aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-10-14 14:10:11 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:54 -0500
commit2a3138ab15b4abce551dcfd78c64314553b3418d (patch)
tree146e549c24c786f568b85fe896f827fd711399b9
parente482dc3eaac43f88beea133843ae38c661262e97 (diff)
downloadqemu-2a3138ab15b4abce551dcfd78c64314553b3418d.zip
qemu-2a3138ab15b4abce551dcfd78c64314553b3418d.tar.gz
qemu-2a3138ab15b4abce551dcfd78c64314553b3418d.tar.bz2
vga: create is_vbe_vmstate field
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/vga.c17
-rw-r--r--hw/vga_int.h1
2 files changed, 11 insertions, 7 deletions
diff --git a/hw/vga.c b/hw/vga.c
index 6cbd3d3..99edf25 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2159,23 +2159,21 @@ void vga_common_save(QEMUFile *f, void *opaque)
qemu_put_buffer(f, s->palette, 768);
qemu_put_be32(f, s->bank_offset);
+ qemu_put_byte(f, s->is_vbe_vmstate);
#ifdef CONFIG_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]);
qemu_put_be32s(f, &s->vbe_start_addr);
qemu_put_be32s(f, &s->vbe_line_offset);
qemu_put_be32s(f, &s->vbe_bank_mask);
-#else
- qemu_put_byte(f, 0);
#endif
}
int vga_common_load(QEMUFile *f, void *opaque, int version_id)
{
VGACommonState *s = opaque;
- int is_vbe, i;
+ int i;
if (version_id > 2)
return -EINVAL;
@@ -2203,9 +2201,9 @@ int vga_common_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_buffer(f, s->palette, 768);
s->bank_offset=qemu_get_be32(f);
- is_vbe = qemu_get_byte(f);
+ s->is_vbe_vmstate = qemu_get_byte(f);
#ifdef CONFIG_BOCHS_VBE
- if (!is_vbe)
+ if (!s->is_vbe_vmstate)
return -EINVAL;
qemu_get_be16s(f, &s->vbe_index);
for(i = 0; i < VBE_DISPI_INDEX_NB; i++)
@@ -2214,7 +2212,7 @@ int vga_common_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 (is_vbe)
+ if (s->is_vbe_vmstate)
return -EINVAL;
#endif
@@ -2250,6 +2248,11 @@ void vga_common_init(VGACommonState *s, int vga_ram_size)
expand4to8[i] = v;
}
+#ifdef CONFIG_BOCHS_VBE
+ s->is_vbe_vmstate = 1;
+#else
+ s->is_vbe_vmstate = 0;
+#endif
s->vram_offset = qemu_ram_alloc(vga_ram_size);
s->vram_ptr = qemu_get_ram_ptr(s->vram_offset);
s->vram_size = vga_ram_size;
diff --git a/hw/vga_int.h b/hw/vga_int.h
index c162c07..4d5232f 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -176,6 +176,7 @@ typedef struct VGACommonState {
vga_retrace_fn retrace;
vga_update_retrace_info_fn update_retrace_info;
union vga_retrace retrace_info;
+ uint8_t is_vbe_vmstate;
} VGACommonState;
static inline int c6_to_8(int v)