[coreboot] r964 - coreboot-v3/util/x86emu

svn at coreboot.org svn at coreboot.org
Wed Oct 29 21:39:32 CET 2008


Author: myles
Date: 2008-10-29 21:39:32 +0100 (Wed, 29 Oct 2008)
New Revision: 964

Modified:
   coreboot-v3/util/x86emu/vm86.c
Log:
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 <mylesgw at gmail.com>
Acked-by: Stefan Reinauer <stepan at coresystems.de>


Modified: coreboot-v3/util/x86emu/vm86.c
===================================================================
--- coreboot-v3/util/x86emu/vm86.c	2008-10-29 18:29:19 UTC (rev 963)
+++ coreboot-v3/util/x86emu/vm86.c	2008-10-29 20:39:32 UTC (rev 964)
@@ -29,7 +29,6 @@
 #include <string.h>
 #include <io.h>
 
-
 /* The address arguments to this function are PHYSICAL ADDRESSES */
 static void real_mode_switch_call_vga(unsigned long devfn)
 {
@@ -240,19 +239,6 @@
 		);
 }
 
-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 @@
 
 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 @@
 	return ret;
 }
 
-
 void setup_realmode_idt(void)
 {
 	extern unsigned char idthandle, end_idthandle;
@@ -543,12 +528,21 @@
 	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,
 	FINDDEV = 0xb102,





More information about the coreboot mailing list