aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/entry_32.S
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-16 21:19:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-16 21:19:19 -0500
commit5674124f9f16f196533abb383193bd232c9afc2f (patch)
tree275af51d6f7749dc72e1530fcace7c770cdbdd46 /arch/x86/kernel/entry_32.S
parent5d48421be3c8a9f753d61b826ecb3ad287d867c0 (diff)
parent72142fd4109105c6bd21658966ca5e93c1684081 (diff)
Merge branch 'x86-syscall-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-syscall-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Move <asm/asm-offsets.h> from trace_syscalls.c to asm/syscall.h x86, um: Fix typo in 32-bit system call modifications um: Use $(srctree) not $(KBUILD_SRC) x86, um: Mark system call tables readonly x86, um: Use the same style generated syscall tables as native um: Generate headers before generating user-offsets.s um: Run host archheaders, allow use of host generated headers kbuild, headers.sh: Don't make archheaders explicitly x86, syscall: Allow syscall offset to be symbolic x86, syscall: Re-fix typo in comment x86: Simplify syscallhdr.sh x86: Generate system call tables and unistd_*.h from tables checksyscalls: Use arch/x86/syscalls/syscall_32.tbl as source x86: Machine-readable syscall tables and scripts to process them trace: Include <asm/asm-offsets.h> in trace_syscalls.c x86-64, ia32: Move compat_ni_syscall into C and its own file x86-64, syscall: Adjust comment spacing and remove typo kbuild: Add support for an "archheaders" target kbuild: Add support for installing generated asm headers
Diffstat (limited to 'arch/x86/kernel/entry_32.S')
-rw-r--r--arch/x86/kernel/entry_32.S37
1 files changed, 14 insertions, 23 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 22d0e21b4dd7..4af9fd2450a5 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -81,8 +81,6 @@
81 * enough to patch inline, increasing performance. 81 * enough to patch inline, increasing performance.
82 */ 82 */
83 83
84#define nr_syscalls ((syscall_table_size)/4)
85
86#ifdef CONFIG_PREEMPT 84#ifdef CONFIG_PREEMPT
87#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF 85#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF
88#else 86#else
@@ -423,7 +421,7 @@ sysenter_past_esp:
423 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) 421 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
424 jnz sysenter_audit 422 jnz sysenter_audit
425sysenter_do_call: 423sysenter_do_call:
426 cmpl $(nr_syscalls), %eax 424 cmpl $(NR_syscalls), %eax
427 jae syscall_badsys 425 jae syscall_badsys
428 call *sys_call_table(,%eax,4) 426 call *sys_call_table(,%eax,4)
429 movl %eax,PT_EAX(%esp) 427 movl %eax,PT_EAX(%esp)
@@ -504,7 +502,7 @@ ENTRY(system_call)
504 # system call tracing in operation / emulation 502 # system call tracing in operation / emulation
505 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) 503 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
506 jnz syscall_trace_entry 504 jnz syscall_trace_entry
507 cmpl $(nr_syscalls), %eax 505 cmpl $(NR_syscalls), %eax
508 jae syscall_badsys 506 jae syscall_badsys
509syscall_call: 507syscall_call:
510 call *sys_call_table(,%eax,4) 508 call *sys_call_table(,%eax,4)
@@ -654,7 +652,7 @@ syscall_trace_entry:
654 movl %esp, %eax 652 movl %esp, %eax
655 call syscall_trace_enter 653 call syscall_trace_enter
656 /* What it returned is what we'll actually use. */ 654 /* What it returned is what we'll actually use. */
657 cmpl $(nr_syscalls), %eax 655 cmpl $(NR_syscalls), %eax
658 jnae syscall_call 656 jnae syscall_call
659 jmp syscall_exit 657 jmp syscall_exit
660END(syscall_trace_entry) 658END(syscall_trace_entry)
@@ -694,29 +692,28 @@ END(syscall_badsys)
694 * System calls that need a pt_regs pointer. 692 * System calls that need a pt_regs pointer.
695 */ 693 */
696#define PTREGSCALL0(name) \ 694#define PTREGSCALL0(name) \
697 ALIGN; \ 695ENTRY(ptregs_##name) ; \
698ptregs_##name: \
699 leal 4(%esp),%eax; \ 696 leal 4(%esp),%eax; \
700 jmp sys_##name; 697 jmp sys_##name; \
698ENDPROC(ptregs_##name)
701 699
702#define PTREGSCALL1(name) \ 700#define PTREGSCALL1(name) \
703 ALIGN; \ 701ENTRY(ptregs_##name) ; \
704ptregs_##name: \
705 leal 4(%esp),%edx; \ 702 leal 4(%esp),%edx; \
706 movl (PT_EBX+4)(%esp),%eax; \ 703 movl (PT_EBX+4)(%esp),%eax; \
707 jmp sys_##name; 704 jmp sys_##name; \
705ENDPROC(ptregs_##name)
708 706
709#define PTREGSCALL2(name) \ 707#define PTREGSCALL2(name) \
710 ALIGN; \ 708ENTRY(ptregs_##name) ; \
711ptregs_##name: \
712 leal 4(%esp),%ecx; \ 709 leal 4(%esp),%ecx; \
713 movl (PT_ECX+4)(%esp),%edx; \ 710 movl (PT_ECX+4)(%esp),%edx; \
714 movl (PT_EBX+4)(%esp),%eax; \ 711 movl (PT_EBX+4)(%esp),%eax; \
715 jmp sys_##name; 712 jmp sys_##name; \
713ENDPROC(ptregs_##name)
716 714
717#define PTREGSCALL3(name) \ 715#define PTREGSCALL3(name) \
718 ALIGN; \ 716ENTRY(ptregs_##name) ; \
719ptregs_##name: \
720 CFI_STARTPROC; \ 717 CFI_STARTPROC; \
721 leal 4(%esp),%eax; \ 718 leal 4(%esp),%eax; \
722 pushl_cfi %eax; \ 719 pushl_cfi %eax; \
@@ -741,8 +738,7 @@ PTREGSCALL2(vm86)
741PTREGSCALL1(vm86old) 738PTREGSCALL1(vm86old)
742 739
743/* Clone is an oddball. The 4th arg is in %edi */ 740/* Clone is an oddball. The 4th arg is in %edi */
744 ALIGN; 741ENTRY(ptregs_clone)
745ptregs_clone:
746 CFI_STARTPROC 742 CFI_STARTPROC
747 leal 4(%esp),%eax 743 leal 4(%esp),%eax
748 pushl_cfi %eax 744 pushl_cfi %eax
@@ -1213,11 +1209,6 @@ return_to_handler:
1213 jmp *%ecx 1209 jmp *%ecx
1214#endif 1210#endif
1215 1211
1216.section .rodata,"a"
1217#include "syscall_table_32.S"
1218
1219syscall_table_size=(.-sys_call_table)
1220
1221/* 1212/*
1222 * Some functions should be protected against kprobes 1213 * Some functions should be protected against kprobes
1223 */ 1214 */