Revision 8da3ff18 hw/pl061.c
b/hw/pl061.c | ||
---|---|---|
28 | 28 |
{ 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x18, 0x01, 0x0d, 0xf0, 0x05, 0xb1 }; |
29 | 29 |
|
30 | 30 |
typedef struct { |
31 |
uint32_t base; |
|
32 | 31 |
int locked; |
33 | 32 |
uint8_t data; |
34 | 33 |
uint8_t old_data; |
... | ... | |
83 | 82 |
{ |
84 | 83 |
pl061_state *s = (pl061_state *)opaque; |
85 | 84 |
|
86 |
offset -= s->base; |
|
87 | 85 |
if (offset >= 0xfd0 && offset < 0x1000) { |
88 | 86 |
return pl061_id[(offset - 0xfd0) >> 2]; |
89 | 87 |
} |
... | ... | |
140 | 138 |
pl061_state *s = (pl061_state *)opaque; |
141 | 139 |
uint8_t mask; |
142 | 140 |
|
143 |
offset -= s->base; |
|
144 | 141 |
if (offset < 0x400) { |
145 | 142 |
mask = (offset >> 2) & s->dir; |
146 | 143 |
s->data = (s->data & ~mask) | (value & mask); |
... | ... | |
306 | 303 |
iomemtype = cpu_register_io_memory(0, pl061_readfn, |
307 | 304 |
pl061_writefn, s); |
308 | 305 |
cpu_register_physical_memory(base, 0x00001000, iomemtype); |
309 |
s->base = base; |
|
310 | 306 |
s->irq = irq; |
311 | 307 |
pl061_reset(s); |
312 | 308 |
if (out) |
Also available in: Unified diff