[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 30/35] target-alpha: Implement WAIT IPR.
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 30/35] target-alpha: Implement WAIT IPR. |
Date: |
Mon, 9 May 2011 14:34:44 -0700 |
---
target-alpha/translate.c | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 8107d19..7b976be 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -1621,9 +1621,10 @@ static void gen_mfpr(int ra, int regno)
}
}
-static void gen_mtpr(int rb, int regno)
+static ExitStatus gen_mtpr(DisasContext *ctx, int rb, int regno)
{
TCGv tmp;
+ int data;
if (rb == 31) {
tmp = tcg_const_i64(0);
@@ -1631,19 +1632,27 @@ static void gen_mtpr(int rb, int regno)
tmp = cpu_ir[rb];
}
- /* These two register numbers perform a TLB cache flush. Thankfully we
- can only do this inside PALmode, which means that the current basic
- block cannot be affected by the change in mappings. */
- if (regno == 255) {
+ switch (regno) {
+ case 255:
/* TBIA */
gen_helper_tbia();
- } else if (regno == 254) {
+ break;
+
+ case 254:
/* TBIS */
gen_helper_tbis(tmp);
- } else {
+ break;
+
+ case 253:
+ /* WAIT */
+ tmp = tcg_const_i64(1);
+ tcg_gen_st32_i64(tmp, cpu_env, offsetof(CPUState, halted));
+ return gen_excp(ctx, EXCP_HLT, 0);
+
+ default:
/* The basic registers are data only, and unknown registers
are read-zero, write-ignore. */
- int data = cpu_pr_data(regno);
+ data = cpu_pr_data(regno);
if (data != 0) {
if (data & PR_BYTE) {
tcg_gen_st8_i64(tmp, cpu_env, data & ~PR_BYTE);
@@ -1653,11 +1662,14 @@ static void gen_mtpr(int rb, int regno)
tcg_gen_st_i64(tmp, cpu_env, data);
}
}
+ break;
}
if (rb == 31) {
tcg_temp_free(tmp);
}
+
+ return NO_EXIT;
}
#endif /* !USER_ONLY*/
@@ -3052,8 +3064,7 @@ static ExitStatus translate_one(DisasContext *ctx,
uint32_t insn)
/* HW_MTPR (PALcode) */
#ifndef CONFIG_USER_ONLY
if (ctx->tb->flags & TB_FLAGS_PAL_MODE) {
- gen_mtpr(rb, insn & 0xffff);
- break;
+ return gen_mtpr(ctx, rb, insn & 0xffff);
}
#endif
goto invalid_opc;
--
1.7.4.4
- [Qemu-devel] [PATCH 18/35] target-alpha: Use kernel mmu_idx for pal_mode., (continued)
- [Qemu-devel] [PATCH 18/35] target-alpha: Use kernel mmu_idx for pal_mode., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 20/35] target-alpha: Disable interrupts properly., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 21/35] target-alpha: Implement more CALL_PAL values inline., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 19/35] target-alpha: All ISA checks to use TB->FLAGS., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 22/35] target-alpha: Implement cpu_alpha_handle_mmu_fault for system mode., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 23/35] target-alpha: Remap PIO space for 43-bit KSEG for EV6., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 24/35] target-alpha: Trap for unassigned and unaligned addresses., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 25/35] target-alpha: Include the PCC_OFS in the RPCC return value., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 26/35] target-alpha: Use a fixed frequency for the RPCC in system mode., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 27/35] target-alpha: Implement TLB flush primitives., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 30/35] target-alpha: Implement WAIT IPR.,
Richard Henderson <=
- [Qemu-devel] [PATCH 33/35] target-alpha: Properly select the VGA controler to use., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 29/35] target-alpha: Add CLIPPER emulation., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 34/35] target-alpha: Enable PCI IDE, Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 35/35] target-alpha: Add ps2 keyboard., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 31/35] target-alpha: Implement HALT IPR., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 32/35] target-alpha: Add high-resolution access to wall clock and an alarm., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 28/35] target-alpha: Add custom PALcode image for CLIPPER emulation., Richard Henderson, 2011/05/09
- Re: [Qemu-devel] [PATCH 00/35] Alpha system emulation, v4, Paul Brook, 2011/05/10