summaryrefslogtreecommitdiff
path: root/vgasrc
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-04-09 17:15:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2015-04-10 00:38:17 -0400
commit799b20b0db45891845e2d820368a66af538d5664 (patch)
tree7e731c80347a28629a14df607c95307526ca42c1 /vgasrc
parent3b9b9f2446e69a081c5f10a1755b62a31980c52a (diff)
downloadqemu-seabios-799b20b0db45891845e2d820368a66af538d5664.tar.gz
vgabios: Add config option for assembler fixups
Add a kconfig build option (CONFIG_VGA_FIXUP_ASM) to allow users to build the vgabios without the complex assembler fixups that work around emulator bugs. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc')
-rw-r--r--vgasrc/Kconfig10
-rw-r--r--vgasrc/vgaentry.S4
2 files changed, 14 insertions, 0 deletions
diff --git a/vgasrc/Kconfig b/vgasrc/Kconfig
index 400e8da..27a24c9 100644
--- a/vgasrc/Kconfig
+++ b/vgasrc/Kconfig
@@ -90,6 +90,16 @@ menu "VGA ROM"
Support emulating text mode features when only a
framebuffer is available.
+ config VGA_FIXUP_ASM
+ bool "Fixup assembler to work with broken emulators"
+ default y
+ help
+ This option will cause the build to attempt to avoid
+ certain x86 machine instructions that are known to confuse
+ some emulators. In particular, it works around
+ deficiencies in the Windows vgabios emulator and the
+ x86emu vgabios emulator (frequently used in Xorg).
+
config VGA_ALLOCATE_EXTRA_STACK
depends on BUILD_VGABIOS
bool "Allocate an internal stack for 16bit interrupt entry point"
diff --git a/vgasrc/vgaentry.S b/vgasrc/vgaentry.S
index e0ab954..7ca550d 100644
--- a/vgasrc/vgaentry.S
+++ b/vgasrc/vgaentry.S
@@ -64,6 +64,7 @@ x86emu_fault:
// This macro implements a call while avoiding instructions
// that old versions of x86emu have problems with.
.macro VGA_CALLL cfunc
+#if CONFIG_VGA_FIXUP_ASM
// Make sure leal instruction works.
movl $0x8000, %ecx
leal (%ecx, %ecx, 1), %ecx
@@ -72,6 +73,9 @@ x86emu_fault:
// Use callw instead of calll
push %ax
callw \cfunc
+#else
+ calll \cfunc
+#endif
.endm
// This macro is the same as ENTRY_ARG except VGA_CALLL is used.