forked from Bananymous/banan-os
Kernel: PIT now has very barebones sleep
This commit is contained in:
parent
1b45b4d728
commit
94cbacc998
|
@ -8,7 +8,7 @@ namespace PIT
|
|||
{
|
||||
|
||||
uint64_t ms_since_boot();
|
||||
|
||||
void initialize();
|
||||
void sleep(uint64_t);
|
||||
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue