summaryrefslogtreecommitdiffstats
path: root/qemu/roms/seabios/vgasrc
diff options
context:
space:
mode:
authorJosé Pekkarinen <jose.pekkarinen@nokia.com>2016-05-18 13:18:31 +0300
committerJosé Pekkarinen <jose.pekkarinen@nokia.com>2016-05-18 13:42:15 +0300
commit437fd90c0250dee670290f9b714253671a990160 (patch)
treeb871786c360704244a07411c69fb58da9ead4a06 /qemu/roms/seabios/vgasrc
parent5bbd6fe9b8bab2a93e548c5a53b032d1939eec05 (diff)
These changes are the raw update to qemu-2.6.
Collission happened in the following patches: migration: do cleanup operation after completion(738df5b9) Bug fix.(1750c932f86) kvmclock: add a new function to update env->tsc.(b52baab2) The code provided by the patches was already in the upstreamed version. Change-Id: I3cc11841a6a76ae20887b2e245710199e1ea7f9a Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'qemu/roms/seabios/vgasrc')
-rw-r--r--qemu/roms/seabios/vgasrc/Kconfig29
-rw-r--r--qemu/roms/seabios/vgasrc/geodevga.h2
-rw-r--r--qemu/roms/seabios/vgasrc/vgabios.c6
-rw-r--r--qemu/roms/seabios/vgasrc/vgabios.h4
-rw-r--r--qemu/roms/seabios/vgasrc/vgaentry.S18
-rw-r--r--qemu/roms/seabios/vgasrc/vgafb.c17
-rw-r--r--qemu/roms/seabios/vgasrc/vgainit.c1
-rw-r--r--qemu/roms/seabios/vgasrc/vgaversion.c6
8 files changed, 65 insertions, 18 deletions
diff --git a/qemu/roms/seabios/vgasrc/Kconfig b/qemu/roms/seabios/vgasrc/Kconfig
index 91d590ae2..f5098a4bd 100644
--- a/qemu/roms/seabios/vgasrc/Kconfig
+++ b/qemu/roms/seabios/vgasrc/Kconfig
@@ -58,6 +58,25 @@ menu "VGA ROM"
endchoice
choice
+ depends on VGA_BOCHS
+ prompt "bochs vga variant"
+ default VGA_BOCHS_STDVGA
+
+ config VGA_BOCHS_STDVGA
+ bool "qemu stdvga / bochs svga"
+
+ config VGA_BOCHS_VMWARE
+ bool "qemu vmware svga"
+
+ config VGA_BOCHS_QXL
+ bool "qemu qxl vga"
+
+ config VGA_BOCHS_VIRTIO
+ bool "qemu virtio vga"
+
+ endchoice
+
+ choice
depends on VGA_GEODEGX2 || VGA_GEODELX
prompt "Output Mode"
default VGA_OUTPUT_CRT
@@ -141,7 +160,10 @@ menu "VGA ROM"
hex
prompt "PCI Vendor ID" if OVERRIDE_PCI_ID
default 0x1013 if VGA_CIRRUS
- default 0x1234 if VGA_BOCHS
+ default 0x1234 if VGA_BOCHS_STDVGA
+ default 0x15ad if VGA_BOCHS_VMWARE
+ default 0x1b36 if VGA_BOCHS_QXL
+ default 0x1af4 if VGA_BOCHS_VIRTIO
default 0x100b if VGA_GEODEGX2
default 0x1022 if VGA_GEODELX
default 0x0000
@@ -153,7 +175,10 @@ menu "VGA ROM"
hex
prompt "PCI Vendor ID" if OVERRIDE_PCI_ID
default 0x00b8 if VGA_CIRRUS
- default 0x1111 if VGA_BOCHS
+ default 0x1111 if VGA_BOCHS_STDVGA
+ default 0x0405 if VGA_BOCHS_VMWARE
+ default 0x0100 if VGA_BOCHS_QXL
+ default 0x1050 if VGA_BOCHS_VIRTIO
default 0x0030 if VGA_GEODEGX2
default 0x2081 if VGA_GEODELX
default 0x0000
diff --git a/qemu/roms/seabios/vgasrc/geodevga.h b/qemu/roms/seabios/vgasrc/geodevga.h
index 61d78084d..c99f54bb1 100644
--- a/qemu/roms/seabios/vgasrc/geodevga.h
+++ b/qemu/roms/seabios/vgasrc/geodevga.h
@@ -2,7 +2,7 @@
//
// Copyright (C) 2009 Chris Kindt
//
-// Writen for Google Summer of Code 2009 for the coreboot project
+// Written for Google Summer of Code 2009 for the coreboot project
//
// This file may be distributed under the terms of the GNU LGPLv3 license.
diff --git a/qemu/roms/seabios/vgasrc/vgabios.c b/qemu/roms/seabios/vgasrc/vgabios.c
index 4aa50e1c1..f07e85bd3 100644
--- a/qemu/roms/seabios/vgasrc/vgabios.c
+++ b/qemu/roms/seabios/vgasrc/vgabios.c
@@ -304,6 +304,12 @@ vga_set_mode(int mode, int flags)
SET_BDA(video_mode, 0xff);
SET_BDA_EXT(vbe_mode, mode | (flags & MF_VBEFLAGS));
SET_BDA_EXT(vgamode_offset, (u32)vmode_g);
+ if (CONFIG_VGA_ALLOCATE_EXTRA_STACK)
+ // Disable extra stack if it appears a modern OS is in use.
+ // This works around bugs in some versions of Windows (Vista
+ // and possibly later) when the stack is in the e-segment.
+ MASK_BDA_EXT(flags, BF_EXTRA_STACK
+ , (flags & MF_LEGACY) ? BF_EXTRA_STACK : 0);
if (memmodel == MM_TEXT) {
SET_BDA(video_cols, width);
SET_BDA(video_rows, height-1);
diff --git a/qemu/roms/seabios/vgasrc/vgabios.h b/qemu/roms/seabios/vgasrc/vgabios.h
index fd796f2e6..831f69407 100644
--- a/qemu/roms/seabios/vgasrc/vgabios.h
+++ b/qemu/roms/seabios/vgasrc/vgabios.h
@@ -62,7 +62,8 @@ struct gfx_op {
#define GO_MEMSET 3
#define GO_MEMMOVE 4
-// Custom internal storage in BDA
+// Custom internal storage in BDA (don't change here without also
+// updating vgaentry.S)
#define VGA_CUSTOM_BDA 0xb9
struct vga_bda_s {
@@ -74,6 +75,7 @@ struct vga_bda_s {
#define BF_PM_MASK 0x0f
#define BF_EMULATE_TEXT 0x10
#define BF_SWCURSOR 0x20
+#define BF_EXTRA_STACK 0x40
#define GET_BDA_EXT(var) \
GET_FARVAR(SEG_BDA, ((struct vga_bda_s *)VGA_CUSTOM_BDA)->var)
diff --git a/qemu/roms/seabios/vgasrc/vgaentry.S b/qemu/roms/seabios/vgasrc/vgaentry.S
index d9ebdb93c..53be2b38c 100644
--- a/qemu/roms/seabios/vgasrc/vgaentry.S
+++ b/qemu/roms/seabios/vgasrc/vgaentry.S
@@ -86,14 +86,23 @@ entry_10:
ENTRY_ARG_VGA handle_10
iretw
+#define VGA_CUSTOM_BDA_FLAGS 0xb9
+#define BF_EXTRA_STACK 0x40
+
// Entry point using extra stack
DECLFUNC entry_10_extrastack
entry_10_extrastack:
cli
cld
- pushw %ds // Set %ds:%eax to space on ExtraStack
+ pushw %ds
pushl %eax
- movw %cs:ExtraStackSeg, %ds
+
+ movw $SEG_BDA, %ax // Check if extra stack is enabled
+ movw %ax, %ds
+ testb $BF_EXTRA_STACK, VGA_CUSTOM_BDA_FLAGS
+ jz 1f
+
+ movw %cs:ExtraStackSeg, %ds // Set %ds:%eax to space on ExtraStack
movl $(CONFIG_VGA_EXTRA_STACK_SIZE-PUSHBREGS_size-16), %eax
SAVEBREGS_POP_DSEAX // Save registers on extra stack
movl %esp, PUSHBREGS_size+8(%eax)
@@ -116,6 +125,11 @@ entry_10_extrastack:
RESTOREBREGS_DSEAX
iretw
+1: // Use regular entry point if the extra stack is disabled
+ popl %eax
+ popw %ds
+ jmp entry_10
+
// Timer irq handling
DECLFUNC entry_timer_hook
entry_timer_hook:
diff --git a/qemu/roms/seabios/vgasrc/vgafb.c b/qemu/roms/seabios/vgasrc/vgafb.c
index 1a94fcf70..5d1ecc936 100644
--- a/qemu/roms/seabios/vgasrc/vgafb.c
+++ b/qemu/roms/seabios/vgasrc/vgafb.c
@@ -273,28 +273,22 @@ gfx_direct(struct gfx_op *op)
int bypp = DIV_ROUND_UP(depth, 8);
void *dest_far = (fb + op->displaystart + op->y * op->linelength
+ op->x * bypp);
+ u8 data[64];
+ int i;
switch (op->op) {
default:
- case GO_READ8: {
- u8 data[64];
+ case GO_READ8:
memcpy_high(MAKE_FLATPTR(GET_SEG(SS), data), dest_far, bypp * 8);
- int i;
for (i=0; i<8; i++)
op->pixels[i] = reverse_color(depth, *(u32*)&data[i*bypp]);
break;
- }
- case GO_WRITE8: {
- u8 data[64];
- int i;
+ case GO_WRITE8:
for (i=0; i<8; i++)
*(u32*)&data[i*bypp] = get_color(depth, op->pixels[i]);
memcpy_high(dest_far, MAKE_FLATPTR(GET_SEG(SS), data), bypp * 8);
break;
- }
- case GO_MEMSET: {
+ case GO_MEMSET: ;
u32 color = get_color(depth, op->pixels[0]);
- u8 data[64];
- int i;
for (i=0; i<8; i++)
*(u32*)&data[i*bypp] = color;
memcpy_high(dest_far, MAKE_FLATPTR(GET_SEG(SS), data), bypp * 8);
@@ -303,7 +297,6 @@ gfx_direct(struct gfx_op *op)
memcpy_high(dest_far + op->linelength * i
, dest_far, op->xlen * bypp);
break;
- }
case GO_MEMMOVE: ;
void *src_far = (fb + op->displaystart + op->srcy * op->linelength
+ op->x * bypp);
diff --git a/qemu/roms/seabios/vgasrc/vgainit.c b/qemu/roms/seabios/vgasrc/vgainit.c
index 8d1226182..40997dbbd 100644
--- a/qemu/roms/seabios/vgasrc/vgainit.c
+++ b/qemu/roms/seabios/vgasrc/vgainit.c
@@ -150,6 +150,7 @@ vga_post(struct bregs *regs)
{
serial_debug_preinit();
dprintf(1, "Start SeaVGABIOS (version %s)\n", VERSION);
+ dprintf(1, "VGABUILD: %s\n", BUILDINFO);
debug_enter(regs, DEBUG_VGA_POST);
if (CONFIG_VGA_PCI && !GET_GLOBAL(HaveRunInit)) {
diff --git a/qemu/roms/seabios/vgasrc/vgaversion.c b/qemu/roms/seabios/vgasrc/vgaversion.c
new file mode 100644
index 000000000..1ef5ddb79
--- /dev/null
+++ b/qemu/roms/seabios/vgasrc/vgaversion.c
@@ -0,0 +1,6 @@
+// Place build generated version into a C variable
+#include "autovgaversion.h"
+#include "types.h"
+
+char VERSION[] VAR16 = BUILD_VERSION;
+char BUILDINFO[] VAR16 = BUILD_TOOLS;