1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:27:34 +00:00

Kernel: Add TimeManagement::now_as_timeval()

Hide the implementation of time-of-day computation in TimeManagement.
This commit is contained in:
Andreas Kling 2020-05-16 11:33:24 +02:00
parent 2dc051c866
commit 2d35810e0a
3 changed files with 8 additions and 2 deletions

View file

@ -115,6 +115,11 @@ TimeManagement::TimeManagement(bool probe_non_legacy_hardware_timers)
ASSERT_NOT_REACHED();
}
timeval TimeManagement::now_as_timeval()
{
return { s_time_management->epoch_time(), (suseconds_t)s_time_management->ticks_this_second() * (suseconds_t)1000 };
}
Vector<HardwareTimer*> TimeManagement::scan_and_initialize_periodic_timers()
{
bool should_enable = is_hpet_periodic_mode_allowed();

View file

@ -60,6 +60,8 @@ public:
static bool is_hpet_periodic_mode_allowed();
static timeval now_as_timeval();
private:
explicit TimeManagement(bool probe_non_legacy_hardware_timers);
bool probe_and_set_legacy_hardware_timers();