cpu: rename _cpu() to current_cpu()

This commit is contained in:
Matheus
2024-09-15 19:03:09 -03:00
parent 56d665d5a0
commit 16b6c86a5f
14 changed files with 94 additions and 94 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ int arch_context_saveandcall(void (*fn)(context_t *context, void *argument), voi
// kernelgsbase is set as user because they'll be swapped in the context switch
#define ARCH_CONTEXT_SWITCHTHREAD(x) \
_cpu()->ist.rsp0 = (uint64_t)(x)->kernelstacktop; \
current_cpu()->ist.rsp0 = (uint64_t)(x)->kernelstacktop; \
wrmsr(MSR_KERNELGSBASE, (x)->extracontext.gsbase); \
wrmsr(MSR_FSBASE, (x)->extracontext.fsbase); \
asm("fxrstor (%%rax)" : : "a"(&(x)->extracontext.fx[0])); \
@@ -99,7 +99,7 @@ int arch_context_saveandcall(void (*fn)(context_t *context, void *argument), voi
#define ARCH_CONTEXT_THREADLOAD(t, c) \
memcpy(c, &(t)->context, sizeof(context_t)); \
_cpu()->ist.rsp0 = (uint64_t)(t)->kernelstacktop; \
current_cpu()->ist.rsp0 = (uint64_t)(t)->kernelstacktop; \
wrmsr(MSR_KERNELGSBASE, (t)->extracontext.gsbase); \
wrmsr(MSR_FSBASE, (t)->extracontext.fsbase); \
asm("fxrstor (%%rax)" : : "a"(&(t)->extracontext.fx[0])); \
+1 -1
View File
@@ -62,7 +62,7 @@ static inline thread_t *current_thread(void) {
return thread;
}
static inline cpu_t *_cpu(void) {
static inline cpu_t *current_cpu(void) {
cpu_t *cpu;
asm volatile ("mov %%gs:8, %%rax" : "=a"(cpu) : : "memory");
return cpu;