summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64/HalCommonAPI.asm
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 18:42:59 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 18:42:59 +0200
commitd126ebf73370fbc64913aa6ff19db56a39f625b2 (patch)
treedb66ede0635b1a6a5f13b8f7e161b68ed631226b /dev/kernel/HALKit/AMD64/HalCommonAPI.asm
parent6a30f42d5dcd0f944262147b2806db6c14fe7ffc (diff)
feat(kernel): pushing the fixes regarding the scheduler, and working on
making the LAPIC work correctly. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalCommonAPI.asm')
-rw-r--r--dev/kernel/HALKit/AMD64/HalCommonAPI.asm30
1 files changed, 29 insertions, 1 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalCommonAPI.asm b/dev/kernel/HALKit/AMD64/HalCommonAPI.asm
index c1dfc66a..432f79d3 100644
--- a/dev/kernel/HALKit/AMD64/HalCommonAPI.asm
+++ b/dev/kernel/HALKit/AMD64/HalCommonAPI.asm
@@ -79,4 +79,32 @@ mp_system_call_handler:
o64 sysret
-[bits 16]
+
+section .text
+
+global sched_jump_to_task
+
+;; Jump to the task from its stack frame.
+sched_jump_to_task:
+ push rbp
+ mov rbp, rsp
+
+ mov r8, [rcx + 0x10]
+ mov r9, [rcx + 0x18]
+ mov r10, [rcx + 0x20]
+ mov r11, [rcx + 0x28]
+ mov r12, [rcx + 0x30]
+ mov r13, [rcx + 0x38]
+ mov r14, [rcx + 0x40]
+ mov r15, [rcx + 0x48]
+
+ mov rax, [rcx + 0x00]
+ mov rsp, [rcx + 0x08] ; SP
+
+ jmp rax
+
+global rtl_ne_task
+
+rtl_ne_task:
+ jmp $
+ ret \ No newline at end of file