|
PatchworkOS
28a9544
A non-POSIX operating system.
|
#include <kernel/sched/sys_time.h>#include <kernel/cpu/cpu.h>#include <kernel/cpu/interrupt.h>#include <kernel/cpu/syscalls.h>#include <kernel/drivers/apic.h>#include <kernel/drivers/rtc.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 <stdbool.h>#include <stdint.h>#include <sys/math.h>Go to the source code of this file.
Functions | |
| static void | timer_boot_epoch_init (void) |
| uint64_t | sys_time_register_source (const sys_time_source_t *source) |
| Register a system timer source. | |
| void | sys_time_unregister_source (const sys_time_source_t *source) |
| Unregister a system timer source. | |
| clock_t | sys_time_uptime (void) |
| Time since boot. | |
| time_t | sys_time_unix_epoch (void) |
| The unix epoch. | |
| void | sys_time_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 time_t | bootEpoch = 0 |
| static bool | bootEpochInitialized = false |
| static sys_time_source_t * | sources [SYS_TIME_MAX_SOURCES] |
| static uint32_t | sourceCount = 0 |
| static sys_time_source_t * | bestSource = NULL |
| static rwlock_t | sourcesLock = RWLOCK_CREATE |
| SYSCALL_DEFINE | ( | SYS_UNIX_EPOCH | , |
| time_t | , | ||
| time_t * | timePtr | ||
| ) |
Definition at line 151 of file sys_time.c.
References ERR, NULL, sched_thread(), sys_time_unix_epoch(), and thread_copy_to_user().
| SYSCALL_DEFINE | ( | SYS_UPTIME | , |
| clock_t | |||
| ) |
Definition at line 146 of file sys_time.c.
References sys_time_uptime().
|
static |
Definition at line 27 of file sys_time.c.
References bootEpoch, bootEpochInitialized, mktime(), rtc_read(), and time().
Referenced by sys_time_unix_epoch().
|
static |
Definition at line 24 of file sys_time.c.
Referenced by sys_time_register_source(), sys_time_unregister_source(), and sys_time_uptime().
|
static |
Definition at line 19 of file sys_time.c.
Referenced by sys_time_unix_epoch(), and timer_boot_epoch_init().
Definition at line 20 of file sys_time.c.
Referenced by sys_time_unix_epoch(), and timer_boot_epoch_init().
|
static |
Definition at line 23 of file sys_time.c.
Referenced by sys_time_register_source(), and sys_time_unregister_source().
|
static |
Definition at line 22 of file sys_time.c.
Referenced by sys_time_register_source(), and sys_time_unregister_source().
|
static |
Definition at line 25 of file sys_time.c.
Referenced by sys_time_register_source(), sys_time_unregister_source(), and sys_time_uptime().