Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
ppce500_pci: convert to sysbus_init_mmio_cb2()
Browse files Browse the repository at this point in the history
Not a huge step forward, but at least we now have a 1:1 relationship
between registration and unregistration.

Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
avikivity authored and Anthony Liguori committed Aug 22, 2011
1 parent 45de094 commit cd0fa1e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hw/ppce500_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ static void e500_pci_map(SysBusDevice *dev, target_phys_addr_t base)
s->reg);
}

static void e500_pci_unmap(SysBusDevice *dev, target_phys_addr_t base)
{
cpu_register_physical_memory(base + PCIE500_CFGADDR, 4,
IO_MEM_UNASSIGNED);
cpu_register_physical_memory(base + PCIE500_CFGDATA, 4,
IO_MEM_UNASSIGNED);
cpu_register_physical_memory(base + PCIE500_REG_BASE, PCIE500_REG_SIZE,
IO_MEM_UNASSIGNED);
}

#include "exec-memory.h"

static int e500_pcihost_initfn(SysBusDevice *dev)
Expand Down Expand Up @@ -304,7 +314,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
DEVICE_LITTLE_ENDIAN);
s->reg = cpu_register_io_memory(e500_pci_reg_read, e500_pci_reg_write, s,
DEVICE_BIG_ENDIAN);
sysbus_init_mmio_cb(dev, PCIE500_ALL_SIZE, e500_pci_map);
sysbus_init_mmio_cb2(dev, e500_pci_map, e500_pci_unmap);

return 0;
}
Expand Down

0 comments on commit cd0fa1e

Please sign in to comment.