]> git.proxmox.com Git - qemu.git/blobdiff - hw/vga-pci.c
ui: move files to ui/ and include/ui/
[qemu.git] / hw / vga-pci.c
index 5c4daee3978991226865a377c5e4663b50a8c3d1..fe3a3d489952f7a9bb0ca8b73aa8d38a51a7bc1e 100644 (file)
  * THE SOFTWARE.
  */
 #include "hw.h"
-#include "console.h"
-#include "pci.h"
+#include "ui/console.h"
+#include "pci/pci.h"
 #include "vga_int.h"
-#include "pixel_ops.h"
+#include "ui/pixel_ops.h"
 #include "qemu-timer.h"
 #include "loader.h"
 
@@ -62,7 +62,7 @@ static const VMStateDescription vmstate_vga_pci = {
     }
 };
 
-static uint64_t pci_vga_ioport_read(void *ptr, target_phys_addr_t addr,
+static uint64_t pci_vga_ioport_read(void *ptr, hwaddr addr,
                                     unsigned size)
 {
     PCIVGAState *d = ptr;
@@ -80,13 +80,14 @@ static uint64_t pci_vga_ioport_read(void *ptr, target_phys_addr_t addr,
     return ret;
 }
 
-static void pci_vga_ioport_write(void *ptr, target_phys_addr_t addr,
+static void pci_vga_ioport_write(void *ptr, hwaddr addr,
                                  uint64_t val, unsigned size)
 {
     PCIVGAState *d = ptr;
+
     switch (size) {
     case 1:
-        vga_ioport_write(&d->vga, addr, val);
+        vga_ioport_write(&d->vga, addr + 0x3c0, val);
         break;
     case 2:
         /*
@@ -94,8 +95,8 @@ static void pci_vga_ioport_write(void *ptr, target_phys_addr_t addr,
          * indexed registers with a single word write because the
          * index byte is updated first.
          */
-        vga_ioport_write(&d->vga, addr, val & 0xff);
-        vga_ioport_write(&d->vga, addr+1, (val >> 8) & 0xff);
+        vga_ioport_write(&d->vga, addr + 0x3c0, val & 0xff);
+        vga_ioport_write(&d->vga, addr + 0x3c1, (val >> 8) & 0xff);
         break;
     }
 }
@@ -110,7 +111,7 @@ static const MemoryRegionOps pci_vga_ioport_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
-static uint64_t pci_vga_bochs_read(void *ptr, target_phys_addr_t addr,
+static uint64_t pci_vga_bochs_read(void *ptr, hwaddr addr,
                                    unsigned size)
 {
     PCIVGAState *d = ptr;
@@ -120,7 +121,7 @@ static uint64_t pci_vga_bochs_read(void *ptr, target_phys_addr_t addr,
     return vbe_ioport_read_data(&d->vga, 0);
 }
 
-static void pci_vga_bochs_write(void *ptr, target_phys_addr_t addr,
+static void pci_vga_bochs_write(void *ptr, hwaddr addr,
                                 uint64_t val, unsigned size)
 {
     PCIVGAState *d = ptr;