Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/ppc: Get CPUState in one step
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>
Message-ID: <28424220f37f51ce97f24cadc7538a9c0d16cb45.1686868895.git.balaton@eik.bme.hu>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
  • Loading branch information
zbalaton authored and danielhb committed Jul 7, 2023
1 parent 08d7cfd commit 4e6b7db
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions target/ppc/excp_helper.c
Expand Up @@ -1770,8 +1770,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;

Expand Down Expand Up @@ -1860,8 +1860,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;

Expand Down Expand Up @@ -1981,8 +1981,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;

Expand Down Expand Up @@ -2675,9 +2675,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 */
Expand Down

0 comments on commit 4e6b7db

Please sign in to comment.