cpu: better _cpu() function

This commit is contained in:
Matheus
2024-05-27 22:03:44 -03:00
parent 54c01081cc
commit 04d8431b32
+3 -3
View File
@@ -55,9 +55,9 @@ static inline uint16_t be_to_cpu_w(uint16_t w) {
}
static inline cpu_t *_cpu() {
volatile cpu_t *cpu;
asm volatile ("mov %%gs:0, %%rax" : "=a"(cpu));
return cpu->self;
cpu_t *cpu;
asm volatile ("mov %%gs:0, %%rax" : "=a"(cpu) : : "memory");
return cpu;
}
static inline void cpu_set(cpu_t *ptr) {