diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2011-10-12 14:25:07 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2011-10-13 20:00:37 +0200 |
commit | 216fa4633a583fcc278186e1f927f32332d1e5c5 (patch) | |
tree | 505828f2e861068aece46728aea941d562e48771 /src/devices/oprom/x86.c | |
parent | 491e2a29b9b29565f4023ac7ce32dbb5c284cb6e (diff) | |
download | coreboot-216fa4633a583fcc278186e1f927f32332d1e5c5.tar.xz |
Refactor option rom initialization code in coreboot.
- move int15 handler out of the generic code into the mainboard directories
of those mainboards that actually use it.
- move vbe headers to vbe.h
- move function prototypes used in native oprom code to x86.h
Change-Id: Idfff5e804ea328f7b5feebac72497c97329320ee
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/255
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
Diffstat (limited to 'src/devices/oprom/x86.c')
-rw-r--r-- | src/devices/oprom/x86.c | 93 |
1 files changed, 1 insertions, 92 deletions
diff --git a/src/devices/oprom/x86.c b/src/devices/oprom/x86.c index 37b45e6376..9a6ce41029 100644 --- a/src/devices/oprom/x86.c +++ b/src/devices/oprom/x86.c @@ -26,18 +26,7 @@ #include <console/console.h> #include <arch/interrupt.h> -#define REALMODE_BASE ((void *)0x600) - -struct realmode_idt { - u16 offset, cs; -}; - -void x86_exception(struct eregs *info); - -/* From x86_asm.S */ -extern unsigned char __idt_handler, __idt_handler_size; -extern unsigned char __realmode_code, __realmode_code_size; -extern unsigned char __realmode_call, __realmode_interrupt; +#include "x86.h" void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx, u32 esi, u32 edi) __attribute__((regparm(0))) = (void *)&__realmode_call; @@ -45,10 +34,6 @@ void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx, void (*realmode_interrupt)(u32 intno, u32 eax, u32 ebx, u32 ecx, u32 edx, u32 esi, u32 edi) __attribute__((regparm(0))) = (void *)&__realmode_interrupt; -#define FAKE_MEMORY_SIZE (1024*1024) // only 1MB -#define INITIAL_EBDA_SEGMENT 0xF600 -#define INITIAL_EBDA_SIZE 0x400 - static void setup_bda(void) { /* clear BIOS DATA AREA */ @@ -104,79 +89,6 @@ void mainboard_interrupt_handlers(int intXX, void *intXX_func) intXX_handler[intXX] = intXX_func; } -static int int10_handler(struct eregs *regs) -{ - int res=-1; - static u8 cursor_row=0, cursor_col=0; - switch((regs->eax & 0xff00)>>8) { - case 0x01: // Set cursor shape - res = 0; - break; - case 0x02: // Set cursor position - if (cursor_row != ((regs->edx >> 8) & 0xff) || - cursor_col >= (regs->edx & 0xff)) { - printk(BIOS_INFO, "\n"); - } - cursor_row = (regs->edx >> 8) & 0xff; - cursor_col = regs->edx & 0xff; - res = 0; - break; - case 0x03: // Get cursor position - regs->eax &= 0x00ff; - regs->ecx = 0x0607; - regs->edx = (cursor_row << 8) | cursor_col; - res = 0; - break; - case 0x06: // Scroll up - printk(BIOS_INFO, "\n"); - res = 0; - break; - case 0x08: // Get Character and Mode at Cursor Position - regs->eax = 0x0f00 | 'A'; // White on black 'A' - res = 0; - break; - case 0x09: // Write Character and attribute - case 0x10: // Write Character - printk(BIOS_INFO, "%c", regs->eax & 0xff); - res = 0; - break; - case 0x0f: // Get video mode - regs->eax = 0x5002; //80x25 - regs->ebx &= 0x00ff; - res = 0; - break; - default: - printk(BIOS_WARNING, "Unknown INT10 function %04x!\n", - regs->eax & 0xffff); - break; - } - return res; -} - -static int int16_handler(struct eregs *regs) -{ - int res=-1; - switch((regs->eax & 0xff00)>>8) { - case 0x00: // Check for Keystroke - regs->eax = 0x6120; // Space Bar, Space - res = 0; - break; - case 0x01: // Check for Keystroke - regs->eflags |= 1<<6; // Zero Flag set (no key available) - res = 0; - break; - default: - printk(BIOS_WARNING, "Unknown INT16 function %04x!\n", - regs->eax & 0xffff); - break; - } - return res; -} - -int int12_handler(struct eregs *regs); -int int15_handler(struct eregs *regs); -int int1a_handler(struct eregs *regs); - static void setup_interrupt_handlers(void) { int i; @@ -206,9 +118,6 @@ static void setup_interrupt_handlers(void) case 0x12: intXX_handler[0x12] = &int12_handler; break; - case 0x15: - intXX_handler[0x15] = &int15_handler; - break; case 0x16: intXX_handler[0x16] = &int16_handler; break; |