aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-11-04 22:12:24 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-06-05 09:10:02 -0700
commit6fbc032cbc83ba80009c4a2a18e4d5578bc9ba35 (patch)
tree3cf73c2b64e13cfdaea36dfdd4533e9259d9d563
parent56f2ef9c7958320d574448f555cc3a82e500c485 (diff)
downloadqemu-6fbc032cbc83ba80009c4a2a18e4d5578bc9ba35.zip
qemu-6fbc032cbc83ba80009c4a2a18e4d5578bc9ba35.tar.gz
qemu-6fbc032cbc83ba80009c4a2a18e4d5578bc9ba35.tar.bz2
target/sparc: Implement MWAIT
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/sparc/insns.decode1
-rw-r--r--target/sparc/translate.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index a772056..fbcb4f7 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -124,6 +124,7 @@ CALL 01 i:s30
WRTICK_CMPR 10 10111 110000 ..... . ............. @n_r_ri
WRSTICK 10 11000 110000 ..... . ............. @n_r_ri
WRSTICK_CMPR 10 11001 110000 ..... . ............. @n_r_ri
+ WRMWAIT 10 11100 110000 ..... . ............. @n_r_ri
]
# Before v8, rs1==0 was WRY, and the rest executed as nop.
[
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index b10936a..6d0ad38 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -3344,6 +3344,17 @@ static void do_wrpowerdown(DisasContext *dc, TCGv src)
TRANS(WRPOWERDOWN, POWERDOWN, do_wr_special, a, supervisor(dc), do_wrpowerdown)
+static void do_wrmwait(DisasContext *dc, TCGv src)
+{
+ /*
+ * TODO: This is a stub version of mwait, which merely recognizes
+ * interrupts immediately and does not wait.
+ */
+ dc->base.is_jmp = DISAS_EXIT;
+}
+
+TRANS(WRMWAIT, VIS4, do_wr_special, a, true, do_wrmwait)
+
static void do_wrpsr(DisasContext *dc, TCGv src)
{
gen_helper_wrpsr(tcg_env, src);