aboutsummaryrefslogtreecommitdiff
path: root/hw/sh_serial.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-01 18:59:50 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-01 18:59:50 +0000
commit8da3ff180974732fc4272cb4433fef85c1822961 (patch)
treef23cfaffa61efb36aa46dfeb771ad33cbfd4f3aa /hw/sh_serial.c
parent6ad1d22b15c0a091edb1d8efc983c1d75f74ef45 (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/sh_serial.c')
-rw-r--r--hw/sh_serial.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/hw/sh_serial.c b/hw/sh_serial.c
index 814bd38a5a..8397739de9 100644
--- a/hw/sh_serial.c
+++ b/hw/sh_serial.c
@@ -53,7 +53,6 @@ typedef struct {
uint8_t rx_tail;
uint8_t rx_head;
- target_phys_addr_t base;
int freq;
int feat;
int flags;
@@ -82,8 +81,8 @@ static void sh_serial_ioport_write(void *opaque, uint32_t offs, uint32_t val)
unsigned char ch;
#ifdef DEBUG_SERIAL
- printf("sh_serial: write base=0x%08lx offs=0x%02x val=0x%02x\n",
- (unsigned long) s->base, offs, val);
+ printf("sh_serial: write offs=0x%02x val=0x%02x\n",
+ offs, val);
#endif
switch(offs) {
case 0x00: /* SMR */
@@ -278,8 +277,8 @@ static uint32_t sh_serial_ioport_read(void *opaque, uint32_t offs)
#endif
}
#ifdef DEBUG_SERIAL
- printf("sh_serial: read base=0x%08lx offs=0x%02x val=0x%x\n",
- (unsigned long) s->base, offs, ret);
+ printf("sh_serial: read offs=0x%02x val=0x%x\n",
+ offs, ret);
#endif
if (ret & ~((1 << 16) - 1)) {
@@ -343,14 +342,14 @@ static void sh_serial_event(void *opaque, int event)
static uint32_t sh_serial_read (void *opaque, target_phys_addr_t addr)
{
sh_serial_state *s = opaque;
- return sh_serial_ioport_read(s, addr - s->base);
+ return sh_serial_ioport_read(s, addr);
}
static void sh_serial_write (void *opaque,
target_phys_addr_t addr, uint32_t value)
{
sh_serial_state *s = opaque;
- sh_serial_ioport_write(s, addr - s->base, value);
+ sh_serial_ioport_write(s, addr, value);
}
static CPUReadMemoryFunc *sh_serial_readfn[] = {
@@ -380,7 +379,6 @@ void sh_serial_init (target_phys_addr_t base, int feat,
if (!s)
return;
- s->base = base;
s->feat = feat;
s->flags = SH_SERIAL_FLAG_TEND | SH_SERIAL_FLAG_TDE;
s->rtrg = 1;