diff options
author | Raul E Rangel <rrangel@chromium.org> | 2018-08-22 10:03:05 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-09-10 15:01:19 +0000 |
commit | f47ccbdd47c57def602201869081d1025014c042 (patch) | |
tree | 92ea7ff14cdabdc0dc04c44414507db47b628bb5 | |
parent | 80d5c195901d7fa1a442b36d697f9f0f3f063379 (diff) |
libpayload/x86/gdb: Migrate to use set_interrupt_handler
BUG=b:109749762
TEST=Verified GDB still functions by hitting Ctrl+G on the developer
screen and stepping through some code.
Change-Id: I723a8a95f681c500d9d8e35e49fd1d893cb1f133
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://review.coreboot.org/28240
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
-rw-r--r-- | payloads/libpayload/arch/x86/gdb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/payloads/libpayload/arch/x86/gdb.c b/payloads/libpayload/arch/x86/gdb.c index 66a5a24090..7d2951282e 100644 --- a/payloads/libpayload/arch/x86/gdb.c +++ b/payloads/libpayload/arch/x86/gdb.c @@ -38,17 +38,17 @@ static const u8 type_to_signal[] = { [EXC_SX] = GDB_SIGFPE, }; -static int gdb_exception_hook(u32 type) +static void gdb_exception_hook(u8 vector) { - if (type >= ARRAY_SIZE(type_to_signal) || !type_to_signal[type]) - return 0; - gdb_command_loop(type_to_signal[type]); - return 1; + gdb_command_loop(type_to_signal[vector]); } void gdb_arch_init(void) { - exception_install_hook(&gdb_exception_hook); + for (int vector = 0; vector < ARRAY_SIZE(type_to_signal); ++vector) { + if (type_to_signal[vector]) + set_interrupt_handler(vector, &gdb_exception_hook); + } } void gdb_arch_enter(void) |