Skip to contentSkip to conversation

Questions on "hidden" functions in QEMU source code

Qemu-devel Jun Koi 4 participants 5 messages Oct 16, 2007 – Oct 20, 2007

lore
Share & tools
lore

Jun Koi

author
#0 lore raw

Hi,

I am looking at the source code of QEMU, and there are some mystery to
me: some functions are not defined anywhere.

For example, functions like compute_all_incb() and compute_c_incl() in target-i386/op.c are never defined anywhere.

So how the compilation process generates these functions?

Another question: micro-op are defined as OPPROTO, but OPPROTO is actually defined as empty in dyngen-exec.h

#define OPPROTO

So what is the point of using OPPROTO here? I am sure that there is a good reason to do that, but cannot figure it out.

Many thanks,
Jun

#1 lore raw
Quoted 2 lines · Jun Koi

For example, functions like compute_all_incb() and compute_c_incl() in target-i386/op.c are never defined anywhere.

compute_all_inc* are defined in ops_template.h:~171. You'll notice that ops_template.h is included four times from op.c.

Quoted 7 lines

Another question: micro-op are defined as OPPROTO, but OPPROTO is actually defined as empty in dyngen-exec.h

#define OPPROTO

So what is the point of using OPPROTO here? I am sure that there is a good reason to do that, but cannot figure it out.

Presumably so that attributes can be defined later if they're needed.

Cheers,

Signature · 1 line
Stuart Brady
author
#3 lore raw
Quoted 8 lines · Johannes Schindelin

Hi,

Quoted 4 lines · Stuart Brady
Quoted 2 lines · Jun Koi

For example, functions like compute_all_incb() and compute_c_incl() in target-i386/op.c are never defined anywhere.

Quoted 7 lines
Quoted 2 lines

compute_all_inc* are defined in ops_template.h:~171. You'll notice that ops_template.h is included four times from op.c.

If you wonder why it is included four times, this might help:

http://libvncserver.sourceforge.net/qemu/qemu-templates-ala-Fabrice.txt

Now it is clear that those stuffs are generated by dyngen, thanks.

But still it it not obvious to me what is the purpose of "OPPROTO" when defining micro-ops. May you elaborate this a bit more?

Many thanks,
Jun

Quoted 6 lines

Hth,
Dscho