qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [ADD] tests for PPC target.


From: J. Mayer
Subject: Re: [Qemu-devel] [ADD] tests for PPC target.
Date: 18 Nov 2003 09:09:17 +0100

target-ppc__tests__hello-ppc.c.diff

Say hello to the world...

diff -urNbB -x CVS qemu-current/target-ppc/tests/hello-ppc.c 
qemu/target-ppc/tests/hello-ppc.c
--- qemu-current/target-ppc/tests/hello-ppc.c   Thu Jan  1 01:00:00 1970
+++ qemu/target-ppc/tests/hello-ppc.c   Wed Jun 25 11:40:03 2003
@@ -0,0 +1,25 @@
+#include "/usr/src/linux/include/asm-ppc/unistd.h"
+
+static void _exit(int status)
+{
+    __asm__ __volatile__ ("mr 3, %1 ; li 0, %0 ; sc ;" \
+                          :: "i"(__NR_exit), "r"(status));
+}
+
+static int _write(int fd, const char * buf, int len)
+{
+    int status;
+
+    __asm__ __volatile__ ("mr 3, %2 ; mr 4, %3 ; mr 5, %4 ; li 0, %1 ; sc ;" \
+                          "mr %0, 3 ;" \
+                          : "=r"(status) \
+                          : "i"(__NR_write), "r"(fd), "r"(buf), "r"(len));
+
+    return status;
+}
+
+void _start(void)
+{
+    _write(1, "Hello World\n", 12);
+    _exit(0);
+}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]