Very simple threading and context switching.

This commit is contained in:
2018-01-05 17:07:22 +01:00
parent 63ae2a0b9d
commit 1e2f81a5d8
4 changed files with 132 additions and 0 deletions

25
src/kernel/proc/swtch.S Normal file
View 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