Revision 8da3ff18 hw/arm_sysctl.c

b/hw/arm_sysctl.c
14 14
#define LOCK_VALUE 0xa05f
15 15

  
16 16
typedef struct {
17
    uint32_t base;
18 17
    uint32_t sys_id;
19 18
    uint32_t leds;
20 19
    uint16_t lockval;
......
29 28
{
30 29
    arm_sysctl_state *s = (arm_sysctl_state *)opaque;
31 30

  
32
    offset -= s->base;
33 31
    switch (offset) {
34 32
    case 0x00: /* ID */
35 33
        return s->sys_id;
......
108 106
                          uint32_t val)
109 107
{
110 108
    arm_sysctl_state *s = (arm_sysctl_state *)opaque;
111
    offset -= s->base;
112 109

  
113 110
    switch (offset) {
114 111
    case 0x08: /* LED */
......
199 196
    s = (arm_sysctl_state *)qemu_mallocz(sizeof(arm_sysctl_state));
200 197
    if (!s)
201 198
        return;
202
    s->base = base;
203 199
    s->sys_id = sys_id;
204 200
    /* The MPcore bootloader uses these flags to start secondary CPUs.
205 201
       We don't use a bootloader, so do this here.  */

Also available in: Unified diff