Skip to contentSkip to conversation

tcg_qemu_tb_exec...

Qemu-devel Davide Ferraretto 2 participants 2 messages Jun 3, 2012 – Jun 4, 2012

lore
Share & tools
lore
#0 lore raw

I'm in qemu-arm.
tcg_qemu_tb_exec function is a macro:

#define tcg_qemu_tb_exec(env, tb_ptr)                                    \
    ((long REGPARM (*)(void *, void *))code_gen_prologue)(env, tb_ptr)

#endif

I don't understand what function calls. where is code of code_gen_prologue???

#1 lore raw
Quoted 5 lines · Davide Ferraretto

I'm in qemu-arm.
tcg_qemu_tb_exec function is a macro:

#define tcg_qemu_tb_exec(env, tb_ptr)                                    \
    ((long REGPARM (*)(void *, void *))code_gen_prologue)(env, tb_ptr)

#endif

QEMU treats execution in code cache as a function call. As you might know,
function has its prologue/epilogue, the "code_gen_prologue" stores the prologue/epilogue code. After executing prologue, it'll jump to the code cache (tb_ptr), then back to epilogue, finally return to QEMU.

Regards,
chenwj

[1] http://en.wikipedia.org/wiki/Function_prologue

Signature · 5 lines
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj