2 * Code for the vsyscall page. This version uses the syscall instruction.
5 #include <asm/ia32_unistd.h>
6 #include <asm/offset.h>
9 .globl __kernel_vsyscall
10 .type __kernel_vsyscall,@function
21 .size __kernel_vsyscall,.-.LSTART_vsyscall
24 .globl __kernel_sigreturn
25 .type __kernel_sigreturn,@function
29 movl $__NR_ia32_sigreturn, %eax
32 .size __kernel_sigreturn,.-.LSTART_sigreturn
35 .globl __kernel_rt_sigreturn
36 .type __kernel_rt_sigreturn,@function
37 __kernel_rt_sigreturn:
39 movl $__NR_ia32_rt_sigreturn, %eax
42 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn
44 .section .eh_frame,"a",@progbits
46 .long .LENDCIE-.LSTARTCIE
49 .byte 1 /* Version number */
50 .string "zR" /* NUL-terminated augmentation string */
51 .uleb128 1 /* Code alignment factor */
52 .sleb128 -4 /* Data alignment factor */
53 .byte 8 /* Return address register column */
54 .uleb128 1 /* Augmentation value length */
55 .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
56 .byte 0x0c /* DW_CFA_def_cfa */
59 .byte 0x88 /* DW_CFA_offset, column 0x8 */
64 .long .LENDFDE1-.LSTARTFDE1 /* Length FDE */
66 .long .LSTARTFDE1-.LSTARTFRAME /* CIE pointer */
67 .long .LSTART_vsyscall-. /* PC-relative start address */
68 .long .LEND_vsyscall-.LSTART_vsyscall
69 .uleb128 0 /* Augmentation length */
70 /* What follows are the instructions for the table generation.
71 We have to record all changes of the stack pointer. */
72 .byte 0x40 + .Lpush_ebp-.LSTART_vsyscall /* DW_CFA_advance_loc */
73 .byte 0x0e /* DW_CFA_def_cfa_offset */
75 .byte 0x85, 0x02 /* DW_CFA_offset %ebp -8 */
76 .byte 0x40 + .Lpop_ebp-.Lpush_ebp /* DW_CFA_advance_loc */
77 .byte 0xc5 /* DW_CFA_restore %ebp */
78 .byte 0x0e /* DW_CFA_def_cfa_offset */
83 .long .LENDFDE2-.LSTARTFDE2 /* Length FDE */
85 .long .LSTARTFDE2-.LSTARTFRAME /* CIE pointer */
86 /* HACK: The dwarf2 unwind routines will subtract 1 from the
87 return address to get an address in the middle of the
88 presumed call instruction. Since we didn't get here via
89 a call, we need to include the nop before the real start
91 .long .LSTART_sigreturn-1-. /* PC-relative start address */
92 .long .LEND_sigreturn-.LSTART_sigreturn+1
93 .uleb128 0 /* Augmentation length */
94 /* What follows are the instructions for the table generation.
95 We record the locations of each register saved. This is
96 complicated by the fact that the "CFA" is always assumed to
97 be the value of the stack pointer in the caller. This means
98 that we must define the CFA of this body of code to be the
99 saved value of the stack pointer in the sigcontext. Which
100 also means that there is no fixed relation to the other
101 saved registers, which means that we must use DW_CFA_expression
102 to compute their addresses. It also means that when we
103 adjust the stack with the popl, we have to do it all over again. */
105 #define do_cfa_expr(offset) \
106 .byte 0x0f; /* DW_CFA_def_cfa_expression */ \
107 .uleb128 1f-0f; /* length */ \
108 0: .byte 0x74; /* DW_OP_breg4 */ \
109 .sleb128 offset; /* offset */ \
110 .byte 0x06; /* DW_OP_deref */ \
113 #define do_expr(regno, offset) \
114 .byte 0x10; /* DW_CFA_expression */ \
115 .uleb128 regno; /* regno */ \
116 .uleb128 1f-0f; /* length */ \
117 0: .byte 0x74; /* DW_OP_breg4 */ \
118 .sleb128 offset; /* offset */ \
121 do_cfa_expr(IA32_SIGCONTEXT_esp+4)
122 do_expr(0, IA32_SIGCONTEXT_eax+4)
123 do_expr(1, IA32_SIGCONTEXT_ecx+4)
124 do_expr(2, IA32_SIGCONTEXT_edx+4)
125 do_expr(3, IA32_SIGCONTEXT_ebx+4)
126 do_expr(5, IA32_SIGCONTEXT_ebp+4)
127 do_expr(6, IA32_SIGCONTEXT_esi+4)
128 do_expr(7, IA32_SIGCONTEXT_edi+4)
129 do_expr(8, IA32_SIGCONTEXT_eip+4)
131 .byte 0x42 /* DW_CFA_advance_loc 2 -- nop; popl eax. */
133 do_cfa_expr(IA32_SIGCONTEXT_esp)
134 do_expr(0, IA32_SIGCONTEXT_eax)
135 do_expr(1, IA32_SIGCONTEXT_ecx)
136 do_expr(2, IA32_SIGCONTEXT_edx)
137 do_expr(3, IA32_SIGCONTEXT_ebx)
138 do_expr(5, IA32_SIGCONTEXT_ebp)
139 do_expr(6, IA32_SIGCONTEXT_esi)
140 do_expr(7, IA32_SIGCONTEXT_edi)
141 do_expr(8, IA32_SIGCONTEXT_eip)
146 .long .LENDFDE3-.LSTARTFDE3 /* Length FDE */
148 .long .LSTARTFDE3-.LSTARTFRAME /* CIE pointer */
149 /* HACK: See above wrt unwind library assumptions. */
150 .long .LSTART_rt_sigreturn-1-. /* PC-relative start address */
151 .long .LEND_rt_sigreturn-.LSTART_rt_sigreturn+1
152 .uleb128 0 /* Augmentation */
153 /* What follows are the instructions for the table generation.
154 We record the locations of each register saved. This is
155 slightly less complicated than the above, since we don't
156 modify the stack pointer in the process. */
158 do_cfa_expr(IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_esp)
159 do_expr(0, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_eax)
160 do_expr(1, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ecx)
161 do_expr(2, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_edx)
162 do_expr(3, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ebx)
163 do_expr(5, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ebp)
164 do_expr(6, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_esi)
165 do_expr(7, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_edi)
166 do_expr(8, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_eip)