qemu-devel
[Top][All Lists]
Advanced

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

[PATCH-for-9.0? 15/21] target/sparc: Fix string format errors when DEBUG


From: Philippe Mathieu-Daudé
Subject: [PATCH-for-9.0? 15/21] target/sparc: Fix string format errors when DEBUG_MMU is defined
Date: Thu, 21 Mar 2024 16:48:31 +0100

Fix when building with DEBUG_MMU:

  target/sparc/ldst_helper.c:245:72: error: format specifies type 'unsigned 
long' but the argument has type 'uint64_t' (aka 'unsigned long long') 
[-Werror,-Wformat]
                    DPRINTF_MMU("auto demap entry [%d] %lx->%lx\n", i, vaddr,
                                                       ~~~             ^~~~~
                                                       %llx
  target/sparc/ldst_helper.c:1736:60: error: no member named 'immuregs' in 
'struct CPUArchState'
                              PRIx64 "\n", reg, oldreg, env->immuregs[reg]);
                                                        ~~~  ^
  target/sparc/ldst_helper.c:1820:60: error: no member named 'dmmuregs' in 
'struct CPUArchState'
                              PRIx64 "\n", reg, oldreg, env->dmmuregs[reg]);
                                                        ~~~  ^

Fixes: 96df2bc99f ("target-sparc: use SparcV9MMU type for sparc64 I/D-MMUs")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/sparc/ldst_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
index e581bb42ac..064390d1d4 100644
--- a/target/sparc/ldst_helper.c
+++ b/target/sparc/ldst_helper.c
@@ -242,8 +242,8 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb,
                 if (new_vaddr == vaddr
                     || (new_vaddr < vaddr + size
                         && vaddr < new_vaddr + new_size)) {
-                    DPRINTF_MMU("auto demap entry [%d] %lx->%lx\n", i, vaddr,
-                                new_vaddr);
+                    DPRINTF_MMU("auto demap entry [%d] %"PRIx64"->%"PRIx64"\n",
+                                i, vaddr, new_vaddr);
                     replace_tlb_entry(&tlb[i], tlb_tag, tlb_tte, env1);
                     return;
                 }
@@ -1733,7 +1733,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, 
target_ulong val,
 
             if (oldreg != env->immu.mmuregs[reg]) {
                 DPRINTF_MMU("immu change reg[%d]: 0x%016" PRIx64 " -> 0x%016"
-                            PRIx64 "\n", reg, oldreg, env->immuregs[reg]);
+                            PRIx64 "\n", reg, oldreg, env->immu.mmuregs[reg]);
             }
 #ifdef DEBUG_MMU
             dump_mmu(env);
@@ -1817,7 +1817,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, 
target_ulong val,
 
             if (oldreg != env->dmmu.mmuregs[reg]) {
                 DPRINTF_MMU("dmmu change reg[%d]: 0x%016" PRIx64 " -> 0x%016"
-                            PRIx64 "\n", reg, oldreg, env->dmmuregs[reg]);
+                            PRIx64 "\n", reg, oldreg, env->dmmu.mmuregs[reg]);
             }
 #ifdef DEBUG_MMU
             dump_mmu(env);
-- 
2.41.0




reply via email to

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