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:04 +0000 |
commit | 80d5c195901d7fa1a442b36d697f9f0f3f063379 (patch) | |
tree | ea157434824368d55047d03d5fbe0e84dfe06d2e /payloads/libpayload/arch/x86/exception_asm.S | |
parent | 28cee59ca294422056d983fc06d5d8d5800a4390 (diff) | |
download | coreboot-80d5c195901d7fa1a442b36d697f9f0f3f063379.tar.xz |
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 <rrangel@chromium.org>
Reviewed-on: https://review.coreboot.org/28100
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'payloads/libpayload/arch/x86/exception_asm.S')
-rw-r--r-- | payloads/libpayload/arch/x86/exception_asm.S | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/payloads/libpayload/arch/x86/exception_asm.S b/payloads/libpayload/arch/x86/exception_asm.S index a8f9a1d254..00dc888207 100644 --- a/payloads/libpayload/arch/x86/exception_asm.S +++ b/payloads/libpayload/arch/x86/exception_asm.S @@ -68,6 +68,14 @@ exception_stub_\num: jmp exception_common .endm + .altmacro + .macro user_defined_stubs from, to + stub \from + .if \to-\from + user_defined_stubs %(from+1),\to + .endif + .endm + stub 0 stub 1 stub 2 @@ -100,6 +108,11 @@ exception_stub_\num: stub 29 stub_err 30 stub 31 + /* Split the macro so we avoid a stack overflow. */ + user_defined_stubs 32, 63 + user_defined_stubs 64, 127 + user_defined_stubs 128, 191 + user_defined_stubs 192, 255 exception_common: /* @@ -215,6 +228,14 @@ gdt_ptr: .long \target .endm + .altmacro + .macro user_defined_gates from, to + interrupt_gate exception_stub_\from + .if \to-\from + user_defined_gates %(from+1),\to + .endif + .endm + .align 8 .global idt idt: @@ -250,6 +271,10 @@ idt: interrupt_gate exception_stub_29 interrupt_gate exception_stub_30 interrupt_gate exception_stub_31 + user_defined_gates 32, 63 + user_defined_gates 64, 127 + user_defined_gates 128, 191 + user_defined_gates 192, 255 idt_end: /* IDT pointer for use with lidt */ |