Commit 1eed09cb4a0b187427ef1ccefd42579174f20a7c

Authored by Avi Kivity
Committed by Anthony Liguori
1 parent dff84034

Remove io_index argument from cpu_register_io_memory()

The parameter is always zero except when registering the three internal
io regions (ROM, unassigned, notdirty).  Remove the parameter to reduce
the API's power, thus facilitating future change.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 140 changed files with 291 additions and 283 deletions
cpu-common.h
@@ -41,8 +41,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr); @@ -41,8 +41,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr);
41 /* This should not be used by devices. */ 41 /* This should not be used by devices. */
42 ram_addr_t qemu_ram_addr_from_host(void *ptr); 42 ram_addr_t qemu_ram_addr_from_host(void *ptr);
43 43
44 -int cpu_register_io_memory(int io_index,  
45 - CPUReadMemoryFunc **mem_read, 44 +int cpu_register_io_memory(CPUReadMemoryFunc **mem_read,
46 CPUWriteMemoryFunc **mem_write, 45 CPUWriteMemoryFunc **mem_write,
47 void *opaque); 46 void *opaque);
48 void cpu_unregister_io_memory(int table_address); 47 void cpu_unregister_io_memory(int table_address);
@@ -3004,7 +3004,7 @@ static void *subpage_init (target_phys_addr_t base, ram_addr_t *phys, @@ -3004,7 +3004,7 @@ static void *subpage_init (target_phys_addr_t base, ram_addr_t *phys,
3004 mmio = qemu_mallocz(sizeof(subpage_t)); 3004 mmio = qemu_mallocz(sizeof(subpage_t));
3005 3005
3006 mmio->base = base; 3006 mmio->base = base;
3007 - subpage_memory = cpu_register_io_memory(0, subpage_read, subpage_write, mmio); 3007 + subpage_memory = cpu_register_io_memory(subpage_read, subpage_write, mmio);
3008 #if defined(DEBUG_SUBPAGE) 3008 #if defined(DEBUG_SUBPAGE)
3009 printf("%s: %p base " TARGET_FMT_plx " len %08x %d\n", __func__, 3009 printf("%s: %p base " TARGET_FMT_plx " len %08x %d\n", __func__,
3010 mmio, base, TARGET_PAGE_SIZE, subpage_memory); 3010 mmio, base, TARGET_PAGE_SIZE, subpage_memory);
@@ -3029,17 +3029,22 @@ static int get_free_io_mem_idx(void) @@ -3029,17 +3029,22 @@ static int get_free_io_mem_idx(void)
3029 return -1; 3029 return -1;
3030 } 3030 }
3031 3031
  3032 +static int cpu_register_io_memory_fixed(int io_index,
  3033 + CPUReadMemoryFunc **mem_read,
  3034 + CPUWriteMemoryFunc **mem_write,
  3035 + void *opaque);
  3036 +
