From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLFd8-0001Vi-5z for qemu-devel@nongnu.org; Tue, 01 Nov 2011 10:48:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLFd2-00014w-Kv for qemu-devel@nongnu.org; Tue, 01 Nov 2011 10:47:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48497 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLFd2-00014q-Ex for qemu-devel@nongnu.org; Tue, 01 Nov 2011 10:47:52 -0400 Message-ID: <4EB00651.5040903@suse.de> Date: Tue, 01 Nov 2011 15:46:41 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] cpu_x86() ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Koi Cc: Max Filippov , qemu-devel@nongnu.org Am 01.11.2011 15:34, schrieb Jun Koi: > On Tue, Nov 1, 2011 at 6:58 PM, Max Filippov wrote= : >>> the way cpu_exec() is defined is really confused to me. >>> >>> in cpu-exec.c, we define cpu_exec() function. >>> >>> however, each architecture seems to redefine cpu_exec(), like we have >>> in target-i386/cpu.h >>> >>> #define cpu_exec cpu_x86_exec >>> >>> so which cpu_exec() is executed in case of tcg/x86? >>> >>> also, i cannot find the definition of cpu_x86_exec() anywhere. >> >> cpu_exec definition in cpu-exec.c takes place after #include "cpu.h" >> which contains #define cpu_exec whatever. >> In case of x86 cpu_x86_exec is actually defined by the cpu-exec.c. >> >=20 > ok, so which means cpu_exec is redefined accordingly to each architectu= re. >=20 > why do we need to do this weird thing? as there is no namespace > collision it seems between architectures, why dont we just let > cpu_exec() be cpu_exec()? See the recent discussion about heterogeneous system emulation. Such redefinitions are a handy way to avoid name collisions across architectures. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg