Revision b8f7a738 hw/pl050.c
b/hw/pl050.c | ||
---|---|---|
12 | 12 |
|
13 | 13 |
typedef struct { |
14 | 14 |
SysBusDevice busdev; |
15 |
MemoryRegion iomem; |
|
15 | 16 |
void *dev; |
16 | 17 |
uint32_t cr; |
17 | 18 |
uint32_t clk; |
... | ... | |
57 | 58 |
qemu_set_irq(s->irq, raise); |
58 | 59 |
} |
59 | 60 |
|
60 |
static uint32_t pl050_read(void *opaque, target_phys_addr_t offset) |
|
61 |
static uint64_t pl050_read(void *opaque, target_phys_addr_t offset, |
|
62 |
unsigned size) |
|
61 | 63 |
{ |
62 | 64 |
pl050_state *s = (pl050_state *)opaque; |
63 | 65 |
if (offset >= 0xfe0 && offset < 0x1000) |
... | ... | |
99 | 101 |
} |
100 | 102 |
|
101 | 103 |
static void pl050_write(void *opaque, target_phys_addr_t offset, |
102 |
uint32_t value)
|
|
104 |
uint64_t value, unsigned size)
|
|
103 | 105 |
{ |
104 | 106 |
pl050_state *s = (pl050_state *)opaque; |
105 | 107 |
switch (offset >> 2) { |
... | ... | |
124 | 126 |
hw_error("pl050_write: Bad offset %x\n", (int)offset); |
125 | 127 |
} |
126 | 128 |
} |
127 |
static CPUReadMemoryFunc * const pl050_readfn[] = { |
|
128 |
pl050_read, |
|
129 |
pl050_read, |
|
130 |
pl050_read |
|
131 |
}; |
|
132 |
|
|
133 |
static CPUWriteMemoryFunc * const pl050_writefn[] = { |
|
134 |
pl050_write, |
|
135 |
pl050_write, |
|
136 |
pl050_write |
|
129 |
static const MemoryRegionOps pl050_ops = { |
|
130 |
.read = pl050_read, |
|
131 |
.write = pl050_write, |
|
132 |
.endianness = DEVICE_NATIVE_ENDIAN, |
|
137 | 133 |
}; |
138 | 134 |
|
139 | 135 |
static int pl050_init(SysBusDevice *dev, int is_mouse) |
140 | 136 |
{ |
141 | 137 |
pl050_state *s = FROM_SYSBUS(pl050_state, dev); |
142 |
int iomemtype; |
|
143 | 138 |
|
144 |
iomemtype = cpu_register_io_memory(pl050_readfn, |
|
145 |
pl050_writefn, s, |
|
146 |
DEVICE_NATIVE_ENDIAN); |
|
147 |
sysbus_init_mmio(dev, 0x1000, iomemtype); |
|
139 |
memory_region_init_io(&s->iomem, &pl050_ops, s, "pl050", 0x1000); |
|
140 |
sysbus_init_mmio_region(dev, &s->iomem); |
|
148 | 141 |
sysbus_init_irq(dev, &s->irq); |
149 | 142 |
s->is_mouse = is_mouse; |
150 | 143 |
if (s->is_mouse) |
Also available in: Unified diff