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/northbridge/via/vt8623/vga.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/northbridge/via/vt8623') diff --git a/src/northbridge/via/vt8623/vga.c b/src/northbridge/via/vt8623/vga.c index 8e9bd6de34..954ff47873 100644 --- a/src/northbridge/via/vt8623/vga.c +++ b/src/northbridge/via/vt8623/vga.c @@ -30,44 +30,45 @@ #include #include #include +#include #if CONFIG_PCI_OPTION_ROM_RUN_REALMODE #include #endif -static int via_vt8623_int15_handler(struct eregs *regs) +static int via_vt8623_int15_handler(void) { int res=0; printk(BIOS_DEBUG, "via_vt8623_int15_handler\n"); - switch(regs->eax & 0xffff) { + switch(X86_EAX & 0xffff) { case 0x5f19: break; case 0x5f18: - regs->eax=0x5f; - regs->ebx=0x545; // MCLK = 133, 32M frame buffer, 256 M main memory - regs->ecx=0x060; + X86_EAX=0x5f; + X86_EBX=0x545; // MCLK = 133, 32M frame buffer, 256 M main memory + X86_ECX=0x060; res=1; break; case 0x5f00: - regs->eax = 0x8600; + X86_EAX = 0x8600; break; case 0x5f01: - regs->eax = 0x5f; - regs->ecx = (regs->ecx & 0xffffff00 ) | 2; // panel type = 2 = 1024 * 768 + X86_EAX = 0x5f; + X86_ECX = (X86_ECX & 0xffffff00 ) | 2; // panel type = 2 = 1024 * 768 res = 1; break; case 0x5f02: - regs->eax=0x5f; - regs->ebx= (regs->ebx & 0xffff0000) | 2; - regs->ecx= (regs->ecx & 0xffff0000) | 0x401; // PAL + crt only - regs->edx= (regs->edx & 0xffff0000) | 0; // TV Layout - default + X86_EAX=0x5f; + X86_EBX= (X86_EBX & 0xffff0000) | 2; + X86_ECX= (X86_ECX & 0xffff0000) | 0x401; // PAL + crt only + X86_EDX= (X86_EDX & 0xffff0000) | 0; // TV Layout - default res=1; break; case 0x5f0f: - regs->eax=0x860f; + X86_EAX=0x860f; break; default: printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", - regs->eax & 0xffff); + X86_EAX & 0xffff); break; } return res; -- cgit v1.2.3