From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HqFD8-0003LP-P6 for qemu-devel@nongnu.org; Mon, 21 May 2007 17:14:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HqFD8-0003KQ-AB for qemu-devel@nongnu.org; Mon, 21 May 2007 17:14:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HqFD8-0003KA-44 for qemu-devel@nongnu.org; Mon, 21 May 2007 17:14:34 -0400 Received: from terminus.zytor.com ([192.83.249.54]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HqFD7-0006If-PL for qemu-devel@nongnu.org; Mon, 21 May 2007 17:14:34 -0400 Message-ID: <46520B81.1000901@zytor.com> Date: Mon, 21 May 2007 14:13:37 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 Subject: Re: [Qemu-devel] Using native libraries References: <200705211511.01631.luke@dashjr.org> In-Reply-To: <200705211511.01631.luke@dashjr.org> Content-Type: text/plain; charset=ISO-8859-1 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 Luke -Jr wrote: > I'm sure someone's probably had a similar idea before, and it's probably not > practical for some reason I'm overlooking-- but is there a reason Qemu can't > dynamically translate library calls to use the native libraries instead of > requiring emulated libraries as well? The easiest way to do that is by having an "RPC stub library" in the emulated environment which contains nothing but trap instructions -- like system calls -- that can be intercepted on the other side. At that point, one has to do translation of data types and pointers (called "thunking") before invoking the native library. Generating such "thunks" is usually done automatically, but it is still a fairly major effort. This kind of stuff is what underlies things like running PowerMac applications on IntelMacs (or 68kmac apps on PowerMac). -hpa