[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 93/96] target/ppc/mmu-hash32.c: Move get_pteg_offset32() to the he
From: |
Nicholas Piggin |
Subject: |
[PULL 93/96] target/ppc/mmu-hash32.c: Move get_pteg_offset32() to the header |
Date: |
Fri, 26 Jul 2024 09:54:06 +1000 |
From: BALATON Zoltan <balaton@eik.bme.hu>
This function is a simple shared function, move it to other similar
static inline functions in the header.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/mmu-hash32.c | 7 -------
target/ppc/mmu-hash32.h | 6 +++++-
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/target/ppc/mmu-hash32.c b/target/ppc/mmu-hash32.c
index c4de1647e2..44b16142ab 100644
--- a/target/ppc/mmu-hash32.c
+++ b/target/ppc/mmu-hash32.c
@@ -201,13 +201,6 @@ static bool ppc_hash32_direct_store(PowerPCCPU *cpu,
target_ulong sr,
return false;
}
-hwaddr get_pteg_offset32(PowerPCCPU *cpu, hwaddr hash)
-{
- target_ulong mask = ppc_hash32_hpt_mask(cpu);
-
- return (hash * HASH_PTEG_SIZE_32) & mask;
-}
-
static hwaddr ppc_hash32_pteg_search(PowerPCCPU *cpu, hwaddr pteg_off,
bool secondary, target_ulong ptem,
ppc_hash_pte32_t *pte)
diff --git a/target/ppc/mmu-hash32.h b/target/ppc/mmu-hash32.h
index bd75f7d647..2838de031c 100644
--- a/target/ppc/mmu-hash32.h
+++ b/target/ppc/mmu-hash32.h
@@ -3,7 +3,6 @@
#ifndef CONFIG_USER_ONLY
-hwaddr get_pteg_offset32(PowerPCCPU *cpu, hwaddr hash);
bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
hwaddr *raddrp, int *psizep, int *protp, int mmu_idx,
bool guest_visible);
@@ -102,6 +101,11 @@ static inline void ppc_hash32_store_hpte1(PowerPCCPU *cpu,
stl_phys(CPU(cpu)->as, base + pte_offset + HASH_PTE_SIZE_32 / 2, pte1);
}
+static inline hwaddr get_pteg_offset32(PowerPCCPU *cpu, hwaddr hash)
+{
+ return (hash * HASH_PTEG_SIZE_32) & ppc_hash32_hpt_mask(cpu);
+}
+
static inline bool ppc_hash32_key(bool pr, target_ulong sr)
{
return pr ? (sr & SR32_KP) : (sr & SR32_KS);
--
2.45.2
- [PULL 83/96] target/ppc/mmu-hash32.c: Inline and remove ppc_hash32_pte_prot(), (continued)
- [PULL 83/96] target/ppc/mmu-hash32.c: Inline and remove ppc_hash32_pte_prot(), Nicholas Piggin, 2024/07/25
- [PULL 84/96] target/ppc/mmu_common.c: Init variable in function that relies on it, Nicholas Piggin, 2024/07/25
- [PULL 85/96] target/ppc/mmu_common.c: Remove key field from mmu_ctx_t, Nicholas Piggin, 2024/07/25
- [PULL 86/96] target/ppc/mmu_common.c: Stop using ctx in ppc6xx_tlb_check(), Nicholas Piggin, 2024/07/25
- [PULL 87/96] target/ppc/mmu_common.c: Rename function parameter, Nicholas Piggin, 2024/07/25
- [PULL 88/96] target/ppc/mmu_common.c: Use defines instead of numeric constants, Nicholas Piggin, 2024/07/25
- [PULL 91/96] target/ppc/mmu_common.c: Remove mmu_ctx_t, Nicholas Piggin, 2024/07/25
- [PULL 89/96] target/ppc: Remove bat_size_prot(), Nicholas Piggin, 2024/07/25
- [PULL 90/96] target/ppc/mmu_common.c: Stop using ctx in get_bat_6xx_tlb(), Nicholas Piggin, 2024/07/25
- [PULL 94/96] target/ppc: Unexport some functions from mmu-book3s-v3.h, Nicholas Piggin, 2024/07/25
- [PULL 93/96] target/ppc/mmu-hash32.c: Move get_pteg_offset32() to the header,
Nicholas Piggin <=
- [PULL 96/96] target/ppc: Remove includes from mmu-book3s-v3.h, Nicholas Piggin, 2024/07/25
- [PULL 92/96] target/ppc/mmu-hash32.c: Inline and remove ppc_hash32_pte_raddr(), Nicholas Piggin, 2024/07/25
- [PULL 95/96] target/ppc/mmu-radix64: Remove externally unused parts from header, Nicholas Piggin, 2024/07/25
- Re: [PULL 00/96] ppc-for-9.1-2 queue, Richard Henderson, 2024/07/27
- Re: [PULL 00/96] ppc-for-9.1-2 queue, Philippe Mathieu-Daudé, 2024/07/29