]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/riscv: Replace target_ulong uses
authorAnton Johansson <anjo@rev.ng>
Mon, 27 Oct 2025 12:35:11 +0000 (13:35 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 30 Oct 2025 13:48:26 +0000 (14:48 +0100)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20251027-feature-single-binary-hw-v1-v2-2-44478d589ae9@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/riscv/riscv-iommu.c
hw/riscv/riscv_hart.c

index b33c7fe3259efc07eb10fb19d704426171ba1c47..f8656ec04b1bdff749131ae8f50a28f38f60fe6f 100644 (file)
@@ -26,6 +26,8 @@
 #include "migration/vmstate.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
+#include "qemu/target-info.h"
+#include "qemu/bitops.h"
 
 #include "cpu_bits.h"
 #include "riscv-iommu.h"
@@ -391,9 +393,9 @@ static int riscv_iommu_spa_fetch(RISCVIOMMUState *s, RISCVIOMMUContext *ctx,
             const uint64_t va_mask = (1ULL << va_len) - 1;
 
             if (pass == S_STAGE && va_len > 32) {
-                target_ulong mask, masked_msbs;
+                uint64_t mask, masked_msbs;
 
-                mask = (1L << (TARGET_LONG_BITS - (va_len - 1))) - 1;
+                mask = MAKE_64BIT_MASK(0, target_long_bits() - va_len + 1);
                 masked_msbs = (addr >> (va_len - 1)) & mask;
 
                 if (masked_msbs != 0 && masked_msbs != mask) {
index 4d51a93dd528d9e5497a5ad3098dc66c722139ab..33cbc9873e69df3a68c31267c6bf3456328cda69 100644 (file)
@@ -94,7 +94,7 @@ static bool csr_qtest_callback(CharFrontend *chr, gchar **words)
         g_assert(rc == 0);
         csr_call(words[1], cpu, csr, &val);
 
-        qtest_sendf(chr, "OK 0 "TARGET_FMT_lx"\n", (target_ulong)val);
+        qtest_sendf(chr, "OK 0 %"PRIx64"\n", val);
 
         return true;
     }