Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5674124f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 5d48421b 72142fd4
Loading
Loading
Loading
Loading
+32 −18
Original line number Original line Diff line number Diff line
@@ -33,14 +33,15 @@ This document describes the Linux kernel Makefiles.


	=== 6 Architecture Makefiles
	=== 6 Architecture Makefiles
	   --- 6.1 Set variables to tweak the build to the architecture
	   --- 6.1 Set variables to tweak the build to the architecture
	   --- 6.2 Add prerequisites to archprepare:
	   --- 6.2 Add prerequisites to archheaders:
	   --- 6.3 List directories to visit when descending
	   --- 6.3 Add prerequisites to archprepare:
	   --- 6.4 Architecture-specific boot images
	   --- 6.4 List directories to visit when descending
	   --- 6.5 Building non-kbuild targets
	   --- 6.5 Architecture-specific boot images
	   --- 6.6 Commands useful for building a boot image
	   --- 6.6 Building non-kbuild targets
	   --- 6.7 Custom kbuild commands
	   --- 6.7 Commands useful for building a boot image
	   --- 6.8 Preprocessing linker scripts
	   --- 6.8 Custom kbuild commands
	   --- 6.9 Generic header files
	   --- 6.9 Preprocessing linker scripts
	   --- 6.10 Generic header files


	=== 7 Kbuild syntax for exported headers
	=== 7 Kbuild syntax for exported headers
		--- 7.1 header-y
		--- 7.1 header-y
@@ -252,7 +253,7 @@ more details, with real examples.
	This will create a library lib.a based on delay.o. For kbuild to
	This will create a library lib.a based on delay.o. For kbuild to
	actually recognize that there is a lib.a being built, the directory
	actually recognize that there is a lib.a being built, the directory
	shall be listed in libs-y.
	shall be listed in libs-y.
	See also "6.3 List directories to visit when descending".
	See also "6.4 List directories to visit when descending".


	Use of lib-y is normally restricted to lib/ and arch/*/lib.
	Use of lib-y is normally restricted to lib/ and arch/*/lib.


@@ -974,7 +975,20 @@ When kbuild executes, the following steps are followed (roughly):
	$(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
	$(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
	mode) if this option is supported by $(AR).
	mode) if this option is supported by $(AR).


--- 6.2 Add prerequisites to archprepare:
--- 6.2 Add prerequisites to archheaders:

	The archheaders: rule is used to generate header files that
	may be installed into user space by "make header_install" or
	"make headers_install_all".  In order to support
	"make headers_install_all", this target has to be able to run
	on an unconfigured tree, or a tree configured for another
	architecture.

	It is run before "make archprepare" when run on the
	architecture itself.


--- 6.3 Add prerequisites to archprepare:


	The archprepare: rule is used to list prerequisites that need to be
	The archprepare: rule is used to list prerequisites that need to be
	built before starting to descend down in the subdirectories.
	built before starting to descend down in the subdirectories.
@@ -990,7 +1004,7 @@ When kbuild executes, the following steps are followed (roughly):
	generating offset header files.
	generating offset header files.




--- 6.3 List directories to visit when descending
--- 6.4 List directories to visit when descending


	An arch Makefile cooperates with the top Makefile to define variables
	An arch Makefile cooperates with the top Makefile to define variables
	which specify how to build the vmlinux file.  Note that there is no
	which specify how to build the vmlinux file.  Note that there is no
@@ -1019,7 +1033,7 @@ When kbuild executes, the following steps are followed (roughly):
		drivers-$(CONFIG_OPROFILE)  += arch/sparc64/oprofile/
		drivers-$(CONFIG_OPROFILE)  += arch/sparc64/oprofile/




--- 6.4 Architecture-specific boot images
--- 6.5 Architecture-specific boot images


	An arch Makefile specifies goals that take the vmlinux file, compress
	An arch Makefile specifies goals that take the vmlinux file, compress
	it, wrap it in bootstrapping code, and copy the resulting files
	it, wrap it in bootstrapping code, and copy the resulting files
@@ -1070,7 +1084,7 @@ When kbuild executes, the following steps are followed (roughly):


	When "make" is executed without arguments, bzImage will be built.
	When "make" is executed without arguments, bzImage will be built.


--- 6.5 Building non-kbuild targets
--- 6.6 Building non-kbuild targets


    extra-y
    extra-y


@@ -1090,7 +1104,7 @@ When kbuild executes, the following steps are followed (roughly):
	shall be built, but shall not be linked as part of built-in.o.
	shall be built, but shall not be linked as part of built-in.o.




--- 6.6 Commands useful for building a boot image
--- 6.7 Commands useful for building a boot image


	Kbuild provides a few macros that are useful when building a
	Kbuild provides a few macros that are useful when building a
	boot image.
	boot image.
@@ -1112,7 +1126,7 @@ When kbuild executes, the following steps are followed (roughly):
	always be built.
	always be built.
	Assignments to $(targets) are without $(obj)/ prefix.
	Assignments to $(targets) are without $(obj)/ prefix.
	if_changed may be used in conjunction with custom commands as
	if_changed may be used in conjunction with custom commands as
	defined in 6.7 "Custom kbuild commands".
	defined in 6.8 "Custom kbuild commands".


	Note: It is a typical mistake to forget the FORCE prerequisite.
	Note: It is a typical mistake to forget the FORCE prerequisite.
	Another common pitfall is that whitespace is sometimes
	Another common pitfall is that whitespace is sometimes
