提交 ab4dd33d 编写于 作者: B Blue Swirl

Merge branch 'vga.1' of git://git.kraxel.org/qemu

* 'vga.1' of git://git.kraxel.org/qemu:
  vga: fix mmio vga register mapping
  vga: fix bochs alignment issue
...@@ -36,7 +36,8 @@ IO ports used ...@@ -36,7 +36,8 @@ IO ports used
03c0 - 03df : standard vga ports 03c0 - 03df : standard vga ports
01ce : bochs vbe interface index port 01ce : bochs vbe interface index port
01cf : bochs vbe interface data port 01cf : bochs vbe interface data port (x86 only)
01d0 : bochs vbe interface data port
Memory regions used Memory regions used
......
...@@ -84,9 +84,10 @@ static void pci_vga_ioport_write(void *ptr, hwaddr addr, ...@@ -84,9 +84,10 @@ static void pci_vga_ioport_write(void *ptr, hwaddr addr,
uint64_t val, unsigned size) uint64_t val, unsigned size)
{ {
PCIVGAState *d = ptr; PCIVGAState *d = ptr;
switch (size) { switch (size) {
case 1: case 1:
vga_ioport_write(&d->vga, addr, val); vga_ioport_write(&d->vga, addr + 0x3c0, val);
break; break;
case 2: case 2:
/* /*
...@@ -94,8 +95,8 @@ static void pci_vga_ioport_write(void *ptr, hwaddr addr, ...@@ -94,8 +95,8 @@ static void pci_vga_ioport_write(void *ptr, hwaddr addr,
* indexed registers with a single word write because the * indexed registers with a single word write because the
* index byte is updated first. * index byte is updated first.
*/ */
vga_ioport_write(&d->vga, addr, val & 0xff); vga_ioport_write(&d->vga, addr + 0x3c0, val & 0xff);
vga_ioport_write(&d->vga, addr+1, (val >> 8) & 0xff); vga_ioport_write(&d->vga, addr + 0x3c1, (val >> 8) & 0xff);
break; break;
} }
} }
......
...@@ -2321,9 +2321,8 @@ static const MemoryRegionPortio vbe_portio_list[] = { ...@@ -2321,9 +2321,8 @@ static const MemoryRegionPortio vbe_portio_list[] = {
{ 0, 1, 2, .read = vbe_ioport_read_index, .write = vbe_ioport_write_index }, { 0, 1, 2, .read = vbe_ioport_read_index, .write = vbe_ioport_write_index },
# ifdef TARGET_I386 # ifdef TARGET_I386
{ 1, 1, 2, .read = vbe_ioport_read_data, .write = vbe_ioport_write_data }, { 1, 1, 2, .read = vbe_ioport_read_data, .write = vbe_ioport_write_data },
# else
{ 2, 1, 2, .read = vbe_ioport_read_data, .write = vbe_ioport_write_data },
# endif # endif
{ 2, 1, 2, .read = vbe_ioport_read_data, .write = vbe_ioport_write_data },
PORTIO_END_OF_LIST(), PORTIO_END_OF_LIST(),
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册