qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] cpu_x86() ?


From: Andreas Färber
Subject: Re: [Qemu-devel] cpu_x86() ?
Date: Tue, 01 Nov 2011 15:46:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

Am 01.11.2011 15:34, schrieb Jun Koi:
> On Tue, Nov 1, 2011 at 6:58 PM, Max Filippov <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]