aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2007-12-12 12:00:46 +0000
committerKeir Fraser <keir.fraser@citrix.com>2007-12-12 12:00:46 +0000
commit8e7e63dc88d4ede72b5d684a4e1765b95a62882e (patch)
treec7fa0cefe06a5ac8ae5ce9e0e9eda8a5c9033cb5
parent9ac3def627b22b79395fe879296e4ebd4c850073 (diff)
downloadxen-8e7e63dc88d4ede72b5d684a4e1765b95a62882e.tar.gz
xen-8e7e63dc88d4ede72b5d684a4e1765b95a62882e.tar.bz2
xen-8e7e63dc88d4ede72b5d684a4e1765b95a62882e.zip
Revert 16579:0884e0a5ecc33afac8d60ea09652cf436d1a33ce.
-rw-r--r--tools/ioemu/hw/vga.c30
-rw-r--r--tools/ioemu/hw/vga_int.h3
2 files changed, 9 insertions, 24 deletions
diff --git a/tools/ioemu/hw/vga.c b/tools/ioemu/hw/vga.c
index a1e2c09964..cb34f289fb 100644
--- a/tools/ioemu/hw/vga.c
+++ b/tools/ioemu/hw/vga.c
@@ -1742,8 +1742,6 @@ static CPUWriteMemoryFunc *vga_mem_write[3] = {
static void vga_save(QEMUFile *f, void *opaque)
{
VGAState *s = opaque;
- unsigned save_format_flags;
- uint32_t vram_size;
#ifdef CONFIG_BOCHS_VBE
int i;
#endif
@@ -1774,9 +1772,8 @@ static void vga_save(QEMUFile *f, void *opaque)
qemu_put_buffer(f, s->palette, 768);
qemu_put_be32s(f, &s->bank_offset);
- save_format_flags = VGA_SAVE_FORMAT_FLAG_VRAM_DATA;
#ifdef CONFIG_BOCHS_VBE
- qemu_put_byte(f, save_format_flags | VGA_SAVE_FORMAT_FLAG_BOCHS_VBE);
+ qemu_put_byte(f, 1);
qemu_put_be16s(f, &s->vbe_index);
for(i = 0; i < VBE_DISPI_INDEX_NB; i++)
qemu_put_be16s(f, &s->vbe_regs[i]);
@@ -1784,19 +1781,17 @@ static void vga_save(QEMUFile *f, void *opaque)
qemu_put_be32s(f, &s->vbe_line_offset);
qemu_put_be32s(f, &s->vbe_bank_mask);
#else
- qemu_put_byte(f, save_format_flags);
+ qemu_put_byte(f, 0);
#endif
- vram_size = s->vram_size;
- qemu_put_be32s(f, &vram_size);
- qemu_put_buffer(f, s->vram_ptr, s->vram_size);
}
static int vga_load(QEMUFile *f, void *opaque, int version_id)
{
VGAState *s = opaque;
- int ret;
- unsigned int save_format_flags;
- uint32_t vram_size;
+ int is_vbe, ret;
+#ifdef CONFIG_BOCHS_VBE
+ int i;
+#endif
if (version_id > 2)
return -EINVAL;
@@ -1830,9 +1825,9 @@ static int vga_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_buffer(f, s->palette, 768);
qemu_get_be32s(f, &s->bank_offset);
- save_format_flags = qemu_get_byte(f);
+ is_vbe = qemu_get_byte(f);
#ifdef CONFIG_BOCHS_VBE
- if (!(save_format_flags & VGA_SAVE_FORMAT_FLAG_BOCHS_VBE))
+ if (!is_vbe)
return -EINVAL;
qemu_get_be16s(f, &s->vbe_index);
for(i = 0; i < VBE_DISPI_INDEX_NB; i++)
@@ -1841,16 +1836,9 @@ static int vga_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_be32s(f, &s->vbe_line_offset);
qemu_get_be32s(f, &s->vbe_bank_mask);
#else
- if (save_format_flags & VGA_SAVE_FORMAT_FLAG_BOCHS_VBE)
+ if (is_vbe)
return -EINVAL;
#endif
- if (save_format_flags & VGA_SAVE_FORMAT_FLAG_VRAM_DATA) {
- /* people who restore old images may be lucky ... */
- qemu_get_be32s(f, &vram_size);
- if (vram_size != s->vram_size)
- return -EINVAL;
- qemu_get_buffer(f, s->vram_ptr, s->vram_size);
- }
/* force refresh */
s->graphic_mode = -1;
diff --git a/tools/ioemu/hw/vga_int.h b/tools/ioemu/hw/vga_int.h
index 7c870d8d18..3dd9330573 100644
--- a/tools/ioemu/hw/vga_int.h
+++ b/tools/ioemu/hw/vga_int.h
@@ -157,9 +157,6 @@ static inline int c6_to_8(int v)
return (v << 2) | (b << 1) | b;
}
-#define VGA_SAVE_FORMAT_FLAG_BOCHS_VBE 0x01
-#define VGA_SAVE_FORMAT_FLAG_VRAM_DATA 0x02
-
void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
unsigned long vga_ram_offset, int vga_ram_size);
uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr);