Revision 8da3ff18 hw/pxa2xx_pic.c
b/hw/pxa2xx_pic.c | ||
---|---|---|
31 | 31 |
#define PXA2XX_PIC_SRCS 40 |
32 | 32 |
|
33 | 33 |
struct pxa2xx_pic_state_s { |
34 |
target_phys_addr_t base; |
|
35 | 34 |
CPUState *cpu_env; |
36 | 35 |
uint32_t int_enabled[2]; |
37 | 36 |
uint32_t int_pending[2]; |
... | ... | |
117 | 116 |
static uint32_t pxa2xx_pic_mem_read(void *opaque, target_phys_addr_t offset) |
118 | 117 |
{ |
119 | 118 |
struct pxa2xx_pic_state_s *s = (struct pxa2xx_pic_state_s *) opaque; |
120 |
offset -= s->base; |
|
121 | 119 |
|
122 | 120 |
switch (offset) { |
123 | 121 |
case ICIP: /* IRQ Pending register */ |
... | ... | |
158 | 156 |
uint32_t value) |
159 | 157 |
{ |
160 | 158 |
struct pxa2xx_pic_state_s *s = (struct pxa2xx_pic_state_s *) opaque; |
161 |
offset -= s->base; |
|
162 | 159 |
|
163 | 160 |
switch (offset) { |
164 | 161 |
case ICMR: /* Mask register */ |
... | ... | |
207 | 204 |
|
208 | 205 |
static uint32_t pxa2xx_pic_cp_read(void *opaque, int op2, int reg, int crm) |
209 | 206 |
{ |
210 |
struct pxa2xx_pic_state_s *s = (struct pxa2xx_pic_state_s *) opaque; |
|
211 | 207 |
target_phys_addr_t offset; |
212 | 208 |
|
213 | 209 |
if (pxa2xx_cp_reg_map[reg] == -1) { |
... | ... | |
215 | 211 |
return 0; |
216 | 212 |
} |
217 | 213 |
|
218 |
offset = s->base + pxa2xx_cp_reg_map[reg];
|
|
214 |
offset = pxa2xx_cp_reg_map[reg]; |
|
219 | 215 |
return pxa2xx_pic_mem_read(opaque, offset); |
220 | 216 |
} |
221 | 217 |
|
222 | 218 |
static void pxa2xx_pic_cp_write(void *opaque, int op2, int reg, int crm, |
223 | 219 |
uint32_t value) |
224 | 220 |
{ |
225 |
struct pxa2xx_pic_state_s *s = (struct pxa2xx_pic_state_s *) opaque; |
|
226 | 221 |
target_phys_addr_t offset; |
227 | 222 |
|
228 | 223 |
if (pxa2xx_cp_reg_map[reg] == -1) { |
... | ... | |
230 | 225 |
return; |
231 | 226 |
} |
232 | 227 |
|
233 |
offset = s->base + pxa2xx_cp_reg_map[reg];
|
|
228 |
offset = pxa2xx_cp_reg_map[reg]; |
|
234 | 229 |
pxa2xx_pic_mem_write(opaque, offset, value); |
235 | 230 |
} |
236 | 231 |
|
... | ... | |
293 | 288 |
return NULL; |
294 | 289 |
|
295 | 290 |
s->cpu_env = env; |
296 |
s->base = base; |
|
297 | 291 |
|
298 | 292 |
s->int_pending[0] = 0; |
299 | 293 |
s->int_pending[1] = 0; |
Also available in: Unified diff