summaryrefslogtreecommitdiff
path: root/core/minute-ia/panic.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2019-06-17 15:37:55 -0600
committerCommit Bot <commit-bot@chromium.org>2019-06-19 00:51:23 +0000
commit7e80ddc5177af46cc8defc2741f4e9590b97cbbb (patch)
tree811bd2fb95e3190c956bae2e8ff7dd0a2181fa8e /core/minute-ia/panic.c
parent247b6099f910c3e1685b9185371177ac61a32617 (diff)
downloadchrome-ec-7e80ddc5177af46cc8defc2741f4e9590b97cbbb.tar.gz
minute-ia: load eip value from top of stack
For interrupt vectors (as opposed to exception handlers), the eip value is on top of the stack (referentially the return address by C calling convention). Use separate code for WDT vector. BUG=b:129983997 BRANCH=none TEST='crash watchdog' showing correct EIP, CS values Change-Id: I7efb2c71aba63eefd89fc71af089bc14034b7d08 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663188 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'core/minute-ia/panic.c')
-rw-r--r--core/minute-ia/panic.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/minute-ia/panic.c b/core/minute-ia/panic.c
index 464d25ec52..cbdabc3eec 100644
--- a/core/minute-ia/panic.c
+++ b/core/minute-ia/panic.c
@@ -7,6 +7,7 @@
#include "console.h"
#include "cpu.h"
#include "host_command.h"
+#include "mia_panic_internal.h"
#include "panic.h"
#include "printf.h"
#include "software_panic.h"
@@ -90,7 +91,7 @@ void panic_data_print(const struct panic_data *pdata)
* order pushed to the stack by hardware: see "Intel 64 and IA-32
* Architectures Software Developer's Manual", Volume 3A, Figure 6-4.
*/
-__attribute__((noreturn)) void __keep exception_panic(
+void exception_panic(
uint32_t vector,
uint32_t error_code,
uint32_t eip,
@@ -121,10 +122,11 @@ __attribute__((noreturn)) void __keep exception_panic(
PANIC_DATA_PTR->x86.edi = edi;
/*
- * Convert ISH_WDT_VEC to be a SW Watchdog. This is for
- * code that is in system_common_pre_init
+ * Convert watchdog timer vector number to be a SW
+ * Watchdog. This is for code that is in
+ * system_common_pre_init
*/
- if (vector == ISH_WDT_VEC)
+ if (IS_ENABLED(CONFIG_WATCHDOG) && vector == CONFIG_MIA_WDT_VEC)
vector = PANIC_SW_WATCHDOG;
/* Save stack data to global panic structure */