[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/28] target/ppc/mmu_common.c: Simplify checking for real mod
|
From: |
BALATON Zoltan |
|
Subject: |
[PATCH v2 08/28] target/ppc/mmu_common.c: Simplify checking for real mode |
|
Date: |
Thu, 02 May 2024 01:43:14 +0200 (CEST) |
In get_physical_address_wtlb() the real_mode flag depends on either
the MSR[IR] or MSR[DR] bit depending on access_type. Extract just the
needed bit in a more straight forward way instead of doing unnecessary
computation.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
target/ppc/mmu_common.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c
index 74c3b814c9..45b6501ecb 100644
--- a/target/ppc/mmu_common.c
+++ b/target/ppc/mmu_common.c
@@ -1183,8 +1183,10 @@ int get_physical_address_wtlb(CPUPPCState *env,
mmu_ctx_t *ctx,
int mmu_idx)
{
int ret = -1;
- bool real_mode = (type == ACCESS_CODE && !FIELD_EX64(env->msr, MSR, IR)) ||
- (type != ACCESS_CODE && !FIELD_EX64(env->msr, MSR, DR));
+ bool real_mode;
+
+ real_mode = (type == ACCESS_CODE) ? !FIELD_EX64(env->msr, MSR, IR)
+ : !FIELD_EX64(env->msr, MSR, DR);
switch (env->mmu_model) {
case POWERPC_MMU_SOFT_6xx:
--
2.30.9
- Re: [PATCH v2 18/28] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate(), (continued)
- [PATCH v2 08/28] target/ppc/mmu_common.c: Simplify checking for real mode,
BALATON Zoltan <=
- [PATCH v2 19/28] target/ppc/mmu_common.c: Replace hard coded constants in ppc_jumbo_xlate(), BALATON Zoltan, 2024/05/01
- [PATCH v2 21/28] target/ppc: Move mmu_ctx_t definition to mmu_common.c, BALATON Zoltan, 2024/05/01
- [PATCH v2 23/28] target/ppc/mmu_common.c: Split off BookE handling from ppc_jumbo_xlate(), BALATON Zoltan, 2024/05/01
- [PATCH v2 25/28] target/ppc/mmu_common.c: Simplify ppc_booke_xlate(), BALATON Zoltan, 2024/05/01
- [PATCH v2 26/28] target/ppc/mmu_common.c: Move BookE MMU functions together, BALATON Zoltan, 2024/05/01