From 4b032e457f1377fc06d12214b0450eae48653565 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 20 Apr 2018 01:39:30 -0600 Subject: arch/x86: allow idt to be available to link in all stages Add Kconfig IDT_IN_EVERY_STAGE to optionally specify having the interrupt handling code available to all stages. In order to do this the idt setup is moved to a C module. The vecX entries are made global so that a table of references to all the interrupt vector entry points can be used to dynamically initialize the idt. The ramification for ramstage is that exceptions are initialized later (lib/hardwaremain.c). Not all stages initialize exceptions when this Kconfig variable is selected, but bootblock for the C, stages using assembly_entry.S, and of course ramstage do. Anything left out just needs a call to exception_init() at the right location. BUG=b:72728953 Change-Id: I4146a040e5e43bed7ccc6cb0a7dc2271f1e7b7fa Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25761 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/arch/x86/include/arch/exception.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/arch/x86/include') diff --git a/src/arch/x86/include/arch/exception.h b/src/arch/x86/include/arch/exception.h index d4e9658f75..8f7213d27e 100644 --- a/src/arch/x86/include/arch/exception.h +++ b/src/arch/x86/include/arch/exception.h @@ -30,6 +30,13 @@ #ifndef _ARCH_EXCEPTION_H #define _ARCH_EXCEPTION_H +#include +#include + +#if IS_ENABLED(CONFIG_IDT_IN_EVERY_STAGE) || ENV_RAMSTAGE +asmlinkage void exception_init(void); +#else static inline void exception_init(void) { /* not implemented */ } +#endif #endif -- cgit v1.2.3