Very simple threading and context switching.
This commit is contained in:
25
src/kernel/proc/swtch.S
Normal file
25
src/kernel/proc/swtch.S
Normal file
@@ -0,0 +1,25 @@
|
||||
.intel_syntax noprefix
|
||||
|
||||
.global swtch
|
||||
|
||||
swtch:
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
push r15
|
||||
push r14
|
||||
push r13
|
||||
push r12
|
||||
push rbx
|
||||
push rbp
|
||||
|
||||
mov [rdi], rsp
|
||||
mov rsp, [rsi]
|
||||
|
||||
pop rbp
|
||||
pop rbx
|
||||
pop r12
|
||||
pop r13
|
||||
pop r14
|
||||
pop r15
|
||||
leaveq
|
||||
ret
|
||||
Reference in New Issue
Block a user