Skip to content

Commit

Permalink
interrupts: safeguard isr_wrapper and isr_install
Browse files Browse the repository at this point in the history
ld linker will only resolve undefined symbols inside functions that is
actually being called.

However, not all linkers behaves this way. Certain linkers, for example
armlink, resolves all undefined symbols even if during a later stage at
the linking the function will be pruned.

Therefore `ifdef CONFIG_GEN_ISR_TABLES` has been placed to safeguard
functions that will call undefined symbols when CONFIG_GEN_ISR_TABLES=y.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
  • Loading branch information
tejlmand authored and nashif committed Aug 28, 2021
1 parent f574836 commit 302fd80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/core/aarch32/cortex_m/vector_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ GTEXT(z_arm_pendsv)
GTEXT(z_arm_exc_spurious)

GTEXT(z_arm_prep_c)
#if defined(CONFIG_GEN_ISR_TABLES)
GTEXT(_isr_wrapper)
#endif /* CONFIG_GEN_ISR_TABLES */

#else /* _ASMLANGUAGE */

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/core/aarch32/irq_manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ void irq_target_state_set_all_non_secure(void)
#endif /* CONFIG_ARM_SECURE_FIRMWARE */

#ifdef CONFIG_DYNAMIC_INTERRUPTS
#ifdef CONFIG_GEN_ISR_TABLES
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
Expand All @@ -299,6 +300,7 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
z_arm_irq_priority_set(irq, priority, flags);
return irq;
}
#endif /* CONFIG_GEN_ISR_TABLES */

#ifdef CONFIG_DYNAMIC_DIRECT_INTERRUPTS
static inline void z_arm_irq_dynamic_direct_isr_dispatch(void)
Expand Down

0 comments on commit 302fd80

Please sign in to comment.