mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Wrong value for HPET
This commit is contained in:
parent
7cb935db05
commit
1f399e37af
@ -15,9 +15,18 @@ namespace Time
|
||||
void time::Sleep(uint64_t Milliseconds)
|
||||
{
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
uintptr_t Target = mminq(&((HPET *)hpet)->MainCounterValue) + (Milliseconds * 1000000000) / clk;
|
||||
uintptr_t Target = mminq(&((HPET *)hpet)->MainCounterValue) + (Milliseconds * 1000000000000) / clk;
|
||||
#ifdef DEBUG
|
||||
uint64_t Counter = mminq(&((HPET *)hpet)->MainCounterValue);
|
||||
while (Counter < Target)
|
||||
{
|
||||
Counter = mminq(&((HPET *)hpet)->MainCounterValue);
|
||||
CPU::Pause();
|
||||
}
|
||||
#else
|
||||
while (mminq(&((HPET *)hpet)->MainCounterValue) < Target)
|
||||
CPU::Pause();
|
||||
#endif
|
||||
#elif defined(__aarch64__)
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user