From f47ccbdd47c57def602201869081d1025014c042 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Wed, 22 Aug 2018 10:03:05 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/28240 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- payloads/libpayload/arch/x86/gdb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'payloads/libpayload/arch/x86') 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) -- cgit v1.2.3