All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Jun Koi <junkoi2004@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] cpu_x86() ?
Date: Tue, 01 Nov 2011 15:46:41 +0100	[thread overview]
Message-ID: <4EB00651.5040903@suse.de> (raw)
In-Reply-To: <CA+g7VZ0amKxq-0NuFym5CKMpgUggiYzvBqebammtoVr=bHRmvQ@mail.gmail.com>

Am 01.11.2011 15:34, schrieb Jun Koi:
> On Tue, Nov 1, 2011 at 6:58 PM, Max Filippov <jcmvbkbc@gmail.com> 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.
>>
> 
> ok, so which means cpu_exec is redefined accordingly to each architecture.
> 
> 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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2011-11-01 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 10:45 [Qemu-devel] cpu_x86() ? Jun Koi
2011-11-01 10:58 ` Max Filippov
2011-11-01 14:34   ` Jun Koi
2011-11-01 14:46     ` Andreas Färber [this message]
2011-11-01 14:47     ` Max Filippov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EB00651.5040903@suse.de \
    --to=afaerber@suse.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=junkoi2004@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.