mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 13:52:22 +08:00
sched/irq: align irq work queue stack buffer
Add aligned_data(STACK_ALIGNMENT) attribute to g_irq_work_stack buffer declaration in irq_attach_wqueue.c. Ensures stack memory is properly aligned to architecture requirements, preventing unaligned stack addresses that could cause data access faults or performance degradation on strict alignment architectures. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -72,11 +72,12 @@ static mutex_t g_irq_wqueue_lock = NXMUTEX_INITIALIZER;
|
||||
static FAR struct kwork_wqueue_s *g_irq_wqueue[CONFIG_IRQ_NWORKS];
|
||||
|
||||
#ifdef IRQ_WORK_SECTION
|
||||
static uint8_t g_irq_work_stack[CONFIG_IRQ_NWORKS][CONFIG_IRQ_WORK_STACKSIZE]
|
||||
static aligned_data(STACK_ALIGNMENT) uint8_t
|
||||
g_irq_work_stack[CONFIG_IRQ_NWORKS][CONFIG_IRQ_WORK_STACKSIZE]
|
||||
locate_data(IRQ_WORK_SECTION);
|
||||
#else
|
||||
static uint8_t g_irq_work_stack[CONFIG_IRQ_NWORKS]
|
||||
[CONFIG_IRQ_WORK_STACKSIZE];
|
||||
static aligned_data(STACK_ALIGNMENT) uint8_t
|
||||
g_irq_work_stack[CONFIG_IRQ_NWORKS][CONFIG_IRQ_WORK_STACKSIZE];
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user