From eece345b2cd90090e72009839ca38f572072fd9e Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Wed, 29 Oct 2008 20:39:32 +0000 Subject: [PATCH] This patch makes the vm86 call succeed. It 1. moves the run_bios function down so it can call setup_realmode_idt 2. adds the __attribute__((regnum(0))) to biosint because it is called from assembly Signed-off-by: Myles Watson Acked-by: Stefan Reinauer git-svn-id: svn://coreboot.org/repository/coreboot-v3@964 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- util/x86emu/vm86.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/util/x86emu/vm86.c b/util/x86emu/vm86.c index 6796738364..c097b723e4 100644 --- a/util/x86emu/vm86.c +++ b/util/x86emu/vm86.c @@ -29,7 +29,6 @@ #include #include - /* The address arguments to this function are PHYSICAL ADDRESSES */ static void real_mode_switch_call_vga(unsigned long devfn) { @@ -240,19 +239,6 @@ void vga_enable_console(void) ); } -void run_bios(struct device *dev, unsigned long addr) -{ - int i; - - /* clear vga bios data area */ - for (i = 0x400; i < 0x500; i++) { - *(unsigned char *) i = 0; - } - - real_mode_switch_call_vga((dev->bus->secondary << 8) | dev->path.pci.devfn); -} - - // we had hoped to avoid this. // this is a stub IDT only. It's main purpose is to ignore calls // to the BIOS. @@ -415,7 +401,7 @@ int handleint21(unsigned long *pedi, unsigned long *pesi, unsigned long *pebp, extern void vga_exit(void); -int biosint(unsigned long intnumber, +int __attribute__((regparm(0))) biosint(unsigned long intnumber, unsigned long gsfs, unsigned long dses, unsigned long edi, unsigned long esi, unsigned long ebp, unsigned long esp, @@ -484,7 +470,6 @@ int biosint(unsigned long intnumber, return ret; } - void setup_realmode_idt(void) { extern unsigned char idthandle, end_idthandle; @@ -543,11 +528,20 @@ void setup_realmode_idt(void) idts[1].offset = 16384; memcpy((void *)16384, &debughandle, &end_debughandle - &debughandle); #endif - - } +void run_bios(struct device *dev, unsigned long addr) +{ + int i; + /* clear vga bios data area */ + for (i = 0x400; i < 0x500; i++) { + *(unsigned char *) i = 0; + } + setup_realmode_idt(); + + real_mode_switch_call_vga((dev->bus->secondary << 8) | dev->path.pci.devfn); +} enum { CHECK = 0xb001,