Skip to content
Snippets Groups Projects
Commit fcc8487d authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by Masahiro Yamada
Browse files

uapi: export all headers under uapi directories


Regularly, when a new header is created in include/uapi/, the developer
forgets to add it in the corresponding Kbuild file. This error is usually
detected after the release is out.

In fact, all headers under uapi directories should be exported, thus it's
useless to have an exhaustive list.

After this patch, the following files, which were not exported, are now
exported (with make headers_install_all):
asm-arc/kvm_para.h
asm-arc/ucontext.h
asm-blackfin/shmparam.h
asm-blackfin/ucontext.h
asm-c6x/shmparam.h
asm-c6x/ucontext.h
asm-cris/kvm_para.h
asm-h8300/shmparam.h
asm-h8300/ucontext.h
asm-hexagon/shmparam.h
asm-m32r/kvm_para.h
asm-m68k/kvm_para.h
asm-m68k/shmparam.h
asm-metag/kvm_para.h
asm-metag/shmparam.h
asm-metag/ucontext.h
asm-mips/hwcap.h
asm-mips/reg.h
asm-mips/ucontext.h
asm-nios2/kvm_para.h
asm-nios2/ucontext.h
asm-openrisc/shmparam.h
asm-parisc/kvm_para.h
asm-powerpc/perf_regs.h
asm-sh/kvm_para.h
asm-sh/ucontext.h
asm-tile/shmparam.h
asm-unicore32/shmparam.h
asm-unicore32/ucontext.h
asm-x86/hwcap2.h
asm-xtensa/kvm_para.h
drm/armada_drm.h
drm/etnaviv_drm.h
drm/vgem_drm.h
linux/aspeed-lpc-ctrl.h
linux/auto_dev-ioctl.h
linux/bcache.h
linux/btrfs_tree.h
linux/can/vxcan.h
linux/cifs/cifs_mount.h
linux/coresight-stm.h
linux/cryptouser.h
linux/fsmap.h
linux/genwqe/genwqe_card.h
linux/hash_info.h
linux/kcm.h
linux/kcov.h
linux/kfd_ioctl.h
linux/lightnvm.h
linux/module.h
linux/nbd-netlink.h
linux/nilfs2_api.h
linux/nilfs2_ondisk.h
linux/nsfs.h
linux/pr.h
linux/qrtr.h
linux/rpmsg.h
linux/sched/types.h
linux/sed-opal.h
linux/smc.h
linux/smc_diag.h
linux/stm.h
linux/switchtec_ioctl.h
linux/vfio_ccw.h
linux/wil6210_uapi.h
rdma/bnxt_re-abi.h

Note that I have removed from this list the files which are generated in every
exported directories (like .install or .install.cmd).

Thanks to Julien Floret <julien.floret@6wind.com> for the tip to get all
subdirs with a pure makefile command.

