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/onenand.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/onenand.c')
-rw-r--r-- | hw/onenand.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/onenand.c b/hw/onenand.c index 762da278a3..9bf4630c47 100644 --- a/hw/onenand.c +++ b/hw/onenand.c @@ -113,8 +113,8 @@ void onenand_base_update(void *opaque, target_phys_addr_t new) 0xbe00 << s->shift, (s->ram +(0x0200 << s->shift)) | IO_MEM_RAM); if (s->iomemtype) - cpu_register_physical_memory(s->base + (0xc000 << s->shift), - 0x4000 << s->shift, s->iomemtype); + cpu_register_physical_memory_offset(s->base + (0xc000 << s->shift), + 0x4000 << s->shift, s->iomemtype, (0xc000 << s->shift)); } void onenand_base_unmap(void *opaque) @@ -449,11 +449,11 @@ static void onenand_command(struct onenand_s *s, int cmd) static uint32_t onenand_read(void *opaque, target_phys_addr_t addr) { struct onenand_s *s = (struct onenand_s *) opaque; - int offset = (addr - s->base) >> s->shift; + int offset = addr >> s->shift; switch (offset) { case 0x0000 ... 0xc000: - return lduw_le_p(s->boot[0] + (addr - s->base)); + return lduw_le_p(s->boot[0] + addr); case 0xf000: /* Manufacturer ID */ return (s->id >> 16) & 0xff; @@ -514,7 +514,7 @@ static void onenand_write(void *opaque, target_phys_addr_t addr, uint32_t value) { struct onenand_s *s = (struct onenand_s *) opaque; - int offset = (addr - s->base) >> s->shift; + int offset = addr >> s->shift; int sec; switch (offset) { |