Revision 94451178 target-i386/op_helper.c
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 |
|
Also available in: Unified diff