Received: from eggs.gnu.org ([2001:4830:134:3::10]:34952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuNFp-0002Oh-IQ for qemu-devel@nongnu.org; Thu, 05 Nov 2015 11:19:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuNFl-0001bL-8o for qemu-devel@nongnu.org; Thu, 05 Nov 2015 11:19:13 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:48390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuNFk-0001bD-V2 for qemu-devel@nongnu.org; Thu, 05 Nov 2015 11:19:09 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Nov 2015 16:19:06 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 57EEC17D8042 for ; Thu, 5 Nov 2015 16:19:19 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tA5GJ3127012638 for ; Thu, 5 Nov 2015 16:19:03 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tA5GJ2jU021353 for ; Thu, 5 Nov 2015 09:19:03 -0700 From: Pierre Morel Date: Thu, 5 Nov 2015 17:18:59 +0100 Message-Id: <1446740339-31366-8-git-send-email-pmorel@linux.vnet.ibm.com> In-Reply-To: <1446740339-31366-1-git-send-email-pmorel@linux.vnet.ibm.com> References: <1446740339-31366-1-git-send-email-pmorel@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 7/7] 128bits: some HW components use 128bit arithmetic. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, pbonzini@redhat.com, pmorel@linux.vnet.ibm.com, peter.maydell@linaro.org Some HW components use 128bit arithmetic. Let's adapt to unsigned 128 bit calculations. Signed-off-by: Pierre Morel --- hw/core/loader.c | 2 +- hw/display/exynos4210_fimd.c | 4 ++-- hw/display/framebuffer.c | 2 +- hw/mem/pc-dimm.c | 6 +++--- hw/pci-host/ppce500.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 216eeeb..97c7b54 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -953,7 +953,7 @@ int rom_check_and_register_reset(void) addr = rom->addr; addr += rom->romsize; section = memory_region_find(get_system_memory(), rom->addr, 1); - rom->isrom = int128_nz(section.size) && memory_region_is_rom(section.mr); + rom->isrom = uint128_nz(section.size) && memory_region_is_rom(section.mr); memory_region_unref(section.mr); } qemu_register_reset(rom_reset, NULL); diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 603ef50..dbedb45 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -1154,7 +1154,7 @@ static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win) DPRINT_TRACE("Window %u framebuffer changed: address=0x%08x, len=0x%x\n", win, fb_start_addr, w->fb_len); - if (int128_get64(w->mem_section.size) != w->fb_len || + if (uint128_to_64(w->mem_section.size) != w->fb_len || !memory_region_is_ram(w->mem_section.mr)) { DPRINT_ERROR("Failed to find window %u framebuffer region\n", win); goto error_return; @@ -1179,7 +1179,7 @@ static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win) error_return: memory_region_unref(w->mem_section.mr); w->mem_section.mr = NULL; - w->mem_section.size = int128_zero(); + w->mem_section.size = uint128_zero(); w->host_fb_addr = NULL; w->fb_len = 0; } diff --git a/hw/display/framebuffer.c b/hw/display/framebuffer.c index 7f075ce..19e3d39 100644 --- a/hw/display/framebuffer.c +++ b/hw/display/framebuffer.c @@ -41,7 +41,7 @@ void framebuffer_update_memory_section( return; } - if (int128_get64(mem_section->size) < src_len || + if (uint128_to_64(mem_section->size) < src_len || !memory_region_is_ram(mem_section->mr)) { memory_region_unref(mem_section->mr); mem_section->mr = NULL; diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index bb04862..0be2a18 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -260,11 +260,11 @@ static gint pc_dimm_addr_sort(gconstpointer a, gconstpointer b) { PCDIMMDevice *x = PC_DIMM(a); PCDIMMDevice *y = PC_DIMM(b); - Int128 diff = int128_sub(int128_make64(x->addr), int128_make64(y->addr)); + UInt128 diff = uint128_sub(uint128_from_64(x->addr), uint128_from_64(y->addr)); - if (int128_lt(diff, int128_zero())) { + if (uint128_lt(diff, uint128_zero())) { return -1; - } else if (int128_gt(diff, int128_zero())) { + } else if (uint128_gt(diff, uint128_zero())) { return 1; } return 0; diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 613ba73..9002c51 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -428,7 +428,7 @@ static void e500_pcihost_bridge_realize(PCIDevice *d, Error **errp) PCI_HEADER_TYPE_BRIDGE; memory_region_init_alias(&b->bar0, OBJECT(ccsr), "e500-pci-bar0", &ccsr->ccsr_space, - 0, int128_get64(ccsr->ccsr_space.size)); + 0, uint128_to_64(ccsr->ccsr_space.size)); pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &b->bar0); } -- 1.7.1