HPET
include/acpi/hpet.h View source View on GitHubUnions
Section titled “Unions”hpet_timer_general_capabilities
Section titled “hpet_timer_general_capabilities”union hpet_timer_general_capabilities {
uint64_t raw;
struct {
uint64_t rev_id : 7;
uint64_t num_timers : 5;
uint64_t counter_size : 1;
uint64_t reserved : 1;
uint64_t leg_rt_cap : 1;
uint64_t vendor_id : 16;
uint64_t counter_clock_period : 32;
};
}; hpet_timer_config
Section titled “hpet_timer_config”union hpet_timer_config {
uint64_t raw;
struct {
uint64_t reserved0 : 1;
uint64_t interrupt_type : 1;
uint64_t interrupt_enable : 1;
uint64_t type : 1;
uint64_t periodic_capable : 1;
uint64_t size_capable : 1;
uint64_t value_set : 1;
uint64_t reserved1 : 1;
uint64_t timer_32bit : 1;
uint64_t ioapic_route : 5;
uint64_t fsb_int_enable : 1;
uint64_t fsb_int_delivery : 1;
uint64_t reserved2 : 16;
uint64_t route_cap : 32;
};
}; Functions
Section titled “Functions”hpet_init
Section titled “hpet_init”void hpet_init(void); hpet_timestamp_ns
Section titled “hpet_timestamp_ns”uint64_t hpet_timestamp_ns(void); hpet_program_oneshot
Section titled “hpet_program_oneshot”void hpet_program_oneshot(uint64_t future_ms); hpet_timestamp_ms
Section titled “hpet_timestamp_ms”uint64_t hpet_timestamp_ms(void); hpet_timestamp_us
Section titled “hpet_timestamp_us”uint64_t hpet_timestamp_us(void); hpet_disable
Section titled “hpet_disable”void hpet_disable(void); hpet_enable
Section titled “hpet_enable”void hpet_enable(void); hpet_clear_interrupt_status
Section titled “hpet_clear_interrupt_status”void hpet_clear_interrupt_status(void); hpet_setup_timer
Section titled “hpet_setup_timer”void hpet_setup_timer(uint8_t timer_index, irq_t irq_line, bool periodic, bool edge_triggered); hpet_write64
Section titled “hpet_write64”void hpet_write64(uint64_t offset, uint64_t value); hpet_read64
Section titled “hpet_read64”uint64_t hpet_read64(uint64_t offset); Variables
Section titled “Variables”hpet_base
Section titled “hpet_base”extern uint64_t *hpet_base; hpet_timer_count
Section titled “hpet_timer_count”extern uint64_t hpet_timer_count; hpet_fs_per_tick
Section titled “hpet_fs_per_tick”extern uint64_t hpet_fs_per_tick; Macros
Section titled “Macros”HPET_GEN_CAP_ID_OFFSET
Section titled “HPET_GEN_CAP_ID_OFFSET”#define HPET_GEN_CAP_ID_OFFSET 0x0 HPET_GEN_CONF_OFFSET
Section titled “HPET_GEN_CONF_OFFSET”#define HPET_GEN_CONF_OFFSET 0x10 HPET_GEN_INT_STAT_OFFSET
Section titled “HPET_GEN_INT_STAT_OFFSET”#define HPET_GEN_INT_STAT_OFFSET 0x20 HPET_IRQ_BASE
Section titled “HPET_IRQ_BASE”#define HPET_IRQ_BASE 2 HPET_MAIN_COUNTER_OFFSET
Section titled “HPET_MAIN_COUNTER_OFFSET”#define HPET_MAIN_COUNTER_OFFSET 0xF0 HPET_TIMER_CONF_OFFSET
Section titled “HPET_TIMER_CONF_OFFSET”#define HPET_TIMER_CONF_OFFSET(num) (0x100 + (num * 0x20)) HPET_TIMER_COMPARATOR_OFFSET
Section titled “HPET_TIMER_COMPARATOR_OFFSET”#define HPET_TIMER_COMPARATOR_OFFSET(num) (HPET_TIMER_CONF_OFFSET(num) + 0x8) HPET_CURRENT
Section titled “HPET_CURRENT”#define HPET_CURRENT (smp_core_id() % hpet_timer_count) HPET_IRQ_LINE
Section titled “HPET_IRQ_LINE”#define HPET_IRQ_LINE 2