From 20cdb2439f7e76f78d2618220fc1a0061afd57cd Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 11 Dec 2013 00:23:15 -0800 Subject: libpayload: Make it possible to install callbacks for particular exceptions. To support a GDB stub, it will be necessary to trap various exceptions which will be used to implement breakpoints, single stepping, etc. BUG=None TEST=Built and booted on Link with hooks installed and saw that they triggered when exceptions occurred. Built and booted on nyan. BRANCH=None Original-Change-Id: Iab659365864a3055159a50b8f6e5c44290d3ba2b Original-Signed-off-by: Gabe Black Original-Reviewed-on: https://chromium-review.googlesource.com/179602 Original-Reviewed-by: Gabe Black Original-Tested-by: Gabe Black Original-Commit-Queue: Gabe Black (cherry picked from commit 8db0897b1ddad600e247cb4df147c757a8187626) Signed-off-by: Marc Jones Change-Id: I5e7f724b99988cd259909dd3bd01166fa52317ec Reviewed-on: http://review.coreboot.org/7656 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Ronald G. Minnich --- payloads/libpayload/include/arm/arch/exception.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload/include/arm/arch/exception.h') diff --git a/payloads/libpayload/include/arm/arch/exception.h b/payloads/libpayload/include/arm/arch/exception.h index a0d9413f1c..13fda57aa7 100644 --- a/payloads/libpayload/include/arm/arch/exception.h +++ b/payloads/libpayload/include/arm/arch/exception.h @@ -30,9 +30,23 @@ #ifndef _ARCH_EXCEPTION_H #define _ARCH_EXCEPTION_H -#include #include void set_vbar(uint32_t vbar); +struct exception_state +{ + uint32_t regs[16]; +} __attribute__((packed)); + +enum { + EXC_UNDEF = 1, + EXC_SWI = 2, + EXC_PABORT = 3, + EXC_DABORT = 4, + EXC_IRQ = 6, + EXC_FIQ = 7, + EXC_COUNT +}; + #endif -- cgit v1.2.3