[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 26/43] target/ppc/mmu_common.c: Stop using ctx in get_bat_6xx_tlb
From: |
BALATON Zoltan |
Subject: |
[PATCH 26/43] target/ppc/mmu_common.c: Stop using ctx in get_bat_6xx_tlb() |
Date: |
Mon, 27 May 2024 01:13:02 +0200 (CEST) |
Pass raddr and prot in function parameters instead
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
target/ppc/mmu_common.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c
index 624ed51a92..4770b43630 100644
--- a/target/ppc/mmu_common.c
+++ b/target/ppc/mmu_common.c
@@ -193,7 +193,7 @@ static int ppc6xx_tlb_check(CPUPPCState *env, hwaddr
*raddr, int *prot,
return ret;
}
-static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
+static int get_bat_6xx_tlb(CPUPPCState *env, hwaddr *raddr, int *prot,
target_ulong eaddr, MMUAccessType access_type,
bool pr)
{
@@ -224,16 +224,16 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t
*ctx,
if ((eaddr & BATU32_BEPIU) == BEPIu &&
((eaddr & BATU32_BEPIL) & ~bl) == BEPIl) {
/* Get physical address */
- ctx->raddr = (*BATl & BATU32_BEPIU) |
+ *raddr = (*BATl & BATU32_BEPIU) |
((eaddr & BATU32_BEPIL & bl) | (*BATl & BATU32_BEPIL)) |
(eaddr & 0x0001F000);
/* Compute access rights */
- ctx->prot = ppc_hash32_bat_prot(*BATu, *BATl);
- if (check_prot_access_type(ctx->prot, access_type)) {
+ *prot = ppc_hash32_bat_prot(*BATu, *BATl);
+ if (check_prot_access_type(*prot, access_type)) {
qemu_log_mask(CPU_LOG_MMU, "BAT %d match: r "
HWADDR_FMT_plx
- " prot=%c%c\n", i, ctx->raddr,
- ctx->prot & PAGE_READ ? 'R' : '-',
- ctx->prot & PAGE_WRITE ? 'W' : '-');
+ " prot=%c%c\n", i, *raddr,
+ *prot & PAGE_READ ? 'R' : '-',
+ *prot & PAGE_WRITE ? 'W' : '-');
ret = 0;
} else {
ret = -2;
@@ -277,7 +277,8 @@ static int mmu6xx_get_physical_address(CPUPPCState *env,
mmu_ctx_t *ctx,
/* First try to find a BAT entry if there are any */
if (env->nb_BATs &&
- get_bat_6xx_tlb(env, ctx, eaddr, access_type, pr) == 0) {
+ get_bat_6xx_tlb(env, &ctx->raddr, &ctx->prot, eaddr,
+ access_type, pr) == 0) {
return 0;
}
--
2.30.9
- [PATCH 10/43] target/ppc/mmu_common.c: Remove hash field from mmu_ctx_t, (continued)
- [PATCH 10/43] target/ppc/mmu_common.c: Remove hash field from mmu_ctx_t, BALATON Zoltan, 2024/05/26
- [PATCH 11/43] target/ppc/mmu_common.c: Remove pte_update_flags(), BALATON Zoltan, 2024/05/26
- [PATCH 12/43] target/ppc/mmu_common.c: Remove nx field from mmu_ctx_t, BALATON Zoltan, 2024/05/26
- [PATCH 28/43] target/ppc/mmu-hash32.c: Inline and remove ppc_hash32_pte_raddr(), BALATON Zoltan, 2024/05/26
- [PATCH 14/43] target/ppc/mmu_common.c: Remove single use local variable, BALATON Zoltan, 2024/05/26
- [PATCH 41/43] target/ppc: Change MMU xlate functions to take CPUState, BALATON Zoltan, 2024/05/26
- [PATCH 13/43] target/ppc/mmu_common.c: Convert local variable to bool, BALATON Zoltan, 2024/05/26
- [PATCH 19/43] target/ppc/mmu-hash32.c: Inline and remove ppc_hash32_pte_prot(), BALATON Zoltan, 2024/05/26
- [PATCH 23/43] target/ppc/mmu_common.c: Rename function parameter, BALATON Zoltan, 2024/05/26
- [PATCH 39/43] target/ppc: Change parameter type of some inline functions, BALATON Zoltan, 2024/05/26
- [PATCH 26/43] target/ppc/mmu_common.c: Stop using ctx in get_bat_6xx_tlb(),
BALATON Zoltan <=
- [PATCH 32/43] target/ppc: Remove includes from mmu-book3s-v3.h, BALATON Zoltan, 2024/05/26
- [PATCH 37/43] target/ppc/mmu-hash32.c: Return and use pte address instead of base + offset, BALATON Zoltan, 2024/05/26
- [PATCH 22/43] target/ppc/mmu_common.c: Stop using ctx in ppc6xx_tlb_check(), BALATON Zoltan, 2024/05/26
- [PATCH 35/43] target/ppc/mmu-hash32.c: Change parameter type of ppc_hash32_bat_lookup(), BALATON Zoltan, 2024/05/26
- [PATCH 25/43] target/ppc: Remove bat_size_prot(), BALATON Zoltan, 2024/05/26
- [PATCH 29/43] target/ppc/mmu-hash32.c: Move get_pteg_offset32() to the header, BALATON Zoltan, 2024/05/26
- [PATCH 42/43] target/ppc/mmu-hash32.c: Change parameter type of ppc_hash32_set_[rc], BALATON Zoltan, 2024/05/26
- [PATCH 38/43] target/ppc/mmu-hash32.c: Use pte address as parameter instead of offset, BALATON Zoltan, 2024/05/26
- [PATCH 36/43] target/ppc/mmu-hash32: Remove some static inlines from header, BALATON Zoltan, 2024/05/26
- [PATCH 40/43] target/ppc: Change parameter type of ppc64_v3_radix(), BALATON Zoltan, 2024/05/26