mirror of
https://github.com/apache/nuttx.git
synced 2026-10-19 04:43:03 +00: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:
parent
8bb250a4c0
commit
a2d2a49ba9
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue