|
PatchworkOS
966e257
A non-POSIX operating system.
|
#include <kernel/sched/clock.h>#include <kernel/cpu/cpu.h>#include <kernel/cpu/interrupt.h>#include <kernel/cpu/syscall.h>#include <kernel/log/log.h>#include <kernel/log/panic.h>#include <kernel/module/symbol.h>#include <kernel/sched/thread.h>#include <kernel/sched/timer.h>#include <kernel/sync/rwlock.h>#include <stdatomic.h>#include <stdbool.h>#include <stdint.h>#include <sys/math.h>Go to the source code of this file.
Functions | |
| static void | clock_update_best_sources (void) |
| uint64_t | clock_source_register (const clock_source_t *source) |
| Register a system timer source. | |
| void | clock_source_unregister (const clock_source_t *source) |
| Unregister a system timer source. | |
| clock_t | clock_uptime (void) |
| Retrieve the time in nanoseconds since boot. | |
| time_t | clock_epoch (void) |
| Retrieve the seconds since the unix epoch. | |
| void | clock_wait (clock_t nanoseconds) |
| Wait for a specified number of nanoseconds. | |
| SYSCALL_DEFINE (SYS_UPTIME, clock_t) | |
| SYSCALL_DEFINE (SYS_UNIX_EPOCH, time_t, time_t *timePtr) | |
Variables | |
| static const clock_source_t * | sources [CLOCK_MAX_SOURCES] = {0} |
| static uint32_t | sourceCount = 0 |
| static const clock_source_t * | bestNsSource = NULL |
| static const clock_source_t * | bestEpochSource = NULL |
| static rwlock_t | sourcesLock = RWLOCK_CREATE() |
|
static |
| SYSCALL_DEFINE | ( | SYS_UPTIME | , |
| clock_t | |||
| ) |
| SYSCALL_DEFINE | ( | SYS_UNIX_EPOCH | , |
| time_t | , | ||
| time_t * | timePtr | ||
| ) |
|
static |
|
static |
|
static |
|
static |