Message ID | 20180912160118.21158-8-liq3ea@163.com |
---|---|
State | New |
Headers | show |
Series | Add missed read callback for some memory region | expand |
Please correct the typo in the subject. I was scared that someone dug out the sun4c zombie emulation. In the particular case of sun4u, I think the proper way is not to have the read callback, but throw an 'Unassigned memory access' exception Regards, Artyom On Wed, Sep 12, 2018 at 6:09 PM Li Qiang <liq3ea@163.com> wrote: > > From: Li Qiang <liq3ea@gmail.com> > > Signed-off-by: Li Qiang <liq3ea@gmail.com> > --- > hw/sparc64/sun4u.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c > index d16843b30e..74c55a82f4 100644 > --- a/hw/sparc64/sun4u.c > +++ b/hw/sparc64/sun4u.c > @@ -212,6 +212,11 @@ typedef struct PowerDevice { > MemoryRegion power_mmio; > } PowerDevice; > > +static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) > +{ > + return 0; > +} > + > /* Power */ > static void power_mem_write(void *opaque, hwaddr addr, > uint64_t val, unsigned size) > @@ -223,6 +228,7 @@ static void power_mem_write(void *opaque, hwaddr addr, > } > > static const MemoryRegionOps power_mem_ops = { > + .read = power_mem_read, > .write = power_mem_write, > .endianness = DEVICE_NATIVE_ENDIAN, > .valid = { > -- > 2.17.1 > > >
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index d16843b30e..74c55a82f4 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -212,6 +212,11 @@ typedef struct PowerDevice { MemoryRegion power_mmio; } PowerDevice; +static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0; +} + /* Power */ static void power_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) @@ -223,6 +228,7 @@ static void power_mem_write(void *opaque, hwaddr addr, } static const MemoryRegionOps power_mem_ops = { + .read = power_mem_read, .write = power_mem_write, .endianness = DEVICE_NATIVE_ENDIAN, .valid = {