Revision 8da3ff18 hw/pl031.c

b/hw/pl031.c
35 35
typedef struct {
36 36
    QEMUTimer *timer;
37 37
    qemu_irq irq;
38
    uint32_t base;
39 38

  
40 39
    uint64_t start_time;
41 40
    uint32_t tick_offset;
......
97 96
{
98 97
    pl031_state *s = (pl031_state *)opaque;
99 98

  
100
    offset -= s->base;
101

  
102 99
    if (offset >= 0xfe0  &&  offset < 0x1000)
103 100
        return pl031_id[(offset - 0xfe0) >> 2];
104 101

  
......
136 133
{
137 134
    pl031_state *s = (pl031_state *)opaque;
138 135

  
139
    offset -= s->base;
140 136

  
141 137
    switch (offset) {
142 138
    case RTC_LR:
......
207 203

  
208 204
    cpu_register_physical_memory(base, 0x00001000, iomemtype);
209 205

  
210
    s->base = base;
211 206
    s->irq  = irq;
212 207
    /* ??? We assume vm_clock is zero at this point.  */
213 208
    qemu_get_timedate(&tm, 0);

Also available in: Unified diff