Kernel: PIT now has very barebones sleep

This commit is contained in:
Bananymous 2023-02-16 17:53:25 +02:00
parent 1b45b4d728
commit 94cbacc998
2 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,7 @@ namespace PIT
{
uint64_t ms_since_boot();
void initialize();
void sleep(uint64_t);
}

View File

@ -50,4 +50,11 @@ namespace PIT
InterruptController::get().enable_irq(PIT_IRQ);
}
void sleep(uint64_t ms)
{
uint64_t end = s_system_time + ms;
while (s_system_time < end)
asm volatile("hlt");
}
}