replace asm volatile("pause") with function

This commit is contained in:
2026-10-15 21:20:31 +02:00
parent d7b20baf97
commit 7748a1dac8
8 changed files with 19 additions and 8 deletions
+2 -1
View File
@@ -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();
}
}