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:
hujun5
2025-04-11 15:52:06 +08:00
committed by GUIDINGLI
parent 8bb250a4c0
commit a2d2a49ba9
+4 -3
View File
@@ -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
/****************************************************************************