summaryrefslogtreecommitdiff
path: root/kernel/source/application.asm
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-05-20 17:40:47 -0400
committerBenji Dial <benji@benjidial.net>2024-05-20 17:40:47 -0400
commit9af5588c30c4126a2800aae1afcb0de2c373dc6c (patch)
treed2a48a97b1664f958b5f88a8b0c03ef8366b0f49 /kernel/source/application.asm
parent5a54df93c4e9368c36e69d1e9c88cd2904e92308 (diff)
downloadhilbert-os-9af5588c30c4126a2800aae1afcb0de2c373dc6c.tar.gz
rewrite application stuff in the kernel to support multitasking
Diffstat (limited to 'kernel/source/application.asm')
-rw-r--r--kernel/source/application.asm11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/source/application.asm b/kernel/source/application.asm
index ed8b190..632822f 100644
--- a/kernel/source/application.asm
+++ b/kernel/source/application.asm
@@ -137,9 +137,12 @@ resume_thread:
extern copy_syscall_stack
;rdi = bottom
+;returns: pointer to copy
-global save_thread_state
-save_thread_state:
+extern resume_next_thread
+
+global yield
+yield:
;rdi = pointer to cpu state structure
;only saving registers that need to be preserved by this function
@@ -163,9 +166,7 @@ save_thread_state:
mov qword [rdi + 152], rax ;kernel_stack_copy
mov byte [rdi + 160], 0x01 ;in_syscall
- xor al, al
- ret
+ jmp resume_next_thread
.resume_to:
- mov al, 0x01
ret