@@ -78,14 +78,33 @@ static uint64_t pci_vga_ioport_read(void *ptr, target_phys_addr_t addr,
unsigned size)
{
PCIVGAState *d = ptr;
- return vga_ioport_read(&d->vga, addr);
+ uint64_t ret = 0;
+
+ switch (size) {
+ case 1:
+ ret = vga_ioport_read(&d->vga, addr);
+ break;
+ case 2:
+ ret = vga_ioport_read(&d->vga, addr);
+ ret |= vga_ioport_read(&d->vga, addr+1) << 8;
+ break;
+ }
+ return ret;
}
static void pci_vga_ioport_write(void *ptr, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
PCIVGAState *d = ptr;
- vga_ioport_write(&d->vga, addr, val);
+ switch (size) {
+ case 1:
+ vga_ioport_write(&d->vga, addr, val);
+ break;
+ case 2:
+ vga_ioport_write(&d->vga, addr, val & 0xff);
+ vga_ioport_write(&d->vga, addr+1, (val >> 8) & 0xff);
+ break;
+ }
}
static const MemoryRegionOps pci_vga_ioport_ops = {
@@ -94,7 +113,7 @@ static const MemoryRegionOps pci_vga_ioport_ops = {
.valid.min_access_size = 1,
.valid.max_access_size = 4,
.impl.min_access_size = 1,
- .impl.max_access_size = 1,
+ .impl.max_access_size = 2,
.endianness = DEVICE_LITTLE_ENDIAN,
};