replace asm volatile("pause") with function
This commit is contained in:
+2
-1
@@ -4,6 +4,7 @@
|
||||
#include <zinnia/compiler.h>
|
||||
#include <zinnia/print.h>
|
||||
#include <zinnia/spin.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static struct clock* active_clock = nullptr;
|
||||
@@ -62,6 +63,6 @@ void clock_spin_ns(uint64_t ns) {
|
||||
|
||||
uint64_t target = clock_get_elapsed_ns() + ns;
|
||||
while (clock_get_elapsed_ns() < target) {
|
||||
// TODO: Maybe pause?
|
||||
arch_cpu_pause();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user