From: "Magnus Damm" <magnus.damm@gmail.com>
To: Thiemo Seufer <ths@networkno.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] sh4: more patches
Date: Wed, 4 Jul 2007 13:19:07 +0900 [thread overview]
Message-ID: <aec7e5c30707032119t3d080394raea644a1a1b6a70a@mail.gmail.com> (raw)
In-Reply-To: <20070625120153.GB24018@networkno.de>
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
On 6/25/07, Thiemo Seufer <ths@networkno.de> wrote:
> Can you also provide a regression test like some of the other targets
> have? It would be very useful to detect breakage.
Sure, what about the attached hello-sh4 test patch?
And while at it I've attached two minor patches for fixing trapa
single stepping and enabling of sh4-linux-user in ./configure.
Thanks!
/ magnus
[-- Attachment #2: qemu-cvs_20070704-sh4-hello-test.patch --]
[-- Type: application/octet-stream, Size: 1180 bytes --]
sh4: add syscall test program
This patch adds the hello-sh4 test program to qemu. The implementation is
very similar to hello-i386.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
--- /dev/null
+++ work/tests/hello-sh4.c 2007-07-04 11:27:26.000000000 +0900
@@ -0,0 +1,33 @@
+/*
+* sh4 linux syscall example
+*
+* sh4-unknown-linux-gnu-gcc -nostdlib -static -o hello-sh4 hello-sh4.c
+*/
+
+#define __NR_exit 1
+#define __NR_write 4
+
+void exit(int status)
+{
+ register long __sc0 __asm__ ("r3") = __NR_exit;
+ register long __sc4 __asm__ ("r4") = (long) status;
+ __asm__ __volatile__ ("trapa #0x11" : "=z" (__sc0) : "0" (__sc0),
+ "r" (__sc4) : "memory");
+ while(1);
+}
+
+void write(int fd, const char * buf, int len)
+{
+ register long __sc0 __asm__ ("r3") = __NR_write;
+ register long __sc4 __asm__ ("r4") = (long) fd;
+ register long __sc5 __asm__ ("r5") = (long) buf;
+ register long __sc6 __asm__ ("r6") = (long) len;
+ __asm__ __volatile__ ("trapa #0x13" : "=z" (__sc0) : "0" (__sc0),
+ "r" (__sc4), "r" (__sc5), "r" (__sc6) : "memory");
+}
+
+void _start(void)
+{
+ write(1, "Hello World\n", 12);
+ exit(0);
+}
[-- Attachment #3: qemu-cvs_20070608-sh4-trapa-single-step.patch --]
[-- Type: application/octet-stream, Size: 536 bytes --]
sh4: fix trapa single step
This patch fixes trapa single step so we can single step syscalls.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
--- 0001/linux-user/main.c
+++ work/linux-user/main.c 2007-06-08 13:17:40.000000000 +0900
@@ -1453,6 +1453,10 @@ void cpu_loop (CPUState *env)
0);
env->gregs[0] = ret;
env->pc += 2;
+
+ if (env->singlestep_enabled)
+ env->interrupt_request |= CPU_INTERRUPT_DEBUG;
+
break;
case EXCP_DEBUG:
{
[-- Attachment #4: qemu-cvs_20070625-configure-enable-sh4-linux-user.patch --]
[-- Type: application/octet-stream, Size: 837 bytes --]
sh4: add sh4-linux-user to configure
This patch adds sh4-linux-user to the list of emulated user space cpus.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
--- 0003/configure
+++ work/configure 2007-06-25 18:40:31.000000000 +0900
@@ -480,7 +480,7 @@ if test -z "$target_list" ; then
fi
# the following are Linux specific
if [ "$linux_user" = "yes" ] ; then
- target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user $target_list"
+ target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user $target_list"
fi
# the following are Darwin specific
if [ "$darwin_user" = "yes" ] ; then
next prev parent reply other threads:[~2007-07-04 4:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-22 7:44 [Qemu-devel] sh4: more patches Magnus Damm
2007-06-22 11:48 ` Thiemo Seufer
2007-06-25 6:42 ` Magnus Damm
2007-06-25 12:01 ` Thiemo Seufer
2007-07-04 4:19 ` Magnus Damm [this message]
2007-07-25 1:02 ` Paul Mundt
2007-06-25 15:28 ` Blue Swirl
2007-07-04 4:44 ` Magnus Damm
2007-07-04 18:01 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aec7e5c30707032119t3d080394raea644a1a1b6a70a@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=ths@networkno.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).