Commit 5674124f9f16f196533abb383193bd232c9afc2f

Authored by Linus Torvalds

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

Showing 33 changed files Side-by-side Diff

Documentation/kbuild/makefiles.txt
... ... @@ -33,14 +33,15 @@
33 33  
34 34 === 6 Architecture Makefiles
35 35 --- 6.1 Set variables to tweak the build to the architecture
36   - --- 6.2 Add prerequisites to archprepare:
37   - --- 6.3 List directories to visit when descending
38   - --- 6.4 Architecture-specific boot images
39   - --- 6.5 Building non-kbuild targets
40   - --- 6.6 Commands useful for building a boot image
41   - --- 6.7 Custom kbuild commands
42   - --- 6.8 Preprocessing linker scripts
43   - --- 6.9 Generic header files
  36 + --- 6.2 Add prerequisites to archheaders:
  37 + --- 6.3 Add prerequisites to archprepare:
  38 + --- 6.4 List directories to visit when descending
  39 + --- 6.5 Architecture-specific boot images
  40 + --- 6.6 Building non-kbuild targets
  41 + --- 6.7 Commands useful for building a boot image
  42 + --- 6.8 Custom kbuild commands
  43 + --- 6.9 Preprocessing linker scripts
  44 + --- 6.10 Generic header files
44 45  
45 46 === 7 Kbuild syntax for exported headers
46 47 --- 7.1 header-y
... ... @@ -252,7 +253,7 @@
252 253 This will create a library lib.a based on delay.o. For kbuild to
253 254 actually recognize that there is a lib.a being built, the directory
254 255 shall be listed in libs-y.
255   - See also "6.3 List directories to visit when descending".
  256 + See also "6.4 List directories to visit when descending".
