diff --git a/include/kernel.h b/include/kernel.h index 51c4eed2848..40661d8d628 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -420,9 +420,8 @@ struct k_stack { _DEBUG_TRACING_KERNEL_OBJECTS_NEXT_PTR(k_stack); }; -extern void k_stack_init(struct k_stack *stack, int num_entries); -extern void k_stack_init_with_buffer(struct k_stack *stack, int num_entries, - uint32_t *buffer); +extern void k_stack_init(struct k_stack *stack, + uint32_t *buffer, int num_entries); extern void k_stack_push(struct k_stack *stack, uint32_t data); extern int k_stack_pop(struct k_stack *stack, uint32_t *data, int32_t timeout); diff --git a/include/legacy.h b/include/legacy.h index 9c493ecda1f..85510b1ceed 100644 --- a/include/legacy.h +++ b/include/legacy.h @@ -630,7 +630,7 @@ static inline void *nano_lifo_get(struct nano_lifo *lifo, static inline void nano_stack_init(struct nano_stack *stack, uint32_t *data) { - k_stack_init_with_buffer(stack, UINT_MAX, data); + k_stack_init(stack, data, UINT_MAX); } #define nano_stack_push k_stack_push diff --git a/kernel/unified/stack.c b/kernel/unified/stack.c index 67ded276ca2..32b5787c2ad 100644 --- a/kernel/unified/stack.c +++ b/kernel/unified/stack.c @@ -27,8 +27,7 @@ #include #include -void k_stack_init_with_buffer(struct k_stack *stack, int num_entries, - uint32_t *buffer) +void k_stack_init(struct k_stack *stack, uint32_t *buffer, int num_entries) { sys_dlist_init(&stack->wait_q); stack->next = stack->base = buffer; @@ -37,11 +36,6 @@ void k_stack_init_with_buffer(struct k_stack *stack, int num_entries, SYS_TRACING_OBJ_INIT(k_stack, stack); } -void k_stack_init(struct k_stack *stack, int num_entries) -{ - k_stack_init_with_buffer(stack, num_entries, (uint32_t *)(stack + 1)); -} - void k_stack_push(struct k_stack *stack, uint32_t data) { struct k_thread *first_pending_thread;