diff --git a/arch/arc/core/thread.c b/arch/arc/core/thread.c index 84a543aced4..44052e487a2 100644 --- a/arch/arc/core/thread.c +++ b/arch/arc/core/thread.c @@ -59,10 +59,10 @@ struct init_stack_frame { * * @return N/A */ -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - size_t stackSize, k_thread_entry_t pEntry, - void *parameter1, void *parameter2, void *parameter3, - int priority, unsigned int options) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t stackSize, k_thread_entry_t pEntry, + void *parameter1, void *parameter2, void *parameter3, + int priority, unsigned int options) { char *pStackMem = Z_THREAD_STACK_BUFFER(stack); Z_ASSERT_VALID_PRIO(priority, pEntry); diff --git a/arch/arc/core/thread_entry_wrapper.S b/arch/arc/core/thread_entry_wrapper.S index 5660dddf2d1..47b15a87180 100644 --- a/arch/arc/core/thread_entry_wrapper.S +++ b/arch/arc/core/thread_entry_wrapper.S @@ -22,7 +22,7 @@ GTEXT(z_thread_entry_wrapper1) * @brief Wrapper for z_thread_entry * * The routine pops parameters for the z_thread_entry from stack frame, prepared - * by the z_new_thread() routine. + * by the z_arch_new_thread() routine. * * @return N/A */ diff --git a/arch/arm/core/thread.c b/arch/arm/core/thread.c index 42812a62366..7c958ae8fb9 100644 --- a/arch/arm/core/thread.c +++ b/arch/arm/core/thread.c @@ -50,10 +50,10 @@ extern u8_t *z_priv_stack_find(void *obj); * @return N/A */ -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - size_t stackSize, k_thread_entry_t pEntry, - void *parameter1, void *parameter2, void *parameter3, - int priority, unsigned int options) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t stackSize, k_thread_entry_t pEntry, + void *parameter1, void *parameter2, void *parameter3, + int priority, unsigned int options) { char *pStackMem = Z_THREAD_STACK_BUFFER(stack); char *stackEnd; diff --git a/arch/nios2/core/thread.c b/arch/nios2/core/thread.c index 207bc38026f..532107a3686 100644 --- a/arch/nios2/core/thread.c +++ b/arch/nios2/core/thread.c @@ -31,10 +31,10 @@ struct init_stack_frame { }; -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - size_t stack_size, k_thread_entry_t thread_func, - void *arg1, void *arg2, void *arg3, - int priority, unsigned int options) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t stack_size, k_thread_entry_t thread_func, + void *arg1, void *arg2, void *arg3, + int priority, unsigned int options) { char *stack_memory = Z_THREAD_STACK_BUFFER(stack); Z_ASSERT_VALID_PRIO(priority, thread_func); diff --git a/arch/posix/core/posix_core.c b/arch/posix/core/posix_core.c index 0898b0befb6..143ce2b7fd1 100644 --- a/arch/posix/core/posix_core.c +++ b/arch/posix/core/posix_core.c @@ -361,10 +361,10 @@ static int ttable_get_empty_slot(void) } /** - * Called from z_new_thread(), + * Called from z_arch_new_thread(), * Create a new POSIX thread for the new Zephyr thread. - * z_new_thread() picks from the kernel structures what it is that we need to - * call with what parameters + * z_arch_new_thread() picks from the kernel structures what it is that we need + * to call with what parameters */ void posix_new_thread(posix_thread_status_t *ptr) { diff --git a/arch/posix/core/thread.c b/arch/posix/core/thread.c index bfe1368f4d2..2a5f58329c6 100644 --- a/arch/posix/core/thread.c +++ b/arch/posix/core/thread.c @@ -41,10 +41,10 @@ * pthreads stack and therefore we ignore the stack size * */ -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - size_t stack_size, k_thread_entry_t thread_func, - void *arg1, void *arg2, void *arg3, - int priority, unsigned int options) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t stack_size, k_thread_entry_t thread_func, + void *arg1, void *arg2, void *arg3, + int priority, unsigned int options) { char *stack_memory = Z_THREAD_STACK_BUFFER(stack); diff --git a/arch/riscv/core/thread.c b/arch/riscv/core/thread.c index 56ac1b000d0..db5a2977f41 100644 --- a/arch/riscv/core/thread.c +++ b/arch/riscv/core/thread.c @@ -15,10 +15,10 @@ void z_thread_entry_wrapper(k_thread_entry_t thread, void *arg2, void *arg3); -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - size_t stack_size, k_thread_entry_t thread_func, - void *arg1, void *arg2, void *arg3, - int priority, unsigned int options) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t stack_size, k_thread_entry_t thread_func, + void *arg1, void *arg2, void *arg3, + int priority, unsigned int options) { char *stack_memory = Z_THREAD_STACK_BUFFER(stack); Z_ASSERT_VALID_PRIO(priority, thread_func); diff --git a/arch/x86/core/ia32/swap.S b/arch/x86/core/ia32/swap.S index 5c47044d37b..a2a0d4b34cb 100644 --- a/arch/x86/core/ia32/swap.S +++ b/arch/x86/core/ia32/swap.S @@ -382,19 +382,19 @@ time_read_not_needed: * * @brief Adjust stack/parameters before invoking thread entry function * - * This function adjusts the initial stack frame created by z_new_thread() such - * that the GDB stack frame unwinders recognize it as the outermost frame in - * the thread's stack. + * This function adjusts the initial stack frame created by z_arch_new_thread() + * such that the GDB stack frame unwinders recognize it as the outermost frame + * in the thread's stack. * * GDB normally stops unwinding a stack when it detects that it has * reached a function called main(). Kernel threads, however, do not have * a main() function, and there does not appear to be a simple way of stopping * the unwinding of the stack. * - * Given the initial thread created by z_new_thread(), GDB expects to find a - * return address on the stack immediately above the thread entry routine - * z_thread_entry, in the location occupied by the initial EFLAGS. - * GDB attempts to examine the memory at this return address, which typically + * Given the initial thread created by z_arch_new_thread(), GDB expects to find + * a return address on the stack immediately above the thread entry routine + * z_thread_entry, in the location occupied by the initial EFLAGS. GDB + * attempts to examine the memory at this return address, which typically * results in an invalid access to page 0 of memory. * * This function overwrites the initial EFLAGS with zero. When GDB subsequently diff --git a/arch/x86/core/ia32/thread.c b/arch/x86/core/ia32/thread.c index 6277fb1a30a..97e45f83d54 100644 --- a/arch/x86/core/ia32/thread.c +++ b/arch/x86/core/ia32/thread.c @@ -190,10 +190,10 @@ int z_arch_float_disable(struct k_thread *thread) * @param priority thread priority * @param options thread options: K_ESSENTIAL, K_FP_REGS, K_SSE_REGS */ -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - size_t stack_size, k_thread_entry_t entry, - void *parameter1, void *parameter2, void *parameter3, - int priority, unsigned int options) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t stack_size, k_thread_entry_t entry, + void *parameter1, void *parameter2, void *parameter3, + int priority, unsigned int options) { char *stack_buf; char *stack_high; diff --git a/arch/x86/core/intel64/thread.c b/arch/x86/core/intel64/thread.c index 18472421930..29460d51b4f 100644 --- a/arch/x86/core/intel64/thread.c +++ b/arch/x86/core/intel64/thread.c @@ -10,10 +10,10 @@ extern void x86_sse_init(struct k_thread *); /* in locore.S */ -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - size_t stack_size, k_thread_entry_t entry, - void *parameter1, void *parameter2, void *parameter3, - int priority, unsigned int options) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t stack_size, k_thread_entry_t entry, + void *parameter1, void *parameter2, void *parameter3, + int priority, unsigned int options) { Z_ASSERT_VALID_PRIO(priority, entry); z_new_thread_init(thread, Z_THREAD_STACK_BUFFER(stack), diff --git a/arch/x86/include/ia32/kernel_arch_thread.h b/arch/x86/include/ia32/kernel_arch_thread.h index 4c9cd2b7dde..cc42eaa8f22 100644 --- a/arch/x86/include/ia32/kernel_arch_thread.h +++ b/arch/x86/include/ia32/kernel_arch_thread.h @@ -202,7 +202,7 @@ typedef struct s_preempFloatReg { * The thread control structure definition. It contains the * various fields to manage a _single_ thread. The TCS will be aligned * to the appropriate architecture specific boundary via the - * z_new_thread() call. + * z_arch_new_thread() call. */ struct _thread_arch { diff --git a/arch/x86_64/core/x86_64.c b/arch/x86_64/core/x86_64.c index 05829374326..9f193de4101 100644 --- a/arch/x86_64/core/x86_64.c +++ b/arch/x86_64/core/x86_64.c @@ -24,10 +24,10 @@ struct device; struct z_arch_esf_t { }; -void z_new_thread(struct k_thread *t, k_thread_stack_t *stack, - size_t sz, k_thread_entry_t entry, - void *p1, void *p2, void *p3, - int prio, unsigned int opts) +void z_arch_new_thread(struct k_thread *t, k_thread_stack_t *stack, + size_t sz, k_thread_entry_t entry, + void *p1, void *p2, void *p3, + int prio, unsigned int opts) { void *args[] = { entry, p1, p2, p3 }; int nargs = 4; diff --git a/arch/xtensa/core/xtensa-asm2.c b/arch/xtensa/core/xtensa-asm2.c index 17a0f131043..9d64c74c193 100644 --- a/arch/xtensa/core/xtensa-asm2.c +++ b/arch/xtensa/core/xtensa-asm2.c @@ -56,9 +56,10 @@ void *xtensa_init_stack(int *stack_top, return &bsa[-9]; } -void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, size_t sz, - k_thread_entry_t entry, void *p1, void *p2, void *p3, - int prio, unsigned int opts) +void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, + size_t sz, k_thread_entry_t entry, + void *p1, void *p2, void *p3, + int prio, unsigned int opts) { char *base = Z_THREAD_STACK_BUFFER(stack); char *top = base + sz; diff --git a/kernel/include/kernel_internal.h b/kernel/include/kernel_internal.h index a35192071dd..d2b47b7bf75 100644 --- a/kernel/include/kernel_internal.h +++ b/kernel/include/kernel_internal.h @@ -40,10 +40,10 @@ extern FUNC_NORETURN void z_thread_entry(k_thread_entry_t entry, void *p1, void *p2, void *p3); /* Implemented by architectures. Only called from z_setup_new_thread. */ -extern void z_new_thread(struct k_thread *thread, k_thread_stack_t *pStack, - size_t stackSize, k_thread_entry_t entry, - void *p1, void *p2, void *p3, - int prio, unsigned int options); +extern void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *pStack, + size_t stackSize, k_thread_entry_t entry, + void *p1, void *p2, void *p3, + int prio, unsigned int options); extern void z_setup_new_thread(struct k_thread *new_thread, k_thread_stack_t *stack, size_t stack_size, @@ -181,7 +181,7 @@ extern int z_arch_buffer_validate(void *addr, size_t size, int write); * - Set up any kernel stack region for the CPU to use during privilege * elevation * - Put the CPU in whatever its equivalent of user mode is - * - Transfer execution to z_new_thread() passing along all the supplied + * - Transfer execution to z_arch_new_thread() passing along all the supplied * arguments, in user mode. * * @param Entry point to start executing as a user thread diff --git a/kernel/thread.c b/kernel/thread.c index b6b8a70969c..4fb9ae28d35 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -412,8 +412,8 @@ static inline size_t adjust_stack_size(size_t stack_size) random_val = sys_rand32_get(); } - /* Don't need to worry about alignment of the size here, z_new_thread() - * is required to do it + /* Don't need to worry about alignment of the size here, + * z_arch_new_thread() is required to do it. * * FIXME: Not the best way to get a random number in a range. * See #6493 @@ -462,12 +462,12 @@ void z_setup_new_thread(struct k_thread *new_thread, #endif #endif - z_new_thread(new_thread, stack, stack_size, entry, p1, p2, p3, - prio, options); + z_arch_new_thread(new_thread, stack, stack_size, entry, p1, p2, p3, + prio, options); #ifdef CONFIG_THREAD_USERSPACE_LOCAL_DATA #ifndef CONFIG_THREAD_USERSPACE_LOCAL_DATA_ARCH_DEFER_SETUP - /* don't set again if the arch's own code in z_new_thread() has + /* don't set again if the arch's own code in z_arch_new_thread() has * already set the pointer. */ new_thread->userspace_local_data =