Revision 8da3ff18 hw/zaurus.c

b/hw/zaurus.c
31 31
/* SCOOP devices */
32 32

  
33 33
struct scoop_info_s {
34
    target_phys_addr_t target_base;
35 34
    qemu_irq handler[16];
36 35
    qemu_irq *in;
37 36
    uint16_t status;
......
76 75
static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr)
77 76
{
78 77
    struct scoop_info_s *s = (struct scoop_info_s *) opaque;
79
    addr -= s->target_base;
80 78

  
81 79
    switch (addr) {
82 80
    case SCOOP_MCR:
......
110 108
static void scoop_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
111 109
{
112 110
    struct scoop_info_s *s = (struct scoop_info_s *) opaque;
113
    addr -= s->target_base;
114 111
    value &= 0xffff;
115 112

  
116 113
    switch (addr) {
......
234 231
            qemu_mallocz(sizeof(struct scoop_info_s));
235 232
    memset(s, 0, sizeof(struct scoop_info_s));
236 233

  
237
    s->target_base = target_base;
238 234
    s->status = 0x02;
239 235
    s->in = qemu_allocate_irqs(scoop_gpio_set, s, 16);
240 236
    iomemtype = cpu_register_io_memory(0, scoop_readfn,
241 237
                    scoop_writefn, s);
242
    cpu_register_physical_memory(s->target_base, 0x1000, iomemtype);
238
    cpu_register_physical_memory(target_base, 0x1000, iomemtype);
243 239
    register_savevm("scoop", instance, 1, scoop_save, scoop_load, s);
244 240

  
245 241
    return s;

Also available in: Unified diff