256 257  
257 258 Use of lib-y is normally restricted to lib/ and arch/*/lib.
258 259  
259 260  
... ... @@ -974,8 +975,21 @@
974 975 $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
975 976 mode) if this option is supported by $(AR).
976 977  
977   ---- 6.2 Add prerequisites to archprepare:
  978 +--- 6.2 Add prerequisites to archheaders:
978 979  
  980 + The archheaders: rule is used to generate header files that
  981 + may be installed into user space by "make header_install" or
  982 + "make headers_install_all". In order to support
  983 + "make headers_install_all", this target has to be able to run
  984 + on an unconfigured tree, or a tree configured for another
  985 + architecture.
  986 +
  987 + It is run before "make archprepare" when run on the
  988 + architecture itself.
  989 +
  990 +
  991 +--- 6.3 Add prerequisites to archprepare:
  992 +
979 993 The archprepare: rule is used to list prerequisites that need to be
980 994 built before starting to descend down in the subdirectories.
981 995 This is usually used for header files containing assembler constants.
... ... @@ -990,7 +1004,7 @@
990 1004 generating offset header files.
991 1005  
992 1006  
993   ---- 6.3 List directories to visit when descending
  1007 +--- 6.4 List directories to visit when descending
994 1008  
995 1009 An arch Makefile cooperates with the top Makefile to define variables
996 1010 which specify how to build the vmlinux file. Note that there is no
... ... @@ -1019,7 +1033,7 @@
1019 1033 drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/
1020 1034  
1021 1035  
1022   ---- 6.4 Architecture-specific boot images
  1036 +--- 6.5 Architecture-specific boot images
1023 1037  
1024 1038 An arch Makefile specifies goals that take the vmlinux file, compress
1025 1039 it, wrap it in bootstrapping code, and copy the resulting files
... ... @@ -1070,7 +1084,7 @@
1070 1084  
1071 1085 When "make" is executed without arguments, bzImage will be built.
1072 1086  
1073   ---- 6.5 Building non-kbuild targets
  1087 +--- 6.6 Building non-kbuild targets
1074 1088  
1075 1089 extra-y
1076 1090  
... ... @@ -1090,7 +1104,7 @@
1090 1104 shall be built, but shall not be linked as part of built-in.o.
1091 1105  
1092 1106  
1093   ---- 6.6 Commands useful for building a boot image
  1107 +--- 6.7 Commands useful for building a boot image
1094 1108  
1095 1109 Kbuild provides a few macros that are useful when building a
1096 1110 boot image.
... ... @@ -1112,7 +1126,7 @@
1112 1126 always be built.
1113 1127 Assignments to $(targets) are without $(obj)/ prefix.
1114 1128 if_changed may be used in conjunction with custom commands as
1115   - defined in 6.7 "Custom kbuild commands".
  1129 + defined in 6.8 "Custom kbuild commands".
1116 1130  
1117 1131 Note: It is a typical mistake to forget the FORCE prerequisite.
1118 1132 Another common pitfall is that whitespace is sometimes
... ... @@ -1171,7 +1185,7 @@
1171 1185 $(obj)/%.dtb: $(src)/%.dts
1172 1186 $(call cmd,dtc)
1173 1187  
1174   ---- 6.7 Custom kbuild commands
  1188 +--- 6.8 Custom kbuild commands
1175 1189  
1176 1190 When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand
1177 1191 of a command is normally displayed.
... ... @@ -1198,7 +1212,7 @@
1198 1212 will be displayed with "make KBUILD_VERBOSE=0".
1199 1213  
1200 1214  
1201   ---- 6.8 Preprocessing linker scripts
  1215 +--- 6.9 Preprocessing linker scripts
1202 1216  
1203 1217 When the vmlinux image is built, the linker script
1204 1218 arch/$(ARCH)/kernel/vmlinux.lds is used.
... ... @@ -1228,7 +1242,7 @@
1228 1242 The kbuild infrastructure for *lds file are used in several
1229 1243 architecture-specific files.
1230 1244  
1231   ---- 6.9 Generic header files
  1245 +--- 6.10 Generic header files
1232 1246  
1233 1247 The directory include/asm-generic contains the header files
1234 1248 that may be shared between individual architectures.
... ... @@ -442,7 +442,7 @@
442 442  
443 443 no-dot-config-targets := clean mrproper distclean \
444 444 cscope gtags TAGS tags help %docs check% coccicheck \
445   - include/linux/version.h headers_% \
  445 + include/linux/version.h headers_% archheaders \
446 446 kernelversion %src-pkg
447 447  
448 448 config-targets := 0
... ... @@ -979,7 +979,7 @@
979 979 include/config/auto.conf
980 980 $(cmd_crmodverdir)
981 981  
982   -archprepare: prepare1 scripts_basic
  982 +archprepare: archheaders prepare1 scripts_basic
983 983  
984 984 prepare0: archprepare FORCE
985 985 $(Q)$(MAKE) $(build)=.
986 986  
... ... @@ -1046,8 +1046,11 @@
1046 1046 # If we do an all arch process set dst to asm-$(hdr-arch)
1047 1047 hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
1048 1048  
  1049 +PHONY += archheaders
  1050 +archheaders:
  1051 +
1049 1052 PHONY += __headers
1050   -__headers: include/linux/version.h scripts_basic asm-generic FORCE
  1053 +__headers: include/linux/version.h scripts_basic asm-generic archheaders FORCE
1051 1054 $(Q)$(MAKE) $(build)=scripts build_unifdef
1052 1055  
1053 1056 PHONY += headers_install_all
... ... @@ -64,7 +64,8 @@
64 64 #This will adjust *FLAGS accordingly to the platform.
65 65 include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
66 66  
67   -KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include
  67 +KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
  68 + -I$(HOST_DIR)/include/generated
68 69  
69 70 # -Derrno=kernel_errno - This turns all kernel references to errno into
70 71 # kernel_errno to separate them from the libc errno. This allows -fno-common
... ... @@ -96,6 +97,10 @@
96 97  
97 98 KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
98 99  
  100 +archheaders:
  101 + $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
  102 + ARCH=$(SUBARCH) O='$(objtree)' archheaders
  103 +
99 104 archprepare: include/generated/user_constants.h
100 105  
101 106 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
... ... @@ -135,7 +140,7 @@
135 140  
136 141 # Generated files
137 142  
138   -$(HOST_DIR)/um/user-offsets.s: FORCE
  143 +$(HOST_DIR)/um/user-offsets.s: __headers FORCE
139 144 $(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@
140 145  
141 146 define filechk_gen-asm-offsets
... ... @@ -118,6 +118,12 @@
118 118 KBUILD_AFLAGS += $(mflags-y)
119 119  
120 120 ###
  121 +# Syscall table generation
  122 +
  123 +archheaders:
  124 + $(Q)$(MAKE) $(build)=arch/x86/syscalls all
  125 +
  126 +###
121 127 # Kernel objects
122 128  
123 129 head-y := arch/x86/kernel/head_$(BITS).o
arch/x86/ia32/Makefile
... ... @@ -3,6 +3,7 @@
3 3 #
4 4  
5 5 obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o
  6 +obj-$(CONFIG_IA32_EMULATION) += nosyscall.o syscall_ia32.o
6 7  
7 8 sysv-$(CONFIG_SYSVIPC) := ipc32.o
8 9 obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
arch/x86/ia32/ia32entry.S
... ... @@ -27,8 +27,6 @@
27 27  
28 28 .section .entry.text, "ax"
29 29  
30   -#define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
31   -
32 30 .macro IA32_ARG_FIXUP noebp=0
33 31 movl %edi,%r8d
34 32 .if \noebp
... ... @@ -447,9 +445,6 @@
447 445 movq $-ENOSYS,%rax
448 446 jmp ia32_sysret
449 447  
450   -quiet_ni_syscall:
451   - movq $-ENOSYS,%rax
452   - ret
453 448 CFI_ENDPROC
454 449  
455 450 .macro PTREGSCALL label, func, arg
... ... @@ -494,358 +489,4 @@
494 489 jmp ia32_sysret /* misbalances the return cache */
495 490 CFI_ENDPROC
496 491 END(ia32_ptregs_common)
497   -
498   - .section .rodata,"a"
499   - .align 8
500   -ia32_sys_call_table:
501   - .quad sys_restart_syscall
502   - .quad sys_exit
503   - .quad stub32_fork
504   - .quad sys_read
505   - .quad sys_write
506   - .quad compat_sys_open /* 5 */
507   - .quad sys_close
508   - .quad sys32_waitpid
509   - .quad sys_creat
510   - .quad sys_link
511   - .quad sys_unlink /* 10 */
512   - .quad stub32_execve
513   - .quad sys_chdir
514   - .quad compat_sys_time
515   - .quad sys_mknod
516   - .quad sys_chmod /* 15 */
517   - .quad sys_lchown16
518   - .quad quiet_ni_syscall /* old break syscall holder */
519   - .quad sys_stat
520   - .quad sys32_lseek
521   - .quad sys_getpid /* 20 */
522   - .quad compat_sys_mount /* mount */
523   - .quad sys_oldumount /* old_umount */
524   - .quad sys_setuid16
525   - .quad sys_getuid16
526   - .quad compat_sys_stime /* stime */ /* 25 */
527   - .quad compat_sys_ptrace /* ptrace */
528   - .quad sys_alarm
529   - .quad sys_fstat /* (old)fstat */
530   - .quad sys_pause
531   - .quad compat_sys_utime /* 30 */
532   - .quad quiet_ni_syscall /* old stty syscall holder */
533   - .quad quiet_ni_syscall /* old gtty syscall holder */
534   - .quad sys_access
535   - .quad sys_nice
536   - .quad quiet_ni_syscall /* 35 */ /* old ftime syscall holder */
537   - .quad sys_sync
538   - .quad sys32_kill
539   - .quad sys_rename
540   - .quad sys_mkdir
541   - .quad sys_rmdir /* 40 */
542   - .quad sys_dup
543   - .quad sys_pipe
544   - .quad compat_sys_times
545   - .quad quiet_ni_syscall /* old prof syscall holder */
546   - .quad sys_brk /* 45 */
547   - .quad sys_setgid16
548   - .quad sys_getgid16
549   - .quad sys_signal
550   - .quad sys_geteuid16
551   - .quad sys_getegid16 /* 50 */
552   - .quad sys_acct
553   - .quad sys_umount /* new_umount */
554   - .quad quiet_ni_syscall /* old lock syscall holder */
555   - .quad compat_sys_ioctl
556   - .quad compat_sys_fcntl64 /* 55 */
557   - .quad quiet_ni_syscall /* old mpx syscall holder */
558   - .quad sys_setpgid
559   - .quad quiet_ni_syscall /* old ulimit syscall holder */
560   - .quad sys_olduname
561   - .quad sys_umask /* 60 */
562   - .quad sys_chroot
563   - .quad compat_sys_ustat
564   - .quad sys_dup2
565   - .quad sys_getppid
566   - .quad sys_getpgrp /* 65 */
567   - .quad sys_setsid
568   - .quad sys32_sigaction
569   - .quad sys_sgetmask
570   - .quad sys_ssetmask
571   - .quad sys_setreuid16 /* 70 */
572   - .quad sys_setregid16
573   - .quad sys32_sigsuspend
574   - .quad compat_sys_sigpending
575   - .quad sys_sethostname
576   - .quad compat_sys_setrlimit /* 75 */
577   - .quad compat_sys_old_getrlimit /* old_getrlimit */
578   - .quad compat_sys_getrusage
579   - .quad compat_sys_gettimeofday
580   - .quad compat_sys_settimeofday
581   - .quad sys_getgroups16 /* 80 */
582   - .quad sys_setgroups16
583   - .quad compat_sys_old_select
584   - .quad sys_symlink
585   - .quad sys_lstat
586   - .quad sys_readlink /* 85 */
587   - .quad sys_uselib
588   - .quad sys_swapon
589   - .quad sys_reboot
590   - .quad compat_sys_old_readdir
591   - .quad sys32_mmap /* 90 */
592   - .quad sys_munmap
593   - .quad sys_truncate
594   - .quad sys_ftruncate
595   - .quad sys_fchmod
596   - .quad sys_fchown16 /* 95 */
597   - .quad sys_getpriority
598   - .quad sys_setpriority
599   - .quad quiet_ni_syscall /* old profil syscall holder */
600   - .quad compat_sys_statfs
601   - .quad compat_sys_fstatfs /* 100 */
602   - .quad sys_ioperm
603   - .quad compat_sys_socketcall
604   - .quad sys_syslog
605   - .quad compat_sys_setitimer
606   - .quad compat_sys_getitimer /* 105 */
607   - .quad compat_sys_newstat
608   - .quad compat_sys_newlstat
609   - .quad compat_sys_newfstat
610   - .quad sys_uname
611   - .quad stub32_iopl /* 110 */
612   - .quad sys_vhangup
613   - .quad quiet_ni_syscall /* old "idle" system call */
614   - .quad sys32_vm86_warning /* vm86old */
615   - .quad compat_sys_wait4
616   - .quad sys_swapoff /* 115 */
617   - .quad compat_sys_sysinfo
618   - .quad sys32_ipc
619   - .quad sys_fsync
620   - .quad stub32_sigreturn
621   - .quad stub32_clone /* 120 */
622   - .quad sys_setdomainname
623   - .quad sys_newuname
624   - .quad sys_modify_ldt
625   - .quad compat_sys_adjtimex
626   - .quad sys32_mprotect /* 125 */
627   - .quad compat_sys_sigprocmask
628   - .quad quiet_ni_syscall /* create_module */
629   - .quad sys_init_module
630   - .quad sys_delete_module
631   - .quad quiet_ni_syscall /* 130 get_kernel_syms */
632   - .quad sys32_quotactl
633   - .quad sys_getpgid
634   - .quad sys_fchdir
635   - .quad quiet_ni_syscall /* bdflush */
636   - .quad sys_sysfs /* 135 */
637   - .quad sys_personality
638   - .quad quiet_ni_syscall /* for afs_syscall */
639   - .quad sys_setfsuid16
640   - .quad sys_setfsgid16
641   - .quad sys_llseek /* 140 */
642   - .quad compat_sys_getdents
643   - .quad compat_sys_select
644   - .quad sys_flock
645   - .quad sys_msync
646   - .quad compat_sys_readv /* 145 */
647   - .quad compat_sys_writev
648   - .quad sys_getsid
649   - .quad sys_fdatasync
650   - .quad compat_sys_sysctl /* sysctl */
651   - .quad sys_mlock /* 150 */
652   - .quad sys_munlock
653   - .quad sys_mlockall
654   - .quad sys_munlockall
655   - .quad sys_sched_setparam
656   - .quad sys_sched_getparam /* 155 */
657   - .quad sys_sched_setscheduler
658   - .quad sys_sched_getscheduler
659   - .quad sys_sched_yield
660   - .quad sys_sched_get_priority_max
661   - .quad sys_sched_get_priority_min /* 160 */
662   - .quad sys32_sched_rr_get_interval
663   - .quad compat_sys_nanosleep
664   - .quad sys_mremap
665   - .quad sys_setresuid16
666   - .quad sys_getresuid16 /* 165 */
667   - .quad sys32_vm86_warning /* vm86 */
668   - .quad quiet_ni_syscall /* query_module */
669   - .quad sys_poll
670   - .quad quiet_ni_syscall /* old nfsservctl */
671   - .quad sys_setresgid16 /* 170 */
672   - .quad sys_getresgid16
673   - .quad sys_prctl
674   - .quad stub32_rt_sigreturn
675   - .quad sys32_rt_sigaction
676   - .quad sys32_rt_sigprocmask /* 175 */
677   - .quad sys32_rt_sigpending
678   - .quad compat_sys_rt_sigtimedwait
679   - .quad sys32_rt_sigqueueinfo
680   - .quad sys_rt_sigsuspend
681   - .quad sys32_pread /* 180 */
682   - .quad sys32_pwrite
683   - .quad sys_chown16
684   - .quad sys_getcwd
685   - .quad sys_capget
686   - .quad sys_capset
687   - .quad stub32_sigaltstack
688   - .quad sys32_sendfile
689   - .quad quiet_ni_syscall /* streams1 */
690   - .quad quiet_ni_syscall /* streams2 */
691   - .quad stub32_vfork /* 190 */
692   - .quad compat_sys_getrlimit
693   - .quad sys_mmap_pgoff
694   - .quad sys32_truncate64
695   - .quad sys32_ftruncate64
696   - .quad sys32_stat64 /* 195 */
697   - .quad sys32_lstat64
698   - .quad sys32_fstat64
699   - .quad sys_lchown
700   - .quad sys_getuid
701   - .quad sys_getgid /* 200 */
702   - .quad sys_geteuid
703   - .quad sys_getegid
704   - .quad sys_setreuid
705   - .quad sys_setregid
706   - .quad sys_getgroups /* 205 */
707   - .quad sys_setgroups
708   - .quad sys_fchown
709   - .quad sys_setresuid
710   - .quad sys_getresuid
711   - .quad sys_setresgid /* 210 */
712   - .quad sys_getresgid
713   - .quad sys_chown
714   - .quad sys_setuid
715   - .quad sys_setgid
716   - .quad sys_setfsuid /* 215 */
717   - .quad sys_setfsgid
718   - .quad sys_pivot_root
719   - .quad sys_mincore
720   - .quad sys_madvise
721   - .quad compat_sys_getdents64 /* 220 getdents64 */
722   - .quad compat_sys_fcntl64
723   - .quad quiet_ni_syscall /* tux */
724   - .quad quiet_ni_syscall /* security */
725   - .quad sys_gettid
726   - .quad sys32_readahead /* 225 */
727   - .quad sys_setxattr
728   - .quad sys_lsetxattr
729   - .quad sys_fsetxattr
730   - .quad sys_getxattr
731   - .quad sys_lgetxattr /* 230 */
732   - .quad sys_fgetxattr
733   - .quad sys_listxattr
734   - .quad sys_llistxattr
735   - .quad sys_flistxattr
736   - .quad sys_removexattr /* 235 */
737   - .quad sys_lremovexattr
738   - .quad sys_fremovexattr
739   - .quad sys_tkill
740   - .quad sys_sendfile64
741   - .quad compat_sys_futex /* 240 */
742   - .quad compat_sys_sched_setaffinity
743   - .quad compat_sys_sched_getaffinity
744   - .quad sys_set_thread_area
745   - .quad sys_get_thread_area
746   - .quad compat_sys_io_setup /* 245 */
747   - .quad sys_io_destroy
748   - .quad compat_sys_io_getevents
749   - .quad compat_sys_io_submit
750   - .quad sys_io_cancel
751   - .quad sys32_fadvise64 /* 250 */
752   - .quad quiet_ni_syscall /* free_huge_pages */
753   - .quad sys_exit_group
754   - .quad sys32_lookup_dcookie
755   - .quad sys_epoll_create
756   - .quad sys_epoll_ctl /* 255 */
757   - .quad sys_epoll_wait
758   - .quad sys_remap_file_pages
759   - .quad sys_set_tid_address
760   - .quad compat_sys_timer_create
761   - .quad compat_sys_timer_settime /* 260 */
762   - .quad compat_sys_timer_gettime
763   - .quad sys_timer_getoverrun
764   - .quad sys_timer_delete
765   - .quad compat_sys_clock_settime
766   - .quad compat_sys_clock_gettime /* 265 */
767   - .quad compat_sys_clock_getres
768   - .quad compat_sys_clock_nanosleep
769   - .quad compat_sys_statfs64
770   - .quad compat_sys_fstatfs64
771   - .quad sys_tgkill /* 270 */
772   - .quad compat_sys_utimes
773   - .quad sys32_fadvise64_64
774   - .quad quiet_ni_syscall /* sys_vserver */
775   - .quad sys_mbind
776   - .quad compat_sys_get_mempolicy /* 275 */
777   - .quad sys_set_mempolicy
778   - .quad compat_sys_mq_open
779   - .quad sys_mq_unlink
780   - .quad compat_sys_mq_timedsend
781   - .quad compat_sys_mq_timedreceive /* 280 */
782   - .quad compat_sys_mq_notify
783   - .quad compat_sys_mq_getsetattr
784   - .quad compat_sys_kexec_load /* reserved for kexec */
785   - .quad compat_sys_waitid
786   - .quad quiet_ni_syscall /* 285: sys_altroot */
787   - .quad sys_add_key
788   - .quad sys_request_key
789   - .quad sys_keyctl
790   - .quad sys_ioprio_set
791   - .quad sys_ioprio_get /* 290 */
792   - .quad sys_inotify_init
793   - .quad sys_inotify_add_watch
794   - .quad sys_inotify_rm_watch
795   - .quad sys_migrate_pages
796   - .quad compat_sys_openat /* 295 */
797   - .quad sys_mkdirat
798   - .quad sys_mknodat
799   - .quad sys_fchownat
800   - .quad compat_sys_futimesat
801   - .quad sys32_fstatat /* 300 */
802   - .quad sys_unlinkat
803   - .quad sys_renameat
804   - .quad sys_linkat
805   - .quad sys_symlinkat
806   - .quad sys_readlinkat /* 305 */
807   - .quad sys_fchmodat
808   - .quad sys_faccessat
809   - .quad compat_sys_pselect6
810   - .quad compat_sys_ppoll
811   - .quad sys_unshare /* 310 */
812   - .quad compat_sys_set_robust_list
813   - .quad compat_sys_get_robust_list
814   - .quad sys_splice
815   - .quad sys32_sync_file_range
816   - .quad sys_tee /* 315 */
817   - .quad compat_sys_vmsplice
818   - .quad compat_sys_move_pages
819   - .quad sys_getcpu
820   - .quad sys_epoll_pwait
821   - .quad compat_sys_utimensat /* 320 */
822   - .quad compat_sys_signalfd
823   - .quad sys_timerfd_create
824   - .quad sys_eventfd
825   - .quad sys32_fallocate
826   - .quad compat_sys_timerfd_settime /* 325 */
827   - .quad compat_sys_timerfd_gettime
828   - .quad compat_sys_signalfd4
829   - .quad sys_eventfd2
830   - .quad sys_epoll_create1
831   - .quad sys_dup3 /* 330 */
832   - .quad sys_pipe2
833   - .quad sys_inotify_init1
834   - .quad compat_sys_preadv
835   - .quad compat_sys_pwritev
836   - .quad compat_sys_rt_tgsigqueueinfo /* 335 */
837   - .quad sys_perf_event_open
838   - .quad compat_sys_recvmmsg
839   - .quad sys_fanotify_init
840   - .quad sys32_fanotify_mark
841   - .quad sys_prlimit64 /* 340 */
842   - .quad sys_name_to_handle_at
843   - .quad compat_sys_open_by_handle_at
844   - .quad compat_sys_clock_adjtime
845   - .quad sys_syncfs
846   - .quad compat_sys_sendmmsg /* 345 */
847   - .quad sys_setns
848   - .quad compat_sys_process_vm_readv
849   - .quad compat_sys_process_vm_writev
850   -ia32_syscall_end:
arch/x86/ia32/nosyscall.c
  1 +#include <linux/kernel.h>
  2 +#include <linux/errno.h>
  3 +
  4 +long compat_ni_syscall(void)
  5 +{
  6 + return -ENOSYS;
  7 +}
