Patchwork [20/22] Introduce vga_common_reset() to be able to typcheck vga_reset()

login
register
mail settings
Submitter Juan Quintela
Date Aug. 24, 2009, 11:03 a.m.
Message ID <4674d71c66c16b03fc98a77fa2411c8c415311aa.1251111439.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/31921/
State Superseded
Headers show

Comments

Juan Quintela - Aug. 24, 2009, 11:03 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/cirrus_vga.c |    2 +-
 hw/vga.c        |   10 +++++++---
 hw/vga_int.h    |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 93cc1ff..63bef22 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3122,7 +3122,7 @@  static void cirrus_reset(void *opaque)
 {
     CirrusVGAState *s = opaque;

-    vga_reset(&s->vga);
+    vga_common_reset(&s->vga);
     unmap_linear_vram(s);
     s->vga.sr[0x06] = 0x0f;
     if (s->device_id == CIRRUS_ID_CLGD5446) {
diff --git a/hw/vga.c b/hw/vga.c
index 4a0f197..0ff0216 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1871,10 +1871,8 @@  static void vga_invalidate_display(void *opaque)
     s->full_update = 1;
 }

-void vga_reset(void *opaque)
+void vga_common_reset(VGACommonState *s)
 {
-    VGAState *s = (VGAState *) opaque;
-
     s->lfb_addr = 0;
     s->lfb_end = 0;
     s->map_addr = 0;
@@ -1940,6 +1938,12 @@  void vga_reset(void *opaque)
     }
 }

+static void vga_reset(void *opaque)
+{
+    VGAState *s = (VGAState *) opaque;
+    vga_common_reset(s);
+}
+
 #define TEXTMODE_X(x)	((x) % width)
 #define TEXTMODE_Y(x)	((x) / width)
 #define VMEM2CHTYPE(v)	((v & 0xff0007ff) | \
diff --git a/hw/vga_int.h b/hw/vga_int.h
index eb2d6ea..bb28872 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -192,7 +192,7 @@  static inline int c6_to_8(int v)

 void vga_common_init(VGAState *s, int vga_ram_size);
 void vga_init(VGAState *s);
-void vga_reset(void *s);
+void vga_common_reset(VGACommonState *s);

 void vga_dirty_log_start(VGAState *s);