diff options
Diffstat (limited to 'arch/x86/ia32/vsyscall-sysenter.S')
-rw-r--r-- | arch/x86/ia32/vsyscall-sysenter.S | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/arch/x86/ia32/vsyscall-sysenter.S b/arch/x86/ia32/vsyscall-sysenter.S new file mode 100644 index 000000000000..ae056e553d13 --- /dev/null +++ b/arch/x86/ia32/vsyscall-sysenter.S | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * Code for the vsyscall page. This version uses the sysenter instruction. | ||
3 | */ | ||
4 | |||
5 | #include <asm/ia32_unistd.h> | ||
6 | #include <asm/asm-offsets.h> | ||
7 | |||
8 | .code32 | ||
9 | .text | ||
10 | .section .text.vsyscall,"ax" | ||
11 | .globl __kernel_vsyscall | ||
12 | .type __kernel_vsyscall,@function | ||
13 | __kernel_vsyscall: | ||
14 | .LSTART_vsyscall: | ||
15 | push %ecx | ||
16 | .Lpush_ecx: | ||
17 | push %edx | ||
18 | .Lpush_edx: | ||
19 | push %ebp | ||
20 | .Lenter_kernel: | ||
21 | movl %esp,%ebp | ||
22 | sysenter | ||
23 | .space 7,0x90 | ||
24 | jmp .Lenter_kernel | ||
25 | /* 16: System call normal return point is here! */ | ||
26 | pop %ebp | ||
27 | .Lpop_ebp: | ||
28 | pop %edx | ||
29 | .Lpop_edx: | ||
30 | pop %ecx | ||
31 | .Lpop_ecx: | ||
32 | ret | ||
33 | .LEND_vsyscall: | ||
34 | .size __kernel_vsyscall,.-.LSTART_vsyscall | ||
35 | |||
36 | .section .eh_frame,"a",@progbits | ||
37 | .LSTARTFRAME: | ||
38 | .long .LENDCIE-.LSTARTCIE | ||
39 | .LSTARTCIE: | ||
40 | .long 0 /* CIE ID */ | ||
41 | .byte 1 /* Version number */ | ||
42 | .string "zR" /* NUL-terminated augmentation string */ | ||
43 | .uleb128 1 /* Code alignment factor */ | ||
44 | .sleb128 -4 /* Data alignment factor */ | ||
45 | .byte 8 /* Return address register column */ | ||
46 | .uleb128 1 /* Augmentation value length */ | ||
47 | .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ | ||
48 | .byte 0x0c /* DW_CFA_def_cfa */ | ||
49 | .uleb128 4 | ||
50 | .uleb128 4 | ||
51 | .byte 0x88 /* DW_CFA_offset, column 0x8 */ | ||
52 | .uleb128 1 | ||
53 | .align 4 | ||
54 | .LENDCIE: | ||
55 | |||
56 | .long .LENDFDE1-.LSTARTFDE1 /* Length FDE */ | ||
57 | .LSTARTFDE1: | ||
58 | .long .LSTARTFDE1-.LSTARTFRAME /* CIE pointer */ | ||
59 | .long .LSTART_vsyscall-. /* PC-relative start address */ | ||
60 | .long .LEND_vsyscall-.LSTART_vsyscall | ||
61 | .uleb128 0 /* Augmentation length */ | ||
62 | /* What follows are the instructions for the table generation. | ||
63 | We have to record all changes of the stack pointer. */ | ||
64 | .byte 0x04 /* DW_CFA_advance_loc4 */ | ||
65 | .long .Lpush_ecx-.LSTART_vsyscall | ||
66 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
67 | .byte 0x08 /* RA at offset 8 now */ | ||
68 | .byte 0x04 /* DW_CFA_advance_loc4 */ | ||
69 | .long .Lpush_edx-.Lpush_ecx | ||
70 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
71 | .byte 0x0c /* RA at offset 12 now */ | ||
72 | .byte 0x04 /* DW_CFA_advance_loc4 */ | ||
73 | .long .Lenter_kernel-.Lpush_edx | ||
74 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
75 | .byte 0x10 /* RA at offset 16 now */ | ||
76 | .byte 0x85, 0x04 /* DW_CFA_offset %ebp -16 */ | ||
77 | /* Finally the epilogue. */ | ||
78 | .byte 0x04 /* DW_CFA_advance_loc4 */ | ||
79 | .long .Lpop_ebp-.Lenter_kernel | ||
80 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
81 | .byte 0x12 /* RA at offset 12 now */ | ||
82 | .byte 0xc5 /* DW_CFA_restore %ebp */ | ||
83 | .byte 0x04 /* DW_CFA_advance_loc4 */ | ||
84 | .long .Lpop_edx-.Lpop_ebp | ||
85 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
86 | .byte 0x08 /* RA at offset 8 now */ | ||
87 | .byte 0x04 /* DW_CFA_advance_loc4 */ | ||
88 | .long .Lpop_ecx-.Lpop_edx | ||
89 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
90 | .byte 0x04 /* RA at offset 4 now */ | ||
91 | .align 4 | ||
92 | .LENDFDE1: | ||
93 | |||
94 | #define SYSCALL_ENTER_KERNEL int $0x80 | ||
95 | #include "vsyscall-sigreturn.S" | ||