mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Kernel: Add HPET::read_main_counter()
This commit is contained in:
parent
67e93745cb
commit
ceb5682b54
Notes:
sideshowbarker
2024-07-18 22:50:16 +09:00
Author: https://github.com/sppmacd Commit: https://github.com/SerenityOS/serenity/commit/ceb5682b540 Pull-request: https://github.com/SerenityOS/serenity/pull/5046 Issue: https://github.com/SerenityOS/serenity/issues/4490 Reviewed-by: https://github.com/tomuta ✅
@ -271,6 +271,12 @@ u64 HPET::update_time(u64& seconds_since_boot, u32& ticks_this_second, bool quer
|
||||
return (delta_ticks * 1000000000ull) / ticks_per_second;
|
||||
}
|
||||
|
||||
u64 HPET::read_main_counter() const
|
||||
{
|
||||
auto& main_counter = registers().main_counter_value;
|
||||
return ((u64)main_counter.high << 32) | (u64)main_counter.low;
|
||||
}
|
||||
|
||||
void HPET::enable_periodic_interrupt(const HPETComparator& comparator)
|
||||
{
|
||||
#if HPET_DEBUG
|
||||
|
@ -60,6 +60,7 @@ public:
|
||||
void disable_periodic_interrupt(const HPETComparator& comparator);
|
||||
|
||||
u64 update_time(u64& seconds_since_boot, u32& ticks_this_second, bool query_only);
|
||||
u64 read_main_counter() const;
|
||||
|
||||
Vector<unsigned> capable_interrupt_numbers(u8 comparator_number);
|
||||
Vector<unsigned> capable_interrupt_numbers(const HPETComparator&);
|
||||
|
Loading…
Reference in New Issue
Block a user