[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 53/61] target/ppc/mmu_common.c: Init variable in function that
From: |
BALATON Zoltan |
Subject: |
[PATCH v7 53/61] target/ppc/mmu_common.c: Init variable in function that relies on it |
Date: |
Mon, 13 May 2024 01:28:28 +0200 (CEST) |
The ppc6xx_tlb_check() relies on the caller to initialise raddr field
in ctx. Move this init from the only caller into the function.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
target/ppc/mmu_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c
index 3d028a2008..ccc1c76a06 100644
--- a/target/ppc/mmu_common.c
+++ b/target/ppc/mmu_common.c
@@ -102,6 +102,8 @@ static int ppc6xx_tlb_check(CPUPPCState *env,
int nr, best, way, ret;
bool is_code = (access_type == MMU_INST_FETCH);
+ /* Initialize real address with an invalid value */
+ ctx->raddr = (hwaddr)-1ULL;
best = -1;
ret = -1; /* No TLB found */
for (way = 0; way < env->nb_ways; way++) {
@@ -340,8 +342,6 @@ static int mmu6xx_get_physical_address(CPUPPCState *env,
mmu_ctx_t *ctx,
ppc_hash32_hpt_base(cpu), ppc_hash32_hpt_mask(cpu),
hash);
*hashp = hash;
- /* Initialize real address with an invalid value */
- ctx->raddr = (hwaddr)-1ULL;
/* Software TLB search */
return ppc6xx_tlb_check(env, ctx, eaddr, access_type, ptem, nx);
}
--
2.30.9
- [PATCH v7 37/61] target/ppc/mmu_common.c: Remove single use local variable, (continued)
- [PATCH v7 37/61] target/ppc/mmu_common.c: Remove single use local variable, BALATON Zoltan, 2024/05/12
- [PATCH v7 39/61] target/ppc/mmu_common.c: Remove another single use local, BALATON Zoltan, 2024/05/12
- [PATCH v7 41/61] target/ppc/mmu_common.c: Return directly in ppc6xx_tlb_pte_check(), BALATON Zoltan, 2024/05/12
- [PATCH v7 44/61] target/ppc/mmu_common.c: Remove hash field from mmu_ctx_t, BALATON Zoltan, 2024/05/12
- [PATCH v7 43/61] target/ppc/mmu_common.c: Remove unused field from mmu_ctx_t, BALATON Zoltan, 2024/05/12
- [PATCH v7 48/61] target/ppc/mmu_common.c: Simplify a switch statement, BALATON Zoltan, 2024/05/12
- [PATCH v7 45/61] target/ppc/mmu_common.c: Remove nx field from mmu_ctx_t, BALATON Zoltan, 2024/05/12
- [PATCH v7 50/61] target/ppc/mmu_common.c: Remove ptem field from mmu_ctx_t, BALATON Zoltan, 2024/05/12
- [PATCH v7 51/61] target/ppc: Add function to get protection key for hash32 MMU, BALATON Zoltan, 2024/05/12
- [PATCH v7 49/61] target/ppc/mmu_common.c: Inline and remove ppc6xx_tlb_pte_check(), BALATON Zoltan, 2024/05/12
- [PATCH v7 53/61] target/ppc/mmu_common.c: Init variable in function that relies on it,
BALATON Zoltan <=
- [PATCH v7 55/61] target/ppc/mmu_common.c: Stop using ctx in ppc6xx_tlb_check(), BALATON Zoltan, 2024/05/12
- [PATCH v7 57/61] targe/ppc/mmu_common.c: Use defines instead of numeric constants, BALATON Zoltan, 2024/05/12
- [PATCH v7 58/61] target/ppc: Remove bat_size_prot(), BALATON Zoltan, 2024/05/12
- [PATCH v7 61/61] target/ppc/mmu_common.c: Remove a local variable, BALATON Zoltan, 2024/05/12
- [PATCH v7 59/61] target/ppc/mmu_common.c: Stop using ctx in get_bat_6xx_tlb(), BALATON Zoltan, 2024/05/12
- [PATCH v7 52/61] target/ppc/mmu-hash32.c: Inline and remove ppc_hash32_pte_prot(), BALATON Zoltan, 2024/05/12
- [PATCH v7 56/61] target/ppc/mmu_common.c: Rename function parameter, BALATON Zoltan, 2024/05/12
- [PATCH v7 47/61] target/ppc/mmu_common.c: Remove single use local variable, BALATON Zoltan, 2024/05/12