arch/x86/ia32/syscall_ia32.c
  1 +/* System call table for ia32 emulation. */
  2 +
  3 +#include <linux/linkage.h>
  4 +#include <linux/sys.h>
  5 +#include <linux/cache.h>
  6 +#include <asm/asm-offsets.h>
  7 +
  8 +#define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void compat(void) ;
  9 +#include <asm/syscalls_32.h>
  10 +#undef __SYSCALL_I386
  11 +
  12 +#define __SYSCALL_I386(nr, sym, compat) [nr] = compat,
  13 +
  14 +typedef void (*sys_call_ptr_t)(void);
  15 +
  16 +extern void compat_ni_syscall(void);
  17 +
  18 +const sys_call_ptr_t ia32_sys_call_table[__NR_ia32_syscall_max+1] = {
  19 + /*
  20 + * Smells like a compiler bug -- it doesn't work
  21 + * when the & below is removed.
  22 + */
  23 + [0 ... __NR_ia32_syscall_max] = &compat_ni_syscall,
  24 +#include <asm/syscalls_32.h>
  25 +};
arch/x86/include/asm/Kbuild
... ... @@ -19,8 +19,9 @@
19 19 header-y += ptrace-abi.h
20 20 header-y += sigcontext32.h
21 21 header-y += ucontext.h
22   -header-y += unistd_32.h
23   -header-y += unistd_64.h
24 22 header-y += vm86.h
25 23 header-y += vsyscall.h
  24 +
  25 +genhdr-y += unistd_32.h
  26 +genhdr-y += unistd_64.h
