From 199b09cb7a3c590ccbf8d705c98cfde101378f20 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 22 Nov 2012 12:46:12 +0100 Subject: x86 realmode: Use x86emu register file + defines By using the (global) register file as defined by x86emu, we can use the same register access for YABEL and realmode interrupt handlers. - the x86 realmode interrupt handlers changed in signature - to access registers, use X86_$REGNAME now (eg. X86_EAX) - x86_exception_handler still uses struct eregs *regs to avoid spilling the x86emu register file stuff everywhere Coccinelle script that handled most of this commit: @ inthandler @ identifier FUNC, regs; @@ int FUNC( -struct eregs *regs +void ) { ... } @ depends on inthandler @ identifier regs; @@ -regs->eax +X86_EAX @ depends on inthandler @ identifier regs; @@ -regs->ebx +X86_EBX @ depends on inthandler @ identifier regs; @@ -regs->ecx +X86_ECX @ depends on inthandler @ identifier regs; @@ -regs->edx +X86_EDX @ depends on inthandler @ identifier regs; @@ -regs->esi +X86_ESI @ depends on inthandler @ identifier regs; @@ -regs->edi +X86_EDI @ depends on inthandler @ identifier regs; @@ -regs->eflags +X86_EFLAGS @ depends on inthandler @ identifier regs; @@ -regs->vector +M.x86.intno Change-Id: I60cc2c36646fe4b7f97457b1e297e3df086daa36 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/1891 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/samsung/stumpy/mainboard.c | 62 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'src/mainboard/samsung/stumpy/mainboard.c') diff --git a/src/mainboard/samsung/stumpy/mainboard.c b/src/mainboard/samsung/stumpy/mainboard.c index fe70948f10..b0981fd711 100644 --- a/src/mainboard/samsung/stumpy/mainboard.c +++ b/src/mainboard/samsung/stumpy/mainboard.c @@ -25,7 +25,7 @@ #include #include #include -#if defined(CONFIG_PCI_OPTION_ROM_RUN_YABEL) && CONFIG_PCI_OPTION_ROM_RUN_YABEL +#if CONFIG_PCI_ROM_RUN || CONFIG_VGA_ROM_RUN #include #endif #include @@ -43,14 +43,14 @@ void mainboard_suspend_resume(void) } #if defined(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) && CONFIG_PCI_OPTION_ROM_RUN_REALMODE -static int int15_handler(struct eregs *regs) +static int int15_handler(void) { int res=0; printk(BIOS_DEBUG, "%s: INT15 function %04x!\n", - __func__, regs->eax & 0xffff); + __func__, X86_EAX & 0xffff); - switch(regs->eax & 0xffff) { + switch(X86_EAX & 0xffff) { case 0x5f34: /* * Set Panel Fitting Hook: @@ -59,10 +59,10 @@ static int int15_handler(struct eregs *regs) * bit 0 = Centering (do not set with bit1 or bit2) * 0 = video bios default */ - regs->eax &= 0xffff0000; - regs->eax |= 0x005f; - regs->ecx &= 0xffffff00; - regs->ecx |= 0x01; + X86_EAX &= 0xffff0000; + X86_EAX |= 0x005f; + X86_ECX &= 0xffffff00; + X86_ECX |= 0x01; res = 1; break; case 0x5f35: @@ -77,10 +77,10 @@ static int int15_handler(struct eregs *regs) * bit 6 = EFP2 * * bit 7 = LFP2 */ - regs->eax &= 0xffff0000; - regs->eax |= 0x005f; - regs->ecx &= 0xffff0000; - regs->ecx |= 0x0000; + X86_EAX &= 0xffff0000; + X86_EAX |= 0x005f; + X86_ECX &= 0xffff0000; + X86_ECX |= 0x0000; res = 1; break; case 0x5f51: @@ -91,49 +91,49 @@ static int int15_handler(struct eregs *regs) * 02h = SVDO-LVDS, LFP driven by SVDO decoder * 03h = eDP, LFP Driven by Int-DisplayPort encoder */ - regs->eax &= 0xffff0000; - regs->eax |= 0x005f; - regs->ecx &= 0xffff0000; - regs->ecx |= 0x0003; + X86_EAX &= 0xffff0000; + X86_EAX |= 0x005f; + X86_ECX &= 0xffff0000; + X86_ECX |= 0x0003; res = 1; break; case 0x5f70: - switch ((regs->ecx >> 8) & 0xff) { + switch ((X86_ECX >> 8) & 0xff) { case 0: /* Get Mux */ - regs->eax &= 0xffff0000; - regs->eax |= 0x005f; - regs->ecx &= 0xffff0000; - regs->ecx |= 0x0000; + X86_EAX &= 0xffff0000; + X86_EAX |= 0x005f; + X86_ECX &= 0xffff0000; + X86_ECX |= 0x0000; res = 1; break; case 1: /* Set Mux */ - regs->eax &= 0xffff0000; - regs->eax |= 0x005f; - regs->ecx &= 0xffff0000; - regs->ecx |= 0x0000; + X86_EAX &= 0xffff0000; + X86_EAX |= 0x005f; + X86_ECX &= 0xffff0000; + X86_ECX |= 0x0000; res = 1; break; case 2: /* Get SG/Non-SG mode */ - regs->eax &= 0xffff0000; - regs->eax |= 0x005f; - regs->ecx &= 0xffff0000; - regs->ecx |= 0x0000; + X86_EAX &= 0xffff0000; + X86_EAX |= 0x005f; + X86_ECX &= 0xffff0000; + X86_ECX |= 0x0000; res = 1; break; default: /* FIXME: Interrupt was not handled, but return sucess? */ printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n", - ((regs->ecx >> 8) & 0xff)); + ((X86_ECX >> 8) & 0xff)); return 1; } break; default: printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", - regs->eax & 0xffff); + X86_EAX & 0xffff); break; } return res; -- cgit v1.2.3