Received: from eggs.gnu.org ([2001:4830:134:3::10]:40980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxFA-0005vj-6f for qemu-devel@nongnu.org; Fri, 16 Sep 2016 13:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkxF6-0007M4-2V for qemu-devel@nongnu.org; Fri, 16 Sep 2016 13:48:07 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxF5-0007Lp-Te for qemu-devel@nongnu.org; Fri, 16 Sep 2016 13:48:04 -0400 Received: by mail-pf0-f194.google.com with SMTP id q2so1220802pfj.0 for ; Fri, 16 Sep 2016 10:48:03 -0700 (PDT) Received: from anchor.twiddle.net (174-24-157-40.tukw.qwest.net. [174.24.157.40]) by smtp.gmail.com with ESMTPSA id e71sm27910078pfc.75.2016.09.16.10.47.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Sep 2016 10:47:02 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Fri, 16 Sep 2016 10:46:25 -0700 Message-Id: <1474048017-26696-4-git-send-email-rth@twiddle.net> In-Reply-To: <1474048017-26696-1-git-send-email-rth@twiddle.net> References: <1474048017-26696-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH v4 03/35] exec: Avoid direct references to Int128 parts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Richard Henderson --- exec.c | 4 ++-- include/qemu/int128.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index c8389f9..cc2997e 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); -- 2.5.5