diff options
author | Juan Quintela <quintela@redhat.com> | 2009-08-31 16:07:19 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-09-09 14:55:13 -0500 |
commit | 25a18cbd27d1556aafe268d48bffbb3c883de081 (patch) | |
tree | 046283453fc067a1bac2acc8a508836e922f685a /hw/cirrus_vga.c | |
parent | 79b97bf2e7f33ca4338fe3d83f2a38c97450d350 (diff) |
vga and cirrus_vga: create vga_ioport_invalid() and use it everywhere
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/cirrus_vga.c')
-rw-r--r-- | hw/cirrus_vga.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 5f5710701c..7e63399bd8 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -2661,10 +2661,7 @@ static uint32_t cirrus_vga_ioport_read(void *opaque, uint32_t addr) CirrusVGAState *s = opaque; int val, index; - /* check port range access depending on color/monochrome mode */ - if ((addr >= 0x3b0 && addr <= 0x3bf && (s->vga.msr & MSR_COLOR_EMULATION)) - || (addr >= 0x3d0 && addr <= 0x3df - && !(s->vga.msr & MSR_COLOR_EMULATION))) { + if (vga_ioport_invalid(&s->vga, addr)) { val = 0xff; } else { switch (addr) { @@ -2768,11 +2765,9 @@ static void cirrus_vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) int index; /* check port range access depending on color/monochrome mode */ - if ((addr >= 0x3b0 && addr <= 0x3bf && (s->vga.msr & MSR_COLOR_EMULATION)) - || (addr >= 0x3d0 && addr <= 0x3df - && !(s->vga.msr & MSR_COLOR_EMULATION))) + if (vga_ioport_invalid(&s->vga, addr)) { return; - + } #ifdef DEBUG_VGA printf("VGA: write addr=0x%04x data=0x%02x\n", addr, val); #endif |