sparc: allow CASA with ASI 0xa from user space
authorAlex Zuepke <azu@sysgo.de>
Fri, 4 Dec 2015 15:01:02 +0000 (16:01 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 Dec 2015 11:19:18 +0000 (11:19 +0000)
LEON3 allows the CASA instruction to be used from user space
if the ASI is set to 0xa (user data).

Signed-off-by: Alex Zuepke <azu@sysgo.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target-sparc/translate.c

index 41a33193d8c506f63514553f0f78f8f4c8e28d25..63440dd792a659fd3bf4cec599576d72fcfa6ace 100644 (file)
@@ -5097,7 +5097,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
                     if (IS_IMM) {
                         goto illegal_insn;
                     }
-                    if (!supervisor(dc)) {
+                    /* LEON3 allows CASA from user space with ASI 0xa */
+                    if ((GET_FIELD(insn, 19, 26) != 0xa) && !supervisor(dc)) {
                         goto priv_insn;
                     }
 #endif