diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-11-12 02:29:56 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-12-13 17:58:17 +0300 |
commit | b46f30a378673a5c789d145c1d8d0d76312714d8 (patch) | |
tree | 2065881150fea2870cbda7f5e2634cd68d2498dd /include/os.h | |
parent | 21f9075def91ccbed3620c187cc2e15c0a94bac4 (diff) | |
download | u-boot-b46f30a378673a5c789d145c1d8d0d76312714d8.tar.xz |
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 <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/os.h')
-rw-r--r-- | include/os.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h index 1fe44f3510..0913b47b3a 100644 --- a/include/os.h +++ b/include/os.h @@ -407,4 +407,21 @@ void *os_find_text_base(void); */ void os_relaunch(char *argv[]); +/** + * os_setup_signal_handlers() - setup signal handlers + * + * Install signal handlers for SIGBUS and SIGSEGV. + * + * Return: 0 for success + */ +int os_setup_signal_handlers(void); + +/** + * os_signal_action() - handle a signal + * + * @sig: signal + * @pc: program counter + */ +void os_signal_action(int sig, unsigned long pc); + #endif |