For the record, note that exported files for asm directories are a mix of
files listed by:
 - include/uapi/asm-generic/Kbuild.asm;
 - arch/<arch>/include/uapi/asm/Kbuild;
 - arch/<arch>/include/asm/Kbuild.

Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Acked-by: default avatarMark Salter <msalter@redhat.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent ea6819e1
No related branches found
No related tags found
No related merge requests found
Showing
with 43 additions and 432 deletions
...@@ -44,10 +44,12 @@ This document describes the Linux kernel Makefiles. ...@@ -44,10 +44,12 @@ This document describes the Linux kernel Makefiles.
--- 6.11 Post-link pass --- 6.11 Post-link pass
=== 7 Kbuild syntax for exported headers === 7 Kbuild syntax for exported headers
--- 7.1 header-y --- 7.1 no-export-headers
--- 7.2 genhdr-y --- 7.2 genhdr-y
--- 7.3 generic-y --- 7.3 generic-y
--- 7.4 generated-y --- 7.4 generated-y
--- 7.5 mandatory-y
--- 7.6 subdir-y
=== 8 Kbuild Variables === 8 Kbuild Variables
=== 9 Makefile language === 9 Makefile language
...@@ -1235,7 +1237,7 @@ When kbuild executes, the following steps are followed (roughly): ...@@ -1235,7 +1237,7 @@ When kbuild executes, the following steps are followed (roughly):
that may be shared between individual architectures. that may be shared between individual architectures.
The recommended approach how to use a generic header file is The recommended approach how to use a generic header file is
to list the file in the Kbuild file. to list the file in the Kbuild file.
See "7.4 generic-y" for further info on syntax etc. See "7.3 generic-y" for further info on syntax etc.
--- 6.11 Post-link pass --- 6.11 Post-link pass
...@@ -1262,37 +1264,30 @@ The pre-processing does: ...@@ -1262,37 +1264,30 @@ The pre-processing does:
- drop include of compiler.h - drop include of compiler.h
- drop all sections that are kernel internal (guarded by ifdef __KERNEL__) - drop all sections that are kernel internal (guarded by ifdef __KERNEL__)
Each relevant directory contains a file name "Kbuild" which specifies the All headers under include/uapi/, include/generated/uapi/,
headers to be exported. arch/<arch>/include/uapi/asm/ and arch/<arch>/include/generated/uapi/asm/
See subsequent chapter for the syntax of the Kbuild file. are exported.
--- 7.1 header-y
header-y specifies header files to be exported.
Example:
#include/linux/Kbuild
header-y += usb/
header-y += aio_abi.h
The convention is to list one file per line and A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
preferably in alphabetic order. arch/<arch>/include/asm/ to list asm files coming from asm-generic.
See subsequent chapter for the syntax of the Kbuild file.
header-y also specifies which subdirectories to visit. --- 7.1 no-export-headers
A subdirectory is identified by a trailing '/' which
can be seen in the example above for the usb subdirectory.
Subdirectories are visited before their parent directories. no-export-headers is essentially used by include/uapi/linux/Kbuild to
avoid exporting specific headers (e.g. kvm.h) on architectures that do
not support it. It should be avoided as much as possible.
--- 7.2 genhdr-y --- 7.2 genhdr-y
genhdr-y specifies generated files to be exported. genhdr-y specifies asm files to be generated.
Generated files are special as they need to be looked
up in another directory when doing 'make O=...' builds.
Example: Example:
#include/linux/Kbuild #arch/x86/include/uapi/asm/Kbuild
genhdr-y += version.h genhdr-y += unistd_32.h
genhdr-y += unistd_64.h
genhdr-y += unistd_x32.h
--- 7.3 generic-y --- 7.3 generic-y
...@@ -1334,6 +1329,27 @@ See subsequent chapter for the syntax of the Kbuild file. ...@@ -1334,6 +1329,27 @@ See subsequent chapter for the syntax of the Kbuild file.
#arch/x86/include/asm/Kbuild #arch/x86/include/asm/Kbuild
generated-y += syscalls_32.h generated-y += syscalls_32.h
--- 7.5 mandatory-y
mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
to define the minimun set of headers that must be exported in
include/asm.
The convention is to list one subdir per line and
preferably in alphabetic order.
--- 7.6 subdir-y
subdir-y may be used to specify a subdirectory to be exported.
Example:
#arch/cris/include/uapi/asm/Kbuild
subdir-y += ../arch-v10/arch/
subdir-y += ../arch-v32/arch/
The convention is to list one subdir per line and
preferably in alphabetic order.
=== 8 Kbuild Variables === 8 Kbuild Variables
The top Makefile exports the following variables: The top Makefile exports the following variables:
......
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += a.out.h
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += compiler.h
header-y += console.h
header-y += errno.h
header-y += fcntl.h
header-y += fpu.h
header-y += gentrap.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += pal.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += reg.h
header-y += regdef.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += sysinfo.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += unistd.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += elf.h
header-y += page.h
header-y += cachectl.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += auxvec.h
header-y += byteorder.h
header-y += fcntl.h
header-y += hwcap.h
header-y += ioctls.h
header-y += kvm_para.h
header-y += mman.h
header-y += perf_regs.h
header-y += posix_types.h
header-y += ptrace.h
header-y += setup.h
header-y += sigcontext.h
header-y += signal.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += unistd.h
genhdr-y += unistd-common.h genhdr-y += unistd-common.h
genhdr-y += unistd-oabi.h genhdr-y += unistd-oabi.h
genhdr-y += unistd-eabi.h genhdr-y += unistd-eabi.h
...@@ -2,21 +2,3 @@ ...@@ -2,21 +2,3 @@
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += fcntl.h
header-y += hwcap.h
header-y += kvm_para.h
header-y += perf_regs.h
header-y += param.h
header-y += ptrace.h
header-y += setup.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += stat.h
header-y += statfs.h
header-y += ucontext.h
header-y += unistd.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += bfin_sport.h
header-y += byteorder.h
header-y += cachectl.h
header-y += fcntl.h
header-y += fixed_code.h
header-y += ioctls.h
header-y += kvm_para.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += stat.h
header-y += swab.h
header-y += unistd.h
...@@ -2,11 +2,3 @@ ...@@ -2,11 +2,3 @@
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
header-y += byteorder.h
header-y += kvm_para.h
header-y += ptrace.h
header-y += setup.h
header-y += sigcontext.h
header-y += swab.h
header-y += unistd.h
# UAPI Header export list
header-y += sv_addr.agh
header-y += sv_addr_ag.h
header-y += svinto.h
header-y += user.h
# UAPI Header export list
header-y += cryptocop.h
header-y += user.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += ../arch-v10/arch/ subdir-y += ../arch-v10/arch/
header-y += ../arch-v32/arch/ subdir-y += ../arch-v32/arch/
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += elf.h
header-y += elf_v10.h
header-y += elf_v32.h
header-y += errno.h
header-y += ethernet.h
header-y += etraxgpio.h
header-y += fcntl.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += mman.h
header-y += msgbuf.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += ptrace_v10.h
header-y += ptrace_v32.h
header-y += resource.h
header-y += rs485.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += sync_serial.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += unistd.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += errno.h
header-y += fcntl.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += registers.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += unistd.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += auxvec.h
header-y += bitsperlong.h
header-y += errno.h
header-y += fcntl.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += siginfo.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += unistd.h
header-y += ucontext.h
generic-y += auxvec.h generic-y += auxvec.h
generic-y += barrier.h generic-y += barrier.h
generic-y += bug.h generic-y += bug.h
......
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += bitsperlong.h
header-y += byteorder.h
header-y += kvm_para.h
header-y += param.h
header-y += ptrace.h
header-y += registers.h
header-y += setup.h
header-y += sigcontext.h
header-y += signal.h
header-y += swab.h
header-y += unistd.h
header-y += user.h
...@@ -2,48 +2,3 @@ ...@@ -2,48 +2,3 @@
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
header-y += auxvec.h
header-y += bitsperlong.h
header-y += break.h
header-y += byteorder.h
header-y += cmpxchg.h
header-y += errno.h
header-y += fcntl.h
header-y += fpu.h
header-y += gcc_intrin.h
header-y += ia64regs.h
header-y += intel_intrin.h
header-y += intrinsics.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += param.h
header-y += perfmon.h
header-y += perfmon_default_smpl.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += ptrace_offsets.h
header-y += resource.h
header-y += rse.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += ucontext.h
header-y += unistd.h
header-y += ustack.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += errno.h
header-y += fcntl.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += mman.h
header-y += msgbuf.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += unistd.h
...@@ -9,27 +9,3 @@ generic-y += socket.h ...@@ -9,27 +9,3 @@ generic-y += socket.h
generic-y += sockios.h generic-y += sockios.h
generic-y += termbits.h generic-y += termbits.h
generic-y += termios.h generic-y += termios.h
header-y += a.out.h
header-y += bootinfo.h
header-y += bootinfo-amiga.h
header-y += bootinfo-apollo.h
header-y += bootinfo-atari.h
header-y += bootinfo-hp300.h
header-y += bootinfo-mac.h
header-y += bootinfo-q40.h
header-y += bootinfo-vme.h
header-y += byteorder.h
header-y += cachectl.h
header-y += fcntl.h
header-y += ioctls.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += setup.h
header-y += sigcontext.h
header-y += signal.h
header-y += stat.h
header-y += swab.h
header-y += unistd.h
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += byteorder.h
header-y += ech.h
header-y += ptrace.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += swab.h
header-y += unistd.h
generic-y += mman.h generic-y += mman.h
generic-y += resource.h generic-y += resource.h
generic-y += setup.h generic-y += setup.h
...@@ -2,35 +2,3 @@ ...@@ -2,35 +2,3 @@
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
generic-y += types.h generic-y += types.h
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += elf.h
header-y += errno.h
header-y += fcntl.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += termbits.h
header-y += termios.h
header-y += unistd.h
...@@ -2,40 +2,3 @@ ...@@ -2,40 +2,3 @@
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
generic-y += ipcbuf.h generic-y += ipcbuf.h
header-y += auxvec.h
header-y += bitfield.h
header-y += bitsperlong.h
header-y += break.h
header-y += byteorder.h
header-y += cachectl.h
header-y += errno.h
header-y += fcntl.h
header-y += inst.h
header-y += ioctl.h
header-y += ioctls.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += sgidefs.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += sysmips.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += unistd.h
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment