24#define TIMER_MAX_CALLBACK 16
void timer_interrupt_handler(interrupt_frame_t *frame, cpu_t *self)
Handle timer interrupt.
time_t timer_unix_epoch(void)
The unix epoch.
void(* timer_callback_t)(interrupt_frame_t *frame, cpu_t *self)
Timer callback function type.
void timer_notify_self(void)
Trigger timer interrupt on self.
#define TIMER_MAX_CALLBACK
Maximum amount of timer callbacks.
void timer_one_shot(cpu_t *self, clock_t uptime, clock_t timeout)
Schedule a one-shot timer interrupt.
void timer_unsubscribe(timer_ctx_t *ctx, timer_callback_t callback)
Unsubscribe from timer interrupts.
void timer_subscribe(timer_ctx_t *ctx, timer_callback_t callback)
Subscribe to timer interrupts.
void timer_notify(cpu_t *cpu)
Trigger timer interrupt on cpu.
clock_t timer_uptime(void)
Time since boot.
void timer_ctx_init(timer_ctx_t *ctx)
Initialize per-CPU timer context.
clock_t uptime(void)
System call for retreving the time since boot.
__UINT64_TYPE__ clock_t
A nanosecond time.
A simple ticket lock implementation.
Per-CPU system time context.
clock_t nextDeadline
The next time the owner cpus apic timer will fire, specified in nanoseconds since boot,...
uint64_t apicTicksPerNs
The amount of ticks in the owner cpus apic timer that occur every nanosecond, stored using fixed poin...
long long unsigned time_t