2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2015-12-17 07:18:47 +00:00
|
|
|
* AT_SYSINFO entry point
|
2015-10-06 00:47:59 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm/dwarf2.h>
|
2015-10-06 00:48:11 +00:00
|
|
|
#include <asm/cpufeature.h>
|
|
|
|
#include <asm/alternative-asm.h>
|
2015-10-06 00:47:59 +00:00
|
|
|
|
|
|
|
/*
|
2008-01-30 12:30:44 +00:00
|
|
|
* First get the common code for the sigreturn entry points.
|
|
|
|
* This must come first.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2008-01-30 12:30:44 +00:00
|
|
|
#include "sigreturn.S"
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
.text
|
|
|
|
.globl __kernel_vsyscall
|
|
|
|
.type __kernel_vsyscall,@function
|
2008-01-30 12:30:44 +00:00
|
|
|
ALIGN
|
2005-04-16 22:20:36 +00:00
|
|
|
__kernel_vsyscall:
|
2015-10-06 00:47:59 +00:00
|
|
|
CFI_STARTPROC
|
2015-10-06 00:48:01 +00:00
|
|
|
/*
|
|
|
|
* Reshuffle regs so that all of any of the entry instructions
|
|
|
|
* will preserve enough state.
|
|
|
|
*/
|
|
|
|
pushl %edx
|
|
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
|
|
CFI_REL_OFFSET edx, 0
|
|
|
|
pushl %ecx
|
|
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
|
|
CFI_REL_OFFSET ecx, 0
|
|
|
|
movl %esp, %ecx
|
|
|
|
|
2015-10-06 00:48:11 +00:00
|
|
|
#ifdef CONFIG_X86_64
|
|
|
|
/* If SYSENTER (Intel) or SYSCALL32 (AMD) is available, use it. */
|
|
|
|
ALTERNATIVE_2 "", "sysenter", X86_FEATURE_SYSENTER32, \
|
|
|
|
"syscall", X86_FEATURE_SYSCALL32
|
2015-10-06 00:48:15 +00:00
|
|
|
#else
|
|
|
|
ALTERNATIVE "", "sysenter", X86_FEATURE_SEP
|
2015-10-06 00:48:11 +00:00
|
|
|
#endif
|
|
|
|
|
2015-10-06 00:48:01 +00:00
|
|
|
/* Enter using int $0x80 */
|
|
|
|
movl (%esp), %ecx
|
|
|
|
int $0x80
|
|
|
|
GLOBAL(int80_landing_pad)
|
|
|
|
|
|
|
|
/* Restore ECX and EDX in case they were clobbered. */
|
|
|
|
popl %ecx
|
|
|
|
CFI_RESTORE ecx
|
|
|
|
CFI_ADJUST_CFA_OFFSET -4
|
|
|
|
popl %edx
|
|
|
|
CFI_RESTORE edx
|
|
|
|
CFI_ADJUST_CFA_OFFSET -4
|
2005-04-16 22:20:36 +00:00
|
|
|
ret
|
2015-10-06 00:47:59 +00:00
|
|
|
CFI_ENDPROC
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2015-10-06 00:47:59 +00:00
|
|
|
.size __kernel_vsyscall,.-__kernel_vsyscall
|
2008-01-30 12:30:44 +00:00
|
|
|
.previous
|