summaryrefslogtreecommitdiff
path: root/src/common/x64/native_clock.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-06-28 12:37:50 -0400
committerGitHub <noreply@github.com>2020-06-28 12:37:50 -0400
commitb05795d704e0c194215f815a5703db09e524b59a (patch)
treeecf4023b4ee0c91555c1d8263762fcb9dcb04a17 /src/common/x64/native_clock.h
parent8596a127724e9d7e27c4d7d9becd323c8d6d4f8e (diff)
parent2f8947583f2f0af4058600243d6c1d244e3c4890 (diff)
Merge pull request #3955 from FernandoS27/prometheus-2b
Remake Kernel Scheduling, CPU Management & Boot Management (Prometheus)
Diffstat (limited to 'src/common/x64/native_clock.h')
-rw-r--r--src/common/x64/native_clock.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/x64/native_clock.h b/src/common/x64/native_clock.h
index b58cf9f5a..891a3bbfd 100644
--- a/src/common/x64/native_clock.h
+++ b/src/common/x64/native_clock.h
@@ -26,9 +26,16 @@ public:
u64 GetCPUCycles() override;
+ void Pause(bool is_paused) override;
+
private:
u64 GetRTSC();
+ /// value used to reduce the native clocks accuracy as some apss rely on
+ /// undefined behavior where the level of accuracy in the clock shouldn't
+ /// be higher.
+ static constexpr u64 inaccuracy_mask = ~(0x400 - 1);
+
SpinLock rtsc_serialize{};
u64 last_measure{};
u64 accumulated_ticks{};