qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sun4u: add power_mem_read routine


From: Mark Cave-Ayland
Subject: Re: [Qemu-devel] [PATCH] sun4u: add power_mem_read routine
Date: Thu, 3 Jan 2019 12:33:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 03/01/2019 09:37, P J P wrote:

> From: Prasad J Pandit <address@hidden>
> 
> Define skeleton 'power_mem_read' routine. Avoid NULL dereference.
> 
> Reported-by: Fakhri Zulkifli <address@hidden>
> Signed-off-by: Prasad J Pandit <address@hidden>
> ---
>  hw/sparc64/sun4u.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index f76b19e4e9..cbdb2bb411 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -214,6 +214,11 @@ typedef struct PowerDevice {
>  } PowerDevice;
>  
>  /* Power */
> +static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size)
> +{
> +    return 0xffffffff;
> +}
> +
>  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 = {

Certainly the addition of the missing read function is valid, although I see 
that
you've defaulted reads to returning 0xffffffff - can you point me towards the 
source
that indicates that this behaviour matches that of real Ultra-5 hardware?


ATB,

Mark.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]