Revision 4f5e19e6 hw/grackle_pci.c
b/hw/grackle_pci.c | ||
---|---|---|
26 | 26 |
#include "sysbus.h" |
27 | 27 |
#include "ppc_mac.h" |
28 | 28 |
#include "pci.h" |
29 |
#include "pci_host.h" |
|
29 | 30 |
|
30 | 31 |
/* debug Grackle */ |
31 | 32 |
//#define DEBUG_GRACKLE |
... | ... | |
37 | 38 |
#define GRACKLE_DPRINTF(fmt, ...) |
38 | 39 |
#endif |
39 | 40 |
|
40 |
typedef target_phys_addr_t pci_addr_t; |
|
41 |
#include "pci_host.h" |
|
42 |
|
|
43 | 41 |
typedef struct GrackleState { |
44 | 42 |
SysBusDevice busdev; |
45 | 43 |
PCIHostState host_state; |
... | ... | |
84 | 82 |
&pci_grackle_config_readl, |
85 | 83 |
}; |
86 | 84 |
|
87 |
static CPUWriteMemoryFunc * const pci_grackle_write[] = { |
|
88 |
&pci_host_data_writeb, |
|
89 |
&pci_host_data_writew, |
|
90 |
&pci_host_data_writel, |
|
91 |
}; |
|
92 |
|
|
93 |
static CPUReadMemoryFunc * const pci_grackle_read[] = { |
|
94 |
&pci_host_data_readb, |
|
95 |
&pci_host_data_readw, |
|
96 |
&pci_host_data_readl, |
|
97 |
}; |
|
98 |
|
|
99 | 85 |
/* Don't know if this matches real hardware, but it agrees with OHW. */ |
100 | 86 |
static int pci_grackle_map_irq(PCIDevice *pci_dev, int irq_num) |
101 | 87 |
{ |
... | ... | |
163 | 149 |
|
164 | 150 |
pci_mem_config = cpu_register_io_memory(pci_grackle_config_read, |
165 | 151 |
pci_grackle_config_write, s); |
166 |
pci_mem_data = cpu_register_io_memory(pci_grackle_read, |
|
167 |
pci_grackle_write, |
|
168 |
&s->host_state); |
|
152 |
pci_mem_data = pci_host_data_register_io_memory(&s->host_state); |
|
169 | 153 |
sysbus_init_mmio(dev, 0x1000, pci_mem_config); |
170 | 154 |
sysbus_init_mmio(dev, 0x1000, pci_mem_data); |
171 | 155 |
|
... | ... | |
184 | 168 |
|
185 | 169 |
pci_mem_config = cpu_register_io_memory(pci_grackle_config_read, |
186 | 170 |
pci_grackle_config_write, s); |
187 |
pci_mem_data = cpu_register_io_memory(pci_grackle_read, |
|
188 |
pci_grackle_write, |
|
189 |
&s->host_state); |
|
171 |
pci_mem_data = pci_host_data_register_io_memory(&s->host_state); |
|
190 | 172 |
sysbus_init_mmio(dev, 0x1000, pci_mem_config); |
191 | 173 |
sysbus_init_mmio(dev, 0x1000, pci_mem_data); |
192 | 174 |
return 0; |
Also available in: Unified diff