diff options
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/setjmp_32.S | 4 | ||||
-rw-r--r-- | arch/x86/lib/setjmp_64.S | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/lib/setjmp_32.S b/arch/x86/lib/setjmp_32.S index 38dcb68c1b..30db5f989a 100644 --- a/arch/x86/lib/setjmp_32.S +++ b/arch/x86/lib/setjmp_32.S @@ -8,6 +8,7 @@ #define _REGPARM #include <linux/linkage.h> +#include <asm-generic/pointer.h> .text .align 8 @@ -53,7 +54,8 @@ ENDPROC(longjmp) ENTRY(initjmp) movl %edx, 20(%eax) /* Return address */ - movl %ecx, 4(%eax) /* Post-return %esp! */ + sub $ASM_SZPTR, %ecx /* ESP - 4 has to be 16-byte aligned on entry */ + movl %ecx, 4(%eax) /* Stack top */ xorl %eax, %eax /* Return value */ ret diff --git a/arch/x86/lib/setjmp_64.S b/arch/x86/lib/setjmp_64.S index 28ea576cd2..d5cf99a155 100644 --- a/arch/x86/lib/setjmp_64.S +++ b/arch/x86/lib/setjmp_64.S @@ -6,6 +6,7 @@ */ #include <linux/linkage.h> +#include <asm-generic/pointer.h> .text .align 8 @@ -53,6 +54,7 @@ ENDPROC(longjmp) ENTRY(initjmp) movq %rsi, (%rdi) /* Return address */ + sub $ASM_SZPTR, %rdx /* RSP - 8 has to be 16-byte aligned on entry */ movq %rdx, 8(%rdi) /* Stack top */ xorq %rax, %rax ret |