mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 09:45:55 +08:00
arch: move some macros to public code.
Move stack alignment and kernel stack macros from architecture-specific internal headers to public include/nuttx/irq.h. Consolidates duplicate definitions across 17 architecture families, reducing code duplication while enabling common code to access these core alignment utilities without architecture dependencies. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -98,6 +98,18 @@
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Stack alignment macros */
|
||||
|
||||
#define STACK_ALIGN_MASK (STACK_ALIGNMENT - 1)
|
||||
#define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
|
||||
#define STACK_ALIGN_UP(a) (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
|
||||
|
||||
/* Aligned size of the kernel stack */
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
# define ARCH_KERNEL_STACKSIZE STACK_ALIGN_UP(CONFIG_ARCH_KERNEL_STACKSIZE)
|
||||
#endif
|
||||
|
||||
/* Interrupt was handled by this device */
|
||||
|
||||
#define IRQ_HANDLED 0
|
||||
|
||||
Reference in New Issue
Block a user