sun4u: add power_mem_read routine
PATCH 1/1 sun4u: add power_mem_read routine
From: Prasad J Pandit <[email protected]>
Define skeleton 'power_mem_read' routine. Avoid NULL dereference.
Reported-by Fakhri Zulkifli <[email protected]>
Signed-off-by Prasad J Pandit <[email protected]>
--- hw/sparc64/sun4u.c | 6 ++++++ 1 file changed, 6 insertions(+)
Update v1: change return value to zero(0)
-> https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00448.html
hw/sparc64/sun4u.c +6 -0
@@ -214,6 +214,11 @@ typedef struct PowerDevice { } PowerDevice;/* Power */ +static uint64_t power_mem_read (void *opaque,hwaddr addr,unsigned size) +{ +return 0 ; +} +static void power_mem_write (void *opaque,hwaddr addr,uint64_t val,unsigned size) {
@@ -224,6 +229,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 = {
Signature · 1 line
2.20.1