summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-11 20:26:55 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-11 20:26:55 +0000
commit569561d0b8bbf208837ed267a59b5c8152b278d7 (patch)
treea811a5b1a1418ff45417d02863d5fcc2ffaa8b25 /nuttx/sched
parent3578c60ae17a31fef6486ba5c3a2f97b899fb243 (diff)
downloadpx4-nuttx-569561d0b8bbf208837ed267a59b5c8152b278d7.tar.gz
px4-nuttx-569561d0b8bbf208837ed267a59b5c8152b278d7.tar.bz2
px4-nuttx-569561d0b8bbf208837ed267a59b5c8152b278d7.zip
Reorganize some AT91SAM3U files; Add an NSH kernel build configuration to the WaveSahhare Open1788 board
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5732 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/group_leave.c4
-rw-r--r--nuttx/sched/group_setupstreams.c4
-rw-r--r--nuttx/sched/os_bringup.c9
-rw-r--r--nuttx/sched/os_start.c6
-rw-r--r--nuttx/sched/sched_getstreams.c5
-rw-r--r--nuttx/sched/task_exithook.c4
6 files changed, 26 insertions, 6 deletions
diff --git a/nuttx/sched/group_leave.c b/nuttx/sched/group_leave.c
index c6a546928..5f3c684ca 100644
--- a/nuttx/sched/group_leave.c
+++ b/nuttx/sched/group_leave.c
@@ -181,7 +181,11 @@ static inline void group_release(FAR struct task_group_s *group)
#if CONFIG_NFILE_STREAMS > 0
/* Free resource held by the stream list */
+#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP)
lib_releaselist(&group->tg_streamlist);
+#else
+ lib_releaselist(&group->tg_streamlist);
+#endif
#endif /* CONFIG_NFILE_STREAMS */
#endif /* CONFIG_NFILE_DESCRIPTORS */
diff --git a/nuttx/sched/group_setupstreams.c b/nuttx/sched/group_setupstreams.c
index 4a9fa5762..0f0bfd083 100644
--- a/nuttx/sched/group_setupstreams.c
+++ b/nuttx/sched/group_setupstreams.c
@@ -78,7 +78,11 @@ int group_setupstreams(FAR struct task_tcb_s *tcb)
/* Initialize file streams for the task group */
+#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP)
+ lib_streaminit(tcb->cmn.group->tg_streamlist);
+#else
lib_streaminit(&tcb->cmn.group->tg_streamlist);
+#endif
/* fdopen to get the stdin, stdout and stderr streams. The following logic
* depends on the fact that the library layer will allocate FILEs in order.
diff --git a/nuttx/sched/os_bringup.c b/nuttx/sched/os_bringup.c
index 29bd1c17e..4ef493409 100644
--- a/nuttx/sched/os_bringup.c
+++ b/nuttx/sched/os_bringup.c
@@ -47,6 +47,7 @@
#include <stdlib.h>
#include <debug.h>
+#include <nuttx/arch.h>
#include <nuttx/init.h>
#include <nuttx/wqueue.h>
#include <nuttx/userspace.h>
@@ -206,6 +207,14 @@ int os_bringup(void)
svdbg("Starting init thread\n");
+ /* Perform any last-minute, board-specific initialization, if so
+ * configured.
+ */
+
+#ifdef CONFIG_BOARD_INITIALIZE
+ board_initialize();
+#endif
+
/* Start the default application. In a flat build, this is entrypoint
* is given by the definitions, CONFIG_USER_ENTRYPOINT. In the kernel
* build, however, we must get the address of the entrypoint from the
diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c
index e76f3c14b..b7c8bb15c 100644
--- a/nuttx/sched/os_start.c
+++ b/nuttx/sched/os_start.c
@@ -451,12 +451,6 @@ void os_start(void)
up_initialize();
- /* Perform any special board-specific initialization, if so configured. */
-
-#ifdef CONFIG_BOARD_INITIALIZE
- board_initialize();
-#endif
-
/* Initialize the C libraries (if included in the link). This
* is done last because the libraries may depend on the above.
*/
diff --git a/nuttx/sched/sched_getstreams.c b/nuttx/sched/sched_getstreams.c
index 2e0dfecfc..9f0820a48 100644
--- a/nuttx/sched/sched_getstreams.c
+++ b/nuttx/sched/sched_getstreams.c
@@ -73,7 +73,12 @@ FAR struct streamlist *sched_getstreams(void)
FAR struct task_group_s *group = rtcb->group;
DEBUGASSERT(group);
+
+#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP)
+ return group->tg_streamlist;
+#else
return &group->tg_streamlist;
+#endif
}
#endif /* CONFIG_NFILE_DESCRIPTORS && CONFIG_NFILE_STREAMS */
diff --git a/nuttx/sched/task_exithook.c b/nuttx/sched/task_exithook.c
index 0c1c99929..3a03e0e77 100644
--- a/nuttx/sched/task_exithook.c
+++ b/nuttx/sched/task_exithook.c
@@ -609,8 +609,12 @@ void task_exithook(FAR struct tcb_s *tcb, int status)
*/
#if CONFIG_NFILE_STREAMS > 0
+#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP)
+ (void)lib_flushall(tcb->group->tg_streamlist);
+#else
(void)lib_flushall(&tcb->group->tg_streamlist);
#endif
+#endif
/* Leave the task group. Perhaps discarding any un-reaped child
* status (no zombies here!)