arch/x86/include/asm/ia32_unistd.h
... ... @@ -2,18 +2,11 @@
2 2 #define _ASM_X86_IA32_UNISTD_H
3 3  
4 4 /*
5   - * This file contains the system call numbers of the ia32 port,
  5 + * This file contains the system call numbers of the ia32 compat ABI,
6 6 * this is for the kernel only.
7   - * Only add syscalls here where some part of the kernel needs to know
8   - * the number. This should be otherwise in sync with asm-x86/unistd_32.h. -AK
9 7 */
10   -
11   -#define __NR_ia32_restart_syscall 0
12   -#define __NR_ia32_exit 1
13   -#define __NR_ia32_read 3
14   -#define __NR_ia32_write 4
15   -#define __NR_ia32_sigreturn 119
16   -#define __NR_ia32_rt_sigreturn 173
  8 +#define __SYSCALL_ia32_NR(x) (x)
  9 +#include <asm/unistd_32_ia32.h>
17 10  
18 11 #endif /* _ASM_X86_IA32_UNISTD_H */
arch/x86/include/asm/syscall.h
... ... @@ -15,6 +15,7 @@
15 15  
16 16 #include <linux/sched.h>
17 17 #include <linux/err.h>
  18 +#include <asm/asm-offsets.h> /* For NR_syscalls */
