Revision b0a941b0 hw/empty_slot.c

b/hw/empty_slot.c
24 24

  
25 25
typedef struct EmptySlot {
26 26
    SysBusDevice busdev;
27
    MemoryRegion iomem;
27 28
    uint64_t size;
28 29
} EmptySlot;
29 30

  
30
static uint32_t empty_slot_readl(void *opaque, target_phys_addr_t addr)
31
static uint64_t empty_slot_read(void *opaque, target_phys_addr_t addr,
32
                                unsigned size)
31 33
{
32 34
    DPRINTF("read from " TARGET_FMT_plx "\n", addr);
33 35
    return 0;
34 36
}
35 37

  
36
static void empty_slot_writel(void *opaque, target_phys_addr_t addr,
37
                              uint32_t val)
38
static void empty_slot_write(void *opaque, target_phys_addr_t addr,
39
                             uint64_t val, unsigned size)
38 40
{
39
    DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", val, addr);
41
    DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", (unsigned)val, addr);
40 42
}
41 43

  
42
CPUReadMemoryFunc * const empty_slot_read[3] = {
43
    empty_slot_readl,
44
    empty_slot_readl,
45
    empty_slot_readl,
46
};
47

  
48
static CPUWriteMemoryFunc * const empty_slot_write[3] = {
49
    empty_slot_writel,
50
    empty_slot_writel,
51
    empty_slot_writel,
44
static const MemoryRegionOps empty_slot_ops = {
45
    .read = empty_slot_read,
46
    .write = empty_slot_write,
47
    .endianness = DEVICE_NATIVE_ENDIAN,
52 48
};
53 49

  
54 50
void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size)
......
73 69
static int empty_slot_init1(SysBusDevice *dev)
74 70
{
75 71
    EmptySlot *s = FROM_SYSBUS(EmptySlot, dev);
76
    ram_addr_t empty_slot_offset;
77 72

  
78
    empty_slot_offset = cpu_register_io_memory(empty_slot_read,
79
                                               empty_slot_write, s,
80
                                               DEVICE_NATIVE_ENDIAN);
81
    sysbus_init_mmio(dev, s->size, empty_slot_offset | IO_MEM_RAM);
73
    memory_region_init_io(&s->iomem, &empty_slot_ops, s,
74
                          "empty-slot", s->size);
75
    sysbus_init_mmio_region(dev, &s->iomem);
82 76
    return 0;
83 77
}
84 78

  

Also available in: Unified diff