summaryrefslogtreecommitdiff
path: root/include/panic.h
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2021-02-12 13:33:48 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-17 22:57:46 +0000
commit717b8cb62ba1d15ce070ffb35474184672ed8010 (patch)
tree4ff89109907ecae23707dba5bc545b1448f7a27d /include/panic.h
parent0403bb098edd006d4c0c1b483e8ba591af21b91c (diff)
downloadchrome-ec-717b8cb62ba1d15ce070ffb35474184672ed8010.tar.gz
zephyr: cortex-m: Add software panic support
Software panic implementation is needed to support system.c's system_common_pre_init. For reference, this code was taken from core/cortex-m/panic.c. BRANCH=none BUG=b:167392037 TEST=zmake testall Change-Id: I91232b297c9933d48e3b7c59d7d8befe84cdecc5 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2693687 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/panic.h')
-rw-r--r--include/panic.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/panic.h b/include/panic.h
index 664c3c58f0..4d462a1bfb 100644
--- a/include/panic.h
+++ b/include/panic.h
@@ -192,7 +192,15 @@ void panic_set_reason(uint32_t reason, uint32_t info, uint8_t exception);
* Retrieve the currently stored panic reason + info.
*/
void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception);
-#endif
+
+#ifdef CONFIG_ZEPHYR
+/**
+ * Zephyr utility for architecture specific logic to run when setting panic
+ * reason.
+ */
+void arch_panic_set_reason(uint32_t reason, uint32_t info, uint8_t exception);
+#endif /* CONFIG_ZEPHYR */
+#endif /* CONFIG_SOFTWARE_PANIC */
/**
* Enable/disable bus fault handler