88 LOG_ERR(
"failed to register apic timer source\n");
static void apic_timer_eoi(void)
static timer_source_t apicTimer
static void apic_timer_set(irq_virt_t virt, clock_t uptime, clock_t timeout)
static uint64_t apic_timer_ticks_per_ms(void)
#define CLI_SCOPE()
Macro to increment CLI depth for the duration of the current scope.
uint8_t irq_virt_t
Virtual IRQ numbers.
uint32_t lapic_read(uint32_t reg)
Read from a local apic register.
lapic_t PERCPU _pcpu_lapic
The per-CPU local APIC structure.
void lapic_write(uint32_t reg, uint32_t value)
Write to a local apic register.
@ LAPIC_REG_TIMER_CURRENT_COUNT
@ LAPIC_REG_TIMER_INITIAL_COUNT
@ LAPIC_REG_TIMER_DIVIDER
uint64_t apic_timer_init(void)
Initialize the APIC timer.
@ APIC_TIMER_MASKED
Timer is masked (disabled)
#define LOG_ERR(format,...)
void clock_wait(clock_t nanoseconds)
Wait for a specified number of nanoseconds.
uint64_t timer_source_register(const timer_source_t *source)
Register a timer source.
#define UNUSED(x)
Mark a variable as unused.
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.
uint64_t ticksPerMs
Initialized to 0, set on first use of the APIC timer on the CPU.