18 19  
19 20 extern const unsigned long sys_call_table[];
20 21  
arch/x86/include/asm/unistd.h
  1 +#ifndef _ASM_X86_UNISTD_H
  2 +#define _ASM_X86_UNISTD_H 1
  3 +
1 4 #ifdef __KERNEL__
2 5 # ifdef CONFIG_X86_32
3   -# include "unistd_32.h"
  6 +
  7 +# include <asm/unistd_32.h>
  8 +# define __ARCH_WANT_IPC_PARSE_VERSION
  9 +# define __ARCH_WANT_STAT64
  10 +# define __ARCH_WANT_SYS_OLD_MMAP
  11 +# define __ARCH_WANT_SYS_OLD_SELECT
  12 +
4 13 # else
5   -# include "unistd_64.h"
  14 +
  15 +# include <asm/unistd_64.h>
  16 +# define __ARCH_WANT_COMPAT_SYS_TIME
  17 +
6 18 # endif
  19 +
  20 +# define __ARCH_WANT_OLD_READDIR
  21 +# define __ARCH_WANT_OLD_STAT
  22 +# define __ARCH_WANT_SYS_ALARM
  23 +# define __ARCH_WANT_SYS_FADVISE64
  24 +# define __ARCH_WANT_SYS_GETHOSTNAME
  25 +# define __ARCH_WANT_SYS_GETPGRP
  26 +# define __ARCH_WANT_SYS_LLSEEK
  27 +# define __ARCH_WANT_SYS_NICE
  28 +# define __ARCH_WANT_SYS_OLDUMOUNT
  29 +# define __ARCH_WANT_SYS_OLD_GETRLIMIT
  30 +# define __ARCH_WANT_SYS_OLD_UNAME
  31 +# define __ARCH_WANT_SYS_PAUSE
  32 +# define __ARCH_WANT_SYS_RT_SIGACTION
  33 +# define __ARCH_WANT_SYS_RT_SIGSUSPEND
  34 +# define __ARCH_WANT_SYS_SGETMASK
  35 +# define __ARCH_WANT_SYS_SIGNAL
  36 +# define __ARCH_WANT_SYS_SIGPENDING
  37 +# define __ARCH_WANT_SYS_SIGPROCMASK
  38 +# define __ARCH_WANT_SYS_SOCKETCALL
  39 +# define __ARCH_WANT_SYS_TIME
  40 +# define __ARCH_WANT_SYS_UTIME
  41 +# define __ARCH_WANT_SYS_WAITPID
  42 +
  43 +/*
  44 + * "Conditional" syscalls
  45 + *
  46 + * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
  47 + * but it doesn't work on all toolchains, so we just do it by hand
  48 + */
  49 +# define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
  50 +
