From 32c906fde62a13dc9b8065f9532ce3d556da554c Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Wed, 10 Aug 2016 19:52:35 +0200 Subject: [PATCH] Use the counter for stall --- kernel/src/thor_acpi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/src/thor_acpi.cpp b/kernel/src/thor_acpi.cpp index 7ab07bab..308a8dfe 100644 --- a/kernel/src/thor_acpi.cpp +++ b/kernel/src/thor_acpi.cpp @@ -166,11 +166,11 @@ void AcpiOsSleep(UINT64 ms){ * \brief Active sleep for the given number of microseconds */ void AcpiOsStall(UINT32 us){ - auto ticks = timer::ticks(); - auto wait = us * (timer::timer_frequency() / 1000000); + uint64_t c = timer::counter(); + uint64_t wait = us * (timer::counter_frequency() / double(1000000)); wait = !wait ? 1 : wait; - while(timer::ticks() != ticks + wait){ + while(timer::counter() != c + wait){ asm volatile("nop"); asm volatile("nop"); asm volatile("nop");