mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
arch: rename STACK_ALIGNMENT to STACKFRAME_ALIGN across all architectures
Rename STACK_ALIGNMENT macro to STACKFRAME_ALIGN throughout the codebase to provide clearer naming semantics. The new name better reflects the macro's purpose of frame alignment rather than general stack alignment. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
* however, the stack must be aligned to 8-byte addresses.
|
||||
*/
|
||||
|
||||
#define STACK_ALIGNMENT 8
|
||||
#define STACKFRAME_ALIGN 8
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
|
||||
@@ -101,8 +101,8 @@ size_t sparc_stack_check(void *stackbase, size_t nbytes)
|
||||
|
||||
/* Take extra care that we do not check outside the stack boundaries */
|
||||
|
||||
start = STACK_ALIGN_UP((uintptr_t)stackbase);
|
||||
end = STACK_ALIGN_DOWN((uintptr_t)stackbase + nbytes);
|
||||
start = STACKFRAME_ALIGN_UP((uintptr_t)stackbase);
|
||||
end = STACKFRAME_ALIGN_DOWN((uintptr_t)stackbase + nbytes);
|
||||
|
||||
/* Get the adjusted size based on the top and bottom of the stack */
|
||||
|
||||
@@ -179,7 +179,7 @@ void sparc_stack_color(void *stackbase, size_t nbytes)
|
||||
|
||||
/* Take extra care that we do not write outside the stack boundaries */
|
||||
|
||||
stkptr = (uint32_t *)STACK_ALIGN_UP((uintptr_t)stackbase);
|
||||
stkptr = (uint32_t *)STACKFRAME_ALIGN_UP((uintptr_t)stackbase);
|
||||
|
||||
if (nbytes == 0) /* 0: colorize the running stack */
|
||||
{
|
||||
@@ -194,7 +194,7 @@ void sparc_stack_color(void *stackbase, size_t nbytes)
|
||||
stkend = (uintptr_t)stackbase + nbytes;
|
||||
}
|
||||
|
||||
stkend = STACK_ALIGN_DOWN(stkend);
|
||||
stkend = STACKFRAME_ALIGN_DOWN(stkend);
|
||||
nwords = (stkend - (uintptr_t)stkptr) >> 2;
|
||||
|
||||
/* Set the entire stack to the coloration value */
|
||||
@@ -231,7 +231,7 @@ size_t up_check_intstack(int cpu, size_t check_size)
|
||||
{
|
||||
if (check_size == 0)
|
||||
{
|
||||
check_size = STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK);
|
||||
check_size = STACKFRAME_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK);
|
||||
}
|
||||
|
||||
return sparc_stack_check((void *)up_get_intstackbase(cpu), check_size);
|
||||
|
||||
@@ -147,7 +147,7 @@ int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||
* boundary to meet these alignment requirements.
|
||||
*/
|
||||
|
||||
top_of_stack = STACK_ALIGN_DOWN(top_of_stack);
|
||||
top_of_stack = STACKFRAME_ALIGN_DOWN(top_of_stack);
|
||||
|
||||
/* The size of the stack in bytes is then the difference between
|
||||
* the top and the bottom of the stack (+4 because if the top
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
# define CONFIG_ARCH_INTERRUPTSTACK 0
|
||||
#endif
|
||||
|
||||
#define INTSTACK_SIZE (CONFIG_ARCH_INTERRUPTSTACK & ~STACK_ALIGN_MASK)
|
||||
#define INTSTACK_SIZE (CONFIG_ARCH_INTERRUPTSTACK & ~STACKFRAME_ALIGN_MASK)
|
||||
|
||||
/* This is the value used to mark the stack for subsequent stack monitoring
|
||||
* logic.
|
||||
|
||||
@@ -77,7 +77,7 @@ void *up_stack_frame(struct tcb_s *tcb, size_t frame_size)
|
||||
|
||||
/* Align the frame_size */
|
||||
|
||||
frame_size = STACK_ALIGN_UP(frame_size);
|
||||
frame_size = STACKFRAME_ALIGN_UP(frame_size);
|
||||
|
||||
/* Is there already a stack allocated? Is it big enough? */
|
||||
|
||||
|
||||
@@ -85,9 +85,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||
/* Save the new stack allocation */
|
||||
|
||||
tcb->stack_alloc_ptr = stack;
|
||||
tcb->stack_base_ptr = (void *)STACK_ALIGN_UP((uintptr_t)stack);
|
||||
tcb->stack_base_ptr = (void *)STACKFRAME_ALIGN_UP((uintptr_t)stack);
|
||||
|
||||
top_of_stack = STACK_ALIGN_DOWN((uintptr_t)stack + stack_size);
|
||||
top_of_stack = STACKFRAME_ALIGN_DOWN((uintptr_t)stack + stack_size);
|
||||
size_of_stack = top_of_stack - (uintptr_t)tcb->stack_base_ptr;
|
||||
tcb->adj_stack_size = size_of_stack;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user