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/etraxfs_dma.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/etraxfs_dma.c')
-rw-r--r-- | hw/etraxfs_dma.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/hw/etraxfs_dma.c b/hw/etraxfs_dma.c index 2e5de50cf6..54e55d1288 100644 --- a/hw/etraxfs_dma.c +++ b/hw/etraxfs_dma.c @@ -188,7 +188,6 @@ struct fs_dma_channel struct fs_dma_ctrl { CPUState *env; - target_phys_addr_t base; int nr_channels; struct fs_dma_channel *channels; @@ -212,10 +211,10 @@ static inline int channel_en(struct fs_dma_ctrl *ctrl, int c) && ctrl->channels[c].client; } -static inline int fs_channel(target_phys_addr_t base, target_phys_addr_t addr) +static inline int fs_channel(target_phys_addr_t addr) { /* Every channel has a 0x2000 ctrl register map. */ - return (addr - base) >> 13; + return addr >> 13; } #ifdef USE_THIS_DEAD_CODE @@ -572,7 +571,7 @@ dma_readl (void *opaque, target_phys_addr_t addr) uint32_t r = 0; /* Make addr relative to this instances base. */ - c = fs_channel(ctrl->base, addr); + c = fs_channel(addr); addr &= 0x1fff; switch (addr) { @@ -618,7 +617,7 @@ dma_writel (void *opaque, target_phys_addr_t addr, uint32_t value) int c; /* Make addr relative to this instances base. */ - c = fs_channel(ctrl->base, addr); + c = fs_channel(addr); addr &= 0x1fff; switch (addr) { @@ -753,7 +752,6 @@ void *etraxfs_dmac_init(CPUState *env, ctrl->bh = qemu_bh_new(DMA_run, ctrl); - ctrl->base = base; ctrl->env = env; ctrl->nr_channels = nr_channels; ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels); @@ -766,9 +764,9 @@ void *etraxfs_dmac_init(CPUState *env, dma_read, dma_write, ctrl); - cpu_register_physical_memory (base + i * 0x2000, - sizeof ctrl->channels[i].regs, - ctrl->channels[i].regmap); + cpu_register_physical_memory_offset (base + i * 0x2000, + sizeof ctrl->channels[i].regs, ctrl->channels[i].regmap, + i * 0x2000); } return ctrl; |