diff options
author | Libra Li <libra.li@technexion.com> | 2009-12-23 19:16:47 +0000 |
---|---|---|
committer | Marc Jones <marc.jones@amd.com> | 2009-12-23 19:16:47 +0000 |
commit | c143693c260391918bf1233c59172514bb9bfa21 (patch) | |
tree | 16ab4e87557d49e4d3dc41ec286eef7782662b28 /util | |
parent | 9341acda13aa2e8d8df4f04f80c14ace52f9aa27 (diff) |
Add mainboard x86emu interrupt function support. Add tim5690 VGA BIOS functions: int15 getting LCD panel ID.
Signed-off-by: Libra Li <libra.li@technexion.com>
Acked-by: Marc Jones <marcj303@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4990 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rw-r--r-- | util/x86emu/x86.c | 46 |
1 files changed, 35 insertions, 11 deletions
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 <console.h> #endif +#include <arch/interrupt.h> + #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(); |