Kernel: Properly update the stored thread rbp when switching contexts
This commit is contained in:
parent
50b7183bd1
commit
0ee476948b
Notes:
sideshowbarker
2024-07-17 01:46:43 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/0ee476948b Pull-request: https://github.com/SerenityOS/serenity/pull/18413 Reviewed-by: https://github.com/Panky-codes
1 changed files with 2 additions and 0 deletions
|
@ -1723,6 +1723,7 @@ void Processor::switch_context(Thread*& from_thread, Thread*& to_thread)
|
|||
"shrq $32, %%rbx \n"
|
||||
"movl %%ebx, %[tss_rsp0h] \n"
|
||||
"movq %[to_rsp], %%rsp \n"
|
||||
"movq %%rbp, %[from_rbp] \n"
|
||||
"pushq %[to_thread] \n"
|
||||
"pushq %[from_thread] \n"
|
||||
"pushq %[to_rip] \n"
|
||||
|
@ -1748,6 +1749,7 @@ void Processor::switch_context(Thread*& from_thread, Thread*& to_thread)
|
|||
"popq %%rbx \n"
|
||||
"popfq \n"
|
||||
: [from_rsp] "=m" (from_thread->regs().rsp),
|
||||
[from_rbp] "=m" (from_thread->regs().rbp),
|
||||
[from_rip] "=m" (from_thread->regs().rip),
|
||||
[tss_rsp0l] "=m" (m_tss.rsp0l),
|
||||
[tss_rsp0h] "=m" (m_tss.rsp0h),
|
||||
|
|
Loading…
Add table
Reference in a new issue