qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 7/7] 128bits: some HW components use 128bit arithmet


From: Pierre Morel
Subject: [Qemu-devel] [PATCH 7/7] 128bits: some HW components use 128bit arithmetic.
Date: Thu, 5 Nov 2015 17:18:59 +0100

Some HW components use 128bit arithmetic.
Let's adapt to unsigned 128 bit calculations.

Signed-off-by: Pierre Morel <address@hidden>
---
 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




reply via email to

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