36#define HPET_CAP_COUNTER_CLK_PERIOD_SHIFT 32
41#define HPET_CONF_ENABLE_CNF_BIT (1 << 0)
46#define HPET_CONF_LEG_RT_CNF_BIT (1 << 1)
51#define HPET_ADDRESS_SPACE_MEMORY 0
56#define HPET_ADDRESS_SPACE_IO 1
61#define HPET_FEMTOSECONDS_PER_SECOND 1000000000000000ULL
#define PACKED
GCC packed attribute.
void hpet_write(uint64_t reg, uint64_t value)
Write a value to an HPET register.
hpet_register_t
HPET register offsets.
void hpet_wait(clock_t nanoseconds)
Wait for a specified number of nanoseconds using the HPET.
clock_t hpet_nanoseconds_per_tick(void)
Retrieve the number of nanoseconds per HPET tick.
void hpet_reset_counter(void)
Reset the HPET main counter to 0 and enable the HPET.
uint64_t hpet_read(uint64_t reg)
Read a value from an HPET register.
uint64_t hpet_read_counter(void)
Read the current value of the HPET main counter.
@ HPET_REG_GENERAL_CONFIG
@ HPET_REG_GENERAL_CAPABILITIES_ID
@ HPET_REG_MAIN_COUNTER_VALUE
@ HPET_REG_GENERAL_INTERRUPT
@ HPET_REG_TIMER0_COMPARATOR
@ HPET_REG_TIMER0_CONFIG_CAP
__UINT64_TYPE__ clock_t
A nanosecond time.
High Precision Event Timer structure.
uint8_t legacyReplacementCapable
uint8_t registerBitOffset