vga: simplify vga window mmio access functions

Make use of the memory API's ability to satisfy multi-byte accesses via
multiple single-byte accesses.

We have to keep vga_mem_{read,write}b() since they're used by cirrus.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Avi Kivity 2011-08-08 16:09:01 +03:00 committed by Anthony Liguori
parent a815b16649
commit b2a5e761c6
3 changed files with 12 additions and 52 deletions

View file

@ -1966,7 +1966,7 @@ static uint64_t cirrus_vga_mem_read(void *opaque,
uint32_t val;
if ((s->vga.sr[0x07] & 0x01) == 0) {
return vga_mem_readb(s, addr);
return vga_mem_readb(&s->vga, addr);
}
if (addr < 0x10000) {
@ -2011,7 +2011,7 @@ static void cirrus_vga_mem_write(void *opaque,
unsigned mode;
if ((s->vga.sr[0x07] & 0x01) == 0) {
vga_mem_writeb(s, addr, mem_value);
vga_mem_writeb(&s->vga, addr, mem_value);
return;
}