V2. Finish to convert integratorcp and stellaris to memory API
cover V2. Finish to convert integratorcp and stellaris to memory API
Theses patches finish to convert integratorcp.c and stellaris.c to the new memory API.
They apply on git://github.com/avikivity/qemu.git memory/master.
Benoît Canet (7):
integratorcp: convert core to memory API
integratorcp: convert icp pic to memory API
integratorcp: convert control to memory API
stellaris: convert sys to memory API
stellaris: convert i2c to memory API
stellaris: convert adc to memory API
stellaris: convert gptm to memory API
hw/integratorcp.c | 87 ++++++++++++++++----------------------- hw/stellaris.c | 115 +++++++++++++++++++++-------------------------------- 2 files changed, 82 insertions(+), 120 deletions(-)
Signature · 1 line
1.7.5.4
PATCH 1/7 integratorcp: convert core to memory API
--- hw/integratorcp.c | 29 ++++++++++++----------------- 1 files changed, 12 insertions(+), 17 deletions(-)
hw/integratorcp.c +12 -17
@@ -18,6 +18,7 @@ typedef struct { SysBusDevice busdev; + MemoryRegion iomem; uint32_t memsz; MemoryRegion flash; bool flash_mapped;
@@ -39,7 +40,8 @@ static uint8_t integrator_spd[128] = {0xe ,4 ,0x1c ,1 ,2 ,0x20 ,0xc0 ,0 ,0 ,0 ,0 ,0x30 ,0x28 ,0x30 ,0x28 ,0x40 }; -static uint32_t integratorcm_read (void *opaque,target_phys_addr_t offset) +static uint64_t integratorcm_read (void *opaque,target_phys_addr_t offset, +unsigned size) {integratorcm_state *s = (integratorcm_state *)opaque;if (offset >=0x100 && offset <0x200 ) {
@@ -152,7 +154,7 @@ static void integratorcm_update(integratorcm_state *s) }static void integratorcm_write (void *opaque,target_phys_addr_t offset, -uint32_t value) +uint64_t value,unsigned size) {integratorcm_state *s = (integratorcm_state *)opaque;switch (offset >>2 ) {
@@ -228,21 +230,14 @@ static void integratorcm_write(void *opaque, target_phys_addr_t offset,/* Integrator/CM control registers. */ -static CPUReadMemoryFunc *const integratorcm_readfn[] = { - integratorcm_read, - integratorcm_read, - integratorcm_read -}; - -static CPUWriteMemoryFunc *const integratorcm_writefn[] = { - integratorcm_write, - integratorcm_write, - integratorcm_write +static const MemoryRegionOps integratorcm_ops = { + .read = integratorcm_read, + .write = integratorcm_write, + .endianness =DEVICE_NATIVE_ENDIAN , };static int integratorcm_init (SysBusDevice *dev) { -int iomemtype;integratorcm_state *s =FROM_SYSBUS (integratorcm_state, dev); s->cm_osc =0x01000048 ;
@@ -269,10 +264,10 @@ static int integratorcm_init(SysBusDevice *dev)memory_region_init_ram (&s->flash,NULL ,"integrator.flash" ,0x100000 ); s->flash_mapped = false; - iomemtype =cpu_register_io_memory (integratorcm_readfn, - integratorcm_writefn, s, -DEVICE_NATIVE_ENDIAN ); -sysbus_init_mmio (dev,0x00800000 , iomemtype); +memory_region_init_io (&s->iomem, &integratorcm_ops, s, +"integratorcm" ,0x00800000 ); +sysbus_init_mmio_region (dev, &s->iomem); +integratorcm_do_remap (s,1 );/* ??? Save/restore. */ return 0 ;
Signature · 1 line
1.7.5.4
PATCH 2/7 integratorcp: convert icp pic to memory API
In reply to Benoît Canet--- hw/integratorcp.c | 27 ++++++++++----------------- 1 files changed, 10 insertions(+), 17 deletions(-)
hw/integratorcp.c +10 -17
@@ -279,6 +279,7 @@ static int integratorcm_init(SysBusDevice *dev) typedef struct icp_pic_state { SysBusDevice busdev; + MemoryRegion iomem; uint32_t level; uint32_t irq_enabled; uint32_t fiq_enabled;
@@ -306,7 +307,8 @@ static void icp_pic_set_irq(void *opaque, int irq, int level)icp_pic_update (s); } -static uint32_t icp_pic_read (void *opaque,target_phys_addr_t offset) +static uint64_t icp_pic_read (void *opaque,target_phys_addr_t offset, +unsigned size) {icp_pic_state *s = (icp_pic_state *)opaque;
@@ -335,7 +337,7 @@ static uint32_t icp_pic_read(void *opaque, target_phys_addr_t offset) }static void icp_pic_write (void *opaque,target_phys_addr_t offset, -uint32_t value) +uint64_t value,unsigned size) {icp_pic_state *s = (icp_pic_state *)opaque;
@@ -371,30 +373,21 @@ static void icp_pic_write(void *opaque, target_phys_addr_t offset,icp_pic_update (s); } -static CPUReadMemoryFunc *const icp_pic_readfn[] = { - icp_pic_read, - icp_pic_read, - icp_pic_read -}; - -static CPUWriteMemoryFunc *const icp_pic_writefn[] = { - icp_pic_write, - icp_pic_write, - icp_pic_write +static const MemoryRegionOps icp_pic_ops = { + .read = icp_pic_read, + .write = icp_pic_write, + .endianness =DEVICE_NATIVE_ENDIAN , };static int icp_pic_init (SysBusDevice *dev) {icp_pic_state *s =FROM_SYSBUS (icp_pic_state, dev); -int iomemtype;qdev_init_gpio_in (&dev->qdev, icp_pic_set_irq,32 );sysbus_init_irq (dev, &s->parent_irq);sysbus_init_irq (dev, &s->parent_fiq); - iomemtype =cpu_register_io_memory (icp_pic_readfn, - icp_pic_writefn, s, -DEVICE_NATIVE_ENDIAN ); -sysbus_init_mmio (dev,0x00800000 , iomemtype); +memory_region_init_io (&s->iomem, &icp_pic_ops, s,"icp-pic" ,0x00800000 ); +sysbus_init_mmio_region (dev, &s->iomem);return 0 ; }
Signature · 1 line
1.7.5.4
PATCH 4/7 stellaris: convert sys to memory API
In reply to Benoît Canet--- hw/stellaris.c | 28 +++++++++++----------------- 1 files changed, 11 insertions(+), 17 deletions(-)
hw/stellaris.c +11 -17
@@ -327,6 +327,7 @@ static int stellaris_gptm_init(SysBusDevice *dev)/* System controller. */ typedef struct { + MemoryRegion iomem; uint32_t pborctl; uint32_t ldopctl; uint32_t int_status;
@@ -414,7 +415,8 @@ static int ssys_board_class(const ssys_state *s) } } -static uint32_t ssys_read (void *opaque,target_phys_addr_t offset) +static uint64_t ssys_read (void *opaque,target_phys_addr_t offset, +unsigned size) {ssys_state *s = (ssys_state *)opaque;
@@ -518,7 +520,8 @@ static void ssys_calculate_system_clock(ssys_state *s) } } -static void ssys_write (void *opaque,target_phys_addr_t offset,uint32_t value) +static void ssys_write (void *opaque,target_phys_addr_t offset, +uint64_t value,unsigned size) {ssys_state *s = (ssys_state *)opaque;
@@ -602,16 +605,10 @@ static void ssys_write(void *opaque, target_phys_addr_t offset, uint32_t value)ssys_update (s); } -static CPUReadMemoryFunc *const ssys_readfn[] = { - ssys_read, - ssys_read, - ssys_read -}; - -static CPUWriteMemoryFunc *const ssys_writefn[] = { - ssys_write, - ssys_write, - ssys_write +static const MemoryRegionOps ssys_ops = { + .read = ssys_read, + .write = ssys_write, + .endianness =DEVICE_NATIVE_ENDIAN , };static void ssys_reset (void *opaque)
@@ -667,7 +664,6 @@ static int stellaris_sys_init(uint32_t base, qemu_irq irq, stellaris_board_info * board, uint8_t *macaddr) { -int iomemtype;ssys_state *s; s = (ssys_state *)g_malloc0 (sizeof (ssys_state));
@@ -677,10 +673,8 @@ static int stellaris_sys_init(uint32_t base, qemu_irq irq, s->user0 = macaddr[0 ] | (macaddr[1 ] <<8 ) | (macaddr[2 ] <<16 ); s->user1 = macaddr[3 ] | (macaddr[4 ] <<8 ) | (macaddr[5 ] <<16 ); - iomemtype =cpu_register_io_memory (ssys_readfn, - ssys_writefn, s, -DEVICE_NATIVE_ENDIAN ); -cpu_register_physical_memory (base,0x00001000 , iomemtype); +memory_region_init_io (&s->iomem, &ssys_ops, s,"ssys" ,0x00001000 ); +memory_region_add_subregion (get_system_memory (), base, &s->iomem);ssys_reset (s);vmstate_register (NULL ,-1 , &vmstate_stellaris_sys, s);return 0 ;
Signature · 1 line
1.7.5.4
PATCH 3/7 integratorcp: convert control to memory API
In reply to Benoît Canet--- hw/integratorcp.c | 31 ++++++++++++++----------------- 1 files changed, 14 insertions(+), 17 deletions(-)
hw/integratorcp.c +14 -17
@@ -392,7 +392,9 @@ static int icp_pic_init(SysBusDevice *dev) }/* CP control registers. */ -static uint32_t icp_control_read (void *opaque,target_phys_addr_t offset) + +static uint64_t icp_control_read (void *opaque,target_phys_addr_t offset, +unsigned size) {switch (offset >>2 ) {case 0 :/* CP_IDFIELD */
@@ -410,7 +412,7 @@ static uint32_t icp_control_read(void *opaque, target_phys_addr_t offset) }static void icp_control_write (void *opaque,target_phys_addr_t offset, -uint32_t value) +uint64_t value,unsigned size) {switch (offset >>2 ) {case 1 :/* CP_FLASHPROG */
@@ -422,26 +424,21 @@ static void icp_control_write(void *opaque, target_phys_addr_t offset,hw_error ("icp_control_write: Bad offset %x\n" , (int )offset); } } -static CPUReadMemoryFunc *const icp_control_readfn[] = { - icp_control_read, - icp_control_read, - icp_control_read -}; -static CPUWriteMemoryFunc *const icp_control_writefn[] = { - icp_control_write, - icp_control_write, - icp_control_write +static const MemoryRegionOps icp_control_ops = { + .read = icp_control_read, + .write = icp_control_write, + .endianness =DEVICE_NATIVE_ENDIAN , }; -static void icp_control_init (uint32_t base) +static void icp_control_init (target_phys_addr_t base) { -int iomemtype; +MemoryRegion *io; - iomemtype =cpu_register_io_memory (icp_control_readfn, - icp_control_writefn,NULL , -DEVICE_NATIVE_ENDIAN ); -cpu_register_physical_memory (base,0x00800000 , iomemtype); + io = (MemoryRegion *)g_malloc0 (sizeof (MemoryRegion)); +memory_region_init_io (io, &icp_control_ops,NULL , +"control" ,0x00800000 ); +memory_region_add_subregion (get_system_memory (), base, io);/* ??? Save/restore. */ }
Signature · 1 line
1.7.5.4
PATCH 5/7 stellaris: convert i2c to memory API
In reply to Benoît Canet--- hw/stellaris.c | 28 +++++++++++----------------- 1 files changed, 11 insertions(+), 17 deletions(-)
hw/stellaris.c +11 -17
@@ -687,6 +687,7 @@ typedef struct {SysBusDevice busdev;i2c_bus *bus;qemu_irq irq; +MemoryRegion iomem;uint32_t msa;uint32_t mcs;uint32_t mdr;
@@ -704,7 +705,8 @@ typedef struct {#define STELLARIS_I2C_MCS_IDLE 0x20#define STELLARIS_I2C_MCS_BUSBSY 0x40 -static uint32_t stellaris_i2c_read (void *opaque,target_phys_addr_t offset) +static uint64_t stellaris_i2c_read (void *opaque,target_phys_addr_t offset, +unsigned size) {stellaris_i2c_state *s = (stellaris_i2c_state *)opaque;
@@ -741,7 +743,7 @@ static void stellaris_i2c_update(stellaris_i2c_state *s) }static void stellaris_i2c_write (void *opaque,target_phys_addr_t offset, -uint32_t value) +uint64_t value,unsigned size) {stellaris_i2c_state *s = (stellaris_i2c_state *)opaque;
@@ -832,16 +834,10 @@ static void stellaris_i2c_reset(stellaris_i2c_state *s)stellaris_i2c_update (s); } -static CPUReadMemoryFunc *const stellaris_i2c_readfn[] = { - stellaris_i2c_read, - stellaris_i2c_read, - stellaris_i2c_read -}; - -static CPUWriteMemoryFunc *const stellaris_i2c_writefn[] = { - stellaris_i2c_write, - stellaris_i2c_write, - stellaris_i2c_write +static const MemoryRegionOps stellaris_i2c_ops = { + .read = stellaris_i2c_read, + .write = stellaris_i2c_write, + .endianness =DEVICE_NATIVE_ENDIAN , };static const VMStateDescription vmstate_stellaris_i2c = {
@@ -865,16 +861,14 @@ static int stellaris_i2c_init(SysBusDevice * dev) {stellaris_i2c_state *s =FROM_SYSBUS (stellaris_i2c_state, dev);i2c_bus *bus; -int iomemtype;sysbus_init_irq (dev, &s->irq); bus =i2c_init_bus (&dev->qdev,"i2c" ); s->bus = bus; - iomemtype =cpu_register_io_memory (stellaris_i2c_readfn, - stellaris_i2c_writefn, s, -DEVICE_NATIVE_ENDIAN ); -sysbus_init_mmio (dev,0x1000 , iomemtype); +memory_region_init_io (&s->iomem, &stellaris_i2c_ops, s, +"i2c" ,0x1000 ); +sysbus_init_mmio_region (dev, &s->iomem);/* ??? For now we only implement the master interface. */ stellaris_i2c_reset (s);vmstate_register (&dev->qdev,-1 , &vmstate_stellaris_i2c, s);
Signature · 1 line
1.7.5.4
PATCH 6/7 stellaris: convert adc to memory API
In reply to Benoît Canet--- hw/stellaris.c | 30 ++++++++++++------------------ 1 files changed, 12 insertions(+), 18 deletions(-)
hw/stellaris.c +12 -18
@@ -892,6 +892,7 @@ static int stellaris_i2c_init(SysBusDevice * dev) typedef struct { SysBusDevice busdev; + MemoryRegion iomem; uint32_t actss; uint32_t ris; uint32_t im;
@@ -992,7 +993,8 @@ static void stellaris_adc_reset(stellaris_adc_state *s) } } -static uint32_t stellaris_adc_read (void *opaque,target_phys_addr_t offset) +static uint64_t stellaris_adc_read (void *opaque,target_phys_addr_t offset, +unsigned size) {stellaris_adc_state *s = (stellaris_adc_state *)opaque;
@@ -1040,7 +1042,7 @@ static uint32_t stellaris_adc_read(void *opaque, target_phys_addr_t offset) }static void stellaris_adc_write (void *opaque,target_phys_addr_t offset, -uint32_t value) +uint64_t value,unsigned size) {stellaris_adc_state *s = (stellaris_adc_state *)opaque;
@@ -1054,7 +1056,7 @@ static void stellaris_adc_write(void *opaque, target_phys_addr_t offset,return ;case 0x04 :/* SSCTL */ if (value !=6 ) { -hw_error ("ADC: Unimplemented sequence %x\n" , +hw_error ("ADC: Unimplemented sequence %" PRIx64"\n" , value); } s->ssctl[n] = value;
@@ -1097,16 +1099,10 @@ static void stellaris_adc_write(void *opaque, target_phys_addr_t offset,stellaris_adc_update (s); } -static CPUReadMemoryFunc *const stellaris_adc_readfn[] = { - stellaris_adc_read, - stellaris_adc_read, - stellaris_adc_read -}; - -static CPUWriteMemoryFunc *const stellaris_adc_writefn[] = { - stellaris_adc_write, - stellaris_adc_write, - stellaris_adc_write +static const MemoryRegionOps stellaris_adc_ops = { + .read = stellaris_adc_read, + .write = stellaris_adc_write, + .endianness =DEVICE_NATIVE_ENDIAN , };static const VMStateDescription vmstate_stellaris_adc = {
@@ -1147,17 +1143,15 @@ static const VMStateDescription vmstate_stellaris_adc = {static int stellaris_adc_init (SysBusDevice *dev) {stellaris_adc_state *s =FROM_SYSBUS (stellaris_adc_state, dev); -int iomemtype;int n;for (n =0 ; n <4 ; n++) {sysbus_init_irq (dev, &s->irq[n]); } - iomemtype =cpu_register_io_memory (stellaris_adc_readfn, - stellaris_adc_writefn, s, -DEVICE_NATIVE_ENDIAN ); -sysbus_init_mmio (dev,0x1000 , iomemtype); +memory_region_init_io (&s->iomem, &stellaris_adc_ops, s, +"adc" ,0x1000 ); +sysbus_init_mmio_region (dev, &s->iomem);stellaris_adc_reset (s);qdev_init_gpio_in (&dev->qdev, stellaris_adc_trigger,1 );vmstate_register (&dev->qdev,-1 , &vmstate_stellaris_adc, s);
Signature · 1 line
1.7.5.4
PATCH 7/7 stellaris: convert gptm to memory API
In reply to Benoît Canet--- hw/stellaris.c | 29 ++++++++++++----------------- 1 files changed, 12 insertions(+), 17 deletions(-)
hw/stellaris.c +12 -17
@@ -45,6 +45,7 @@ typedef const struct { typedef struct gptm_state { SysBusDevice busdev; + MemoryRegion iomem; uint32_t config; uint32_t mode[2]; uint32_t control;
@@ -140,7 +141,8 @@ static void gptm_tick(void *opaque)gptm_update_irq (s); } -static uint32_t gptm_read (void *opaque,target_phys_addr_t offset) +static uint64_t gptm_read (void *opaque,target_phys_addr_t offset, +unsigned size) {gptm_state *s = (gptm_state *)opaque;
@@ -188,7 +190,8 @@ static uint32_t gptm_read(void *opaque, target_phys_addr_t offset) } } -static void gptm_write (void *opaque,target_phys_addr_t offset,uint32_t value) +static void gptm_write (void *opaque,target_phys_addr_t offset, +uint64_t value,unsigned size) {gptm_state *s = (gptm_state *)opaque;uint32_t oldval;
@@ -268,16 +271,10 @@ static void gptm_write(void *opaque, target_phys_addr_t offset, uint32_t value)gptm_update_irq (s); } -static CPUReadMemoryFunc *const gptm_readfn[] = { - gptm_read, - gptm_read, - gptm_read -}; - -static CPUWriteMemoryFunc *const gptm_writefn[] = { - gptm_write, - gptm_write, - gptm_write +static const MemoryRegionOps gptm_ops = { + .read = gptm_read, + .write = gptm_write, + .endianness =DEVICE_NATIVE_ENDIAN , };static const VMStateDescription vmstate_stellaris_gptm = {
@@ -305,16 +302,14 @@ static const VMStateDescription vmstate_stellaris_gptm = {static int stellaris_gptm_init (SysBusDevice *dev) { -int iomemtype;gptm_state *s =FROM_SYSBUS (gptm_state, dev);sysbus_init_irq (dev, &s->irq);qdev_init_gpio_out (&dev->qdev, &s->trigger,1 ); - iomemtype =cpu_register_io_memory (gptm_readfn, - gptm_writefn, s, -DEVICE_NATIVE_ENDIAN ); -sysbus_init_mmio (dev,0x1000 , iomemtype); +memory_region_init_io (&s->iomem, &gptm_ops, s, +"gptm" ,0x1000 ); +sysbus_init_mmio_region (dev, &s->iomem); s->opaque[0 ] = s->opaque[1 ] = s; s->timer[0 ] =qemu_new_timer_ns (vm_clock, gptm_tick, &s->opaque[0 ]);
Signature · 1 line
1.7.5.4
Re: [Qemu-devel] [PATCH 6/7] stellaris: convert adc to memory API
In reply to Benoît Canet2011/10/17 Benoît Canet <[email protected]>:
Quoted 4 lines
Signed-off-by Benoit Canet <[email protected]>---
hw/stellaris.c | 30 ++++++++++++------------------1 files changed, 12 insertions(+), 18 deletions(-)
Re: [Qemu-devel] [PATCH 4/7] stellaris: convert sys to memory API
In reply to Benoît Canet2011/10/17 Benoît Canet <[email protected]>:
Quoted 4 lines
Signed-off-by Benoit Canet <[email protected]>---
hw/stellaris.c | 28 +++++++++++-----------------1 files changed, 11 insertions(+), 17 deletions(-)
Re: [Qemu-devel] [PATCH 2/7] integratorcp: convert icp pic to memory API
In reply to Benoît Canet2011/10/17 Benoît Canet <[email protected]>:
Quoted 4 lines
Signed-off-by Benoit Canet <[email protected]>---
hw/integratorcp.c | 27 ++++++++++-----------------1 files changed, 10 insertions(+), 17 deletions(-)
Re: [Qemu-devel] [PATCH 3/7] integratorcp: convert control to memory API
In reply to Benoît Canet2011/10/17 Benoît Canet <[email protected]>:
Quoted 6 lines
hw/integratorcp.c +1
-1-static void icp_control_init (uint32_t base) +static void icp_control_init (target_phys_addr_t base){
- int iomemtype;
+ MemoryRegion *io;
Quoted 10 lines
- iomemtype = cpu_register_io_memory(icp_control_readfn,
-icp_control_writefn, NULL,
-DEVICE_NATIVE_ENDIAN);
- cpu_register_physical_memory(base,0x00800000, iomemtype);
+ io = (MemoryRegion *)g_malloc0(sizeof(MemoryRegion));
+ memory_region_init_io(io,&icp_control_ops, NULL,
+ "control",0x00800000);
+ memory_region_add_subregion(get_system_memory(), base, io); /* ??? Save/restore. */
}
I didn't spot this the first time round, but this is wrong. We shouldn't be g_malloc0()ing the MemoryRegion -- it should be an element in some suitable device struct.
I think the right thing to do here is probably first to do the (fairly trivial) conversion of the icp_control code to be a sysbus device, then do the memory region conversion on top of that.
-- PMM
Re: [Qemu-devel] [PATCH 3/7] integratorcp: convert control to memory API
Quoted 22 lines · Peter Maydell
2011/10/17 Benoît Canet <[email protected]>:
Quoted 6 lines
hw/integratorcp.c +2
-2-static void icp_control_init (uint32_t base) +static void icp_control_init (target_phys_addr_t base) { -int iomemtype; +MemoryRegion *io;hw/integratorcp.c static void icp_control_write(void *opaque, target_phys_addr_t offset, · line 443
Quoted 10 lines
hw/integratorcp.c +4
-4- iomemtype =cpu_register_io_memory (icp_control_readfn, - icp_control_writefn,NULL , -DEVICE_NATIVE_ENDIAN ); -cpu_register_physical_memory (base,0x00800000 , iomemtype); + io = (MemoryRegion *)g_malloc0 (sizeof (MemoryRegion)); +memory_region_init_io (io, &icp_control_ops,NULL , +"control" ,0x00800000 ); +memory_region_add_subregion (get_system_memory (), base, io);/* ??? Save/restore. */ }I didn't spot this the first time round, but this is wrong. We shouldn't be g_malloc0()ing the MemoryRegion -- it should be an element in some suitable device struct.
Quoted 3 lines
I think the right thing to do here is probably first to do the (fairly trivial) conversion of the
icp_controlcode to be a sysbus device, then do the memory region conversion on top of that.
It's not any less wrong than the original code, which also leaked memory. I'll merge it and let any further conversion take place on top.
(though g_malloc0() is better replaced by g_new()).
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [Qemu-devel] [PATCH 3/7] integratorcp: convert control to memory API
Quoted 10 lines · Avi Kivity
Quoted 7 lines
I didn't spot this the first time round, but this is wrong. We shouldn't be g_malloc0()ing the MemoryRegion -- it should be an element in some suitable device struct.
I think the right thing to do here is probably first to do the (fairly trivial) conversion of the
icp_controlcode to be a sysbus device, then do the memory region conversion on top of that.It's not any less wrong than the original code, which also leaked memory. I'll merge it and let any further conversion take place on top.
I meant, it's not any more wrong than the original code, though my original statement is also correct.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [Qemu-devel] [PATCH 3/7] integratorcp: convert control to memory API
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Avi Kivity
Quoted 7 lines
I didn't spot this the first time round, but this is wrong. We shouldn't be g_malloc0()ing the MemoryRegion -- it should be an element in some suitable device struct.
I think the right thing to do here is probably first to do the (fairly trivial) conversion of the
icp_controlcode to be a sysbus device, then do the memory region conversion on top of that.
Quoted 5 lines
Quoted 2 lines
It's not any less wrong than the original code, which also leaked memory. I'll merge it and let any further conversion take place on top.
I meant, it's not any more wrong than the original code, though my original statement is also correct.
Either way, if you're happy to take it into your tree that's fine with me :-)
-- PMM
Avi Kivity
AppliedQuoted 6 lines · Benoît Canet
Theses patches finish to convert
integratorcp.candstellaris.cto the new memory API.They apply on
git://github.com/avikivity/qemu.gitmemory/master.
Thanks, applied to memory/queue.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.