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

Commit 9b2e077c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'uapi-prep-20121002' of git://git.infradead.org/users/dhowells/linux-headers



Pull preparatory patches for user API disintegration from David Howells:
 "The patches herein prepare for the extraction of the Userspace API
  bits from the various header files named in the Kbuild files.

  New subdirectories are created under either include/uapi/ or
  arch/x/include/uapi/ that correspond to the subdirectory containing
  that file under include/ or arch/x/include/.

  The new subdirs under the uapi/ directory are populated with Kbuild
  files that mostly do nothing at this time.  Further patches will
  disintegrate the headers in each original directory and fill in the
  Kbuild files as they do it.

  These patches also:

   (1) fix up #inclusions of "foo.h" rather than <foo.h>.

   (2) Remove some redundant #includes from the DRM code.

   (3) Make the kernel build infrastructure handle Kbuild files both in
       the old places and the new UAPI place that both specify headers
       to be exported.

   (4) Fix some kernel tools that #include kernel headers during their
       build.

  I have compile tested this with allyesconfig against x86_64,
  allmodconfig against i386 and a scattering of additional defconfigs of
  other arches.  Prepared for main script

  Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
  Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
  Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
  Acked-by: default avatarMichael Kerrisk <mtk.manpages@gmail.com>
  Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
  Acked-by: default avatarDave Jones <davej@redhat.com>
  Acked-by: default avatarH. Peter Anvin <hpa@zytor.com&gt;">

* tag 'uapi-prep-20121002' of git://git.infradead.org/users/dhowells/linux-headers:
  UAPI: Plumb the UAPI Kbuilds into the user header installation and checking
  UAPI: x86: Differentiate the generated UAPI and internal headers
  UAPI: Remove the objhdr-y export list
  UAPI: Move linux/version.h
  UAPI: Set up uapi/asm/Kbuild.asm
  UAPI: x86: Fix insn_sanity build failure after UAPI split
  UAPI: x86: Fix the test_get_len tool
  UAPI: (Scripted) Set up UAPI Kbuild files
  UAPI: Partition the header include path sets and add uapi/ header directories
  UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers
  UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/
  UAPI: (Scripted) Remove redundant DRM UAPI header #inclusions from drivers/gpu/.
  UAPI: Refer to the DRM UAPI headers with <...> and from certain headers only
parents a54dfb1a 10b63956
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ This document describes the Linux kernel Makefiles.

	=== 7 Kbuild syntax for exported headers
		--- 7.1 header-y
		--- 7.2 objhdr-y
		--- 7.2 genhdr-y
		--- 7.3 destination-y
		--- 7.4 generic-y

@@ -1282,15 +1282,15 @@ See subsequent chapter for the syntax of the Kbuild file.

	Subdirectories are visited before their parent directories.

	--- 7.2 objhdr-y
	--- 7.2 genhdr-y

	objhdr-y specifies generated files to be exported.
	genhdr-y specifies generated files to be exported.
	Generated files are special as they need to be looked
	up in another directory when doing 'make O=...' builds.

		Example:
			#include/linux/Kbuild
			objhdr-y += version.h
			genhdr-y += version.h

	--- 7.3 destination-y

+27 −16
Original line number Diff line number Diff line
@@ -350,12 +350,22 @@ AFLAGS_KERNEL =
CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage


# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE    := \
		-I$(srctree)/arch/$(hdr-arch)/include/uapi \
		-Iarch/$(hdr-arch)/include/generated/uapi \
		-I$(srctree)/include/uapi \
		-Iinclude/generated/uapi \
                -include $(srctree)/include/linux/kconfig.h

# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE    := -I$(srctree)/arch/$(hdr-arch)/include \
                   -Iarch/$(hdr-arch)/include/generated -Iinclude \
LINUXINCLUDE    := \
		-I$(srctree)/arch/$(hdr-arch)/include \
		-Iarch/$(hdr-arch)/include/generated \
		$(if $(KBUILD_SRC), -I$(srctree)/include) \
                   -include $(srctree)/include/linux/kconfig.h
		-Iinclude \
		$(USERINCLUDE)

KBUILD_CPPFLAGS := -D__KERNEL__

@@ -437,9 +447,11 @@ asm-generic:
# Detect when mixed targets is specified, and make a second invocation
# of make so .config is not included in this case either (for *config).

version_h := include/generated/uapi/linux/version.h

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

config-targets := 0
@@ -809,7 +821,7 @@ endif
# prepare2 creates a makefile if using a separate output directory
prepare2: prepare3 outputmakefile asm-generic

prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
                   include/config/auto.conf
	$(cmd_crmodverdir)

@@ -842,7 +854,7 @@ define filechk_version.h
	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef

include/linux/version.h: $(srctree)/Makefile FORCE
$(version_h): $(srctree)/Makefile FORCE
	$(call filechk,version.h)

include/generated/utsrelease.h: include/config/kernel.release FORCE
@@ -887,7 +899,7 @@ PHONY += archscripts
archscripts:

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

PHONY += headers_install_all
@@ -896,10 +908,10 @@ headers_install_all:

PHONY += headers_install
headers_install: __headers
	$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \
	$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
	  $(error Headers not exportable for the $(SRCARCH) architecture))
	$(Q)$(MAKE) $(hdr-inst)=include
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst)
	$(Q)$(MAKE) $(hdr-inst)=include/uapi
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)

PHONY += headers_check_all
headers_check_all: headers_install_all
@@ -907,8 +919,8 @@ headers_check_all: headers_install_all

PHONY += headers_check
headers_check: headers_install
	$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1
	$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1

# ---------------------------------------------------------------------------
# Modules
@@ -997,8 +1009,7 @@ CLEAN_DIRS += $(MODVERDIR)
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS  += include/config usr/include include/generated          \
                  arch/*/include/generated
MRPROPER_FILES += .config .config.old .version .old_version             \
                  include/linux/version.h                               \
MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS

# clean - Delete most, but leave enough to build external modules
+3 −0
Original line number Diff line number Diff line
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@

#ifndef CONFIG_MMU

#include "page-nommu.h"
#include <asm/page-nommu.h>

#else

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
#ifndef CONFIG_MMU

#include <asm-generic/4level-fixup.h>
#include "pgtable-nommu.h"
#include <asm/pgtable-nommu.h>

#else

Loading