qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] sh4: minor fixes for current cvs
@ 2007-04-25  8:25 Magnus Damm
  0 siblings, 0 replies; only message in thread
From: Magnus Damm @ 2007-04-25  8:25 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

Hi everyone,

Attached are a few minor fixes for the sh4 user space emulator. Please commit.

I will continue to improve the sh4 user space and system emulation
code in the near future, so feel free to send any qemu on sh4 related
questions or comments to me!

Thanks in advance,

/ magnus

[-- Attachment #2: qemu-cvs_20070417-sh4-use-uid16.patch --]
[-- Type: text/x-patch, Size: 521 bytes --]

sh4: Use 16-bit uid wrappers

Without this patch a simple hello world program emits this:
qemu: Unsupported syscall: 47

Signed-off-by: Magnus Damm <damm@igel.co.jp>

--- 0001/linux-user/syscall.c
+++ work/linux-user/syscall.c	2007-04-17 11:48:24.000000000 +0900
@@ -74,7 +74,7 @@
 //#define DEBUG
 
 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) \
-    || defined(TARGET_M68K)
+    || defined(TARGET_M68K) || defined(TARGET_SH4)
 /* 16 bit uid wrappers emulation */
 #define USE_UID16
 #endif

[-- Attachment #3: qemu-cvs_20070417-sh4-stsl-fpul-fpscr.patch --]
[-- Type: text/x-patch, Size: 844 bytes --]

sh4: Fix opcode for sts.l fpul/cpscr

0x4052/0x4062 should be used instead of 0x0052/0x0062 according to the
SH-4 Software Manual.

Signed-off-by: Magnus Damm <damm@igel.co.jp>

--- 0001/target-sh4/translate.c
+++ work/target-sh4/translate.c	2007-04-17 15:51:36.000000000 +0900
@@ -1003,8 +1003,8 @@ void decode_opc(DisasContext * ctx)
 	LDST(mach, 0x400a, 0x4006, lds, 0x000a, 0x4002, sts,)
 	LDST(macl, 0x401a, 0x4016, lds, 0x001a, 0x4012, sts,)
 	LDST(pr, 0x402a, 0x4026, lds, 0x002a, 0x4022, sts,)
-	LDST(fpul, 0x405a, 0x4056, lds, 0x005a, 0x0052, sts,)
-	LDST(fpscr, 0x406a, 0x4066, lds, 0x006a, 0x0062, sts, ctx->flags |=
+	LDST(fpul, 0x405a, 0x4056, lds, 0x005a, 0x4052, sts,)
+	LDST(fpscr, 0x406a, 0x4066, lds, 0x006a, 0x4062, sts, ctx->flags |=
 	     MODE_CHANGE;)
     case 0x00c3:		/* movca.l R0,@Rm */
 	gen_op_movl_rN_T0(REG(0));

[-- Attachment #4: qemu-cvs_20070425-sh4-inc8-dec8.patch --]
[-- Type: text/x-patch, Size: 578 bytes --]

sh4: Fix inc8 and dec8 operations

We should increment and decrement by 8 according to the SH-4 Software Manual.

Signed-off-by: Magnus Damm <damm@igel.co.jp>

--- 0001/target-sh4/op.c
+++ work/target-sh4/op.c	2007-04-25 16:18:47.000000000 +0900
@@ -737,7 +737,7 @@ void OPPROTO op_dec4_rN(void)
 
 void OPPROTO op_dec8_rN(void)
 {
-    env->gregs[PARAM1] -= 4;
+    env->gregs[PARAM1] -= 8;
     RETURN();
 }
 
@@ -761,7 +761,7 @@ void OPPROTO op_inc4_rN(void)
 
 void OPPROTO op_inc8_rN(void)
 {
-    env->gregs[PARAM1] += 4;
+    env->gregs[PARAM1] += 8;
     RETURN();
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-25  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-25  8:25 [Qemu-devel] sh4: minor fixes for current cvs Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).