arches: fix arch_new_thread param names
MISRA-C wants the parameter names in a function implementaion to match the names used by the header prototype. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
aa464052ff
commit
24825c8667
9 changed files with 58 additions and 60 deletions
|
@ -39,8 +39,8 @@ struct init_stack_frame {
|
|||
* and status register.
|
||||
*/
|
||||
void 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)
|
||||
size_t stack_size, k_thread_entry_t entry,
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
char *pStackMem = Z_THREAD_STACK_BUFFER(stack);
|
||||
|
||||
|
@ -54,13 +54,11 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
size_t offset = 0;
|
||||
bool is_user = (thread->base.user_options & K_USER) != 0;
|
||||
|
||||
|
||||
stackAdjSize = Z_ARC_MPU_SIZE_ALIGN(stackSize);
|
||||
|
||||
stackAdjSize = Z_ARC_MPU_SIZE_ALIGN(stack_size);
|
||||
stackEnd = pStackMem + stackAdjSize;
|
||||
|
||||
#ifdef CONFIG_STACK_POINTER_RANDOM
|
||||
offset = stackAdjSize - stackSize;
|
||||
offset = stackAdjSize - stack_size;
|
||||
#endif
|
||||
|
||||
if (is_user) {
|
||||
|
@ -134,9 +132,9 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
pInitCtx->status32 |= _ARC_V2_STATUS32_US;
|
||||
#else /* For no USERSPACE feature */
|
||||
pStackMem += STACK_GUARD_SIZE;
|
||||
stackEnd = pStackMem + stackSize;
|
||||
stackEnd = pStackMem + stack_size;
|
||||
|
||||
z_new_thread_init(thread, pStackMem, stackSize);
|
||||
z_new_thread_init(thread, pStackMem, stack_size);
|
||||
|
||||
priv_stack_end = stackEnd;
|
||||
|
||||
|
@ -152,10 +150,10 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
pInitCtx->sec_stat = z_arc_v2_aux_reg_read(_ARC_V2_SEC_STAT);
|
||||
#endif
|
||||
|
||||
pInitCtx->r0 = (uint32_t)pEntry;
|
||||
pInitCtx->r1 = (uint32_t)parameter1;
|
||||
pInitCtx->r2 = (uint32_t)parameter2;
|
||||
pInitCtx->r3 = (uint32_t)parameter3;
|
||||
pInitCtx->r0 = (uint32_t)entry;
|
||||
pInitCtx->r1 = (uint32_t)p1;
|
||||
pInitCtx->r2 = (uint32_t)p2;
|
||||
pInitCtx->r3 = (uint32_t)p3;
|
||||
|
||||
/* stack check configuration */
|
||||
#ifdef CONFIG_ARC_STACK_CHECKING
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
* of the ESF.
|
||||
*/
|
||||
void 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)
|
||||
size_t stack_size, k_thread_entry_t entry,
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
char *pStackMem = Z_THREAD_STACK_BUFFER(stack);
|
||||
char *stackEnd;
|
||||
|
@ -53,11 +53,11 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
* switches to user mode (thus, its stack area will need to be MPU-
|
||||
* programmed to be assigned unprivileged RW access permission).
|
||||
*/
|
||||
stackSize &= ~(CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE - 1);
|
||||
stack_size &= ~(CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE - 1);
|
||||
|
||||
#ifdef CONFIG_THREAD_USERSPACE_LOCAL_DATA
|
||||
/* Reserve space on top of stack for local data. */
|
||||
uint32_t p_local_data = Z_STACK_PTR_ALIGN(pStackMem + stackSize
|
||||
uint32_t p_local_data = Z_STACK_PTR_ALIGN(pStackMem + stack_size
|
||||
- sizeof(*thread->userspace_local_data));
|
||||
|
||||
thread->userspace_local_data =
|
||||
|
@ -65,7 +65,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
|
||||
/* Top of actual stack must be moved below the user local data. */
|
||||
top_of_stack_offset = (uint32_t)
|
||||
(pStackMem + stackSize - ((char *)p_local_data));
|
||||
(pStackMem + stack_size - ((char *)p_local_data));
|
||||
|
||||
#endif /* CONFIG_THREAD_USERSPACE_LOCAL_DATA */
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
|
@ -83,15 +83,15 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
if ((thread->base.user_options & K_FP_REGS) != 0) {
|
||||
pStackMem += MPU_GUARD_ALIGN_AND_SIZE_FLOAT
|
||||
- MPU_GUARD_ALIGN_AND_SIZE;
|
||||
stackSize -= MPU_GUARD_ALIGN_AND_SIZE_FLOAT
|
||||
stack_size -= MPU_GUARD_ALIGN_AND_SIZE_FLOAT
|
||||
- MPU_GUARD_ALIGN_AND_SIZE;
|
||||
}
|
||||
#endif
|
||||
stackEnd = pStackMem + stackSize;
|
||||
stackEnd = pStackMem + stack_size;
|
||||
|
||||
struct __esf *pInitCtx;
|
||||
|
||||
z_new_thread_init(thread, pStackMem, stackSize);
|
||||
z_new_thread_init(thread, pStackMem, stack_size);
|
||||
|
||||
/* Carve the thread entry struct from the "base" of the stack
|
||||
*
|
||||
|
@ -117,10 +117,10 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
pInitCtx->basic.pc &= 0xfffffffe;
|
||||
#endif
|
||||
|
||||
pInitCtx->basic.a1 = (uint32_t)pEntry;
|
||||
pInitCtx->basic.a2 = (uint32_t)parameter1;
|
||||
pInitCtx->basic.a3 = (uint32_t)parameter2;
|
||||
pInitCtx->basic.a4 = (uint32_t)parameter3;
|
||||
pInitCtx->basic.a1 = (uint32_t)entry;
|
||||
pInitCtx->basic.a2 = (uint32_t)p1;
|
||||
pInitCtx->basic.a3 = (uint32_t)p2;
|
||||
pInitCtx->basic.a4 = (uint32_t)p3;
|
||||
|
||||
#if defined(CONFIG_CPU_CORTEX_M)
|
||||
pInitCtx->basic.xpsr =
|
||||
|
|
|
@ -44,29 +44,29 @@ struct init_stack_frame {
|
|||
* anymore.
|
||||
*/
|
||||
void 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)
|
||||
size_t stack_size, k_thread_entry_t entry,
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
char *pStackMem = Z_THREAD_STACK_BUFFER(stack);
|
||||
char *stackEnd;
|
||||
struct init_stack_frame *pInitCtx;
|
||||
|
||||
stackEnd = pStackMem + stackSize;
|
||||
stackEnd = pStackMem + stack_size;
|
||||
|
||||
z_new_thread_init(thread, pStackMem, stackSize);
|
||||
z_new_thread_init(thread, pStackMem, stack_size);
|
||||
|
||||
pInitCtx = (struct init_stack_frame *)(Z_STACK_PTR_ALIGN(stackEnd -
|
||||
sizeof(struct init_stack_frame)));
|
||||
|
||||
pInitCtx->entry_point = (uint64_t)pEntry;
|
||||
pInitCtx->arg1 = (uint64_t)parameter1;
|
||||
pInitCtx->arg2 = (uint64_t)parameter2;
|
||||
pInitCtx->arg3 = (uint64_t)parameter3;
|
||||
pInitCtx->entry_point = (uint64_t)entry;
|
||||
pInitCtx->arg1 = (uint64_t)p1;
|
||||
pInitCtx->arg2 = (uint64_t)p2;
|
||||
pInitCtx->arg3 = (uint64_t)p3;
|
||||
|
||||
/*
|
||||
* - ELR_ELn: to be used by eret in z_thread_entry_wrapper() to return
|
||||
* to z_thread_entry() with pEntry in x0(entry_point) and the parameters
|
||||
* already in place in x1(arg1), x2(arg2), x3(arg3).
|
||||
* to z_thread_entry() with entry in x0(entry_point) and the
|
||||
* parameters already in place in x1(arg1), x2(arg2), x3(arg3).
|
||||
* - SPSR_ELn: to enable IRQs (we are masking debug exceptions, SError
|
||||
* interrupts and FIQs).
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
/*
|
||||
* We are saving:
|
||||
*
|
||||
* - SP: to pop out pEntry and parameters when going through
|
||||
* - SP: to pop out entry and parameters when going through
|
||||
* z_thread_entry_wrapper().
|
||||
* - x30: to be used by ret in z_arm64_context_switch() when the new
|
||||
* task is first scheduled.
|
||||
|
|
|
@ -29,7 +29,7 @@ struct init_stack_frame {
|
|||
|
||||
|
||||
void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
||||
size_t stack_size, k_thread_entry_t thread_func,
|
||||
size_t stack_size, k_thread_entry_t entry,
|
||||
void *arg1, void *arg2, void *arg3)
|
||||
{
|
||||
char *stack_memory = Z_THREAD_STACK_BUFFER(stack);
|
||||
|
@ -42,7 +42,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
Z_STACK_PTR_ALIGN(stack_memory + stack_size - sizeof(*iframe));
|
||||
|
||||
/* Setup the initial stack frame */
|
||||
iframe->entry_point = thread_func;
|
||||
iframe->entry_point = entry;
|
||||
iframe->arg1 = arg1;
|
||||
iframe->arg2 = arg2;
|
||||
iframe->arg3 = arg3;
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
* pthreads stack and therefore we ignore the stack size
|
||||
*/
|
||||
void 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)
|
||||
size_t stack_size, k_thread_entry_t entry,
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
|
||||
char *stack_memory = Z_THREAD_STACK_BUFFER(stack);
|
||||
|
@ -43,10 +43,10 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
- sizeof(*thread_status));
|
||||
|
||||
/* z_thread_entry() arguments */
|
||||
thread_status->entry_point = thread_func;
|
||||
thread_status->arg1 = arg1;
|
||||
thread_status->arg2 = arg2;
|
||||
thread_status->arg3 = arg3;
|
||||
thread_status->entry_point = entry;
|
||||
thread_status->arg1 = p1;
|
||||
thread_status->arg2 = p2;
|
||||
thread_status->arg3 = p3;
|
||||
#if defined(CONFIG_ARCH_HAS_THREAD_ABORT)
|
||||
thread_status->aborted = 0;
|
||||
#endif
|
||||
|
|
|
@ -13,8 +13,8 @@ void z_thread_entry_wrapper(k_thread_entry_t thread,
|
|||
void *arg3);
|
||||
|
||||
void 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)
|
||||
size_t stack_size, k_thread_entry_t entry,
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
char *stack_memory = Z_THREAD_STACK_BUFFER(stack);
|
||||
|
||||
|
@ -32,10 +32,10 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
stack_size - sizeof(struct __esf));
|
||||
|
||||
/* Setup the initial stack frame */
|
||||
stack_init->a0 = (ulong_t)thread_func;
|
||||
stack_init->a1 = (ulong_t)arg1;
|
||||
stack_init->a2 = (ulong_t)arg2;
|
||||
stack_init->a3 = (ulong_t)arg3;
|
||||
stack_init->a0 = (ulong_t)entry;
|
||||
stack_init->a1 = (ulong_t)p1;
|
||||
stack_init->a2 = (ulong_t)p2;
|
||||
stack_init->a3 = (ulong_t)p3;
|
||||
/*
|
||||
* Following the RISC-V architecture,
|
||||
* the MSTATUS register (used to globally enable/disable interrupt),
|
||||
|
|
|
@ -62,7 +62,7 @@ int arch_float_disable(struct k_thread *thread)
|
|||
|
||||
void 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)
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
char *stack_buf;
|
||||
char *stack_high;
|
||||
|
@ -95,9 +95,9 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
(stack_high - sizeof(struct _x86_initial_frame));
|
||||
/* z_thread_entry() arguments */
|
||||
initial_frame->entry = entry;
|
||||
initial_frame->p1 = parameter1;
|
||||
initial_frame->p2 = parameter2;
|
||||
initial_frame->p3 = parameter3;
|
||||
initial_frame->p1 = p1;
|
||||
initial_frame->p2 = p2;
|
||||
initial_frame->p3 = p3;
|
||||
initial_frame->eflags = EFLAGS_INITIAL;
|
||||
#ifdef _THREAD_WRAPPER_REQUIRED
|
||||
initial_frame->edi = (uint32_t)swap_entry;
|
||||
|
|
|
@ -13,7 +13,7 @@ extern void x86_sse_init(struct k_thread *); /* in locore.S */
|
|||
|
||||
void 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)
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
void *switch_entry;
|
||||
|
||||
|
@ -44,9 +44,9 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
* thread->callee_saved.rip
|
||||
*/
|
||||
thread->arch.rdi = (long) entry;
|
||||
thread->arch.rsi = (long) parameter1;
|
||||
thread->arch.rdx = (long) parameter2;
|
||||
thread->arch.rcx = (long) parameter3;
|
||||
thread->arch.rsi = (long) p1;
|
||||
thread->arch.rdx = (long) p2;
|
||||
thread->arch.rcx = (long) p3;
|
||||
|
||||
x86_sse_init(thread);
|
||||
|
||||
|
|
|
@ -57,16 +57,16 @@ void *xtensa_init_stack(int *stack_top,
|
|||
}
|
||||
|
||||
void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
||||
size_t sz, k_thread_entry_t entry,
|
||||
size_t stack_size, k_thread_entry_t entry,
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
char *base = Z_THREAD_STACK_BUFFER(stack);
|
||||
char *top = base + sz;
|
||||
char *top = base + stack_size;
|
||||
|
||||
/* Align downward. The API as specified requires a runtime check. */
|
||||
top = (char *)(((unsigned int)top) & ~3);
|
||||
|
||||
z_new_thread_init(thread, base, sz);
|
||||
z_new_thread_init(thread, base, stack_size);
|
||||
|
||||
thread->switch_handle = xtensa_init_stack((void *)top, entry,
|
||||
p1, p2, p3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue