summaryrefslogtreecommitdiff
path: root/core/nds32/task.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/nds32/task.c')
-rw-r--r--core/nds32/task.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/nds32/task.c b/core/nds32/task.c
index 9969db34bc..edacb7975e 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -224,6 +224,16 @@ void __ram_code interrupt_enable(void)
asm volatile ("mtsr %0, $INT_MASK" : : "r"(val));
}
+inline int is_interrupt_enabled(void)
+{
+ uint32_t val = 0;
+
+ asm volatile ("mfsr %0, $INT_MASK" : "=r"(val));
+
+ /* Interrupts are enabled if any of HW2 ~ HW15 is enabled */
+ return !!(val & 0xFFFC);
+}
+
inline int in_interrupt_context(void)
{
/* check INTL (Interrupt Stack Level) bits */