mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-12 22:17:11 -04:00
Use the counter for stall
This commit is contained in:
parent
3e168e192d
commit
32c906fde6
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user