mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 10:37:41 +00:00
Kernel: Only expose CLOCK_REALTIME_COARSE via the kernel time page
Non-COARSE clock sources may probably still require a syscall.
This commit is contained in:
parent
afa225f55c
commit
aaead6f332
2 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ namespace Kernel {
|
||||||
|
|
||||||
inline bool time_page_supports(clockid_t clock_id)
|
inline bool time_page_supports(clockid_t clock_id)
|
||||||
{
|
{
|
||||||
return clock_id == CLOCK_REALTIME;
|
return clock_id == CLOCK_REALTIME_COARSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TimePage {
|
struct TimePage {
|
||||||
|
|
|
@ -431,7 +431,7 @@ void TimeManagement::update_time_page()
|
||||||
{
|
{
|
||||||
auto* page = time_page();
|
auto* page = time_page();
|
||||||
u32 update_iteration = AK::atomic_fetch_add(&page->update2, 1u, AK::MemoryOrder::memory_order_acquire);
|
u32 update_iteration = AK::atomic_fetch_add(&page->update2, 1u, AK::MemoryOrder::memory_order_acquire);
|
||||||
page->clocks[CLOCK_REALTIME] = m_epoch_time;
|
page->clocks[CLOCK_REALTIME_COARSE] = m_epoch_time;
|
||||||
AK::atomic_store(&page->update1, update_iteration + 1u, AK::MemoryOrder::memory_order_release);
|
AK::atomic_store(&page->update1, update_iteration + 1u, AK::MemoryOrder::memory_order_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue