diff mbox

[v2,2/3] m68k: implement move to/from usp register instruction

Message ID 1434721406-25288-3-git-send-email-gerg@uclinux.org
State New
Headers show

Commit Message

Greg Ungerer June 19, 2015, 1:43 p.m. UTC
From: Greg Ungerer <gerg@uclinux.org>

Fill out the code support for the move to/from usp instructions. They are
being decoded, but there is no code to support there actions. So add it.

Current versions of Linux running on the ColdFire 5208 use these instructions.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 target-m68k/translate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Laurent Vivier June 19, 2015, 7:28 p.m. UTC | #1
Le 19/06/2015 15:43, gerg@uclinux.org a écrit :
> From: Greg Ungerer <gerg@uclinux.org>
> 
> Fill out the code support for the move to/from usp instructions. They are
> being decoded, but there is no code to support there actions. So add it.
> 
> Current versions of Linux running on the ColdFire 5208 use these instructions.
> 
> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
> Reviewed-by: Richard Henderson <rth@twiddle.net>
> ---
>  target-m68k/translate.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)


Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox

Patch

diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 4959b97..96d75bf 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -1995,8 +1995,8 @@  DISAS_INSN(move_from_usp)
         gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
         return;
     }
-    /* TODO: Implement USP.  */
-    gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
+    tcg_gen_ld_i32(AREG(insn, 0), cpu_env,
+                   offsetof(CPUM68KState, sp[M68K_USP]));
 }
 
 DISAS_INSN(move_to_usp)
@@ -2005,8 +2005,8 @@  DISAS_INSN(move_to_usp)
         gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
         return;
     }
-    /* TODO: Implement USP.  */
-    gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
+    tcg_gen_st_i32(AREG(insn, 0), cpu_env,
+                   offsetof(CPUM68KState, sp[M68K_USP]));
 }
 
 DISAS_INSN(halt)