> > Whatever calling sequence you choose, please put the required attribute
> > for any function that needs something specific in the declaration for
> > that function (in a header file). This includes any function
> > implemented
> > in assembler (except those without arguments at all).
> >
> > This will save you a lot of headaches ;-)
>
> I appreciate the clarification.
>
> Thanks,
> Myles
>
> 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 <[EMAIL PROTECTED]>
Thanks,
Myles
Index: util/x86emu/vm86.c
===================================================================
--- util/x86emu/vm86.c (revision 962)
+++ util/x86emu/vm86.c (working copy)
@@ -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,
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot