Revision 94451178
b/target-i386/helper.h | ||
---|---|---|
60 | 60 |
DEF_HELPER(void, helper_syscall, (int next_eip_addend)) |
61 | 61 |
DEF_HELPER(void, helper_sysret, (int dflag)) |
62 | 62 |
#endif |
63 |
DEF_HELPER(void, helper_hlt, (void))
|
|
63 |
DEF_HELPER(void, helper_hlt, (int next_eip_addend))
|
|
64 | 64 |
DEF_HELPER(void, helper_monitor, (target_ulong ptr)) |
65 |
DEF_HELPER(void, helper_mwait, (void))
|
|
65 |
DEF_HELPER(void, helper_mwait, (int next_eip_addend))
|
|
66 | 66 |
DEF_HELPER(void, helper_debug, (void)) |
67 | 67 |
DEF_HELPER(void, helper_raise_interrupt, (int intno, int next_eip_addend)) |
68 | 68 |
DEF_HELPER(void, helper_raise_exception, (int exception_index)) |
b/target-i386/op_helper.c | ||
---|---|---|
4547 | 4547 |
} |
4548 | 4548 |
#endif |
4549 | 4549 |
|
4550 |
void helper_hlt(void)
|
|
4550 |
static void do_hlt(void)
|
|
4551 | 4551 |
{ |
4552 |
helper_svm_check_intercept_param(SVM_EXIT_HLT, 0); |
|
4553 |
|
|
4554 | 4552 |
env->hflags &= ~HF_INHIBIT_IRQ_MASK; /* needed if sti is just before */ |
4555 | 4553 |
env->halted = 1; |
4556 | 4554 |
env->exception_index = EXCP_HLT; |
4557 | 4555 |
cpu_loop_exit(); |
4558 | 4556 |
} |
4559 | 4557 |
|
4558 |
void helper_hlt(int next_eip_addend) |
|
4559 |
{ |
|
4560 |
helper_svm_check_intercept_param(SVM_EXIT_HLT, 0); |
|
4561 |
EIP += next_eip_addend; |
|
4562 |
|
|
4563 |
do_hlt(); |
|
4564 |
} |
|
4565 |
|
|
4560 | 4566 |
void helper_monitor(target_ulong ptr) |
4561 | 4567 |
{ |
4562 | 4568 |
if ((uint32_t)ECX != 0) |
... | ... | |
4565 | 4571 |
helper_svm_check_intercept_param(SVM_EXIT_MONITOR, 0); |
4566 | 4572 |
} |
4567 | 4573 |
|
4568 |
void helper_mwait(void)
|
|
4574 |
void helper_mwait(int next_eip_addend)
|
|
4569 | 4575 |
{ |
4570 | 4576 |
if ((uint32_t)ECX != 0) |
4571 | 4577 |
raise_exception(EXCP0D_GPF); |
4572 | 4578 |
helper_svm_check_intercept_param(SVM_EXIT_MWAIT, 0); |
4579 |
EIP += next_eip_addend; |
|
4580 |
|
|
4573 | 4581 |
/* XXX: not complete but not completely erroneous */ |
4574 | 4582 |
if (env->cpu_index != 0 || env->next_cpu != NULL) { |
4575 | 4583 |
/* more than one CPU: do not sleep because another CPU may |
4576 | 4584 |
wake this one */ |
4577 | 4585 |
} else { |
4578 |
helper_hlt();
|
|
4586 |
do_hlt();
|
|
4579 | 4587 |
} |
4580 | 4588 |
} |
4581 | 4589 |
|
b/target-i386/translate.c | ||
---|---|---|
6420 | 6420 |
} else { |
6421 | 6421 |
if (s->cc_op != CC_OP_DYNAMIC) |
6422 | 6422 |
gen_op_set_cc_op(s->cc_op); |
6423 |
gen_jmp_im(s->pc - s->cs_base);
|
|
6424 |
tcg_gen_helper_0_0(helper_hlt);
|
|
6423 |
gen_jmp_im(pc_start - s->cs_base);
|
|
6424 |
tcg_gen_helper_0_1(helper_hlt, tcg_const_i32(s->pc - pc_start));
|
|
6425 | 6425 |
s->is_jmp = 3; |
6426 | 6426 |
} |
6427 | 6427 |
break; |
... | ... | |
6519 | 6519 |
if (!(s->cpuid_ext_features & CPUID_EXT_MONITOR) || |
6520 | 6520 |
s->cpl != 0) |
6521 | 6521 |
goto illegal_op; |
6522 |
if (s->cc_op != CC_OP_DYNAMIC) |
|
6523 |
gen_op_set_cc_op(s->cc_op); |
|
6522 | 6524 |
gen_jmp_im(pc_start - s->cs_base); |
6523 | 6525 |
#ifdef TARGET_X86_64 |
6524 | 6526 |
if (s->aflag == 2) { |
... | ... | |
6541 | 6543 |
gen_op_set_cc_op(s->cc_op); |
6542 | 6544 |
s->cc_op = CC_OP_DYNAMIC; |
6543 | 6545 |
} |
6544 |
gen_jmp_im(s->pc - s->cs_base);
|
|
6545 |
tcg_gen_helper_0_0(helper_mwait);
|
|
6546 |
gen_jmp_im(pc_start - s->cs_base);
|
|
6547 |
tcg_gen_helper_0_1(helper_mwait, tcg_const_i32(s->pc - pc_start));
|
|
6546 | 6548 |
gen_eob(s); |
6547 | 6549 |
break; |
6548 | 6550 |
default: |
Also available in: Unified diff