Skip to content

Generic headers implementation

Remis Lima Baima linux-kbuild 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Create the infrastructure for generic headersMakefile scripts/Makefile.genericheaders scripts/Makefile.headersinst+42 -00 replies
2/3Apply generic headers for x86arch/x86/include/asm/Kbuild arch/x86/include/asm/cputime.h arch/x86/include/asm/errno.h +6 more+9 -80 replies
3/3Apply generic headers for PPCarch/powerpc/include/asm/Kbuild arch/powerpc/include/asm/div64.h arch/powerpc/include/asm/emergency-restart.h +5 more+8 -130 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Generic headers implementation

Generic headers allow ARCH maintainers to remove all dummy arch/ARCH/include/asm/XXX.h files or, depending on the architecture, include/asm-ARCH/XXX.h (e.g. arch/x86/include/asm/errno.h) that only include the _name equivalent_ include/asm-generic/XXX.h file (e.g. include/asm-generic/errno.h) with _no_ changes. It was called generic headers for short. Arnd Bergmann gave the original idea and asked me to implement it.

To use it just two steps are necessary:

- Remove all the dummy arch/ARCH/include/asm/XXX.h files (e.g. rm arch/x86/include/asm/errno.h)

- Add the variable generic-y with the names of the removed files (e.g. generic-y += errno.h) in the arch/ARCH/include/asm/Kbuild (e.g. arch/x86/include/asm/Kbuild)

The removed files will be automatically generated during the build process by the script scripts/Makefile.genericheaders.

The scripts/Makefile.headersinst was adapted to avoid errors (due to the removal of header files from their default locations) so it would pass the 'make headers_check'.

The generic headers were applyed and tested in both x86 (tested in my Notebook with i386_defconfig on kernel 2.6.29-rc7 of 09/Mar/2009 from Linus git tree) and powerpc (tested in my PS3 with ps3_defconfig on kernel 2.6.29-rc7 of 11/Mar/2009 from Geoff Levand git tree). Both compiled and booted without problems.

This approach does not reduce much LOC but, in a rough estimation, it would allow the removal of around 90 dummy header files among all architectures.

PS: This is my first e-mail/patch here. Sorry for any misbehaviour :)

Remis Lima Baima (3):
Create the infrastructure for generic headers
Apply generic headers for x86
Apply generic headers for PPC

 Makefile                                     |    4 +++
 arch/powerpc/include/asm/Kbuild              |    8 ++++++
 arch/powerpc/include/asm/div64.h             |    1 -
 arch/powerpc/include/asm/emergency-restart.h |    1 -
 arch/powerpc/include/asm/irq_regs.h          |    2 -
 arch/powerpc/include/asm/poll.h              |    1 -
 arch/powerpc/include/asm/resource.h          |    1 -
 arch/powerpc/include/asm/statfs.h            |    6 ----
 arch/powerpc/include/asm/xor.h               |    1 -
 arch/x86/include/asm/Kbuild                  |    9 +++++++
 arch/x86/include/asm/cputime.h               |    1 -
 arch/x86/include/asm/errno.h                 |    1 -
 arch/x86/include/asm/fcntl.h                 |    1 -
 arch/x86/include/asm/ioctl.h                 |    1 -
 arch/x86/include/asm/poll.h                  |    1 -
 arch/x86/include/asm/resource.h              |    1 -
 arch/x86/include/asm/rtc.h                   |    1 -
 arch/x86/include/asm/sections.h              |    1 -
 scripts/Makefile.genericheaders              |   34 ++++++++++++++++++++++++++
 scripts/Makefile.headersinst                 |    4 +++
 20 files changed, 59 insertions(+), 21 deletions(-)
 delete mode 100644 arch/powerpc/include/asm/div64.h
 delete mode 100644 arch/powerpc/include/asm/emergency-restart.h
 delete mode 100644 arch/powerpc/include/asm/irq_regs.h
 delete mode 100644 arch/powerpc/include/asm/poll.h
 delete mode 100644 arch/powerpc/include/asm/resource.h
 delete mode 100644 arch/powerpc/include/asm/statfs.h
 delete mode 100644 arch/powerpc/include/asm/xor.h
 delete mode 100644 arch/x86/include/asm/cputime.h
 delete mode 100644 arch/x86/include/asm/errno.h
 delete mode 100644 arch/x86/include/asm/fcntl.h
 delete mode 100644 arch/x86/include/asm/ioctl.h
 delete mode 100644 arch/x86/include/asm/poll.h
 delete mode 100644 arch/x86/include/asm/resource.h
 delete mode 100644 arch/x86/include/asm/rtc.h
 delete mode 100644 arch/x86/include/asm/sections.h
 create mode 100644 scripts/Makefile.genericheaders