Revision 3d7374c5 target-i386/helper.c
b/target-i386/helper.c | ||
---|---|---|
3408 | 3408 |
} |
3409 | 3409 |
#endif |
3410 | 3410 |
|
3411 |
void helper_hlt(void) |
|
3412 |
{ |
|
3413 |
env->hflags &= ~HF_INHIBIT_IRQ_MASK; /* needed if sti is just before */ |
|
3414 |
env->hflags |= HF_HALTED_MASK; |
|
3415 |
env->exception_index = EXCP_HLT; |
|
3416 |
cpu_loop_exit(); |
|
3417 |
} |
|
3418 |
|
|
3419 |
void helper_monitor(void) |
|
3420 |
{ |
|
3421 |
if (ECX != 0) |
|
3422 |
raise_exception(EXCP0D_GPF); |
|
3423 |
/* XXX: store address ? */ |
|
3424 |
} |
|
3425 |
|
|
3426 |
void helper_mwait(void) |
|
3427 |
{ |
|
3428 |
if (ECX != 0) |
|
3429 |
raise_exception(EXCP0D_GPF); |
|
3430 |
/* XXX: not complete but not completely erroneous */ |
|
3431 |
if (env->cpu_index != 0 || env->next_cpu != NULL) { |
|
3432 |
/* more than one CPU: do not sleep because another CPU may |
|
3433 |
wake this one */ |
|
3434 |
} else { |
|
3435 |
helper_hlt(); |
|
3436 |
} |
|
3437 |
} |
|
3438 |
|
|
3411 | 3439 |
float approx_rsqrt(float a) |
3412 | 3440 |
{ |
3413 | 3441 |
return 1.0 / sqrt(a); |
Also available in: Unified diff