90 LOG_ERR(
"failed to register apic timer source\n");
static timer_source_t apicTimer
static void apic_timer_eoi(cpu_t *cpu)
static void apic_timer_set(irq_virt_t virt, clock_t uptime, clock_t timeout)
static uint64_t apic_timer_ticks_per_ms(void)
void interrupt_disable(void)
Disable interrupts and increment the disableDepth.
void interrupt_enable(void)
Decrement the CLI depth and enable interrupts if depth reaches zero and interrupts were previously en...
uint8_t irq_virt_t
Virtual IRQ numbers.
static cpuid_t cpu_get_id_unsafe(void)
Gets the current CPU ID.
#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.
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.
lapic_t * lapic_get(uint32_t cpuId)
Get the lapic data for the specified CPU.
uint32_t lapic_read(uint32_t reg)
Read from a local apic register.
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 subsystem.
@ APIC_TIMER_MASKED
Timer is masked (disabled)
uint64_t ticksPerMs
Initialized to 0, set on first use of the APIC timer on the CPU.