#pragma once

#include <efi.h>

// PIT I/O ports
#define PIT_CHANNEL0_DATA  0x40
#define PIT_COMMAND_PORT   0x43

// PIT frequency
#define PIT_BASE_FREQ     1193182   // 1.193182 MHz
#define PIT_TICK_HZ       100       // 100 Hz tick (10ms per tick)

// Timer tick callback type
typedef void (*timer_callback_t)(void);

void pit_init(void);
void pit_set_tick_handler(timer_callback_t handler);
UINT64 pit_get_ticks(void);
