[PATCH 5/7] target/alpha: Do not use target_ulong for page table entries / indexes

Philippe Mathieu-Daudé posted 7 patches 6 days, 16 hours ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>
[PATCH 5/7] target/alpha: Do not use target_ulong for page table entries / indexes
Posted by Philippe Mathieu-Daudé 6 days, 16 hours ago
%L[123]pte are loaded calling ldq_le_phys() which returns
a uint64_t. %pt is loaded with @ptbr, declared as uint64_t
in target/alpha/cpu.h:

  236    uint64_t ptbr;

%index is at most 1024 so can fit in uint16_t.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/alpha/helper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 2dc52cc4465..d6200d101cc 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -173,8 +173,9 @@ static int get_physical_address(CPUAlphaState *env, target_ulong addr,
     CPUState *cs = env_cpu(env);
     target_long saddr = addr;
     target_ulong phys = 0;
-    target_ulong L1pte, L2pte, L3pte;
-    target_ulong pt, index;
+    uint64_t L1pte, L2pte, L3pte;
+    uint64_t pt;
+    uint16_t index;
     int prot = 0;
     int ret = MM_K_ACV;
     MemTxResult txres;
-- 
2.52.0