diff options
author | Fabiano Rosas <farosas@linux.ibm.com> | 2022-01-12 11:28:27 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2022-01-12 11:28:27 +0100 |
commit | 19bd7f5747dc75120f7fdaad7a153aa90d468df0 (patch) | |
tree | beddefe2fcc1c89f6f1ddd6d61a57ea4bb8fd4f5 /target/ppc | |
parent | 2e89484821883457cc76a576cf398a7efde4e052 (diff) | |
download | qemu-19bd7f5747dc75120f7fdaad7a153aa90d468df0.zip qemu-19bd7f5747dc75120f7fdaad7a153aa90d468df0.tar.gz qemu-19bd7f5747dc75120f7fdaad7a153aa90d468df0.tar.bz2 |
target/ppc: Use ppc_interrupts_little_endian in powerpc_excp
The ppc_interrupts_little_endian function is now suitable for
determining the endianness of interrupts for all CPUs.
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220107222601.4101511-7-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'target/ppc')
-rw-r--r-- | target/ppc/excp_helper.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 3a430f2..3b4123b 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -832,36 +832,9 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp) * Sort out endianness of interrupt, this differs depending on the * CPU, the HV mode, etc... */ -#ifdef TARGET_PPC64 - if (excp_model == POWERPC_EXCP_POWER7) { - if (!(new_msr & MSR_HVB) && (env->spr[SPR_LPCR] & LPCR_ILE)) { - new_msr |= (target_ulong)1 << MSR_LE; - } - } else if (excp_model == POWERPC_EXCP_POWER8) { - if (new_msr & MSR_HVB) { - if (env->spr[SPR_HID0] & HID0_HILE) { - new_msr |= (target_ulong)1 << MSR_LE; - } - } else if (env->spr[SPR_LPCR] & LPCR_ILE) { - new_msr |= (target_ulong)1 << MSR_LE; - } - } else if (excp_model == POWERPC_EXCP_POWER9 || - excp_model == POWERPC_EXCP_POWER10) { - if (new_msr & MSR_HVB) { - if (env->spr[SPR_HID0] & HID0_POWER9_HILE) { - new_msr |= (target_ulong)1 << MSR_LE; - } - } else if (env->spr[SPR_LPCR] & LPCR_ILE) { - new_msr |= (target_ulong)1 << MSR_LE; - } - } else if (msr_ile) { - new_msr |= (target_ulong)1 << MSR_LE; - } -#else - if (msr_ile) { + if (ppc_interrupts_little_endian(cpu, !!(new_msr & MSR_HVB))) { new_msr |= (target_ulong)1 << MSR_LE; } -#endif #if defined(TARGET_PPC64) if (excp_model == POWERPC_EXCP_BOOKE) { |