Skip to content

Commit fcc8487

Browse files
NicolasDichtelmasahir0y
authored andcommitted
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: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Mark Salter <msalter@redhat.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent ea6819e commit fcc8487

File tree

80 files changed

+111
-1750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+111
-1750
lines changed

Documentation/kbuild/makefiles.txt

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ This document describes the Linux kernel Makefiles.
4444
--- 6.11 Post-link pass
4545

4646
=== 7 Kbuild syntax for exported headers
47-
--- 7.1 header-y
47+
--- 7.1 no-export-headers
4848
--- 7.2 genhdr-y
4949
--- 7.3 generic-y
5050
--- 7.4 generated-y
51+
--- 7.5 mandatory-y
52+
--- 7.6 subdir-y
5153

5254
=== 8 Kbuild Variables
5355
=== 9 Makefile language
@@ -1235,7 +1237,7 @@ When kbuild executes, the following steps are followed (roughly):
12351237
that may be shared between individual architectures.
12361238
The recommended approach how to use a generic header file is
12371239
to list the file in the Kbuild file.
1238-
See "7.4 generic-y" for further info on syntax etc.
1240+
See "7.3 generic-y" for further info on syntax etc.
12391241

12401242
--- 6.11 Post-link pass
12411243

@@ -1262,37 +1264,30 @@ The pre-processing does:
12621264
- drop include of compiler.h
12631265
- drop all sections that are kernel internal (guarded by ifdef __KERNEL__)
12641266

1265-
Each relevant directory contains a file name "Kbuild" which specifies the
1266-
headers to be exported.
1267-
See subsequent chapter for the syntax of the Kbuild file.
1268-
1269-
--- 7.1 header-y
1270-
1271-
header-y specifies header files to be exported.
1272-
1273-
Example:
1274-
#include/linux/Kbuild
1275-
header-y += usb/
1276-
header-y += aio_abi.h
1267+
All headers under include/uapi/, include/generated/uapi/,
1268+
arch/<arch>/include/uapi/asm/ and arch/<arch>/include/generated/uapi/asm/
1269+
are exported.
12771270

1278-
The convention is to list one file per line and
1279-
preferably in alphabetic order.
1271+
A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
1272+
arch/<arch>/include/asm/ to list asm files coming from asm-generic.
1273+
See subsequent chapter for the syntax of the Kbuild file.
12801274

1281-
header-y also specifies which subdirectories to visit.
1282-
A subdirectory is identified by a trailing '/' which
1283-
can be seen in the example above for the usb subdirectory.
1275+
--- 7.1 no-export-headers
12841276

1285-
Subdirectories are visited before their parent directories.
1277+
no-export-headers is essentially used by include/uapi/linux/Kbuild to
1278+
avoid exporting specific headers (e.g. kvm.h) on architectures that do
1279+
not support it. It should be avoided as much as possible.
12861280

12871281
--- 7.2 genhdr-y
12881282

1289-
genhdr-y specifies generated files to be exported.
1290-
Generated files are special as they need to be looked
1291-
up in another directory when doing 'make O=...' builds.
1283+
genhdr-y specifies asm files to be generated.
12921284

12931285
Example:
1294-
#include/linux/Kbuild
1295-
genhdr-y += version.h
1286+
#arch/x86/include/uapi/asm/Kbuild
1287+
genhdr-y += unistd_32.h
1288+
genhdr-y += unistd_64.h
1289+
genhdr-y += unistd_x32.h
1290+
12961291

12971292
--- 7.3 generic-y
12981293

@@ -1334,6 +1329,27 @@ See subsequent chapter for the syntax of the Kbuild file.
13341329
#arch/x86/include/asm/Kbuild
13351330
generated-y += syscalls_32.h
13361331

1332+
--- 7.5 mandatory-y
1333+
1334+
mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
1335+
to define the minimun set of headers that must be exported in
1336+
include/asm.
1337+
1338+
The convention is to list one subdir per line and
1339+
preferably in alphabetic order.
1340+
1341+
--- 7.6 subdir-y
1342+
1343+
subdir-y may be used to specify a subdirectory to be exported.
1344+
1345+
Example:
1346+
#arch/cris/include/uapi/asm/Kbuild
1347+
subdir-y += ../arch-v10/arch/
1348+
subdir-y += ../arch-v32/arch/
1349+
1350+
The convention is to list one subdir per line and
1351+
preferably in alphabetic order.
1352+
13371353
=== 8 Kbuild Variables
13381354

