summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-02 19:04:44 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-02 19:04:44 +0000
commitf5d629b65b9588ddae1333f06aa392083c284949 (patch)
tree01e8e16f655b7738037330adbef3120df72bfb3f /nuttx/sched
parentc3e496ad6e836db85c8c8fa7118aa9ed8b99ded3 (diff)
downloadpx4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.tar.gz
px4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.tar.bz2
px4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.zip
Add SAM3U kernel build logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3456 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/os_bringup.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/nuttx/sched/os_bringup.c b/nuttx/sched/os_bringup.c
index 7ef7f5f6d..84971ad6c 100644
--- a/nuttx/sched/os_bringup.c
+++ b/nuttx/sched/os_bringup.c
@@ -57,11 +57,25 @@
#ifdef CONFIG_BUILTIN_APP_START
# include "apps/apps.h"
#endif
+#ifdef CONFIG_NUTTX_KERNEL
+# include "arch/board/user_map.h"
+#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+/* If NuttX is built as a separately compiled module, then the the header
+ * file should contain the address of the user module entry point. If not
+ * then the default entry point is user_start.
+ */
+
+#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_USER_ENTRYPOINT)
+# define USER_ENTRYPOINT (main_t)CONFIG_USER_ENTRYPOINT
+#else
+# define USER_ENTRYPOINT user_start
+#endif
+
/****************************************************************************
* Private Types
****************************************************************************/
@@ -104,8 +118,8 @@
* And the main application entry point. This may be one of two different
* symbols:
*
- * - user_start: This is the default entry point used for all of the
- * examples.
+ * - USER_ENTRYPOINT: This is the default entry point used for all of the
+ * example code in apps/examples.
* - CONFIG_BUILTIN_APP_START: The system can also be configured to start
* custom applications at however CONFIG_BUILTIN_APP_START
* is defined in the NuttX start-up file.
@@ -157,11 +171,11 @@ int os_bringup(void)
init_taskid = exec_namedapp(CONFIG_BUILTIN_APP_START, argv);
#else
- /* Start the default application at user_start() */
+ /* Start the default application at USER_ENTRYPOINT() */
init_taskid = TASK_CREATE("init", SCHED_PRIORITY_DEFAULT,
CONFIG_USERMAIN_STACKSIZE,
- (main_t)user_start, (const char **)NULL);
+ (main_t)USER_ENTRYPOINT, (const char **)NULL);
#endif
ASSERT(init_taskid != ERROR);
return OK;