* [Qemu-devel] where is the definition of this fuction?
@ 2009-11-09 6:10 yuanzhu86
2009-11-09 9:02 ` Laurent Desnogues
0 siblings, 1 reply; 2+ messages in thread
From: yuanzhu86 @ 2009-11-09 6:10 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1688 bytes --]
Hi everyone:
as I want to analysis the source code of qemu now, and there is a litte trouble at this fuction:
in the file--Translate.c(target-i386)
Line 6113 :
case 0xea: /* ljmp im */
{
unsigned int selector, offset;
if (CODE64(s))
goto illegal_op;
ot = dflag ? OT_LONG : OT_WORD;
offset = insn_get(s, ot);
selector = insn_get(s, OT_WORD);
gen_op_movl_T0_im(selector);
gen_op_movl_T1_imu(offset);
}
goto do_ljmp;
------------------------------------------------------
do_ljmp:
if (s->pe && !s->vm86) {
if (s->cc_op != CC_OP_DYNAMIC)
gen_op_set_cc_op(s->cc_op);
gen_jmp_im(pc_start - s->cs_base);
tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]);
gen_helper_ljmp_protected(cpu_tmp2_i32, cpu_T[1],
tcg_const_i32(s->pc - pc_start));
} else {
gen_op_movl_seg_T0_vm(R_CS);
gen_op_movl_T0_T1();
gen_op_jmp_T0();
}
gen_eob(s);
break;
------------------------------------------------
this fucion:
gen_helper_ljmp_protected(cpu_tmp2_i32, cpu_T[1],
tcg_const_i32(s->pc - pc_start));
I guess it should use the fuction glue() to create,but I can not find where it is ,could someone tell me that if you konw !
thanks very much !look forward to your answer !
---------yuanzhu
11.09
[-- Attachment #2: Type: text/html, Size: 4820 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] where is the definition of this fuction?
2009-11-09 6:10 [Qemu-devel] where is the definition of this fuction? yuanzhu86
@ 2009-11-09 9:02 ` Laurent Desnogues
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Desnogues @ 2009-11-09 9:02 UTC (permalink / raw)
To: yuanzhu86; +Cc: qemu-devel
2009/11/9 yuanzhu86 <yuanzhu86@163.com>:
> Hi everyone:
> as I want to analysis the source code of qemu now, and there is a litte
> trouble at this fuction:
> in the file--Translate.c(target-i386)
>
> Line 6113 :
> case 0xea: /* ljmp im */
> {
> unsigned int selector, offset;
> if (CODE64(s))
> goto illegal_op;
> ot = dflag ? OT_LONG : OT_WORD;
> offset = insn_get(s, ot);
> selector = insn_get(s, OT_WORD);
> gen_op_movl_T0_im(selector);
> gen_op_movl_T1_imu(offset);
> }
> goto do_ljmp;
> ------------------------------------------------------
> do_ljmp:
> if (s->pe && !s->vm86) {
> if (s->cc_op != CC_OP_DYNAMIC)
> gen_op_set_cc_op(s->cc_op);
> gen_jmp_im(pc_start - s->cs_base);
> tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]);
> gen_helper_ljmp_protected(cpu_tmp2_i32, cpu_T[1],
> tcg_const_i32(s->pc - pc_start));
> } else {
> gen_op_movl_seg_T0_vm(R_CS);
> gen_op_movl_T0_T1();
> gen_op_jmp_T0();
> }
> gen_eob(s);
> break;
> ------------------------------------------------
> this fucion:
> gen_helper_ljmp_protected(cpu_tmp2_i32, cpu_T[1],
> tcg_const_i32(s->pc - pc_start));
> I guess it should use the fuction glue() to create,but I can not find where
> it is ,could someone tell me that if you konw !
> thanks very much !look forward to your answer !
Helper functions are built using macros.
This will find the definition:
grep -r ljmp_protected .
Laurent
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-09 9:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09 6:10 [Qemu-devel] where is the definition of this fuction? yuanzhu86
2009-11-09 9:02 ` Laurent Desnogues
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).