Revision 8da3ff18 hw/pl022.c

b/hw/pl022.c
40 40
#define PL022_INT_TX  0x08
41 41

  
42 42
typedef struct {
43
    uint32_t base;
44 43
    uint32_t cr0;
45 44
    uint32_t cr1;
46 45
    uint32_t bitmask;
......
137 136
    pl022_state *s = (pl022_state *)opaque;
138 137
    int val;
139 138

  
140
    offset -= s->base;
141 139
    if (offset >= 0xfe0 && offset < 0x1000) {
142 140
        return pl022_id[(offset - 0xfe0) >> 2];
143 141
    }
......
181 179
{
182 180
    pl022_state *s = (pl022_state *)opaque;
183 181

  
184
    offset -= s->base;
185 182
    switch (offset) {
186 183
    case 0x00: /* CR0 */
187 184
        s->cr0 = value;
......
303 300
    iomemtype = cpu_register_io_memory(0, pl022_readfn,
304 301
                                       pl022_writefn, s);
305 302
    cpu_register_physical_memory(base, 0x00001000, iomemtype);
306
    s->base = base;
307 303
    s->irq = irq;
308 304
    s->xfer_cb = xfer_cb;
309 305
    s->opaque = opaque;

Also available in: Unified diff