[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/26] target-alpha: Merge HW_REI and HW_RET impleme
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 08/26] target-alpha: Merge HW_REI and HW_RET implementations. |
Date: |
Mon, 23 May 2011 13:28:28 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
target-alpha/helper.h | 1 -
target-alpha/op_helper.c | 10 ----------
target-alpha/translate.c | 19 ++++++++-----------
3 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/target-alpha/helper.h b/target-alpha/helper.h
index f4f693a..de86ff2 100644
--- a/target-alpha/helper.h
+++ b/target-alpha/helper.h
@@ -100,7 +100,6 @@ DEF_HELPER_1(ieee_input_cmp, i64, i64)
DEF_HELPER_1(ieee_input_s, i64, i64)
#if !defined (CONFIG_USER_ONLY)
-DEF_HELPER_0(hw_rei, void)
DEF_HELPER_1(hw_ret, void, i64)
DEF_HELPER_2(mfpr, i64, int, i64)
DEF_HELPER_2(mtpr, void, int, i64)
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index a90c7a6..ea11cd2 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -1156,22 +1156,12 @@ uint64_t helper_cvtqg (uint64_t a)
/* PALcode support special instructions */
#if !defined (CONFIG_USER_ONLY)
-void helper_hw_rei (void)
-{
- env->pc = env->ipr[IPR_EXC_ADDR] & ~3;
- env->ipr[IPR_EXC_ADDR] = env->ipr[IPR_EXC_ADDR] & 1;
- env->intr_flag = 0;
- env->lock_addr = -1;
- /* XXX: re-enable interrupts and memory mapping */
-}
-
void helper_hw_ret (uint64_t a)
{
env->pc = a & ~3;
env->ipr[IPR_EXC_ADDR] = a & 1;
env->intr_flag = 0;
env->lock_addr = -1;
- /* XXX: re-enable interrupts and memory mapping */
}
uint64_t helper_mfpr (int iprn, uint64_t val)
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 2c0b9c2..2559814 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -2876,25 +2876,22 @@ static ExitStatus translate_one(DisasContext *ctx,
uint32_t insn)
break;
#endif
case 0x1E:
- /* HW_REI (PALcode) */
+ /* HW_RET (PALcode) */
#if defined (CONFIG_USER_ONLY)
goto invalid_opc;
#else
if (!ctx->pal_mode)
goto invalid_opc;
if (rb == 31) {
- /* "Old" alpha */
- gen_helper_hw_rei();
- } else {
- TCGv tmp;
-
- if (ra != 31) {
- tmp = tcg_temp_new();
- tcg_gen_addi_i64(tmp, cpu_ir[rb], (((int64_t)insn << 51) >>
51));
- } else
- tmp = tcg_const_i64(((int64_t)insn << 51) >> 51);
+ /* Pre-EV6 CPUs interpreted this as HW_REI, loading the return
+ address from EXC_ADDR. This turns out to be useful for our
+ emulation PALcode, so continue to accept it. */
+ TCGv tmp = tcg_temp_new();
+ tcg_gen_ld_i64(tmp, cpu_env, offsetof(CPUState,
ipr[IPR_EXC_ADDR]));
gen_helper_hw_ret(tmp);
tcg_temp_free(tmp);
+ } else {
+ gen_helper_hw_ret(cpu_ir[rb]);
}
ret = EXIT_PC_UPDATED;
break;
--
1.7.4.4
- [Qemu-devel] [PULL 00/26] Alpha system emulation, v5, Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 01/26] target-alpha: Claim ownership., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 02/26] target-alpha: Disassemble EV6 PALcode instructions., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 03/26] target-alpha: Single-step properly across branches., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 04/26] target-alpha: Remove partial support for palcode emulation., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 06/26] target-alpha: Fix system store_conditional, Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 08/26] target-alpha: Merge HW_REI and HW_RET implementations.,
Richard Henderson <=
- [Qemu-devel] [PATCH 07/26] target-alpha: Cleanup MMU modes., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 05/26] target-alpha: Fix translation of PALmode memory insns., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 09/26] target-alpha: Rationalize internal processor registers., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 12/26] target-alpha: Tidy up arithmetic exceptions., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 13/26] target-alpha: Use do_restore_state for arithmetic exceptions., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 15/26] target-alpha: Use kernel mmu_idx for pal_mode., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 14/26] target-alpha: Add various symbolic constants., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 10/26] target-alpha: Enable the alpha-softmmu target., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 16/26] target-alpha: Add IPRs to be used by the emulation PALcode., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 17/26] target-alpha: Implement do_interrupt for system mode., Richard Henderson, 2011/05/23