[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 11/14] target/ppc: Get CPUState in one step
From: |
BALATON Zoltan |
Subject: |
[PATCH v3 11/14] target/ppc: Get CPUState in one step |
Date: |
Fri, 16 Jun 2023 01:03:21 +0200 (CEST) |
We can get CPUState from env with env_cpu without going through
PowerPCCPU and casting that.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/excp_helper.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index a62103b8ac..cfb652445a 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -1503,8 +1503,8 @@ static int p7_interrupt_powersave(CPUPPCState *env)
static int p7_next_unmasked_interrupt(CPUPPCState *env)
{
- PowerPCCPU *cpu = env_archcpu(env);
- CPUState *cs = CPU(cpu);
+ CPUState *cs = env_cpu(env);
+
/* Ignore MSR[EE] when coming out of some power management states */
bool msr_ee = FIELD_EX64(env->msr, MSR, EE) || env->resume_as_sreset;
@@ -1593,8 +1593,8 @@ static int p8_interrupt_powersave(CPUPPCState *env)
static int p8_next_unmasked_interrupt(CPUPPCState *env)
{
- PowerPCCPU *cpu = env_archcpu(env);
- CPUState *cs = CPU(cpu);
+ CPUState *cs = env_cpu(env);
+
/* Ignore MSR[EE] when coming out of some power management states */
bool msr_ee = FIELD_EX64(env->msr, MSR, EE) || env->resume_as_sreset;
@@ -1714,8 +1714,8 @@ static int p9_interrupt_powersave(CPUPPCState *env)
static int p9_next_unmasked_interrupt(CPUPPCState *env)
{
- PowerPCCPU *cpu = env_archcpu(env);
- CPUState *cs = CPU(cpu);
+ CPUState *cs = env_cpu(env);
+
/* Ignore MSR[EE] when coming out of some power management states */
bool msr_ee = FIELD_EX64(env->msr, MSR, EE) || env->resume_as_sreset;
@@ -2410,9 +2410,8 @@ void helper_scv(CPUPPCState *env, uint32_t lev)
void helper_pminsn(CPUPPCState *env, uint32_t insn)
{
- CPUState *cs;
+ CPUState *cs = env_cpu(env);
- cs = env_cpu(env);
cs->halted = 1;
/* Condition for waking up at 0x100 */
--
2.30.9
- [PATCH v3 02/14] target/ppc: Remove unneeded parameter from powerpc_reset_wakeup(), (continued)
Re: [PATCH v3 09/14] target/ppc: Move patching nip from exception handler to helper_scv, Nicholas Piggin, 2023/06/26
[PATCH v3 10/14] target/ppc: Simplify syscall exception handlers, BALATON Zoltan, 2023/06/15
[PATCH v3 11/14] target/ppc: Get CPUState in one step,
BALATON Zoltan <=
[PATCH v3 13/14] target/ppc: Clean up ifdefs in excp_helper.c, part 2, BALATON Zoltan, 2023/06/15
[PATCH v3 14/14] target/ppc: Clean up ifdefs in excp_helper.c, part 3, BALATON Zoltan, 2023/06/15
[PATCH v3 12/14] target/ppc: Clean up ifdefs in excp_helper.c, part 1, BALATON Zoltan, 2023/06/15
Re: [PATCH v3 00/14] Misc clean ups to target/ppc exception handling, Daniel Henrique Barboza, 2023/06/30