platform_bionic/libc/kernel
Christopher Ferris 05d08e9716 Updated to v4.4.1 kernel headers.
Small modifications needed to allow compilation with the new headers:

- Manually modify bionic/libc/kernel/uapi/asm-mips/asm/siginfo.h to
  remove the uapi from the include.
- PR_XXX defines are now available for mips, so remove the definition
  from linker_mips.cpp.

Bug: 23789423
Change-Id: I6dc8a03b012426d3a937db15cb24d3a50fab5a8c
2016-02-05 16:03:55 -08:00
..
common/scsi Import scsi headers. 2015-09-17 21:22:44 -07:00
tools <netinet/udp.h> should include <linux/udp.h>. 2015-09-22 12:34:13 -07:00
uapi Updated to v4.4.1 kernel headers. 2016-02-05 16:03:55 -08:00
README.TXT Add gen syscalls step to instructions. 2014-07-18 16:56:33 -07:00

Bionic comes with a processed set of all of the uapi Linux kernel headers that
can safely be included by userland applications and libraries.

These clean headers are automatically generated by several scripts located
in the 'bionic/kernel/tools' directory. The tools process the original
unmodified kernel headers in order to get rid of many annoying
declarations and constructs that usually result in compilation failure.

The 'clean headers' only contain type and macro definitions, with the
exception of a couple static inline functions used for performance
reason (e.g. optimized CPU-specific byte-swapping routines).

They can be included from C++, or when compiling code in strict ANSI mode.
They can be also included before or after any Bionic C library header.

Description of the directories involved in generating the parsed kernel headers:

  * 'external/kernel-headers/original/'
    Contains the uapi kernel headers found in the android kernel. Note this
    also includes the header files that are generated by building the kernel
    sources.

  * 'bionic/libc/kernel/uapi'
    Contains the cleaned kernel headers and mirrors the directory structure
    in 'external/kernel-headers/original/uapi/'.

  * 'bionic/libc/kernel/tools'
    Contains various Python and shell scripts used to get and re-generate
    the headers.

The tools to get/parse the headers:

  * tools/generate_uapi_headers.sh
    Checks out the android kernel and generates all uapi header files.
    copies all the changed files into external/kernel-headers.

  * tools/clean_header.py
    Prints the clean version of a given kernel header. With the -u option,
    this will also update the corresponding clean header file if its
    content has changed. You can also process more than one file with -u.

  * tools/update_all.py
    Automatically update all clean headers from the content of
    'external/kernel-headers/original'.


HOW TO UPDATE THE HEADERS WHEN NEEDED:
======================================

IMPORTANT IMPORTANT:

  WHEN UPDATING THE HEADERS, ALWAYS CHECK THAT THE NEW CLEAN HEADERS DO
  NOT BREAK THE KERNEL <-> USER ABI, FOR EXAMPLE BY CHANGING THE SIZE
  OF A GIVEN TYPE. THIS TASK CANNOT BE EASILY AUTOMATED AT THE MOMENT

Grab the latest headers from the android kernel by running this command:

  bionic/libc/kernel/tools/generate_uapi_headers.sh --download-kernel

Next, run this command to copy the parsed files to bionic/libc/kernel/uapi:

  bionic/libc/kernel/tools/update_all.py

Finally, run this command to regenerate the syscalls list:

  bionic/libc/tools/gensyscalls.py

After this, you will need to build/test the tree to make sure that these
changes do not introduce any errors.