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)
66 #define preempt_stop DISABLE_INTERRUPTS; TRACE_IRQS_OFF
69 #define resume_kernel restore_nocheck
72 .macro TRACE_IRQS_IRET
73 #ifdef CONFIG_TRACE_IRQFLAGS
74 testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off?
82 #define resume_userspace_sig check_userspace
84 #define resume_userspace_sig resume_userspace
90 CFI_ADJUST_CFA_OFFSET 4;\
91 /*CFI_REL_OFFSET gs, 0;*/\
93 CFI_ADJUST_CFA_OFFSET 4;\
94 /*CFI_REL_OFFSET es, 0;*/\
96 CFI_ADJUST_CFA_OFFSET 4;\
97 /*CFI_REL_OFFSET ds, 0;*/\
99 CFI_ADJUST_CFA_OFFSET 4;\
100 CFI_REL_OFFSET eax, 0;\
102 CFI_ADJUST_CFA_OFFSET 4;\
103 CFI_REL_OFFSET ebp, 0;\
105 CFI_ADJUST_CFA_OFFSET 4;\
106 CFI_REL_OFFSET edi, 0;\
108 CFI_ADJUST_CFA_OFFSET 4;\
109 CFI_REL_OFFSET esi, 0;\
111 CFI_ADJUST_CFA_OFFSET 4;\
112 CFI_REL_OFFSET edx, 0;\
114 CFI_ADJUST_CFA_OFFSET 4;\
115 CFI_REL_OFFSET ecx, 0;\
117 CFI_ADJUST_CFA_OFFSET 4;\
118 CFI_REL_OFFSET ebx, 0;\
119 movl $(__USER_DS), %edx; \
122 movl $(__KERNEL_PDA), %edx; \
125 #define RESTORE_INT_REGS \
127 CFI_ADJUST_CFA_OFFSET -4;\
130 CFI_ADJUST_CFA_OFFSET -4;\
133 CFI_ADJUST_CFA_OFFSET -4;\
136 CFI_ADJUST_CFA_OFFSET -4;\
139 CFI_ADJUST_CFA_OFFSET -4;\
142 CFI_ADJUST_CFA_OFFSET -4;\
145 CFI_ADJUST_CFA_OFFSET -4;\
148 #define RESTORE_REGS \
151 CFI_ADJUST_CFA_OFFSET -4;\
154 CFI_ADJUST_CFA_OFFSET -4;\
157 CFI_ADJUST_CFA_OFFSET -4;\
159 .pushsection .fixup,"ax"; \
166 .section __ex_table,"a";\
173 #define RING0_INT_FRAME \
174 CFI_STARTPROC simple;\
176 CFI_DEF_CFA esp, 3*4;\
177 /*CFI_OFFSET cs, -2*4;*/\
180 #define RING0_EC_FRAME \
181 CFI_STARTPROC simple;\
183 CFI_DEF_CFA esp, 4*4;\
184 /*CFI_OFFSET cs, -2*4;*/\
187 #define RING0_PTREGS_FRAME \
188 CFI_STARTPROC simple;\
190 CFI_DEF_CFA esp, PT_OLDESP-PT_EBX;\
191 /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/\
192 CFI_OFFSET eip, PT_EIP-PT_OLDESP;\
193 /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/\
194 /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/\
195 CFI_OFFSET eax, PT_EAX-PT_OLDESP;\
196 CFI_OFFSET ebp, PT_EBP-PT_OLDESP;\
197 CFI_OFFSET edi, PT_EDI-PT_OLDESP;\
198 CFI_OFFSET esi, PT_ESI-PT_OLDESP;\
199 CFI_OFFSET edx, PT_EDX-PT_OLDESP;\
200 CFI_OFFSET ecx, PT_ECX-PT_OLDESP;\
201 CFI_OFFSET ebx, PT_EBX-PT_OLDESP
206 CFI_ADJUST_CFA_OFFSET 4
208 GET_THREAD_INFO(%ebp)
210 CFI_ADJUST_CFA_OFFSET -4
211 pushl $0x0202 # Reset kernel eflags
212 CFI_ADJUST_CFA_OFFSET 4
214 CFI_ADJUST_CFA_OFFSET -4
219 * Return to user mode is not as complex as all this looks,
220 * but we want the default path for a system call return to
221 * go as quickly as possible which is why some of this is
222 * less clear than it otherwise should be.
225 # userspace resumption stub bypassing syscall exit tracing
231 GET_THREAD_INFO(%ebp)
233 movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS
234 movb PT_CS(%esp), %al
235 andl $(VM_MASK | SEGMENT_RPL_MASK), %eax
237 jb resume_kernel # not returning to v8086 or userspace
239 ENTRY(resume_userspace)
240 DISABLE_INTERRUPTS # make sure we don't miss an interrupt
241 # setting need_resched or sigpending
242 # between sampling and the iret
243 movl TI_flags(%ebp), %ecx
244 andl $_TIF_WORK_MASK, %ecx # is there any work to be done on
245 # int/exception return?
249 #ifdef CONFIG_PREEMPT
252 cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
255 movl TI_flags(%ebp), %ecx # need_resched set ?
256 testb $_TIF_NEED_RESCHED, %cl
258 testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off (exception path) ?
260 call preempt_schedule_irq
265 /* SYSENTER_RETURN points to after the "sysenter" instruction in
266 the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */
268 # sysenter call handler stub
269 ENTRY(sysenter_entry)
273 CFI_REGISTER esp, ebp
274 movl TSS_sysenter_esp0(%esp),%esp
277 * No need to follow this irqs on/off section: the syscall
278 * disabled irqs and here we enable it straight after entry:
282 CFI_ADJUST_CFA_OFFSET 4
283 /*CFI_REL_OFFSET ss, 0*/
285 CFI_ADJUST_CFA_OFFSET 4
286 CFI_REL_OFFSET esp, 0
288 CFI_ADJUST_CFA_OFFSET 4
290 CFI_ADJUST_CFA_OFFSET 4
291 /*CFI_REL_OFFSET cs, 0*/
293 * Push current_thread_info()->sysenter_return to the stack.
294 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
295 * pushed above; +8 corresponds to copy_thread's esp0 setting.
297 pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp)
298 CFI_ADJUST_CFA_OFFSET 4
299 CFI_REL_OFFSET eip, 0
302 * Load the potential sixth argument from user stack.
303 * Careful about security.
305 cmpl $__PAGE_OFFSET-3,%ebp
308 .section __ex_table,"a"
310 .long 1b,syscall_fault
314 CFI_ADJUST_CFA_OFFSET 4
316 GET_THREAD_INFO(%ebp)
318 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
319 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
320 jnz syscall_trace_entry
321 cmpl $(nr_syscalls), %eax
323 call *sys_call_table(,%eax,4)
324 movl %eax,PT_EAX(%esp)
327 movl TI_flags(%ebp), %ecx
328 testw $_TIF_ALLWORK_MASK, %cx
329 jne syscall_exit_work
330 /* if something modifies registers it must also disable sysexit */
331 movl PT_EIP(%esp), %edx
332 movl PT_OLDESP(%esp), %ecx
335 1: mov PT_GS(%esp), %gs
336 ENABLE_INTERRUPTS_SYSEXIT
338 .pushsection .fixup,"ax"
339 2: movl $0,PT_GS(%esp)
341 .section __ex_table,"a"
346 # system call handler stub
348 RING0_INT_FRAME # can't unwind into user space anyway
349 pushl %eax # save orig_eax
350 CFI_ADJUST_CFA_OFFSET 4
352 GET_THREAD_INFO(%ebp)
353 testl $TF_MASK,PT_EFLAGS(%esp)
355 orl $_TIF_SINGLESTEP,TI_flags(%ebp)
357 # system call tracing in operation / emulation
358 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
359 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
360 jnz syscall_trace_entry
361 cmpl $(nr_syscalls), %eax
364 call *sys_call_table(,%eax,4)
365 movl %eax,PT_EAX(%esp) # store the return value
367 DISABLE_INTERRUPTS # make sure we don't miss an interrupt
368 # setting need_resched or sigpending
369 # between sampling and the iret
371 movl TI_flags(%ebp), %ecx
372 testw $_TIF_ALLWORK_MASK, %cx # current->work
373 jne syscall_exit_work
376 movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
377 # Warning: PT_OLDSS(%esp) contains the wrong/random values if we
378 # are returning to the kernel.
379 # See comments in process.c:copy_thread() for details.
380 movb PT_OLDSS(%esp), %ah
381 movb PT_CS(%esp), %al
382 andl $(VM_MASK | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax
383 cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax
385 je ldt_ss # returning to user-space with LDT SS
388 restore_nocheck_notrace:
390 addl $4, %esp # skip orig_eax/error_code
391 CFI_ADJUST_CFA_OFFSET -4
397 pushl $0 # no error code
401 .section __ex_table,"a"
408 larl PT_OLDSS(%esp), %eax
410 testl $0x00400000, %eax # returning to 32bit stack?
411 jnz restore_nocheck # allright, normal return
413 #ifdef CONFIG_PARAVIRT
415 * The kernel can't run on a non-flat stack if paravirt mode
416 * is active. Rather than try to fixup the high bits of
417 * ESP, bypass this code entirely. This may break DOSemu
418 * and/or Wine support in a paravirt VM, although the option
419 * is still available to implement the setting of the high
420 * 16-bits in the INTERRUPT_RETURN paravirt-op.
422 cmpl $0, paravirt_ops+PARAVIRT_enabled
426 /* If returning to userspace with 16bit stack,
427 * try to fix the higher word of ESP, as the CPU
429 * This is an "official" bug of all the x86-compatible
430 * CPUs, which we can try to work around to make
431 * dosemu and wine happy. */
432 movl PT_OLDESP(%esp), %eax
434 call patch_espfix_desc
436 CFI_ADJUST_CFA_OFFSET 4
438 CFI_ADJUST_CFA_OFFSET 4
442 CFI_ADJUST_CFA_OFFSET -8
446 # perform work that needs to be done immediately before resumption
448 RING0_PTREGS_FRAME # can't unwind into user space anyway
450 testb $_TIF_NEED_RESCHED, %cl
454 DISABLE_INTERRUPTS # make sure we don't miss an interrupt
455 # setting need_resched or sigpending
456 # between sampling and the iret
458 movl TI_flags(%ebp), %ecx
459 andl $_TIF_WORK_MASK, %ecx # is there any work to be done other
460 # than syscall tracing?
462 testb $_TIF_NEED_RESCHED, %cl
465 work_notifysig: # deal with pending signals and
466 # notify-resume requests
468 testl $VM_MASK, PT_EFLAGS(%esp)
470 jne work_notifysig_v86 # returning to kernel-space or
473 call do_notify_resume
474 jmp resume_userspace_sig
478 pushl %ecx # save ti_flags for do_notify_resume
479 CFI_ADJUST_CFA_OFFSET 4
480 call save_v86_state # %eax contains pt_regs pointer
482 CFI_ADJUST_CFA_OFFSET -4
488 call do_notify_resume
489 jmp resume_userspace_sig
491 # perform syscall exit tracing
494 movl $-ENOSYS,PT_EAX(%esp)
497 call do_syscall_trace
499 jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU,
500 # so must skip actual syscall
501 movl PT_ORIG_EAX(%esp), %eax
502 cmpl $(nr_syscalls), %eax
506 # perform syscall exit tracing
509 testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl
512 ENABLE_INTERRUPTS # could let do_syscall_trace() call
516 call do_syscall_trace
520 RING0_INT_FRAME # can't unwind into user space anyway
522 pushl %eax # save orig_eax
523 CFI_ADJUST_CFA_OFFSET 4
525 GET_THREAD_INFO(%ebp)
526 movl $-EFAULT,PT_EAX(%esp)
530 movl $-ENOSYS,PT_EAX(%esp)
534 #define FIXUP_ESPFIX_STACK \
535 /* since we are on a wrong stack, we cant make it a C code :( */ \
536 movl %gs:PDA_cpu, %ebx; \
537 PER_CPU(cpu_gdt_descr, %ebx); \
538 movl GDS_address(%ebx), %ebx; \
539 GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \
541 pushl $__KERNEL_DS; \
542 CFI_ADJUST_CFA_OFFSET 4; \
544 CFI_ADJUST_CFA_OFFSET 4; \
546 CFI_ADJUST_CFA_OFFSET -8;
547 #define UNWIND_ESPFIX_STACK \
549 /* see if on espfix stack */ \
550 cmpw $__ESPFIX_SS, %ax; \
552 movl $__KERNEL_DS, %eax; \
555 /* switch to normal stack */ \
556 FIXUP_ESPFIX_STACK; \
560 * Build the entry stubs and pointer table with
561 * some assembler magic.
568 ENTRY(irq_entries_start)
573 CFI_ADJUST_CFA_OFFSET -4
576 CFI_ADJUST_CFA_OFFSET 4
585 * the CPU automatically disables interrupts when executing an IRQ vector,
586 * so IRQ-flags tracing has to follow that:
597 #define BUILD_INTERRUPT(name, nr) \
601 CFI_ADJUST_CFA_OFFSET 4; \
609 /* The include is where all of the SMP etc. interrupts come from */
610 #include "entry_arch.h"
612 KPROBE_ENTRY(page_fault)
615 CFI_ADJUST_CFA_OFFSET 4
618 /* the function address is in %gs's slot on the stack */
620 CFI_ADJUST_CFA_OFFSET 4
621 /*CFI_REL_OFFSET es, 0*/
623 CFI_ADJUST_CFA_OFFSET 4
624 /*CFI_REL_OFFSET ds, 0*/
626 CFI_ADJUST_CFA_OFFSET 4
627 CFI_REL_OFFSET eax, 0
629 CFI_ADJUST_CFA_OFFSET 4
630 CFI_REL_OFFSET ebp, 0
632 CFI_ADJUST_CFA_OFFSET 4
633 CFI_REL_OFFSET edi, 0
635 CFI_ADJUST_CFA_OFFSET 4
636 CFI_REL_OFFSET esi, 0
638 CFI_ADJUST_CFA_OFFSET 4
639 CFI_REL_OFFSET edx, 0
641 CFI_ADJUST_CFA_OFFSET 4
642 CFI_REL_OFFSET ecx, 0
644 CFI_ADJUST_CFA_OFFSET 4
645 CFI_REL_OFFSET ebx, 0
648 CFI_ADJUST_CFA_OFFSET 4
649 /*CFI_REL_OFFSET gs, 0*/
650 movl $(__KERNEL_PDA), %ecx
654 CFI_ADJUST_CFA_OFFSET -4
655 /*CFI_REGISTER es, ecx*/
656 movl PT_GS(%esp), %edi # get the function address
657 movl PT_ORIG_EAX(%esp), %edx # get the error code
658 movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
659 mov %ecx, PT_GS(%esp)
660 /*CFI_REL_OFFSET gs, ES*/
661 movl $(__USER_DS), %ecx
664 movl %esp,%eax # pt_regs pointer
666 jmp ret_from_exception
668 KPROBE_END(page_fault)
670 ENTRY(coprocessor_error)
673 CFI_ADJUST_CFA_OFFSET 4
674 pushl $do_coprocessor_error
675 CFI_ADJUST_CFA_OFFSET 4
679 ENTRY(simd_coprocessor_error)
682 CFI_ADJUST_CFA_OFFSET 4
683 pushl $do_simd_coprocessor_error
684 CFI_ADJUST_CFA_OFFSET 4
688 ENTRY(device_not_available)
690 pushl $-1 # mark this as an int
691 CFI_ADJUST_CFA_OFFSET 4
694 testl $0x4, %eax # EM (math emulation bit)
695 jne device_not_available_emulate
697 call math_state_restore
698 jmp ret_from_exception
699 device_not_available_emulate:
700 pushl $0 # temporary storage for ORIG_EIP
701 CFI_ADJUST_CFA_OFFSET 4
704 CFI_ADJUST_CFA_OFFSET -4
705 jmp ret_from_exception
709 * Debug traps and NMI can happen at the one SYSENTER instruction
710 * that sets up the real kernel stack. Check here, since we can't
711 * allow the wrong stack to be used.
713 * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have
714 * already pushed 3 words if it hits on the sysenter instruction:
715 * eflags, cs and eip.
717 * We just load the right stack, and push the three (known) values
718 * by hand onto the new stack - while updating the return eip past
719 * the instruction that would have done it for sysenter.
721 #define FIX_STACK(offset, ok, label) \
722 cmpw $__KERNEL_CS,4(%esp); \
725 movl TSS_sysenter_esp0+offset(%esp),%esp; \
726 CFI_DEF_CFA esp, 0; \
729 CFI_ADJUST_CFA_OFFSET 4; \
730 pushl $__KERNEL_CS; \
731 CFI_ADJUST_CFA_OFFSET 4; \
732 pushl $sysenter_past_esp; \
733 CFI_ADJUST_CFA_OFFSET 4; \
734 CFI_REL_OFFSET eip, 0
738 cmpl $sysenter_entry,(%esp)
739 jne debug_stack_correct
740 FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn)
742 pushl $-1 # mark this as an int
743 CFI_ADJUST_CFA_OFFSET 4
745 xorl %edx,%edx # error code 0
746 movl %esp,%eax # pt_regs pointer
748 jmp ret_from_exception
753 * NMI is doubly nasty. It can happen _while_ we're handling
754 * a debug fault, and the debug fault hasn't yet been able to
755 * clear up the stack. So we first check whether we got an
756 * NMI on the sysenter entry path, but after that we need to
757 * check whether we got an NMI on the debug path where the debug
758 * fault happened on the sysenter path.
763 CFI_ADJUST_CFA_OFFSET 4
765 cmpw $__ESPFIX_SS, %ax
767 CFI_ADJUST_CFA_OFFSET -4
769 cmpl $sysenter_entry,(%esp)
772 CFI_ADJUST_CFA_OFFSET 4
774 /* Do not access memory above the end of our stack page,
775 * it might not exist.
777 andl $(THREAD_SIZE-1),%eax
778 cmpl $(THREAD_SIZE-20),%eax
780 CFI_ADJUST_CFA_OFFSET -4
781 jae nmi_stack_correct
782 cmpl $sysenter_entry,12(%esp)
783 je nmi_debug_stack_check
785 /* We have a RING0_INT_FRAME here */
787 CFI_ADJUST_CFA_OFFSET 4
789 xorl %edx,%edx # zero error code
790 movl %esp,%eax # pt_regs pointer
792 jmp restore_nocheck_notrace
797 FIX_STACK(12,nmi_stack_correct, 1)
798 jmp nmi_stack_correct
800 nmi_debug_stack_check:
801 /* We have a RING0_INT_FRAME here */
802 cmpw $__KERNEL_CS,16(%esp)
803 jne nmi_stack_correct
806 cmpl $debug_esp_fix_insn,(%esp)
808 FIX_STACK(24,nmi_stack_correct, 1)
809 jmp nmi_stack_correct
812 /* We have a RING0_INT_FRAME here.
814 * create the pointer to lss back
817 CFI_ADJUST_CFA_OFFSET 4
819 CFI_ADJUST_CFA_OFFSET 4
821 /* copy the iret frame of 12 bytes */
824 CFI_ADJUST_CFA_OFFSET 4
827 CFI_ADJUST_CFA_OFFSET 4
829 FIXUP_ESPFIX_STACK # %eax == %esp
830 xorl %edx,%edx # zero error code
833 lss 12+4(%esp), %esp # back to espfix stack
834 CFI_ADJUST_CFA_OFFSET -24
837 .section __ex_table,"a"
843 #ifdef CONFIG_PARAVIRT
846 .section __ex_table,"a"
851 ENTRY(native_irq_enable_sysexit)
858 pushl $-1 # mark this as an int
859 CFI_ADJUST_CFA_OFFSET 4
861 xorl %edx,%edx # zero error code
862 movl %esp,%eax # pt_regs pointer
864 jmp ret_from_exception
871 CFI_ADJUST_CFA_OFFSET 4
873 CFI_ADJUST_CFA_OFFSET 4
880 CFI_ADJUST_CFA_OFFSET 4
882 CFI_ADJUST_CFA_OFFSET 4
889 CFI_ADJUST_CFA_OFFSET 4
891 CFI_ADJUST_CFA_OFFSET 4
895 ENTRY(coprocessor_segment_overrun)
898 CFI_ADJUST_CFA_OFFSET 4
899 pushl $do_coprocessor_segment_overrun
900 CFI_ADJUST_CFA_OFFSET 4
906 pushl $do_invalid_TSS
907 CFI_ADJUST_CFA_OFFSET 4
911 ENTRY(segment_not_present)
913 pushl $do_segment_not_present
914 CFI_ADJUST_CFA_OFFSET 4
920 pushl $do_stack_segment
921 CFI_ADJUST_CFA_OFFSET 4
925 KPROBE_ENTRY(general_protection)
927 pushl $do_general_protection
928 CFI_ADJUST_CFA_OFFSET 4
931 KPROBE_END(general_protection)
933 ENTRY(alignment_check)
935 pushl $do_alignment_check
936 CFI_ADJUST_CFA_OFFSET 4
942 pushl $0 # no error code
943 CFI_ADJUST_CFA_OFFSET 4
944 pushl $do_divide_error
945 CFI_ADJUST_CFA_OFFSET 4
949 #ifdef CONFIG_X86_MCE
953 CFI_ADJUST_CFA_OFFSET 4
954 pushl machine_check_vector
955 CFI_ADJUST_CFA_OFFSET 4
960 ENTRY(spurious_interrupt_bug)
963 CFI_ADJUST_CFA_OFFSET 4
964 pushl $do_spurious_interrupt_bug
965 CFI_ADJUST_CFA_OFFSET 4
969 #ifdef CONFIG_STACK_UNWIND
970 ENTRY(arch_unwind_init_running)
975 movl %ebx, PT_EBX(%edx)
977 movl %ebx, PT_ECX(%edx)
978 movl %ebx, PT_EDX(%edx)
979 movl %esi, PT_ESI(%edx)
980 movl %edi, PT_EDI(%edx)
981 movl %ebp, PT_EBP(%edx)
982 movl %ebx, PT_EAX(%edx)
983 movl $__USER_DS, PT_DS(%edx)
984 movl $__USER_DS, PT_ES(%edx)
986 movl %ebx, PT_ORIG_EAX(%edx)
987 movl %ecx, PT_EIP(%edx)
989 movl $__KERNEL_CS, PT_CS(%edx)
990 movl %ebx, PT_EFLAGS(%edx)
991 movl %eax, PT_OLDESP(%edx)
994 movl PT_EBX(%edx), %ebx
995 movl $__KERNEL_DS, PT_OLDSS(%edx)
998 ENDPROC(arch_unwind_init_running)
1001 ENTRY(kernel_thread_helper)
1002 pushl $0 # fake return address for unwinder
1006 CFI_ADJUST_CFA_OFFSET 4
1009 CFI_ADJUST_CFA_OFFSET 4
1012 ENDPROC(kernel_thread_helper)
1014 .section .rodata,"a"
1015 #include "syscall_table.S"
1017 syscall_table_size=(.-sys_call_table)