Patchwork [1/6] sh_pci: use PCIHostState instead of PCIBus.

login
register
mail settings
Submitter Isaku Yamahata
Date Jan. 12, 2010, 8:52 a.m.
Message ID <1263286378-10398-2-git-send-email-yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/42697/
State New
Headers show

Comments

Isaku Yamahata - Jan. 12, 2010, 8:52 a.m.
To use pci_host framework, use PCIHostState instead of PCIBus.

Cc: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/sh_pci.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

Patch

diff --git a/hw/sh_pci.c b/hw/sh_pci.c
index abe4c75..d76d390 100644
--- a/hw/sh_pci.c
+++ b/hw/sh_pci.c
@@ -29,7 +29,7 @@ 
 #include "bswap.h"
 
 typedef struct {
-    PCIBus *bus;
+    PCIHostState s;
     PCIDevice *dev;
     uint32_t par;
     uint32_t mbr;
@@ -53,7 +53,7 @@  static void sh_pci_reg_write (void *p, target_phys_addr_t addr, uint32_t val)
         pcic->iobr = val;
         break;
     case 0x220:
-        pci_data_write(pcic->bus, pcic->par, val, 4);
+        pci_data_write(pcic->s.bus, pcic->par, val, 4);
         break;
     }
 }
@@ -67,7 +67,7 @@  static uint32_t sh_pci_reg_read (void *p, target_phys_addr_t addr)
     case 0x1c0:
         return pcic->par;
     case 0x220:
-        return pci_data_read(pcic->bus, pcic->par, 4);
+        return pci_data_read(pcic->s.bus, pcic->par, 4);
     }
     return 0;
 }
@@ -75,13 +75,13 @@  static uint32_t sh_pci_reg_read (void *p, target_phys_addr_t addr)
 static void sh_pci_data_write (SHPCIC *pcic, target_phys_addr_t addr,
                                uint32_t val, int size)
 {
-    pci_data_write(pcic->bus, addr + pcic->mbr, val, size);
+    pci_data_write(pcic->s.bus, addr + pcic->mbr, val, size);
 }
 
 static uint32_t sh_pci_mem_read (SHPCIC *pcic, target_phys_addr_t addr,
                                  int size)
 {
-    return pci_data_read(pcic->bus, addr + pcic->mbr, size);
+    return pci_data_read(pcic->s.bus, addr + pcic->mbr, size);
 }
 
 static void sh_pci_writeb (void *p, target_phys_addr_t addr, uint32_t val)
@@ -176,10 +176,10 @@  PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,
     int mem, reg, iop;
 
     p = qemu_mallocz(sizeof(SHPCIC));
-    p->bus = pci_register_bus(NULL, "pci",
-                              set_irq, map_irq, opaque, devfn_min, nirq);
+    p->s.bus = pci_register_bus(NULL, "pci",
+                                set_irq, map_irq, opaque, devfn_min, nirq);
 
-    p->dev = pci_register_device(p->bus, "SH PCIC", sizeof(PCIDevice),
+    p->dev = pci_register_device(p->s.bus, "SH PCIC", sizeof(PCIDevice),
                                  -1, NULL, NULL);
     reg = cpu_register_io_memory(sh_pci_reg.r, sh_pci_reg.w, p);
     iop = cpu_register_io_memory(sh_pci_iop.r, sh_pci_iop.w, p);
@@ -198,5 +198,5 @@  PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,
     p->dev->config[0x06] = 0x90;
     p->dev->config[0x07] = 0x02;
 
-    return p->bus;
+    return p->s.bus;
 }