From 8fcc7f69da11ebe7e000288d94893cccee2b5ebb Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Sat, 19 Nov 2016 12:31:53 -0500 Subject: [PATCH] kernel/arch: remove unused uk_task_ptr parameter from _new_thread() Artifact from microkernel, for handling multiple pending tasks on nanokernel objects. Change-Id: I3c2959ea2b87f568736384e6534ce8e275f1098f Signed-off-by: Benjamin Walsh --- arch/arc/core/thread.c | 4 +--- arch/arm/core/thread.c | 4 +--- arch/nios2/core/thread.c | 4 +--- arch/x86/core/thread.c | 8 +++----- kernel/unified/include/nano_internal.h | 1 - kernel/unified/init.c | 4 ++-- kernel/unified/thread.c | 3 +-- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/arch/arc/core/thread.c b/arch/arc/core/thread.c index 196a619f3bc..2156430b471 100644 --- a/arch/arc/core/thread.c +++ b/arch/arc/core/thread.c @@ -85,7 +85,7 @@ static ALWAYS_INLINE void thread_monitor_init(struct k_thread *thread) * @return N/A */ void _new_thread(char *pStackMem, size_t stackSize, - void *uk_task_ptr, _thread_entry_t pEntry, + _thread_entry_t pEntry, void *parameter1, void *parameter2, void *parameter3, int priority, unsigned options) { @@ -147,8 +147,6 @@ void _new_thread(char *pStackMem, size_t stackSize, thread->entry = (struct __thread_entry *)(pInitCtx); #endif - ARG_UNUSED(uk_task_ptr); - /* * intlock_key is constructed based on ARCv2 ISA Programmer's * Reference Manual CLRI instruction description: diff --git a/arch/arm/core/thread.c b/arch/arm/core/thread.c index 2599904d6ac..1eb6e18ffca 100644 --- a/arch/arm/core/thread.c +++ b/arch/arm/core/thread.c @@ -81,7 +81,7 @@ static ALWAYS_INLINE void thread_monitor_init(struct tcs *tcs) */ void _new_thread(char *pStackMem, size_t stackSize, - void *uk_task_ptr, _thread_entry_t pEntry, + _thread_entry_t pEntry, void *parameter1, void *parameter2, void *parameter3, int priority, unsigned options) { @@ -135,8 +135,6 @@ void _new_thread(char *pStackMem, size_t stackSize, tcs->entry = (struct __thread_entry *)(pInitCtx); #endif - ARG_UNUSED(uk_task_ptr); - tcs->callee_saved.psp = (uint32_t)pInitCtx; tcs->arch.basepri = 0; diff --git a/arch/nios2/core/thread.c b/arch/nios2/core/thread.c index 5de3ec8e797..17368f532c6 100644 --- a/arch/nios2/core/thread.c +++ b/arch/nios2/core/thread.c @@ -61,7 +61,7 @@ struct init_stack_frame { void _new_thread(char *stack_memory, size_t stack_size, - void *uk_task_ptr, _thread_entry_t thread_func, + _thread_entry_t thread_func, void *arg1, void *arg2, void *arg3, int priority, unsigned options) { @@ -99,8 +99,6 @@ void _new_thread(char *stack_memory, size_t stack_size, /* Initialize custom data field (value is opaque to kernel) */ thread->custom_data = NULL; #endif - ARG_UNUSED(uk_task_ptr); - thread->callee_saved.sp = (uint32_t)iframe; thread->callee_saved.ra = (uint32_t)_thread_entry_wrapper; thread->callee_saved.key = NIOS2_STATUS_PIE_MSK; diff --git a/arch/x86/core/thread.c b/arch/x86/core/thread.c index 430423135ac..724c5d74ad4 100644 --- a/arch/x86/core/thread.c +++ b/arch/x86/core/thread.c @@ -76,7 +76,7 @@ static ALWAYS_INLINE void thread_monitor_init(struct k_thread *thread) * @return N/A */ static void _new_thread_internal(char *pStackMem, unsigned stackSize, - void *uk_task_ptr, int priority, + int priority, unsigned options) { unsigned long *pInitialCtx; @@ -103,8 +103,6 @@ static void _new_thread_internal(char *pStackMem, unsigned stackSize, thread->custom_data = NULL; #endif - ARG_UNUSED(uk_task_ptr); - /* * The creation of the initial stack for the task has already been done. * Now all that is needed is to set the ESP. However, we have been passed @@ -246,7 +244,7 @@ __asm__("\t.globl _thread_entry\n" * @return opaque pointer to initialized k_thread structure */ void _new_thread(char *pStackMem, size_t stackSize, - void *uk_task_ptr, _thread_entry_t pEntry, + _thread_entry_t pEntry, void *parameter1, void *parameter2, void *parameter3, int priority, unsigned options) { @@ -308,5 +306,5 @@ void _new_thread(char *pStackMem, size_t stackSize, * aside for the thread's stack. */ - _new_thread_internal(pStackMem, stackSize, uk_task_ptr, priority, options); + _new_thread_internal(pStackMem, stackSize, priority, options); } diff --git a/kernel/unified/include/nano_internal.h b/kernel/unified/include/nano_internal.h index 46ae901814b..5396133a3dc 100644 --- a/kernel/unified/include/nano_internal.h +++ b/kernel/unified/include/nano_internal.h @@ -57,7 +57,6 @@ extern void _thread_entry(void (*)(void *, void *, void *), void *, void *, void *); extern void _new_thread(char *pStack, size_t stackSize, - void *uk_task_ptr, void (*pEntry)(void *, void *, void *), void *p1, void *p2, void *p3, int prio, unsigned options); diff --git a/kernel/unified/init.c b/kernel/unified/init.c index 781d625c857..1aece8c6749 100644 --- a/kernel/unified/init.c +++ b/kernel/unified/init.c @@ -277,13 +277,13 @@ static void prepare_multithreading(struct k_thread *dummy_thread) sys_dlist_init(&_ready_q.q[ii]); } - _new_thread(main_stack, MAIN_STACK_SIZE, NULL, + _new_thread(main_stack, MAIN_STACK_SIZE, _main, NULL, NULL, NULL, CONFIG_MAIN_THREAD_PRIORITY, K_ESSENTIAL); _mark_thread_as_started(_main_thread); _add_thread_to_ready_q(_main_thread); - _new_thread(idle_stack, IDLE_STACK_SIZE, NULL, + _new_thread(idle_stack, IDLE_STACK_SIZE, idle, NULL, NULL, NULL, K_LOWEST_THREAD_PRIO, K_ESSENTIAL); _mark_thread_as_started(_idle_thread); diff --git a/kernel/unified/thread.c b/kernel/unified/thread.c index 0ca06e3b1ee..aa94e10427a 100644 --- a/kernel/unified/thread.c +++ b/kernel/unified/thread.c @@ -239,7 +239,7 @@ k_tid_t k_thread_spawn(char *stack, size_t stack_size, struct k_thread *new_thread = (struct k_thread *)stack; - _new_thread(stack, stack_size, NULL, entry, p1, p2, p3, prio, options); + _new_thread(stack, stack_size, entry, p1, p2, p3, prio, options); schedule_new_thread(new_thread, delay); @@ -382,7 +382,6 @@ void _init_static_threads(void) _new_thread( thread_data->init_stack, thread_data->init_stack_size, - NULL, thread_data->init_entry, thread_data->init_p1, thread_data->init_p2,