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);
+}
