diff options
Diffstat (limited to 'nuttx/sched/task')
-rw-r--r-- | nuttx/sched/task/task_create.c | 25 | ||||
-rw-r--r-- | nuttx/sched/task/task_init.c | 7 | ||||
-rw-r--r-- | nuttx/sched/task/task_posixspawn.c | 2 | ||||
-rw-r--r-- | nuttx/sched/task/task_setup.c | 15 | ||||
-rw-r--r-- | nuttx/sched/task/task_spawn.c | 6 |
5 files changed, 10 insertions, 45 deletions
diff --git a/nuttx/sched/task/task_create.c b/nuttx/sched/task/task_create.c index ca0ed892f..4e7d656f7 100644 --- a/nuttx/sched/task/task_create.c +++ b/nuttx/sched/task/task_create.c @@ -100,13 +100,8 @@ * ****************************************************************************/ -#ifndef CONFIG_CUSTOM_STACK static int thread_create(FAR const char *name, uint8_t ttype, int priority, int stack_size, main_t entry, FAR char * const argv[]) -#else -static int thread_create(FAR const char *name, uint8_t ttype, int priority, - main_t entry, FAR char * const argv[]) -#endif { FAR struct task_tcb_s *tcb; pid_t pid; @@ -147,14 +142,12 @@ static int thread_create(FAR const char *name, uint8_t ttype, int priority, /* Allocate the stack for the TCB */ -#ifndef CONFIG_CUSTOM_STACK ret = up_create_stack((FAR struct tcb_s *)tcb, stack_size, ttype); if (ret < OK) { errcode = -ret; goto errout_with_tcb; } -#endif /* Initialize the task control block */ @@ -245,19 +238,10 @@ errout: * ****************************************************************************/ -#ifndef CONFIG_CUSTOM_STACK int task_create(FAR const char *name, int priority, int stack_size, main_t entry, FAR char * const argv[]) -#else -int task_create(FAR const char *name, int priority, - main_t entry, FAR char * const argv[]) -#endif { -#ifndef CONFIG_CUSTOM_STACK return thread_create(name, TCB_FLAG_TTYPE_TASK, priority, stack_size, entry, argv); -#else - return thread_create(name, TCB_FLAG_TTYPE_TASK, priority, entry, argv); -#endif } /**************************************************************************** @@ -276,18 +260,9 @@ int task_create(FAR const char *name, int priority, * ****************************************************************************/ -#ifndef CONFIG_CUSTOM_STACK int kernel_thread(FAR const char *name, int priority, int stack_size, main_t entry, FAR char * const argv[]) -#else -int kernel_thread(FAR const char *name, int priority, - main_t entry, FAR char * const argv[]) -#endif { -#ifndef CONFIG_CUSTOM_STACK return thread_create(name, TCB_FLAG_TTYPE_KERNEL, priority, stack_size, entry, argv); -#else - return thread_create(name, TCB_FLAG_TTYPE_KERNEL, priority, entry, argv); -#endif } diff --git a/nuttx/sched/task/task_init.c b/nuttx/sched/task/task_init.c index f1fa91edf..6ad31e7f2 100644 --- a/nuttx/sched/task/task_init.c +++ b/nuttx/sched/task/task_init.c @@ -112,14 +112,9 @@ * ****************************************************************************/ -#ifndef CONFIG_CUSTOM_STACK int task_init(FAR struct tcb_s *tcb, const char *name, int priority, FAR uint32_t *stack, uint32_t stack_size, main_t entry, FAR char * const argv[]) -#else -int task_init(FAR struct tcb_s *tcb, const char *name, int priority, - main_t entry, FAR char * const argv[]) -#endif { FAR struct task_tcb_s *ttcb = (FAR struct task_tcb_s *)tcb; int errcode; @@ -156,9 +151,7 @@ int task_init(FAR struct tcb_s *tcb, const char *name, int priority, /* Configure the user provided stack region */ -#ifndef CONFIG_CUSTOM_STACK up_use_stack(tcb, stack, stack_size); -#endif /* Initialize the task control block */ diff --git a/nuttx/sched/task/task_posixspawn.c b/nuttx/sched/task/task_posixspawn.c index 5a831b95a..87d868093 100644 --- a/nuttx/sched/task/task_posixspawn.c +++ b/nuttx/sched/task/task_posixspawn.c @@ -424,7 +424,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path, * task. */ - proxy = TASK_CREATE("posix_spawn_proxy", param.sched_priority, + proxy = task_create("posix_spawn_proxy", param.sched_priority, CONFIG_POSIX_SPAWN_PROXY_STACKSIZE, (main_t)posix_spawn_proxy, (FAR char * const *)NULL); diff --git a/nuttx/sched/task/task_setup.c b/nuttx/sched/task/task_setup.c index a0eaa9af6..9ef1b0d39 100644 --- a/nuttx/sched/task/task_setup.c +++ b/nuttx/sched/task/task_setup.c @@ -448,8 +448,7 @@ static void task_namesetup(FAR struct task_tcb_s *tcb, FAR const char *name) * ****************************************************************************/ -#if defined(CONFIG_CUSTOM_STACK) || (!defined(CONFIG_BUILD_PROTECTED) && \ - !defined(CONFIG_BUILD_KERNEL)) +#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL) static int task_tcbargsetup(FAR struct task_tcb_s *tcb, FAR char * const argv[]) { @@ -489,7 +488,7 @@ static int task_tcbargsetup(FAR struct task_tcb_s *tcb, return OK; } -#endif /* CONFIG_CUSTOM_STACK || (!CONFIG_BUILD_PROTECTED && !CONFIG_BUILD_KERNEL) */ +#endif /* !CONFIG_BUILD_PROTECTED && !CONFIG_BUILD_KERNEL */ /**************************************************************************** * Name: task_stackargsetup @@ -516,8 +515,7 @@ static int task_tcbargsetup(FAR struct task_tcb_s *tcb, * ****************************************************************************/ -#if !defined(CONFIG_CUSTOM_STACK) && (defined(CONFIG_BUILD_PROTECTED) || \ - defined(CONFIG_BUILD_KERNEL)) +#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL) static int task_stackargsetup(FAR struct task_tcb_s *tcb, FAR char * const argv[]) { @@ -619,7 +617,7 @@ static int task_stackargsetup(FAR struct task_tcb_s *tcb, return OK; } -#endif /* !CONFIG_CUSTOM_STACK && (CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL) */ +#endif /* CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL */ /**************************************************************************** * Public Functions @@ -744,8 +742,7 @@ int task_argsetup(FAR struct task_tcb_s *tcb, FAR const char *name, task_namesetup(tcb, name); -#if !defined(CONFIG_CUSTOM_STACK) && (defined(CONFIG_BUILD_PROTECTED) || \ - defined(CONFIG_BUILD_KERNEL)) +#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL) /* In the kernel build case, the argv[] array and all strings are copied * to the task's stack. This is done because the TCB (and kernel allocated * strings) are only accessible in kernel-mode. Data on the stack, on the @@ -762,7 +759,7 @@ int task_argsetup(FAR struct task_tcb_s *tcb, FAR const char *name, ret = task_tcbargsetup(tcb, argv); -#endif /* !CONFIG_CUSTOM_STACK && (CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL) */ +#endif /* CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL */ return ret; } diff --git a/nuttx/sched/task/task_spawn.c b/nuttx/sched/task/task_spawn.c index 2f556120f..2b09e63bb 100644 --- a/nuttx/sched/task/task_spawn.c +++ b/nuttx/sched/task/task_spawn.c @@ -149,11 +149,11 @@ static int task_spawn_exec(FAR pid_t *pidp, FAR const char *name, /* Start the task */ - pid = TASK_CREATE(name, priority, stacksize, entry, argv); + pid = task_create(name, priority, stacksize, entry, argv); if (pid < 0) { ret = get_errno(); - sdbg("ERROR: TASK_CREATE failed: %d\n", ret); + sdbg("ERROR: task_create failed: %d\n", ret); goto errout; } @@ -416,7 +416,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, * task. */ - proxy = TASK_CREATE("task_spawn_proxy", param.sched_priority, + proxy = task_create("task_spawn_proxy", param.sched_priority, CONFIG_POSIX_SPAWN_PROXY_STACKSIZE, (main_t)task_spawn_proxy, (FAR char * const*)NULL); |