From 80d5c195901d7fa1a442b36d697f9f0f3f063379 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Wed, 22 Aug 2018 10:03:05 -0600 Subject: libpayload/x86/exception: Add ability to handle user defined interrupts I need to setup the APIC timer to fire interrupts. I would like to reuse the existing interrupt table. So I extended it to support user defined interrupts. I just added all 255 vectors so there wouldn't need to be any additional build time configuration. I'm going to deprecate exception_install_hook and remove it in a follow up. It will be replaced with set_interrupt_handler. This way the exception lookup does not have to manage a list of callbacks, or have to worry about the order they are processed. BUG=b:109749762 TEST=Wrote an interrupt handler and fired an APIC timer interrupt and verified that vector 32 was returned. Change-Id: Id9c2583c7c3d9be4a06a25e546e64399f2b0620c Signed-off-by: Raul E Rangel Reviewed-on: https://review.coreboot.org/28100 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- payloads/libpayload/include/exception.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'payloads/libpayload/include') diff --git a/payloads/libpayload/include/exception.h b/payloads/libpayload/include/exception.h index 67923ea9af..7a7bc46d26 100644 --- a/payloads/libpayload/include/exception.h +++ b/payloads/libpayload/include/exception.h @@ -36,6 +36,10 @@ typedef int (*exception_hook)(u32 type); void exception_init(void); +/* Deprecated, use set_interrupt_handler. */ void exception_install_hook(exception_hook h); +typedef void (*interrupt_handler)(u8 vector); +void set_interrupt_handler(u8 vector, interrupt_handler handler); + #endif -- cgit v1.2.3