qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] cpu_x86() ?


From: Max Filippov
Subject: Re: [Qemu-devel] cpu_x86() ?
Date: Tue, 1 Nov 2011 18:47:59 +0400
User-agent: KMail/1.13.7 (Linux/2.6.40.6-0.fc15.x86_64; KDE/4.6.5; x86_64; ; )

> > 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()?
> 
> is this a trick? i cannot figure out why.

One theory about it is the following (quoted from 
http://lists.nongnu.org/archive/html/qemu-devel/2011-05/msg02921.html):

One of the long standing goals for QEMU has been to be able to use a
single executable to emulate multiple architectures. I think for
example the lines like
#define cpu_init cpu_sparc_init
#define cpu_exec cpu_sparc_exec
etc. stand for this purpose, so there has been some consideration for this.

Thanks.
-- Max



reply via email to

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