Get rid of exception_return
authorcoderain <coderain@sdf.org>
Tue, 25 Sep 2018 13:40:47 +0000 (15:40 +0200)
committercoderain <coderain@sdf.org>
Tue, 25 Sep 2018 13:40:47 +0000 (15:40 +0200)
kernel/src/exception.c
kernel/src/helpers.asm

index bf84b2ac05d3c210ef529d77b29f150d87e17b9b..3dda3e1cd19af6e4bf16d1108ebcb055da0aa3fb 100644 (file)
@@ -75,8 +75,7 @@ static void raise_exception_internal(thread_t *thread, processor_mode_t mode, ex
         if (thread->kernel_handler.eip)
         {
             thread->kernel_handler.eax = 1;
-            thread->in_kernel--;
-            exception_return(thread->kernel_handler);
+            memcpy(exception_regs, &thread->kernel_handler, sizeof(registers_t));
         }
         else
         {
index 0493c0a645561df7964b5ed8cd3608e6a7168d46..e028ebbca631ccf67e33b4413eab9d1bda698852 100644 (file)
@@ -23,7 +23,6 @@ bits 32
 
 global init_cpu_gdt
 global vm86_start
-global exception_return
 global save_kernel_handler
 global syscall_function
 global reschedule
@@ -85,21 +84,6 @@ vm86_start:             pushfd
                         popad
                         iret
 
-;********************************************************************************
-; void exception_return(register_t regs)
-;********************************************************************************
-exception_return:       lea esi, [esp + 0x04]
-                        mov edi, dword [esp + 0x14]
-                        sub edi, 13 * 4
-                        mov esp, edi
-                        mov ecx, 13
-                        cld
-                        rep movsd
-                        add esp, 4
-                        popad
-                        add esp, 4
-                        iret
-
 ;********************************************************************************
 ; void save_kernel_handler(exception_handler_t *old_handler)
 ;********************************************************************************
@@ -151,7 +135,7 @@ reschedule:             push cs
                         cli
                         pop eax
                         mov dword [esp + 44], eax
-                        add dword [esp + 12], 16
+                        add dword [esp + 12], 20
                         push ds
                         push esp
                         call scheduler