76 bool bestSourceUpdated =
false;
80 bestSourceUpdated =
true;
84 LOG_INFO(
"registered timer source '%s'%s\n",
source->
name, bestSourceUpdated ?
" (best source)" :
"");
@ VECTOR_TIMER
See Timer subsystem for more information.
static cpu_t * cpu_get_unsafe(void)
Gets the current CPU structure without disabling interrupts.
#define LOG_INFO(format,...)
void rwlock_write_acquire(rwlock_t *lock)
Acquires a rwlock for writing, blocking until it is available.
void rwlock_read_acquire(rwlock_t *lock)
Acquires a rwlock for reading, blocking until it is available.
#define RWLOCK_READ_SCOPE(lock)
Acquires a rwlock for reading for the reminder of the current scope.
void rwlock_read_release(rwlock_t *lock)
Releases a rwlock from reading.
void rwlock_write_release(rwlock_t *lock)
Releases a rwlock from writing.
#define RWLOCK_CREATE()
Create a rwlock initializer.
uint64_t timer_source_amount(void)
Get the amount of registered timer sources.
void timer_cpu_ctx_init(timer_cpu_ctx_t *ctx)
Initialize per-CPU timer context.
void timer_set(clock_t uptime, clock_t deadline)
Schedule a one-shot timer interrupt on the current CPU.
void timer_source_unregister(const timer_source_t *source)
Unregister a timer source.
void timer_ack_eoi(interrupt_frame_t *frame, cpu_t *self)
Acknowledge a timer interrupt and send EOI.
#define TIMER_MAX_SOURCES
Maximum amount of timer sources.
uint64_t timer_source_register(const timer_source_t *source)
Register a timer source.
#define CONFIG_MIN_TIMER_TIMEOUT
Minimum timer timeout configuration.
#define ENOSPC
No space left on device.
#define EINVAL
Invalid argument.
#define errno
Error number variable.
clock_t uptime(void)
System call for retreving the time since boot.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ clock_t
A nanosecond time.
static sys_time_source_t source
Structure to describe the HPET to the sys time subsystem.
_PUBLIC void * memmove(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
Read-Write Ticket Lock structure.
Per-CPU system time context.
clock_t volatile deadline
void(* set)(irq_virt_t virt, clock_t uptime, clock_t timeout)
Should set the one-shot timer to fire after the specified timeout.
static rwlock_t sourcesLock
static const timer_source_t * sources[TIMER_MAX_SOURCES]
static const timer_source_t * bestSource
static uint32_t sourceCount