diff --git a/arch/x86/exception_wrappers.S b/arch/x86/exception_wrappers.S index 122bcd0..52f6a09 100644 --- a/arch/x86/exception_wrappers.S +++ b/arch/x86/exception_wrappers.S @@ -12,7 +12,7 @@ /* The address of the function to call to set back the user thread's MMU configuration upon return to user context */ -.extern thread_prepare_exception_switch_back +.extern threadPrepareExceptionSwitchBack .altmacro @@ -60,7 +60,7 @@ /* Reconfigure the MMU if needed */ pushl %esp /* cpu_ctxt */ - call thread_prepare_exception_switch_back + call threadPrepareExceptionSwitchBack addl $4, %esp /* Unallocate the stack */ /* Prepare kernel TSS in case we are switching to a @@ -99,6 +99,7 @@ /* uint32_t flags */ /* uint32_t cs; */ /* uint32_t ip */ + /* uint32_t errcode */ /* Pushes the other reg to save same and look like a struct cpu_state*/ /* Backup the actual context */ @@ -132,7 +133,7 @@ /* Reconfigure the MMU if needed */ pushl %esp /* cpu_ctxt */ - call thread_prepare_exception_switch_back + call threadPrepareExceptionSwitchBack addl $4, %esp /* Unallocate the stack */ /* Prepare kernel TSS in case we are switching to a @@ -158,6 +159,9 @@ popl %eax popl %ebp + /* Error code isn't compatible with iretd */ + addl $4, %esp + iret .endm diff --git a/arch/x86/irq_wrappers.S b/arch/x86/irq_wrappers.S index cb5b0e4..b989a96 100644 --- a/arch/x86/irq_wrappers.S +++ b/arch/x86/irq_wrappers.S @@ -11,7 +11,7 @@ /* The address of the function to call to set back the user thread's MMU configuration upon return to user context */ -.extern thread_prepare_irq_switch_back +.extern threadPrepareIrqSwitchBack .altmacro @@ -59,7 +59,7 @@ /* Reconfigure the MMU if needed */ pushl %esp /* cpu_ctxt */ - call thread_prepare_irq_switch_back + call threadPrepareIrqSwitchBack addl $4, %esp /* Unallocate the stack */ /* Prepare kernel TSS in case we are switching to a diff --git a/arch/x86/syscall_wrappers.S b/arch/x86/syscall_wrappers.S index 7d8f568..06d2a9f 100644 --- a/arch/x86/syscall_wrappers.S +++ b/arch/x86/syscall_wrappers.S @@ -14,7 +14,7 @@ /* The address of the function to call to set back the user thread's MMU configuration upon return to user context */ -.extern thread_prepare_syscall_switch_back +.extern threadPrepareSyscallSwitchBack .p2align 2, 0x90 .globl syscallHandler @@ -61,7 +61,7 @@ syscallHandler: /* Set the MMU configuration to that of the user thread's process */ pushl %esp /* user_ctxt */ - call thread_prepare_syscall_switch_back + call threadPrepareSyscallSwitchBack addl $4, %esp /* Unallocate the stack */ /* Prepare kernel TSS because we are switching back to a user diff --git a/core/kthread.c b/core/kthread.c index 9076793..7ef7e13 100644 --- a/core/kthread.c +++ b/core/kthread.c @@ -260,16 +260,18 @@ int kthreadAddThread(struct kthread *th) return 0; } -void thread_prepare_syscall_switch_back(struct cpu_state *cpu_state){ + +void threadPrepareSyscallSwitchBack(struct cpu_state *cpu_state){ (void)cpu_state; return; } -void thread_prepare_exception_switch_back(struct cpu_state *cpu_state){ +void threadPrepareExceptionSwitchBack(struct cpu_state *cpu_state){ (void)cpu_state; return; } -void thread_prepare_irq_switch_back(struct cpu_state *cpu_state){ + +void threadPrepareIrqSwitchBack(struct cpu_state *cpu_state){ (void)cpu_state; return; }