Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * linux/arch/i386/entry.S | |
3 | * | |
4 | * Copyright (C) 1991, 1992 Linus Torvalds | |
5 | */ | |
6 | ||
7 | /* | |
8 | * entry.S contains the system-call and fault low-level handling routines. | |
9 | * This also contains the timer-interrupt handler, as well as all interrupts | |
10 | * and faults that can result in a task-switch. | |
11 | * | |
12 | * NOTE: This code handles signal-recognition, which happens every time | |
13 | * after a timer-interrupt and after each system call. | |
14 | * | |
15 | * I changed all the .align's to 4 (16 byte alignment), as that's faster | |
16 | * on a 486. | |
17 | * | |
18 | * Stack layout in 'ret_from_system_call': | |
19 | * ptrace needs to have all regs on the stack. | |
20 | * if the order here is changed, it needs to be | |
21 | * updated in fork.c:copy_process, signal.c:do_signal, | |
22 | * ptrace.c and ptrace.h | |
23 | * | |
24 | * 0(%esp) - %ebx | |
25 | * 4(%esp) - %ecx | |
26 | * 8(%esp) - %edx | |
27 | * C(%esp) - %esi | |
28 | * 10(%esp) - %edi | |
29 | * 14(%esp) - %ebp | |
30 | * 18(%esp) - %eax | |
31 | * 1C(%esp) - %ds | |
32 | * 20(%esp) - %es | |
33 | * 24(%esp) - orig_eax | |
34 | * 28(%esp) - %eip | |
35 | * 2C(%esp) - %cs | |
36 | * 30(%esp) - %eflags | |
37 | * 34(%esp) - %oldesp | |
38 | * 38(%esp) - %oldss | |
39 | * | |
40 | * "current" is in register %ebx during any slow entries. | |
41 | */ | |
42 | ||
1da177e4 LT |
43 | #include <linux/linkage.h> |
44 | #include <asm/thread_info.h> | |
55f327fa | 45 | #include <asm/irqflags.h> |
1da177e4 LT |
46 | #include <asm/errno.h> |
47 | #include <asm/segment.h> | |
48 | #include <asm/smp.h> | |
49 | #include <asm/page.h> | |
50 | #include <asm/desc.h> | |
fe7cacc1 | 51 | #include <asm/dwarf2.h> |
1da177e4 LT |
52 | #include "irq_vectors.h" |
53 | ||
54 | #define nr_syscalls ((syscall_table_size)/4) | |
55 | ||
56 | EBX = 0x00 | |
57 | ECX = 0x04 | |
58 | EDX = 0x08 | |
59 | ESI = 0x0C | |
60 | EDI = 0x10 | |
61 | EBP = 0x14 | |
62 | EAX = 0x18 | |
63 | DS = 0x1C | |
64 | ES = 0x20 | |
65 | ORIG_EAX = 0x24 | |
66 | EIP = 0x28 | |
67 | CS = 0x2C | |
68 | EFLAGS = 0x30 | |
69 | OLDESP = 0x34 | |
70 | OLDSS = 0x38 | |
71 | ||
72 | CF_MASK = 0x00000001 | |
73 | TF_MASK = 0x00000100 | |
74 | IF_MASK = 0x00000200 | |
75 | DF_MASK = 0x00000400 | |
76 | NT_MASK = 0x00004000 | |
77 | VM_MASK = 0x00020000 | |
78 | ||
79 | #ifdef CONFIG_PREEMPT | |
55f327fa | 80 | #define preempt_stop cli; TRACE_IRQS_OFF |
1da177e4 LT |
81 | #else |
82 | #define preempt_stop | |
83 | #define resume_kernel restore_nocheck | |
84 | #endif | |
85 | ||
55f327fa IM |
86 | .macro TRACE_IRQS_IRET |
87 | #ifdef CONFIG_TRACE_IRQFLAGS | |
88 | testl $IF_MASK,EFLAGS(%esp) # interrupts off? | |
89 | jz 1f | |
90 | TRACE_IRQS_ON | |
91 | 1: | |
92 | #endif | |
93 | .endm | |
94 | ||
4031ff38 AG |
95 | #ifdef CONFIG_VM86 |
96 | #define resume_userspace_sig check_userspace | |
97 | #else | |
98 | #define resume_userspace_sig resume_userspace | |
99 | #endif | |
100 | ||
1da177e4 LT |
101 | #define SAVE_ALL \ |
102 | cld; \ | |
103 | pushl %es; \ | |
fe7cacc1 JB |
104 | CFI_ADJUST_CFA_OFFSET 4;\ |
105 | /*CFI_REL_OFFSET es, 0;*/\ | |
1da177e4 | 106 | pushl %ds; \ |
fe7cacc1 JB |
107 | CFI_ADJUST_CFA_OFFSET 4;\ |
108 | /*CFI_REL_OFFSET ds, 0;*/\ | |
1da177e4 | 109 | pushl %eax; \ |
fe7cacc1 JB |
110 | CFI_ADJUST_CFA_OFFSET 4;\ |
111 | CFI_REL_OFFSET eax, 0;\ | |
1da177e4 | 112 | pushl %ebp; \ |
fe7cacc1 JB |
113 | CFI_ADJUST_CFA_OFFSET 4;\ |
114 | CFI_REL_OFFSET ebp, 0;\ | |
1da177e4 | 115 | pushl %edi; \ |
fe7cacc1 JB |
116 | CFI_ADJUST_CFA_OFFSET 4;\ |
117 | CFI_REL_OFFSET edi, 0;\ | |
1da177e4 | 118 | pushl %esi; \ |
fe7cacc1 JB |
119 | CFI_ADJUST_CFA_OFFSET 4;\ |
120 | CFI_REL_OFFSET esi, 0;\ | |
1da177e4 | 121 | pushl %edx; \ |
fe7cacc1 JB |
122 | CFI_ADJUST_CFA_OFFSET 4;\ |
123 | CFI_REL_OFFSET edx, 0;\ | |
1da177e4 | 124 | pushl %ecx; \ |
fe7cacc1 JB |
125 | CFI_ADJUST_CFA_OFFSET 4;\ |
126 | CFI_REL_OFFSET ecx, 0;\ | |
1da177e4 | 127 | pushl %ebx; \ |
fe7cacc1 JB |
128 | CFI_ADJUST_CFA_OFFSET 4;\ |
129 | CFI_REL_OFFSET ebx, 0;\ | |
1da177e4 LT |
130 | movl $(__USER_DS), %edx; \ |
131 | movl %edx, %ds; \ | |
132 | movl %edx, %es; | |
133 | ||
134 | #define RESTORE_INT_REGS \ | |
135 | popl %ebx; \ | |
fe7cacc1 JB |
136 | CFI_ADJUST_CFA_OFFSET -4;\ |
137 | CFI_RESTORE ebx;\ | |
1da177e4 | 138 | popl %ecx; \ |
fe7cacc1 JB |
139 | CFI_ADJUST_CFA_OFFSET -4;\ |
140 | CFI_RESTORE ecx;\ | |
1da177e4 | 141 | popl %edx; \ |
fe7cacc1 JB |
142 | CFI_ADJUST_CFA_OFFSET -4;\ |
143 | CFI_RESTORE edx;\ | |
1da177e4 | 144 | popl %esi; \ |
fe7cacc1 JB |
145 | CFI_ADJUST_CFA_OFFSET -4;\ |
146 | CFI_RESTORE esi;\ | |
1da177e4 | 147 | popl %edi; \ |
fe7cacc1 JB |
148 | CFI_ADJUST_CFA_OFFSET -4;\ |
149 | CFI_RESTORE edi;\ | |
1da177e4 | 150 | popl %ebp; \ |
fe7cacc1 JB |
151 | CFI_ADJUST_CFA_OFFSET -4;\ |
152 | CFI_RESTORE ebp;\ | |
153 | popl %eax; \ | |
154 | CFI_ADJUST_CFA_OFFSET -4;\ | |
155 | CFI_RESTORE eax | |
1da177e4 LT |
156 | |
157 | #define RESTORE_REGS \ | |
158 | RESTORE_INT_REGS; \ | |
159 | 1: popl %ds; \ | |
fe7cacc1 JB |
160 | CFI_ADJUST_CFA_OFFSET -4;\ |
161 | /*CFI_RESTORE ds;*/\ | |
1da177e4 | 162 | 2: popl %es; \ |
fe7cacc1 JB |
163 | CFI_ADJUST_CFA_OFFSET -4;\ |
164 | /*CFI_RESTORE es;*/\ | |
1da177e4 LT |
165 | .section .fixup,"ax"; \ |
166 | 3: movl $0,(%esp); \ | |
167 | jmp 1b; \ | |
168 | 4: movl $0,(%esp); \ | |
169 | jmp 2b; \ | |
170 | .previous; \ | |
171 | .section __ex_table,"a";\ | |
172 | .align 4; \ | |
173 | .long 1b,3b; \ | |
174 | .long 2b,4b; \ | |
175 | .previous | |
176 | ||
fe7cacc1 JB |
177 | #define RING0_INT_FRAME \ |
178 | CFI_STARTPROC simple;\ | |
179 | CFI_DEF_CFA esp, 3*4;\ | |
180 | /*CFI_OFFSET cs, -2*4;*/\ | |
181 | CFI_OFFSET eip, -3*4 | |
182 | ||
183 | #define RING0_EC_FRAME \ | |
184 | CFI_STARTPROC simple;\ | |
185 | CFI_DEF_CFA esp, 4*4;\ | |
186 | /*CFI_OFFSET cs, -2*4;*/\ | |
187 | CFI_OFFSET eip, -3*4 | |
188 | ||
189 | #define RING0_PTREGS_FRAME \ | |
190 | CFI_STARTPROC simple;\ | |
191 | CFI_DEF_CFA esp, OLDESP-EBX;\ | |
192 | /*CFI_OFFSET cs, CS-OLDESP;*/\ | |
193 | CFI_OFFSET eip, EIP-OLDESP;\ | |
194 | /*CFI_OFFSET es, ES-OLDESP;*/\ | |
195 | /*CFI_OFFSET ds, DS-OLDESP;*/\ | |
196 | CFI_OFFSET eax, EAX-OLDESP;\ | |
197 | CFI_OFFSET ebp, EBP-OLDESP;\ | |
198 | CFI_OFFSET edi, EDI-OLDESP;\ | |
199 | CFI_OFFSET esi, ESI-OLDESP;\ | |
200 | CFI_OFFSET edx, EDX-OLDESP;\ | |
201 | CFI_OFFSET ecx, ECX-OLDESP;\ | |
202 | CFI_OFFSET ebx, EBX-OLDESP | |
1da177e4 LT |
203 | |
204 | ENTRY(ret_from_fork) | |
fe7cacc1 | 205 | CFI_STARTPROC |
1da177e4 | 206 | pushl %eax |
25d7dfda | 207 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
208 | call schedule_tail |
209 | GET_THREAD_INFO(%ebp) | |
210 | popl %eax | |
fe7cacc1 | 211 | CFI_ADJUST_CFA_OFFSET -4 |
1da177e4 | 212 | jmp syscall_exit |
fe7cacc1 | 213 | CFI_ENDPROC |
1da177e4 LT |
214 | |
215 | /* | |
216 | * Return to user mode is not as complex as all this looks, | |
217 | * but we want the default path for a system call return to | |
218 | * go as quickly as possible which is why some of this is | |
219 | * less clear than it otherwise should be. | |
220 | */ | |
221 | ||
222 | # userspace resumption stub bypassing syscall exit tracing | |
223 | ALIGN | |
fe7cacc1 | 224 | RING0_PTREGS_FRAME |
1da177e4 LT |
225 | ret_from_exception: |
226 | preempt_stop | |
227 | ret_from_intr: | |
228 | GET_THREAD_INFO(%ebp) | |
4031ff38 | 229 | check_userspace: |
1da177e4 LT |
230 | movl EFLAGS(%esp), %eax # mix EFLAGS and CS |
231 | movb CS(%esp), %al | |
232 | testl $(VM_MASK | 3), %eax | |
233 | jz resume_kernel | |
234 | ENTRY(resume_userspace) | |
235 | cli # make sure we don't miss an interrupt | |
236 | # setting need_resched or sigpending | |
237 | # between sampling and the iret | |
238 | movl TI_flags(%ebp), %ecx | |
239 | andl $_TIF_WORK_MASK, %ecx # is there any work to be done on | |
240 | # int/exception return? | |
241 | jne work_pending | |
242 | jmp restore_all | |
243 | ||
244 | #ifdef CONFIG_PREEMPT | |
245 | ENTRY(resume_kernel) | |
246 | cli | |
247 | cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? | |
248 | jnz restore_nocheck | |
249 | need_resched: | |
250 | movl TI_flags(%ebp), %ecx # need_resched set ? | |
251 | testb $_TIF_NEED_RESCHED, %cl | |
252 | jz restore_all | |
253 | testl $IF_MASK,EFLAGS(%esp) # interrupts off (exception path) ? | |
254 | jz restore_all | |
255 | call preempt_schedule_irq | |
256 | jmp need_resched | |
257 | #endif | |
fe7cacc1 | 258 | CFI_ENDPROC |
1da177e4 LT |
259 | |
260 | /* SYSENTER_RETURN points to after the "sysenter" instruction in | |
261 | the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */ | |
262 | ||
263 | # sysenter call handler stub | |
264 | ENTRY(sysenter_entry) | |
fe7cacc1 JB |
265 | CFI_STARTPROC simple |
266 | CFI_DEF_CFA esp, 0 | |
267 | CFI_REGISTER esp, ebp | |
1da177e4 LT |
268 | movl TSS_sysenter_esp0(%esp),%esp |
269 | sysenter_past_esp: | |
55f327fa IM |
270 | /* |
271 | * No need to follow this irqs on/off section: the syscall | |
272 | * disabled irqs and here we enable it straight after entry: | |
273 | */ | |
1da177e4 LT |
274 | sti |
275 | pushl $(__USER_DS) | |
fe7cacc1 JB |
276 | CFI_ADJUST_CFA_OFFSET 4 |
277 | /*CFI_REL_OFFSET ss, 0*/ | |
1da177e4 | 278 | pushl %ebp |
fe7cacc1 JB |
279 | CFI_ADJUST_CFA_OFFSET 4 |
280 | CFI_REL_OFFSET esp, 0 | |
1da177e4 | 281 | pushfl |
fe7cacc1 | 282 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 283 | pushl $(__USER_CS) |
fe7cacc1 JB |
284 | CFI_ADJUST_CFA_OFFSET 4 |
285 | /*CFI_REL_OFFSET cs, 0*/ | |
e6e5494c IM |
286 | /* |
287 | * Push current_thread_info()->sysenter_return to the stack. | |
288 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words | |
289 | * pushed above; +8 corresponds to copy_thread's esp0 setting. | |
290 | */ | |
291 | pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) | |
fe7cacc1 JB |
292 | CFI_ADJUST_CFA_OFFSET 4 |
293 | CFI_REL_OFFSET eip, 0 | |
1da177e4 LT |
294 | |
295 | /* | |
296 | * Load the potential sixth argument from user stack. | |
297 | * Careful about security. | |
298 | */ | |
299 | cmpl $__PAGE_OFFSET-3,%ebp | |
300 | jae syscall_fault | |
301 | 1: movl (%ebp),%ebp | |
302 | .section __ex_table,"a" | |
303 | .align 4 | |
304 | .long 1b,syscall_fault | |
305 | .previous | |
306 | ||
307 | pushl %eax | |
fe7cacc1 | 308 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
309 | SAVE_ALL |
310 | GET_THREAD_INFO(%ebp) | |
311 | ||
312 | /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ | |
ed75e8d5 | 313 | testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) |
1da177e4 LT |
314 | jnz syscall_trace_entry |
315 | cmpl $(nr_syscalls), %eax | |
316 | jae syscall_badsys | |
317 | call *sys_call_table(,%eax,4) | |
318 | movl %eax,EAX(%esp) | |
319 | cli | |
55f327fa | 320 | TRACE_IRQS_OFF |
1da177e4 LT |
321 | movl TI_flags(%ebp), %ecx |
322 | testw $_TIF_ALLWORK_MASK, %cx | |
323 | jne syscall_exit_work | |
324 | /* if something modifies registers it must also disable sysexit */ | |
325 | movl EIP(%esp), %edx | |
326 | movl OLDESP(%esp), %ecx | |
327 | xorl %ebp,%ebp | |
55f327fa | 328 | TRACE_IRQS_ON |
1da177e4 LT |
329 | sti |
330 | sysexit | |
fe7cacc1 | 331 | CFI_ENDPROC |
1da177e4 LT |
332 | |
333 | ||
334 | # system call handler stub | |
335 | ENTRY(system_call) | |
fe7cacc1 | 336 | RING0_INT_FRAME # can't unwind into user space anyway |
1da177e4 | 337 | pushl %eax # save orig_eax |
fe7cacc1 | 338 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
339 | SAVE_ALL |
340 | GET_THREAD_INFO(%ebp) | |
635cf99a CE |
341 | testl $TF_MASK,EFLAGS(%esp) |
342 | jz no_singlestep | |
343 | orl $_TIF_SINGLESTEP,TI_flags(%ebp) | |
344 | no_singlestep: | |
ed75e8d5 | 345 | # system call tracing in operation / emulation |
1da177e4 | 346 | /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ |
ed75e8d5 | 347 | testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) |
1da177e4 LT |
348 | jnz syscall_trace_entry |
349 | cmpl $(nr_syscalls), %eax | |
350 | jae syscall_badsys | |
351 | syscall_call: | |
352 | call *sys_call_table(,%eax,4) | |
353 | movl %eax,EAX(%esp) # store the return value | |
354 | syscall_exit: | |
355 | cli # make sure we don't miss an interrupt | |
356 | # setting need_resched or sigpending | |
357 | # between sampling and the iret | |
55f327fa | 358 | TRACE_IRQS_OFF |
1da177e4 LT |
359 | movl TI_flags(%ebp), %ecx |
360 | testw $_TIF_ALLWORK_MASK, %cx # current->work | |
361 | jne syscall_exit_work | |
362 | ||
363 | restore_all: | |
364 | movl EFLAGS(%esp), %eax # mix EFLAGS, SS and CS | |
5df24082 SS |
365 | # Warning: OLDSS(%esp) contains the wrong/random values if we |
366 | # are returning to the kernel. | |
367 | # See comments in process.c:copy_thread() for details. | |
1da177e4 LT |
368 | movb OLDSS(%esp), %ah |
369 | movb CS(%esp), %al | |
370 | andl $(VM_MASK | (4 << 8) | 3), %eax | |
371 | cmpl $((4 << 8) | 3), %eax | |
fe7cacc1 | 372 | CFI_REMEMBER_STATE |
1da177e4 LT |
373 | je ldt_ss # returning to user-space with LDT SS |
374 | restore_nocheck: | |
55f327fa IM |
375 | TRACE_IRQS_IRET |
376 | restore_nocheck_notrace: | |
1da177e4 LT |
377 | RESTORE_REGS |
378 | addl $4, %esp | |
fe7cacc1 | 379 | CFI_ADJUST_CFA_OFFSET -4 |
1da177e4 LT |
380 | 1: iret |
381 | .section .fixup,"ax" | |
382 | iret_exc: | |
55f327fa | 383 | TRACE_IRQS_ON |
1da177e4 | 384 | sti |
a879cbbb LT |
385 | pushl $0 # no error code |
386 | pushl $do_iret_error | |
387 | jmp error_code | |
1da177e4 LT |
388 | .previous |
389 | .section __ex_table,"a" | |
390 | .align 4 | |
391 | .long 1b,iret_exc | |
392 | .previous | |
393 | ||
fe7cacc1 | 394 | CFI_RESTORE_STATE |
1da177e4 LT |
395 | ldt_ss: |
396 | larl OLDSS(%esp), %eax | |
397 | jnz restore_nocheck | |
398 | testl $0x00400000, %eax # returning to 32bit stack? | |
399 | jnz restore_nocheck # allright, normal return | |
400 | /* If returning to userspace with 16bit stack, | |
401 | * try to fix the higher word of ESP, as the CPU | |
402 | * won't restore it. | |
403 | * This is an "official" bug of all the x86-compatible | |
404 | * CPUs, which we can try to work around to make | |
405 | * dosemu and wine happy. */ | |
406 | subl $8, %esp # reserve space for switch16 pointer | |
fe7cacc1 | 407 | CFI_ADJUST_CFA_OFFSET 8 |
1da177e4 | 408 | cli |
55f327fa | 409 | TRACE_IRQS_OFF |
1da177e4 LT |
410 | movl %esp, %eax |
411 | /* Set up the 16bit stack frame with switch32 pointer on top, | |
412 | * and a switch16 pointer on top of the current frame. */ | |
413 | call setup_x86_bogus_stack | |
fe7cacc1 | 414 | CFI_ADJUST_CFA_OFFSET -8 # frame has moved |
55f327fa | 415 | TRACE_IRQS_IRET |
1da177e4 LT |
416 | RESTORE_REGS |
417 | lss 20+4(%esp), %esp # switch to 16bit stack | |
418 | 1: iret | |
419 | .section __ex_table,"a" | |
420 | .align 4 | |
421 | .long 1b,iret_exc | |
422 | .previous | |
fe7cacc1 | 423 | CFI_ENDPROC |
1da177e4 LT |
424 | |
425 | # perform work that needs to be done immediately before resumption | |
426 | ALIGN | |
fe7cacc1 | 427 | RING0_PTREGS_FRAME # can't unwind into user space anyway |
1da177e4 LT |
428 | work_pending: |
429 | testb $_TIF_NEED_RESCHED, %cl | |
430 | jz work_notifysig | |
431 | work_resched: | |
432 | call schedule | |
433 | cli # make sure we don't miss an interrupt | |
434 | # setting need_resched or sigpending | |
435 | # between sampling and the iret | |
55f327fa | 436 | TRACE_IRQS_OFF |
1da177e4 LT |
437 | movl TI_flags(%ebp), %ecx |
438 | andl $_TIF_WORK_MASK, %ecx # is there any work to be done other | |
439 | # than syscall tracing? | |
440 | jz restore_all | |
441 | testb $_TIF_NEED_RESCHED, %cl | |
442 | jnz work_resched | |
443 | ||
444 | work_notifysig: # deal with pending signals and | |
445 | # notify-resume requests | |
446 | testl $VM_MASK, EFLAGS(%esp) | |
447 | movl %esp, %eax | |
448 | jne work_notifysig_v86 # returning to kernel-space or | |
449 | # vm86-space | |
450 | xorl %edx, %edx | |
451 | call do_notify_resume | |
4031ff38 | 452 | jmp resume_userspace_sig |
1da177e4 LT |
453 | |
454 | ALIGN | |
455 | work_notifysig_v86: | |
64ca9004 | 456 | #ifdef CONFIG_VM86 |
1da177e4 | 457 | pushl %ecx # save ti_flags for do_notify_resume |
fe7cacc1 | 458 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
459 | call save_v86_state # %eax contains pt_regs pointer |
460 | popl %ecx | |
fe7cacc1 | 461 | CFI_ADJUST_CFA_OFFSET -4 |
1da177e4 LT |
462 | movl %eax, %esp |
463 | xorl %edx, %edx | |
464 | call do_notify_resume | |
4031ff38 | 465 | jmp resume_userspace_sig |
64ca9004 | 466 | #endif |
1da177e4 LT |
467 | |
468 | # perform syscall exit tracing | |
469 | ALIGN | |
470 | syscall_trace_entry: | |
471 | movl $-ENOSYS,EAX(%esp) | |
472 | movl %esp, %eax | |
473 | xorl %edx,%edx | |
474 | call do_syscall_trace | |
ed75e8d5 | 475 | cmpl $0, %eax |
640aa46e | 476 | jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU, |
ed75e8d5 | 477 | # so must skip actual syscall |
1da177e4 LT |
478 | movl ORIG_EAX(%esp), %eax |
479 | cmpl $(nr_syscalls), %eax | |
480 | jnae syscall_call | |
481 | jmp syscall_exit | |
482 | ||
483 | # perform syscall exit tracing | |
484 | ALIGN | |
485 | syscall_exit_work: | |
486 | testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl | |
487 | jz work_pending | |
55f327fa | 488 | TRACE_IRQS_ON |
1da177e4 LT |
489 | sti # could let do_syscall_trace() call |
490 | # schedule() instead | |
491 | movl %esp, %eax | |
492 | movl $1, %edx | |
493 | call do_syscall_trace | |
494 | jmp resume_userspace | |
fe7cacc1 | 495 | CFI_ENDPROC |
1da177e4 | 496 | |
fe7cacc1 | 497 | RING0_INT_FRAME # can't unwind into user space anyway |
1da177e4 LT |
498 | syscall_fault: |
499 | pushl %eax # save orig_eax | |
fe7cacc1 | 500 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
501 | SAVE_ALL |
502 | GET_THREAD_INFO(%ebp) | |
503 | movl $-EFAULT,EAX(%esp) | |
504 | jmp resume_userspace | |
505 | ||
1da177e4 LT |
506 | syscall_badsys: |
507 | movl $-ENOSYS,EAX(%esp) | |
508 | jmp resume_userspace | |
fe7cacc1 | 509 | CFI_ENDPROC |
1da177e4 LT |
510 | |
511 | #define FIXUP_ESPFIX_STACK \ | |
512 | movl %esp, %eax; \ | |
513 | /* switch to 32bit stack using the pointer on top of 16bit stack */ \ | |
514 | lss %ss:CPU_16BIT_STACK_SIZE-8, %esp; \ | |
515 | /* copy data from 16bit stack to 32bit stack */ \ | |
516 | call fixup_x86_bogus_stack; \ | |
517 | /* put ESP to the proper location */ \ | |
518 | movl %eax, %esp; | |
519 | #define UNWIND_ESPFIX_STACK \ | |
520 | pushl %eax; \ | |
fe7cacc1 | 521 | CFI_ADJUST_CFA_OFFSET 4; \ |
1da177e4 LT |
522 | movl %ss, %eax; \ |
523 | /* see if on 16bit stack */ \ | |
524 | cmpw $__ESPFIX_SS, %ax; \ | |
fe7cacc1 JB |
525 | je 28f; \ |
526 | 27: popl %eax; \ | |
527 | CFI_ADJUST_CFA_OFFSET -4; \ | |
528 | .section .fixup,"ax"; \ | |
529 | 28: movl $__KERNEL_DS, %eax; \ | |
530 | movl %eax, %ds; \ | |
531 | movl %eax, %es; \ | |
1da177e4 | 532 | /* switch to 32bit stack */ \ |
fe7cacc1 JB |
533 | FIXUP_ESPFIX_STACK; \ |
534 | jmp 27b; \ | |
535 | .previous | |
1da177e4 LT |
536 | |
537 | /* | |
538 | * Build the entry stubs and pointer table with | |
539 | * some assembler magic. | |
540 | */ | |
541 | .data | |
542 | ENTRY(interrupt) | |
543 | .text | |
544 | ||
545 | vector=0 | |
546 | ENTRY(irq_entries_start) | |
fe7cacc1 | 547 | RING0_INT_FRAME |
1da177e4 LT |
548 | .rept NR_IRQS |
549 | ALIGN | |
fe7cacc1 JB |
550 | .if vector |
551 | CFI_ADJUST_CFA_OFFSET -4 | |
552 | .endif | |
19eadf98 | 553 | 1: pushl $~(vector) |
fe7cacc1 | 554 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
555 | jmp common_interrupt |
556 | .data | |
557 | .long 1b | |
558 | .text | |
559 | vector=vector+1 | |
560 | .endr | |
561 | ||
55f327fa IM |
562 | /* |
563 | * the CPU automatically disables interrupts when executing an IRQ vector, | |
564 | * so IRQ-flags tracing has to follow that: | |
565 | */ | |
1da177e4 LT |
566 | ALIGN |
567 | common_interrupt: | |
568 | SAVE_ALL | |
55f327fa | 569 | TRACE_IRQS_OFF |
1da177e4 LT |
570 | movl %esp,%eax |
571 | call do_IRQ | |
572 | jmp ret_from_intr | |
fe7cacc1 | 573 | CFI_ENDPROC |
1da177e4 LT |
574 | |
575 | #define BUILD_INTERRUPT(name, nr) \ | |
576 | ENTRY(name) \ | |
fe7cacc1 | 577 | RING0_INT_FRAME; \ |
19eadf98 | 578 | pushl $~(nr); \ |
fe7cacc1 JB |
579 | CFI_ADJUST_CFA_OFFSET 4; \ |
580 | SAVE_ALL; \ | |
55f327fa | 581 | TRACE_IRQS_OFF \ |
1da177e4 LT |
582 | movl %esp,%eax; \ |
583 | call smp_/**/name; \ | |
55f327fa | 584 | jmp ret_from_intr; \ |
fe7cacc1 | 585 | CFI_ENDPROC |
1da177e4 LT |
586 | |
587 | /* The include is where all of the SMP etc. interrupts come from */ | |
588 | #include "entry_arch.h" | |
589 | ||
590 | ENTRY(divide_error) | |
fe7cacc1 | 591 | RING0_INT_FRAME |
1da177e4 | 592 | pushl $0 # no error code |
fe7cacc1 | 593 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 594 | pushl $do_divide_error |
fe7cacc1 | 595 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
596 | ALIGN |
597 | error_code: | |
598 | pushl %ds | |
fe7cacc1 JB |
599 | CFI_ADJUST_CFA_OFFSET 4 |
600 | /*CFI_REL_OFFSET ds, 0*/ | |
1da177e4 | 601 | pushl %eax |
fe7cacc1 JB |
602 | CFI_ADJUST_CFA_OFFSET 4 |
603 | CFI_REL_OFFSET eax, 0 | |
1da177e4 LT |
604 | xorl %eax, %eax |
605 | pushl %ebp | |
fe7cacc1 JB |
606 | CFI_ADJUST_CFA_OFFSET 4 |
607 | CFI_REL_OFFSET ebp, 0 | |
1da177e4 | 608 | pushl %edi |
fe7cacc1 JB |
609 | CFI_ADJUST_CFA_OFFSET 4 |
610 | CFI_REL_OFFSET edi, 0 | |
1da177e4 | 611 | pushl %esi |
fe7cacc1 JB |
612 | CFI_ADJUST_CFA_OFFSET 4 |
613 | CFI_REL_OFFSET esi, 0 | |
1da177e4 | 614 | pushl %edx |
fe7cacc1 JB |
615 | CFI_ADJUST_CFA_OFFSET 4 |
616 | CFI_REL_OFFSET edx, 0 | |
1da177e4 LT |
617 | decl %eax # eax = -1 |
618 | pushl %ecx | |
fe7cacc1 JB |
619 | CFI_ADJUST_CFA_OFFSET 4 |
620 | CFI_REL_OFFSET ecx, 0 | |
1da177e4 | 621 | pushl %ebx |
fe7cacc1 JB |
622 | CFI_ADJUST_CFA_OFFSET 4 |
623 | CFI_REL_OFFSET ebx, 0 | |
1da177e4 LT |
624 | cld |
625 | pushl %es | |
fe7cacc1 JB |
626 | CFI_ADJUST_CFA_OFFSET 4 |
627 | /*CFI_REL_OFFSET es, 0*/ | |
1da177e4 LT |
628 | UNWIND_ESPFIX_STACK |
629 | popl %ecx | |
fe7cacc1 JB |
630 | CFI_ADJUST_CFA_OFFSET -4 |
631 | /*CFI_REGISTER es, ecx*/ | |
1da177e4 LT |
632 | movl ES(%esp), %edi # get the function address |
633 | movl ORIG_EAX(%esp), %edx # get the error code | |
634 | movl %eax, ORIG_EAX(%esp) | |
635 | movl %ecx, ES(%esp) | |
fe7cacc1 | 636 | /*CFI_REL_OFFSET es, ES*/ |
1da177e4 LT |
637 | movl $(__USER_DS), %ecx |
638 | movl %ecx, %ds | |
639 | movl %ecx, %es | |
640 | movl %esp,%eax # pt_regs pointer | |
641 | call *%edi | |
642 | jmp ret_from_exception | |
fe7cacc1 | 643 | CFI_ENDPROC |
1da177e4 LT |
644 | |
645 | ENTRY(coprocessor_error) | |
fe7cacc1 | 646 | RING0_INT_FRAME |
1da177e4 | 647 | pushl $0 |
fe7cacc1 | 648 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 649 | pushl $do_coprocessor_error |
fe7cacc1 | 650 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 651 | jmp error_code |
fe7cacc1 | 652 | CFI_ENDPROC |
1da177e4 LT |
653 | |
654 | ENTRY(simd_coprocessor_error) | |
fe7cacc1 | 655 | RING0_INT_FRAME |
1da177e4 | 656 | pushl $0 |
fe7cacc1 | 657 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 658 | pushl $do_simd_coprocessor_error |
fe7cacc1 | 659 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 660 | jmp error_code |
fe7cacc1 | 661 | CFI_ENDPROC |
1da177e4 LT |
662 | |
663 | ENTRY(device_not_available) | |
fe7cacc1 | 664 | RING0_INT_FRAME |
1da177e4 | 665 | pushl $-1 # mark this as an int |
fe7cacc1 | 666 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
667 | SAVE_ALL |
668 | movl %cr0, %eax | |
669 | testl $0x4, %eax # EM (math emulation bit) | |
670 | jne device_not_available_emulate | |
671 | preempt_stop | |
672 | call math_state_restore | |
673 | jmp ret_from_exception | |
674 | device_not_available_emulate: | |
675 | pushl $0 # temporary storage for ORIG_EIP | |
fe7cacc1 | 676 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
677 | call math_emulate |
678 | addl $4, %esp | |
fe7cacc1 | 679 | CFI_ADJUST_CFA_OFFSET -4 |
1da177e4 | 680 | jmp ret_from_exception |
fe7cacc1 | 681 | CFI_ENDPROC |
1da177e4 LT |
682 | |
683 | /* | |
684 | * Debug traps and NMI can happen at the one SYSENTER instruction | |
685 | * that sets up the real kernel stack. Check here, since we can't | |
686 | * allow the wrong stack to be used. | |
687 | * | |
688 | * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have | |
689 | * already pushed 3 words if it hits on the sysenter instruction: | |
690 | * eflags, cs and eip. | |
691 | * | |
692 | * We just load the right stack, and push the three (known) values | |
693 | * by hand onto the new stack - while updating the return eip past | |
694 | * the instruction that would have done it for sysenter. | |
695 | */ | |
696 | #define FIX_STACK(offset, ok, label) \ | |
697 | cmpw $__KERNEL_CS,4(%esp); \ | |
698 | jne ok; \ | |
699 | label: \ | |
700 | movl TSS_sysenter_esp0+offset(%esp),%esp; \ | |
701 | pushfl; \ | |
702 | pushl $__KERNEL_CS; \ | |
703 | pushl $sysenter_past_esp | |
704 | ||
3d97ae5b | 705 | KPROBE_ENTRY(debug) |
fe7cacc1 | 706 | RING0_INT_FRAME |
1da177e4 LT |
707 | cmpl $sysenter_entry,(%esp) |
708 | jne debug_stack_correct | |
709 | FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn) | |
710 | debug_stack_correct: | |
711 | pushl $-1 # mark this as an int | |
fe7cacc1 | 712 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
713 | SAVE_ALL |
714 | xorl %edx,%edx # error code 0 | |
715 | movl %esp,%eax # pt_regs pointer | |
716 | call do_debug | |
1da177e4 | 717 | jmp ret_from_exception |
fe7cacc1 | 718 | CFI_ENDPROC |
3d97ae5b | 719 | .previous .text |
1da177e4 LT |
720 | /* |
721 | * NMI is doubly nasty. It can happen _while_ we're handling | |
722 | * a debug fault, and the debug fault hasn't yet been able to | |
723 | * clear up the stack. So we first check whether we got an | |
724 | * NMI on the sysenter entry path, but after that we need to | |
725 | * check whether we got an NMI on the debug path where the debug | |
726 | * fault happened on the sysenter path. | |
727 | */ | |
728 | ENTRY(nmi) | |
fe7cacc1 | 729 | RING0_INT_FRAME |
1da177e4 | 730 | pushl %eax |
fe7cacc1 | 731 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
732 | movl %ss, %eax |
733 | cmpw $__ESPFIX_SS, %ax | |
734 | popl %eax | |
fe7cacc1 | 735 | CFI_ADJUST_CFA_OFFSET -4 |
1da177e4 LT |
736 | je nmi_16bit_stack |
737 | cmpl $sysenter_entry,(%esp) | |
738 | je nmi_stack_fixup | |
739 | pushl %eax | |
fe7cacc1 | 740 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
741 | movl %esp,%eax |
742 | /* Do not access memory above the end of our stack page, | |
743 | * it might not exist. | |
744 | */ | |
745 | andl $(THREAD_SIZE-1),%eax | |
746 | cmpl $(THREAD_SIZE-20),%eax | |
747 | popl %eax | |
fe7cacc1 | 748 | CFI_ADJUST_CFA_OFFSET -4 |
1da177e4 LT |
749 | jae nmi_stack_correct |
750 | cmpl $sysenter_entry,12(%esp) | |
751 | je nmi_debug_stack_check | |
752 | nmi_stack_correct: | |
753 | pushl %eax | |
fe7cacc1 | 754 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
755 | SAVE_ALL |
756 | xorl %edx,%edx # zero error code | |
757 | movl %esp,%eax # pt_regs pointer | |
758 | call do_nmi | |
55f327fa | 759 | jmp restore_nocheck_notrace |
fe7cacc1 | 760 | CFI_ENDPROC |
1da177e4 LT |
761 | |
762 | nmi_stack_fixup: | |
763 | FIX_STACK(12,nmi_stack_correct, 1) | |
764 | jmp nmi_stack_correct | |
765 | nmi_debug_stack_check: | |
766 | cmpw $__KERNEL_CS,16(%esp) | |
767 | jne nmi_stack_correct | |
e2718208 JB |
768 | cmpl $debug,(%esp) |
769 | jb nmi_stack_correct | |
1da177e4 | 770 | cmpl $debug_esp_fix_insn,(%esp) |
e2718208 | 771 | ja nmi_stack_correct |
1da177e4 LT |
772 | FIX_STACK(24,nmi_stack_correct, 1) |
773 | jmp nmi_stack_correct | |
774 | ||
775 | nmi_16bit_stack: | |
fe7cacc1 | 776 | RING0_INT_FRAME |
1da177e4 LT |
777 | /* create the pointer to lss back */ |
778 | pushl %ss | |
fe7cacc1 | 779 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 780 | pushl %esp |
fe7cacc1 | 781 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
782 | movzwl %sp, %esp |
783 | addw $4, (%esp) | |
784 | /* copy the iret frame of 12 bytes */ | |
785 | .rept 3 | |
786 | pushl 16(%esp) | |
fe7cacc1 | 787 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
788 | .endr |
789 | pushl %eax | |
fe7cacc1 | 790 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
791 | SAVE_ALL |
792 | FIXUP_ESPFIX_STACK # %eax == %esp | |
fe7cacc1 | 793 | CFI_ADJUST_CFA_OFFSET -20 # the frame has now moved |
1da177e4 LT |
794 | xorl %edx,%edx # zero error code |
795 | call do_nmi | |
796 | RESTORE_REGS | |
797 | lss 12+4(%esp), %esp # back to 16bit stack | |
798 | 1: iret | |
fe7cacc1 | 799 | CFI_ENDPROC |
1da177e4 LT |
800 | .section __ex_table,"a" |
801 | .align 4 | |
802 | .long 1b,iret_exc | |
803 | .previous | |
804 | ||
3d97ae5b | 805 | KPROBE_ENTRY(int3) |
fe7cacc1 | 806 | RING0_INT_FRAME |
1da177e4 | 807 | pushl $-1 # mark this as an int |
fe7cacc1 | 808 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 LT |
809 | SAVE_ALL |
810 | xorl %edx,%edx # zero error code | |
811 | movl %esp,%eax # pt_regs pointer | |
812 | call do_int3 | |
1da177e4 | 813 | jmp ret_from_exception |
fe7cacc1 | 814 | CFI_ENDPROC |
3d97ae5b | 815 | .previous .text |
1da177e4 LT |
816 | |
817 | ENTRY(overflow) | |
fe7cacc1 | 818 | RING0_INT_FRAME |
1da177e4 | 819 | pushl $0 |
fe7cacc1 | 820 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 821 | pushl $do_overflow |
fe7cacc1 | 822 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 823 | jmp error_code |
fe7cacc1 | 824 | CFI_ENDPROC |
1da177e4 LT |
825 | |
826 | ENTRY(bounds) | |
fe7cacc1 | 827 | RING0_INT_FRAME |
1da177e4 | 828 | pushl $0 |
fe7cacc1 | 829 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 830 | pushl $do_bounds |
fe7cacc1 | 831 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 832 | jmp error_code |
fe7cacc1 | 833 | CFI_ENDPROC |
1da177e4 LT |
834 | |
835 | ENTRY(invalid_op) | |
fe7cacc1 | 836 | RING0_INT_FRAME |
1da177e4 | 837 | pushl $0 |
fe7cacc1 | 838 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 839 | pushl $do_invalid_op |
fe7cacc1 | 840 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 841 | jmp error_code |
fe7cacc1 | 842 | CFI_ENDPROC |
1da177e4 LT |
843 | |
844 | ENTRY(coprocessor_segment_overrun) | |
fe7cacc1 | 845 | RING0_INT_FRAME |
1da177e4 | 846 | pushl $0 |
fe7cacc1 | 847 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 848 | pushl $do_coprocessor_segment_overrun |
fe7cacc1 | 849 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 850 | jmp error_code |
fe7cacc1 | 851 | CFI_ENDPROC |
1da177e4 LT |
852 | |
853 | ENTRY(invalid_TSS) | |
fe7cacc1 | 854 | RING0_EC_FRAME |
1da177e4 | 855 | pushl $do_invalid_TSS |
fe7cacc1 | 856 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 857 | jmp error_code |
fe7cacc1 | 858 | CFI_ENDPROC |
1da177e4 LT |
859 | |
860 | ENTRY(segment_not_present) | |
fe7cacc1 | 861 | RING0_EC_FRAME |
1da177e4 | 862 | pushl $do_segment_not_present |
fe7cacc1 | 863 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 864 | jmp error_code |
fe7cacc1 | 865 | CFI_ENDPROC |
1da177e4 LT |
866 | |
867 | ENTRY(stack_segment) | |
fe7cacc1 | 868 | RING0_EC_FRAME |
1da177e4 | 869 | pushl $do_stack_segment |
fe7cacc1 | 870 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 871 | jmp error_code |
fe7cacc1 | 872 | CFI_ENDPROC |
1da177e4 | 873 | |
3d97ae5b | 874 | KPROBE_ENTRY(general_protection) |
fe7cacc1 | 875 | RING0_EC_FRAME |
1da177e4 | 876 | pushl $do_general_protection |
fe7cacc1 | 877 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 878 | jmp error_code |
fe7cacc1 | 879 | CFI_ENDPROC |
3d97ae5b | 880 | .previous .text |
1da177e4 LT |
881 | |
882 | ENTRY(alignment_check) | |
fe7cacc1 | 883 | RING0_EC_FRAME |
1da177e4 | 884 | pushl $do_alignment_check |
fe7cacc1 | 885 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 886 | jmp error_code |
fe7cacc1 | 887 | CFI_ENDPROC |
1da177e4 | 888 | |
3d97ae5b | 889 | KPROBE_ENTRY(page_fault) |
fe7cacc1 | 890 | RING0_EC_FRAME |
1da177e4 | 891 | pushl $do_page_fault |
fe7cacc1 | 892 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 893 | jmp error_code |
fe7cacc1 | 894 | CFI_ENDPROC |
3d97ae5b | 895 | .previous .text |
1da177e4 LT |
896 | |
897 | #ifdef CONFIG_X86_MCE | |
898 | ENTRY(machine_check) | |
fe7cacc1 | 899 | RING0_INT_FRAME |
1da177e4 | 900 | pushl $0 |
fe7cacc1 | 901 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 902 | pushl machine_check_vector |
fe7cacc1 | 903 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 904 | jmp error_code |
fe7cacc1 | 905 | CFI_ENDPROC |
1da177e4 LT |
906 | #endif |
907 | ||
908 | ENTRY(spurious_interrupt_bug) | |
fe7cacc1 | 909 | RING0_INT_FRAME |
1da177e4 | 910 | pushl $0 |
fe7cacc1 | 911 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 912 | pushl $do_spurious_interrupt_bug |
fe7cacc1 | 913 | CFI_ADJUST_CFA_OFFSET 4 |
1da177e4 | 914 | jmp error_code |
fe7cacc1 | 915 | CFI_ENDPROC |
1da177e4 | 916 | |
176a2718 JB |
917 | #ifdef CONFIG_STACK_UNWIND |
918 | ENTRY(arch_unwind_init_running) | |
fe7cacc1 | 919 | CFI_STARTPROC |
176a2718 JB |
920 | movl 4(%esp), %edx |
921 | movl (%esp), %ecx | |
922 | leal 4(%esp), %eax | |
923 | movl %ebx, EBX(%edx) | |
924 | xorl %ebx, %ebx | |
925 | movl %ebx, ECX(%edx) | |
926 | movl %ebx, EDX(%edx) | |
927 | movl %esi, ESI(%edx) | |
928 | movl %edi, EDI(%edx) | |
929 | movl %ebp, EBP(%edx) | |
930 | movl %ebx, EAX(%edx) | |
931 | movl $__USER_DS, DS(%edx) | |
932 | movl $__USER_DS, ES(%edx) | |
933 | movl %ebx, ORIG_EAX(%edx) | |
934 | movl %ecx, EIP(%edx) | |
935 | movl 12(%esp), %ecx | |
936 | movl $__KERNEL_CS, CS(%edx) | |
937 | movl %ebx, EFLAGS(%edx) | |
938 | movl %eax, OLDESP(%edx) | |
939 | movl 8(%esp), %eax | |
940 | movl %ecx, 8(%esp) | |
941 | movl EBX(%edx), %ebx | |
942 | movl $__KERNEL_DS, OLDSS(%edx) | |
943 | jmpl *%eax | |
fe7cacc1 | 944 | CFI_ENDPROC |
176a2718 JB |
945 | ENDPROC(arch_unwind_init_running) |
946 | #endif | |
947 | ||
bb152f53 | 948 | .section .rodata,"a" |
5e7b83ff | 949 | #include "syscall_table.S" |
1da177e4 LT |
950 | |
951 | syscall_table_size=(.-sys_call_table) |