@@ -1171,7 +1185,7 @@ When kbuild executes, the following steps are followed (roughly):
		$(obj)/%.dtb: $(src)/%.dts
		$(obj)/%.dtb: $(src)/%.dts
			$(call cmd,dtc)
			$(call cmd,dtc)


--- 6.7 Custom kbuild commands
--- 6.8 Custom kbuild commands


	When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand
	When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand
	of a command is normally displayed.
	of a command is normally displayed.
@@ -1198,7 +1212,7 @@ When kbuild executes, the following steps are followed (roughly):
	will be displayed with "make KBUILD_VERBOSE=0".
	will be displayed with "make KBUILD_VERBOSE=0".




--- 6.8 Preprocessing linker scripts
--- 6.9 Preprocessing linker scripts


	When the vmlinux image is built, the linker script
	When the vmlinux image is built, the linker script
	arch/$(ARCH)/kernel/vmlinux.lds is used.
	arch/$(ARCH)/kernel/vmlinux.lds is used.
@@ -1228,7 +1242,7 @@ When kbuild executes, the following steps are followed (roughly):
	The kbuild infrastructure for *lds file are used in several
	The kbuild infrastructure for *lds file are used in several
	architecture-specific files.
	architecture-specific files.


--- 6.9 Generic header files
--- 6.10 Generic header files


	The directory include/asm-generic contains the header files
	The directory include/asm-generic contains the header files
	that may be shared between individual architectures.
	that may be shared between individual architectures.
+6 −3
Original line number Original line Diff line number Diff line
@@ -442,7 +442,7 @@ asm-generic:


no-dot-config-targets := clean mrproper distclean \
no-dot-config-targets := clean mrproper distclean \
			 cscope gtags TAGS tags help %docs check% coccicheck \
			 cscope gtags TAGS tags help %docs check% coccicheck \
			 include/linux/version.h headers_% \
			 include/linux/version.h headers_% archheaders \
			 kernelversion %src-pkg
			 kernelversion %src-pkg


config-targets := 0
config-targets := 0
@@ -979,7 +979,7 @@ prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
                   include/config/auto.conf
                   include/config/auto.conf
	$(cmd_crmodverdir)
	$(cmd_crmodverdir)


archprepare: prepare1 scripts_basic
archprepare: archheaders prepare1 scripts_basic


prepare0: archprepare FORCE
prepare0: archprepare FORCE
	$(Q)$(MAKE) $(build)=.
	$(Q)$(MAKE) $(build)=.
@@ -1046,8 +1046,11 @@ hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
# If we do an all arch process set dst to asm-$(hdr-arch)
# If we do an all arch process set dst to asm-$(hdr-arch)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)


PHONY += archheaders
archheaders:

PHONY += __headers
PHONY += __headers
__headers: include/linux/version.h scripts_basic asm-generic FORCE
__headers: include/linux/version.h scripts_basic asm-generic archheaders FORCE
	$(Q)$(MAKE) $(build)=scripts build_unifdef
	$(Q)$(MAKE) $(build)=scripts build_unifdef


PHONY += headers_install_all
PHONY += headers_install_all
+7 −2
Original line number Original line Diff line number Diff line
@@ -64,7 +64,8 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
#This will adjust *FLAGS accordingly to the platform.
#This will adjust *FLAGS accordingly to the platform.
include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)


KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include
KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
		   -I$(HOST_DIR)/include/generated


# -Derrno=kernel_errno - This turns all kernel references to errno into
# -Derrno=kernel_errno - This turns all kernel references to errno into
# kernel_errno to separate them from the libc errno.  This allows -fno-common
# kernel_errno to separate them from the libc errno.  This allows -fno-common
@@ -96,6 +97,10 @@ endef


KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig


archheaders:
	$(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
		ARCH=$(SUBARCH) O='$(objtree)' archheaders

archprepare: include/generated/user_constants.h
archprepare: include/generated/user_constants.h


LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
@@ -135,7 +140,7 @@ archclean:


# Generated files
# Generated files


$(HOST_DIR)/um/user-offsets.s: FORCE
$(HOST_DIR)/um/user-offsets.s: __headers FORCE
	$(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@
	$(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@


define filechk_gen-asm-offsets
define filechk_gen-asm-offsets
+6 −0
Original line number Original line Diff line number Diff line
@@ -117,6 +117,12 @@ KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
KBUILD_CFLAGS += $(mflags-y)
KBUILD_CFLAGS += $(mflags-y)
KBUILD_AFLAGS += $(mflags-y)
KBUILD_AFLAGS += $(mflags-y)


###
# Syscall table generation

archheaders:
	$(Q)$(MAKE) $(build)=arch/x86/syscalls all

###
###
# Kernel objects
# Kernel objects


+1 −0
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@
#
#


obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o
obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o
obj-$(CONFIG_IA32_EMULATION) += nosyscall.o syscall_ia32.o


sysv-$(CONFIG_SYSVIPC) := ipc32.o
sysv-$(CONFIG_SYSVIPC) := ipc32.o
obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
Loading