@samitouri / QOSamiQemu / commits / 6b6081b1ee

target/ppc/mmu: Restrict hash32_load_hpte() helpers scope

hash32_load_hpte() helpers are only used within mmu-hash32.c, no need to have each file including "mmu-hash32.h" to compile them. Move their definition to this source file. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Message-Id: <20260319111936.68041-5-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 18, 2026 at 14:42 UTC 6b6081b1eee8844b7ea9835d4477ed052719aec5
2 files changed +14 -16
target/ppc/mmu-hash32.c
+14
@@ -201,6 +201,20 @@ static bool ppc_hash32_direct_store(PowerPCCPU *cpu, target_ulong sr,
201 return false;
202 }
203
204 +static target_ulong ppc_hash32_load_hpte0(PowerPCCPU *cpu, hwaddr pte_offset)
205 +{
206 + target_ulong base = ppc_hash32_hpt_base(cpu);
207 +
208 + return ldl_phys(CPU(cpu)->as, base + pte_offset);
209 +}
210 +
211 +static target_ulong ppc_hash32_load_hpte1(PowerPCCPU *cpu, hwaddr pte_offset)
212 +{
213 + target_ulong base = ppc_hash32_hpt_base(cpu);
214 +
215 + return ldl_phys(CPU(cpu)->as, base + pte_offset + HASH_PTE_SIZE_32 / 2);
216 +}
217 +
218 static hwaddr ppc_hash32_pteg_search(PowerPCCPU *cpu, hwaddr pteg_off,
219 bool secondary, target_ulong ptem,
220 ppc_hash_pte32_t *pte)
target/ppc/mmu-hash32.h
-16
@@ -71,22 +71,6 @@ static inline hwaddr ppc_hash32_hpt_mask(PowerPCCPU *cpu)
71 return ((cpu->env.spr[SPR_SDR1] & SDR_32_HTABMASK) << 16) | 0xFFFF;
72 }
73
74 -static inline target_ulong ppc_hash32_load_hpte0(PowerPCCPU *cpu,
75 - hwaddr pte_offset)
76 -{
77 - target_ulong base = ppc_hash32_hpt_base(cpu);
78 -
79 - return ldl_phys(CPU(cpu)->as, base + pte_offset);
80 -}
81 -
82 -static inline target_ulong ppc_hash32_load_hpte1(PowerPCCPU *cpu,
83 - hwaddr pte_offset)
84 -{
85 - target_ulong base = ppc_hash32_hpt_base(cpu);
86 -
87 - return ldl_phys(CPU(cpu)->as, base + pte_offset + HASH_PTE_SIZE_32 / 2);
88 -}
89 -
74 static inline hwaddr get_pteg_offset32(PowerPCCPU *cpu, hwaddr hash)
75 {
76 return (hash * HASH_PTEG_SIZE_32) & ppc_hash32_hpt_mask(cpu);