Fix the TSC at 733 MHz

The time stamp counter (accessed via `rdtsc`) may be used as a
performance counter in some titles. On the Xbox, the TSC runs
at a constant 733 MHz.
This commit is contained in:
Matt Borgerson 2016-08-03 23:13:38 -07:00
parent 81dd2188c4
commit e3d643ea16
1 changed files with 5 additions and 0 deletions

View File

@ -144,7 +144,12 @@ static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size)
/* TSC handling */
uint64_t cpu_get_tsc(CPUX86State *env)
{
#ifdef TARGET_XBOX
return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), 733333333,
get_ticks_per_sec());
#else
return cpu_get_ticks();
#endif
}
/* SMM support */