kernel: rename z_new_thread()
This is part of the core kernel -> architecture interface and should have a leading prefix z_arch_. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
9e1dda8804
commit
61901ccb4c
15 changed files with 58 additions and 57 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue