diff options
author | px4dev <px4@purgatory.org> | 2012-09-02 12:17:16 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-09-02 12:17:16 -0700 |
commit | 6576edb47e9d0e032a89f01d9fb071871d53b553 (patch) | |
tree | 452c0de8053abec11bfc102a3480c666adb6282b /nuttx/sched | |
parent | 8aa41f7d34c6b6cddc59ba9d5ed1567044e66e46 (diff) | |
parent | 1349b00b418de388310c6658fd799a9049ddd38b (diff) | |
download | px4-firmware-6576edb47e9d0e032a89f01d9fb071871d53b553.tar.gz px4-firmware-6576edb47e9d0e032a89f01d9fb071871d53b553.tar.bz2 px4-firmware-6576edb47e9d0e032a89f01d9fb071871d53b553.zip |
Merge with trunk NuttX
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5079 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/Kconfig | 8 | ||||
-rw-r--r-- | nuttx/sched/os_bringup.c | 10 | ||||
-rw-r--r-- | nuttx/sched/sem_holder.c | 5 | ||||
-rw-r--r-- | nuttx/sched/work_cancel.c | 12 |
4 files changed, 22 insertions, 13 deletions
diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index 9d7a38549..37ce0ebd6 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -202,6 +202,14 @@ config SCHED_ONEXIT_MAX is supported. That number can be increased by defined this setting to the number that you require. +config USER_ENTRYPOINT + string "Appliation entry point" + default "user_start" + ---help--- + The name of the entry point for user applications. For the example + applications this is of the form 'app_main' where 'app' is the application + name. If not defined, USER_ENTRYPOINT defaults to "user_start." + config DISABLE_OS_API bool "Disable NuttX interfaces" default y diff --git a/nuttx/sched/os_bringup.c b/nuttx/sched/os_bringup.c index 646f49158..d6d943137 100644 --- a/nuttx/sched/os_bringup.c +++ b/nuttx/sched/os_bringup.c @@ -71,12 +71,6 @@ * 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 ****************************************************************************/ @@ -175,11 +169,11 @@ int os_bringup(void) init_taskid = exec_namedapp(CONFIG_BUILTIN_APP_START, argv); #else - /* Start the default application at USER_ENTRYPOINT() */ + /* Start the default application at CONFIG_USER_ENTRYPOINT() */ init_taskid = TASK_CREATE("init", SCHED_PRIORITY_DEFAULT, CONFIG_USERMAIN_STACKSIZE, - (main_t)USER_ENTRYPOINT, (const char **)NULL); + (main_t)CONFIG_USER_ENTRYPOINT, (const char **)NULL); #endif ASSERT(init_taskid != ERROR); return OK; diff --git a/nuttx/sched/sem_holder.c b/nuttx/sched/sem_holder.c index 704ebd194..1bae37746 100644 --- a/nuttx/sched/sem_holder.c +++ b/nuttx/sched/sem_holder.c @@ -948,10 +948,11 @@ void sem_restorebaseprio(FAR _TCB *stcb, FAR sem_t *sem) (sem->semcount <= 0 && stcb != NULL)); /* Handler semaphore counts posed from an interrupt handler differently - * from interrupts posted from threads. The priority difference is that + * from interrupts posted from threads. The primary difference is that * if the semaphore is posted from a thread, then the poster thread is * a player in the priority inheritance scheme. The interrupt handler - * externally injects the new count without participated itself. + * externally injects the new count without otherwise participating + * itself. */ if (up_interrupt_context()) diff --git a/nuttx/sched/work_cancel.c b/nuttx/sched/work_cancel.c index 75a6cbc7d..30b650826 100644 --- a/nuttx/sched/work_cancel.c +++ b/nuttx/sched/work_cancel.c @@ -104,10 +104,16 @@ int work_cancel(struct work_s *work) flags = irqsave(); if (work->worker != NULL) { - DEBUGASSERT(work->dq.blink || (FAR dq_entry_t *)work == g_work.head); - DEBUGASSERT(work->dq.flink || (FAR dq_entry_t *)work == g_work.tail); - dq_rem((FAR dq_entry_t *)work, &g_work); + /* A little test of the integrity of the work queue */ + + DEBUGASSERT(work->dq.flink ||(FAR dq_entry_t *)work == g_work.tail); + DEBUGASSERT(work->dq.blink ||(FAR dq_entry_t *)work == g_work.head); + /* Remove the entry from the work queue and make sure that it is + * mark as availalbe (i.e., the worker field is nullified). + */ + + dq_rem((FAR dq_entry_t *)work, &g_work); work->worker = NULL; } |