2 * linux/arch/i386/entry.S
4 * Copyright (C) 1991, 1992 Linus Torvalds
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.
12 * NOTE: This code handles signal-recognition, which happens every time
13 * after a timer-interrupt and after each system call.
15 * I changed all the .align's to 4 (16 byte alignment), as that's faster
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
41 * "current" is in register %ebx during any slow entries.
44 #include <linux/linkage.h>
45 #include <asm/thread_info.h>
46 #include <asm/irqflags.h>
47 #include <asm/errno.h>
48 #include <asm/segment.h>
52 #include <asm/percpu.h>
53 #include <asm/dwarf2.h>
54 #include "irq_vectors.h"
56 #define nr_syscalls ((syscall_table_size)/4)
65 /* These are replaces for paravirtualization */
66 #define DISABLE_INTERRUPTS cli
67 #define ENABLE_INTERRUPTS sti
68 #define ENABLE_INTERRUPTS_SYSEXIT sti; sysexit
69 #define INTERRUPT_RETURN iret
70 #define GET_CR0_INTO_EAX movl %cr0, %eax
73 #define preempt_stop DISABLE_INTERRUPTS; TRACE_IRQS_OFF
76 #define resume_kernel restore_nocheck
79 .macro TRACE_IRQS_IRET
80 #ifdef CONFIG_TRACE_IRQFLAGS
81 testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off?
89 #define resume_userspace_sig check_userspace
91 #define resume_userspace_sig resume_userspace
97 CFI_ADJUST_CFA_OFFSET 4;\
98 /*CFI_REL_OFFSET gs, 0;*/\
100 CFI_ADJUST_CFA_OFFSET 4;\
101 /*CFI_REL_OFFSET es, 0;*/\
103 CFI_ADJUST_CFA_OFFSET 4;\
104 /*CFI_REL_OFFSET ds, 0;*/\
106 CFI_ADJUST_CFA_OFFSET 4;\
107 CFI_REL_OFFSET eax, 0;\
109 CFI_ADJUST_CFA_OFFSET 4;\
110 CFI_REL_OFFSET ebp, 0;\
112 CFI_ADJUST_CFA_OFFSET 4;\
113 CFI_REL_OFFSET edi, 0;\
115 CFI_ADJUST_CFA_OFFSET 4;\
116 CFI_REL_OFFSET esi, 0;\
118 CFI_ADJUST_CFA_OFFSET 4;\
119 CFI_REL_OFFSET edx, 0;\
121 CFI_ADJUST_CFA_OFFSET 4;\
122 CFI_REL_OFFSET ecx, 0;\
124 CFI_ADJUST_CFA_OFFSET 4;\
125 CFI_REL_OFFSET ebx, 0;\
126 movl $(__USER_DS), %edx; \
129 movl $(__KERNEL_PDA), %edx; \
132 #define RESTORE_INT_REGS \
134 CFI_ADJUST_CFA_OFFSET -4;\
137 CFI_ADJUST_CFA_OFFSET -4;\
140 CFI_ADJUST_CFA_OFFSET -4;\
143 CFI_ADJUST_CFA_OFFSET -4;\
146 CFI_ADJUST_CFA_OFFSET -4;\
149 CFI_ADJUST_CFA_OFFSET -4;\
152 CFI_ADJUST_CFA_OFFSET -4;\
155 #define RESTORE_REGS \
158 CFI_ADJUST_CFA_OFFSET -4;\
161 CFI_ADJUST_CFA_OFFSET -4;\
164 CFI_ADJUST_CFA_OFFSET -4;\
166 .pushsection .fixup,"ax"; \
173 .section __ex_table,"a";\
180 #define RING0_INT_FRAME \
181 CFI_STARTPROC simple;\
183 CFI_DEF_CFA esp, 3*4;\
184 /*CFI_OFFSET cs, -2*4;*/\
187 #define RING0_EC_FRAME \
188 CFI_STARTPROC simple;\
190 CFI_DEF_CFA esp, 4*4;\
191 /*CFI_OFFSET cs, -2*4;*/\
194 #define RING0_PTREGS_FRAME \
195 CFI_STARTPROC simple;\
197 CFI_DEF_CFA esp, PT_OLDESP-PT_EBX;\
198 /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/\
199 CFI_OFFSET eip, PT_EIP-PT_OLDESP;\
200 /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/\
201 /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/\
202 CFI_OFFSET eax, PT_EAX-PT_OLDESP;\
203 CFI_OFFSET ebp, PT_EBP-PT_OLDESP;\
204 CFI_OFFSET edi, PT_EDI-PT_OLDESP;\
205 CFI_OFFSET esi, PT_ESI-PT_OLDESP;\
206 CFI_OFFSET edx, PT_EDX-PT_OLDESP;\
207 CFI_OFFSET ecx, PT_ECX-PT_OLDESP;\
208 CFI_OFFSET ebx, PT_EBX-PT_OLDESP
213 CFI_ADJUST_CFA_OFFSET 4
215 GET_THREAD_INFO(%ebp)
217 CFI_ADJUST_CFA_OFFSET -4
218 pushl $0x0202 # Reset kernel eflags
219 CFI_ADJUST_CFA_OFFSET 4
221 CFI_ADJUST_CFA_OFFSET -4
226 * Return to user mode is not as complex as all this looks,
227 * but we want the default path for a system call return to
228 * go as quickly as possible which is why some of this is
229 * less clear than it otherwise should be.
232 # userspace resumption stub bypassing syscall exit tracing
238 GET_THREAD_INFO(%ebp)
240 movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS
241 movb PT_CS(%esp), %al
242 andl $(VM_MASK | SEGMENT_RPL_MASK), %eax
244 jb resume_kernel # not returning to v8086 or userspace
246 ENTRY(resume_userspace)
247 DISABLE_INTERRUPTS # make sure we don't miss an interrupt
248 # setting need_resched or sigpending
249 # between sampling and the iret
250 movl TI_flags(%ebp), %ecx
251 andl $_TIF_WORK_MASK, %ecx # is there any work to be done on
252 # int/exception return?
256 #ifdef CONFIG_PREEMPT
259 cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
262 movl TI_flags(%ebp), %ecx # need_resched set ?
263 testb $_TIF_NEED_RESCHED, %cl
265 testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off (exception path) ?
267 call preempt_schedule_irq
272 /* SYSENTER_RETURN points to after the "sysenter" instruction in
273 the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */
275 # sysenter call handler stub
276 ENTRY(sysenter_entry)
280 CFI_REGISTER esp, ebp
281 movl TSS_sysenter_esp0(%esp),%esp
284 * No need to follow this irqs on/off section: the syscall
285 * disabled irqs and here we enable it straight after entry:
289 CFI_ADJUST_CFA_OFFSET 4
290 /*CFI_REL_OFFSET ss, 0*/
292 CFI_ADJUST_CFA_OFFSET 4
293 CFI_REL_OFFSET esp, 0
295 CFI_ADJUST_CFA_OFFSET 4
297 CFI_ADJUST_CFA_OFFSET 4
298 /*CFI_REL_OFFSET cs, 0*/
300 * Push current_thread_info()->sysenter_return to the stack.
301 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
302 * pushed above; +8 corresponds to copy_thread's esp0 setting.
304 pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp)
305 CFI_ADJUST_CFA_OFFSET 4
306 CFI_REL_OFFSET eip, 0
309 * Load the potential sixth argument from user stack.
310 * Careful about security.
312 cmpl $__PAGE_OFFSET-3,%ebp
315 .section __ex_table,"a"
317 .long 1b,syscall_fault
321 CFI_ADJUST_CFA_OFFSET 4
323 GET_THREAD_INFO(%ebp)
325 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
326 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
327 jnz syscall_trace_entry
328 cmpl $(nr_syscalls), %eax
330 call *sys_call_table(,%eax,4)
331 movl %eax,PT_EAX(%esp)
334 movl TI_flags(%ebp), %ecx
335 testw $_TIF_ALLWORK_MASK, %cx
336 jne syscall_exit_work
337 /* if something modifies registers it must also disable sysexit */
338 movl PT_EIP(%esp), %edx
339 movl PT_OLDESP(%esp), %ecx
342 1: mov PT_GS(%esp), %gs
343 ENABLE_INTERRUPTS_SYSEXIT
345 .pushsection .fixup,"ax"
346 2: movl $0,PT_GS(%esp)
348 .section __ex_table,"a"
353 # system call handler stub
355 RING0_INT_FRAME # can't unwind into user space anyway
356 pushl %eax # save orig_eax
357 CFI_ADJUST_CFA_OFFSET 4
359 GET_THREAD_INFO(%ebp)
360 testl $TF_MASK,PT_EFLAGS(%esp)
362 orl $_TIF_SINGLESTEP,TI_flags(%ebp)
364 # system call tracing in operation / emulation
365 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
366 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
367 jnz syscall_trace_entry
368 cmpl $(nr_syscalls), %eax
371 call *sys_call_table(,%eax,4)
372 movl %eax,PT_EAX(%esp) # store the return value
374 DISABLE_INTERRUPTS # make sure we don't miss an interrupt
375 # setting need_resched or sigpending
376 # between sampling and the iret
378 movl TI_flags(%ebp), %ecx
379 testw $_TIF_ALLWORK_MASK, %cx # current->work
380 jne syscall_exit_work
383 movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
384 # Warning: PT_OLDSS(%esp) contains the wrong/random values if we
385 # are returning to the kernel.
386 # See comments in process.c:copy_thread() for details.
387 movb PT_OLDSS(%esp), %ah
388 movb PT_CS(%esp), %al
389 andl $(VM_MASK | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax
390 cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax
392 je ldt_ss # returning to user-space with LDT SS
395 restore_nocheck_notrace:
397 addl $4, %esp # skip orig_eax/error_code
398 CFI_ADJUST_CFA_OFFSET -4
404 pushl $0 # no error code
408 .section __ex_table,"a"
415 larl PT_OLDSS(%esp), %eax
417 testl $0x00400000, %eax # returning to 32bit stack?
418 jnz restore_nocheck # allright, normal return
419 /* If returning to userspace with 16bit stack,
420 * try to fix the higher word of ESP, as the CPU
422 * This is an "official" bug of all the x86-compatible
423 * CPUs, which we can try to work around to make
424 * dosemu and wine happy. */
425 movl PT_OLDESP(%esp), %eax
427 call patch_espfix_desc
429 CFI_ADJUST_CFA_OFFSET 4
431 CFI_ADJUST_CFA_OFFSET 4
435 CFI_ADJUST_CFA_OFFSET -8
439 # perform work that needs to be done immediately before resumption
441 RING0_PTREGS_FRAME # can't unwind into user space anyway
443 testb $_TIF_NEED_RESCHED, %cl
447 DISABLE_INTERRUPTS # make sure we don't miss an interrupt
448 # setting need_resched or sigpending
449 # between sampling and the iret
451 movl TI_flags(%ebp), %ecx
452 andl $_TIF_WORK_MASK, %ecx # is there any work to be done other
453 # than syscall tracing?
455 testb $_TIF_NEED_RESCHED, %cl
458 work_notifysig: # deal with pending signals and
459 # notify-resume requests
460 testl $VM_MASK, PT_EFLAGS(%esp)
462 jne work_notifysig_v86 # returning to kernel-space or
465 call do_notify_resume
466 jmp resume_userspace_sig
471 pushl %ecx # save ti_flags for do_notify_resume
472 CFI_ADJUST_CFA_OFFSET 4
473 call save_v86_state # %eax contains pt_regs pointer
475 CFI_ADJUST_CFA_OFFSET -4
478 call do_notify_resume
479 jmp resume_userspace_sig
482 # perform syscall exit tracing
485 movl $-ENOSYS,PT_EAX(%esp)
488 call do_syscall_trace
490 jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU,
491 # so must skip actual syscall
492 movl PT_ORIG_EAX(%esp), %eax
493 cmpl $(nr_syscalls), %eax
497 # perform syscall exit tracing
500 testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl
503 ENABLE_INTERRUPTS # could let do_syscall_trace() call
507 call do_syscall_trace
511 RING0_INT_FRAME # can't unwind into user space anyway
513 pushl %eax # save orig_eax
514 CFI_ADJUST_CFA_OFFSET 4
516 GET_THREAD_INFO(%ebp)
517 movl $-EFAULT,PT_EAX(%esp)
521 movl $-ENOSYS,PT_EAX(%esp)
525 #define FIXUP_ESPFIX_STACK \
526 /* since we are on a wrong stack, we cant make it a C code :( */ \
527 GET_THREAD_INFO(%ebp); \
528 movl TI_cpu(%ebp), %ebx; \
529 PER_CPU(cpu_gdt_descr, %ebx); \
530 movl GDS_address(%ebx), %ebx; \
531 GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \
533 pushl $__KERNEL_DS; \
534 CFI_ADJUST_CFA_OFFSET 4; \
536 CFI_ADJUST_CFA_OFFSET 4; \
538 CFI_ADJUST_CFA_OFFSET -8;
539 #define UNWIND_ESPFIX_STACK \
541 /* see if on espfix stack */ \
542 cmpw $__ESPFIX_SS, %ax; \
544 movl $__KERNEL_DS, %eax; \
547 /* switch to normal stack */ \
548 FIXUP_ESPFIX_STACK; \
552 * Build the entry stubs and pointer table with
553 * some assembler magic.
560 ENTRY(irq_entries_start)
565 CFI_ADJUST_CFA_OFFSET -4
568 CFI_ADJUST_CFA_OFFSET 4
577 * the CPU automatically disables interrupts when executing an IRQ vector,
578 * so IRQ-flags tracing has to follow that:
589 #define BUILD_INTERRUPT(name, nr) \
593 CFI_ADJUST_CFA_OFFSET 4; \
601 /* The include is where all of the SMP etc. interrupts come from */
602 #include "entry_arch.h"
604 KPROBE_ENTRY(page_fault)
607 CFI_ADJUST_CFA_OFFSET 4
610 /* the function address is in %gs's slot on the stack */
612 CFI_ADJUST_CFA_OFFSET 4
613 /*CFI_REL_OFFSET es, 0*/
615 CFI_ADJUST_CFA_OFFSET 4
616 /*CFI_REL_OFFSET ds, 0*/
618 CFI_ADJUST_CFA_OFFSET 4
619 CFI_REL_OFFSET eax, 0
621 CFI_ADJUST_CFA_OFFSET 4
622 CFI_REL_OFFSET ebp, 0
624 CFI_ADJUST_CFA_OFFSET 4
625 CFI_REL_OFFSET edi, 0
627 CFI_ADJUST_CFA_OFFSET 4
628 CFI_REL_OFFSET esi, 0
630 CFI_ADJUST_CFA_OFFSET 4
631 CFI_REL_OFFSET edx, 0
633 CFI_ADJUST_CFA_OFFSET 4
634 CFI_REL_OFFSET ecx, 0
636 CFI_ADJUST_CFA_OFFSET 4
637 CFI_REL_OFFSET ebx, 0
640 CFI_ADJUST_CFA_OFFSET 4
641 /*CFI_REL_OFFSET gs, 0*/
642 movl $(__KERNEL_PDA), %ecx
646 CFI_ADJUST_CFA_OFFSET -4
647 /*CFI_REGISTER es, ecx*/
648 movl PT_GS(%esp), %edi # get the function address
649 movl PT_ORIG_EAX(%esp), %edx # get the error code
650 movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
651 mov %ecx, PT_GS(%esp)
652 /*CFI_REL_OFFSET gs, ES*/
653 movl $(__USER_DS), %ecx
656 movl %esp,%eax # pt_regs pointer
658 jmp ret_from_exception
660 KPROBE_END(page_fault)
662 ENTRY(coprocessor_error)
665 CFI_ADJUST_CFA_OFFSET 4
666 pushl $do_coprocessor_error
667 CFI_ADJUST_CFA_OFFSET 4
671 ENTRY(simd_coprocessor_error)
674 CFI_ADJUST_CFA_OFFSET 4
675 pushl $do_simd_coprocessor_error
676 CFI_ADJUST_CFA_OFFSET 4
680 ENTRY(device_not_available)
682 pushl $-1 # mark this as an int
683 CFI_ADJUST_CFA_OFFSET 4
686 testl $0x4, %eax # EM (math emulation bit)
687 jne device_not_available_emulate
689 call math_state_restore
690 jmp ret_from_exception
691 device_not_available_emulate:
692 pushl $0 # temporary storage for ORIG_EIP
693 CFI_ADJUST_CFA_OFFSET 4
696 CFI_ADJUST_CFA_OFFSET -4
697 jmp ret_from_exception
701 * Debug traps and NMI can happen at the one SYSENTER instruction
702 * that sets up the real kernel stack. Check here, since we can't
703 * allow the wrong stack to be used.
705 * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have
706 * already pushed 3 words if it hits on the sysenter instruction:
707 * eflags, cs and eip.
709 * We just load the right stack, and push the three (known) values
710 * by hand onto the new stack - while updating the return eip past
711 * the instruction that would have done it for sysenter.
713 #define FIX_STACK(offset, ok, label) \
714 cmpw $__KERNEL_CS,4(%esp); \
717 movl TSS_sysenter_esp0+offset(%esp),%esp; \
718 CFI_DEF_CFA esp, 0; \
721 CFI_ADJUST_CFA_OFFSET 4; \
722 pushl $__KERNEL_CS; \
723 CFI_ADJUST_CFA_OFFSET 4; \
724 pushl $sysenter_past_esp; \
725 CFI_ADJUST_CFA_OFFSET 4; \
726 CFI_REL_OFFSET eip, 0
730 cmpl $sysenter_entry,(%esp)
731 jne debug_stack_correct
732 FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn)
734 pushl $-1 # mark this as an int
735 CFI_ADJUST_CFA_OFFSET 4
737 xorl %edx,%edx # error code 0
738 movl %esp,%eax # pt_regs pointer
740 jmp ret_from_exception
745 * NMI is doubly nasty. It can happen _while_ we're handling
746 * a debug fault, and the debug fault hasn't yet been able to
747 * clear up the stack. So we first check whether we got an
748 * NMI on the sysenter entry path, but after that we need to
749 * check whether we got an NMI on the debug path where the debug
750 * fault happened on the sysenter path.
755 CFI_ADJUST_CFA_OFFSET 4
757 cmpw $__ESPFIX_SS, %ax
759 CFI_ADJUST_CFA_OFFSET -4
761 cmpl $sysenter_entry,(%esp)
764 CFI_ADJUST_CFA_OFFSET 4
766 /* Do not access memory above the end of our stack page,
767 * it might not exist.
769 andl $(THREAD_SIZE-1),%eax
770 cmpl $(THREAD_SIZE-20),%eax
772 CFI_ADJUST_CFA_OFFSET -4
773 jae nmi_stack_correct
774 cmpl $sysenter_entry,12(%esp)
775 je nmi_debug_stack_check
777 /* We have a RING0_INT_FRAME here */
779 CFI_ADJUST_CFA_OFFSET 4
781 xorl %edx,%edx # zero error code
782 movl %esp,%eax # pt_regs pointer
784 jmp restore_nocheck_notrace
789 FIX_STACK(12,nmi_stack_correct, 1)
790 jmp nmi_stack_correct
792 nmi_debug_stack_check:
793 /* We have a RING0_INT_FRAME here */
794 cmpw $__KERNEL_CS,16(%esp)
795 jne nmi_stack_correct
798 cmpl $debug_esp_fix_insn,(%esp)
800 FIX_STACK(24,nmi_stack_correct, 1)
801 jmp nmi_stack_correct
804 /* We have a RING0_INT_FRAME here.
806 * create the pointer to lss back
809 CFI_ADJUST_CFA_OFFSET 4
811 CFI_ADJUST_CFA_OFFSET 4
813 /* copy the iret frame of 12 bytes */
816 CFI_ADJUST_CFA_OFFSET 4
819 CFI_ADJUST_CFA_OFFSET 4
821 FIXUP_ESPFIX_STACK # %eax == %esp
822 xorl %edx,%edx # zero error code
825 lss 12+4(%esp), %esp # back to espfix stack
826 CFI_ADJUST_CFA_OFFSET -24
829 .section __ex_table,"a"
837 pushl $-1 # mark this as an int
838 CFI_ADJUST_CFA_OFFSET 4
840 xorl %edx,%edx # zero error code
841 movl %esp,%eax # pt_regs pointer
843 jmp ret_from_exception
850 CFI_ADJUST_CFA_OFFSET 4
852 CFI_ADJUST_CFA_OFFSET 4
859 CFI_ADJUST_CFA_OFFSET 4
861 CFI_ADJUST_CFA_OFFSET 4
868 CFI_ADJUST_CFA_OFFSET 4
870 CFI_ADJUST_CFA_OFFSET 4
874 ENTRY(coprocessor_segment_overrun)
877 CFI_ADJUST_CFA_OFFSET 4
878 pushl $do_coprocessor_segment_overrun
879 CFI_ADJUST_CFA_OFFSET 4
885 pushl $do_invalid_TSS
886 CFI_ADJUST_CFA_OFFSET 4
890 ENTRY(segment_not_present)
892 pushl $do_segment_not_present
893 CFI_ADJUST_CFA_OFFSET 4
899 pushl $do_stack_segment
900 CFI_ADJUST_CFA_OFFSET 4
904 KPROBE_ENTRY(general_protection)
906 pushl $do_general_protection
907 CFI_ADJUST_CFA_OFFSET 4
910 KPROBE_END(general_protection)
912 ENTRY(alignment_check)
914 pushl $do_alignment_check
915 CFI_ADJUST_CFA_OFFSET 4
921 pushl $0 # no error code
922 CFI_ADJUST_CFA_OFFSET 4
923 pushl $do_divide_error
924 CFI_ADJUST_CFA_OFFSET 4
928 #ifdef CONFIG_X86_MCE
932 CFI_ADJUST_CFA_OFFSET 4
933 pushl machine_check_vector
934 CFI_ADJUST_CFA_OFFSET 4
939 ENTRY(spurious_interrupt_bug)
942 CFI_ADJUST_CFA_OFFSET 4
943 pushl $do_spurious_interrupt_bug
944 CFI_ADJUST_CFA_OFFSET 4
948 #ifdef CONFIG_STACK_UNWIND
949 ENTRY(arch_unwind_init_running)
954 movl %ebx, PT_EBX(%edx)
956 movl %ebx, PT_ECX(%edx)
957 movl %ebx, PT_EDX(%edx)
958 movl %esi, PT_ESI(%edx)
959 movl %edi, PT_EDI(%edx)
960 movl %ebp, PT_EBP(%edx)
961 movl %ebx, PT_EAX(%edx)
962 movl $__USER_DS, PT_DS(%edx)
963 movl $__USER_DS, PT_ES(%edx)
965 movl %ebx, PT_ORIG_EAX(%edx)
966 movl %ecx, PT_EIP(%edx)
968 movl $__KERNEL_CS, PT_CS(%edx)
969 movl %ebx, PT_EFLAGS(%edx)
970 movl %eax, PT_OLDESP(%edx)
973 movl PT_EBX(%edx), %ebx
974 movl $__KERNEL_DS, PT_OLDSS(%edx)
977 ENDPROC(arch_unwind_init_running)
980 ENTRY(kernel_thread_helper)
981 pushl $0 # fake return address for unwinder
985 CFI_ADJUST_CFA_OFFSET 4
988 CFI_ADJUST_CFA_OFFSET 4
991 ENDPROC(kernel_thread_helper)
994 #include "syscall_table.S"
996 syscall_table_size=(.-sys_call_table)