the inter-relationship between header files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  i just want to clarify the apparent relationship between header
files.  header files are, for the most part, either arch-independent
(include/linux/*.h), or arch-specific (include/asm-<whatever>/*.h).

  as i see it, a header "file" can fall into one of three categories:

  1) purely arch-independent (say, include/linux/kobject.h)
  2) purely arch-specific (include/asm-*/semaphore.h)
  3) a combination of 1) and 2), where there is an independent
     version of the file, which contains some independent
     content and, furthermore, includes the arch-specific version
     of the header file, say:

     include/linux/uaccess.h
     include/asm-*/uaccess.h

  is that about right?  i ask since that suggests the obvious way to
move some header info around to make it more organized.

  for instance, include/linux/kernel.h contains macro definitions for
BUILD_BUG_ON() and BUILD_BUG_ON_ZERO().  however, there are a number
of arch-specific "bug.h" files that, for each arch, define the macro
BUG().

  would it not make more sense to move those arch-independent macro
defines out of kernel.h and into include/linux/bug.h?  that way, all
the "bug"-related stuff is now available through the single include

  #include <linux/bug.h>

and, obviously, that idea holds for more than just that example.

  thoughts?

rday

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux