From b46f30a378673a5c789d145c1d8d0d76312714d8 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 12 Nov 2020 00:29:56 +0100 Subject: sandbox: add handler for exceptions Add a handler for SIGILL, SIGBUS, SIGSEGV. When an exception occurs print the program counter and the loaded UEFI binaries and reset the system if CONFIG_SANDBOX_CRASH_RESET=y or exit to the OS otherwise. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- arch/sandbox/cpu/start.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/sandbox/cpu/start.c') diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index a03e5aa0b3..f6c98545e0 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -451,6 +451,10 @@ int main(int argc, char *argv[]) if (ret) goto err; + ret = os_setup_signal_handlers(); + if (ret) + goto err; + #if CONFIG_VAL(SYS_MALLOC_F_LEN) gd->malloc_base = CONFIG_MALLOC_F_ADDR; #endif -- cgit v1.2.3