aboutsummaryrefslogtreecommitdiff
path: root/kernel/l0/context_switch.s
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 17:39:41 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 17:40:03 +0100
commitf2c51bc81d2aa618b29ddbeaae5ac1c5308821f0 (patch)
treefae67a79d5e60128d074550326a05216694a5848 /kernel/l0/context_switch.s
parenta5dfdd2b3fa91a2cda4f807c88bd35928e3c7a61 (diff)
downloadkogata-f2c51bc81d2aa618b29ddbeaae5ac1c5308821f0.tar.gz
kogata-f2c51bc81d2aa618b29ddbeaae5ac1c5308821f0.zip
Reorganize all.
Diffstat (limited to 'kernel/l0/context_switch.s')
-rw-r--r--kernel/l0/context_switch.s58
1 files changed, 0 insertions, 58 deletions
diff --git a/kernel/l0/context_switch.s b/kernel/l0/context_switch.s
deleted file mode 100644
index 6738a03..0000000
--- a/kernel/l0/context_switch.s
+++ /dev/null
@@ -1,58 +0,0 @@
-[EXTERN kernel_stack_top]
-[EXTERN run_scheduler]
-
-[GLOBAL save_context_and_enter_scheduler]
-; void save_context_and_enter_scheduler(struct saved_context *ctx);
-save_context_and_enter_scheduler:
- pushf
- cli
- pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
-
- mov eax, cr3
- push eax
-
- mov eax, [esp+44] ; get address of saved_context structure
- mov [eax], esp ; save esp
- mov dword [eax+4], resume_saved_context ; save eip
-
- mov esp, kernel_stack_top
- jmp run_scheduler
-
-resume_saved_context:
- pop eax
- mov cr3, eax
-
- popa
- popf
- ret
-
-[GLOBAL irq0_save_context_and_enter_scheduler]
-; meant to be called on IRQ0
-; general registers already saved by IRQ handler stub
-; flags already saved by interruption and interruptions disabled
-; only saves CR3
-irq0_save_context_and_enter_scheduler:
- mov eax, cr3
- push eax
-
- mov eax, [esp+8] ; get address of saved_context structure
- mov [eax], esp ; save esp
- mov dword [eax+4], resume_saved_irq0_context ; save eip
-
- mov esp, kernel_stack_top
- jmp run_scheduler
-
-resume_saved_irq0_context:
- pop eax
- mov cr3, eax
- ret
-
-
-[GLOBAL resume_context]
-resume_context:
- mov eax, [esp+4] ; get address of saved context
- mov esp, [eax] ; resume esp
- mov ecx, [eax+4] ; jump to specified eip
- jmp ecx
-
-; vim: set ts=4 sw=4 tw=0 noet :