On 08.08.2011, at 15:09, Avi Kivity wrote: > Reviewed-by: Richard Henderson <r...@twiddle.net> > Reviewed-by: Anthony Liguori <aligu...@us.ibm.com> > Signed-off-by: Avi Kivity <a...@redhat.com> > --- > hw/cuda.c | 6 ++- > hw/escc.c | 42 +++++++++++++-------------- > hw/escc.h | 2 +- > hw/heathrow_pic.c | 29 ++++++++---------- > hw/ide.h | 2 +- > hw/ide/macio.c | 36 ++++++++++++----------- > hw/mac_dbdma.c | 32 ++++++++++---------- > hw/mac_dbdma.h | 4 ++- > hw/mac_nvram.c | 39 ++++++++++--------------- > hw/macio.c | 74 +++++++++++++++++++++++------------------------- > hw/openpic.c | 81 +++++++++++++++++++++++++---------------------------- > hw/openpic.h | 2 +- > hw/ppc_mac.h | 16 ++++++---- > hw/ppc_newworld.c | 30 +++++++++---------- > hw/ppc_oldworld.c | 23 +++++++-------- > 15 files changed, 201 insertions(+), 217 deletions(-) > >
[...] > @@ -89,7 +91,8 @@ static void pic_writel (void *opaque, target_phys_addr_t > addr, uint32_t value) > } > } > > -static uint32_t pic_readl (void *opaque, target_phys_addr_t addr) > +static uint64_t pic_read(void *opaque, target_phys_addr_t addr, > + unsigned size) > { > HeathrowPICS *s = opaque; > HeathrowPIC *pic; > @@ -120,19 +123,12 @@ static uint32_t pic_readl (void *opaque, > target_phys_addr_t addr) > return value; > } > > -static CPUWriteMemoryFunc * const pic_write[] = { > - &pic_writel, > - &pic_writel, > - &pic_writel, > +static const MemoryRegionOps heathrow_pic_ops = { > + .read = pic_read, > + .write = pic_write, > + .endianness = DEVICE_NATIVE_ENDIAN, native endian > }; > > -static CPUReadMemoryFunc * const pic_read[] = { > - &pic_readl, > - &pic_readl, > - &pic_readl, > -}; > - > - > static void heathrow_pic_set_irq(void *opaque, int num, int level) > { > HeathrowPICS *s = opaque; > @@ -201,7 +197,7 @@ static void heathrow_pic_reset(void *opaque) > s->pics[1].level_triggered = 0x1ff00000; > } > > -qemu_irq *heathrow_pic_init(int *pmem_index, > +qemu_irq *heathrow_pic_init(MemoryRegion **pmem, > int nb_cpus, qemu_irq **irqs) > { > HeathrowPICS *s; > @@ -209,8 +205,9 @@ qemu_irq *heathrow_pic_init(int *pmem_index, > s = qemu_mallocz(sizeof(HeathrowPICS)); > /* only 1 CPU */ > s->irqs = irqs[0]; > - *pmem_index = cpu_register_io_memory(pic_read, pic_write, s, > - DEVICE_LITTLE_ENDIAN); little endian. So you're changing the endianness of the calls? Not nice. Alex