3032 static void io_mem_init(void) 3037 static void io_mem_init(void)
3033 { 3038 {
3034 int i; 3039 int i;
3035 3040
3036 - cpu_register_io_memory(IO_MEM_ROM >> IO_MEM_SHIFT, error_mem_read, unassigned_mem_write, NULL);  
3037 - cpu_register_io_memory(IO_MEM_UNASSIGNED >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL);  
3038 - cpu_register_io_memory(IO_MEM_NOTDIRTY >> IO_MEM_SHIFT, error_mem_read, notdirty_mem_write, NULL); 3041 + cpu_register_io_memory_fixed(IO_MEM_ROM, error_mem_read, unassigned_mem_write, NULL);
  3042 + cpu_register_io_memory_fixed(IO_MEM_UNASSIGNED, unassigned_mem_read, unassigned_mem_write, NULL);
  3043 + cpu_register_io_memory_fixed(IO_MEM_NOTDIRTY, error_mem_read, notdirty_mem_write, NULL);
3039 for (i=0; i<5; i++) 3044 for (i=0; i<5; i++)
3040 io_mem_used[i] = 1; 3045 io_mem_used[i] = 1;
3041 3046
3042 - io_mem_watch = cpu_register_io_memory(0, watch_mem_read, 3047 + io_mem_watch = cpu_register_io_memory(watch_mem_read,
3043 watch_mem_write, NULL); 3048 watch_mem_write, NULL);
3044 #ifdef CONFIG_KQEMU 3049 #ifdef CONFIG_KQEMU
3045 if (kqemu_phys_ram_base) { 3050 if (kqemu_phys_ram_base) {
@@ -3057,10 +3062,10 @@ static void io_mem_init(void) @@ -3057,10 +3062,10 @@ static void io_mem_init(void)
3057 modified. If it is zero, a new io zone is allocated. The return 3062 modified. If it is zero, a new io zone is allocated. The return
3058 value can be used with cpu_register_physical_memory(). (-1) is 3063 value can be used with cpu_register_physical_memory(). (-1) is
3059 returned if error. */ 3064 returned if error. */
3060 -int cpu_register_io_memory(int io_index,  
3061 - CPUReadMemoryFunc **mem_read,  
3062 - CPUWriteMemoryFunc **mem_write,  
3063 - void *opaque) 3065 +static int cpu_register_io_memory_fixed(int io_index,
  3066 + CPUReadMemoryFunc **mem_read,
  3067 + CPUWriteMemoryFunc **mem_write,
  3068 + void *opaque)
3064 { 3069 {
3065 int i, subwidth = 0; 3070 int i, subwidth = 0;
3066 3071
@@ -3069,6 +3074,7 @@ int cpu_register_io_memory(int io_index, @@ -3069,6 +3074,7 @@ int cpu_register_io_memory(int io_index,
3069 if (io_index == -1) 3074 if (io_index == -1)
3070 return io_index; 3075 return io_index;
3071 } else { 3076 } else {
  3077 + io_index >>= IO_MEM_SHIFT;
3072 if (io_index >= IO_MEM_NB_ENTRIES) 3078 if (io_index >= IO_MEM_NB_ENTRIES)
3073 return -1; 3079 return -1;
3074 } 3080 }
@@ -3083,6 +3089,13 @@ int cpu_register_io_memory(int io_index, @@ -3083,6 +3089,13 @@ int cpu_register_io_memory(int io_index,
3083 return (io_index << IO_MEM_SHIFT) | subwidth; 3089 return (io_index << IO_MEM_SHIFT) | subwidth;
3084 } 3090 }
3085 3091
  3092 +int cpu_register_io_memory(CPUReadMemoryFunc **mem_read,
  3093 + CPUWriteMemoryFunc **mem_write,
  3094 + void *opaque)
  3095 +{
  3096 + return cpu_register_io_memory_fixed(0, mem_read, mem_write, opaque);
  3097 +}
  3098 +
3086 void cpu_unregister_io_memory(int io_table_address) 3099 void cpu_unregister_io_memory(int io_table_address)
3087 { 3100 {
3088 int i; 3101 int i;
hw/apb_pci.c
@@ -234,13 +234,13 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base, @@ -234,13 +234,13 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,
234 s->bus = pci_register_bus(NULL, "pci", 234 s->bus = pci_register_bus(NULL, "pci",
235 pci_apb_set_irq, pci_pbm_map_irq, pic, 0, 32); 235 pci_apb_set_irq, pci_pbm_map_irq, pic, 0, 32);
236 236
237 - pci_mem_config = cpu_register_io_memory(0, pci_apb_config_read, 237 + pci_mem_config = cpu_register_io_memory(pci_apb_config_read,
238 pci_apb_config_write, s); 238 pci_apb_config_write, s);
239 - apb_config = cpu_register_io_memory(0, apb_config_read, 239 + apb_config = cpu_register_io_memory(apb_config_read,
240 apb_config_write, s); 240 apb_config_write, s);
241 - pci_mem_data = cpu_register_io_memory(0, pci_apb_read, 241 + pci_mem_data = cpu_register_io_memory(pci_apb_read,
242 pci_apb_write, s); 242 pci_apb_write, s);
243 - pci_ioport = cpu_register_io_memory(0, pci_apb_ioread, 243 + pci_ioport = cpu_register_io_memory(pci_apb_ioread,
244 pci_apb_iowrite, s); 244 pci_apb_iowrite, s);
245 245
246 cpu_register_physical_memory(special_base + 0x2000ULL, 0x40, apb_config); 246 cpu_register_physical_memory(special_base + 0x2000ULL, 0x40, apb_config);
hw/apic.c
@@ -936,7 +936,7 @@ int apic_init(CPUState *env) @@ -936,7 +936,7 @@ int apic_init(CPUState *env)
936 if (apic_io_memory == 0) { 936 if (apic_io_memory == 0) {
937 /* NOTE: the APIC is directly connected to the CPU - it is not 937 /* NOTE: the APIC is directly connected to the CPU - it is not
938 on the global memory bus. */ 938 on the global memory bus. */
939 - apic_io_memory = cpu_register_io_memory(0, apic_mem_read, 939 + apic_io_memory = cpu_register_io_memory(apic_mem_read,
940 apic_mem_write, NULL); 940 apic_mem_write, NULL);
941 cpu_register_physical_memory(s->apicbase & ~0xfff, 0x1000, 941 cpu_register_physical_memory(s->apicbase & ~0xfff, 0x1000,
942 apic_io_memory); 942 apic_io_memory);
hw/arm_gic.c
@@ -725,7 +725,7 @@ static void gic_init(gic_state *s) @@ -725,7 +725,7 @@ static void gic_init(gic_state *s)
725 for (i = 0; i < NCPU; i++) { 725 for (i = 0; i < NCPU; i++) {
726 sysbus_init_irq(&s->busdev, &s->parent_irq[i]); 726 sysbus_init_irq(&s->busdev, &s->parent_irq[i]);
727 } 727 }
728 - s->iomemtype = cpu_register_io_memory(0, gic_dist_readfn, 728 + s->iomemtype = cpu_register_io_memory(gic_dist_readfn,
729 gic_dist_writefn, s); 729 gic_dist_writefn, s);
730 gic_reset(s); 730 gic_reset(s);
731 register_savevm("arm_gic", -1, 1, gic_save, gic_load, s); 731 register_savevm("arm_gic", -1, 1, gic_save, gic_load, s);
hw/arm_sysctl.c
@@ -198,7 +198,7 @@ static void arm_sysctl_init1(SysBusDevice *dev) @@ -198,7 +198,7 @@ static void arm_sysctl_init1(SysBusDevice *dev)
198 /* The MPcore bootloader uses these flags to start secondary CPUs. 198 /* The MPcore bootloader uses these flags to start secondary CPUs.
199 We don't use a bootloader, so do this here. */ 199 We don't use a bootloader, so do this here. */
200 s->flags = 3; 200 s->flags = 3;
201 - iomemtype = cpu_register_io_memory(0, arm_sysctl_readfn, 201 + iomemtype = cpu_register_io_memory(arm_sysctl_readfn,
202 arm_sysctl_writefn, s); 202 arm_sysctl_writefn, s);
203 sysbus_init_mmio(dev, 0x1000, iomemtype); 203 sysbus_init_mmio(dev, 0x1000, iomemtype);
204 /* ??? Save/restore. */ 204 /* ??? Save/restore. */
hw/arm_timer.c
@@ -268,7 +268,7 @@ static void sp804_init(SysBusDevice *dev) @@ -268,7 +268,7 @@ static void sp804_init(SysBusDevice *dev)
268 s->timer[1] = arm_timer_init(1000000); 268 s->timer[1] = arm_timer_init(1000000);
269 s->timer[0]->irq = qi[0]; 269 s->timer[0]->irq = qi[0];
270 s->timer[1]->irq = qi[1]; 270 s->timer[1]->irq = qi[1];
271 - iomemtype = cpu_register_io_memory(0, sp804_readfn, 271 + iomemtype = cpu_register_io_memory(sp804_readfn,
272 sp804_writefn, s); 272 sp804_writefn, s);
273 sysbus_init_mmio(dev, 0x1000, iomemtype); 273 sysbus_init_mmio(dev, 0x1000, iomemtype);
274 register_savevm("sp804", -1, 1, sp804_save, sp804_load, s); 274 register_savevm("sp804", -1, 1, sp804_save, sp804_load, s);
@@ -338,7 +338,7 @@ static void icp_pit_init(SysBusDevice *dev) @@ -338,7 +338,7 @@ static void icp_pit_init(SysBusDevice *dev)
338 sysbus_init_irq(dev, &s->timer[1]->irq); 338 sysbus_init_irq(dev, &s->timer[1]->irq);
339 sysbus_init_irq(dev, &s->timer[2]->irq); 339 sysbus_init_irq(dev, &s->timer[2]->irq);
340 340
341 - iomemtype = cpu_register_io_memory(0, icp_pit_readfn, 341 + iomemtype = cpu_register_io_memory(icp_pit_readfn,
342 icp_pit_writefn, s); 342 icp_pit_writefn, s);
343 sysbus_init_mmio(dev, 0x1000, iomemtype); 343 sysbus_init_mmio(dev, 0x1000, iomemtype);
344 /* This device has no state to save/restore. The component timers will 344 /* This device has no state to save/restore. The component timers will
hw/armv7m.c
@@ -128,7 +128,7 @@ static void bitband_init(SysBusDevice *dev) @@ -128,7 +128,7 @@ static void bitband_init(SysBusDevice *dev)
128 int iomemtype; 128 int iomemtype;
129 129
130 s->base = qdev_get_prop_int(&dev->qdev, "base", 0); 130 s->base = qdev_get_prop_int(&dev->qdev, "base", 0);
131 - iomemtype = cpu_register_io_memory(0, bitband_readfn, bitband_writefn, 131 + iomemtype = cpu_register_io_memory(bitband_readfn, bitband_writefn,
132 &s->base); 132 &s->base);
133 sysbus_init_mmio(dev, 0x02000000, iomemtype); 133 sysbus_init_mmio(dev, 0x02000000, iomemtype);
134 } 134 }
hw/axis_dev88.c
@@ -286,11 +286,11 @@ void axisdev88_init (ram_addr_t ram_size, @@ -286,11 +286,11 @@ void axisdev88_init (ram_addr_t ram_size,
286 286
287 /* Attach a NAND flash to CS1. */ 287 /* Attach a NAND flash to CS1. */
288 nand_state.nand = nand_init(NAND_MFR_STMICRO, 0x39); 288 nand_state.nand = nand_init(NAND_MFR_STMICRO, 0x39);
289 - nand_regs = cpu_register_io_memory(0, nand_read, nand_write, &nand_state); 289 + nand_regs = cpu_register_io_memory(nand_read, nand_write, &nand_state);
290 cpu_register_physical_memory(0x10000000, 0x05000000, nand_regs); 290 cpu_register_physical_memory(0x10000000, 0x05000000, nand_regs);
291 291
292 gpio_state.nand = &nand_state; 292 gpio_state.nand = &nand_state;
293 - gpio_regs = cpu_register_io_memory(0, gpio_read, gpio_write, &gpio_state); 293 + gpio_regs = cpu_register_io_memory(gpio_read, gpio_write, &gpio_state);
294 cpu_register_physical_memory(0x3001a000, 0x5c, gpio_regs); 294 cpu_register_physical_memory(0x3001a000, 0x5c, gpio_regs);
295 295
296 296
hw/cirrus_vga.c
@@ -3196,7 +3196,7 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci) @@ -3196,7 +3196,7 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
3196 register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s); 3196 register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s);
3197 register_ioport_read(0x3da, 1, 1, vga_ioport_read, s); 3197 register_ioport_read(0x3da, 1, 1, vga_ioport_read, s);
3198 3198
3199 - s->vga.vga_io_memory = cpu_register_io_memory(0, cirrus_vga_mem_read, 3199 + s->vga.vga_io_memory = cpu_register_io_memory(cirrus_vga_mem_read,
3200 cirrus_vga_mem_write, s); 3200 cirrus_vga_mem_write, s);
3201 cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000, 3201 cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
3202 s->vga.vga_io_memory); 3202 s->vga.vga_io_memory);
@@ -3204,16 +3204,16 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci) @@ -3204,16 +3204,16 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
3204 3204
3205 /* I/O handler for LFB */ 3205 /* I/O handler for LFB */
3206 s->cirrus_linear_io_addr = 3206 s->cirrus_linear_io_addr =
3207 - cpu_register_io_memory(0, cirrus_linear_read, cirrus_linear_write, s); 3207 + cpu_register_io_memory(cirrus_linear_read, cirrus_linear_write, s);
3208 3208
3209 /* I/O handler for LFB */ 3209 /* I/O handler for LFB */
3210 s->cirrus_linear_bitblt_io_addr = 3210 s->cirrus_linear_bitblt_io_addr =
3211 - cpu_register_io_memory(0, cirrus_linear_bitblt_read, 3211 + cpu_register_io_memory(cirrus_linear_bitblt_read,
3212 cirrus_linear_bitblt_write, s); 3212 cirrus_linear_bitblt_write, s);
3213 3213
3214 /* I/O handler for memory-mapped I/O */ 3214 /* I/O handler for memory-mapped I/O */
3215 s->cirrus_mmio_io_addr = 3215 s->cirrus_mmio_io_addr =
3216 - cpu_register_io_memory(0, cirrus_mmio_read, cirrus_mmio_write, s); 3216 + cpu_register_io_memory(cirrus_mmio_read, cirrus_mmio_write, s);
3217 3217
3218 s->real_vram_size = 3218 s->real_vram_size =
3219 (s->device_id == CIRRUS_ID_CLGD5446) ? 4096 * 1024 : 2048 * 1024; 3219 (s->device_id == CIRRUS_ID_CLGD5446) ? 4096 * 1024 : 2048 * 1024;
hw/cs4231.c
@@ -172,7 +172,7 @@ void cs_init(target_phys_addr_t base, int irq, void *intctl) @@ -172,7 +172,7 @@ void cs_init(target_phys_addr_t base, int irq, void *intctl)
172 172
173 s = qemu_mallocz(sizeof(CSState)); 173 s = qemu_mallocz(sizeof(CSState));
174 174
175 - cs_io_memory = cpu_register_io_memory(0, cs_mem_read, cs_mem_write, s); 175 + cs_io_memory = cpu_register_io_memory(cs_mem_read, cs_mem_write, s);
176 cpu_register_physical_memory(base, CS_SIZE, cs_io_memory); 176 cpu_register_physical_memory(base, CS_SIZE, cs_io_memory);
177 register_savevm("cs4231", base, 1, cs_save, cs_load, s); 177 register_savevm("cs4231", base, 1, cs_save, cs_load, s);
178 qemu_register_reset(cs_reset, 0, s); 178 qemu_register_reset(cs_reset, 0, s);
hw/cuda.c
@@ -760,7 +760,7 @@ void cuda_init (int *cuda_mem_index, qemu_irq irq) @@ -760,7 +760,7 @@ void cuda_init (int *cuda_mem_index, qemu_irq irq)
760 s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET; 760 s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET;
761 761
762 s->adb_poll_timer = qemu_new_timer(vm_clock, cuda_adb_poll, s); 762 s->adb_poll_timer = qemu_new_timer(vm_clock, cuda_adb_poll, s);
763 - *cuda_mem_index = cpu_register_io_memory(0, cuda_read, cuda_write, s); 763 + *cuda_mem_index = cpu_register_io_memory(cuda_read, cuda_write, s);
764 register_savevm("cuda", -1, 1, cuda_save, cuda_load, s); 764 register_savevm("cuda", -1, 1, cuda_save, cuda_load, s);
765 qemu_register_reset(cuda_reset, 0, s); 765 qemu_register_reset(cuda_reset, 0, s);
766 cuda_reset(s); 766 cuda_reset(s);
hw/dp8393x.c
@@ -897,6 +897,6 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift, @@ -897,6 +897,6 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
897 qemu_register_reset(nic_reset, 0, s); 897 qemu_register_reset(nic_reset, 0, s);
898 nic_reset(s); 898 nic_reset(s);
899 899
900 - s->mmio_index = cpu_register_io_memory(0, dp8393x_read, dp8393x_write, s); 900 + s->mmio_index = cpu_register_io_memory(dp8393x_read, dp8393x_write, s);
901 cpu_register_physical_memory(base, 0x40 << it_shift, s->mmio_index); 901 cpu_register_physical_memory(base, 0x40 << it_shift, s->mmio_index);
902 } 902 }
hw/ds1225y.c
@@ -171,10 +171,10 @@ void *ds1225y_init(target_phys_addr_t mem_base, const char *filename) @@ -171,10 +171,10 @@ void *ds1225y_init(target_phys_addr_t mem_base, const char *filename)
171 } 171 }
172 172
173 /* Read/write memory */ 173 /* Read/write memory */
174 - mem_indexRW = cpu_register_io_memory(0, nvram_read, nvram_write, s); 174 + mem_indexRW = cpu_register_io_memory(nvram_read, nvram_write, s);
175 cpu_register_physical_memory(mem_base, s->chip_size, mem_indexRW); 175 cpu_register_physical_memory(mem_base, s->chip_size, mem_indexRW);
176 /* Read/write protected memory */ 176 /* Read/write protected memory */
177 - mem_indexRP = cpu_register_io_memory(0, nvram_read, nvram_write_protected, s); 177 + mem_indexRP = cpu_register_io_memory(nvram_read, nvram_write_protected, s);
178 cpu_register_physical_memory(mem_base + s->chip_size, s->chip_size, mem_indexRP); 178 cpu_register_physical_memory(mem_base + s->chip_size, s->chip_size, mem_indexRP);
179 return s; 179 return s;
180 } 180 }
hw/e1000.c
@@ -1101,7 +1101,7 @@ static void pci_e1000_init(PCIDevice *pci_dev) @@ -1101,7 +1101,7 @@ static void pci_e1000_init(PCIDevice *pci_dev)
1101 1101
1102 pci_conf[0x3d] = 1; // interrupt pin 0 1102 pci_conf[0x3d] = 1; // interrupt pin 0
1103 1103
1104 - d->mmio_index = cpu_register_io_memory(0, e1000_mmio_read, 1104 + d->mmio_index = cpu_register_io_memory(e1000_mmio_read,
1105 e1000_mmio_write, d); 1105 e1000_mmio_write, d);
1106 1106
1107 pci_register_io_region((PCIDevice *)d, 0, PNPMMIO_SIZE, 1107 pci_register_io_region((PCIDevice *)d, 0, PNPMMIO_SIZE,
hw/eccmemctl.c
@@ -325,10 +325,10 @@ void * ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version) @@ -325,10 +325,10 @@ void * ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
325 s->regs[0] = version; 325 s->regs[0] = version;
326 s->irq = irq; 326 s->irq = irq;
327 327
328 - ecc_io_memory = cpu_register_io_memory(0, ecc_mem_read, ecc_mem_write, s); 328 + ecc_io_memory = cpu_register_io_memory(ecc_mem_read, ecc_mem_write, s);
329 cpu_register_physical_memory(base, ECC_SIZE, ecc_io_memory); 329 cpu_register_physical_memory(base, ECC_SIZE, ecc_io_memory);
330 if (version == ECC_MCC) { // SS-600MP only 330 if (version == ECC_MCC) { // SS-600MP only
331 - ecc_io_memory = cpu_register_io_memory(0, ecc_diag_mem_read, 331 + ecc_io_memory = cpu_register_io_memory(ecc_diag_mem_read,
332 ecc_diag_mem_write, s); 332 ecc_diag_mem_write, s);
333 cpu_register_physical_memory(base + 0x1000, ECC_DIAG_SIZE, 333 cpu_register_physical_memory(base + 0x1000, ECC_DIAG_SIZE,
334 ecc_io_memory); 334 ecc_io_memory);
hw/eepro100.c
@@ -1750,7 +1750,7 @@ static void nic_init(PCIDevice *pci_dev, uint32_t device) @@ -1750,7 +1750,7 @@ static void nic_init(PCIDevice *pci_dev, uint32_t device)
1750 1750
1751 /* Handler for memory-mapped I/O */ 1751 /* Handler for memory-mapped I/O */
1752 d->eepro100.mmio_index = 1752 d->eepro100.mmio_index =
1753 - cpu_register_io_memory(0, pci_mmio_read, pci_mmio_write, s); 1753 + cpu_register_io_memory(pci_mmio_read, pci_mmio_write, s);
1754 1754
1755 pci_register_io_region(&d->dev, 0, PCI_MEM_SIZE, 1755 pci_register_io_region(&d->dev, 0, PCI_MEM_SIZE,
1756 PCI_ADDRESS_SPACE_MEM | 1756 PCI_ADDRESS_SPACE_MEM |
hw/escc.c
@@ -728,7 +728,7 @@ int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB, @@ -728,7 +728,7 @@ int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB,
728 728
729 s = qemu_mallocz(sizeof(SerialState)); 729 s = qemu_mallocz(sizeof(SerialState));
730 730
731 - escc_io_memory = cpu_register_io_memory(0, escc_mem_read, 731 + escc_io_memory = cpu_register_io_memory(escc_mem_read,
732 escc_mem_write, 732 escc_mem_write,
733 s); 733 s);
734 if (base) 734 if (base)
@@ -922,7 +922,7 @@ void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq, @@ -922,7 +922,7 @@ void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,
922 s->chn[0].disabled = disabled; 922 s->chn[0].disabled = disabled;
923 s->chn[1].disabled = disabled; 923 s->chn[1].disabled = disabled;
924 924
925 - slavio_serial_io_memory = cpu_register_io_memory(0, escc_mem_read, 925 + slavio_serial_io_memory = cpu_register_io_memory(escc_mem_read,
926 escc_mem_write, 926 escc_mem_write,
927 s); 927 s);
928 cpu_register_physical_memory(base, ESCC_SIZE << it_shift, 928 cpu_register_physical_memory(base, ESCC_SIZE << it_shift,
hw/esp.c
@@ -676,7 +676,7 @@ static void esp_init1(SysBusDevice *dev) @@ -676,7 +676,7 @@ static void esp_init1(SysBusDevice *dev)
676 s->dma_memory_write = qdev_get_prop_ptr(&dev->qdev, "dma_memory_write"); 676 s->dma_memory_write = qdev_get_prop_ptr(&dev->qdev, "dma_memory_write");
677 s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma_opaque"); 677 s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma_opaque");
678 678
679 - esp_io_memory = cpu_register_io_memory(0, esp_mem_read, esp_mem_write, s); 679 + esp_io_memory = cpu_register_io_memory(esp_mem_read, esp_mem_write, s);
680 sysbus_init_mmio(dev, ESP_REGS << s->it_shift, esp_io_memory); 680 sysbus_init_mmio(dev, ESP_REGS << s->it_shift, esp_io_memory);
681 681
682 esp_reset(s); 682 esp_reset(s);
hw/etraxfs_dma.c
@@ -750,7 +750,7 @@ void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels) @@ -750,7 +750,7 @@ void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels)
750 ctrl->nr_channels = nr_channels; 750 ctrl->nr_channels = nr_channels;
751 ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels); 751 ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels);
752 752
753 - ctrl->map = cpu_register_io_memory(0, dma_read, dma_write, ctrl); 753 + ctrl->map = cpu_register_io_memory(dma_read, dma_write, ctrl);
754 cpu_register_physical_memory(base, nr_channels * 0x2000, ctrl->map); 754 cpu_register_physical_memory(base, nr_channels * 0x2000, ctrl->map);
755 return ctrl; 755 return ctrl;
756 } 756 }
hw/etraxfs_eth.c
@@ -587,7 +587,7 @@ void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr) @@ -587,7 +587,7 @@ void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)
587 tdk_init(&eth->phy); 587 tdk_init(&eth->phy);
588 mdio_attach(&eth->mdio_bus, &eth->phy, eth->phyaddr); 588 mdio_attach(&eth->mdio_bus, &eth->phy, eth->phyaddr);
589 589
590 - eth->ethregs = cpu_register_io_memory(0, eth_read, eth_write, eth); 590 + eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth);
591 cpu_register_physical_memory (base, 0x5c, eth->ethregs); 591 cpu_register_physical_memory (base, 0x5c, eth->ethregs);
592 592
593 eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, 593 eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
hw/etraxfs_pic.c
@@ -145,7 +145,7 @@ static void etraxfs_pic_init(SysBusDevice *dev) @@ -145,7 +145,7 @@ static void etraxfs_pic_init(SysBusDevice *dev)
145 sysbus_init_irq(dev, &s->parent_irq); 145 sysbus_init_irq(dev, &s->parent_irq);
146 sysbus_init_irq(dev, &s->parent_nmi); 146 sysbus_init_irq(dev, &s->parent_nmi);
147 147
148 - intr_vect_regs = cpu_register_io_memory(0, pic_read, pic_write, s); 148 + intr_vect_regs = cpu_register_io_memory(pic_read, pic_write, s);
149 sysbus_init_mmio(dev, R_MAX * 4, intr_vect_regs); 149 sysbus_init_mmio(dev, R_MAX * 4, intr_vect_regs);
150 } 150 }
151 151
hw/etraxfs_ser.c
@@ -171,7 +171,7 @@ static void etraxfs_ser_init(SysBusDevice *dev) @@ -171,7 +171,7 @@ static void etraxfs_ser_init(SysBusDevice *dev)
171 s->regs[RS_STAT_DIN] |= (1 << STAT_TR_IDLE); 171 s->regs[RS_STAT_DIN] |= (1 << STAT_TR_IDLE);
172 172
173 sysbus_init_irq(dev, &s->irq); 173 sysbus_init_irq(dev, &s->irq);
174 - ser_regs = cpu_register_io_memory(0, ser_read, ser_write, s); 174 + ser_regs = cpu_register_io_memory(ser_read, ser_write, s);
175 sysbus_init_mmio(dev, R_MAX * 4, ser_regs); 175 sysbus_init_mmio(dev, R_MAX * 4, ser_regs);
176 s->chr = qdev_init_chardev(&dev->qdev); 176 s->chr = qdev_init_chardev(&dev->qdev);
177 if (s->chr) 177 if (s->chr)
hw/etraxfs_timer.c
@@ -323,7 +323,7 @@ static void etraxfs_timer_init(SysBusDevice *dev) @@ -323,7 +323,7 @@ static void etraxfs_timer_init(SysBusDevice *dev)
323 sysbus_init_irq(dev, &t->irq); 323 sysbus_init_irq(dev, &t->irq);
324 sysbus_init_irq(dev, &t->nmi); 324 sysbus_init_irq(dev, &t->nmi);
325 325
326 - timer_regs = cpu_register_io_memory(0, timer_read, timer_write, t); 326 + timer_regs = cpu_register_io_memory(timer_read, timer_write, t);
327 sysbus_init_mmio(dev, 0x5c, timer_regs); 327 sysbus_init_mmio(dev, 0x5c, timer_regs);
328 328
329 qemu_register_reset(etraxfs_timer_reset, 0, t); 329 qemu_register_reset(etraxfs_timer_reset, 0, t);
hw/fdc.c
@@ -1902,7 +1902,7 @@ fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped, @@ -1902,7 +1902,7 @@ fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,
1902 1902
1903 fdctrl->sun4m = 0; 1903 fdctrl->sun4m = 0;
1904 if (mem_mapped) { 1904 if (mem_mapped) {
1905 - io_mem = cpu_register_io_memory(0, fdctrl_mem_read, fdctrl_mem_write, 1905 + io_mem = cpu_register_io_memory(fdctrl_mem_read, fdctrl_mem_write,
1906 fdctrl); 1906 fdctrl);
1907 cpu_register_physical_memory(io_base, 0x08, io_mem); 1907 cpu_register_physical_memory(io_base, 0x08, io_mem);
1908 } else { 1908 } else {
@@ -1927,7 +1927,7 @@ fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base, @@ -1927,7 +1927,7 @@ fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base,
1927 1927
1928 fdctrl = fdctrl_init_common(irq, -1, io_base, fds); 1928 fdctrl = fdctrl_init_common(irq, -1, io_base, fds);
1929 fdctrl->sun4m = 1; 1929 fdctrl->sun4m = 1;
1930 - io_mem = cpu_register_io_memory(0, fdctrl_mem_read_strict, 1930 + io_mem = cpu_register_io_memory(fdctrl_mem_read_strict,
1931 fdctrl_mem_write_strict, 1931 fdctrl_mem_write_strict,
1932 fdctrl); 1932 fdctrl);
1933 cpu_register_physical_memory(io_base, 0x08, io_mem); 1933 cpu_register_physical_memory(io_base, 0x08, io_mem);
hw/fw_cfg.c
@@ -266,12 +266,12 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, @@ -266,12 +266,12 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
266 register_ioport_write(data_port, 1, 1, fw_cfg_io_writeb, s); 266 register_ioport_write(data_port, 1, 1, fw_cfg_io_writeb, s);
267 } 267 }
268 if (ctl_addr) { 268 if (ctl_addr) {
269 - io_ctl_memory = cpu_register_io_memory(0, fw_cfg_ctl_mem_read, 269 + io_ctl_memory = cpu_register_io_memory(fw_cfg_ctl_mem_read,
270 fw_cfg_ctl_mem_write, s); 270 fw_cfg_ctl_mem_write, s);
271 cpu_register_physical_memory(ctl_addr, FW_CFG_SIZE, io_ctl_memory); 271 cpu_register_physical_memory(ctl_addr, FW_CFG_SIZE, io_ctl_memory);
272 } 272 }
273 if (data_addr) { 273 if (data_addr) {
274 - io_data_memory = cpu_register_io_memory(0, fw_cfg_data_mem_read, 274 + io_data_memory = cpu_register_io_memory(fw_cfg_data_mem_read,
275 fw_cfg_data_mem_write, s); 275 fw_cfg_data_mem_write, s);
276 cpu_register_physical_memory(data_addr, FW_CFG_SIZE, io_data_memory); 276 cpu_register_physical_memory(data_addr, FW_CFG_SIZE, io_data_memory);
277 } 277 }
hw/g364fb.c
@@ -608,7 +608,7 @@ int g364fb_mm_init(target_phys_addr_t vram_base, @@ -608,7 +608,7 @@ int g364fb_mm_init(target_phys_addr_t vram_base,
608 608
609 cpu_register_physical_memory(vram_base, s->vram_size, s->vram_offset); 609 cpu_register_physical_memory(vram_base, s->vram_size, s->vram_offset);
610 610
611 - io_ctrl = cpu_register_io_memory(0, g364fb_ctrl_read, g364fb_ctrl_write, s); 611 + io_ctrl = cpu_register_io_memory(g364fb_ctrl_read, g364fb_ctrl_write, s);
612 cpu_register_physical_memory(ctrl_base, 0x200000, io_ctrl); 612 cpu_register_physical_memory(ctrl_base, 0x200000, io_ctrl);
613 613
614 return 0; 614 return 0;
hw/grackle_pci.c
@@ -137,9 +137,9 @@ PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic) @@ -137,9 +137,9 @@ PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic)
137 pci_grackle_set_irq, pci_grackle_map_irq, 137 pci_grackle_set_irq, pci_grackle_map_irq,
138 pic, 0, 4); 138 pic, 0, 4);
139 139
140 - pci_mem_config = cpu_register_io_memory(0, pci_grackle_config_read, 140 + pci_mem_config = cpu_register_io_memory(pci_grackle_config_read,
141 pci_grackle_config_write, s); 141 pci_grackle_config_write, s);
142 - pci_mem_data = cpu_register_io_memory(0, pci_grackle_read, 142 + pci_mem_data = cpu_register_io_memory(pci_grackle_read,
143 pci_grackle_write, s); 143 pci_grackle_write, s);
144 cpu_register_physical_memory(base, 0x1000, pci_mem_config); 144 cpu_register_physical_memory(base, 0x1000, pci_mem_config);
145 cpu_register_physical_memory(base + 0x00200000, 0x1000, pci_mem_data); 145 cpu_register_physical_memory(base + 0x00200000, 0x1000, pci_mem_data);
hw/gt64xxx.c
@@ -1131,7 +1131,7 @@ PCIBus *pci_gt64120_init(qemu_irq *pic) @@ -1131,7 +1131,7 @@ PCIBus *pci_gt64120_init(qemu_irq *pic)
1131 s->pci->bus = pci_register_bus(NULL, "pci", 1131 s->pci->bus = pci_register_bus(NULL, "pci",
1132 pci_gt64120_set_irq, pci_gt64120_map_irq, 1132 pci_gt64120_set_irq, pci_gt64120_map_irq,
1133 pic, 144, 4); 1133 pic, 144, 4);
1134 - s->ISD_handle = cpu_register_io_memory(0, gt64120_read, gt64120_write, s); 1134 + s->ISD_handle = cpu_register_io_memory(gt64120_read, gt64120_write, s);
1135 d = pci_register_device(s->pci->bus, "GT64120 PCI Bus", sizeof(PCIDevice), 1135 d = pci_register_device(s->pci->bus, "GT64120 PCI Bus", sizeof(PCIDevice),
1136 0, gt64120_read_config, gt64120_write_config); 1136 0, gt64120_read_config, gt64120_write_config);
1137 1137
hw/heathrow_pic.c
@@ -226,7 +226,7 @@ qemu_irq *heathrow_pic_init(int *pmem_index, @@ -226,7 +226,7 @@ qemu_irq *heathrow_pic_init(int *pmem_index,
226 s = qemu_mallocz(sizeof(HeathrowPICS)); 226 s = qemu_mallocz(sizeof(HeathrowPICS));
227 /* only 1 CPU */ 227 /* only 1 CPU */
228 s->irqs = irqs[0]; 228 s->irqs = irqs[0];
229 - *pmem_index = cpu_register_io_memory(0, pic_read, pic_write, s); 229 + *pmem_index = cpu_register_io_memory(pic_read, pic_write, s);
230 230
231 register_savevm("heathrow_pic", -1, 1, heathrow_pic_save, 231 register_savevm("heathrow_pic", -1, 1, heathrow_pic_save,
232 heathrow_pic_load, s); 232 heathrow_pic_load, s);
hw/hpet.c
@@ -582,7 +582,7 @@ void hpet_init(qemu_irq *irq) { @@ -582,7 +582,7 @@ void hpet_init(qemu_irq *irq) {
582 register_savevm("hpet", -1, 1, hpet_save, hpet_load, s); 582 register_savevm("hpet", -1, 1, hpet_save, hpet_load, s);
583 qemu_register_reset(hpet_reset, 0, s); 583 qemu_register_reset(hpet_reset, 0, s);
584 /* HPET Area */ 584 /* HPET Area */
585 - iomemtype = cpu_register_io_memory(0, hpet_ram_read, 585 + iomemtype = cpu_register_io_memory(hpet_ram_read,
586 hpet_ram_write, s); 586 hpet_ram_write, s);
587 cpu_register_physical_memory(HPET_BASE, 0x400, iomemtype); 587 cpu_register_physical_memory(HPET_BASE, 0x400, iomemtype);
588 } 588 }
hw/ide.c
@@ -3751,7 +3751,7 @@ int pmac_ide_init (BlockDriverState **hd_table, qemu_irq irq, @@ -3751,7 +3751,7 @@ int pmac_ide_init (BlockDriverState **hd_table, qemu_irq irq,
3751 if (dbdma) 3751 if (dbdma)
3752 DBDMA_register_channel(dbdma, channel, dma_irq, pmac_ide_transfer, pmac_ide_flush, d); 3752 DBDMA_register_channel(dbdma, channel, dma_irq, pmac_ide_transfer, pmac_ide_flush, d);
3753 3753
3754 - pmac_ide_memory = cpu_register_io_memory(0, pmac_ide_read, 3754 + pmac_ide_memory = cpu_register_io_memory(pmac_ide_read,
3755 pmac_ide_write, d); 3755 pmac_ide_write, d);
3756 register_savevm("ide", 0, 1, pmac_ide_save, pmac_ide_load, d); 3756 register_savevm("ide", 0, 1, pmac_ide_save, pmac_ide_load, d);
3757 qemu_register_reset(pmac_ide_reset, 0, d); 3757 qemu_register_reset(pmac_ide_reset, 0, d);
@@ -3847,8 +3847,8 @@ void mmio_ide_init (target_phys_addr_t membase, target_phys_addr_t membase2, @@ -3847,8 +3847,8 @@ void mmio_ide_init (target_phys_addr_t membase, target_phys_addr_t membase2,
3847 s->dev = ide; 3847 s->dev = ide;
3848 s->shift = shift; 3848 s->shift = shift;
3849 3849
3850 - mem1 = cpu_register_io_memory(0, mmio_ide_reads, mmio_ide_writes, s);  
3851 - mem2 = cpu_register_io_memory(0, mmio_ide_status, mmio_ide_cmd, s); 3850 + mem1 = cpu_register_io_memory(mmio_ide_reads, mmio_ide_writes, s);
  3851 + mem2 = cpu_register_io_memory(mmio_ide_status, mmio_ide_cmd, s);
3852 cpu_register_physical_memory(membase, 16 << shift, mem1); 3852 cpu_register_physical_memory(membase, 16 << shift, mem1);
3853 cpu_register_physical_memory(membase2, 2 << shift, mem2); 3853 cpu_register_physical_memory(membase2, 2 << shift, mem2);
3854 } 3854 }
hw/integratorcp.c
@@ -256,7 +256,7 @@ static void integratorcm_init(SysBusDevice *dev) @@ -256,7 +256,7 @@ static void integratorcm_init(SysBusDevice *dev)
256 s->cm_init = 0x00000112; 256 s->cm_init = 0x00000112;
257 s->flash_offset = qemu_ram_alloc(0x100000); 257 s->flash_offset = qemu_ram_alloc(0x100000);
258 258
259 - iomemtype = cpu_register_io_memory(0, integratorcm_readfn, 259 + iomemtype = cpu_register_io_memory(integratorcm_readfn,
260 integratorcm_writefn, s); 260 integratorcm_writefn, s);
261 sysbus_init_mmio(dev, 0x00800000, iomemtype); 261 sysbus_init_mmio(dev, 0x00800000, iomemtype);
262 integratorcm_do_remap(s, 1); 262 integratorcm_do_remap(s, 1);
@@ -381,7 +381,7 @@ static void icp_pic_init(SysBusDevice *dev) @@ -381,7 +381,7 @@ static void icp_pic_init(SysBusDevice *dev)
381 qdev_init_gpio_in(&dev->qdev, icp_pic_set_irq, 32); 381 qdev_init_gpio_in(&dev->qdev, icp_pic_set_irq, 32);
382 sysbus_init_irq(dev, &s->parent_irq); 382 sysbus_init_irq(dev, &s->parent_irq);
383 sysbus_init_irq(dev, &s->parent_fiq); 383 sysbus_init_irq(dev, &s->parent_fiq);
384 - iomemtype = cpu_register_io_memory(0, icp_pic_readfn, 384 + iomemtype = cpu_register_io_memory(icp_pic_readfn,
385 icp_pic_writefn, s); 385 icp_pic_writefn, s);
386 sysbus_init_mmio(dev, 0x00800000, iomemtype); 386 sysbus_init_mmio(dev, 0x00800000, iomemtype);
387 } 387 }
@@ -433,7 +433,7 @@ static void icp_control_init(uint32_t base) @@ -433,7 +433,7 @@ static void icp_control_init(uint32_t base)
433 { 433 {
434 int iomemtype; 434 int iomemtype;
435 435
436 - iomemtype = cpu_register_io_memory(0, icp_control_readfn, 436 + iomemtype = cpu_register_io_memory(icp_control_readfn,
437 icp_control_writefn, NULL); 437 icp_control_writefn, NULL);
438 cpu_register_physical_memory(base, 0x00800000, iomemtype); 438 cpu_register_physical_memory(base, 0x00800000, iomemtype);
439 /* ??? Save/restore. */ 439 /* ??? Save/restore. */
hw/ioapic.c
@@ -250,7 +250,7 @@ IOAPICState *ioapic_init(void) @@ -250,7 +250,7 @@ IOAPICState *ioapic_init(void)
250 s = qemu_mallocz(sizeof(IOAPICState)); 250 s = qemu_mallocz(sizeof(IOAPICState));
251 ioapic_reset(s); 251 ioapic_reset(s);
252 252
253 - io_memory = cpu_register_io_memory(0, ioapic_mem_read, 253 + io_memory = cpu_register_io_memory(ioapic_mem_read,
254 ioapic_mem_write, s); 254 ioapic_mem_write, s);
255 cpu_register_physical_memory(0xfec00000, 0x1000, io_memory); 255 cpu_register_physical_memory(0xfec00000, 0x1000, io_memory);
256 256
hw/iommu.c
@@ -375,7 +375,7 @@ void *iommu_init(target_phys_addr_t addr, uint32_t version, qemu_irq irq) @@ -375,7 +375,7 @@ void *iommu_init(target_phys_addr_t addr, uint32_t version, qemu_irq irq)
375 s->version = version; 375 s->version = version;
376 s->irq = irq; 376 s->irq = irq;
377 377
378 - iommu_io_memory = cpu_register_io_memory(0, iommu_mem_read, 378 + iommu_io_memory = cpu_register_io_memory(iommu_mem_read,
379 iommu_mem_write, s); 379 iommu_mem_write, s);
380 cpu_register_physical_memory(addr, IOMMU_NREGS * 4, iommu_io_memory); 380 cpu_register_physical_memory(addr, IOMMU_NREGS * 4, iommu_io_memory);
381 381
hw/isa_mmio.c
@@ -96,7 +96,7 @@ static int isa_mmio_iomemtype = 0; @@ -96,7 +96,7 @@ static int isa_mmio_iomemtype = 0;
96 void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size) 96 void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size)
97 { 97 {
98 if (!isa_mmio_iomemtype) { 98 if (!isa_mmio_iomemtype) {
99 - isa_mmio_iomemtype = cpu_register_io_memory(0, isa_mmio_read, 99 + isa_mmio_iomemtype = cpu_register_io_memory(isa_mmio_read,
100 isa_mmio_write, NULL); 100 isa_mmio_write, NULL);
101 } 101 }
102 cpu_register_physical_memory(base, size, isa_mmio_iomemtype); 102 cpu_register_physical_memory(base, size, isa_mmio_iomemtype);
hw/jazz_led.c
@@ -307,7 +307,7 @@ void jazz_led_init(target_phys_addr_t base) @@ -307,7 +307,7 @@ void jazz_led_init(target_phys_addr_t base)
307 307
308 s->state = REDRAW_SEGMENTS | REDRAW_BACKGROUND; 308 s->state = REDRAW_SEGMENTS | REDRAW_BACKGROUND;
309 309
310 - io = cpu_register_io_memory(0, led_read, led_write, s); 310 + io = cpu_register_io_memory(led_read, led_write, s);
311 cpu_register_physical_memory(base, 1, io); 311 cpu_register_physical_memory(base, 1, io);
312 312
313 s->ds = graphic_console_init(jazz_led_update_display, 313 s->ds = graphic_console_init(jazz_led_update_display,
hw/lsi53c895a.c
@@ -1998,9 +1998,9 @@ static void lsi_scsi_init(PCIDevice *dev) @@ -1998,9 +1998,9 @@ static void lsi_scsi_init(PCIDevice *dev)
1998 /* Interrupt pin 1 */ 1998 /* Interrupt pin 1 */
1999 pci_conf[0x3d] = 0x01; 1999 pci_conf[0x3d] = 0x01;
2000 2000
2001 - s->mmio_io_addr = cpu_register_io_memory(0, lsi_mmio_readfn, 2001 + s->mmio_io_addr = cpu_register_io_memory(lsi_mmio_readfn,
2002 lsi_mmio_writefn, s); 2002 lsi_mmio_writefn, s);
2003 - s->ram_io_addr = cpu_register_io_memory(0, lsi_ram_readfn, 2003 + s->ram_io_addr = cpu_register_io_memory(lsi_ram_readfn,
2004 lsi_ram_writefn, s); 2004 lsi_ram_writefn, s);
2005 2005
2006 pci_register_io_region((struct PCIDevice *)s, 0, 256, 2006 pci_register_io_region((struct PCIDevice *)s, 0, 256,
hw/m48t59.c
@@ -632,7 +632,7 @@ m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base, @@ -632,7 +632,7 @@ m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
632 register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, s); 632 register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, s);
633 } 633 }
634 if (mem_base != 0) { 634 if (mem_base != 0) {
635 - s->mem_index = cpu_register_io_memory(0, nvram_read, nvram_write, s); 635 + s->mem_index = cpu_register_io_memory(nvram_read, nvram_write, s);
636 cpu_register_physical_memory(mem_base, size, s->mem_index); 636 cpu_register_physical_memory(mem_base, size, s->mem_index);
637 } 637 }
638 if (type == 59) { 638 if (type == 59) {
hw/mac_dbdma.c
@@ -837,7 +837,7 @@ void* DBDMA_init (int *dbdma_mem_index) @@ -837,7 +837,7 @@ void* DBDMA_init (int *dbdma_mem_index)
837 837
838 s = qemu_mallocz(sizeof(DBDMA_channel) * DBDMA_CHANNELS); 838 s = qemu_mallocz(sizeof(DBDMA_channel) * DBDMA_CHANNELS);
839 839
840 - *dbdma_mem_index = cpu_register_io_memory(0, dbdma_read, dbdma_write, s); 840 + *dbdma_mem_index = cpu_register_io_memory(dbdma_read, dbdma_write, s);
841 register_savevm("dbdma", -1, 1, dbdma_save, dbdma_load, s); 841 register_savevm("dbdma", -1, 1, dbdma_save, dbdma_load, s);
842 qemu_register_reset(dbdma_reset, 0, s); 842 qemu_register_reset(dbdma_reset, 0, s);
843 dbdma_reset(s); 843 dbdma_reset(s);
hw/mac_nvram.c
@@ -138,7 +138,7 @@ MacIONVRAMState *macio_nvram_init (int *mem_index, target_phys_addr_t size, @@ -138,7 +138,7 @@ MacIONVRAMState *macio_nvram_init (int *mem_index, target_phys_addr_t size,
138 s->size = size; 138 s->size = size;
139 s->it_shift = it_shift; 139 s->it_shift = it_shift;
140 140
141 - s->mem_index = cpu_register_io_memory(0, nvram_read, nvram_write, s); 141 + s->mem_index = cpu_register_io_memory(nvram_read, nvram_write, s);
142 *mem_index = s->mem_index; 142 *mem_index = s->mem_index;
143 register_savevm("macio_nvram", -1, 1, macio_nvram_save, macio_nvram_load, 143 register_savevm("macio_nvram", -1, 1, macio_nvram_save, macio_nvram_load,
144 s); 144 s);
hw/mc146818rtc.c
@@ -735,7 +735,7 @@ RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, @@ -735,7 +735,7 @@ RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq,
735 s->next_second_time = qemu_get_clock(vm_clock) + (ticks_per_sec * 99) / 100; 735 s->next_second_time = qemu_get_clock(vm_clock) + (ticks_per_sec * 99) / 100;
736 qemu_mod_timer(s->second_timer2, s->next_second_time); 736 qemu_mod_timer(s->second_timer2, s->next_second_time);
737 737
738 - io_memory = cpu_register_io_memory(0, rtc_mm_read, rtc_mm_write, s); 738 + io_memory = cpu_register_io_memory(rtc_mm_read, rtc_mm_write, s);
739 cpu_register_physical_memory(base, 2 << it_shift, io_memory); 739 cpu_register_physical_memory(base, 2 << it_shift, io_memory);
740 740
741 register_savevm("mc146818rtc", base, 1, rtc_save, rtc_load, s); 741 register_savevm("mc146818rtc", base, 1, rtc_save, rtc_load, s);
hw/mcf5206.c
@@ -524,7 +524,7 @@ qemu_irq *mcf5206_init(uint32_t base, CPUState *env) @@ -524,7 +524,7 @@ qemu_irq *mcf5206_init(uint32_t base, CPUState *env)
524 int iomemtype; 524 int iomemtype;
525 525
526 s = (m5206_mbar_state *)qemu_mallocz(sizeof(m5206_mbar_state)); 526 s = (m5206_mbar_state *)qemu_mallocz(sizeof(m5206_mbar_state));
527 - iomemtype = cpu_register_io_memory(0, m5206_mbar_readfn, 527 + iomemtype = cpu_register_io_memory(m5206_mbar_readfn,
528 m5206_mbar_writefn, s); 528 m5206_mbar_writefn, s);
529 cpu_register_physical_memory(base, 0x00001000, iomemtype); 529 cpu_register_physical_memory(base, 0x00001000, iomemtype);
530 530
hw/mcf5208.c
@@ -176,7 +176,7 @@ static void mcf5208_sys_init(qemu_irq *pic) @@ -176,7 +176,7 @@ static void mcf5208_sys_init(qemu_irq *pic)
176 QEMUBH *bh; 176 QEMUBH *bh;
177 int i; 177 int i;
178 178
179 - iomemtype = cpu_register_io_memory(0, m5208_sys_readfn, 179 + iomemtype = cpu_register_io_memory(m5208_sys_readfn,
180 m5208_sys_writefn, NULL); 180 m5208_sys_writefn, NULL);
181 /* SDRAMC. */ 181 /* SDRAMC. */
182 cpu_register_physical_memory(0xfc0a8000, 0x00004000, iomemtype); 182 cpu_register_physical_memory(0xfc0a8000, 0x00004000, iomemtype);
@@ -185,7 +185,7 @@ static void mcf5208_sys_init(qemu_irq *pic) @@ -185,7 +185,7 @@ static void mcf5208_sys_init(qemu_irq *pic)
185 s = (m5208_timer_state *)qemu_mallocz(sizeof(m5208_timer_state)); 185 s = (m5208_timer_state *)qemu_mallocz(sizeof(m5208_timer_state));
186 bh = qemu_bh_new(m5208_timer_trigger, s); 186 bh = qemu_bh_new(m5208_timer_trigger, s);
187 s->timer = ptimer_init(bh); 187 s->timer = ptimer_init(bh);
188 - iomemtype = cpu_register_io_memory(0, m5208_timer_readfn, 188 + iomemtype = cpu_register_io_memory(m5208_timer_readfn,
189 m5208_timer_writefn, s); 189 m5208_timer_writefn, s);
190 cpu_register_physical_memory(0xfc080000 + 0x4000 * i, 0x00004000, 190 cpu_register_physical_memory(0xfc080000 + 0x4000 * i, 0x00004000,
191 iomemtype); 191 iomemtype);
hw/mcf_fec.c
@@ -458,7 +458,7 @@ void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq) @@ -458,7 +458,7 @@ void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq)
458 458
459 s = (mcf_fec_state *)qemu_mallocz(sizeof(mcf_fec_state)); 459 s = (mcf_fec_state *)qemu_mallocz(sizeof(mcf_fec_state));
460 s->irq = irq; 460 s->irq = irq;
461 - s->mmio_index = cpu_register_io_memory(0, mcf_fec_readfn, 461 + s->mmio_index = cpu_register_io_memory(mcf_fec_readfn,
462 mcf_fec_writefn, s); 462 mcf_fec_writefn, s);
463 cpu_register_physical_memory(base, 0x400, s->mmio_index); 463 cpu_register_physical_memory(base, 0x400, s->mmio_index);
464 464
hw/mcf_intc.c
@@ -148,7 +148,7 @@ qemu_irq *mcf_intc_init(target_phys_addr_t base, CPUState *env) @@ -148,7 +148,7 @@ qemu_irq *mcf_intc_init(target_phys_addr_t base, CPUState *env)
148 s->env = env; 148 s->env = env;
149 mcf_intc_reset(s); 149 mcf_intc_reset(s);
150 150
151 - iomemtype = cpu_register_io_memory(0, mcf_intc_readfn, 151 + iomemtype = cpu_register_io_memory(mcf_intc_readfn,
152 mcf_intc_writefn, s); 152 mcf_intc_writefn, s);
153 cpu_register_physical_memory(base, 0x100, iomemtype); 153 cpu_register_physical_memory(base, 0x100, iomemtype);
154 154
hw/mcf_uart.c
@@ -303,7 +303,7 @@ void mcf_uart_mm_init(target_phys_addr_t base, qemu_irq irq, @@ -303,7 +303,7 @@ void mcf_uart_mm_init(target_phys_addr_t base, qemu_irq irq,
303 int iomemtype; 303 int iomemtype;
304 304
305 s = mcf_uart_init(irq, chr); 305 s = mcf_uart_init(irq, chr);
306 - iomemtype = cpu_register_io_memory(0, mcf_uart_readfn, 306 + iomemtype = cpu_register_io_memory(mcf_uart_readfn,
307 mcf_uart_writefn, s); 307 mcf_uart_writefn, s);
308 cpu_register_physical_memory(base, 0x40, iomemtype); 308 cpu_register_physical_memory(base, 0x40, iomemtype);
309 } 309 }
hw/mips_jazz.c
@@ -181,7 +181,7 @@ void mips_jazz_init (ram_addr_t ram_size, @@ -181,7 +181,7 @@ void mips_jazz_init (ram_addr_t ram_size,
181 181
182 /* Chipset */ 182 /* Chipset */
183 rc4030_opaque = rc4030_init(env->irq[6], env->irq[3], &rc4030, &dmas); 183 rc4030_opaque = rc4030_init(env->irq[6], env->irq[3], &rc4030, &dmas);
184 - s_dma_dummy = cpu_register_io_memory(0, dma_dummy_read, dma_dummy_write, NULL); 184 + s_dma_dummy = cpu_register_io_memory(dma_dummy_read, dma_dummy_write, NULL);
185 cpu_register_physical_memory(0x8000d000, 0x00001000, s_dma_dummy); 185 cpu_register_physical_memory(0x8000d000, 0x00001000, s_dma_dummy);
186 186
187 /* ISA devices */ 187 /* ISA devices */
@@ -245,7 +245,7 @@ void mips_jazz_init (ram_addr_t ram_size, @@ -245,7 +245,7 @@ void mips_jazz_init (ram_addr_t ram_size,
245 245
246 /* Real time clock */ 246 /* Real time clock */
247 rtc_init(0x70, i8259[8], 1980); 247 rtc_init(0x70, i8259[8], 1980);
248 - s_rtc = cpu_register_io_memory(0, rtc_read, rtc_write, env); 248 + s_rtc = cpu_register_io_memory(rtc_read, rtc_write, env);
249 cpu_register_physical_memory(0x80004000, 0x00001000, s_rtc); 249 cpu_register_physical_memory(0x80004000, 0x00001000, s_rtc);
250 250
251 /* Keyboard (i8042) */ 251 /* Keyboard (i8042) */
hw/mips_malta.c
@@ -435,7 +435,7 @@ static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, qemu_irq uart_ir @@ -435,7 +435,7 @@ static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, qemu_irq uart_ir
435 435
436 s = (MaltaFPGAState *)qemu_mallocz(sizeof(MaltaFPGAState)); 436 s = (MaltaFPGAState *)qemu_mallocz(sizeof(MaltaFPGAState));
437 437
438 - malta = cpu_register_io_memory(0, malta_fpga_read, 438 + malta = cpu_register_io_memory(malta_fpga_read,
439 malta_fpga_write, s); 439 malta_fpga_write, s);
440 440
441 cpu_register_physical_memory(base, 0x900, malta); 441 cpu_register_physical_memory(base, 0x900, malta);
hw/mips_r4k.c
@@ -185,7 +185,7 @@ void mips_r4k_init (ram_addr_t ram_size, @@ -185,7 +185,7 @@ void mips_r4k_init (ram_addr_t ram_size,
185 cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM); 185 cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM);
186 186
187 if (!mips_qemu_iomemtype) { 187 if (!mips_qemu_iomemtype) {
188 - mips_qemu_iomemtype = cpu_register_io_memory(0, mips_qemu_read, 188 + mips_qemu_iomemtype = cpu_register_io_memory(mips_qemu_read,
189 mips_qemu_write, NULL); 189 mips_qemu_write, NULL);
190 } 190 }
191 cpu_register_physical_memory(0x1fbf0000, 0x10000, mips_qemu_iomemtype); 191 cpu_register_physical_memory(0x1fbf0000, 0x10000, mips_qemu_iomemtype);
hw/mpcore.c
@@ -268,7 +268,7 @@ static void mpcore_priv_init(SysBusDevice *dev) @@ -268,7 +268,7 @@ static void mpcore_priv_init(SysBusDevice *dev)
268 int i; 268 int i;
269 269
270 gic_init(&s->gic); 270 gic_init(&s->gic);
271 - s->iomemtype = cpu_register_io_memory(0, mpcore_priv_readfn, 271 + s->iomemtype = cpu_register_io_memory(mpcore_priv_readfn,
272 mpcore_priv_writefn, s); 272 mpcore_priv_writefn, s);
273 sysbus_init_mmio_cb(dev, 0x2000, mpcore_priv_map); 273 sysbus_init_mmio_cb(dev, 0x2000, mpcore_priv_map);
274 for (i = 0; i < 8; i++) { 274 for (i = 0; i < 8; i++) {
hw/mst_fpga.c
@@ -231,7 +231,7 @@ qemu_irq *mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq) @@ -231,7 +231,7 @@ qemu_irq *mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq)
231 qi = qemu_allocate_irqs(mst_fpga_set_irq, s, MST_NUM_IRQS); 231 qi = qemu_allocate_irqs(mst_fpga_set_irq, s, MST_NUM_IRQS);
232 s->pins = qi; 232 s->pins = qi;
233 233
234 - iomemtype = cpu_register_io_memory(0, mst_fpga_readfn, 234 + iomemtype = cpu_register_io_memory(mst_fpga_readfn,
235 mst_fpga_writefn, s); 235 mst_fpga_writefn, s);
236 cpu_register_physical_memory(base, 0x00100000, iomemtype); 236 cpu_register_physical_memory(base, 0x00100000, iomemtype);
237 register_savevm("mainstone_fpga", 0, 0, mst_fpga_save, mst_fpga_load, s); 237 register_savevm("mainstone_fpga", 0, 0, mst_fpga_save, mst_fpga_load, s);
hw/musicpal.c
@@ -437,7 +437,7 @@ static i2c_interface *musicpal_audio_init(qemu_irq irq) @@ -437,7 +437,7 @@ static i2c_interface *musicpal_audio_init(qemu_irq irq)
437 s->wm = i2c_create_slave(i2c->bus, "wm8750", MP_WM_ADDR); 437 s->wm = i2c_create_slave(i2c->bus, "wm8750", MP_WM_ADDR);
438 wm8750_data_req_set(s->wm, audio_callback, s); 438 wm8750_data_req_set(s->wm, audio_callback, s);
439 439
440 - iomemtype = cpu_register_io_memory(0, musicpal_audio_readfn, 440 + iomemtype = cpu_register_io_memory(musicpal_audio_readfn,
441 musicpal_audio_writefn, s); 441 musicpal_audio_writefn, s);
442 cpu_register_physical_memory(MP_AUDIO_BASE, MP_AUDIO_SIZE, iomemtype); 442 cpu_register_physical_memory(MP_AUDIO_BASE, MP_AUDIO_SIZE, iomemtype);
443 443
@@ -756,7 +756,7 @@ static void mv88w8618_eth_init(SysBusDevice *dev) @@ -756,7 +756,7 @@ static void mv88w8618_eth_init(SysBusDevice *dev)
756 s->vc = qdev_get_vlan_client(&dev->qdev, 756 s->vc = qdev_get_vlan_client(&dev->qdev,
757 eth_can_receive, eth_receive, NULL, 757 eth_can_receive, eth_receive, NULL,
758 eth_cleanup, s); 758 eth_cleanup, s);
759 - s->mmio_index = cpu_register_io_memory(0, mv88w8618_eth_readfn, 759 + s->mmio_index = cpu_register_io_memory(mv88w8618_eth_readfn,
760 mv88w8618_eth_writefn, s); 760 mv88w8618_eth_writefn, s);
761 sysbus_init_mmio(dev, MP_ETH_SIZE, s->mmio_index); 761 sysbus_init_mmio(dev, MP_ETH_SIZE, s->mmio_index);
762 } 762 }
@@ -946,7 +946,7 @@ static void musicpal_lcd_init(SysBusDevice *dev) @@ -946,7 +946,7 @@ static void musicpal_lcd_init(SysBusDevice *dev)
946 musicpal_lcd_state *s = FROM_SYSBUS(musicpal_lcd_state, dev); 946 musicpal_lcd_state *s = FROM_SYSBUS(musicpal_lcd_state, dev);
947 int iomemtype; 947 int iomemtype;
948 948
949 - iomemtype = cpu_register_io_memory(0, musicpal_lcd_readfn, 949 + iomemtype = cpu_register_io_memory(musicpal_lcd_readfn,
950 musicpal_lcd_writefn, s); 950 musicpal_lcd_writefn, s);
951 sysbus_init_mmio(dev, MP_LCD_SIZE, iomemtype); 951 sysbus_init_mmio(dev, MP_LCD_SIZE, iomemtype);
952 cpu_register_physical_memory(MP_LCD_BASE, MP_LCD_SIZE, iomemtype); 952 cpu_register_physical_memory(MP_LCD_BASE, MP_LCD_SIZE, iomemtype);
@@ -1043,7 +1043,7 @@ static void mv88w8618_pic_init(SysBusDevice *dev) @@ -1043,7 +1043,7 @@ static void mv88w8618_pic_init(SysBusDevice *dev)
1043 1043
1044 qdev_init_gpio_in(&dev->qdev, mv88w8618_pic_set_irq, 32); 1044 qdev_init_gpio_in(&dev->qdev, mv88w8618_pic_set_irq, 32);
1045 sysbus_init_irq(dev, &s->parent_irq); 1045 sysbus_init_irq(dev, &s->parent_irq);
1046 - iomemtype = cpu_register_io_memory(0, mv88w8618_pic_readfn, 1046 + iomemtype = cpu_register_io_memory(mv88w8618_pic_readfn,
1047 mv88w8618_pic_writefn, s); 1047 mv88w8618_pic_writefn, s);
1048 sysbus_init_mmio(dev, MP_PIC_SIZE, iomemtype); 1048 sysbus_init_mmio(dev, MP_PIC_SIZE, iomemtype);
1049 1049
@@ -1167,7 +1167,7 @@ static void mv88w8618_pit_init(SysBusDevice *dev) @@ -1167,7 +1167,7 @@ static void mv88w8618_pit_init(SysBusDevice *dev)
1167 mv88w8618_timer_init(dev, &s->timer[i], 1000000); 1167 mv88w8618_timer_init(dev, &s->timer[i], 1000000);
1168 } 1168 }
1169 1169
1170 - iomemtype = cpu_register_io_memory(0, mv88w8618_pit_readfn, 1170 + iomemtype = cpu_register_io_memory(mv88w8618_pit_readfn,
1171 mv88w8618_pit_writefn, s); 1171 mv88w8618_pit_writefn, s);
1172 sysbus_init_mmio(dev, MP_PIT_SIZE, iomemtype); 1172 sysbus_init_mmio(dev, MP_PIT_SIZE, iomemtype);
1173 } 1173 }
@@ -1224,7 +1224,7 @@ static void mv88w8618_flashcfg_init(SysBusDevice *dev) @@ -1224,7 +1224,7 @@ static void mv88w8618_flashcfg_init(SysBusDevice *dev)
1224 mv88w8618_flashcfg_state *s = FROM_SYSBUS(mv88w8618_flashcfg_state, dev); 1224 mv88w8618_flashcfg_state *s = FROM_SYSBUS(mv88w8618_flashcfg_state, dev);
1225 1225
1226 s->cfgr0 = 0xfffe4285; /* Default as set by U-Boot for 8 MB flash */ 1226 s->cfgr0 = 0xfffe4285; /* Default as set by U-Boot for 8 MB flash */
1227 - iomemtype = cpu_register_io_memory(0, mv88w8618_flashcfg_readfn, 1227 + iomemtype = cpu_register_io_memory(mv88w8618_flashcfg_readfn,
1228 mv88w8618_flashcfg_writefn, s); 1228 mv88w8618_flashcfg_writefn, s);
1229 sysbus_init_mmio(dev, MP_FLASHCFG_SIZE, iomemtype); 1229 sysbus_init_mmio(dev, MP_FLASHCFG_SIZE, iomemtype);
1230 } 1230 }
@@ -1266,7 +1266,7 @@ static void musicpal_misc_init(void) @@ -1266,7 +1266,7 @@ static void musicpal_misc_init(void)
1266 { 1266 {
1267 int iomemtype; 1267 int iomemtype;
1268 1268
1269 - iomemtype = cpu_register_io_memory(0, musicpal_misc_readfn, 1269 + iomemtype = cpu_register_io_memory(musicpal_misc_readfn,
1270 musicpal_misc_writefn, NULL); 1270 musicpal_misc_writefn, NULL);
1271 cpu_register_physical_memory(MP_MISC_BASE, MP_MISC_SIZE, iomemtype); 1271 cpu_register_physical_memory(MP_MISC_BASE, MP_MISC_SIZE, iomemtype);
1272 } 1272 }
@@ -1311,7 +1311,7 @@ static void mv88w8618_wlan_init(SysBusDevice *dev) @@ -1311,7 +1311,7 @@ static void mv88w8618_wlan_init(SysBusDevice *dev)
1311 { 1311 {
1312 int iomemtype; 1312 int iomemtype;
1313 1313
1314 - iomemtype = cpu_register_io_memory(0, mv88w8618_wlan_readfn, 1314 + iomemtype = cpu_register_io_memory(mv88w8618_wlan_readfn,
1315 mv88w8618_wlan_writefn, NULL); 1315 mv88w8618_wlan_writefn, NULL);
1316 sysbus_init_mmio(dev, MP_WLAN_SIZE, iomemtype); 1316 sysbus_init_mmio(dev, MP_WLAN_SIZE, iomemtype);
1317 } 1317 }
@@ -1412,7 +1412,7 @@ static void musicpal_gpio_init(void) @@ -1412,7 +1412,7 @@ static void musicpal_gpio_init(void)
1412 { 1412 {
1413 int iomemtype; 1413 int iomemtype;
1414 1414
1415 - iomemtype = cpu_register_io_memory(0, musicpal_gpio_readfn, 1415 + iomemtype = cpu_register_io_memory(musicpal_gpio_readfn,
1416 musicpal_gpio_writefn, NULL); 1416 musicpal_gpio_writefn, NULL);
1417 cpu_register_physical_memory(MP_GPIO_BASE, MP_GPIO_SIZE, iomemtype); 1417 cpu_register_physical_memory(MP_GPIO_BASE, MP_GPIO_SIZE, iomemtype);
1418 } 1418 }
hw/omap.h
@@ -1116,7 +1116,7 @@ static void io_writew(void *opaque, target_phys_addr_t addr, uint32_t value) @@ -1116,7 +1116,7 @@ static void io_writew(void *opaque, target_phys_addr_t addr, uint32_t value)
1116 static CPUReadMemoryFunc *io_readfn[] = { io_readb, io_readh, io_readw, }; 1116 static CPUReadMemoryFunc *io_readfn[] = { io_readb, io_readh, io_readw, };
1117 static CPUWriteMemoryFunc *io_writefn[] = { io_writeb, io_writeh, io_writew, }; 1117 static CPUWriteMemoryFunc *io_writefn[] = { io_writeb, io_writeh, io_writew, };
1118 1118
1119 -inline static int debug_register_io_memory(int io_index, 1119 +inline static int debug_register_io_memory(
1120 CPUReadMemoryFunc **mem_read, CPUWriteMemoryFunc **mem_write, 1120 CPUReadMemoryFunc **mem_read, CPUWriteMemoryFunc **mem_write,
1121 void *opaque) 1121 void *opaque)
1122 { 1122 {
@@ -1126,7 +1126,7 @@ inline static int debug_register_io_memory(int io_index, @@ -1126,7 +1126,7 @@ inline static int debug_register_io_memory(int io_index,
1126 s->mem_write = mem_write; 1126 s->mem_write = mem_write;
1127 s->opaque = opaque; 1127 s->opaque = opaque;
1128 s->in = 0; 1128 s->in = 0;
1129 - return cpu_register_io_memory(io_index, io_readfn, io_writefn, s); 1129 + return cpu_register_io_memory(io_readfn, io_writefn, s);
1130 } 1130 }
1131 # define cpu_register_io_memory debug_register_io_memory 1131 # define cpu_register_io_memory debug_register_io_memory
1132 # endif 1132 # endif
@@ -1136,7 +1136,7 @@ inline static int debug_register_io_memory(int io_index, @@ -1136,7 +1136,7 @@ inline static int debug_register_io_memory(int io_index,
1136 1136
1137 # ifdef L4_MUX_HACK 1137 # ifdef L4_MUX_HACK
1138 # undef l4_register_io_memory 1138 # undef l4_register_io_memory
1139 -int l4_register_io_memory(int io_index, CPUReadMemoryFunc **mem_read, 1139 +int l4_register_io_memory(CPUReadMemoryFunc **mem_read,
1140 CPUWriteMemoryFunc **mem_write, void *opaque); 1140 CPUWriteMemoryFunc **mem_write, void *opaque);
1141 # endif 1141 # endif
1142 1142
hw/omap1.c
@@ -425,7 +425,7 @@ struct omap_intr_handler_s *omap_inth_init(target_phys_addr_t base, @@ -425,7 +425,7 @@ struct omap_intr_handler_s *omap_inth_init(target_phys_addr_t base,
425 425
426 omap_inth_reset(s); 426 omap_inth_reset(s);
427 427
428 - iomemtype = cpu_register_io_memory(0, omap_inth_readfn, 428 + iomemtype = cpu_register_io_memory(omap_inth_readfn,
429 omap_inth_writefn, s); 429 omap_inth_writefn, s);
430 cpu_register_physical_memory(base, size, iomemtype); 430 cpu_register_physical_memory(base, size, iomemtype);
431 431
@@ -645,7 +645,7 @@ struct omap_intr_handler_s *omap2_inth_init(target_phys_addr_t base, @@ -645,7 +645,7 @@ struct omap_intr_handler_s *omap2_inth_init(target_phys_addr_t base,
645 645
646 omap_inth_reset(s); 646 omap_inth_reset(s);
647 647
648 - iomemtype = cpu_register_io_memory(0, omap2_inth_readfn, 648 + iomemtype = cpu_register_io_memory(omap2_inth_readfn,
649 omap2_inth_writefn, s); 649 omap2_inth_writefn, s);
650 cpu_register_physical_memory(base, size, iomemtype); 650 cpu_register_physical_memory(base, size, iomemtype);
651 651
@@ -834,7 +834,7 @@ struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base, @@ -834,7 +834,7 @@ struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base,
834 omap_mpu_timer_reset(s); 834 omap_mpu_timer_reset(s);
835 omap_timer_clk_setup(s); 835 omap_timer_clk_setup(s);
836 836
837 - iomemtype = cpu_register_io_memory(0, omap_mpu_timer_readfn, 837 + iomemtype = cpu_register_io_memory(omap_mpu_timer_readfn,
838 omap_mpu_timer_writefn, s); 838 omap_mpu_timer_writefn, s);
839 cpu_register_physical_memory(base, 0x100, iomemtype); 839 cpu_register_physical_memory(base, 0x100, iomemtype);
840 840
@@ -957,7 +957,7 @@ struct omap_watchdog_timer_s *omap_wd_timer_init(target_phys_addr_t base, @@ -957,7 +957,7 @@ struct omap_watchdog_timer_s *omap_wd_timer_init(target_phys_addr_t base,
957 omap_wd_timer_reset(s); 957 omap_wd_timer_reset(s);
958 omap_timer_clk_setup(&s->timer); 958 omap_timer_clk_setup(&s->timer);
959 959
960 - iomemtype = cpu_register_io_memory(0, omap_wd_timer_readfn, 960 + iomemtype = cpu_register_io_memory(omap_wd_timer_readfn,
961 omap_wd_timer_writefn, s); 961 omap_wd_timer_writefn, s);
962 cpu_register_physical_memory(base, 0x100, iomemtype); 962 cpu_register_physical_memory(base, 0x100, iomemtype);
963 963
@@ -1059,7 +1059,7 @@ struct omap_32khz_timer_s *omap_os_timer_init(target_phys_addr_t base, @@ -1059,7 +1059,7 @@ struct omap_32khz_timer_s *omap_os_timer_init(target_phys_addr_t base,
1059 omap_os_timer_reset(s); 1059 omap_os_timer_reset(s);
1060 omap_timer_clk_setup(&s->timer); 1060 omap_timer_clk_setup(&s->timer);
1061 1061
1062 - iomemtype = cpu_register_io_memory(0, omap_os_timer_readfn, 1062 + iomemtype = cpu_register_io_memory(omap_os_timer_readfn,
1063 omap_os_timer_writefn, s); 1063 omap_os_timer_writefn, s);
1064 cpu_register_physical_memory(base, 0x800, iomemtype); 1064 cpu_register_physical_memory(base, 0x800, iomemtype);
1065 1065
@@ -1286,7 +1286,7 @@ static void omap_ulpd_pm_reset(struct omap_mpu_state_s *mpu) @@ -1286,7 +1286,7 @@ static void omap_ulpd_pm_reset(struct omap_mpu_state_s *mpu)
1286 static void omap_ulpd_pm_init(target_phys_addr_t base, 1286 static void omap_ulpd_pm_init(target_phys_addr_t base,
1287 struct omap_mpu_state_s *mpu) 1287 struct omap_mpu_state_s *mpu)
1288 { 1288 {
1289 - int iomemtype = cpu_register_io_memory(0, omap_ulpd_pm_readfn, 1289 + int iomemtype = cpu_register_io_memory(omap_ulpd_pm_readfn,
1290 omap_ulpd_pm_writefn, mpu); 1290 omap_ulpd_pm_writefn, mpu);
1291 1291
1292 cpu_register_physical_memory(base, 0x800, iomemtype); 1292 cpu_register_physical_memory(base, 0x800, iomemtype);
@@ -1501,7 +1501,7 @@ static void omap_pin_cfg_reset(struct omap_mpu_state_s *mpu) @@ -1501,7 +1501,7 @@ static void omap_pin_cfg_reset(struct omap_mpu_state_s *mpu)
1501 static void omap_pin_cfg_init(target_phys_addr_t base, 1501 static void omap_pin_cfg_init(target_phys_addr_t base,
1502 struct omap_mpu_state_s *mpu) 1502 struct omap_mpu_state_s *mpu)
1503 { 1503 {
1504 - int iomemtype = cpu_register_io_memory(0, omap_pin_cfg_readfn, 1504 + int iomemtype = cpu_register_io_memory(omap_pin_cfg_readfn,
1505 omap_pin_cfg_writefn, mpu); 1505 omap_pin_cfg_writefn, mpu);
1506 1506
1507 cpu_register_physical_memory(base, 0x800, iomemtype); 1507 cpu_register_physical_memory(base, 0x800, iomemtype);
@@ -1571,7 +1571,7 @@ static CPUWriteMemoryFunc *omap_id_writefn[] = { @@ -1571,7 +1571,7 @@ static CPUWriteMemoryFunc *omap_id_writefn[] = {
1571 1571
1572 static void omap_id_init(struct omap_mpu_state_s *mpu) 1572 static void omap_id_init(struct omap_mpu_state_s *mpu)
1573 { 1573 {
1574 - int iomemtype = cpu_register_io_memory(0, omap_id_readfn, 1574 + int iomemtype = cpu_register_io_memory(omap_id_readfn,
1575 omap_id_writefn, mpu); 1575 omap_id_writefn, mpu);
1576 cpu_register_physical_memory_offset(0xfffe1800, 0x800, iomemtype, 0xfffe1800); 1576 cpu_register_physical_memory_offset(0xfffe1800, 0x800, iomemtype, 0xfffe1800);
1577 cpu_register_physical_memory_offset(0xfffed400, 0x100, iomemtype, 0xfffed400); 1577 cpu_register_physical_memory_offset(0xfffed400, 0x100, iomemtype, 0xfffed400);
@@ -1654,7 +1654,7 @@ static void omap_mpui_reset(struct omap_mpu_state_s *s) @@ -1654,7 +1654,7 @@ static void omap_mpui_reset(struct omap_mpu_state_s *s)
1654 static void omap_mpui_init(target_phys_addr_t base, 1654 static void omap_mpui_init(target_phys_addr_t base,
1655 struct omap_mpu_state_s *mpu) 1655 struct omap_mpu_state_s *mpu)
1656 { 1656 {
1657 - int iomemtype = cpu_register_io_memory(0, omap_mpui_readfn, 1657 + int iomemtype = cpu_register_io_memory(omap_mpui_readfn,
1658 omap_mpui_writefn, mpu); 1658 omap_mpui_writefn, mpu);
1659 1659
1660 cpu_register_physical_memory(base, 0x100, iomemtype); 1660 cpu_register_physical_memory(base, 0x100, iomemtype);
@@ -1763,7 +1763,7 @@ struct omap_tipb_bridge_s *omap_tipb_bridge_init(target_phys_addr_t base, @@ -1763,7 +1763,7 @@ struct omap_tipb_bridge_s *omap_tipb_bridge_init(target_phys_addr_t base,
1763 s->abort = abort_irq; 1763 s->abort = abort_irq;
1764 omap_tipb_bridge_reset(s); 1764 omap_tipb_bridge_reset(s);
1765 1765
1766 - iomemtype = cpu_register_io_memory(0, omap_tipb_bridge_readfn, 1766 + iomemtype = cpu_register_io_memory(omap_tipb_bridge_readfn,
1767 omap_tipb_bridge_writefn, s); 1767 omap_tipb_bridge_writefn, s);
1768 cpu_register_physical_memory(base, 0x100, iomemtype); 1768 cpu_register_physical_memory(base, 0x100, iomemtype);
1769 1769
@@ -1869,7 +1869,7 @@ static void omap_tcmi_reset(struct omap_mpu_state_s *mpu) @@ -1869,7 +1869,7 @@ static void omap_tcmi_reset(struct omap_mpu_state_s *mpu)
1869 static void omap_tcmi_init(target_phys_addr_t base, 1869 static void omap_tcmi_init(target_phys_addr_t base,
1870 struct omap_mpu_state_s *mpu) 1870 struct omap_mpu_state_s *mpu)
1871 { 1871 {
1872 - int iomemtype = cpu_register_io_memory(0, omap_tcmi_readfn, 1872 + int iomemtype = cpu_register_io_memory(omap_tcmi_readfn,
1873 omap_tcmi_writefn, mpu); 1873 omap_tcmi_writefn, mpu);
1874 1874
1875 cpu_register_physical_memory(base, 0x100, iomemtype); 1875 cpu_register_physical_memory(base, 0x100, iomemtype);
@@ -1942,7 +1942,7 @@ static void omap_dpll_reset(struct dpll_ctl_s *s) @@ -1942,7 +1942,7 @@ static void omap_dpll_reset(struct dpll_ctl_s *s)
1942 static void omap_dpll_init(struct dpll_ctl_s *s, target_phys_addr_t base, 1942 static void omap_dpll_init(struct dpll_ctl_s *s, target_phys_addr_t base,
1943 omap_clk clk) 1943 omap_clk clk)
1944 { 1944 {
1945 - int iomemtype = cpu_register_io_memory(0, omap_dpll_readfn, 1945 + int iomemtype = cpu_register_io_memory(omap_dpll_readfn,
1946 omap_dpll_writefn, s); 1946 omap_dpll_writefn, s);
1947 1947
1948 s->dpll = clk; 1948 s->dpll = clk;
@@ -2089,7 +2089,7 @@ struct omap_uart_s *omap2_uart_init(struct omap_target_agent_s *ta, @@ -2089,7 +2089,7 @@ struct omap_uart_s *omap2_uart_init(struct omap_target_agent_s *ta,
2089 target_phys_addr_t base = omap_l4_attach(ta, 0, 0); 2089 target_phys_addr_t base = omap_l4_attach(ta, 0, 0);
2090 struct omap_uart_s *s = omap_uart_init(base, irq, 2090 struct omap_uart_s *s = omap_uart_init(base, irq,
2091 fclk, iclk, txdma, rxdma, chr); 2091 fclk, iclk, txdma, rxdma, chr);
2092 - int iomemtype = cpu_register_io_memory(0, omap_uart_readfn, 2092 + int iomemtype = cpu_register_io_memory(omap_uart_readfn,
2093 omap_uart_writefn, s); 2093 omap_uart_writefn, s);
2094 2094
2095 s->ta = ta; 2095 s->ta = ta;
@@ -2504,8 +2504,8 @@ static void omap_clkm_init(target_phys_addr_t mpu_base, @@ -2504,8 +2504,8 @@ static void omap_clkm_init(target_phys_addr_t mpu_base,
2504 target_phys_addr_t dsp_base, struct omap_mpu_state_s *s) 2504 target_phys_addr_t dsp_base, struct omap_mpu_state_s *s)
2505 { 2505 {
2506 int iomemtype[2] = { 2506 int iomemtype[2] = {
2507 - cpu_register_io_memory(0, omap_clkm_readfn, omap_clkm_writefn, s),  
2508 - cpu_register_io_memory(0, omap_clkdsp_readfn, omap_clkdsp_writefn, s), 2507 + cpu_register_io_memory(omap_clkm_readfn, omap_clkm_writefn, s),
  2508 + cpu_register_io_memory(omap_clkdsp_readfn, omap_clkdsp_writefn, s),
2509 }; 2509 };
2510 2510
2511 s->clkm.arm_idlect1 = 0x03ff; 2511 s->clkm.arm_idlect1 = 0x03ff;
@@ -2758,7 +2758,7 @@ struct omap_mpuio_s *omap_mpuio_init(target_phys_addr_t base, @@ -2758,7 +2758,7 @@ struct omap_mpuio_s *omap_mpuio_init(target_phys_addr_t base,
2758 s->in = qemu_allocate_irqs(omap_mpuio_set, s, 16); 2758 s->in = qemu_allocate_irqs(omap_mpuio_set, s, 16);
2759 omap_mpuio_reset(s); 2759 omap_mpuio_reset(s);
2760 2760
2761 - iomemtype = cpu_register_io_memory(0, omap_mpuio_readfn, 2761 + iomemtype = cpu_register_io_memory(omap_mpuio_readfn,
2762 omap_mpuio_writefn, s); 2762 omap_mpuio_writefn, s);
2763 cpu_register_physical_memory(base, 0x800, iomemtype); 2763 cpu_register_physical_memory(base, 0x800, iomemtype);
2764 2764
@@ -2954,7 +2954,7 @@ struct omap_gpio_s *omap_gpio_init(target_phys_addr_t base, @@ -2954,7 +2954,7 @@ struct omap_gpio_s *omap_gpio_init(target_phys_addr_t base,
2954 s->in = qemu_allocate_irqs(omap_gpio_set, s, 16); 2954 s->in = qemu_allocate_irqs(omap_gpio_set, s, 16);
2955 omap_gpio_reset(s); 2955 omap_gpio_reset(s);
2956 2956
2957 - iomemtype = cpu_register_io_memory(0, omap_gpio_readfn, 2957 + iomemtype = cpu_register_io_memory(omap_gpio_readfn,
2958 omap_gpio_writefn, s); 2958 omap_gpio_writefn, s);
2959 cpu_register_physical_memory(base, 0x1000, iomemtype); 2959 cpu_register_physical_memory(base, 0x1000, iomemtype);
2960 2960
@@ -3124,7 +3124,7 @@ struct omap_uwire_s *omap_uwire_init(target_phys_addr_t base, @@ -3124,7 +3124,7 @@ struct omap_uwire_s *omap_uwire_init(target_phys_addr_t base,
3124 s->txdrq = dma; 3124 s->txdrq = dma;
3125 omap_uwire_reset(s); 3125 omap_uwire_reset(s);
3126 3126
3127 - iomemtype = cpu_register_io_memory(0, omap_uwire_readfn, 3127 + iomemtype = cpu_register_io_memory(omap_uwire_readfn,
3128 omap_uwire_writefn, s); 3128 omap_uwire_writefn, s);
3129 cpu_register_physical_memory(base, 0x800, iomemtype); 3129 cpu_register_physical_memory(base, 0x800, iomemtype);
3130 3130
@@ -3225,7 +3225,7 @@ static void omap_pwl_init(target_phys_addr_t base, struct omap_mpu_state_s *s, @@ -3225,7 +3225,7 @@ static void omap_pwl_init(target_phys_addr_t base, struct omap_mpu_state_s *s,
3225 3225
3226 omap_pwl_reset(s); 3226 omap_pwl_reset(s);
3227 3227
3228 - iomemtype = cpu_register_io_memory(0, omap_pwl_readfn, 3228 + iomemtype = cpu_register_io_memory(omap_pwl_readfn,
3229 omap_pwl_writefn, s); 3229 omap_pwl_writefn, s);
3230 cpu_register_physical_memory(base, 0x800, iomemtype); 3230 cpu_register_physical_memory(base, 0x800, iomemtype);
3231 3231
@@ -3320,7 +3320,7 @@ static void omap_pwt_init(target_phys_addr_t base, struct omap_mpu_state_s *s, @@ -3320,7 +3320,7 @@ static void omap_pwt_init(target_phys_addr_t base, struct omap_mpu_state_s *s,
3320 s->pwt.clk = clk; 3320 s->pwt.clk = clk;
3321 omap_pwt_reset(s); 3321 omap_pwt_reset(s);
3322 3322
3323 - iomemtype = cpu_register_io_memory(0, omap_pwt_readfn, 3323 + iomemtype = cpu_register_io_memory(omap_pwt_readfn,
3324 omap_pwt_writefn, s); 3324 omap_pwt_writefn, s);
3325 cpu_register_physical_memory(base, 0x800, iomemtype); 3325 cpu_register_physical_memory(base, 0x800, iomemtype);
3326 } 3326 }
@@ -3743,7 +3743,7 @@ struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base, @@ -3743,7 +3743,7 @@ struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,
3743 3743
3744 omap_rtc_reset(s); 3744 omap_rtc_reset(s);
3745 3745
3746 - iomemtype = cpu_register_io_memory(0, omap_rtc_readfn, 3746 + iomemtype = cpu_register_io_memory(omap_rtc_readfn,
3747 omap_rtc_writefn, s); 3747 omap_rtc_writefn, s);
3748 cpu_register_physical_memory(base, 0x800, iomemtype); 3748 cpu_register_physical_memory(base, 0x800, iomemtype);
3749 3749
@@ -4263,7 +4263,7 @@ struct omap_mcbsp_s *omap_mcbsp_init(target_phys_addr_t base, @@ -4263,7 +4263,7 @@ struct omap_mcbsp_s *omap_mcbsp_init(target_phys_addr_t base,
4263 s->source_timer = qemu_new_timer(vm_clock, omap_mcbsp_source_tick, s); 4263 s->source_timer = qemu_new_timer(vm_clock, omap_mcbsp_source_tick, s);
4264 omap_mcbsp_reset(s); 4264 omap_mcbsp_reset(s);
4265 4265
4266 - iomemtype = cpu_register_io_memory(0, omap_mcbsp_readfn, 4266 + iomemtype = cpu_register_io_memory(omap_mcbsp_readfn,
4267 omap_mcbsp_writefn, s); 4267 omap_mcbsp_writefn, s);
4268 cpu_register_physical_memory(base, 0x800, iomemtype); 4268 cpu_register_physical_memory(base, 0x800, iomemtype);
4269 4269
@@ -4435,7 +4435,7 @@ struct omap_lpg_s *omap_lpg_init(target_phys_addr_t base, omap_clk clk) @@ -4435,7 +4435,7 @@ struct omap_lpg_s *omap_lpg_init(target_phys_addr_t base, omap_clk clk)
4435 4435
4436 omap_lpg_reset(s); 4436 omap_lpg_reset(s);
4437 4437
4438 - iomemtype = cpu_register_io_memory(0, omap_lpg_readfn, 4438 + iomemtype = cpu_register_io_memory(omap_lpg_readfn,
4439 omap_lpg_writefn, s); 4439 omap_lpg_writefn, s);
4440 cpu_register_physical_memory(base, 0x800, iomemtype); 4440 cpu_register_physical_memory(base, 0x800, iomemtype);
4441 4441
@@ -4468,7 +4468,7 @@ static CPUWriteMemoryFunc *omap_mpui_io_writefn[] = { @@ -4468,7 +4468,7 @@ static CPUWriteMemoryFunc *omap_mpui_io_writefn[] = {
4468 4468
4469 static void omap_setup_mpui_io(struct omap_mpu_state_s *mpu) 4469 static void omap_setup_mpui_io(struct omap_mpu_state_s *mpu)
4470 { 4470 {
4471 - int iomemtype = cpu_register_io_memory(0, omap_mpui_io_readfn, 4471 + int iomemtype = cpu_register_io_memory(omap_mpui_io_readfn,
4472 omap_mpui_io_writefn, mpu); 4472 omap_mpui_io_writefn, mpu);
4473 cpu_register_physical_memory(OMAP_MPUI_BASE, 0x7fff, iomemtype); 4473 cpu_register_physical_memory(OMAP_MPUI_BASE, 0x7fff, iomemtype);
4474 } 4474 }
hw/omap2.c
@@ -483,7 +483,7 @@ struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta, @@ -483,7 +483,7 @@ struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta,
483 omap_gp_timer_reset(s); 483 omap_gp_timer_reset(s);
484 omap_gp_timer_clk_setup(s); 484 omap_gp_timer_clk_setup(s);
485 485
486 - iomemtype = l4_register_io_memory(0, omap_gp_timer_readfn, 486 + iomemtype = l4_register_io_memory(omap_gp_timer_readfn,
487 omap_gp_timer_writefn, s); 487 omap_gp_timer_writefn, s);
488 omap_l4_attach(ta, 0, iomemtype); 488 omap_l4_attach(ta, 0, iomemtype);
489 489
@@ -554,7 +554,7 @@ void omap_synctimer_init(struct omap_target_agent_s *ta, @@ -554,7 +554,7 @@ void omap_synctimer_init(struct omap_target_agent_s *ta,
554 struct omap_synctimer_s *s = &mpu->synctimer; 554 struct omap_synctimer_s *s = &mpu->synctimer;
555 555
556 omap_synctimer_reset(s); 556 omap_synctimer_reset(s);
557 - omap_l4_attach(ta, 0, l4_register_io_memory(0, 557 + omap_l4_attach(ta, 0, l4_register_io_memory(
558 omap_synctimer_readfn, omap_synctimer_writefn, s)); 558 omap_synctimer_readfn, omap_synctimer_writefn, s));
559 } 559 }
560 560
@@ -952,7 +952,7 @@ static void omap_gpio_module_init(struct omap2_gpio_s *s, @@ -952,7 +952,7 @@ static void omap_gpio_module_init(struct omap2_gpio_s *s,
952 s->wkup = wkup; 952 s->wkup = wkup;
953 s->in = qemu_allocate_irqs(omap_gpio_module_set, s, 32); 953 s->in = qemu_allocate_irqs(omap_gpio_module_set, s, 32);
954 954
955 - iomemtype = l4_register_io_memory(0, omap_gpio_module_readfn, 955 + iomemtype = l4_register_io_memory(omap_gpio_module_readfn,
956 omap_gpio_module_writefn, s); 956 omap_gpio_module_writefn, s);
957 omap_l4_attach(ta, region, iomemtype); 957 omap_l4_attach(ta, region, iomemtype);
958 } 958 }
@@ -1060,7 +1060,7 @@ struct omap_gpif_s *omap2_gpio_init(struct omap_target_agent_s *ta, @@ -1060,7 +1060,7 @@ struct omap_gpif_s *omap2_gpio_init(struct omap_target_agent_s *ta,
1060 1060
1061 omap_gpif_reset(s); 1061 omap_gpif_reset(s);
1062 1062
1063 - iomemtype = l4_register_io_memory(0, omap_gpif_top_readfn, 1063 + iomemtype = l4_register_io_memory(omap_gpif_top_readfn,
1064 omap_gpif_top_writefn, s); 1064 omap_gpif_top_writefn, s);
1065 omap_l4_attach(ta, 1, iomemtype); 1065 omap_l4_attach(ta, 1, iomemtype);
1066 1066
@@ -1386,7 +1386,7 @@ struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum, @@ -1386,7 +1386,7 @@ struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum,
1386 } 1386 }
1387 omap_mcspi_reset(s); 1387 omap_mcspi_reset(s);
1388 1388
1389 - iomemtype = l4_register_io_memory(0, omap_mcspi_readfn, 1389 + iomemtype = l4_register_io_memory(omap_mcspi_readfn,
1390 omap_mcspi_writefn, s); 1390 omap_mcspi_writefn, s);
1391 omap_l4_attach(ta, 0, iomemtype); 1391 omap_l4_attach(ta, 0, iomemtype);
1392 1392
@@ -1975,7 +1975,7 @@ struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta, @@ -1975,7 +1975,7 @@ struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
1975 #ifdef HAS_AUDIO 1975 #ifdef HAS_AUDIO
1976 AUD_register_card("OMAP EAC", &s->codec.card); 1976 AUD_register_card("OMAP EAC", &s->codec.card);
1977 1977
1978 - iomemtype = cpu_register_io_memory(0, omap_eac_readfn, 1978 + iomemtype = cpu_register_io_memory(omap_eac_readfn,
1979 omap_eac_writefn, s); 1979 omap_eac_writefn, s);
1980 omap_l4_attach(ta, 0, iomemtype); 1980 omap_l4_attach(ta, 0, iomemtype);
1981 #endif 1981 #endif
@@ -2160,11 +2160,11 @@ static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta, @@ -2160,11 +2160,11 @@ static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta,
2160 2160
2161 s->chr = chr ?: qemu_chr_open("null", "null", NULL); 2161 s->chr = chr ?: qemu_chr_open("null", "null", NULL);
2162 2162
2163 - iomemtype = l4_register_io_memory(0, omap_sti_readfn, 2163 + iomemtype = l4_register_io_memory(omap_sti_readfn,
2164 omap_sti_writefn, s); 2164 omap_sti_writefn, s);
2165 omap_l4_attach(ta, 0, iomemtype); 2165 omap_l4_attach(ta, 0, iomemtype);
2166 2166
2167 - iomemtype = cpu_register_io_memory(0, omap_sti_fifo_readfn, 2167 + iomemtype = cpu_register_io_memory(omap_sti_fifo_readfn,
2168 omap_sti_fifo_writefn, s); 2168 omap_sti_fifo_writefn, s);
2169 cpu_register_physical_memory(channel_base, 0x10000, iomemtype); 2169 cpu_register_physical_memory(channel_base, 0x10000, iomemtype);
2170 2170
@@ -2204,7 +2204,7 @@ static CPUWriteMemoryFunc **omap_l4_io_writeh_fn; @@ -2204,7 +2204,7 @@ static CPUWriteMemoryFunc **omap_l4_io_writeh_fn;
2204 static CPUWriteMemoryFunc **omap_l4_io_writew_fn; 2204 static CPUWriteMemoryFunc **omap_l4_io_writew_fn;
2205 static void **omap_l4_io_opaque; 2205 static void **omap_l4_io_opaque;
2206 2206
2207 -int l4_register_io_memory(int io_index, CPUReadMemoryFunc **mem_read, 2207 +int l4_register_io_memory(CPUReadMemoryFunc **mem_read,
2208 CPUWriteMemoryFunc **mem_write, void *opaque) 2208 CPUWriteMemoryFunc **mem_write, void *opaque)
2209 { 2209 {
2210 omap_l4_io_entry[omap_l4_io_entries].mem_read = mem_read; 2210 omap_l4_io_entry[omap_l4_io_entries].mem_read = mem_read;
@@ -2285,7 +2285,7 @@ struct omap_l4_s *omap_l4_init(target_phys_addr_t base, int ta_num) @@ -2285,7 +2285,7 @@ struct omap_l4_s *omap_l4_init(target_phys_addr_t base, int ta_num)
2285 omap_l4_io_entry = qemu_mallocz(125 * sizeof(*omap_l4_io_entry)); 2285 omap_l4_io_entry = qemu_mallocz(125 * sizeof(*omap_l4_io_entry));
2286 2286
2287 omap_cpu_io_entry = 2287 omap_cpu_io_entry =
2288 - cpu_register_io_memory(0, omap_l4_io_readfn, 2288 + cpu_register_io_memory(omap_l4_io_readfn,
2289 omap_l4_io_writefn, bus); 2289 omap_l4_io_writefn, bus);
2290 # define L4_PAGES (0xb4000 / TARGET_PAGE_SIZE) 2290 # define L4_PAGES (0xb4000 / TARGET_PAGE_SIZE)
2291 omap_l4_io_readb_fn = qemu_mallocz(sizeof(void *) * L4_PAGES); 2291 omap_l4_io_readb_fn = qemu_mallocz(sizeof(void *) * L4_PAGES);
@@ -2578,7 +2578,7 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus, int cs) @@ -2578,7 +2578,7 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus, int cs)
2578 ta->status = 0x00000000; 2578 ta->status = 0x00000000;
2579 ta->control = 0x00000200; /* XXX 01000200 for L4TAO */ 2579 ta->control = 0x00000200; /* XXX 01000200 for L4TAO */
2580 2580
2581 - iomemtype = l4_register_io_memory(0, omap_l4ta_readfn, 2581 + iomemtype = l4_register_io_memory(omap_l4ta_readfn,
2582 omap_l4ta_writefn, ta); 2582 omap_l4ta_writefn, ta);
2583 ta->base = omap_l4_attach(ta, info->ta_region, iomemtype); 2583 ta->base = omap_l4_attach(ta, info->ta_region, iomemtype);
2584 2584
@@ -2708,7 +2708,7 @@ static CPUWriteMemoryFunc *omap_tap_writefn[] = { @@ -2708,7 +2708,7 @@ static CPUWriteMemoryFunc *omap_tap_writefn[] = {
2708 void omap_tap_init(struct omap_target_agent_s *ta, 2708 void omap_tap_init(struct omap_target_agent_s *ta,
2709 struct omap_mpu_state_s *mpu) 2709 struct omap_mpu_state_s *mpu)
2710 { 2710 {
2711 - omap_l4_attach(ta, 0, l4_register_io_memory(0, 2711 + omap_l4_attach(ta, 0, l4_register_io_memory(
2712 omap_tap_readfn, omap_tap_writefn, mpu)); 2712 omap_tap_readfn, omap_tap_writefn, mpu));
2713 } 2713 }
2714 2714
@@ -3521,7 +3521,7 @@ struct omap_prcm_s *omap_prcm_init(struct omap_target_agent_s *ta, @@ -3521,7 +3521,7 @@ struct omap_prcm_s *omap_prcm_init(struct omap_target_agent_s *ta,
3521 s->mpu = mpu; 3521 s->mpu = mpu;
3522 omap_prcm_coldreset(s); 3522 omap_prcm_coldreset(s);
3523 3523
3524 - iomemtype = l4_register_io_memory(0, omap_prcm_readfn, 3524 + iomemtype = l4_register_io_memory(omap_prcm_readfn,
3525 omap_prcm_writefn, s); 3525 omap_prcm_writefn, s);
3526 omap_l4_attach(ta, 0, iomemtype); 3526 omap_l4_attach(ta, 0, iomemtype);
3527 omap_l4_attach(ta, 1, iomemtype); 3527 omap_l4_attach(ta, 1, iomemtype);
@@ -3891,7 +3891,7 @@ struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta, @@ -3891,7 +3891,7 @@ struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
3891 s->mpu = mpu; 3891 s->mpu = mpu;
3892 omap_sysctl_reset(s); 3892 omap_sysctl_reset(s);
3893 3893
3894 - iomemtype = l4_register_io_memory(0, omap_sysctl_readfn, 3894 + iomemtype = l4_register_io_memory(omap_sysctl_readfn,
3895 omap_sysctl_writefn, s); 3895 omap_sysctl_writefn, s);
3896 omap_l4_attach(ta, 0, iomemtype); 3896 omap_l4_attach(ta, 0, iomemtype);
3897 3897
@@ -4035,7 +4035,7 @@ struct omap_sdrc_s *omap_sdrc_init(target_phys_addr_t base) @@ -4035,7 +4035,7 @@ struct omap_sdrc_s *omap_sdrc_init(target_phys_addr_t base)
4035 4035
4036 omap_sdrc_reset(s); 4036 omap_sdrc_reset(s);
4037 4037
4038 - iomemtype = cpu_register_io_memory(0, omap_sdrc_readfn, 4038 + iomemtype = cpu_register_io_memory(omap_sdrc_readfn,
4039 omap_sdrc_writefn, s); 4039 omap_sdrc_writefn, s);
4040 cpu_register_physical_memory(base, 0x1000, iomemtype); 4040 cpu_register_physical_memory(base, 0x1000, iomemtype);
4041 4041
@@ -4409,7 +4409,7 @@ struct omap_gpmc_s *omap_gpmc_init(target_phys_addr_t base, qemu_irq irq) @@ -4409,7 +4409,7 @@ struct omap_gpmc_s *omap_gpmc_init(target_phys_addr_t base, qemu_irq irq)
4409 4409
4410 omap_gpmc_reset(s); 4410 omap_gpmc_reset(s);
4411 4411
4412 - iomemtype = cpu_register_io_memory(0, omap_gpmc_readfn, 4412 + iomemtype = cpu_register_io_memory(omap_gpmc_readfn,
4413 omap_gpmc_writefn, s); 4413 omap_gpmc_writefn, s);
4414 cpu_register_physical_memory(base, 0x1000, iomemtype); 4414 cpu_register_physical_memory(base, 0x1000, iomemtype);
4415 4415
hw/omap_dma.c
@@ -1655,7 +1655,7 @@ struct soc_dma_s *omap_dma_init(target_phys_addr_t base, qemu_irq *irqs, @@ -1655,7 +1655,7 @@ struct soc_dma_s *omap_dma_init(target_phys_addr_t base, qemu_irq *irqs,
1655 omap_dma_reset(s->dma); 1655 omap_dma_reset(s->dma);
1656 omap_dma_clk_update(s, 0, 1); 1656 omap_dma_clk_update(s, 0, 1);
1657 1657
1658 - iomemtype = cpu_register_io_memory(0, omap_dma_readfn, 1658 + iomemtype = cpu_register_io_memory(omap_dma_readfn,
1659 omap_dma_writefn, s); 1659 omap_dma_writefn, s);
1660 cpu_register_physical_memory(base, memsize, iomemtype); 1660 cpu_register_physical_memory(base, memsize, iomemtype);
1661 1661
@@ -2062,7 +2062,7 @@ struct soc_dma_s *omap_dma4_init(target_phys_addr_t base, qemu_irq *irqs, @@ -2062,7 +2062,7 @@ struct soc_dma_s *omap_dma4_init(target_phys_addr_t base, qemu_irq *irqs,
2062 omap_dma_reset(s->dma); 2062 omap_dma_reset(s->dma);
2063 omap_dma_clk_update(s, 0, !!s->dma->freq); 2063 omap_dma_clk_update(s, 0, !!s->dma->freq);
2064 2064
2065 - iomemtype = cpu_register_io_memory(0, omap_dma4_readfn, 2065 + iomemtype = cpu_register_io_memory(omap_dma4_readfn,
2066 omap_dma4_writefn, s); 2066 omap_dma4_writefn, s);
2067 cpu_register_physical_memory(base, 0x1000, iomemtype); 2067 cpu_register_physical_memory(base, 0x1000, iomemtype);
2068 2068
hw/omap_dss.c
@@ -1037,15 +1037,15 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta, @@ -1037,15 +1037,15 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
1037 s->drq = drq; 1037 s->drq = drq;
1038 omap_dss_reset(s); 1038 omap_dss_reset(s);
1039 1039
1040 - iomemtype[0] = l4_register_io_memory(0, omap_diss1_readfn, 1040 + iomemtype[0] = l4_register_io_memory(omap_diss1_readfn,
1041 omap_diss1_writefn, s); 1041 omap_diss1_writefn, s);
1042 - iomemtype[1] = l4_register_io_memory(0, omap_disc1_readfn, 1042 + iomemtype[1] = l4_register_io_memory(omap_disc1_readfn,
1043 omap_disc1_writefn, s); 1043 omap_disc1_writefn, s);
1044 - iomemtype[2] = l4_register_io_memory(0, omap_rfbi1_readfn, 1044 + iomemtype[2] = l4_register_io_memory(omap_rfbi1_readfn,
1045 omap_rfbi1_writefn, s); 1045 omap_rfbi1_writefn, s);
1046 - iomemtype[3] = l4_register_io_memory(0, omap_venc1_readfn, 1046 + iomemtype[3] = l4_register_io_memory(omap_venc1_readfn,
1047 omap_venc1_writefn, s); 1047 omap_venc1_writefn, s);
1048 - iomemtype[4] = cpu_register_io_memory(0, omap_im3_readfn, 1048 + iomemtype[4] = cpu_register_io_memory(omap_im3_readfn,
1049 omap_im3_writefn, s); 1049 omap_im3_writefn, s);
1050 omap_l4_attach(ta, 0, iomemtype[0]); 1050 omap_l4_attach(ta, 0, iomemtype[0]);
1051 omap_l4_attach(ta, 1, iomemtype[1]); 1051 omap_l4_attach(ta, 1, iomemtype[1]);
hw/omap_i2c.c
@@ -436,7 +436,7 @@ struct omap_i2c_s *omap_i2c_init(target_phys_addr_t base, @@ -436,7 +436,7 @@ struct omap_i2c_s *omap_i2c_init(target_phys_addr_t base,
436 s->bus = i2c_init_bus(NULL, "i2c"); 436 s->bus = i2c_init_bus(NULL, "i2c");
437 omap_i2c_reset(s); 437 omap_i2c_reset(s);
438 438
439 - iomemtype = cpu_register_io_memory(0, omap_i2c_readfn, 439 + iomemtype = cpu_register_io_memory(omap_i2c_readfn,
440 omap_i2c_writefn, s); 440 omap_i2c_writefn, s);
441 cpu_register_physical_memory(base, 0x800, iomemtype); 441 cpu_register_physical_memory(base, 0x800, iomemtype);
442 442
@@ -457,7 +457,7 @@ struct omap_i2c_s *omap2_i2c_init(struct omap_target_agent_s *ta, @@ -457,7 +457,7 @@ struct omap_i2c_s *omap2_i2c_init(struct omap_target_agent_s *ta,
457 s->bus = i2c_init_bus(NULL, "i2c"); 457 s->bus = i2c_init_bus(NULL, "i2c");
458 omap_i2c_reset(s); 458 omap_i2c_reset(s);
459 459
460 - iomemtype = l4_register_io_memory(0, omap_i2c_readfn, 460 + iomemtype = l4_register_io_memory(omap_i2c_readfn,
461 omap_i2c_writefn, s); 461 omap_i2c_writefn, s);
462 omap_l4_attach(ta, 0, iomemtype); 462 omap_l4_attach(ta, 0, iomemtype);
463 463
hw/omap_lcdc.c
@@ -450,7 +450,7 @@ struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq, @@ -450,7 +450,7 @@ struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq,
450 s->emiff_base = emiff_base; 450 s->emiff_base = emiff_base;
451 omap_lcdc_reset(s); 451 omap_lcdc_reset(s);
452 452
453 - iomemtype = cpu_register_io_memory(0, omap_lcdc_readfn, 453 + iomemtype = cpu_register_io_memory(omap_lcdc_readfn,
454 omap_lcdc_writefn, s); 454 omap_lcdc_writefn, s);
455 cpu_register_physical_memory(base, 0x100, iomemtype); 455 cpu_register_physical_memory(base, 0x100, iomemtype);
456 456
hw/omap_mmc.c
@@ -586,7 +586,7 @@ struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base, @@ -586,7 +586,7 @@ struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base,
586 586
587 omap_mmc_reset(s); 587 omap_mmc_reset(s);
588 588
589 - iomemtype = cpu_register_io_memory(0, omap_mmc_readfn, 589 + iomemtype = cpu_register_io_memory(omap_mmc_readfn,
590 omap_mmc_writefn, s); 590 omap_mmc_writefn, s);
591 cpu_register_physical_memory(base, 0x800, iomemtype); 591 cpu_register_physical_memory(base, 0x800, iomemtype);
592 592
@@ -612,7 +612,7 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, @@ -612,7 +612,7 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
612 612
613 omap_mmc_reset(s); 613 omap_mmc_reset(s);
614 614
615 - iomemtype = l4_register_io_memory(0, omap_mmc_readfn, 615 + iomemtype = l4_register_io_memory(omap_mmc_readfn,
616 omap_mmc_writefn, s); 616 omap_mmc_writefn, s);
617 omap_l4_attach(ta, 0, iomemtype); 617 omap_l4_attach(ta, 0, iomemtype);
618 618
hw/omap_sx1.c
@@ -142,12 +142,12 @@ static void sx1_init(ram_addr_t ram_size, @@ -142,12 +142,12 @@ static void sx1_init(ram_addr_t ram_size,
142 cpu_register_physical_memory(OMAP_CS0_BASE, flash_size, 142 cpu_register_physical_memory(OMAP_CS0_BASE, flash_size,
143 (phys_flash = qemu_ram_alloc(flash_size)) | IO_MEM_ROM); 143 (phys_flash = qemu_ram_alloc(flash_size)) | IO_MEM_ROM);
144 144
145 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs0val); 145 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs0val);
146 cpu_register_physical_memory(OMAP_CS0_BASE + flash_size, 146 cpu_register_physical_memory(OMAP_CS0_BASE + flash_size,
147 OMAP_CS0_SIZE - flash_size, io); 147 OMAP_CS0_SIZE - flash_size, io);
148 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs2val); 148 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs2val);
149 cpu_register_physical_memory(OMAP_CS2_BASE, OMAP_CS2_SIZE, io); 149 cpu_register_physical_memory(OMAP_CS2_BASE, OMAP_CS2_SIZE, io);
150 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs3val); 150 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs3val);
151 cpu_register_physical_memory(OMAP_CS3_BASE, OMAP_CS3_SIZE, io); 151 cpu_register_physical_memory(OMAP_CS3_BASE, OMAP_CS3_SIZE, io);
152 152
153 fl_idx = 0; 153 fl_idx = 0;
@@ -167,7 +167,7 @@ static void sx1_init(ram_addr_t ram_size, @@ -167,7 +167,7 @@ static void sx1_init(ram_addr_t ram_size,
167 cpu_register_physical_memory(OMAP_CS1_BASE, flash1_size, 167 cpu_register_physical_memory(OMAP_CS1_BASE, flash1_size,
168 (phys_flash = qemu_ram_alloc(flash1_size)) | 168 (phys_flash = qemu_ram_alloc(flash1_size)) |
169 IO_MEM_ROM); 169 IO_MEM_ROM);
170 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs1val); 170 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs1val);
171 cpu_register_physical_memory(OMAP_CS1_BASE + flash1_size, 171 cpu_register_physical_memory(OMAP_CS1_BASE + flash1_size,
172 OMAP_CS1_SIZE - flash1_size, io); 172 OMAP_CS1_SIZE - flash1_size, io);
173 173
@@ -179,7 +179,7 @@ static void sx1_init(ram_addr_t ram_size, @@ -179,7 +179,7 @@ static void sx1_init(ram_addr_t ram_size,
179 } 179 }
180 fl_idx++; 180 fl_idx++;
181 } else { 181 } else {
182 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs1val); 182 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs1val);
183 cpu_register_physical_memory(OMAP_CS1_BASE, OMAP_CS1_SIZE, io); 183 cpu_register_physical_memory(OMAP_CS1_BASE, OMAP_CS1_SIZE, io);
184 } 184 }
185 185
hw/onenand.c
@@ -631,7 +631,7 @@ void *onenand_init(uint32_t id, int regshift, qemu_irq irq) @@ -631,7 +631,7 @@ void *onenand_init(uint32_t id, int regshift, qemu_irq irq)
631 s->secs = size >> 9; 631 s->secs = size >> 9;
632 s->blockwp = qemu_malloc(s->blocks); 632 s->blockwp = qemu_malloc(s->blocks);
633 s->density_mask = (id & (1 << 11)) ? (1 << (6 + ((id >> 12) & 7))) : 0; 633 s->density_mask = (id & (1 << 11)) ? (1 << (6 + ((id >> 12) & 7))) : 0;
634 - s->iomemtype = cpu_register_io_memory(0, onenand_readfn, 634 + s->iomemtype = cpu_register_io_memory(onenand_readfn,
635 onenand_writefn, s); 635 onenand_writefn, s);
636 if (bdrv_index == -1) 636 if (bdrv_index == -1)
637 s->image = memset(qemu_malloc(size + (size >> 5)), 637 s->image = memset(qemu_malloc(size + (size >> 5)),
hw/openpic.c
@@ -1046,7 +1046,7 @@ static void openpic_map(PCIDevice *pci_dev, int region_num, @@ -1046,7 +1046,7 @@ static void openpic_map(PCIDevice *pci_dev, int region_num,
1046 addr + 0x20000, addr + 0x20000 + 0x1000 * MAX_CPU); 1046 addr + 0x20000, addr + 0x20000 + 0x1000 * MAX_CPU);
1047 cpu_register_physical_memory(addr, 0x40000, opp->mem_index); 1047 cpu_register_physical_memory(addr, 0x40000, opp->mem_index);
1048 #if 0 // Don't implement ISU for now 1048 #if 0 // Don't implement ISU for now
1049 - opp_io_memory = cpu_register_io_memory(0, openpic_src_read, 1049 + opp_io_memory = cpu_register_io_memory(openpic_src_read,
1050 openpic_src_write); 1050 openpic_src_write);
1051 cpu_register_physical_memory(isu_base, 0x20 * (EXT_IRQ + 2), 1051 cpu_register_physical_memory(isu_base, 0x20 * (EXT_IRQ + 2),
1052 opp_io_memory); 1052 opp_io_memory);
@@ -1217,7 +1217,7 @@ qemu_irq *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus, @@ -1217,7 +1217,7 @@ qemu_irq *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus,
1217 } else { 1217 } else {
1218 opp = qemu_mallocz(sizeof(openpic_t)); 1218 opp = qemu_mallocz(sizeof(openpic_t));
1219 } 1219 }
1220 - opp->mem_index = cpu_register_io_memory(0, openpic_read, 1220 + opp->mem_index = cpu_register_io_memory(openpic_read,
1221 openpic_write, opp); 1221 openpic_write, opp);
1222 1222
1223 // isu_base &= 0xFFFC0000; 1223 // isu_base &= 0xFFFC0000;
@@ -1687,7 +1687,7 @@ qemu_irq *mpic_init (target_phys_addr_t base, int nb_cpus, @@ -1687,7 +1687,7 @@ qemu_irq *mpic_init (target_phys_addr_t base, int nb_cpus,
1687 for (i = 0; i < sizeof(list)/sizeof(list[0]); i++) { 1687 for (i = 0; i < sizeof(list)/sizeof(list[0]); i++) {
1688 int mem_index; 1688 int mem_index;
1689 1689
1690 - mem_index = cpu_register_io_memory(0, list[i].read, list[i].write, mpp); 1690 + mem_index = cpu_register_io_memory(list[i].read, list[i].write, mpp);
1691 if (mem_index < 0) { 1691 if (mem_index < 0) {
1692 goto free; 1692 goto free;
1693 } 1693 }
hw/palm.c
@@ -216,14 +216,14 @@ static void palmte_init(ram_addr_t ram_size, @@ -216,14 +216,14 @@ static void palmte_init(ram_addr_t ram_size,
216 cpu_register_physical_memory(OMAP_CS0_BASE, flash_size, 216 cpu_register_physical_memory(OMAP_CS0_BASE, flash_size,
217 (phys_flash = qemu_ram_alloc(flash_size)) | IO_MEM_ROM); 217 (phys_flash = qemu_ram_alloc(flash_size)) | IO_MEM_ROM);
218 218
219 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs0val); 219 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs0val);
220 cpu_register_physical_memory(OMAP_CS0_BASE + flash_size, 220 cpu_register_physical_memory(OMAP_CS0_BASE + flash_size,
221 OMAP_CS0_SIZE - flash_size, io); 221 OMAP_CS0_SIZE - flash_size, io);
222 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs1val); 222 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs1val);
223 cpu_register_physical_memory(OMAP_CS1_BASE, OMAP_CS1_SIZE, io); 223 cpu_register_physical_memory(OMAP_CS1_BASE, OMAP_CS1_SIZE, io);
224 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs2val); 224 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs2val);
225 cpu_register_physical_memory(OMAP_CS2_BASE, OMAP_CS2_SIZE, io); 225 cpu_register_physical_memory(OMAP_CS2_BASE, OMAP_CS2_SIZE, io);
226 - io = cpu_register_io_memory(0, static_readfn, static_writefn, &cs3val); 226 + io = cpu_register_io_memory(static_readfn, static_writefn, &cs3val);
227 cpu_register_physical_memory(OMAP_CS3_BASE, OMAP_CS3_SIZE, io); 227 cpu_register_physical_memory(OMAP_CS3_BASE, OMAP_CS3_SIZE, io);
228 228
229 palmte_microwire_setup(cpu); 229 palmte_microwire_setup(cpu);
hw/parallel.c
@@ -543,7 +543,7 @@ ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq @@ -543,7 +543,7 @@ ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq
543 parallel_reset(s); 543 parallel_reset(s);
544 qemu_register_reset(parallel_reset, 0, s); 544 qemu_register_reset(parallel_reset, 0, s);
545 545
546 - io_sw = cpu_register_io_memory(0, parallel_mm_read_sw, parallel_mm_write_sw, s); 546 + io_sw = cpu_register_io_memory(parallel_mm_read_sw, parallel_mm_write_sw, s);
547 cpu_register_physical_memory(base, 8 << it_shift, io_sw); 547 cpu_register_physical_memory(base, 8 << it_shift, io_sw);
548 return s; 548 return s;
549 } 549 }
hw/pckbd.c
@@ -430,7 +430,7 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, @@ -430,7 +430,7 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
430 430
431 kbd_reset(s); 431 kbd_reset(s);
432 register_savevm("pckbd", 0, 3, kbd_save, kbd_load, s); 432 register_savevm("pckbd", 0, 3, kbd_save, kbd_load, s);
433 - s_io_memory = cpu_register_io_memory(0, kbd_mm_read, kbd_mm_write, s); 433 + s_io_memory = cpu_register_io_memory(kbd_mm_read, kbd_mm_write, s);
434 cpu_register_physical_memory(base, size, s_io_memory); 434 cpu_register_physical_memory(base, size, s_io_memory);
435 435
436 s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s); 436 s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
hw/pcnet.c
@@ -2048,7 +2048,7 @@ static void pci_pcnet_init(PCIDevice *pci_dev) @@ -2048,7 +2048,7 @@ static void pci_pcnet_init(PCIDevice *pci_dev)
2048 2048
2049 /* Handler for memory-mapped I/O */ 2049 /* Handler for memory-mapped I/O */
2050 s->mmio_index = 2050 s->mmio_index =
2051 - cpu_register_io_memory(0, pcnet_mmio_read, pcnet_mmio_write, &d->state); 2051 + cpu_register_io_memory(pcnet_mmio_read, pcnet_mmio_write, &d->state);
2052 2052
2053 pci_register_io_region((PCIDevice *)d, 0, PCNET_IOPORT_SIZE, 2053 pci_register_io_region((PCIDevice *)d, 0, PCNET_IOPORT_SIZE,
2054 PCI_ADDRESS_SPACE_IO, pcnet_ioport_map); 2054 PCI_ADDRESS_SPACE_IO, pcnet_ioport_map);
@@ -2126,7 +2126,7 @@ static void lance_init(SysBusDevice *dev) @@ -2126,7 +2126,7 @@ static void lance_init(SysBusDevice *dev)
2126 PCNetState *s = &d->state; 2126 PCNetState *s = &d->state;
2127 2127
2128 s->mmio_index = 2128 s->mmio_index =
2129 - cpu_register_io_memory(0, lance_mem_read, lance_mem_write, d); 2129 + cpu_register_io_memory(lance_mem_read, lance_mem_write, d);
2130 2130
2131 s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma"); 2131 s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma");
2132 2132
hw/pflash_cfi01.c
@@ -522,7 +522,7 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off, @@ -522,7 +522,7 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off,
522 522
523 /* FIXME: Allocate ram ourselves. */ 523 /* FIXME: Allocate ram ourselves. */
524 pfl->storage = qemu_get_ram_ptr(off); 524 pfl->storage = qemu_get_ram_ptr(off);
525 - pfl->fl_mem = cpu_register_io_memory(0, 525 + pfl->fl_mem = cpu_register_io_memory(
526 pflash_read_ops, pflash_write_ops, pfl); 526 pflash_read_ops, pflash_write_ops, pfl);
527 pfl->off = off; 527 pfl->off = off;
528 cpu_register_physical_memory(base, total_len, 528 cpu_register_physical_memory(base, total_len,
hw/pflash_cfi02.c
@@ -559,7 +559,7 @@ pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off, @@ -559,7 +559,7 @@ pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off,
559 pfl = qemu_mallocz(sizeof(pflash_t)); 559 pfl = qemu_mallocz(sizeof(pflash_t));
560 /* FIXME: Allocate ram ourselves. */ 560 /* FIXME: Allocate ram ourselves. */
561 pfl->storage = qemu_get_ram_ptr(off); 561 pfl->storage = qemu_get_ram_ptr(off);
562 - pfl->fl_mem = cpu_register_io_memory(0, pflash_read_ops, pflash_write_ops, 562 + pfl->fl_mem = cpu_register_io_memory(pflash_read_ops, pflash_write_ops,
563 pfl); 563 pfl);
564 pfl->off = off; 564 pfl->off = off;
565 pfl->base = base; 565 pfl->base = base;
hw/pl011.c
@@ -291,7 +291,7 @@ static void pl011_init(SysBusDevice *dev, const unsigned char *id) @@ -291,7 +291,7 @@ static void pl011_init(SysBusDevice *dev, const unsigned char *id)
291 int iomemtype; 291 int iomemtype;
292 pl011_state *s = FROM_SYSBUS(pl011_state, dev); 292 pl011_state *s = FROM_SYSBUS(pl011_state, dev);
293 293
294 - iomemtype = cpu_register_io_memory(0, pl011_readfn, 294 + iomemtype = cpu_register_io_memory(pl011_readfn,
295 pl011_writefn, s); 295 pl011_writefn, s);
296 sysbus_init_mmio(dev, 0x1000,iomemtype); 296 sysbus_init_mmio(dev, 0x1000,iomemtype);
297 sysbus_init_irq(dev, &s->irq); 297 sysbus_init_irq(dev, &s->irq);
hw/pl022.c
@@ -293,7 +293,7 @@ static void pl022_init(SysBusDevice *dev) @@ -293,7 +293,7 @@ static void pl022_init(SysBusDevice *dev)
293 pl022_state *s = FROM_SYSBUS(pl022_state, dev); 293 pl022_state *s = FROM_SYSBUS(pl022_state, dev);
294 int iomemtype; 294 int iomemtype;
295 295
296 - iomemtype = cpu_register_io_memory(0, pl022_readfn, 296 + iomemtype = cpu_register_io_memory(pl022_readfn,
297 pl022_writefn, s); 297 pl022_writefn, s);
298 sysbus_init_mmio(dev, 0x1000, iomemtype); 298 sysbus_init_mmio(dev, 0x1000, iomemtype);
299 sysbus_init_irq(dev, &s->irq); 299 sysbus_init_irq(dev, &s->irq);
hw/pl031.c
@@ -189,7 +189,7 @@ static void pl031_init(SysBusDevice *dev) @@ -189,7 +189,7 @@ static void pl031_init(SysBusDevice *dev)
189 pl031_state *s = FROM_SYSBUS(pl031_state, dev); 189 pl031_state *s = FROM_SYSBUS(pl031_state, dev);
190 struct tm tm; 190 struct tm tm;
191 191
192 - iomemtype = cpu_register_io_memory(0, pl031_readfn, pl031_writefn, s); 192 + iomemtype = cpu_register_io_memory(pl031_readfn, pl031_writefn, s);
193 if (iomemtype == -1) { 193 if (iomemtype == -1) {
194 hw_error("pl031_init: Can't register I/O memory\n"); 194 hw_error("pl031_init: Can't register I/O memory\n");
195 } 195 }
hw/pl050.c
@@ -127,7 +127,7 @@ static void pl050_init(SysBusDevice *dev, int is_mouse) @@ -127,7 +127,7 @@ static void pl050_init(SysBusDevice *dev, int is_mouse)
127 pl050_state *s = FROM_SYSBUS(pl050_state, dev); 127 pl050_state *s = FROM_SYSBUS(pl050_state, dev);
128 int iomemtype; 128 int iomemtype;
129 129
130 - iomemtype = cpu_register_io_memory(0, pl050_readfn, 130 + iomemtype = cpu_register_io_memory(pl050_readfn,
131 pl050_writefn, s); 131 pl050_writefn, s);
132 sysbus_init_mmio(dev, 0x1000, iomemtype); 132 sysbus_init_mmio(dev, 0x1000, iomemtype);
133 sysbus_init_irq(dev, &s->irq); 133 sysbus_init_irq(dev, &s->irq);
hw/pl061.c
@@ -296,7 +296,7 @@ static void pl061_init(SysBusDevice *dev) @@ -296,7 +296,7 @@ static void pl061_init(SysBusDevice *dev)
296 int iomemtype; 296 int iomemtype;
297 pl061_state *s = FROM_SYSBUS(pl061_state, dev); 297 pl061_state *s = FROM_SYSBUS(pl061_state, dev);
298 298
299 - iomemtype = cpu_register_io_memory(0, pl061_readfn, 299 + iomemtype = cpu_register_io_memory(pl061_readfn,
300 pl061_writefn, s); 300 pl061_writefn, s);
301 sysbus_init_mmio(dev, 0x1000, iomemtype); 301 sysbus_init_mmio(dev, 0x1000, iomemtype);
302 sysbus_init_irq(dev, &s->irq); 302 sysbus_init_irq(dev, &s->irq);
hw/pl080.c
@@ -324,7 +324,7 @@ static void pl08x_init(SysBusDevice *dev, int nchannels) @@ -324,7 +324,7 @@ static void pl08x_init(SysBusDevice *dev, int nchannels)
324 int iomemtype; 324 int iomemtype;
325 pl080_state *s = FROM_SYSBUS(pl080_state, dev); 325 pl080_state *s = FROM_SYSBUS(pl080_state, dev);
326 326
327 - iomemtype = cpu_register_io_memory(0, pl080_readfn, 327 + iomemtype = cpu_register_io_memory(pl080_readfn,
328 pl080_writefn, s); 328 pl080_writefn, s);
329 sysbus_init_mmio(dev, 0x1000, iomemtype); 329 sysbus_init_mmio(dev, 0x1000, iomemtype);
330 sysbus_init_irq(dev, &s->irq); 330 sysbus_init_irq(dev, &s->irq);
hw/pl110.c
@@ -354,7 +354,7 @@ static void pl110_init(SysBusDevice *dev) @@ -354,7 +354,7 @@ static void pl110_init(SysBusDevice *dev)
354 pl110_state *s = FROM_SYSBUS(pl110_state, dev); 354 pl110_state *s = FROM_SYSBUS(pl110_state, dev);
355 int iomemtype; 355 int iomemtype;
356 356
357 - iomemtype = cpu_register_io_memory(0, pl110_readfn, 357 + iomemtype = cpu_register_io_memory(pl110_readfn,
358 pl110_writefn, s); 358 pl110_writefn, s);
359 sysbus_init_mmio(dev, 0x1000, iomemtype); 359 sysbus_init_mmio(dev, 0x1000, iomemtype);
360 sysbus_init_irq(dev, &s->irq); 360 sysbus_init_irq(dev, &s->irq);
hw/pl181.c
@@ -451,7 +451,7 @@ static void pl181_init(SysBusDevice *dev) @@ -451,7 +451,7 @@ static void pl181_init(SysBusDevice *dev)
451 pl181_state *s = FROM_SYSBUS(pl181_state, dev); 451 pl181_state *s = FROM_SYSBUS(pl181_state, dev);
452 BlockDriverState *bd; 452 BlockDriverState *bd;
453 453
454 - iomemtype = cpu_register_io_memory(0, pl181_readfn, 454 + iomemtype = cpu_register_io_memory(pl181_readfn,
455 pl181_writefn, s); 455 pl181_writefn, s);
456 sysbus_init_mmio(dev, 0x1000, iomemtype); 456 sysbus_init_mmio(dev, 0x1000, iomemtype);
457 sysbus_init_irq(dev, &s->irq[0]); 457 sysbus_init_irq(dev, &s->irq[0]);
hw/pl190.c
@@ -232,7 +232,7 @@ static void pl190_init(SysBusDevice *dev) @@ -232,7 +232,7 @@ static void pl190_init(SysBusDevice *dev)
232 pl190_state *s = FROM_SYSBUS(pl190_state, dev); 232 pl190_state *s = FROM_SYSBUS(pl190_state, dev);
233 int iomemtype; 233 int iomemtype;
234 234
235 - iomemtype = cpu_register_io_memory(0, pl190_readfn, 235 + iomemtype = cpu_register_io_memory(pl190_readfn,
236 pl190_writefn, s); 236 pl190_writefn, s);
237 sysbus_init_mmio(dev, 0x1000, iomemtype); 237 sysbus_init_mmio(dev, 0x1000, iomemtype);
238 qdev_init_gpio_in(&dev->qdev, pl190_set_irq, 32); 238 qdev_init_gpio_in(&dev->qdev, pl190_set_irq, 32);
hw/ppc405_boards.c
@@ -161,7 +161,7 @@ static void ref405ep_fpga_init (uint32_t base) @@ -161,7 +161,7 @@ static void ref405ep_fpga_init (uint32_t base)
161 int fpga_memory; 161 int fpga_memory;
162 162
163 fpga = qemu_mallocz(sizeof(ref405ep_fpga_t)); 163 fpga = qemu_mallocz(sizeof(ref405ep_fpga_t));
164 - fpga_memory = cpu_register_io_memory(0, ref405ep_fpga_read, 164 + fpga_memory = cpu_register_io_memory(ref405ep_fpga_read,
165 ref405ep_fpga_write, fpga); 165 ref405ep_fpga_write, fpga);
166 cpu_register_physical_memory(base, 0x00000100, fpga_memory); 166 cpu_register_physical_memory(base, 0x00000100, fpga_memory);
167 ref405ep_fpga_reset(fpga); 167 ref405ep_fpga_reset(fpga);
@@ -485,7 +485,7 @@ static void taihu_cpld_init (uint32_t base) @@ -485,7 +485,7 @@ static void taihu_cpld_init (uint32_t base)
485 int cpld_memory; 485 int cpld_memory;
486 486
487 cpld = qemu_mallocz(sizeof(taihu_cpld_t)); 487 cpld = qemu_mallocz(sizeof(taihu_cpld_t));
488 - cpld_memory = cpu_register_io_memory(0, taihu_cpld_read, 488 + cpld_memory = cpu_register_io_memory(taihu_cpld_read,
489 taihu_cpld_write, cpld); 489 taihu_cpld_write, cpld);
490 cpu_register_physical_memory(base, 0x00000100, cpld_memory); 490 cpu_register_physical_memory(base, 0x00000100, cpld_memory);
491 taihu_cpld_reset(cpld); 491 taihu_cpld_reset(cpld);
hw/ppc4xx_devs.c
@@ -247,7 +247,7 @@ ppc4xx_mmio_t *ppc4xx_mmio_init (CPUState *env, target_phys_addr_t base) @@ -247,7 +247,7 @@ ppc4xx_mmio_t *ppc4xx_mmio_init (CPUState *env, target_phys_addr_t base)
247 247
248 mmio = qemu_mallocz(sizeof(ppc4xx_mmio_t)); 248 mmio = qemu_mallocz(sizeof(ppc4xx_mmio_t));
249 mmio->base = base; 249 mmio->base = base;
250 - mmio_memory = cpu_register_io_memory(0, mmio_read, mmio_write, mmio); 250 + mmio_memory = cpu_register_io_memory(mmio_read, mmio_write, mmio);
251 #if defined(DEBUG_MMIO) 251 #if defined(DEBUG_MMIO)
252 printf("%s: base " PADDRX " len %08x %d\n", __func__, 252 printf("%s: base " PADDRX " len %08x %d\n", __func__,
253 base, TARGET_PAGE_SIZE, mmio_memory); 253 base, TARGET_PAGE_SIZE, mmio_memory);
hw/ppc4xx_pci.c
@@ -384,14 +384,14 @@ PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4], @@ -384,14 +384,14 @@ PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4],
384 pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_OTHER); 384 pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_OTHER);
385 385
386 /* CFGADDR */ 386 /* CFGADDR */
387 - index = cpu_register_io_memory(0, pci4xx_cfgaddr_read, 387 + index = cpu_register_io_memory(pci4xx_cfgaddr_read,
388 pci4xx_cfgaddr_write, controller); 388 pci4xx_cfgaddr_write, controller);
389 if (index < 0) 389 if (index < 0)
390 goto free; 390 goto free;
391 cpu_register_physical_memory(config_space + PCIC0_CFGADDR, 4, index); 391 cpu_register_physical_memory(config_space + PCIC0_CFGADDR, 4, index);
392 392
393 /* CFGDATA */ 393 /* CFGDATA */
394 - index = cpu_register_io_memory(0, pci4xx_cfgdata_read, 394 + index = cpu_register_io_memory(pci4xx_cfgdata_read,
395 pci4xx_cfgdata_write, 395 pci4xx_cfgdata_write,
396 &controller->pci_state); 396 &controller->pci_state);
397 if (index < 0) 397 if (index < 0)
@@ -399,7 +399,7 @@ PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4], @@ -399,7 +399,7 @@ PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4],
399 cpu_register_physical_memory(config_space + PCIC0_CFGDATA, 4, index); 399 cpu_register_physical_memory(config_space + PCIC0_CFGDATA, 4, index);
400 400
401 /* Internal registers */ 401 /* Internal registers */
402 - index = cpu_register_io_memory(0, pci_reg_read, pci_reg_write, controller); 402 + index = cpu_register_io_memory(pci_reg_read, pci_reg_write, controller);
403 if (index < 0) 403 if (index < 0)
404 goto free; 404 goto free;
405 cpu_register_physical_memory(registers, PCI_REG_SIZE, index); 405 cpu_register_physical_memory(registers, PCI_REG_SIZE, index);
hw/ppc_newworld.c
@@ -246,7 +246,7 @@ static void ppc_core99_init (ram_addr_t ram_size, @@ -246,7 +246,7 @@ static void ppc_core99_init (ram_addr_t ram_size,
246 isa_mmio_init(0xf2000000, 0x00800000); 246 isa_mmio_init(0xf2000000, 0x00800000);
247 247
248 /* UniN init */ 248 /* UniN init */
249 - unin_memory = cpu_register_io_memory(0, unin_read, unin_write, NULL); 249 + unin_memory = cpu_register_io_memory(unin_read, unin_write, NULL);
250 cpu_register_physical_memory(0xf8000000, 0x00001000, unin_memory); 250 cpu_register_physical_memory(0xf8000000, 0x00001000, unin_memory);
251 251
252 openpic_irqs = qemu_mallocz(smp_cpus * sizeof(qemu_irq *)); 252 openpic_irqs = qemu_mallocz(smp_cpus * sizeof(qemu_irq *));
hw/ppc_prep.c
@@ -659,7 +659,7 @@ static void ppc_prep_init (ram_addr_t ram_size, @@ -659,7 +659,7 @@ static void ppc_prep_init (ram_addr_t ram_size,
659 pci_bus = pci_prep_init(i8259); 659 pci_bus = pci_prep_init(i8259);
660 // pci_bus = i440fx_init(); 660 // pci_bus = i440fx_init();
661 /* Register 8 MB of ISA IO space (needed for non-contiguous map) */ 661 /* Register 8 MB of ISA IO space (needed for non-contiguous map) */
662 - PPC_io_memory = cpu_register_io_memory(0, PPC_prep_io_read, 662 + PPC_io_memory = cpu_register_io_memory(PPC_prep_io_read,
663 PPC_prep_io_write, sysctrl); 663 PPC_prep_io_write, sysctrl);
664 cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory); 664 cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
665 665
@@ -728,12 +728,12 @@ static void ppc_prep_init (ram_addr_t ram_size, @@ -728,12 +728,12 @@ static void ppc_prep_init (ram_addr_t ram_size,
728 register_ioport_read(0x0800, 0x52, 1, &PREP_io_800_readb, sysctrl); 728 register_ioport_read(0x0800, 0x52, 1, &PREP_io_800_readb, sysctrl);
729 register_ioport_write(0x0800, 0x52, 1, &PREP_io_800_writeb, sysctrl); 729 register_ioport_write(0x0800, 0x52, 1, &PREP_io_800_writeb, sysctrl);
730 /* PCI intack location */ 730 /* PCI intack location */
731 - PPC_io_memory = cpu_register_io_memory(0, PPC_intack_read, 731 + PPC_io_memory = cpu_register_io_memory(PPC_intack_read,
732 PPC_intack_write, NULL); 732 PPC_intack_write, NULL);
733 cpu_register_physical_memory(0xBFFFFFF0, 0x4, PPC_io_memory); 733 cpu_register_physical_memory(0xBFFFFFF0, 0x4, PPC_io_memory);
734 /* PowerPC control and status register group */ 734 /* PowerPC control and status register group */
735 #if 0 735 #if 0
736 - PPC_io_memory = cpu_register_io_memory(0, PPC_XCSR_read, PPC_XCSR_write, 736 + PPC_io_memory = cpu_register_io_memory(PPC_XCSR_read, PPC_XCSR_write,
737 NULL); 737 NULL);
738 cpu_register_physical_memory(0xFEFF0000, 0x1000, PPC_io_memory); 738 cpu_register_physical_memory(0xFEFF0000, 0x1000, PPC_io_memory);
739 #endif 739 #endif
hw/ppce500_pci.c
@@ -332,21 +332,21 @@ PCIBus *ppce500_pci_init(qemu_irq pci_irqs[4], target_phys_addr_t registers) @@ -332,21 +332,21 @@ PCIBus *ppce500_pci_init(qemu_irq pci_irqs[4], target_phys_addr_t registers)
332 controller->pci_dev = d; 332 controller->pci_dev = d;
333 333
334 /* CFGADDR */ 334 /* CFGADDR */
335 - index = cpu_register_io_memory(0, pcie500_cfgaddr_read, 335 + index = cpu_register_io_memory(pcie500_cfgaddr_read,
336 pcie500_cfgaddr_write, controller); 336 pcie500_cfgaddr_write, controller);
337 if (index < 0) 337 if (index < 0)
338 goto free; 338 goto free;
339 cpu_register_physical_memory(registers + PCIE500_CFGADDR, 4, index); 339 cpu_register_physical_memory(registers + PCIE500_CFGADDR, 4, index);
340 340
341 /* CFGDATA */ 341 /* CFGDATA */
342 - index = cpu_register_io_memory(0, pcie500_cfgdata_read, 342 + index = cpu_register_io_memory(pcie500_cfgdata_read,
343 pcie500_cfgdata_write, 343 pcie500_cfgdata_write,
344 &controller->pci_state); 344 &controller->pci_state);
345 if (index < 0) 345 if (index < 0)
346 goto free; 346 goto free;
347 cpu_register_physical_memory(registers + PCIE500_CFGDATA, 4, index); 347 cpu_register_physical_memory(registers + PCIE500_CFGDATA, 4, index);
348 348
349 - index = cpu_register_io_memory(0, e500_pci_reg_read, 349 + index = cpu_register_io_memory(e500_pci_reg_read,
350 e500_pci_reg_write, controller); 350 e500_pci_reg_write, controller);
351 if (index < 0) 351 if (index < 0)
352 goto free; 352 goto free;
hw/prep_pci.c
@@ -149,7 +149,7 @@ PCIBus *pci_prep_init(qemu_irq *pic) @@ -149,7 +149,7 @@ PCIBus *pci_prep_init(qemu_irq *pic)
149 register_ioport_read(0xcfc, 4, 2, pci_host_data_readw, s); 149 register_ioport_read(0xcfc, 4, 2, pci_host_data_readw, s);
150 register_ioport_read(0xcfc, 4, 4, pci_host_data_readl, s); 150 register_ioport_read(0xcfc, 4, 4, pci_host_data_readl, s);
151 151
152 - PPC_io_memory = cpu_register_io_memory(0, PPC_PCIIO_read, 152 + PPC_io_memory = cpu_register_io_memory(PPC_PCIIO_read,
153 PPC_PCIIO_write, s); 153 PPC_PCIIO_write, s);
154 cpu_register_physical_memory(0x80800000, 0x00400000, PPC_io_memory); 154 cpu_register_physical_memory(0x80800000, 0x00400000, PPC_io_memory);
155 155
hw/pxa2xx.c
@@ -857,7 +857,7 @@ static void pxa2xx_ssp_init(SysBusDevice *dev) @@ -857,7 +857,7 @@ static void pxa2xx_ssp_init(SysBusDevice *dev)
857 857
858 sysbus_init_irq(dev, &s->irq); 858 sysbus_init_irq(dev, &s->irq);
859 859
860 - iomemtype = cpu_register_io_memory(0, pxa2xx_ssp_readfn, 860 + iomemtype = cpu_register_io_memory(pxa2xx_ssp_readfn,
861 pxa2xx_ssp_writefn, s); 861 pxa2xx_ssp_writefn, s);
862 sysbus_init_mmio(dev, 0x1000, iomemtype); 862 sysbus_init_mmio(dev, 0x1000, iomemtype);
863 register_savevm("pxa2xx_ssp", -1, 0, 863 register_savevm("pxa2xx_ssp", -1, 0,
@@ -1509,7 +1509,7 @@ PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base, @@ -1509,7 +1509,7 @@ PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base,
1509 s->bus = i2c_init_bus(NULL, "i2c"); 1509 s->bus = i2c_init_bus(NULL, "i2c");
1510 s->offset = base - (base & (~region_size) & TARGET_PAGE_MASK); 1510 s->offset = base - (base & (~region_size) & TARGET_PAGE_MASK);
1511 1511
1512 - iomemtype = cpu_register_io_memory(0, pxa2xx_i2c_readfn, 1512 + iomemtype = cpu_register_io_memory(pxa2xx_i2c_readfn,
1513 pxa2xx_i2c_writefn, s); 1513 pxa2xx_i2c_writefn, s);
1514 cpu_register_physical_memory(base & ~region_size, 1514 cpu_register_physical_memory(base & ~region_size,
1515 region_size + 1, iomemtype); 1515 region_size + 1, iomemtype);
@@ -1747,7 +1747,7 @@ static PXA2xxI2SState *pxa2xx_i2s_init(target_phys_addr_t base, @@ -1747,7 +1747,7 @@ static PXA2xxI2SState *pxa2xx_i2s_init(target_phys_addr_t base,
1747 1747
1748 pxa2xx_i2s_reset(s); 1748 pxa2xx_i2s_reset(s);
1749 1749
1750 - iomemtype = cpu_register_io_memory(0, pxa2xx_i2s_readfn, 1750 + iomemtype = cpu_register_io_memory(pxa2xx_i2s_readfn,
1751 pxa2xx_i2s_writefn, s); 1751 pxa2xx_i2s_writefn, s);
1752 cpu_register_physical_memory(base, 0x100000, iomemtype); 1752 cpu_register_physical_memory(base, 0x100000, iomemtype);
1753 1753
@@ -2006,7 +2006,7 @@ static PXA2xxFIrState *pxa2xx_fir_init(target_phys_addr_t base, @@ -2006,7 +2006,7 @@ static PXA2xxFIrState *pxa2xx_fir_init(target_phys_addr_t base,
2006 2006
2007 pxa2xx_fir_reset(s); 2007 pxa2xx_fir_reset(s);
2008 2008
2009 - iomemtype = cpu_register_io_memory(0, pxa2xx_fir_readfn, 2009 + iomemtype = cpu_register_io_memory(pxa2xx_fir_readfn,
2010 pxa2xx_fir_writefn, s); 2010 pxa2xx_fir_writefn, s);
2011 cpu_register_physical_memory(base, 0x1000, iomemtype); 2011 cpu_register_physical_memory(base, 0x1000, iomemtype);
2012 2012
@@ -2090,7 +2090,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) @@ -2090,7 +2090,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision)
2090 s->cm_base = 0x41300000; 2090 s->cm_base = 0x41300000;
2091 s->cm_regs[CCCR >> 2] = 0x02000210; /* 416.0 MHz */ 2091 s->cm_regs[CCCR >> 2] = 0x02000210; /* 416.0 MHz */
2092 s->clkcfg = 0x00000009; /* Turbo mode active */ 2092 s->clkcfg = 0x00000009; /* Turbo mode active */
2093 - iomemtype = cpu_register_io_memory(0, pxa2xx_cm_readfn, 2093 + iomemtype = cpu_register_io_memory(pxa2xx_cm_readfn,
2094 pxa2xx_cm_writefn, s); 2094 pxa2xx_cm_writefn, s);
2095 cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype); 2095 cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype);
2096 register_savevm("pxa2xx_cm", 0, 0, pxa2xx_cm_save, pxa2xx_cm_load, s); 2096 register_savevm("pxa2xx_cm", 0, 0, pxa2xx_cm_save, pxa2xx_cm_load, s);
@@ -2101,13 +2101,13 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) @@ -2101,13 +2101,13 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision)
2101 s->mm_regs[MDMRS >> 2] = 0x00020002; 2101 s->mm_regs[MDMRS >> 2] = 0x00020002;
2102 s->mm_regs[MDREFR >> 2] = 0x03ca4000; 2102 s->mm_regs[MDREFR >> 2] = 0x03ca4000;
2103 s->mm_regs[MECR >> 2] = 0x00000001; /* Two PC Card sockets */ 2103 s->mm_regs[MECR >> 2] = 0x00000001; /* Two PC Card sockets */
2104 - iomemtype = cpu_register_io_memory(0, pxa2xx_mm_readfn, 2104 + iomemtype = cpu_register_io_memory(pxa2xx_mm_readfn,
2105 pxa2xx_mm_writefn, s); 2105 pxa2xx_mm_writefn, s);
2106 cpu_register_physical_memory(s->mm_base, 0x1000, iomemtype); 2106 cpu_register_physical_memory(s->mm_base, 0x1000, iomemtype);
2107 register_savevm("pxa2xx_mm", 0, 0, pxa2xx_mm_save, pxa2xx_mm_load, s); 2107 register_savevm("pxa2xx_mm", 0, 0, pxa2xx_mm_save, pxa2xx_mm_load, s);
2108 2108
2109 s->pm_base = 0x40f00000; 2109 s->pm_base = 0x40f00000;
2110 - iomemtype = cpu_register_io_memory(0, pxa2xx_pm_readfn, 2110 + iomemtype = cpu_register_io_memory(pxa2xx_pm_readfn,
2111 pxa2xx_pm_writefn, s); 2111 pxa2xx_pm_writefn, s);
2112 cpu_register_physical_memory(s->pm_base, 0x100, iomemtype); 2112 cpu_register_physical_memory(s->pm_base, 0x100, iomemtype);
2113 register_savevm("pxa2xx_pm", 0, 0, pxa2xx_pm_save, pxa2xx_pm_load, s); 2113 register_savevm("pxa2xx_pm", 0, 0, pxa2xx_pm_save, pxa2xx_pm_load, s);
@@ -2129,7 +2129,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) @@ -2129,7 +2129,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision)
2129 s->pcmcia[1] = pxa2xx_pcmcia_init(0x30000000); 2129 s->pcmcia[1] = pxa2xx_pcmcia_init(0x30000000);
2130 2130
2131 s->rtc_base = 0x40900000; 2131 s->rtc_base = 0x40900000;
2132 - iomemtype = cpu_register_io_memory(0, pxa2xx_rtc_readfn, 2132 + iomemtype = cpu_register_io_memory(pxa2xx_rtc_readfn,
2133 pxa2xx_rtc_writefn, s); 2133 pxa2xx_rtc_writefn, s);
2134 cpu_register_physical_memory(s->rtc_base, 0x1000, iomemtype); 2134 cpu_register_physical_memory(s->rtc_base, 0x1000, iomemtype);
2135 pxa2xx_rtc_init(s); 2135 pxa2xx_rtc_init(s);
@@ -2202,7 +2202,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) @@ -2202,7 +2202,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size)
2202 s->cm_base = 0x41300000; 2202 s->cm_base = 0x41300000;
2203 s->cm_regs[CCCR >> 2] = 0x02000210; /* 416.0 MHz */ 2203 s->cm_regs[CCCR >> 2] = 0x02000210; /* 416.0 MHz */
2204 s->clkcfg = 0x00000009; /* Turbo mode active */ 2204 s->clkcfg = 0x00000009; /* Turbo mode active */
2205 - iomemtype = cpu_register_io_memory(0, pxa2xx_cm_readfn, 2205 + iomemtype = cpu_register_io_memory(pxa2xx_cm_readfn,
2206 pxa2xx_cm_writefn, s); 2206 pxa2xx_cm_writefn, s);
2207 cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype); 2207 cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype);
2208 register_savevm("pxa2xx_cm", 0, 0, pxa2xx_cm_save, pxa2xx_cm_load, s); 2208 register_savevm("pxa2xx_cm", 0, 0, pxa2xx_cm_save, pxa2xx_cm_load, s);
@@ -2213,13 +2213,13 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) @@ -2213,13 +2213,13 @@ PXA2xxState *pxa255_init(unsigned int sdram_size)
2213 s->mm_regs[MDMRS >> 2] = 0x00020002; 2213 s->mm_regs[MDMRS >> 2] = 0x00020002;
2214 s->mm_regs[MDREFR >> 2] = 0x03ca4000; 2214 s->mm_regs[MDREFR >> 2] = 0x03ca4000;
2215 s->mm_regs[MECR >> 2] = 0x00000001; /* Two PC Card sockets */ 2215 s->mm_regs[MECR >> 2] = 0x00000001; /* Two PC Card sockets */
2216 - iomemtype = cpu_register_io_memory(0, pxa2xx_mm_readfn, 2216 + iomemtype = cpu_register_io_memory(pxa2xx_mm_readfn,
2217 pxa2xx_mm_writefn, s); 2217 pxa2xx_mm_writefn, s);
2218 cpu_register_physical_memory(s->mm_base, 0x1000, iomemtype); 2218 cpu_register_physical_memory(s->mm_base, 0x1000, iomemtype);
2219 register_savevm("pxa2xx_mm", 0, 0, pxa2xx_mm_save, pxa2xx_mm_load, s); 2219 register_savevm("pxa2xx_mm", 0, 0, pxa2xx_mm_save, pxa2xx_mm_load, s);
2220 2220
2221 s->pm_base = 0x40f00000; 2221 s->pm_base = 0x40f00000;
2222 - iomemtype = cpu_register_io_memory(0, pxa2xx_pm_readfn, 2222 + iomemtype = cpu_register_io_memory(pxa2xx_pm_readfn,
2223 pxa2xx_pm_writefn, s); 2223 pxa2xx_pm_writefn, s);
2224 cpu_register_physical_memory(s->pm_base, 0x100, iomemtype); 2224 cpu_register_physical_memory(s->pm_base, 0x100, iomemtype);
2225 register_savevm("pxa2xx_pm", 0, 0, pxa2xx_pm_save, pxa2xx_pm_load, s); 2225 register_savevm("pxa2xx_pm", 0, 0, pxa2xx_pm_save, pxa2xx_pm_load, s);
@@ -2241,7 +2241,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) @@ -2241,7 +2241,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size)
2241 s->pcmcia[1] = pxa2xx_pcmcia_init(0x30000000); 2241 s->pcmcia[1] = pxa2xx_pcmcia_init(0x30000000);
2242 2242
2243 s->rtc_base = 0x40900000; 2243 s->rtc_base = 0x40900000;
2244 - iomemtype = cpu_register_io_memory(0, pxa2xx_rtc_readfn, 2244 + iomemtype = cpu_register_io_memory(pxa2xx_rtc_readfn,
2245 pxa2xx_rtc_writefn, s); 2245 pxa2xx_rtc_writefn, s);
2246 cpu_register_physical_memory(s->rtc_base, 0x1000, iomemtype); 2246 cpu_register_physical_memory(s->rtc_base, 0x1000, iomemtype);
2247 pxa2xx_rtc_init(s); 2247 pxa2xx_rtc_init(s);
hw/pxa2xx_dma.c
@@ -503,7 +503,7 @@ static PXA2xxDMAState *pxa2xx_dma_init(target_phys_addr_t base, @@ -503,7 +503,7 @@ static PXA2xxDMAState *pxa2xx_dma_init(target_phys_addr_t base,
503 503
504 memset(s->req, 0, sizeof(uint8_t) * PXA2XX_DMA_NUM_REQUESTS); 504 memset(s->req, 0, sizeof(uint8_t) * PXA2XX_DMA_NUM_REQUESTS);
505 505
506 - iomemtype = cpu_register_io_memory(0, pxa2xx_dma_readfn, 506 + iomemtype = cpu_register_io_memory(pxa2xx_dma_readfn,
507 pxa2xx_dma_writefn, s); 507 pxa2xx_dma_writefn, s);
508 cpu_register_physical_memory(base, 0x00010000, iomemtype); 508 cpu_register_physical_memory(base, 0x00010000, iomemtype);
509 509
hw/pxa2xx_gpio.c
@@ -308,7 +308,7 @@ PXA2xxGPIOInfo *pxa2xx_gpio_init(target_phys_addr_t base, @@ -308,7 +308,7 @@ PXA2xxGPIOInfo *pxa2xx_gpio_init(target_phys_addr_t base,
308 s->cpu_env = env; 308 s->cpu_env = env;
309 s->in = qemu_allocate_irqs(pxa2xx_gpio_set, s, lines); 309 s->in = qemu_allocate_irqs(pxa2xx_gpio_set, s, lines);
310 310
311 - iomemtype = cpu_register_io_memory(0, pxa2xx_gpio_readfn, 311 + iomemtype = cpu_register_io_memory(pxa2xx_gpio_readfn,
312 pxa2xx_gpio_writefn, s); 312 pxa2xx_gpio_writefn, s);
313 cpu_register_physical_memory(base, 0x00001000, iomemtype); 313 cpu_register_physical_memory(base, 0x00001000, iomemtype);
314 314
hw/pxa2xx_keypad.c
@@ -313,7 +313,7 @@ PXA2xxKeyPadState *pxa27x_keypad_init(target_phys_addr_t base, @@ -313,7 +313,7 @@ PXA2xxKeyPadState *pxa27x_keypad_init(target_phys_addr_t base,
313 s = (PXA2xxKeyPadState *) qemu_mallocz(sizeof(PXA2xxKeyPadState)); 313 s = (PXA2xxKeyPadState *) qemu_mallocz(sizeof(PXA2xxKeyPadState));
314 s->irq = irq; 314 s->irq = irq;
315 315
316 - iomemtype = cpu_register_io_memory(0, pxa2xx_keypad_readfn, 316 + iomemtype = cpu_register_io_memory(pxa2xx_keypad_readfn,
317 pxa2xx_keypad_writefn, s); 317 pxa2xx_keypad_writefn, s);
318 cpu_register_physical_memory(base, 0x00100000, iomemtype); 318 cpu_register_physical_memory(base, 0x00100000, iomemtype);
319 319
hw/pxa2xx_lcd.c
@@ -928,7 +928,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq) @@ -928,7 +928,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq)
928 928
929 pxa2xx_lcdc_orientation(s, graphic_rotate); 929 pxa2xx_lcdc_orientation(s, graphic_rotate);
930 930
931 - iomemtype = cpu_register_io_memory(0, pxa2xx_lcdc_readfn, 931 + iomemtype = cpu_register_io_memory(pxa2xx_lcdc_readfn,
932 pxa2xx_lcdc_writefn, s); 932 pxa2xx_lcdc_writefn, s);
933 cpu_register_physical_memory(base, 0x00100000, iomemtype); 933 cpu_register_physical_memory(base, 0x00100000, iomemtype);
934 934
hw/pxa2xx_mmci.c
@@ -527,7 +527,7 @@ PXA2xxMMCIState *pxa2xx_mmci_init(target_phys_addr_t base, @@ -527,7 +527,7 @@ PXA2xxMMCIState *pxa2xx_mmci_init(target_phys_addr_t base,
527 s->irq = irq; 527 s->irq = irq;
528 s->dma = dma; 528 s->dma = dma;
529 529
530 - iomemtype = cpu_register_io_memory(0, pxa2xx_mmci_readfn, 530 + iomemtype = cpu_register_io_memory(pxa2xx_mmci_readfn,
531 pxa2xx_mmci_writefn, s); 531 pxa2xx_mmci_writefn, s);
532 cpu_register_physical_memory(base, 0x00100000, iomemtype); 532 cpu_register_physical_memory(base, 0x00100000, iomemtype);
533 533
hw/pxa2xx_pcmcia.c
@@ -139,19 +139,19 @@ PXA2xxPCMCIAState *pxa2xx_pcmcia_init(target_phys_addr_t base) @@ -139,19 +139,19 @@ PXA2xxPCMCIAState *pxa2xx_pcmcia_init(target_phys_addr_t base)
139 qemu_mallocz(sizeof(PXA2xxPCMCIAState)); 139 qemu_mallocz(sizeof(PXA2xxPCMCIAState));
140 140
141 /* Socket I/O Memory Space */ 141 /* Socket I/O Memory Space */
142 - iomemtype = cpu_register_io_memory(0, pxa2xx_pcmcia_io_readfn, 142 + iomemtype = cpu_register_io_memory(pxa2xx_pcmcia_io_readfn,
143 pxa2xx_pcmcia_io_writefn, s); 143 pxa2xx_pcmcia_io_writefn, s);
144 cpu_register_physical_memory(base | 0x00000000, 0x04000000, iomemtype); 144 cpu_register_physical_memory(base | 0x00000000, 0x04000000, iomemtype);
145 145
146 /* Then next 64 MB is reserved */ 146 /* Then next 64 MB is reserved */
147 147
148 /* Socket Attribute Memory Space */ 148 /* Socket Attribute Memory Space */
149 - iomemtype = cpu_register_io_memory(0, pxa2xx_pcmcia_attr_readfn, 149 + iomemtype = cpu_register_io_memory(pxa2xx_pcmcia_attr_readfn,
150 pxa2xx_pcmcia_attr_writefn, s); 150 pxa2xx_pcmcia_attr_writefn, s);
151 cpu_register_physical_memory(base | 0x08000000, 0x04000000, iomemtype); 151 cpu_register_physical_memory(base | 0x08000000, 0x04000000, iomemtype);
152 152
153 /* Socket Common Memory Space */ 153 /* Socket Common Memory Space */
154 - iomemtype = cpu_register_io_memory(0, pxa2xx_pcmcia_common_readfn, 154 + iomemtype = cpu_register_io_memory(pxa2xx_pcmcia_common_readfn,
155 pxa2xx_pcmcia_common_writefn, s); 155 pxa2xx_pcmcia_common_writefn, s);
156 cpu_register_physical_memory(base | 0x0c000000, 0x04000000, iomemtype); 156 cpu_register_physical_memory(base | 0x0c000000, 0x04000000, iomemtype);
157 157
hw/pxa2xx_pic.c
@@ -299,7 +299,7 @@ qemu_irq *pxa2xx_pic_init(target_phys_addr_t base, CPUState *env) @@ -299,7 +299,7 @@ qemu_irq *pxa2xx_pic_init(target_phys_addr_t base, CPUState *env)
299 qi = qemu_allocate_irqs(pxa2xx_pic_set_irq, s, PXA2XX_PIC_SRCS); 299 qi = qemu_allocate_irqs(pxa2xx_pic_set_irq, s, PXA2XX_PIC_SRCS);
300 300
301 /* Enable IC memory-mapped registers access. */ 301 /* Enable IC memory-mapped registers access. */
302 - iomemtype = cpu_register_io_memory(0, pxa2xx_pic_readfn, 302 + iomemtype = cpu_register_io_memory(pxa2xx_pic_readfn,
303 pxa2xx_pic_writefn, s); 303 pxa2xx_pic_writefn, s);
304 cpu_register_physical_memory(base, 0x00100000, iomemtype); 304 cpu_register_physical_memory(base, 0x00100000, iomemtype);
305 305
hw/pxa2xx_timer.c
@@ -451,7 +451,7 @@ static pxa2xx_timer_info *pxa2xx_timer_init(target_phys_addr_t base, @@ -451,7 +451,7 @@ static pxa2xx_timer_info *pxa2xx_timer_init(target_phys_addr_t base,
451 pxa2xx_timer_tick, &s->timer[i]); 451 pxa2xx_timer_tick, &s->timer[i]);
452 } 452 }
453 453
454 - iomemtype = cpu_register_io_memory(0, pxa2xx_timer_readfn, 454 + iomemtype = cpu_register_io_memory(pxa2xx_timer_readfn,
455 pxa2xx_timer_writefn, s); 455 pxa2xx_timer_writefn, s);
456 cpu_register_physical_memory(base, 0x00001000, iomemtype); 456 cpu_register_physical_memory(base, 0x00001000, iomemtype);
457 457
hw/r2d.c
@@ -176,7 +176,7 @@ static qemu_irq *r2d_fpga_init(target_phys_addr_t base, qemu_irq irl) @@ -176,7 +176,7 @@ static qemu_irq *r2d_fpga_init(target_phys_addr_t base, qemu_irq irl)
176 176
177 s->irl = irl; 177 s->irl = irl;
178 178
179 - iomemtype = cpu_register_io_memory(0, r2d_fpga_readfn, 179 + iomemtype = cpu_register_io_memory(r2d_fpga_readfn,
180 r2d_fpga_writefn, s); 180 r2d_fpga_writefn, s);
181 cpu_register_physical_memory(base, 0x40, iomemtype); 181 cpu_register_physical_memory(base, 0x40, iomemtype);
182 return qemu_allocate_irqs(r2d_fpga_irq_set, s, NR_IRQS); 182 return qemu_allocate_irqs(r2d_fpga_irq_set, s, NR_IRQS);
hw/rc4030.c
@@ -814,9 +814,9 @@ void *rc4030_init(qemu_irq timer, qemu_irq jazz_bus, @@ -814,9 +814,9 @@ void *rc4030_init(qemu_irq timer, qemu_irq jazz_bus,
814 register_savevm("rc4030", 0, 2, rc4030_save, rc4030_load, s); 814 register_savevm("rc4030", 0, 2, rc4030_save, rc4030_load, s);
815 rc4030_reset(s); 815 rc4030_reset(s);
816 816
817 - s_chipset = cpu_register_io_memory(0, rc4030_read, rc4030_write, s); 817 + s_chipset = cpu_register_io_memory(rc4030_read, rc4030_write, s);
818 cpu_register_physical_memory(0x80000000, 0x300, s_chipset); 818 cpu_register_physical_memory(0x80000000, 0x300, s_chipset);
819 - s_jazzio = cpu_register_io_memory(0, jazzio_read, jazzio_write, s); 819 + s_jazzio = cpu_register_io_memory(jazzio_read, jazzio_write, s);
820 cpu_register_physical_memory(0xf0000000, 0x00001000, s_jazzio); 820 cpu_register_physical_memory(0xf0000000, 0x00001000, s_jazzio);
821 821
822 return s; 822 return s;
hw/realview_gic.c
@@ -63,7 +63,7 @@ static void realview_gic_init(SysBusDevice *dev) @@ -63,7 +63,7 @@ static void realview_gic_init(SysBusDevice *dev)
63 RealViewGICState *s = FROM_SYSBUSGIC(RealViewGICState, dev); 63 RealViewGICState *s = FROM_SYSBUSGIC(RealViewGICState, dev);
64 64
65 gic_init(&s->gic); 65 gic_init(&s->gic);
66 - s->iomemtype = cpu_register_io_memory(0, realview_gic_cpu_readfn, 66 + s->iomemtype = cpu_register_io_memory(realview_gic_cpu_readfn,
67 realview_gic_cpu_writefn, s); 67 realview_gic_cpu_writefn, s);
68 sysbus_init_mmio_cb(dev, 0x2000, realview_gic_map); 68 sysbus_init_mmio_cb(dev, 0x2000, realview_gic_map);
69 } 69 }
hw/rtl8139.c
@@ -3469,7 +3469,7 @@ static void pci_rtl8139_init(PCIDevice *dev) @@ -3469,7 +3469,7 @@ static void pci_rtl8139_init(PCIDevice *dev)
3469 3469
3470 /* I/O handler for memory-mapped I/O */ 3470 /* I/O handler for memory-mapped I/O */
3471 s->rtl8139_mmio_io_addr = 3471 s->rtl8139_mmio_io_addr =
3472 - cpu_register_io_memory(0, rtl8139_mmio_read, rtl8139_mmio_write, s); 3472 + cpu_register_io_memory(rtl8139_mmio_read, rtl8139_mmio_write, s);
3473 3473
3474 pci_register_io_region(&d->dev, 0, 0x100, 3474 pci_register_io_region(&d->dev, 0, 0x100,
3475 PCI_ADDRESS_SPACE_IO, rtl8139_ioport_map); 3475 PCI_ADDRESS_SPACE_IO, rtl8139_ioport_map);
hw/sbi.c
@@ -151,7 +151,7 @@ void *sbi_init(target_phys_addr_t addr, qemu_irq **irq, qemu_irq **cpu_irq, @@ -151,7 +151,7 @@ void *sbi_init(target_phys_addr_t addr, qemu_irq **irq, qemu_irq **cpu_irq,
151 s->cpu_irqs[i] = parent_irq[i]; 151 s->cpu_irqs[i] = parent_irq[i];
152 } 152 }
153 153
154 - sbi_io_memory = cpu_register_io_memory(0, sbi_mem_read, sbi_mem_write, s); 154 + sbi_io_memory = cpu_register_io_memory(sbi_mem_read, sbi_mem_write, s);
155 cpu_register_physical_memory(addr, SBI_SIZE, sbi_io_memory); 155 cpu_register_physical_memory(addr, SBI_SIZE, sbi_io_memory);
156 156
157 register_savevm("sbi", addr, 1, sbi_save, sbi_load, s); 157 register_savevm("sbi", addr, 1, sbi_save, sbi_load, s);
hw/serial.c
@@ -831,7 +831,7 @@ SerialState *serial_mm_init (target_phys_addr_t base, int it_shift, @@ -831,7 +831,7 @@ SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
831 register_savevm("serial", base, 3, serial_save, serial_load, s); 831 register_savevm("serial", base, 3, serial_save, serial_load, s);
832 832
833 if (ioregister) { 833 if (ioregister) {
834 - s_io_memory = cpu_register_io_memory(0, serial_mm_read, 834 + s_io_memory = cpu_register_io_memory(serial_mm_read,
835 serial_mm_write, s); 835 serial_mm_write, s);
836 cpu_register_physical_memory(base, 8 << it_shift, s_io_memory); 836 cpu_register_physical_memory(base, 8 << it_shift, s_io_memory);
837 } 837 }
hw/sh7750.c
@@ -709,8 +709,7 @@ SH7750State *sh7750_init(CPUSH4State * cpu) @@ -709,8 +709,7 @@ SH7750State *sh7750_init(CPUSH4State * cpu)
709 s = qemu_mallocz(sizeof(SH7750State)); 709 s = qemu_mallocz(sizeof(SH7750State));
710 s->cpu = cpu; 710 s->cpu = cpu;
711 s->periph_freq = 60000000; /* 60MHz */ 711 s->periph_freq = 60000000; /* 60MHz */
712 - sh7750_io_memory = cpu_register_io_memory(0,  
713 - sh7750_mem_read, 712 + sh7750_io_memory = cpu_register_io_memory(sh7750_mem_read,
714 sh7750_mem_write, s); 713 sh7750_mem_write, s);
715 cpu_register_physical_memory_offset(0x1f000000, 0x1000, 714 cpu_register_physical_memory_offset(0x1f000000, 0x1000,
716 sh7750_io_memory, 0x1f000000); 715 sh7750_io_memory, 0x1f000000);
@@ -725,8 +724,7 @@ SH7750State *sh7750_init(CPUSH4State * cpu) @@ -725,8 +724,7 @@ SH7750State *sh7750_init(CPUSH4State * cpu)
725 cpu_register_physical_memory_offset(0xffc00000, 0x1000, 724 cpu_register_physical_memory_offset(0xffc00000, 0x1000,
726 sh7750_io_memory, 0x1fc00000); 725 sh7750_io_memory, 0x1fc00000);
727 726
728 - sh7750_mm_cache_and_tlb = cpu_register_io_memory(0,  
729 - sh7750_mmct_read, 727 + sh7750_mm_cache_and_tlb = cpu_register_io_memory(sh7750_mmct_read,
730 sh7750_mmct_write, s); 728 sh7750_mmct_write, s);
731 cpu_register_physical_memory(0xf0000000, 0x08000000, 729 cpu_register_physical_memory(0xf0000000, 0x08000000,
732 sh7750_mm_cache_and_tlb); 730 sh7750_mm_cache_and_tlb);
hw/sh_intc.c
@@ -442,7 +442,7 @@ int sh_intc_init(struct intc_desc *desc, @@ -442,7 +442,7 @@ int sh_intc_init(struct intc_desc *desc,
442 442
443 desc->irqs = qemu_allocate_irqs(sh_intc_set_irq, desc, nr_sources); 443 desc->irqs = qemu_allocate_irqs(sh_intc_set_irq, desc, nr_sources);
444 444
445 - desc->iomemtype = cpu_register_io_memory(0, sh_intc_readfn, 445 + desc->iomemtype = cpu_register_io_memory(sh_intc_readfn,
446 sh_intc_writefn, desc); 446 sh_intc_writefn, desc);
447 if (desc->mask_regs) { 447 if (desc->mask_regs) {
448 for (i = 0; i < desc->nr_mask_regs; i++) { 448 for (i = 0; i < desc->nr_mask_regs; i++) {
hw/sh_pci.c
@@ -179,9 +179,9 @@ PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, @@ -179,9 +179,9 @@ PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,
179 179
180 p->dev = pci_register_device(p->bus, "SH PCIC", sizeof(PCIDevice), 180 p->dev = pci_register_device(p->bus, "SH PCIC", sizeof(PCIDevice),
181 -1, NULL, NULL); 181 -1, NULL, NULL);
182 - reg = cpu_register_io_memory(0, sh_pci_reg.r, sh_pci_reg.w, p);  
183 - iop = cpu_register_io_memory(0, sh_pci_iop.r, sh_pci_iop.w, p);  
184 - mem = cpu_register_io_memory(0, sh_pci_mem.r, sh_pci_mem.w, p); 182 + reg = cpu_register_io_memory(sh_pci_reg.r, sh_pci_reg.w, p);
  183 + iop = cpu_register_io_memory(sh_pci_iop.r, sh_pci_iop.w, p);
  184 + mem = cpu_register_io_memory(sh_pci_mem.r, sh_pci_mem.w, p);
185 cpu_register_physical_memory(0x1e200000, 0x224, reg); 185 cpu_register_physical_memory(0x1e200000, 0x224, reg);
186 cpu_register_physical_memory(0x1e240000, 0x40000, iop); 186 cpu_register_physical_memory(0x1e240000, 0x40000, iop);
187 cpu_register_physical_memory(0x1d000000, 0x1000000, mem); 187 cpu_register_physical_memory(0x1d000000, 0x1000000, mem);
hw/sh_serial.c
@@ -394,7 +394,7 @@ void sh_serial_init (target_phys_addr_t base, int feat, @@ -394,7 +394,7 @@ void sh_serial_init (target_phys_addr_t base, int feat,
394 394
395 sh_serial_clear_fifo(s); 395 sh_serial_clear_fifo(s);
396 396
397 - s_io_memory = cpu_register_io_memory(0, sh_serial_readfn, 397 + s_io_memory = cpu_register_io_memory(sh_serial_readfn,
398 sh_serial_writefn, s); 398 sh_serial_writefn, s);
399 cpu_register_physical_memory(P4ADDR(base), 0x28, s_io_memory); 399 cpu_register_physical_memory(P4ADDR(base), 0x28, s_io_memory);
400 cpu_register_physical_memory(A7ADDR(base), 0x28, s_io_memory); 400 cpu_register_physical_memory(A7ADDR(base), 0x28, s_io_memory);
hw/sh_timer.c
@@ -318,7 +318,7 @@ void tmu012_init(target_phys_addr_t base, int feat, uint32_t freq, @@ -318,7 +318,7 @@ void tmu012_init(target_phys_addr_t base, int feat, uint32_t freq,
318 if (feat & TMU012_FEAT_3CHAN) 318 if (feat & TMU012_FEAT_3CHAN)
319 s->timer[2] = sh_timer_init(freq, timer_feat | TIMER_FEAT_CAPT, 319 s->timer[2] = sh_timer_init(freq, timer_feat | TIMER_FEAT_CAPT,
320 ch2_irq0); /* ch2_irq1 not supported */ 320 ch2_irq0); /* ch2_irq1 not supported */
321 - iomemtype = cpu_register_io_memory(0, tmu012_readfn, 321 + iomemtype = cpu_register_io_memory(tmu012_readfn,
322 tmu012_writefn, s); 322 tmu012_writefn, s);
323 cpu_register_physical_memory(P4ADDR(base), 0x00001000, iomemtype); 323 cpu_register_physical_memory(P4ADDR(base), 0x00001000, iomemtype);
324 cpu_register_physical_memory(A7ADDR(base), 0x00001000, iomemtype); 324 cpu_register_physical_memory(A7ADDR(base), 0x00001000, iomemtype);
hw/slavio_intctl.c
@@ -388,8 +388,7 @@ void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg, @@ -388,8 +388,7 @@ void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg,
388 slave->cpu = i; 388 slave->cpu = i;
389 slave->master = s; 389 slave->master = s;
390 390
391 - slavio_intctl_io_memory = cpu_register_io_memory(0,  
392 - slavio_intctl_mem_read, 391 + slavio_intctl_io_memory = cpu_register_io_memory(slavio_intctl_mem_read,
393 slavio_intctl_mem_write, 392 slavio_intctl_mem_write,
394 slave); 393 slave);
395 cpu_register_physical_memory(addr + i * TARGET_PAGE_SIZE, INTCTL_SIZE, 394 cpu_register_physical_memory(addr + i * TARGET_PAGE_SIZE, INTCTL_SIZE,
@@ -399,8 +398,7 @@ void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg, @@ -399,8 +398,7 @@ void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg,
399 s->cpu_irqs[i] = parent_irq[i]; 398 s->cpu_irqs[i] = parent_irq[i];
400 } 399 }
401 400
402 - slavio_intctlm_io_memory = cpu_register_io_memory(0,  
403 - slavio_intctlm_mem_read, 401 + slavio_intctlm_io_memory = cpu_register_io_memory(slavio_intctlm_mem_read,
404 slavio_intctlm_mem_write, 402 slavio_intctlm_mem_write,
405 s); 403 s);
406 cpu_register_physical_memory(addrg, INTCTLM_SIZE, slavio_intctlm_io_memory); 404 cpu_register_physical_memory(addrg, INTCTLM_SIZE, slavio_intctlm_io_memory);
hw/slavio_misc.c
@@ -448,28 +448,28 @@ void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base, @@ -448,28 +448,28 @@ void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base,
448 /* 8 bit registers */ 448 /* 8 bit registers */
449 449
450 // Slavio control 450 // Slavio control
451 - io = cpu_register_io_memory(0, slavio_cfg_mem_read, 451 + io = cpu_register_io_memory(slavio_cfg_mem_read,
452 slavio_cfg_mem_write, s); 452 slavio_cfg_mem_write, s);
453 cpu_register_physical_memory(base + MISC_CFG, MISC_SIZE, io); 453 cpu_register_physical_memory(base + MISC_CFG, MISC_SIZE, io);
454 454
455 // Diagnostics 455 // Diagnostics
456 - io = cpu_register_io_memory(0, slavio_diag_mem_read, 456 + io = cpu_register_io_memory(slavio_diag_mem_read,
457 slavio_diag_mem_write, s); 457 slavio_diag_mem_write, s);
458 cpu_register_physical_memory(base + MISC_DIAG, MISC_SIZE, io); 458 cpu_register_physical_memory(base + MISC_DIAG, MISC_SIZE, io);
459 459
460 // Modem control 460 // Modem control
461 - io = cpu_register_io_memory(0, slavio_mdm_mem_read, 461 + io = cpu_register_io_memory(slavio_mdm_mem_read,
462 slavio_mdm_mem_write, s); 462 slavio_mdm_mem_write, s);
463 cpu_register_physical_memory(base + MISC_MDM, MISC_SIZE, io); 463 cpu_register_physical_memory(base + MISC_MDM, MISC_SIZE, io);
464 464
465 /* 16 bit registers */ 465 /* 16 bit registers */
466 - io = cpu_register_io_memory(0, slavio_led_mem_read, 466 + io = cpu_register_io_memory(slavio_led_mem_read,
467 slavio_led_mem_write, s); 467 slavio_led_mem_write, s);
468 /* ss600mp diag LEDs */ 468 /* ss600mp diag LEDs */
469 cpu_register_physical_memory(base + MISC_LEDS, MISC_SIZE, io); 469 cpu_register_physical_memory(base + MISC_LEDS, MISC_SIZE, io);
470 470
471 /* 32 bit registers */ 471 /* 32 bit registers */
472 - io = cpu_register_io_memory(0, slavio_sysctrl_mem_read, 472 + io = cpu_register_io_memory(slavio_sysctrl_mem_read,
473 slavio_sysctrl_mem_write, s); 473 slavio_sysctrl_mem_write, s);
474 // System control 474 // System control
475 cpu_register_physical_memory(base + MISC_SYS, SYSCTRL_SIZE, io); 475 cpu_register_physical_memory(base + MISC_SYS, SYSCTRL_SIZE, io);
@@ -477,21 +477,21 @@ void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base, @@ -477,21 +477,21 @@ void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base,
477 477
478 // AUX 1 (Misc System Functions) 478 // AUX 1 (Misc System Functions)
479 if (aux1_base) { 479 if (aux1_base) {
480 - io = cpu_register_io_memory(0, slavio_aux1_mem_read, 480 + io = cpu_register_io_memory(slavio_aux1_mem_read,
481 slavio_aux1_mem_write, s); 481 slavio_aux1_mem_write, s);
482 cpu_register_physical_memory(aux1_base, MISC_SIZE, io); 482 cpu_register_physical_memory(aux1_base, MISC_SIZE, io);
483 } 483 }
484 484
485 // AUX 2 (Software Powerdown Control) 485 // AUX 2 (Software Powerdown Control)
486 if (aux2_base) { 486 if (aux2_base) {
487 - io = cpu_register_io_memory(0, slavio_aux2_mem_read, 487 + io = cpu_register_io_memory(slavio_aux2_mem_read,
488 slavio_aux2_mem_write, s); 488 slavio_aux2_mem_write, s);
489 cpu_register_physical_memory(aux2_base, MISC_SIZE, io); 489 cpu_register_physical_memory(aux2_base, MISC_SIZE, io);
490 } 490 }
491 491
492 // Power management (APC) XXX: not a Slavio device 492 // Power management (APC) XXX: not a Slavio device
493 if (power_base) { 493 if (power_base) {
494 - io = cpu_register_io_memory(0, apc_mem_read, apc_mem_write, s); 494 + io = cpu_register_io_memory(apc_mem_read, apc_mem_write, s);
495 cpu_register_physical_memory(power_base, MISC_SIZE, io); 495 cpu_register_physical_memory(power_base, MISC_SIZE, io);
496 } 496 }
497 497
hw/slavio_timer.c
@@ -381,7 +381,7 @@ static SLAVIO_TIMERState *slavio_timer_init(target_phys_addr_t addr, @@ -381,7 +381,7 @@ static SLAVIO_TIMERState *slavio_timer_init(target_phys_addr_t addr,
381 ptimer_set_period(s->timer, TIMER_PERIOD); 381 ptimer_set_period(s->timer, TIMER_PERIOD);
382 } 382 }
383 383
384 - slavio_timer_io_memory = cpu_register_io_memory(0, slavio_timer_mem_read, 384 + slavio_timer_io_memory = cpu_register_io_memory(slavio_timer_mem_read,
385 slavio_timer_mem_write, s); 385 slavio_timer_mem_write, s);
386 if (master) 386 if (master)
387 cpu_register_physical_memory(addr, CPU_TIMER_SIZE, 387 cpu_register_physical_memory(addr, CPU_TIMER_SIZE,
hw/sm501.c
@@ -1080,11 +1080,11 @@ void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq, @@ -1080,11 +1080,11 @@ void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
1080 1080
1081 /* map mmio */ 1081 /* map mmio */
1082 sm501_system_config_index 1082 sm501_system_config_index
1083 - = cpu_register_io_memory(0, sm501_system_config_readfn, 1083 + = cpu_register_io_memory(sm501_system_config_readfn,
1084 sm501_system_config_writefn, s); 1084 sm501_system_config_writefn, s);
1085 cpu_register_physical_memory(base + MMIO_BASE_OFFSET, 1085 cpu_register_physical_memory(base + MMIO_BASE_OFFSET,
1086 0x6c, sm501_system_config_index); 1086 0x6c, sm501_system_config_index);
1087 - sm501_disp_ctrl_index = cpu_register_io_memory(0, sm501_disp_ctrl_readfn, 1087 + sm501_disp_ctrl_index = cpu_register_io_memory(sm501_disp_ctrl_readfn,
1088 sm501_disp_ctrl_writefn, s); 1088 sm501_disp_ctrl_writefn, s);
1089 cpu_register_physical_memory(base + MMIO_BASE_OFFSET + SM501_DC, 1089 cpu_register_physical_memory(base + MMIO_BASE_OFFSET + SM501_DC,
1090 0x1000, sm501_disp_ctrl_index); 1090 0x1000, sm501_disp_ctrl_index);
hw/smc91c111.c
@@ -704,7 +704,7 @@ static void smc91c111_init1(SysBusDevice *dev) @@ -704,7 +704,7 @@ static void smc91c111_init1(SysBusDevice *dev)
704 { 704 {
705 smc91c111_state *s = FROM_SYSBUS(smc91c111_state, dev); 705 smc91c111_state *s = FROM_SYSBUS(smc91c111_state, dev);
706 706
707 - s->mmio_index = cpu_register_io_memory(0, smc91c111_readfn, 707 + s->mmio_index = cpu_register_io_memory(smc91c111_readfn,
708 smc91c111_writefn, s); 708 smc91c111_writefn, s);
709 sysbus_init_mmio(dev, 16, s->mmio_index); 709 sysbus_init_mmio(dev, 16, s->mmio_index);
710 sysbus_init_irq(dev, &s->irq); 710 sysbus_init_irq(dev, &s->irq);
hw/sparc32_dma.c
@@ -252,7 +252,7 @@ void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq, @@ -252,7 +252,7 @@ void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,
252 s->irq = parent_irq; 252 s->irq = parent_irq;
253 s->iommu = iommu; 253 s->iommu = iommu;
254 254
255 - dma_io_memory = cpu_register_io_memory(0, dma_mem_read, dma_mem_write, s); 255 + dma_io_memory = cpu_register_io_memory(dma_mem_read, dma_mem_write, s);
256 cpu_register_physical_memory(daddr, DMA_SIZE, dma_io_memory); 256 cpu_register_physical_memory(daddr, DMA_SIZE, dma_io_memory);
257 257
258 register_savevm("sparc32_dma", daddr, 2, dma_save, dma_load, s); 258 register_savevm("sparc32_dma", daddr, 2, dma_save, dma_load, s);
hw/spitz.c
@@ -174,7 +174,7 @@ static void sl_flash_register(PXA2xxState *cpu, int size) @@ -174,7 +174,7 @@ static void sl_flash_register(PXA2xxState *cpu, int size)
174 else if (size == FLASH_1024M) 174 else if (size == FLASH_1024M)
175 s->nand = nand_init(NAND_MFR_SAMSUNG, 0xf1); 175 s->nand = nand_init(NAND_MFR_SAMSUNG, 0xf1);
176 176
177 - iomemtype = cpu_register_io_memory(0, sl_readfn, 177 + iomemtype = cpu_register_io_memory(sl_readfn,
178 sl_writefn, s); 178 sl_writefn, s);
179 cpu_register_physical_memory(FLASH_BASE, 0x40, iomemtype); 179 cpu_register_physical_memory(FLASH_BASE, 0x40, iomemtype);
180 180
hw/stellaris.c
@@ -347,7 +347,7 @@ static void stellaris_gptm_init(SysBusDevice *dev) @@ -347,7 +347,7 @@ static void stellaris_gptm_init(SysBusDevice *dev)
347 sysbus_init_irq(dev, &s->irq); 347 sysbus_init_irq(dev, &s->irq);
348 qdev_init_gpio_out(&dev->qdev, &s->trigger, 1); 348 qdev_init_gpio_out(&dev->qdev, &s->trigger, 1);
349 349
350 - iomemtype = cpu_register_io_memory(0, gptm_readfn, 350 + iomemtype = cpu_register_io_memory(gptm_readfn,
351 gptm_writefn, s); 351 gptm_writefn, s);
352 sysbus_init_mmio(dev, 0x1000, iomemtype); 352 sysbus_init_mmio(dev, 0x1000, iomemtype);
353 353
@@ -668,7 +668,7 @@ static void stellaris_sys_init(uint32_t base, qemu_irq irq, @@ -668,7 +668,7 @@ static void stellaris_sys_init(uint32_t base, qemu_irq irq,
668 s->user0 = macaddr[0] | (macaddr[1] << 8) | (macaddr[2] << 16); 668 s->user0 = macaddr[0] | (macaddr[1] << 8) | (macaddr[2] << 16);
669 s->user1 = macaddr[3] | (macaddr[4] << 8) | (macaddr[5] << 16); 669 s->user1 = macaddr[3] | (macaddr[4] << 8) | (macaddr[5] << 16);
670 670
671 - iomemtype = cpu_register_io_memory(0, ssys_readfn, 671 + iomemtype = cpu_register_io_memory(ssys_readfn,
672 ssys_writefn, s); 672 ssys_writefn, s);
673 cpu_register_physical_memory(base, 0x00001000, iomemtype); 673 cpu_register_physical_memory(base, 0x00001000, iomemtype);
674 ssys_reset(s); 674 ssys_reset(s);
@@ -880,7 +880,7 @@ static void stellaris_i2c_init(SysBusDevice * dev) @@ -880,7 +880,7 @@ static void stellaris_i2c_init(SysBusDevice * dev)
880 bus = i2c_init_bus(&dev->qdev, "i2c"); 880 bus = i2c_init_bus(&dev->qdev, "i2c");
881 s->bus = bus; 881 s->bus = bus;
882 882
883 - iomemtype = cpu_register_io_memory(0, stellaris_i2c_readfn, 883 + iomemtype = cpu_register_io_memory(stellaris_i2c_readfn,
884 stellaris_i2c_writefn, s); 884 stellaris_i2c_writefn, s);
885 sysbus_init_mmio(dev, 0x1000, iomemtype); 885 sysbus_init_mmio(dev, 0x1000, iomemtype);
886 /* ??? For now we only implement the master interface. */ 886 /* ??? For now we only implement the master interface. */
@@ -1188,7 +1188,7 @@ static void stellaris_adc_init(SysBusDevice *dev) @@ -1188,7 +1188,7 @@ static void stellaris_adc_init(SysBusDevice *dev)
1188 sysbus_init_irq(dev, &s->irq[n]); 1188 sysbus_init_irq(dev, &s->irq[n]);
1189 } 1189 }
1190 1190
1191 - iomemtype = cpu_register_io_memory(0, stellaris_adc_readfn, 1191 + iomemtype = cpu_register_io_memory(stellaris_adc_readfn,
1192 stellaris_adc_writefn, s); 1192 stellaris_adc_writefn, s);
1193 sysbus_init_mmio(dev, 0x1000, iomemtype); 1193 sysbus_init_mmio(dev, 0x1000, iomemtype);
1194 stellaris_adc_reset(s); 1194 stellaris_adc_reset(s);
hw/stellaris_enet.c
@@ -400,7 +400,7 @@ static void stellaris_enet_init(SysBusDevice *dev) @@ -400,7 +400,7 @@ static void stellaris_enet_init(SysBusDevice *dev)
400 { 400 {
401 stellaris_enet_state *s = FROM_SYSBUS(stellaris_enet_state, dev); 401 stellaris_enet_state *s = FROM_SYSBUS(stellaris_enet_state, dev);
402 402
403 - s->mmio_index = cpu_register_io_memory(0, stellaris_enet_readfn, 403 + s->mmio_index = cpu_register_io_memory(stellaris_enet_readfn,
404 stellaris_enet_writefn, s); 404 stellaris_enet_writefn, s);
405 sysbus_init_mmio(dev, 0x1000, s->mmio_index); 405 sysbus_init_mmio(dev, 0x1000, s->mmio_index);
406 sysbus_init_irq(dev, &s->irq); 406 sysbus_init_irq(dev, &s->irq);
hw/sun4c_intctl.c
@@ -205,7 +205,7 @@ void *sun4c_intctl_init(target_phys_addr_t addr, qemu_irq **irq, @@ -205,7 +205,7 @@ void *sun4c_intctl_init(target_phys_addr_t addr, qemu_irq **irq,
205 205
206 s = qemu_mallocz(sizeof(Sun4c_INTCTLState)); 206 s = qemu_mallocz(sizeof(Sun4c_INTCTLState));
207 207
208 - sun4c_intctl_io_memory = cpu_register_io_memory(0, sun4c_intctl_mem_read, 208 + sun4c_intctl_io_memory = cpu_register_io_memory(sun4c_intctl_mem_read,
209 sun4c_intctl_mem_write, s); 209 sun4c_intctl_mem_write, s);
210 cpu_register_physical_memory(addr, INTCTL_SIZE, sun4c_intctl_io_memory); 210 cpu_register_physical_memory(addr, INTCTL_SIZE, sun4c_intctl_io_memory);
211 s->cpu_irqs = parent_irq; 211 s->cpu_irqs = parent_irq;
hw/syborg_fb.c
@@ -511,7 +511,7 @@ static void syborg_fb_init(SysBusDevice *dev) @@ -511,7 +511,7 @@ static void syborg_fb_init(SysBusDevice *dev)
511 int height; 511 int height;
512 512
513 sysbus_init_irq(dev, &s->irq); 513 sysbus_init_irq(dev, &s->irq);
514 - iomemtype = cpu_register_io_memory(0, syborg_fb_readfn, 514 + iomemtype = cpu_register_io_memory(syborg_fb_readfn,
515 syborg_fb_writefn, s); 515 syborg_fb_writefn, s);
516 sysbus_init_mmio(dev, 0x1000, iomemtype); 516 sysbus_init_mmio(dev, 0x1000, iomemtype);
517 517
hw/syborg_interrupt.c
@@ -210,7 +210,7 @@ static void syborg_int_init(SysBusDevice *dev) @@ -210,7 +210,7 @@ static void syborg_int_init(SysBusDevice *dev)
210 sysbus_init_irq(dev, &s->parent_irq); 210 sysbus_init_irq(dev, &s->parent_irq);
211 s->num_irqs = qdev_get_prop_int(&dev->qdev, "num-interrupts", 64); 211 s->num_irqs = qdev_get_prop_int(&dev->qdev, "num-interrupts", 64);
212 qdev_init_gpio_in(&dev->qdev, syborg_int_set_irq, s->num_irqs); 212 qdev_init_gpio_in(&dev->qdev, syborg_int_set_irq, s->num_irqs);
213 - iomemtype = cpu_register_io_memory(0, syborg_int_readfn, 213 + iomemtype = cpu_register_io_memory(syborg_int_readfn,
214 syborg_int_writefn, s); 214 syborg_int_writefn, s);
215 sysbus_init_mmio(dev, 0x1000, iomemtype); 215 sysbus_init_mmio(dev, 0x1000, iomemtype);
216 s->flags = qemu_mallocz(s->num_irqs * sizeof(syborg_int_flags)); 216 s->flags = qemu_mallocz(s->num_irqs * sizeof(syborg_int_flags));
hw/syborg_keyboard.c
@@ -209,7 +209,7 @@ static void syborg_keyboard_init(SysBusDevice *dev) @@ -209,7 +209,7 @@ static void syborg_keyboard_init(SysBusDevice *dev)
209 int iomemtype; 209 int iomemtype;
210 210
211 sysbus_init_irq(dev, &s->irq); 211 sysbus_init_irq(dev, &s->irq);
212 - iomemtype = cpu_register_io_memory(0, syborg_keyboard_readfn, 212 + iomemtype = cpu_register_io_memory(syborg_keyboard_readfn,
213 syborg_keyboard_writefn, s); 213 syborg_keyboard_writefn, s);
214 sysbus_init_mmio(dev, 0x1000, iomemtype); 214 sysbus_init_mmio(dev, 0x1000, iomemtype);
215 s->fifo_size = qdev_get_prop_int(&dev->qdev, "fifo-size", 16); 215 s->fifo_size = qdev_get_prop_int(&dev->qdev, "fifo-size", 16);
hw/syborg_pointer.c
@@ -205,7 +205,7 @@ static void syborg_pointer_init(SysBusDevice *dev) @@ -205,7 +205,7 @@ static void syborg_pointer_init(SysBusDevice *dev)
205 int iomemtype; 205 int iomemtype;
206 206
207 sysbus_init_irq(dev, &s->irq); 207 sysbus_init_irq(dev, &s->irq);
208 - iomemtype = cpu_register_io_memory(0, syborg_pointer_readfn, 208 + iomemtype = cpu_register_io_memory(syborg_pointer_readfn,
209 syborg_pointer_writefn, s); 209 syborg_pointer_writefn, s);
210 sysbus_init_mmio(dev, 0x1000, iomemtype); 210 sysbus_init_mmio(dev, 0x1000, iomemtype);
211 211
hw/syborg_rtc.c
@@ -129,7 +129,7 @@ static void syborg_rtc_init(SysBusDevice *dev) @@ -129,7 +129,7 @@ static void syborg_rtc_init(SysBusDevice *dev)
129 struct tm tm; 129 struct tm tm;
130 int iomemtype; 130 int iomemtype;
131 131
132 - iomemtype = cpu_register_io_memory(0, syborg_rtc_readfn, 132 + iomemtype = cpu_register_io_memory(syborg_rtc_readfn,
133 syborg_rtc_writefn, s); 133 syborg_rtc_writefn, s);
134 sysbus_init_mmio(dev, 0x1000, iomemtype); 134 sysbus_init_mmio(dev, 0x1000, iomemtype);
135 135
hw/syborg_serial.c
@@ -321,7 +321,7 @@ static void syborg_serial_init(SysBusDevice *dev) @@ -321,7 +321,7 @@ static void syborg_serial_init(SysBusDevice *dev)
321 int iomemtype; 321 int iomemtype;
322 322
323 sysbus_init_irq(dev, &s->irq); 323 sysbus_init_irq(dev, &s->irq);
324 - iomemtype = cpu_register_io_memory(0, syborg_serial_readfn, 324 + iomemtype = cpu_register_io_memory(syborg_serial_readfn,
325 syborg_serial_writefn, s); 325 syborg_serial_writefn, s);
326 sysbus_init_mmio(dev, 0x1000, iomemtype); 326 sysbus_init_mmio(dev, 0x1000, iomemtype);
327 s->chr = qdev_init_chardev(&dev->qdev); 327 s->chr = qdev_init_chardev(&dev->qdev);
hw/syborg_timer.c
@@ -215,7 +215,7 @@ static void syborg_timer_init(SysBusDevice *dev) @@ -215,7 +215,7 @@ static void syborg_timer_init(SysBusDevice *dev)
215 exit(1); 215 exit(1);
216 } 216 }
217 sysbus_init_irq(dev, &s->irq); 217 sysbus_init_irq(dev, &s->irq);
218 - iomemtype = cpu_register_io_memory(0, syborg_timer_readfn, 218 + iomemtype = cpu_register_io_memory(syborg_timer_readfn,
219 syborg_timer_writefn, s); 219 syborg_timer_writefn, s);
220 sysbus_init_mmio(dev, 0x1000, iomemtype); 220 sysbus_init_mmio(dev, 0x1000, iomemtype);
221 221
hw/syborg_virtio.c
@@ -249,7 +249,7 @@ static void syborg_virtio_init(SyborgVirtIOProxy *proxy, VirtIODevice *vdev) @@ -249,7 +249,7 @@ static void syborg_virtio_init(SyborgVirtIOProxy *proxy, VirtIODevice *vdev)
249 proxy->vdev = vdev; 249 proxy->vdev = vdev;
250 250
251 sysbus_init_irq(&proxy->busdev, &proxy->irq); 251 sysbus_init_irq(&proxy->busdev, &proxy->irq);
252 - iomemtype = cpu_register_io_memory(0, syborg_virtio_readfn, 252 + iomemtype = cpu_register_io_memory(syborg_virtio_readfn,
253 syborg_virtio_writefn, proxy); 253 syborg_virtio_writefn, proxy);
254 sysbus_init_mmio(&proxy->busdev, 0x1000, iomemtype); 254 sysbus_init_mmio(&proxy->busdev, 0x1000, iomemtype);
255 255
hw/tc6393xb.c
@@ -589,7 +589,7 @@ TC6393xbState *tc6393xb_init(uint32_t base, qemu_irq irq) @@ -589,7 +589,7 @@ TC6393xbState *tc6393xb_init(uint32_t base, qemu_irq irq)
589 589
590 s->flash = nand_init(NAND_MFR_TOSHIBA, 0x76); 590 s->flash = nand_init(NAND_MFR_TOSHIBA, 0x76);
591 591
592 - iomemtype = cpu_register_io_memory(0, tc6393xb_readfn, 592 + iomemtype = cpu_register_io_memory(tc6393xb_readfn,
593 tc6393xb_writefn, s); 593 tc6393xb_writefn, s);
594 cpu_register_physical_memory(base, 0x10000, iomemtype); 594 cpu_register_physical_memory(base, 0x10000, iomemtype);
595 595
hw/tcx.c
@@ -523,11 +523,11 @@ void tcx_init(target_phys_addr_t addr, int vram_size, int width, int height, @@ -523,11 +523,11 @@ void tcx_init(target_phys_addr_t addr, int vram_size, int width, int height,
523 vram_offset += size; 523 vram_offset += size;
524 vram_base += size; 524 vram_base += size;
525 525
526 - io_memory = cpu_register_io_memory(0, tcx_dac_read, tcx_dac_write, s); 526 + io_memory = cpu_register_io_memory(tcx_dac_read, tcx_dac_write, s);
527 cpu_register_physical_memory(addr + 0x00200000ULL, TCX_DAC_NREGS, 527 cpu_register_physical_memory(addr + 0x00200000ULL, TCX_DAC_NREGS,
528 io_memory); 528 io_memory);
529 529
530 - dummy_memory = cpu_register_io_memory(0, tcx_dummy_read, tcx_dummy_write, 530 + dummy_memory = cpu_register_io_memory(tcx_dummy_read, tcx_dummy_write,
531 s); 531 s);
532 cpu_register_physical_memory(addr + 0x00700000ULL, TCX_TEC_NREGS, 532 cpu_register_physical_memory(addr + 0x00700000ULL, TCX_TEC_NREGS,
533 dummy_memory); 533 dummy_memory);
hw/tusb6010.c
@@ -742,7 +742,7 @@ TUSBState *tusb6010_init(qemu_irq intr) @@ -742,7 +742,7 @@ TUSBState *tusb6010_init(qemu_irq intr)
742 s->mask = 0xffffffff; 742 s->mask = 0xffffffff;
743 s->intr = 0x00000000; 743 s->intr = 0x00000000;
744 s->otg_timer_val = 0; 744 s->otg_timer_val = 0;
745 - s->iomemtype[1] = cpu_register_io_memory(0, tusb_async_readfn, 745 + s->iomemtype[1] = cpu_register_io_memory(tusb_async_readfn,
746 tusb_async_writefn, s); 746 tusb_async_writefn, s);
747 s->irq = intr; 747 s->irq = intr;
748 s->otg_timer = qemu_new_timer(vm_clock, tusb_otg_tick, s); 748 s->otg_timer = qemu_new_timer(vm_clock, tusb_otg_tick, s);
hw/unin_pci.c
@@ -179,9 +179,9 @@ PCIBus *pci_pmac_init(qemu_irq *pic) @@ -179,9 +179,9 @@ PCIBus *pci_pmac_init(qemu_irq *pic)
179 pci_unin_set_irq, pci_unin_map_irq, 179 pci_unin_set_irq, pci_unin_map_irq,
180 pic, 11 << 3, 4); 180 pic, 11 << 3, 4);
181 181
182 - pci_mem_config = cpu_register_io_memory(0, pci_unin_main_config_read, 182 + pci_mem_config = cpu_register_io_memory(pci_unin_main_config_read,
183 pci_unin_main_config_write, s); 183 pci_unin_main_config_write, s);
184 - pci_mem_data = cpu_register_io_memory(0, pci_unin_main_read, 184 + pci_mem_data = cpu_register_io_memory(pci_unin_main_read,
185 pci_unin_main_write, s); 185 pci_unin_main_write, s);
186 cpu_register_physical_memory(0xf2800000, 0x1000, pci_mem_config); 186 cpu_register_physical_memory(0xf2800000, 0x1000, pci_mem_config);
187 cpu_register_physical_memory(0xf2c00000, 0x1000, pci_mem_data); 187 cpu_register_physical_memory(0xf2c00000, 0x1000, pci_mem_data);
@@ -226,9 +226,9 @@ PCIBus *pci_pmac_init(qemu_irq *pic) @@ -226,9 +226,9 @@ PCIBus *pci_pmac_init(qemu_irq *pic)
226 #endif 226 #endif
227 227
228 /* Uninorth AGP bus */ 228 /* Uninorth AGP bus */
229 - pci_mem_config = cpu_register_io_memory(0, pci_unin_config_read, 229 + pci_mem_config = cpu_register_io_memory(pci_unin_config_read,
230 pci_unin_config_write, s); 230 pci_unin_config_write, s);
231 - pci_mem_data = cpu_register_io_memory(0, pci_unin_main_read, 231 + pci_mem_data = cpu_register_io_memory(pci_unin_main_read,
232 pci_unin_main_write, s); 232 pci_unin_main_write, s);
233 cpu_register_physical_memory(0xf0800000, 0x1000, pci_mem_config); 233 cpu_register_physical_memory(0xf0800000, 0x1000, pci_mem_config);
234 cpu_register_physical_memory(0xf0c00000, 0x1000, pci_mem_data); 234 cpu_register_physical_memory(0xf0c00000, 0x1000, pci_mem_data);
@@ -247,9 +247,9 @@ PCIBus *pci_pmac_init(qemu_irq *pic) @@ -247,9 +247,9 @@ PCIBus *pci_pmac_init(qemu_irq *pic)
247 #if 0 // XXX: not needed for now 247 #if 0 // XXX: not needed for now
248 /* Uninorth internal bus */ 248 /* Uninorth internal bus */
249 s = &pci_bridge[2]; 249 s = &pci_bridge[2];
250 - pci_mem_config = cpu_register_io_memory(0, pci_unin_config_read, 250 + pci_mem_config = cpu_register_io_memory(pci_unin_config_read,
251 pci_unin_config_write, s); 251 pci_unin_config_write, s);
252 - pci_mem_data = cpu_register_io_memory(0, pci_unin_read, 252 + pci_mem_data = cpu_register_io_memory(pci_unin_read,
253 pci_unin_write, s); 253 pci_unin_write, s);
254 cpu_register_physical_memory(0xf4800000, 0x1000, pci_mem_config); 254 cpu_register_physical_memory(0xf4800000, 0x1000, pci_mem_config);
255 cpu_register_physical_memory(0xf4c00000, 0x1000, pci_mem_data); 255 cpu_register_physical_memory(0xf4c00000, 0x1000, pci_mem_data);
hw/usb-ohci.c
@@ -1682,7 +1682,7 @@ static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn, @@ -1682,7 +1682,7 @@ static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn,
1682 usb_frame_time, usb_bit_time); 1682 usb_frame_time, usb_bit_time);
1683 } 1683 }
1684 1684
1685 - ohci->mem = cpu_register_io_memory(0, ohci_readfn, ohci_writefn, ohci); 1685 + ohci->mem = cpu_register_io_memory(ohci_readfn, ohci_writefn, ohci);
1686 ohci->localmem_base = localmem_base; 1686 ohci->localmem_base = localmem_base;
1687 ohci->name = name; 1687 ohci->name = name;
1688 1688
hw/versatile_pci.c
@@ -124,7 +124,7 @@ static void pci_vpb_init(SysBusDevice *dev) @@ -124,7 +124,7 @@ static void pci_vpb_init(SysBusDevice *dev)
124 124
125 /* ??? Register memory space. */ 125 /* ??? Register memory space. */
126 126
127 - s->mem_config = cpu_register_io_memory(0, pci_vpb_config_read, 127 + s->mem_config = cpu_register_io_memory(pci_vpb_config_read,
128 pci_vpb_config_write, bus); 128 pci_vpb_config_write, bus);
129 sysbus_init_mmio_cb(dev, 0x04000000, pci_vpb_map); 129 sysbus_init_mmio_cb(dev, 0x04000000, pci_vpb_map);
130 130
hw/versatilepb.c
@@ -140,7 +140,7 @@ static void vpb_sic_init(SysBusDevice *dev) @@ -140,7 +140,7 @@ static void vpb_sic_init(SysBusDevice *dev)
140 sysbus_init_irq(dev, &s->parent[i]); 140 sysbus_init_irq(dev, &s->parent[i]);
141 } 141 }
142 s->irq = 31; 142 s->irq = 31;
143 - iomemtype = cpu_register_io_memory(0, vpb_sic_readfn, 143 + iomemtype = cpu_register_io_memory(vpb_sic_readfn,
144 vpb_sic_writefn, s); 144 vpb_sic_writefn, s);
145 sysbus_init_mmio(dev, 0x1000, iomemtype); 145 sysbus_init_mmio(dev, 0x1000, iomemtype);
146 /* ??? Save/restore. */ 146 /* ??? Save/restore. */
hw/vga.c
@@ -2347,7 +2347,7 @@ void vga_init(VGAState *s) @@ -2347,7 +2347,7 @@ void vga_init(VGAState *s)
2347 #endif 2347 #endif
2348 #endif /* CONFIG_BOCHS_VBE */ 2348 #endif /* CONFIG_BOCHS_VBE */
2349 2349
2350 - vga_io_memory = cpu_register_io_memory(0, vga_mem_read, vga_mem_write, s); 2350 + vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
2351 cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000, 2351 cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
2352 vga_io_memory); 2352 vga_io_memory);
2353 qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000); 2353 qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000);
@@ -2417,8 +2417,8 @@ static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base, @@ -2417,8 +2417,8 @@ static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base,
2417 int s_ioport_ctrl, vga_io_memory; 2417 int s_ioport_ctrl, vga_io_memory;
2418 2418
2419 s->it_shift = it_shift; 2419 s->it_shift = it_shift;
2420 - s_ioport_ctrl = cpu_register_io_memory(0, vga_mm_read_ctrl, vga_mm_write_ctrl, s);  
2421 - vga_io_memory = cpu_register_io_memory(0, vga_mem_read, vga_mem_write, s); 2420 + s_ioport_ctrl = cpu_register_io_memory(vga_mm_read_ctrl, vga_mm_write_ctrl, s);
  2421 + vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
2422 2422
2423 register_savevm("vga", 0, 2, vga_save, vga_load, s); 2423 register_savevm("vga", 0, 2, vga_save, vga_load, s);
2424 2424
hw/vmware_vga.c
@@ -1201,7 +1201,7 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int region_num, @@ -1201,7 +1201,7 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int region_num,
1201 1201
1202 s->vram_base = addr; 1202 s->vram_base = addr;
1203 #ifdef DIRECT_VRAM 1203 #ifdef DIRECT_VRAM
1204 - iomemtype = cpu_register_io_memory(0, vmsvga_vram_read, 1204 + iomemtype = cpu_register_io_memory(vmsvga_vram_read,
1205 vmsvga_vram_write, s); 1205 vmsvga_vram_write, s);
1206 #else 1206 #else
1207 iomemtype = s->vga.vram_offset | IO_MEM_RAM; 1207 iomemtype = s->vga.vram_offset | IO_MEM_RAM;
hw/wdt_i6300esb.c
@@ -368,7 +368,7 @@ static void i6300esb_map(PCIDevice *dev, int region_num, @@ -368,7 +368,7 @@ static void i6300esb_map(PCIDevice *dev, int region_num,
368 368
369 i6300esb_debug("addr = %x, size = %x, type = %d\n", addr, size, type); 369 i6300esb_debug("addr = %x, size = %x, type = %d\n", addr, size, type);
370 370
371 - io_mem = cpu_register_io_memory (0, mem_read, mem_write, d); 371 + io_mem = cpu_register_io_memory(mem_read, mem_write, d);
372 cpu_register_physical_memory (addr, 0x10, io_mem); 372 cpu_register_physical_memory (addr, 0x10, io_mem);
373 /* qemu_register_coalesced_mmio (addr, 0x10); ? */ 373 /* qemu_register_coalesced_mmio (addr, 0x10); ? */
374 } 374 }
hw/xilinx_ethlite.c
@@ -218,7 +218,7 @@ static void xilinx_ethlite_init(SysBusDevice *dev) @@ -218,7 +218,7 @@ static void xilinx_ethlite_init(SysBusDevice *dev)
218 s->c_rx_pingpong = qdev_get_prop_int(&dev->qdev, "rxpingpong", 1); 218 s->c_rx_pingpong = qdev_get_prop_int(&dev->qdev, "rxpingpong", 1);
219 s->rxbuf = 0; 219 s->rxbuf = 0;
220 220
221 - regs = cpu_register_io_memory(0, eth_read, eth_write, s); 221 + regs = cpu_register_io_memory(eth_read, eth_write, s);
222 sysbus_init_mmio(dev, R_MAX * 4, regs); 222 sysbus_init_mmio(dev, R_MAX * 4, regs);
223 223
224 qdev_get_macaddr(&dev->qdev, s->macaddr); 224 qdev_get_macaddr(&dev->qdev, s->macaddr);
hw/xilinx_intc.c
@@ -154,7 +154,7 @@ static void xilinx_intc_init(SysBusDevice *dev) @@ -154,7 +154,7 @@ static void xilinx_intc_init(SysBusDevice *dev)
154 qdev_init_gpio_in(&dev->qdev, irq_handler, 32); 154 qdev_init_gpio_in(&dev->qdev, irq_handler, 32);
155 sysbus_init_irq(dev, &p->parent_irq); 155 sysbus_init_irq(dev, &p->parent_irq);
156 156
157 - pic_regs = cpu_register_io_memory(0, pic_read, pic_write, p); 157 + pic_regs = cpu_register_io_memory(pic_read, pic_write, p);
158 sysbus_init_mmio(dev, R_MAX * 4, pic_regs); 158 sysbus_init_mmio(dev, R_MAX * 4, pic_regs);
159 } 159 }
160 160
hw/xilinx_timer.c
@@ -211,7 +211,7 @@ static void xilinx_timer_init(SysBusDevice *dev) @@ -211,7 +211,7 @@ static void xilinx_timer_init(SysBusDevice *dev)
211 ptimer_set_freq(xt->ptimer, freq_hz); 211 ptimer_set_freq(xt->ptimer, freq_hz);
212 } 212 }
213 213
214 - timer_regs = cpu_register_io_memory(0, timer_read, timer_write, t); 214 + timer_regs = cpu_register_io_memory(timer_read, timer_write, t);
215 sysbus_init_mmio(dev, R_MAX * 4 * t->nr_timers, timer_regs); 215 sysbus_init_mmio(dev, R_MAX * 4 * t->nr_timers, timer_regs);
216 } 216 }
217 217
hw/xilinx_uartlite.c
@@ -201,7 +201,7 @@ static void xilinx_uartlite_init(SysBusDevice *dev) @@ -201,7 +201,7 @@ static void xilinx_uartlite_init(SysBusDevice *dev)
201 sysbus_init_irq(dev, &s->irq); 201 sysbus_init_irq(dev, &s->irq);
202 202
203 uart_update_status(s); 203 uart_update_status(s);
204 - uart_regs = cpu_register_io_memory(0, uart_read, uart_write, s); 204 + uart_regs = cpu_register_io_memory(uart_read, uart_write, s);
205 sysbus_init_mmio(dev, R_MAX * 4, uart_regs); 205 sysbus_init_mmio(dev, R_MAX * 4, uart_regs);
206 206
207 s->chr = qdev_init_chardev(&dev->qdev); 207 s->chr = qdev_init_chardev(&dev->qdev);
hw/zaurus.c
@@ -228,7 +228,7 @@ ScoopInfo *scoop_init(PXA2xxState *cpu, @@ -228,7 +228,7 @@ ScoopInfo *scoop_init(PXA2xxState *cpu,
228 228
229 s->status = 0x02; 229 s->status = 0x02;
230 s->in = qemu_allocate_irqs(scoop_gpio_set, s, 16); 230 s->in = qemu_allocate_irqs(scoop_gpio_set, s, 16);
231 - iomemtype = cpu_register_io_memory(0, scoop_readfn, 231 + iomemtype = cpu_register_io_memory(scoop_readfn,
232 scoop_writefn, s); 232 scoop_writefn, s);
233 cpu_register_physical_memory(target_base, 0x1000, iomemtype); 233 cpu_register_physical_memory(target_base, 0x1000, iomemtype);
234 register_savevm("scoop", instance, 1, scoop_save, scoop_load, s); 234 register_savevm("scoop", instance, 1, scoop_save, scoop_load, s);
@@ -990,7 +990,7 @@ static CPUWriteMemoryFunc *qpi_mem_write[3] = { @@ -990,7 +990,7 @@ static CPUWriteMemoryFunc *qpi_mem_write[3] = {
990 static void qpi_init(void) 990 static void qpi_init(void)
991 { 991 {
992 kqemu_comm_base = 0xff000000 | 1; 992 kqemu_comm_base = 0xff000000 | 1;
993 - qpi_io_memory = cpu_register_io_memory(0, 993 + qpi_io_memory = cpu_register_io_memory(
994 qpi_mem_read, 994 qpi_mem_read,
995 qpi_mem_write, NULL); 995 qpi_mem_write, NULL);
996 cpu_register_physical_memory(kqemu_comm_base & ~0xfff, 996 cpu_register_physical_memory(kqemu_comm_base & ~0xfff,