[CPU] Implement mftb instruction natively.
When the cvars clock_no_scaling and clock_source_raw are set, tick counts will be directly calculated in the emitted code.
This commit is contained in:
@@ -134,6 +134,11 @@ void Clock::set_guest_time_scalar(double scalar) {
|
||||
RecomputeGuestTickScalar();
|
||||
}
|
||||
|
||||
std::pair<uint64_t, uint64_t> Clock::guest_tick_ratio() {
|
||||
std::lock_guard<std::mutex> lock(tick_mutex_);
|
||||
return guest_tick_ratio_;
|
||||
}
|
||||
|
||||
uint64_t Clock::guest_tick_frequency() { return guest_tick_frequency_; }
|
||||
|
||||
void Clock::set_guest_tick_frequency(uint64_t frequency) {
|
||||
|
||||
@@ -43,6 +43,8 @@ class Clock {
|
||||
// Sets the guest time scalar, adjusting tick and wall clock speed.
|
||||
// Ex: 1x=normal, 2x=double speed, 1/2x=half speed.
|
||||
static void set_guest_time_scalar(double scalar);
|
||||
// Get the tick ration between host and guest including time scaling if set.
|
||||
static std::pair<uint64_t, uint64_t> guest_tick_ratio();
|
||||
// Guest ticks-per-second.
|
||||
static uint64_t guest_tick_frequency();
|
||||
// Sets the guest ticks-per-second.
|
||||
|
||||
Reference in New Issue
Block a user