mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 06:58:22 +00:00
cpu: better _cpu() function
This commit is contained in:
@@ -55,9 +55,9 @@ static inline uint16_t be_to_cpu_w(uint16_t w) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline cpu_t *_cpu() {
|
static inline cpu_t *_cpu() {
|
||||||
volatile cpu_t *cpu;
|
cpu_t *cpu;
|
||||||
asm volatile ("mov %%gs:0, %%rax" : "=a"(cpu));
|
asm volatile ("mov %%gs:0, %%rax" : "=a"(cpu) : : "memory");
|
||||||
return cpu->self;
|
return cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void cpu_set(cpu_t *ptr) {
|
static inline void cpu_set(cpu_t *ptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user