On 09/22/2011 07:05 AM, Xin Tong wrote:

I am new to QEMU, can anyone please tell me where the TB chaining code is in 
QEMU ?
Actually, TB chaining was implemented via TB list. You might want to look at 
Exec.c

In struct TranslationBlock, the following data are used to directly call 
another TB from
the code of this one.

    uint16_t tb_next_offset[2]; /* offset of original jump target */
#ifdef USE_DIRECT_JUMP
    uint16_t tb_jmp_offset[2]; /* offset of jump instruction */
#else
    unsigned long tb_next[2]; /* address of jump generated code */
#endif
    /* list of TBs jumping to this one. This is a circular list using
       the two least significant bits of the pointers to tell what is
       the next pointer: 0 = jmp_next[0], 1 = jmp_next[1], 2 =
       jmp_first */
    struct TranslationBlock *jmp_next[2];
    struct TranslationBlock *jmp_first; are used to directly call another TB 
from
       the code of this one

Thanks
Xin

--
Lei


Reply via email to