From c143693c260391918bf1233c59172514bb9bfa21 Mon Sep 17 00:00:00 2001 From: Libra Li Date: Wed, 23 Dec 2009 19:16:47 +0000 Subject: Add mainboard x86emu interrupt function support. Add tim5690 VGA BIOS functions: int15 getting LCD panel ID. Signed-off-by: Libra Li Acked-by: Marc Jones git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4990 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/x86emu/x86.c | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) (limited to 'util') diff --git a/util/x86emu/x86.c b/util/x86emu/x86.c index 4ceb4b2e07..342bb6ef77 100644 --- a/util/x86emu/x86.c +++ b/util/x86emu/x86.c @@ -29,6 +29,8 @@ #include #endif +#include + #define REALMODE_BASE ((void *)0x600) struct realmode_idt { @@ -64,6 +66,12 @@ static int intXX_unknown_handler(struct eregs *regs) return -1; } +/* setup interrupt handlers for mainboard */ +void mainboard_interrupt_handlers(int intXX, void *intXX_func) +{ + intXX_handler[intXX] = intXX_func; +} + int int12_handler(struct eregs *regs); int int15_handler(struct eregs *regs); int int1a_handler(struct eregs *regs); @@ -80,16 +88,32 @@ static void setup_interrupt_handlers(void) /* Mark all other intXX calls as unknown first */ for (i = 0x10; i < 0x100; i++) - intXX_handler[i] = &intXX_unknown_handler; - - /* Now set the default functions that are actually - * needed to initialize the option roms. This is very - * slick, as it allows us to implement mainboard specific - * interrupt handlers, such as the int15 - */ - intXX_handler[0x12] = &int12_handler; - intXX_handler[0x15] = &int15_handler; - intXX_handler[0x1a] = &int1a_handler; + { + /* If the mainboard_interrupt_handler isn't called first. + */ + if(!intXX_handler[i]) + { + /* Now set the default functions that are actually + * needed to initialize the option roms. This is very + * slick, as it allows us to implement mainboard specific + * interrupt handlers, such as the int15 + */ + switch (i) { + case 0x12: + intXX_handler[0x12] = &int12_handler; + break; + case 0x15: + intXX_handler[0x15] = &int15_handler; + break; + case 0x1a: + intXX_handler[0x1a] = &int1a_handler; + break; + default: + intXX_handler[i] = &intXX_unknown_handler; + break; + } + } + } } static void write_idt_stub(void *target, u8 intnum) @@ -127,7 +151,7 @@ void run_bios(struct device *dev, unsigned long addr) { /* clear vga bios data area */ memset((void *)0x400, 0, 0x200); - + /* Set up C interrupt handlers */ setup_interrupt_handlers(); -- cgit v1.2.3