arch/xtensa: Add z_arch_irq_is_enabled()

This function got dropped, and is needed for dynamic interrupt support

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2019-08-21 12:02:41 -07:00 committed by Anas Nashif
parent 74d26094f8
commit 915739e724
2 changed files with 10 additions and 0 deletions

View file

@ -209,3 +209,11 @@ void *xtensa_excint1_c(int *interrupted_stack)
return z_get_next_switch_handle(interrupted_stack);
}
int z_arch_irq_is_enabled(unsigned int irq)
{
u32_t ie;
__asm__ volatile("rsr.intenable %0" : "=r"(ie));
return (ie & (1 << irq)) != 0;
}

View file

@ -82,6 +82,8 @@ static ALWAYS_INLINE bool z_arch_irq_unlocked(unsigned int key)
return (key & 0xf) == 0; /* INTLEVEL field */
}
extern int z_arch_irq_is_enabled(unsigned int irq);
#include <irq.h>
#endif /* ZEPHYR_INCLUDE_ARCH_XTENSA_XTENSA_IRQ_H_ */