mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
kernel threads
kernel threads and preemptive multitasking
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
global arch_switchcontext
|
||||
arch_switchcontext:
|
||||
mov rsp,rdi
|
||||
add rsp, 8 ; cr2
|
||||
pop rax
|
||||
mov gs,rax
|
||||
pop rax
|
||||
mov fs,rax
|
||||
pop rax
|
||||
mov es,rax
|
||||
pop rax
|
||||
mov ds,rax
|
||||
pop rax
|
||||
pop rbx
|
||||
pop rcx
|
||||
pop rdx
|
||||
pop r8
|
||||
pop r9
|
||||
pop r10
|
||||
pop r11
|
||||
pop r12
|
||||
pop r13
|
||||
pop r14
|
||||
pop r15
|
||||
pop rdi
|
||||
pop rsi
|
||||
pop rbp
|
||||
add rsp,8 ; remove error code
|
||||
|
||||
swapgs
|
||||
|
||||
iretq
|
||||
Reference in New Issue
Block a user