diff --git a/arch/x86_64/pit.c b/arch/x86_64/pit.c index b6b248a..d8e5cd8 100644 --- a/arch/x86_64/pit.c +++ b/arch/x86_64/pit.c @@ -8,7 +8,6 @@ static unsigned long long tick_counter = 0; static int pit_callback(void) { tick_counter++; - printk("tick"); return 0; } @@ -18,6 +17,8 @@ static irq_hook_t pit_irq_hook = { void pit_start(unsigned int hz) { + tick_counter = 0; + unsigned int divisor = 1193180 / hz; outportb(0x43, 0x36); @@ -49,7 +50,6 @@ void pit_wait(unsigned int ticks) { unsigned long long end = tick_counter + ticks; - while (tick_counter < end) { - ml_cpu_pause(); + while (READ_ONCE(tick_counter) < end) { } }