mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
Kernel: Make some of the assembly code position-independent on x86_64
This commit is contained in:
parent
412ce31f7f
commit
a6c4a4d2fc
2 changed files with 5 additions and 5 deletions
|
@ -47,7 +47,7 @@ NAKED void do_assume_context(Thread*, u32)
|
|||
" movq %r12, %rsi \n" // from_thread
|
||||
" pushq %r12 \n" // to_thread (for thread_context_first_enter)
|
||||
" pushq %r12 \n" // from_thread (for thread_context_first_enter)
|
||||
" movabs $thread_context_first_enter, %r12 \n" // should be same as regs.rip
|
||||
" leaq thread_context_first_enter(%rip), %r12 \n" // should be same as regs.rip
|
||||
" pushq %r12 \n"
|
||||
" jmp enter_thread_context \n");
|
||||
// clang-format on
|
||||
|
@ -191,7 +191,7 @@ void Processor::switch_context(Thread*& from_thread, Thread*& to_thread)
|
|||
"pushq %%r14 \n"
|
||||
"pushq %%r15 \n"
|
||||
"movq %%rsp, %[from_rsp] \n"
|
||||
"movabs $1f, %%rbx \n"
|
||||
"leaq 1f(%%rip), %%rbx \n"
|
||||
"movq %%rbx, %[from_rip] \n"
|
||||
"movq %[to_rsp0], %%rbx \n"
|
||||
"movl %%ebx, %[tss_rsp0l] \n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue