From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C6ST7-0007rH-C3 for qemu-devel@nongnu.org; Sun, 12 Sep 2004 07:24:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C6ST2-0007pt-CR for qemu-devel@nongnu.org; Sun, 12 Sep 2004 07:24:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C6ST2-0007pc-6Q for qemu-devel@nongnu.org; Sun, 12 Sep 2004 07:24:24 -0400 Received: from [62.241.160.73] (helo=colossus.systems.pipex.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C6SMy-0006Jt-O3 for qemu-devel@nongnu.org; Sun, 12 Sep 2004 07:18:08 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [patch] Fix uname syscall Date: Sun, 12 Sep 2004 12:18:04 +0100 References: <200409111933.10136.paul@codesourcery.com> <20040911185407.GE19740@xi.wantstofly.org> In-Reply-To: <20040911185407.GE19740@xi.wantstofly.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409121218.04285.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Saturday 11 September 2004 19:54, Lennert Buytenhek wrote: > On Sat, Sep 11, 2004 at 07:33:10PM +0100, Paul Brook wrote: > > +#define UNAME_MACHINE "armv4" > > Wouldn't this be armv4l/armv4b (depending on endianness)? Yes. Updated patch below. Paul Index: syscall.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/syscall.c,v retrieving revision 1.50 diff -u -p -r1.50 syscall.c --- syscall.c 19 Jun 2004 16:59:03 -0000 1.50 +++ syscall.c 12 Sep 2004 11:11:26 -0000 @@ -72,6 +72,21 @@ /* 16 bit uid wrappers emulation */ #define USE_UID16 #endif +#if defined(TARGET_ARM) +#if defined(TARGET_WORDS_BIGENDIAN) +#define UNAME_MACHINE "armv4b" +#else +#define UNAME_MACHINE "armv4l" +#endif +#elif defined(TARGET_I386) +#define UNAME_MACHINE "i686" +#elif defined(TARGET_PPC) +#define UNAME_MACHINE "ppc" +#elif defined(TARGET_SPARC) +#define UNAME_MACHINE "sun4" +#else +#error unsupported CPU +#endif //#include #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) @@ -2391,8 +2410,17 @@ long do_syscall(void *cpu_env, int num, ret = get_errno(setdomainname((const char *)arg1, arg2)); break; case TARGET_NR_uname: - /* no need to transcode because we use the linux syscall */ - ret = get_errno(sys_uname((struct new_utsname *)arg1)); + { + struct new_utsname * buf; + + buf = (struct new_utsname *)arg1; + ret = get_errno(sys_uname(buf)); + if (!is_error(ret)) { + /* Overrite the native machine name with whatever is being + emulated. */ + strcpy (buf->machine, UNAME_MACHINE); + } + } break; #ifdef TARGET_I386 case TARGET_NR_modify_ldt: