81 bool bestSourceUpdated =
false;
85 bestSourceUpdated =
true;
89 LOG_INFO(
"registered timer source '%s'%s\n",
source->
name, bestSourceUpdated ?
" (best source)" :
"");
150 if (pcpu_timer->deadline <= deadline)
154 pcpu_timer->deadline = deadline;
#define CONFIG_MIN_TIMER_TIMEOUT
Minimum timer timeout configuration.
@ VECTOR_TIMER
See Timer subsystem for more information.
#define PERCPU_DEFINE_CTOR(type, name)
Macro to define a percpu variable with a constructor.
static clock_source_t source
Structure to describe the HPET to the sys time subsystem.
#define LOG_INFO(format,...)
static void rwlock_write_release(rwlock_t *lock)
Releases a rwlock from writing.
static void rwlock_read_release(rwlock_t *lock)
Releases a rwlock from reading.
#define RWLOCK_READ_SCOPE(lock)
Acquires a rwlock for reading for the reminder of the current scope.
static void rwlock_write_acquire(rwlock_t *lock)
Acquires a rwlock for writing, blocking until it is available.
#define RWLOCK_CREATE()
Create a rwlock initializer.
static void rwlock_read_acquire(rwlock_t *lock)
Acquires a rwlock for reading, blocking until it is available.
uint64_t timer_source_amount(void)
Get the amount of registered timer sources.
void timer_source_unregister(const timer_source_t *source)
Unregister a timer source.
#define TIMER_MAX_SOURCES
Maximum amount of timer sources.
void timer_ack_eoi(interrupt_frame_t *frame)
Acknowledge a timer interrupt and send EOI.
uint64_t timer_source_register(const timer_source_t *source)
Register a timer source.
void timer_set(clock_t now, clock_t deadline)
Schedule a one-shot timer interrupt on the current CPU.
#define ENOSPC
No space left on device.
#define EINVAL
Invalid argument.
#define errno
Error number variable.
#define UNUSED(x)
Mark a variable as unused.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ clock_t
A nanosecond time.
_PUBLIC void * memmove(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
Read-Write Ticket Lock structure.
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