summaryrefslogtreecommitdiff
path: root/include/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/system.h')
-rw-r--r--include/system.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h
index c50c44797b..ef86d821aa 100644
--- a/include/system.h
+++ b/include/system.h
@@ -17,6 +17,18 @@
#include "ec_commands.h"
#include "timer.h"
+#ifdef CONFIG_ZEPHYR
+#ifdef CONFIG_CPU_CORTEX_M
+/*
+ * For cortex-m we cannot use irq_lock() for disabling all the interrupts
+ * because it leaves some (NMI and faults) still enabled.
+ */
+#define interrupt_disable_all() __asm__("cpsid i")
+#endif
+#else /* !CONFIG_ZEPHYR */
+#define interrupt_disable_all() interrupt_disable()
+#endif /* CONFIG_ZEPHYR */
+
/* Per chip implementation to save/read raw EC_RESET_FLAG_ flags. */
void chip_save_reset_flags(uint32_t flags);
uint32_t chip_read_reset_flags(void);