From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FoHd8-0003Hz-5Q for qemu-devel@nongnu.org; Thu, 08 Jun 2006 06:20:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FoHd2-0003Fn-Jx for qemu-devel@nongnu.org; Thu, 08 Jun 2006 06:20:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FoHd2-0003Fd-GL for qemu-devel@nongnu.org; Thu, 08 Jun 2006 06:20:40 -0400 Received: from [205.233.218.70] (helo=canuck.infradead.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FoHkq-0008FA-0C for qemu-devel@nongnu.org; Thu, 08 Jun 2006 06:28:44 -0400 Received: from pmac.infradead.org ([81.187.2.168]) by canuck.infradead.org with esmtpsa (Exim 4.62 #1 (Red Hat Linux)) id 1FoHcy-0005CF-T8 for qemu-devel@nongnu.org; Thu, 08 Jun 2006 06:20:37 -0400 Subject: Re: [Qemu-devel] [PATCH] Remove abuse of kernel headers. From: David Woodhouse In-Reply-To: <1149718365.1608.35.camel@shinybook.infradead.org> References: <1149718365.1608.35.camel@shinybook.infradead.org> Content-Type: text/plain Date: Thu, 08 Jun 2006 11:20:34 +0100 Message-Id: <1149762034.13596.132.camel@pmac.infradead.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Wed, 2006-06-07 at 23:12 +0100, David Woodhouse wrote: > The _syscallX() macros in the kernel's private headers are not suitable > for use in userspace. This patch switches from abusing those to using > the syscall() function which glibc provides. One more instance... --- qemu-0.8.1/target-i386/helper2.c.orig 2006-06-08 11:09:41.000000000 +0100 +++ qemu-0.8.1/target-i386/helper2.c 2006-06-08 11:10:30.000000000 +0100 @@ -35,7 +35,10 @@ #include #include -_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount) +int modify_ldt(int func, void *ptr, unsigned long bytecount) +{ + return syscall(__NR_modify_ldt, func, ptr, bytecount); +} #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66) #define modify_ldt_ldt_s user_desc -- dwmw2