From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AM1ol-0000vi-FN for qemu-devel@nongnu.org; Tue, 18 Nov 2003 04:06:39 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AM1oA-0000eA-KS for qemu-devel@nongnu.org; Tue, 18 Nov 2003 04:06:33 -0500 Received: from [62.210.158.45] (helo=quito.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AM1o9-0000dd-Cs for qemu-devel@nongnu.org; Tue, 18 Nov 2003 04:06:01 -0500 Received: from 10.0.0.2 (ppp-181.net-555.magic.fr [62.210.255.181]) by quito.magic.fr (8.11.6/8.11.2) with ESMTP id hAI84VW27457 for ; Tue, 18 Nov 2003 09:04:31 +0100 (CET) Subject: Re: [Qemu-devel] [ADD] tests for PPC target. From: "J. Mayer" In-Reply-To: <1069142555.13659.2265.camel@rapid> References: <20031117105133.7e856e56.Jens.Arm@gmx.de> <1069140512.14646.2174.camel@rapid> <1069142555.13659.2265.camel@rapid> Content-Type: text/plain Message-Id: <1069142957.14646.2276.camel@rapid> Mime-Version: 1.0 Date: 18 Nov 2003 09:09:17 +0100 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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); +}