+/* divisor encoded by bits 0,1,3 with bit 2 always 0: */
+#define LAPIC_TIMER_DIVIDE_MASK 0x0000000F
+#define LAPIC_TIMER_DIVIDE_2 0x00000000
+#define LAPIC_TIMER_DIVIDE_4 0x00000001
+#define LAPIC_TIMER_DIVIDE_8 0x00000002
+#define LAPIC_TIMER_DIVIDE_16 0x00000003
+#define LAPIC_TIMER_DIVIDE_32 0x00000008
+#define LAPIC_TIMER_DIVIDE_64 0x00000009
+#define LAPIC_TIMER_DIVIDE_128 0x0000000A
+#define LAPIC_TIMER_DIVIDE_1 0x0000000B
+
+#ifndef ASSEMBLER
+#include <stdint.h>
+typedef enum {
+ periodic,
+ one_shot
+} lapic_timer_mode_t;
+typedef enum {
+ divide_by_1 = LAPIC_TIMER_DIVIDE_1,
+ divide_by_2 = LAPIC_TIMER_DIVIDE_2,
+ divide_by_4 = LAPIC_TIMER_DIVIDE_4,
+ divide_by_8 = LAPIC_TIMER_DIVIDE_8,
+ divide_by_16 = LAPIC_TIMER_DIVIDE_16,
+ divide_by_32 = LAPIC_TIMER_DIVIDE_32,
+ divide_by_64 = LAPIC_TIMER_DIVIDE_64,
+ divide_by_128 = LAPIC_TIMER_DIVIDE_128
+} lapic_timer_divide_t;
+typedef uint32_t lapic_timer_count_t;
+#endif /* ASSEMBLER */