diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-01 18:59:50 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-01 18:59:50 +0000 |
commit | 8da3ff180974732fc4272cb4433fef85c1822961 (patch) | |
tree | f23cfaffa61efb36aa46dfeb771ad33cbfd4f3aa /hw/e1000.c | |
parent | 6ad1d22b15c0a091edb1d8efc983c1d75f74ef45 (diff) |
Change MMIO callbacks to use offsets, not absolute addresses.
Signed-off-by: Paul Brook <paul@codesourcery.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/e1000.c')
-rw-r--r-- | hw/e1000.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/e1000.c b/hw/e1000.c index 71781e6e9..f07936fdc 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -76,7 +76,6 @@ typedef struct E1000State_st { PCIDevice dev; VLANClientState *vc; NICInfo *nd; - uint32_t mmio_base; int mmio_index; uint32_t mac_reg[0x8000]; @@ -786,7 +785,7 @@ static void e1000_mmio_writel(void *opaque, target_phys_addr_t addr, uint32_t val) { E1000State *s = opaque; - unsigned int index = ((addr - s->mmio_base) & 0x1ffff) >> 2; + unsigned int index = (addr & 0x1ffff) >> 2; #ifdef TARGET_WORDS_BIGENDIAN val = bswap32(val); @@ -820,7 +819,7 @@ static uint32_t e1000_mmio_readl(void *opaque, target_phys_addr_t addr) { E1000State *s = opaque; - unsigned int index = ((addr - s->mmio_base) & 0x1ffff) >> 2; + unsigned int index = (addr & 0x1ffff) >> 2; if (index < NREADOPS && macreg_readops[index]) { @@ -870,7 +869,7 @@ nic_save(QEMUFile *f, void *opaque) int i, j; pci_device_save(&s->dev, f); - qemu_put_be32s(f, &s->mmio_base); + qemu_put_be32(f, 0); qemu_put_be32s(f, &s->rxbuf_size); qemu_put_be32s(f, &s->rxbuf_min_shift); qemu_put_be32s(f, &s->eecd_state.val_in); @@ -916,7 +915,7 @@ nic_load(QEMUFile *f, void *opaque, int version_id) return ret; if (version_id == 1) qemu_get_sbe32s(f, &i); /* once some unused instance id */ - qemu_get_be32s(f, &s->mmio_base); + qemu_get_be32(f); /* Ignored. Was mmio_base. */ qemu_get_be32s(f, &s->rxbuf_size); qemu_get_be32s(f, &s->rxbuf_min_shift); qemu_get_be32s(f, &s->eecd_state.val_in); @@ -1005,7 +1004,6 @@ e1000_mmio_map(PCIDevice *pci_dev, int region_num, DBGOUT(MMIO, "e1000_mmio_map addr=0x%08x 0x%08x\n", addr, size); - d->mmio_base = addr; cpu_register_physical_memory(addr, PNPMMIO_SIZE, d->mmio_index); } |