Questions on "hidden" functions in QEMU source code
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
Quoted 2 lines · Jun Koi
For example, functions like
compute_all_incb()andcompute_c_incl()intarget-i386/op.care 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
Hi,
Quoted 6 lines · Stuart Brady
Quoted 2 lines · Jun Koi
For example, functions like
compute_all_incb()andcompute_c_incl()intarget-i386/op.care never defined anywhere.compute_all_inc* are defined in ops_template.h:~171. You'll notice that
ops_template.his included four times fromop.c.
If you wonder why it is included four times, this might help:
http://libvncserver.sourceforge.net/qemu/qemu-templates-ala-Fabrice.txt
Hth,
Dscho
Quoted 8 lines · Johannes Schindelin
Hi,
Quoted 4 lines · Stuart Brady
Quoted 2 lines · Jun Koi
For example, functions like
compute_all_incb()andcompute_c_incl()intarget-i386/op.care 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.his included four times fromop.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
Quoted 3 lines · Johannes Schindelin
If you wonder why it is included four times, this might help:
http://libvncserver.sourceforge.net/qemu/qemu-templates-ala-Fabrice.txt
Is that linked from qemu.org/user-doc.html somewhere?
Rob
Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.