Skip to content

Commit

Permalink
Merge tag 'uapi-prep-20121002' of git://git.infradead.org/users/dhowe…
Browse files Browse the repository at this point in the history
…lls/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: David Howells <dhowells@redhat.com>
  Acked-by: Arnd Bergmann <arnd@arndb.de>
  Acked-by: Thomas Gleixner <tglx@linutronix.de>
  Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
  Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  Acked-by: Dave Jones <davej@redhat.com>
  Acked-by: H. Peter Anvin <hpa@zytor.com>"

* 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
  • Loading branch information
Linus Torvalds committed Oct 3, 2012
2 parents a54dfb1 + 10b6395 commit 9b2e077
Showing 634 changed files with 1,399 additions and 1,327 deletions.
8 changes: 4 additions & 4 deletions Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
@@ -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

43 changes: 27 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-include $(srctree)/include/linux/kconfig.h
LINUXINCLUDE := \
-I$(srctree)/arch/$(hdr-arch)/include \
-Iarch/$(hdr-arch)/include/generated \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-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,19 +908,19 @@ headers_install_all:

PHONY += headers_install
headers_install: __headers
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/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)
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
$(error Headers not exportable for the $(SRCARCH) architecture))
$(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
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check

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 changes: 3 additions & 0 deletions arch/alpha/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

2 changes: 1 addition & 1 deletion arch/arm/include/asm/page.h
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@

#ifndef CONFIG_MMU

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

#else

2 changes: 1 addition & 1 deletion arch/arm/include/asm/pgtable.h
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
#ifndef CONFIG_MMU

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

#else

2 changes: 1 addition & 1 deletion arch/arm/include/asm/vfpmacros.h
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
*/
#include <asm/hwcap.h>

#include "vfp.h"
#include <asm/vfp.h>

@ Macros to allow building with old toolkits (with no VFP support)
.macro VFPFMRX, rd, sysreg, cond
3 changes: 3 additions & 0 deletions arch/arm/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/arm64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/avr32/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/blackfin/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/c6x/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

4 changes: 3 additions & 1 deletion arch/cris/Makefile
Original file line number Diff line number Diff line change
@@ -23,7 +23,9 @@ mach-$(CONFIG_ETRAXFS) := fs

ifneq ($(arch-y),)
SARCH := arch-$(arch-y)
inc := -Iarch/cris/include/$(SARCH)
inc := -Iarch/cris/include/uapi/$(SARCH)
inc += -Iarch/cris/include/$(SARCH)
inc += -Iarch/cris/include/uapi/$(SARCH)/arch
inc += -Iarch/cris/include/$(SARCH)/arch
else
SARCH :=
2 changes: 1 addition & 1 deletion arch/cris/include/arch-v10/arch/sv_addr_ag.h
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@

/*------------------------------------------------------------*/

#include "sv_addr.agh"
#include <arch/sv_addr.agh>

#if __test_sv_addr__
/* IO_MASK( R_BUS_CONFIG , CE ) */
2 changes: 1 addition & 1 deletion arch/cris/include/arch-v10/arch/svinto.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _ASM_CRIS_SVINTO_H
#define _ASM_CRIS_SVINTO_H

#include "sv_addr_ag.h"
#include <arch/sv_addr_ag.h>

extern unsigned int genconfig_shadow; /* defined and set in head.S */

2 changes: 1 addition & 1 deletion arch/cris/include/arch-v32/arch/dma.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#include "mach/dma.h"
#include <mach/dma.h>
2 changes: 1 addition & 1 deletion arch/cris/include/arch-v32/arch/hwregs/dma.h
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
#define dma_h

/* registers */ /* Really needed, since both are listed in sw.list? */
#include "dma_defs.h"
#include <arch/hwregs/dma_defs.h>


/* descriptors */
1 change: 1 addition & 0 deletions arch/cris/include/uapi/arch-v10/arch/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# UAPI Header export list
1 change: 1 addition & 0 deletions arch/cris/include/uapi/arch-v32/arch/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# UAPI Header export list
5 changes: 5 additions & 0 deletions arch/cris/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

header-y += arch-v10/
header-y += arch-v32/
3 changes: 3 additions & 0 deletions arch/frv/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/h8300/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/hexagon/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/ia64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

3 changes: 3 additions & 0 deletions arch/m32r/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

4 changes: 2 additions & 2 deletions arch/m68k/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef __uClinux__
#include "cacheflush_no.h"
#include <asm/cacheflush_no.h>
#else
#include "cacheflush_mm.h"
#include <asm/cacheflush_mm.h>
#endif
4 changes: 2 additions & 2 deletions arch/m68k/include/asm/io.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef __uClinux__
#include "io_no.h"
#include <asm/io_no.h>
#else
#include "io_mm.h"
#include <asm/io_mm.h>
#endif
8 changes: 4 additions & 4 deletions arch/m68k/include/asm/m68360.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "m68360_regs.h"
#include "m68360_pram.h"
#include "m68360_quicc.h"
#include "m68360_enet.h"
#include <asm/m68360_regs.h>
#include <asm/m68360_pram.h>
#include <asm/m68360_quicc.h>
#include <asm/m68360_enet.h>

#ifdef CONFIG_M68360

2 changes: 1 addition & 1 deletion arch/m68k/include/asm/m68360_enet.h
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
#ifndef __ETHER_H
#define __ETHER_H

#include "quicc_simple.h"
#include <asm/quicc_simple.h>

/*
* transmit BD's
4 changes: 2 additions & 2 deletions arch/m68k/include/asm/page.h
Original file line number Diff line number Diff line change
@@ -43,9 +43,9 @@ extern unsigned long _ramend;
#endif /* !__ASSEMBLY__ */

#ifdef CONFIG_MMU
#include "page_mm.h"
#include <asm/page_mm.h>
#else
#include "page_no.h"
#include <asm/page_no.h>
#endif

#include <asm-generic/getorder.h>
4 changes: 2 additions & 2 deletions arch/m68k/include/asm/pgtable.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef __uClinux__
#include "pgtable_no.h"
#include <asm/pgtable_no.h>
#else
#include "pgtable_mm.h"
#include <asm/pgtable_mm.h>
#endif
2 changes: 1 addition & 1 deletion arch/m68k/include/asm/q40_master.h
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@
#define Q40_RTC_WRITE 128

/* define some Q40 specific ints */
#include "q40ints.h"
#include <asm/q40ints.h>

/* misc defs */
#define DAC_LEFT ((unsigned char *)0xff008000)
4 changes: 2 additions & 2 deletions arch/m68k/include/asm/uaccess.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef __uClinux__
#include "uaccess_no.h"
#include <asm/uaccess_no.h>
#else
#include "uaccess_mm.h"
#include <asm/uaccess_mm.h>
#endif
3 changes: 3 additions & 0 deletions arch/m68k/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

2 changes: 1 addition & 1 deletion arch/microblaze/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef CONFIG_MMU
# include "mmu_context_mm.h"
# include <asm/mmu_context_mm.h>
#else
# include <asm-generic/mmu_context.h>
#endif
3 changes: 3 additions & 0 deletions arch/microblaze/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

2 changes: 1 addition & 1 deletion arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef BCM63XX_IO_H_
#define BCM63XX_IO_H_

#include "bcm63xx_cpu.h"
#include <asm/mach-bcm63xx/bcm63xx_cpu.h>

/*
* Physical memory map, RAM is mapped at 0x0.
2 changes: 1 addition & 1 deletion arch/mips/include/asm/mach-pnx833x/gpio.h
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
- including locking between different uses
*/

#include "pnx833x.h"
#include <asm/mach-pnx833x/pnx833x.h>

#define SET_REG_BIT(reg, bit) do { (reg |= (1 << (bit))); } while (0)
#define CLEAR_REG_BIT(reg, bit) do { (reg &= ~(1 << (bit))); } while (0)
2 changes: 1 addition & 1 deletion arch/mips/include/asm/octeon/cvmx-asm.h
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
#ifndef __CVMX_ASM_H__
#define __CVMX_ASM_H__

#include "octeon-model.h"
#include <asm/octeon/octeon-model.h>

/* other useful stuff */
#define CVMX_SYNC asm volatile ("sync" : : : "memory")
2 changes: 1 addition & 1 deletion arch/mips/include/asm/octeon/cvmx-cmd-queue.h
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@

#include <linux/prefetch.h>

#include "cvmx-fpa.h"
#include <asm/octeon/cvmx-fpa.h>
/**
* By default we disable the max depth support. Most programs
* don't use it and it slows down the command queue processing
4 changes: 2 additions & 2 deletions arch/mips/include/asm/octeon/cvmx-fpa.h
Original file line number Diff line number Diff line change
@@ -36,8 +36,8 @@
#ifndef __CVMX_FPA_H__
#define __CVMX_FPA_H__

#include "cvmx-address.h"
#include "cvmx-fpa-defs.h"
#include <asm/octeon/cvmx-address.h>
#include <asm/octeon/cvmx-fpa-defs.h>

#define CVMX_FPA_NUM_POOLS 8
#define CVMX_FPA_MIN_BLOCK_SIZE 128
2 changes: 1 addition & 1 deletion arch/mips/include/asm/octeon/cvmx-helper-board.h
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
#ifndef __CVMX_HELPER_BOARD_H__
#define __CVMX_HELPER_BOARD_H__

#include "cvmx-helper.h"
#include <asm/octeon/cvmx-helper.h>

typedef enum {
set_phy_link_flags_autoneg = 0x1,
Loading

0 comments on commit 9b2e077

Please sign in to comment.