13391355
The top Makefile exports the following variables:

arch/alpha/include/uapi/asm/Kbuild

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,2 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
3-
4-
header-y += a.out.h
5-
header-y += auxvec.h
6-
header-y += bitsperlong.h
7-
header-y += byteorder.h
8-
header-y += compiler.h
9-
header-y += console.h
10-
header-y += errno.h
11-
header-y += fcntl.h
12-
header-y += fpu.h
13-
header-y += gentrap.h
14-
header-y += ioctl.h
15-
header-y += ioctls.h
16-
header-y += ipcbuf.h
17-
header-y += kvm_para.h
18-
header-y += mman.h
19-
header-y += msgbuf.h
20-
header-y += pal.h
21-
header-y += param.h
22-
header-y += poll.h
23-
header-y += posix_types.h
24-
header-y += ptrace.h
25-
header-y += reg.h
26-
header-y += regdef.h
27-
header-y += resource.h
28-
header-y += sembuf.h
29-
header-y += setup.h
30-
header-y += shmbuf.h
31-
header-y += sigcontext.h
32-
header-y += siginfo.h
33-
header-y += signal.h
34-
header-y += socket.h
35-
header-y += sockios.h
36-
header-y += stat.h
37-
header-y += statfs.h
38-
header-y += swab.h
39-
header-y += sysinfo.h
40-
header-y += termbits.h
41-
header-y += termios.h
42-
header-y += types.h
43-
header-y += unistd.h

arch/arc/include/uapi/asm/Kbuild

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
3-
header-y += elf.h
4-
header-y += page.h
5-
header-y += cachectl.h

arch/arm/include/uapi/asm/Kbuild

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
33

4-
header-y += auxvec.h
5-
header-y += byteorder.h
6-
header-y += fcntl.h
7-
header-y += hwcap.h
8-
header-y += ioctls.h
9-
header-y += kvm_para.h
10-
header-y += mman.h
11-
header-y += perf_regs.h
12-
header-y += posix_types.h
13-
header-y += ptrace.h
14-
header-y += setup.h
15-
header-y += sigcontext.h
16-
header-y += signal.h
17-
header-y += stat.h
18-
header-y += statfs.h
19-
header-y += swab.h
20-
header-y += unistd.h
214
genhdr-y += unistd-common.h
225
genhdr-y += unistd-oabi.h
236
genhdr-y += unistd-eabi.h

arch/arm64/include/uapi/asm/Kbuild

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,3 @@
22
include include/uapi/asm-generic/Kbuild.asm
33

44
generic-y += kvm_para.h
5-
6-
header-y += auxvec.h
7-
header-y += bitsperlong.h
8-
header-y += byteorder.h
9-
header-y += fcntl.h
10-
header-y += hwcap.h
11-
header-y += kvm_para.h
12-
header-y += perf_regs.h
13-
header-y += param.h
14-
header-y += ptrace.h
15-
header-y += setup.h
16-
header-y += sigcontext.h
17-
header-y += siginfo.h
18-
header-y += signal.h
19-
header-y += stat.h
20-
header-y += statfs.h
21-
header-y += ucontext.h
22-
header-y += unistd.h

arch/blackfin/include/uapi/asm/Kbuild

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,2 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
3-
4-
header-y += bfin_sport.h
5-
header-y += byteorder.h
6-
header-y += cachectl.h
7-
header-y += fcntl.h
8-
header-y += fixed_code.h
9-
header-y += ioctls.h
10-
header-y += kvm_para.h
11-
header-y += poll.h
12-
header-y += posix_types.h
13-
header-y += ptrace.h
14-
header-y += sigcontext.h
15-
header-y += siginfo.h
16-
header-y += signal.h
17-
header-y += stat.h
18-
header-y += swab.h
19-
header-y += unistd.h

arch/c6x/include/uapi/asm/Kbuild

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,3 @@
22
include include/uapi/asm-generic/Kbuild.asm
33

44
generic-y += kvm_para.h
5-
6-
header-y += byteorder.h
7-
header-y += kvm_para.h
8-
header-y += ptrace.h
9-
header-y += setup.h
10-
header-y += sigcontext.h
11-
header-y += swab.h
12-
header-y += unistd.h

arch/cris/include/uapi/arch-v10/arch/Kbuild

Lines changed: 0 additions & 5 deletions
This file was deleted.

arch/cris/include/uapi/arch-v32/arch/Kbuild

Lines changed: 0 additions & 3 deletions
This file was deleted.

arch/cris/include/uapi/asm/Kbuild

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,5 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
33

4-
header-y += ../arch-v10/arch/
5-
header-y += ../arch-v32/arch/
6-
header-y += auxvec.h
7-
header-y += bitsperlong.h
8-
header-y += byteorder.h
9-
header-y += elf.h
10-
header-y += elf_v10.h
11-
header-y += elf_v32.h
12-
header-y += errno.h
13-
header-y += ethernet.h
14-
header-y += etraxgpio.h
15-
header-y += fcntl.h
16-
header-y += ioctl.h
17-
header-y += ioctls.h
18-
header-y += ipcbuf.h
19-
header-y += mman.h
20-
header-y += msgbuf.h
21-
header-y += param.h
22-
header-y += poll.h
23-
header-y += posix_types.h
24-
header-y += ptrace.h
25-
header-y += ptrace_v10.h
26-
header-y += ptrace_v32.h
27-
header-y += resource.h
28-
header-y += rs485.h
29-
header-y += sembuf.h
30-
header-y += setup.h
31-
header-y += shmbuf.h
32-
header-y += sigcontext.h
33-
header-y += siginfo.h
34-
header-y += signal.h
35-
header-y += socket.h
36-
header-y += sockios.h
37-
header-y += stat.h
38-
header-y += statfs.h
39-
header-y += swab.h
40-
header-y += sync_serial.h
41-
header-y += termbits.h
42-
header-y += termios.h
43-
header-y += types.h
44-
header-y += unistd.h
4+
subdir-y += ../arch-v10/arch/
5+
subdir-y += ../arch-v32/arch/

arch/frv/include/uapi/asm/Kbuild

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,2 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
3-
4-
header-y += auxvec.h
5-
header-y += bitsperlong.h
6-
header-y += byteorder.h
7-
header-y += errno.h
8-
header-y += fcntl.h
9-
header-y += ioctl.h
10-
header-y += ioctls.h
11-
header-y += ipcbuf.h
12-
header-y += kvm_para.h
13-
header-y += mman.h
14-
header-y += msgbuf.h
15-
header-y += param.h
16-
header-y += poll.h
17-
header-y += posix_types.h
18-
header-y += ptrace.h
19-
header-y += registers.h
20-
header-y += resource.h
21-
header-y += sembuf.h
22-
header-y += setup.h
23-
header-y += shmbuf.h
24-
header-y += sigcontext.h
25-
header-y += siginfo.h
26-
header-y += signal.h
27-
header-y += socket.h
28-
header-y += sockios.h
29-
header-y += stat.h
30-
header-y += statfs.h
31-
header-y += swab.h
32-
header-y += termbits.h
33-
header-y += termios.h
34-
header-y += types.h
35-
header-y += unistd.h

arch/h8300/include/uapi/asm/Kbuild

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,2 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
3-
4-
header-y += auxvec.h
5-
header-y += bitsperlong.h
6-
header-y += errno.h
7-
header-y += fcntl.h
8-
header-y += ioctl.h
9-
header-y += ioctls.h
10-
header-y += ipcbuf.h
11-
header-y += kvm_para.h
12-
header-y += mman.h
13-
header-y += msgbuf.h
14-
header-y += param.h
15-
header-y += poll.h
16-
header-y += posix_types.h
17-
header-y += resource.h
18-
header-y += sembuf.h
19-
header-y += setup.h
20-
header-y += shmbuf.h
21-
header-y += siginfo.h
22-
header-y += socket.h
23-
header-y += sockios.h
24-
header-y += stat.h
25-
header-y += statfs.h
26-
header-y += swab.h
27-
header-y += termbits.h
28-
header-y += termios.h
29-
header-y += types.h
30-
header-y += unistd.h

arch/hexagon/include/asm/Kbuild

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
header-y += ucontext.h
3-
41
generic-y += auxvec.h
52
generic-y += barrier.h
63
generic-y += bug.h

arch/hexagon/include/uapi/asm/Kbuild

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
3-
4-
header-y += bitsperlong.h
5-
header-y += byteorder.h
6-
header-y += kvm_para.h
7-
header-y += param.h
8-
header-y += ptrace.h
9-
header-y += registers.h
10-
header-y += setup.h
11-
header-y += sigcontext.h
12-
header-y += signal.h
13-
header-y += swab.h
14-
header-y += unistd.h
15-
header-y += user.h

0 commit comments

Comments
 (0)