summaryrefslogtreecommitdiff
path: root/kernel/asm.s
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/asm.s')
-rw-r--r--kernel/asm.s14
1 files changed, 4 insertions, 10 deletions
diff --git a/kernel/asm.s b/kernel/asm.s
index 6d35334..fc36171 100644
--- a/kernel/asm.s
+++ b/kernel/asm.s
@@ -11,6 +11,7 @@ extern save_state
switch_to:
push ebp
mov ebp, esp
+ push ebx
; abort if we're switching to the current task
mov ebx, [ctask]
cmp ebx, [ebp+12]
@@ -18,16 +19,6 @@ switch_to:
pop ebp
ret
.skip:
- ; clear the busy flag in the current TSS
- mov eax, 0
- str ax
- add ax, gdt+5
- mov byte [eax], 0x89
- ; set the current TSS to null so it won't be overwritten by the switch
- mov ax, 0
- ltr ax
- ; copy the saved state into the previous TSS
- call save_state
; update ctask and ctaskn
mov ebx, [ebp+12]
mov [ctask], ebx
@@ -39,6 +30,9 @@ switch_to:
shl ebx, 3
mov [.tmp+4], bx
jmp far [.tmp]
+ pop ebx
+ pop ebp
+ ret
.tmp:
dq 0