1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 06:37:35 +00:00
serenity/Kernel/API
Andreas Kling fdfc66db61 Kernel+LibC: Allow clock_gettime() to run without syscalls
This patch adds a vDSO-like mechanism for exposing the current time as
an array of per-clock-source timestamps.

LibC's clock_gettime() calls sys$map_time_page() to map the kernel's
"time page" into the process address space (at a random address, ofc.)
This is only done on first call, and from then on the timestamps are
fetched from the time page.

This first patch only adds support for CLOCK_REALTIME, but eventually
we should be able to support all clock sources this way and get rid of
sys$clock_gettime() in the kernel entirely. :^)

Accesses are synchronized using two atomic integers that are incremented
at the start and finish of the kernel's time page update cycle.
2021-08-10 19:21:16 +02:00
..
FB.h WindowServer: Query driver for framebuffer offset 2021-07-04 23:59:17 +02:00
InodeWatcherEvent.h Kernel: Implement multi-watch InodeWatcher :^) 2021-05-12 22:38:20 +02:00
InodeWatcherFlags.h Kernel: Implement multi-watch InodeWatcher :^) 2021-05-12 22:38:20 +02:00
KeyCode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MousePacket.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Syscall.h Kernel+LibC: Allow clock_gettime() to run without syscalls 2021-08-10 19:21:16 +02:00
TimePage.h Kernel+LibC: Allow clock_gettime() to run without syscalls 2021-08-10 19:21:16 +02:00