[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 43/48] target/ppc: Remove type argument from get_bat_6xx_tlb
From: |
David Gibson |
Subject: |
[PULL 43/48] target/ppc: Remove type argument from get_bat_6xx_tlb |
Date: |
Wed, 19 May 2021 22:51:43 +1000 |
From: Richard Henderson <richard.henderson@linaro.org>
We can now use MMU_INST_FETCH from access_type for this.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210518201146.794854-11-richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
target/ppc/mmu_helper.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index 2f00955b80..0eba8302ee 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -379,25 +379,22 @@ static inline void bat_size_prot(CPUPPCState *env,
target_ulong *blp,
}
static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
- target_ulong virtual, MMUAccessType access_type,
- int type)
+ target_ulong virtual, MMUAccessType access_type)
{
target_ulong *BATlt, *BATut, *BATu, *BATl;
target_ulong BEPIl, BEPIu, bl;
int i, valid, prot;
int ret = -1;
+ bool ifetch = access_type == MMU_INST_FETCH;
LOG_BATS("%s: %cBAT v " TARGET_FMT_lx "\n", __func__,
- type == ACCESS_CODE ? 'I' : 'D', virtual);
- switch (type) {
- case ACCESS_CODE:
+ ifetch ? 'I' : 'D', virtual);
+ if (ifetch) {
BATlt = env->IBAT[1];
BATut = env->IBAT[0];
- break;
- default:
+ } else {
BATlt = env->DBAT[1];
BATut = env->DBAT[0];
- break;
}
for (i = 0; i < env->nb_BATs; i++) {
BATu = &BATut[i];
@@ -407,7 +404,7 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
bat_size_prot(env, &bl, &valid, &prot, BATu, BATl);
LOG_BATS("%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx
" BATl " TARGET_FMT_lx "\n", __func__,
- type == ACCESS_CODE ? 'I' : 'D', i, virtual, *BATu, *BATl);
+ ifetch ? 'I' : 'D', i, virtual, *BATu, *BATl);
if ((virtual & 0xF0000000) == BEPIu &&
((virtual & 0x0FFE0000) & ~bl) == BEPIl) {
/* BAT matches */
@@ -441,7 +438,7 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
LOG_BATS("%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx
" BATl " TARGET_FMT_lx "\n\t" TARGET_FMT_lx " "
TARGET_FMT_lx " " TARGET_FMT_lx "\n",
- __func__, type == ACCESS_CODE ? 'I' : 'D', i, virtual,
+ __func__, ifetch ? 'I' : 'D', i, virtual,
*BATu, *BATl, BEPIu, BEPIl, bl);
}
}
@@ -1415,7 +1412,7 @@ static int get_physical_address_wtlb(CPUPPCState *env,
mmu_ctx_t *ctx,
} else {
/* Try to find a BAT */
if (env->nb_BATs != 0) {
- ret = get_bat_6xx_tlb(env, ctx, eaddr, access_type, type);
+ ret = get_bat_6xx_tlb(env, ctx, eaddr, access_type);
}
if (ret < 0) {
/* We didn't match any BAT entry or don't have BATs */
--
2.31.1
- [PULL 33/48] target/ppc: Fix load endianness for lxvwsx/lxvdsx, (continued)
- [PULL 33/48] target/ppc: Fix load endianness for lxvwsx/lxvdsx, David Gibson, 2021/05/19
- [PULL 38/48] target/ppc: Rename access_type to type in mmu_helper.c, David Gibson, 2021/05/19
- [PULL 37/48] target/ppc: Use MMUAccessType in mmu-hash32.c, David Gibson, 2021/05/19
- [PULL 39/48] target/ppc: Use MMUAccessType in mmu_helper.c, David Gibson, 2021/05/19
- [PULL 35/48] target/ppc: Use MMUAccessType in mmu-radix64.c, David Gibson, 2021/05/19
- [PULL 36/48] target/ppc: Use MMUAccessType in mmu-hash64.c, David Gibson, 2021/05/19
- [PULL 40/48] target/ppc: Remove type argument from check_prot, David Gibson, 2021/05/19
- [PULL 44/48] target/ppc: Remove type argument from mmu40x_get_physical_address, David Gibson, 2021/05/19
- [PULL 45/48] target/ppc: Remove type argument from mmubooke_check_tlb, David Gibson, 2021/05/19
- [PULL 42/48] target/ppc: Remove type argument from ppc6xx_tlb_check, David Gibson, 2021/05/19
- [PULL 43/48] target/ppc: Remove type argument from get_bat_6xx_tlb,
David Gibson <=
- [PULL 46/48] target/ppc: Remove type argument from mmubooke_get_physical_address, David Gibson, 2021/05/19
- [PULL 47/48] target/ppc: Remove type argument from mmubooke206_check_tlb, David Gibson, 2021/05/19
- [PULL 48/48] target/ppc: Remove type argument for mmubooke206_get_physical_address, David Gibson, 2021/05/19
- Re: [PULL 00/48] ppc-for-6.1 queue 20210519, no-reply, 2021/05/19
- Re: [PULL 00/48] ppc-for-6.1 queue 20210519, Peter Maydell, 2021/05/20