Revision 8da3ff18 hw/pl050.c

b/hw/pl050.c
13 13

  
14 14
typedef struct {
15 15
    void *dev;
16
    uint32_t base;
17 16
    uint32_t cr;
18 17
    uint32_t clk;
19 18
    uint32_t last;
......
47 46
static uint32_t pl050_read(void *opaque, target_phys_addr_t offset)
48 47
{
49 48
    pl050_state *s = (pl050_state *)opaque;
50
    offset -= s->base;
51 49
    if (offset >= 0xfe0 && offset < 0x1000)
52 50
        return pl050_id[(offset - 0xfe0) >> 2];
53 51

  
......
90 88
                          uint32_t value)
91 89
{
92 90
    pl050_state *s = (pl050_state *)opaque;
93
    offset -= s->base;
94 91
    switch (offset >> 2) {
95 92
    case 0: /* KMICR */
96 93
        s->cr = value;
......
134 131
    iomemtype = cpu_register_io_memory(0, pl050_readfn,
135 132
                                       pl050_writefn, s);
136 133
    cpu_register_physical_memory(base, 0x00001000, iomemtype);
137
    s->base = base;
138 134
    s->irq = irq;
139 135
    s->is_mouse = is_mouse;
140 136
    if (is_mouse)

Also available in: Unified diff