qemu-ppc
[Top][All Lists]
Advanced

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

[PATCH 1/4] target/ppc: Include missing headers in mmu-hash[32,64].h


From: Philippe Mathieu-Daudé
Subject: [PATCH 1/4] target/ppc: Include missing headers in mmu-hash[32,64].h
Date: Wed, 18 Dec 2024 16:51:59 +0100

CPUState* is dereferenced, so we need the structure definition
from "cpu.h". PowerPCCPU is declared in "cpu-qom.h". Include
them in order to avoid when refactoring:

  In file included from ../../target/ppc/cpu_init.c:27:
  target/ppc/mmu-hash32.h:6:23: error: unknown type name 'PowerPCCPU'
      6 | bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType 
access_type,
        |                       ^
  target/ppc/mmu-hash32.h:66:15: error: incomplete definition of type 'struct 
ArchCPU'
     66 |     return cpu->env.spr[SPR_SDR1] & SDR_32_HTABORG;
        |            ~~~^
  target/ppc/mmu-hash64.h:173:36: error: unknown type name ‘PowerPCCPU’; did 
you mean ‘PowerPCCPUAlias’?
    173 | static inline void ppc_hash64_init(PowerPCCPU *cpu)
        |                                    ^~~~~~~~~~
        |                                    PowerPCCPUAlias

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/ppc/mmu-hash32.h | 3 +++
 target/ppc/mmu-hash64.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/target/ppc/mmu-hash32.h b/target/ppc/mmu-hash32.h
index 2838de031c7..abbff206d4e 100644
--- a/target/ppc/mmu-hash32.h
+++ b/target/ppc/mmu-hash32.h
@@ -3,6 +3,9 @@
 
 #ifndef CONFIG_USER_ONLY
 
+#include "target/ppc/cpu-qom.h"
+#include "cpu.h"
+
 bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
                       hwaddr *raddrp, int *psizep, int *protp, int mmu_idx,
                       bool guest_visible);
diff --git a/target/ppc/mmu-hash64.h b/target/ppc/mmu-hash64.h
index ae8d4b37aed..b32e17c2c58 100644
--- a/target/ppc/mmu-hash64.h
+++ b/target/ppc/mmu-hash64.h
@@ -3,6 +3,8 @@
 
 #ifndef CONFIG_USER_ONLY
 
+#include "target/ppc/cpu-qom.h"
+
 #ifdef TARGET_PPC64
 void dump_slb(PowerPCCPU *cpu);
 int ppc_store_slb(PowerPCCPU *cpu, target_ulong slot,
-- 
2.45.2




reply via email to

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