summaryrefslogtreecommitdiff
path: root/Kernel/Time
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-07-14 21:46:32 -0600
committerAndreas Kling <kling@serenityos.org>2021-07-18 22:08:26 +0200
commita635ff4e600729fb7d12fdd16ac6ffbaa455bb30 (patch)
tree8625e110b4c9ca2510c3a8ac28b45bddae828af7 /Kernel/Time
parent7e77a2ec40bc339f41e75aa9fdc6744df449612c (diff)
downloadserenity-a635ff4e600729fb7d12fdd16ac6ffbaa455bb30.zip
Everywhere: Make tracking cpu usage independent from system ticks
This switches tracking CPU usage to more accurately measure time in user and kernel land using either the TSC or another time source. This will also come in handy when implementing a tickless kernel mode.
Diffstat (limited to 'Kernel/Time')
-rw-r--r--Kernel/Time/TimeManagement.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/Time/TimeManagement.h b/Kernel/Time/TimeManagement.h
index 1a68bbd2a1..9b8f2dfa13 100644
--- a/Kernel/Time/TimeManagement.h
+++ b/Kernel/Time/TimeManagement.h
@@ -80,6 +80,8 @@ private:
void set_system_timer(HardwareTimerBase&);
static void system_timer_tick(const RegisterState&);
+ static u64 scheduling_current_time(bool);
+
// Variables between m_update1 and m_update2 are synchronized
Atomic<u32> m_update1 { 0 };
u32 m_ticks_this_second { 0 };
@@ -91,6 +93,7 @@ private:
u32 m_time_ticks_per_second { 0 }; // may be different from interrupts/second (e.g. hpet)
bool m_can_query_precise_time { false };
+ bool m_updating_time { false }; // may only be accessed from the BSP!
RefPtr<HardwareTimerBase> m_system_timer;
RefPtr<HardwareTimerBase> m_time_keeper_timer;