qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 03/34] exec: Avoid direct references to Int12


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH v3 03/34] exec: Avoid direct references to Int128 parts
Date: Fri, 09 Sep 2016 18:14:38 +0100
User-agent: mu4e 0.9.17; emacs 25.1.12

Richard Henderson <address@hidden> writes:

> Signed-off-by: Richard Henderson <address@hidden>

Reviewed-by: Alex Bennée <address@hidden>

> ---
>  exec.c                |  4 ++--
>  include/qemu/int128.h | 10 ++++++++++
>  2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 8ffde75..373313d 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -320,9 +320,9 @@ static inline bool section_covers_addr(const 
> MemoryRegionSection *section,
>      /* Memory topology clips a memory region to [0, 2^64); size.hi > 0 means
>       * the section must cover the entire address space.
>       */
> -    return section->size.hi ||
> +    return int128_gethi(section->size) ||
>             range_covers_byte(section->offset_within_address_space,
> -                             section->size.lo, addr);
> +                             int128_getlo(section->size), addr);
>  }
>
>  static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr addr,
> diff --git a/include/qemu/int128.h b/include/qemu/int128.h
> index c598881..52aaf99 100644
> --- a/include/qemu/int128.h
> +++ b/include/qemu/int128.h
> @@ -20,6 +20,16 @@ static inline uint64_t int128_get64(Int128 a)
>      return a.lo;
>  }
>
> +static inline uint64_t int128_getlo(Int128 a)
> +{
> +    return a.lo;
> +}
> +
> +static inline int64_t int128_gethi(Int128 a)
> +{
> +    return a.hi;
> +}
> +
>  static inline Int128 int128_zero(void)
>  {
>      return int128_make64(0);


--
Alex Bennée



reply via email to

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