Skip to content

Commit

Permalink
Remove io_index argument from cpu_register_io_memory()
Browse files Browse the repository at this point in the history
The parameter is always zero except when registering the three internal
io regions (ROM, unassigned, notdirty).  Remove the parameter to reduce
the API's power, thus facilitating future change.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
avikivity authored and Anthony Liguori committed Jun 16, 2009
1 parent dff8403 commit 1eed09c
Show file tree
Hide file tree
Showing 140 changed files with 291 additions and 283 deletions.
3 changes: 1 addition & 2 deletions cpu-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr);
/* This should not be used by devices. */
ram_addr_t qemu_ram_addr_from_host(void *ptr);

int cpu_register_io_memory(int io_index,
CPUReadMemoryFunc **mem_read,
int cpu_register_io_memory(CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
void *opaque);
void cpu_unregister_io_memory(int table_address);
Expand Down
31 changes: 22 additions & 9 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3004,7 +3004,7 @@ static void *subpage_init (target_phys_addr_t base, ram_addr_t *phys,
mmio = qemu_mallocz(sizeof(subpage_t));

mmio->base = base;
subpage_memory = cpu_register_io_memory(0, subpage_read, subpage_write, mmio);
subpage_memory = cpu_register_io_memory(subpage_read, subpage_write, mmio);
#if defined(DEBUG_SUBPAGE)
printf("%s: %p base " TARGET_FMT_plx " len %08x %d\n", __func__,
mmio, base, TARGET_PAGE_SIZE, subpage_memory);
Expand All @@ -3029,17 +3029,22 @@ static int get_free_io_mem_idx(void)
return -1;
}

static int cpu_register_io_memory_fixed(int io_index,
CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
void *opaque);

static void io_mem_init(void)
{
int i;

cpu_register_io_memory(IO_MEM_ROM >> IO_MEM_SHIFT, error_mem_read, unassigned_mem_write, NULL);
cpu_register_io_memory(IO_MEM_UNASSIGNED >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL);
cpu_register_io_memory(IO_MEM_NOTDIRTY >> IO_MEM_SHIFT, error_mem_read, notdirty_mem_write, NULL);
cpu_register_io_memory_fixed(IO_MEM_ROM, error_mem_read, unassigned_mem_write, NULL);
cpu_register_io_memory_fixed(IO_MEM_UNASSIGNED, unassigned_mem_read, unassigned_mem_write, NULL);
cpu_register_io_memory_fixed(IO_MEM_NOTDIRTY, error_mem_read, notdirty_mem_write, NULL);
for (i=0; i<5; i++)
io_mem_used[i] = 1;

io_mem_watch = cpu_register_io_memory(0, watch_mem_read,
io_mem_watch = cpu_register_io_memory(watch_mem_read,
watch_mem_write, NULL);
#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
Expand All @@ -3057,10 +3062,10 @@ static void io_mem_init(void)
modified. If it is zero, a new io zone is allocated. The return
value can be used with cpu_register_physical_memory(). (-1) is
returned if error. */
int cpu_register_io_memory(int io_index,
CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
void *opaque)
static int cpu_register_io_memory_fixed(int io_index,
CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
void *opaque)
{
int i, subwidth = 0;

Expand All @@ -3069,6 +3074,7 @@ int cpu_register_io_memory(int io_index,
if (io_index == -1)
return io_index;
} else {
io_index >>= IO_MEM_SHIFT;
if (io_index >= IO_MEM_NB_ENTRIES)
return -1;
}
Expand All @@ -3083,6 +3089,13 @@ int cpu_register_io_memory(int io_index,
return (io_index << IO_MEM_SHIFT) | subwidth;
}

int cpu_register_io_memory(CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
void *opaque)
{
return cpu_register_io_memory_fixed(0, mem_read, mem_write, opaque);
}

void cpu_unregister_io_memory(int io_table_address)
{
int i;
Expand Down
8 changes: 4 additions & 4 deletions hw/apb_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,
s->bus = pci_register_bus(NULL, "pci",
pci_apb_set_irq, pci_pbm_map_irq, pic, 0, 32);

pci_mem_config = cpu_register_io_memory(0, pci_apb_config_read,
pci_mem_config = cpu_register_io_memory(pci_apb_config_read,
pci_apb_config_write, s);
apb_config = cpu_register_io_memory(0, apb_config_read,
apb_config = cpu_register_io_memory(apb_config_read,
apb_config_write, s);
pci_mem_data = cpu_register_io_memory(0, pci_apb_read,
pci_mem_data = cpu_register_io_memory(pci_apb_read,
pci_apb_write, s);
pci_ioport = cpu_register_io_memory(0, pci_apb_ioread,
pci_ioport = cpu_register_io_memory(pci_apb_ioread,
pci_apb_iowrite, s);

cpu_register_physical_memory(special_base + 0x2000ULL, 0x40, apb_config);
Expand Down
2 changes: 1 addition & 1 deletion hw/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ int apic_init(CPUState *env)
if (apic_io_memory == 0) {
/* NOTE: the APIC is directly connected to the CPU - it is not
on the global memory bus. */
apic_io_memory = cpu_register_io_memory(0, apic_mem_read,
apic_io_memory = cpu_register_io_memory(apic_mem_read,
apic_mem_write, NULL);
cpu_register_physical_memory(s->apicbase & ~0xfff, 0x1000,
apic_io_memory);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm_gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ static void gic_init(gic_state *s)
for (i = 0; i < NCPU; i++) {
sysbus_init_irq(&s->busdev, &s->parent_irq[i]);
}
s->iomemtype = cpu_register_io_memory(0, gic_dist_readfn,
s->iomemtype = cpu_register_io_memory(gic_dist_readfn,
gic_dist_writefn, s);
gic_reset(s);
register_savevm("arm_gic", -1, 1, gic_save, gic_load, s);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static void arm_sysctl_init1(SysBusDevice *dev)
/* The MPcore bootloader uses these flags to start secondary CPUs.
We don't use a bootloader, so do this here. */
s->flags = 3;
iomemtype = cpu_register_io_memory(0, arm_sysctl_readfn,
iomemtype = cpu_register_io_memory(arm_sysctl_readfn,
arm_sysctl_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
/* ??? Save/restore. */
Expand Down
4 changes: 2 additions & 2 deletions hw/arm_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static void sp804_init(SysBusDevice *dev)
s->timer[1] = arm_timer_init(1000000);
s->timer[0]->irq = qi[0];
s->timer[1]->irq = qi[1];
iomemtype = cpu_register_io_memory(0, sp804_readfn,
iomemtype = cpu_register_io_memory(sp804_readfn,
sp804_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
register_savevm("sp804", -1, 1, sp804_save, sp804_load, s);
Expand Down Expand Up @@ -338,7 +338,7 @@ static void icp_pit_init(SysBusDevice *dev)
sysbus_init_irq(dev, &s->timer[1]->irq);
sysbus_init_irq(dev, &s->timer[2]->irq);

iomemtype = cpu_register_io_memory(0, icp_pit_readfn,
iomemtype = cpu_register_io_memory(icp_pit_readfn,
icp_pit_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
/* This device has no state to save/restore. The component timers will
Expand Down
2 changes: 1 addition & 1 deletion hw/armv7m.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void bitband_init(SysBusDevice *dev)
int iomemtype;

s->base = qdev_get_prop_int(&dev->qdev, "base", 0);
iomemtype = cpu_register_io_memory(0, bitband_readfn, bitband_writefn,
iomemtype = cpu_register_io_memory(bitband_readfn, bitband_writefn,
&s->base);
sysbus_init_mmio(dev, 0x02000000, iomemtype);
}
Expand Down
4 changes: 2 additions & 2 deletions hw/axis_dev88.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ void axisdev88_init (ram_addr_t ram_size,

/* Attach a NAND flash to CS1. */
nand_state.nand = nand_init(NAND_MFR_STMICRO, 0x39);
nand_regs = cpu_register_io_memory(0, nand_read, nand_write, &nand_state);
nand_regs = cpu_register_io_memory(nand_read, nand_write, &nand_state);
cpu_register_physical_memory(0x10000000, 0x05000000, nand_regs);

gpio_state.nand = &nand_state;
gpio_regs = cpu_register_io_memory(0, gpio_read, gpio_write, &gpio_state);
gpio_regs = cpu_register_io_memory(gpio_read, gpio_write, &gpio_state);
cpu_register_physical_memory(0x3001a000, 0x5c, gpio_regs);


Expand Down
8 changes: 4 additions & 4 deletions hw/cirrus_vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -3196,24 +3196,24 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s);
register_ioport_read(0x3da, 1, 1, vga_ioport_read, s);

s->vga.vga_io_memory = cpu_register_io_memory(0, cirrus_vga_mem_read,
s->vga.vga_io_memory = cpu_register_io_memory(cirrus_vga_mem_read,
cirrus_vga_mem_write, s);
cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
s->vga.vga_io_memory);
qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000);

/* I/O handler for LFB */
s->cirrus_linear_io_addr =
cpu_register_io_memory(0, cirrus_linear_read, cirrus_linear_write, s);
cpu_register_io_memory(cirrus_linear_read, cirrus_linear_write, s);

/* I/O handler for LFB */
s->cirrus_linear_bitblt_io_addr =
cpu_register_io_memory(0, cirrus_linear_bitblt_read,
cpu_register_io_memory(cirrus_linear_bitblt_read,
cirrus_linear_bitblt_write, s);

/* I/O handler for memory-mapped I/O */
s->cirrus_mmio_io_addr =
cpu_register_io_memory(0, cirrus_mmio_read, cirrus_mmio_write, s);
cpu_register_io_memory(cirrus_mmio_read, cirrus_mmio_write, s);

s->real_vram_size =
(s->device_id == CIRRUS_ID_CLGD5446) ? 4096 * 1024 : 2048 * 1024;
Expand Down
2 changes: 1 addition & 1 deletion hw/cs4231.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void cs_init(target_phys_addr_t base, int irq, void *intctl)

s = qemu_mallocz(sizeof(CSState));

cs_io_memory = cpu_register_io_memory(0, cs_mem_read, cs_mem_write, s);
cs_io_memory = cpu_register_io_memory(cs_mem_read, cs_mem_write, s);
cpu_register_physical_memory(base, CS_SIZE, cs_io_memory);
register_savevm("cs4231", base, 1, cs_save, cs_load, s);
qemu_register_reset(cs_reset, 0, s);
Expand Down
2 changes: 1 addition & 1 deletion hw/cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ void cuda_init (int *cuda_mem_index, qemu_irq irq)
s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET;

s->adb_poll_timer = qemu_new_timer(vm_clock, cuda_adb_poll, s);
*cuda_mem_index = cpu_register_io_memory(0, cuda_read, cuda_write, s);
*cuda_mem_index = cpu_register_io_memory(cuda_read, cuda_write, s);
register_savevm("cuda", -1, 1, cuda_save, cuda_load, s);
qemu_register_reset(cuda_reset, 0, s);
cuda_reset(s);
Expand Down
2 changes: 1 addition & 1 deletion hw/dp8393x.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,6 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
qemu_register_reset(nic_reset, 0, s);
nic_reset(s);

s->mmio_index = cpu_register_io_memory(0, dp8393x_read, dp8393x_write, s);
s->mmio_index = cpu_register_io_memory(dp8393x_read, dp8393x_write, s);
cpu_register_physical_memory(base, 0x40 << it_shift, s->mmio_index);
}
4 changes: 2 additions & 2 deletions hw/ds1225y.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ void *ds1225y_init(target_phys_addr_t mem_base, const char *filename)
}

/* Read/write memory */
mem_indexRW = cpu_register_io_memory(0, nvram_read, nvram_write, s);
mem_indexRW = cpu_register_io_memory(nvram_read, nvram_write, s);
cpu_register_physical_memory(mem_base, s->chip_size, mem_indexRW);
/* Read/write protected memory */
mem_indexRP = cpu_register_io_memory(0, nvram_read, nvram_write_protected, s);
mem_indexRP = cpu_register_io_memory(nvram_read, nvram_write_protected, s);
cpu_register_physical_memory(mem_base + s->chip_size, s->chip_size, mem_indexRP);
return s;
}
2 changes: 1 addition & 1 deletion hw/e1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ static void pci_e1000_init(PCIDevice *pci_dev)

pci_conf[0x3d] = 1; // interrupt pin 0

d->mmio_index = cpu_register_io_memory(0, e1000_mmio_read,
d->mmio_index = cpu_register_io_memory(e1000_mmio_read,
e1000_mmio_write, d);

pci_register_io_region((PCIDevice *)d, 0, PNPMMIO_SIZE,
Expand Down
4 changes: 2 additions & 2 deletions hw/eccmemctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@ void * ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
s->regs[0] = version;
s->irq = irq;

ecc_io_memory = cpu_register_io_memory(0, ecc_mem_read, ecc_mem_write, s);
ecc_io_memory = cpu_register_io_memory(ecc_mem_read, ecc_mem_write, s);
cpu_register_physical_memory(base, ECC_SIZE, ecc_io_memory);
if (version == ECC_MCC) { // SS-600MP only
ecc_io_memory = cpu_register_io_memory(0, ecc_diag_mem_read,
ecc_io_memory = cpu_register_io_memory(ecc_diag_mem_read,
ecc_diag_mem_write, s);
cpu_register_physical_memory(base + 0x1000, ECC_DIAG_SIZE,
ecc_io_memory);
Expand Down
2 changes: 1 addition & 1 deletion hw/eepro100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ static void nic_init(PCIDevice *pci_dev, uint32_t device)

/* Handler for memory-mapped I/O */
d->eepro100.mmio_index =
cpu_register_io_memory(0, pci_mmio_read, pci_mmio_write, s);
cpu_register_io_memory(pci_mmio_read, pci_mmio_write, s);

pci_register_io_region(&d->dev, 0, PCI_MEM_SIZE,
PCI_ADDRESS_SPACE_MEM |
Expand Down
4 changes: 2 additions & 2 deletions hw/escc.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB,

s = qemu_mallocz(sizeof(SerialState));

escc_io_memory = cpu_register_io_memory(0, escc_mem_read,
escc_io_memory = cpu_register_io_memory(escc_mem_read,
escc_mem_write,
s);
if (base)
Expand Down Expand Up @@ -922,7 +922,7 @@ void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,
s->chn[0].disabled = disabled;
s->chn[1].disabled = disabled;

slavio_serial_io_memory = cpu_register_io_memory(0, escc_mem_read,
slavio_serial_io_memory = cpu_register_io_memory(escc_mem_read,
escc_mem_write,
s);
cpu_register_physical_memory(base, ESCC_SIZE << it_shift,
Expand Down
2 changes: 1 addition & 1 deletion hw/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ static void esp_init1(SysBusDevice *dev)
s->dma_memory_write = qdev_get_prop_ptr(&dev->qdev, "dma_memory_write");
s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma_opaque");

esp_io_memory = cpu_register_io_memory(0, esp_mem_read, esp_mem_write, s);
esp_io_memory = cpu_register_io_memory(esp_mem_read, esp_mem_write, s);
sysbus_init_mmio(dev, ESP_REGS << s->it_shift, esp_io_memory);

esp_reset(s);
Expand Down
2 changes: 1 addition & 1 deletion hw/etraxfs_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels)
ctrl->nr_channels = nr_channels;
ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels);

ctrl->map = cpu_register_io_memory(0, dma_read, dma_write, ctrl);
ctrl->map = cpu_register_io_memory(dma_read, dma_write, ctrl);
cpu_register_physical_memory(base, nr_channels * 0x2000, ctrl->map);
return ctrl;
}
2 changes: 1 addition & 1 deletion hw/etraxfs_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)
tdk_init(&eth->phy);
mdio_attach(&eth->mdio_bus, &eth->phy, eth->phyaddr);

eth->ethregs = cpu_register_io_memory(0, eth_read, eth_write, eth);
eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth);
cpu_register_physical_memory (base, 0x5c, eth->ethregs);

eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
Expand Down
2 changes: 1 addition & 1 deletion hw/etraxfs_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static void etraxfs_pic_init(SysBusDevice *dev)
sysbus_init_irq(dev, &s->parent_irq);
sysbus_init_irq(dev, &s->parent_nmi);

intr_vect_regs = cpu_register_io_memory(0, pic_read, pic_write, s);
intr_vect_regs = cpu_register_io_memory(pic_read, pic_write, s);
sysbus_init_mmio(dev, R_MAX * 4, intr_vect_regs);
}

Expand Down
2 changes: 1 addition & 1 deletion hw/etraxfs_ser.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static void etraxfs_ser_init(SysBusDevice *dev)
s->regs[RS_STAT_DIN] |= (1 << STAT_TR_IDLE);

sysbus_init_irq(dev, &s->irq);
ser_regs = cpu_register_io_memory(0, ser_read, ser_write, s);
ser_regs = cpu_register_io_memory(ser_read, ser_write, s);
sysbus_init_mmio(dev, R_MAX * 4, ser_regs);
s->chr = qdev_init_chardev(&dev->qdev);
if (s->chr)
Expand Down
2 changes: 1 addition & 1 deletion hw/etraxfs_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static void etraxfs_timer_init(SysBusDevice *dev)
sysbus_init_irq(dev, &t->irq);
sysbus_init_irq(dev, &t->nmi);

timer_regs = cpu_register_io_memory(0, timer_read, timer_write, t);
timer_regs = cpu_register_io_memory(timer_read, timer_write, t);
sysbus_init_mmio(dev, 0x5c, timer_regs);

qemu_register_reset(etraxfs_timer_reset, 0, t);
Expand Down
4 changes: 2 additions & 2 deletions hw/fdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,

fdctrl->sun4m = 0;
if (mem_mapped) {
io_mem = cpu_register_io_memory(0, fdctrl_mem_read, fdctrl_mem_write,
io_mem = cpu_register_io_memory(fdctrl_mem_read, fdctrl_mem_write,
fdctrl);
cpu_register_physical_memory(io_base, 0x08, io_mem);
} else {
Expand All @@ -1927,7 +1927,7 @@ fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base,

fdctrl = fdctrl_init_common(irq, -1, io_base, fds);
fdctrl->sun4m = 1;
io_mem = cpu_register_io_memory(0, fdctrl_mem_read_strict,
io_mem = cpu_register_io_memory(fdctrl_mem_read_strict,
fdctrl_mem_write_strict,
fdctrl);
cpu_register_physical_memory(io_base, 0x08, io_mem);
Expand Down
4 changes: 2 additions & 2 deletions hw/fw_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
register_ioport_write(data_port, 1, 1, fw_cfg_io_writeb, s);
}
if (ctl_addr) {
io_ctl_memory = cpu_register_io_memory(0, fw_cfg_ctl_mem_read,
io_ctl_memory = cpu_register_io_memory(fw_cfg_ctl_mem_read,
fw_cfg_ctl_mem_write, s);
cpu_register_physical_memory(ctl_addr, FW_CFG_SIZE, io_ctl_memory);
}
if (data_addr) {
io_data_memory = cpu_register_io_memory(0, fw_cfg_data_mem_read,
io_data_memory = cpu_register_io_memory(fw_cfg_data_mem_read,
fw_cfg_data_mem_write, s);
cpu_register_physical_memory(data_addr, FW_CFG_SIZE, io_data_memory);
}
Expand Down
2 changes: 1 addition & 1 deletion hw/g364fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ int g364fb_mm_init(target_phys_addr_t vram_base,

cpu_register_physical_memory(vram_base, s->vram_size, s->vram_offset);

io_ctrl = cpu_register_io_memory(0, g364fb_ctrl_read, g364fb_ctrl_write, s);
io_ctrl = cpu_register_io_memory(g364fb_ctrl_read, g364fb_ctrl_write, s);
cpu_register_physical_memory(ctrl_base, 0x200000, io_ctrl);

return 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/grackle_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic)
pci_grackle_set_irq, pci_grackle_map_irq,
pic, 0, 4);

pci_mem_config = cpu_register_io_memory(0, pci_grackle_config_read,
pci_mem_config = cpu_register_io_memory(pci_grackle_config_read,
pci_grackle_config_write, s);
pci_mem_data = cpu_register_io_memory(0, pci_grackle_read,
pci_mem_data = cpu_register_io_memory(pci_grackle_read,
pci_grackle_write, s);
cpu_register_physical_memory(base, 0x1000, pci_mem_config);
cpu_register_physical_memory(base + 0x00200000, 0x1000, pci_mem_data);
Expand Down
Loading

0 comments on commit 1eed09c

Please sign in to comment.