mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
arm: add nvic_disable_irq_sync()
Disabling an IRQ in the NVIC may not take effect right away; if the IRQ is being disabled to implement a critical section it's necessary to follow up with dsb + isb to serialize the NVIC update. Add a helper function for doing this. Change-Id: Iaaa238ad39997cc3c6d62867d265cf9e9e0e5c4b
This commit is contained in:
parent
7c2800beb4
commit
02d317a3f4
1 changed files with 7 additions and 0 deletions
|
|
@ -43,6 +43,13 @@ static inline void nvic_disable_irq(int nr)
|
|||
reg_var(CM_NVIC_ICER(reg)) = BIT_N(bit);
|
||||
}
|
||||
|
||||
static inline void nvic_disable_irq_sync(int nr)
|
||||
{
|
||||
nvic_disable_irq(nr);
|
||||
arm_dsb();
|
||||
arm_isb();
|
||||
}
|
||||
|
||||
static inline void nvic_set_pending_irq(int nr)
|
||||
{
|
||||
int reg = nr / 32;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue