diff --git a/kernel/arch/i686/Yield.S b/kernel/arch/i686/Yield.S index 68b352be..3a577637 100644 --- a/kernel/arch/i686/Yield.S +++ b/kernel/arch/i686/Yield.S @@ -1,9 +1,9 @@ .global asm_yield_trampoline asm_yield_trampoline: - movl %esp, %ecx + leal 4(%esp), %ecx movl 4(%esp), %esp - pushl (%ecx) + pushl -4(%ecx) pushl %ecx pushl %eax pushl %ebx diff --git a/kernel/arch/x86_64/Yield.S b/kernel/arch/x86_64/Yield.S index bec190c4..11c57ff1 100644 --- a/kernel/arch/x86_64/Yield.S +++ b/kernel/arch/x86_64/Yield.S @@ -1,10 +1,10 @@ .global asm_yield_trampoline asm_yield_trampoline: - movq %rsp, %rcx + leaq 8(%rsp), %rcx movq %rdi, %rsp subq $8, %rsp - pushq (%rcx) + pushq -8(%rcx) pushq %rcx pushq %rax pushq %rbx