7 51 #else
8 52 # ifdef __i386__
9   -# include "unistd_32.h"
  53 +# include <asm/unistd_32.h>
10 54 # else
11   -# include "unistd_64.h"
  55 +# include <asm/unistd_64.h>
12 56 # endif
13 57 #endif
  58 +
  59 +#endif /* _ASM_X86_UNISTD_H */
arch/x86/include/asm/unistd_32.h
1   -#ifndef _ASM_X86_UNISTD_32_H
2   -#define _ASM_X86_UNISTD_32_H
3   -
4   -/*
5   - * This file contains the system call numbers.
6   - */
7   -
8   -#define __NR_restart_syscall 0
9   -#define __NR_exit 1
10   -#define __NR_fork 2
11   -#define __NR_read 3
12   -#define __NR_write 4
13   -#define __NR_open 5
14   -#define __NR_close 6
15   -#define __NR_waitpid 7
16   -#define __NR_creat 8
17   -#define __NR_link 9
18   -#define __NR_unlink 10
19   -#define __NR_execve 11
20   -#define __NR_chdir 12
21   -#define __NR_time 13
22   -#define __NR_mknod 14
23   -#define __NR_chmod 15
24   -#define __NR_lchown 16
25   -#define __NR_break 17
26   -#define __NR_oldstat 18
27   -#define __NR_lseek 19
28   -#define __NR_getpid 20
29   -#define __NR_mount 21
30   -#define __NR_umount 22
31   -#define __NR_setuid 23
32   -#define __NR_getuid 24
33   -#define __NR_stime 25
34   -#define __NR_ptrace 26
35   -#define __NR_alarm 27
36   -#define __NR_oldfstat 28
37   -#define __NR_pause 29
38   -#define __NR_utime 30
39   -#define __NR_stty 31
40   -#define __NR_gtty 32
41   -#define __NR_access 33
42   -#define __NR_nice 34
43   -#define __NR_ftime 35
44   -#define __NR_sync 36
45   -#define __NR_kill 37
46   -#define __NR_rename 38
47   -#define __NR_mkdir 39
48   -#define __NR_rmdir 40
49   -#define __NR_dup 41
50   -#define __NR_pipe 42
51   -#define __NR_times 43
52   -#define __NR_prof 44
53   -#define __NR_brk 45
54   -#define __NR_setgid 46
55   -#define __NR_getgid 47
56   -#define __NR_signal 48
57   -#define __NR_geteuid 49
58   -#define __NR_getegid 50
59   -#define __NR_acct 51
60   -#define __NR_umount2 52
61   -#define __NR_lock 53
62   -#define __NR_ioctl 54
63   -#define __NR_fcntl 55
64   -#define __NR_mpx 56
65   -#define __NR_setpgid 57
66   -#define __NR_ulimit 58
67   -#define __NR_oldolduname 59
68   -#define __NR_umask 60
69   -#define __NR_chroot 61
70   -#define __NR_ustat 62
71   -#define __NR_dup2 63
72   -#define __NR_getppid 64
73   -#define __NR_getpgrp 65
74   -#define __NR_setsid 66
75   -#define __NR_sigaction 67
76   -#define __NR_sgetmask 68
77   -#define __NR_ssetmask 69
78   -#define __NR_setreuid 70
79   -#define __NR_setregid 71
80   -#define __NR_sigsuspend 72
81   -#define __NR_sigpending 73
82   -#define __NR_sethostname 74
83   -#define __NR_setrlimit 75
84   -#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
85   -#define __NR_getrusage 77
86   -#define __NR_gettimeofday 78
87   -#define __NR_settimeofday 79
88   -#define __NR_getgroups 80
89   -#define __NR_setgroups 81
90   -#define __NR_select 82
91   -#define __NR_symlink 83
92   -#define __NR_oldlstat 84
93   -#define __NR_readlink 85
94   -#define __NR_uselib 86
95   -#define __NR_swapon 87
96   -#define __NR_reboot 88
97   -#define __NR_readdir 89
98   -#define __NR_mmap 90
99   -#define __NR_munmap 91
100   -#define __NR_truncate 92
101   -#define __NR_ftruncate 93
102   -#define __NR_fchmod 94
103   -#define __NR_fchown 95
104   -#define __NR_getpriority 96
105   -#define __NR_setpriority 97
106   -#define __NR_profil 98
107   -#define __NR_statfs 99
108   -#define __NR_fstatfs 100
109   -#define __NR_ioperm 101
110   -#define __NR_socketcall 102
111   -#define __NR_syslog 103
112   -#define __NR_setitimer 104
113   -#define __NR_getitimer 105
114   -#define __NR_stat 106
115   -#define __NR_lstat 107
116   -#define __NR_fstat 108
117   -#define __NR_olduname 109
118   -#define __NR_iopl 110
119   -#define __NR_vhangup 111
120   -#define __NR_idle 112
121   -#define __NR_vm86old 113
122   -#define __NR_wait4 114
123   -#define __NR_swapoff 115
124   -#define __NR_sysinfo 116
125   -#define __NR_ipc 117
126   -#define __NR_fsync 118
127   -#define __NR_sigreturn 119
128   -#define __NR_clone 120
129   -#define __NR_setdomainname 121
130   -#define __NR_uname 122
131   -#define __NR_modify_ldt 123
132   -#define __NR_adjtimex 124
133   -#define __NR_mprotect 125
134   -#define __NR_sigprocmask 126
135   -#define __NR_create_module 127
136   -#define __NR_init_module 128
137   -#define __NR_delete_module 129
138   -#define __NR_get_kernel_syms 130
139   -#define __NR_quotactl 131
140   -#define __NR_getpgid 132
141   -#define __NR_fchdir 133
142   -#define __NR_bdflush 134
143   -#define __NR_sysfs 135
144   -#define __NR_personality 136
145   -#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
146   -#define __NR_setfsuid 138
147   -#define __NR_setfsgid 139
148   -#define __NR__llseek 140
149   -#define __NR_getdents 141
150   -#define __NR__newselect 142
151   -#define __NR_flock 143
152   -#define __NR_msync 144
153   -#define __NR_readv 145
154   -#define __NR_writev 146
155   -#define __NR_getsid 147
156   -#define __NR_fdatasync 148
157   -#define __NR__sysctl 149
158   -#define __NR_mlock 150
159   -#define __NR_munlock 151
160   -#define __NR_mlockall 152
161   -#define __NR_munlockall 153
162   -#define __NR_sched_setparam 154
163   -#define __NR_sched_getparam 155
164   -#define __NR_sched_setscheduler 156
165   -#define __NR_sched_getscheduler 157
166   -#define __NR_sched_yield 158
167   -#define __NR_sched_get_priority_max 159
168   -#define __NR_sched_get_priority_min 160
169   -#define __NR_sched_rr_get_interval 161
170   -#define __NR_nanosleep 162
171   -#define __NR_mremap 163
172   -#define __NR_setresuid 164
173   -#define __NR_getresuid 165
174   -#define __NR_vm86 166
175   -#define __NR_query_module 167
176   -#define __NR_poll 168
177   -#define __NR_nfsservctl 169
178   -#define __NR_setresgid 170
179   -#define __NR_getresgid 171
180   -#define __NR_prctl 172
181   -#define __NR_rt_sigreturn 173
182   -#define __NR_rt_sigaction 174
183   -#define __NR_rt_sigprocmask 175
184   -#define __NR_rt_sigpending 176
185   -#define __NR_rt_sigtimedwait 177
186   -#define __NR_rt_sigqueueinfo 178
187   -#define __NR_rt_sigsuspend 179
188   -#define __NR_pread64 180
189   -#define __NR_pwrite64 181
190   -#define __NR_chown 182
191   -#define __NR_getcwd 183
192   -#define __NR_capget 184
193   -#define __NR_capset 185
194   -#define __NR_sigaltstack 186
195   -#define __NR_sendfile 187
196   -#define __NR_getpmsg 188 /* some people actually want streams */
197   -#define __NR_putpmsg 189 /* some people actually want streams */
198   -#define __NR_vfork 190
199   -#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
200   -#define __NR_mmap2 192
201   -#define __NR_truncate64 193
202   -#define __NR_ftruncate64 194
203   -#define __NR_stat64 195
204   -#define __NR_lstat64 196
205   -#define __NR_fstat64 197
206   -#define __NR_lchown32 198
207   -#define __NR_getuid32 199
208   -#define __NR_getgid32 200
209   -#define __NR_geteuid32 201
210   -#define __NR_getegid32 202
211   -#define __NR_setreuid32 203
212   -#define __NR_setregid32 204
213   -#define __NR_getgroups32 205
214   -#define __NR_setgroups32 206
215   -#define __NR_fchown32 207
216   -#define __NR_setresuid32 208
217   -#define __NR_getresuid32 209
218   -#define __NR_setresgid32 210
219   -#define __NR_getresgid32 211
220   -#define __NR_chown32 212
221   -#define __NR_setuid32 213
222   -#define __NR_setgid32 214
223   -#define __NR_setfsuid32 215
224   -#define __NR_setfsgid32 216
225   -#define __NR_pivot_root 217
226   -#define __NR_mincore 218
227   -#define __NR_madvise 219
228   -#define __NR_madvise1 219 /* delete when C lib stub is removed */
229   -#define __NR_getdents64 220
230   -#define __NR_fcntl64 221
231   -/* 223 is unused */
232   -#define __NR_gettid 224
233   -#define __NR_readahead 225
234   -#define __NR_setxattr 226
235   -#define __NR_lsetxattr 227
236   -#define __NR_fsetxattr 228
237   -#define __NR_getxattr 229
238   -#define __NR_lgetxattr 230
239   -#define __NR_fgetxattr 231
240   -#define __NR_listxattr 232
241   -#define __NR_llistxattr 233
242   -#define __NR_flistxattr 234
243   -#define __NR_removexattr 235
244   -#define __NR_lremovexattr 236
245   -#define __NR_fremovexattr 237
246   -#define __NR_tkill 238
247   -#define __NR_sendfile64 239
248   -#define __NR_futex 240
249   -#define __NR_sched_setaffinity 241
250   -#define __NR_sched_getaffinity 242
251   -#define __NR_set_thread_area 243
252   -#define __NR_get_thread_area 244
253   -#define __NR_io_setup 245
254   -#define __NR_io_destroy 246
255   -#define __NR_io_getevents 247
256   -#define __NR_io_submit 248
257   -#define __NR_io_cancel 249
258   -#define __NR_fadvise64 250
259   -/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
260   -#define __NR_exit_group 252
261   -#define __NR_lookup_dcookie 253
262   -#define __NR_epoll_create 254
263   -#define __NR_epoll_ctl 255
264   -#define __NR_epoll_wait 256
265   -#define __NR_remap_file_pages 257
266   -#define __NR_set_tid_address 258
267   -#define __NR_timer_create 259
268   -#define __NR_timer_settime (__NR_timer_create+1)
269   -#define __NR_timer_gettime (__NR_timer_create+2)
270   -#define __NR_timer_getoverrun (__NR_timer_create+3)
271   -#define __NR_timer_delete (__NR_timer_create+4)
272   -#define __NR_clock_settime (__NR_timer_create+5)
273   -#define __NR_clock_gettime (__NR_timer_create+6)
274   -#define __NR_clock_getres (__NR_timer_create+7)
275   -#define __NR_clock_nanosleep (__NR_timer_create+8)
276   -#define __NR_statfs64 268
277   -#define __NR_fstatfs64 269
278   -#define __NR_tgkill 270
279   -#define __NR_utimes 271
280   -#define __NR_fadvise64_64 272
281   -#define __NR_vserver 273
282   -#define __NR_mbind 274
283   -#define __NR_get_mempolicy 275
284   -#define __NR_set_mempolicy 276
285   -#define __NR_mq_open 277
286   -#define __NR_mq_unlink (__NR_mq_open+1)
287   -#define __NR_mq_timedsend (__NR_mq_open+2)
288   -#define __NR_mq_timedreceive (__NR_mq_open+3)
289   -#define __NR_mq_notify (__NR_mq_open+4)
290   -#define __NR_mq_getsetattr (__NR_mq_open+5)
291   -#define __NR_kexec_load 283
292   -#define __NR_waitid 284
293   -/* #define __NR_sys_setaltroot 285 */
294   -#define __NR_add_key 286
295   -#define __NR_request_key 287
296   -#define __NR_keyctl 288
297   -#define __NR_ioprio_set 289
298   -#define __NR_ioprio_get 290
299   -#define __NR_inotify_init 291
300   -#define __NR_inotify_add_watch 292
301   -#define __NR_inotify_rm_watch 293
302   -#define __NR_migrate_pages 294
303   -#define __NR_openat 295
304   -#define __NR_mkdirat 296
305   -#define __NR_mknodat 297
306   -#define __NR_fchownat 298
307   -#define __NR_futimesat 299
308   -#define __NR_fstatat64 300
309   -#define __NR_unlinkat 301
310   -#define __NR_renameat 302
311   -#define __NR_linkat 303
312   -#define __NR_symlinkat 304
313   -#define __NR_readlinkat 305
314   -#define __NR_fchmodat 306
315   -#define __NR_faccessat 307
316   -#define __NR_pselect6 308
317   -#define __NR_ppoll 309
318   -#define __NR_unshare 310
319   -#define __NR_set_robust_list 311
320   -#define __NR_get_robust_list 312
321   -#define __NR_splice 313
322   -#define __NR_sync_file_range 314
323   -#define __NR_tee 315
324   -#define __NR_vmsplice 316
325   -#define __NR_move_pages 317
326   -#define __NR_getcpu 318
327   -#define __NR_epoll_pwait 319
328   -#define __NR_utimensat 320
329   -#define __NR_signalfd 321
330   -#define __NR_timerfd_create 322
331   -#define __NR_eventfd 323
332   -#define __NR_fallocate 324
333   -#define __NR_timerfd_settime 325
334   -#define __NR_timerfd_gettime 326
335   -#define __NR_signalfd4 327
336   -#define __NR_eventfd2 328
337   -#define __NR_epoll_create1 329
338   -#define __NR_dup3 330
339   -#define __NR_pipe2 331
340   -#define __NR_inotify_init1 332
341   -#define __NR_preadv 333
342   -#define __NR_pwritev 334
343