Download Latest Version alter-footer.zip (4.0 kB)
Email in envelope

Get an email when there's a new version of supernova_aosp

Home / ics / bionic / libc / kernel / common / linux
Name Modified Size InfoDownloads / Week
Parent folder
usb 2012-01-01
sunrpc 2012-01-01
spi 2012-01-01
raid 2012-01-01
nfsd 2012-01-01
netfilter_ipv6 2012-01-01
netfilter_arp 2012-01-01
netfilter_ipv4 2012-01-01
netfilter 2012-01-01
mmc 2012-01-01
mtd 2012-01-01
lockd 2012-01-01
hdlc 2012-01-01
byteorder 2012-01-01
tiocl.h 2012-01-01 1.5 kB
tpa2018d1.h 2012-01-01 1.2 kB
transport_class.h 2012-01-01 1.9 kB
tty.h 2012-01-01 738 Bytes
types.h 2012-01-01 1.2 kB
ublock.h 2012-01-01 1.5 kB
udp.h 2012-01-01 934 Bytes
ufs_fs_i.h 2012-01-01 1.0 kB
ufs_fs_sb.h 2012-01-01 1.2 kB
uinput.h 2012-01-01 2.3 kB
uio.h 2012-01-01 889 Bytes
un.h 2012-01-01 823 Bytes
unistd.h 2012-01-01 750 Bytes
usb.h 2012-01-01 834 Bytes
usb_ch9.h 2012-01-01 9.0 kB
usbdevice_fs.h 2012-01-01 3.6 kB
user.h 2012-01-01 689 Bytes
utime.h 2012-01-01 775 Bytes
utsname.h 2012-01-01 1.2 kB
version.h 2012-01-01 764 Bytes
vfs.h 2012-01-01 744 Bytes
videodev2.h 2012-01-01 38.0 kB
videodev.h 2012-01-01 7.0 kB
vmalloc.h 2012-01-01 1.2 kB
vt.h 2012-01-01 1.8 kB
vt_buffer.h 2012-01-01 1.1 kB
wait.h 2012-01-01 1.0 kB
wanrouter.h 2012-01-01 7.4 kB
wireless.h 2012-01-01 12.1 kB
workqueue.h 2012-01-01 1.7 kB
xattr.h 2012-01-01 1.6 kB
zconf.h 2012-01-01 1.1 kB
zlib.h 2012-01-01 2.0 kB
zorro_ids.h 2012-01-01 28.8 kB
sched.h 2012-01-01 1.5 kB
sem.h 2012-01-01 1.8 kB
seq_file.h 2012-01-01 726 Bytes
seqlock.h 2012-01-01 2.1 kB
serial_core.h 2012-01-01 2.0 kB
serial_reg.h 2012-01-01 6.6 kB
serio.h 2012-01-01 1.8 kB
sfh7743.h 2012-01-01 903 Bytes
shm.h 2012-01-01 1.8 kB
signal.h 2012-01-01 773 Bytes
skbuff.h 2012-01-01 3.3 kB
slab.h 2012-01-01 719 Bytes
smb.h 2012-01-01 1.4 kB
smp.h 2012-01-01 1.3 kB
smp_lock.h 2012-01-01 920 Bytes
socket.h 2012-01-01 5.8 kB
sockios.h 2012-01-01 3.0 kB
soundcard.h 2012-01-01 28.7 kB
spinlock.h 2012-01-01 4.6 kB
spinlock_api_smp.h 2012-01-01 887 Bytes
spinlock_api_up.h 2012-01-01 3.2 kB
spinlock_types.h 2012-01-01 1.6 kB
spinlock_types_up.h 2012-01-01 982 Bytes
spinlock_up.h 2012-01-01 1.3 kB
stacktrace.h 2012-01-01 850 Bytes
stat.h 2012-01-01 1.6 kB
statfs.h 2012-01-01 972 Bytes
stddef.h 2012-01-01 1.0 kB
string.h 2012-01-01 725 Bytes
stringify.h 2012-01-01 800 Bytes
swab.h 2012-01-01 3.0 kB
swap.h 2012-01-01 1.2 kB
sysctl.h 2012-01-01 17.9 kB
sysdev.h 2012-01-01 2.0 kB
sysfs.h 2012-01-01 2.3 kB
taskstats.h 2012-01-01 1.7 kB
taskstats_kern.h 2012-01-01 821 Bytes
tcp.h 2012-01-01 3.3 kB
tegra_audio.h 2012-01-01 1.8 kB
tegra_avp.h 2012-01-01 1.3 kB
tegra_rpc.h 2012-01-01 1.4 kB
tegra_sema.h 2012-01-01 1.0 kB
tegrafb.h 2012-01-01 2.6 kB
telephony.h 2012-01-01 4.5 kB
termios.h 2012-01-01 776 Bytes
textsearch.h 2012-01-01 733 Bytes
thread_info.h 2012-01-01 892 Bytes
threads.h 2012-01-01 962 Bytes
time.h 2012-01-01 1.7 kB
timer.h 2012-01-01 1.4 kB
times.h 2012-01-01 846 Bytes
timex.h 2012-01-01 2.7 kB
netfilter_ipv6.h 2012-01-01 1.7 kB
netlink.h 2012-01-01 3.4 kB
nfs2.h 2012-01-01 2.0 kB
nfs3.h 2012-01-01 2.8 kB
nfs4.h 2012-01-01 3.4 kB
nfs.h 2012-01-01 3.2 kB
nfs_xdr.h 2012-01-01 11.5 kB
nfsacl.h 2012-01-01 1.1 kB
node.h 2012-01-01 894 Bytes
nodemask.h 2012-01-01 5.1 kB
notifier.h 2012-01-01 2.0 kB
numa.h 2012-01-01 783 Bytes
nvhdcp.h 2012-01-01 3.7 kB
nvram.h 2012-01-01 899 Bytes
omap_csmi.h 2012-01-01 987 Bytes
omap_ion.h 2012-01-01 2.2 kB
pagemap.h 2012-01-01 1.3 kB
param.h 2012-01-01 745 Bytes
patchkey.h 2012-01-01 1.1 kB
pci.h 2012-01-01 1.2 kB
pci_ids.h 2012-01-01 87.2 kB
pci_regs.h 2012-01-01 13.9 kB
percpu.h 2012-01-01 1.2 kB
percpu_counter.h 2012-01-01 909 Bytes
perf_event.h 2012-01-01 5.1 kB
personality.h 2012-01-01 2.7 kB
pfkeyv2.h 2012-01-01 8.2 kB
pkt_cls.h 2012-01-01 8.1 kB
pkt_sched.h 2012-01-01 6.9 kB
platform_device.h 2012-01-01 1.4 kB
plist.h 2012-01-01 1.8 kB
pm.h 2012-01-01 715 Bytes
pn544.h 2012-01-01 857 Bytes
pnp.h 2012-01-01 717 Bytes
poll.h 2012-01-01 742 Bytes
posix_acl.h 2012-01-01 1.4 kB
posix_types.h 2012-01-01 1.3 kB
ppdev.h 2012-01-01 2.3 kB
ppp_defs.h 2012-01-01 2.6 kB
prctl.h 2012-01-01 1.8 kB
preempt.h 2012-01-01 1.3 kB
proc_fs.h 2012-01-01 2.1 kB
ptrace.h 2012-01-01 1.7 kB
qic117.h 2012-01-01 8.1 kB
qnxtypes.h 2012-01-01 985 Bytes
quota.h 2012-01-01 2.4 kB
random.h 2012-01-01 1.1 kB
rbtree.h 2012-01-01 1.6 kB
rcupdate.h 2012-01-01 729 Bytes
reboot.h 2012-01-01 1.3 kB
relay.h 2012-01-01 2.2 kB
resource.h 2012-01-01 1.4 kB
route.h 2012-01-01 1.4 kB
rpmsg_omx.h 2012-01-01 1.9 kB
rtc.h 2012-01-01 2.2 kB
rtnetlink.h 2012-01-01 11.5 kB
rwsem.h 2012-01-01 749 Bytes
mtio.h 2012-01-01 7.1 kB
mutex-debug.h 2012-01-01 985 Bytes
mutex.h 2012-01-01 1.7 kB
ncp.h 2012-01-01 5.0 kB
ncp_mount.h 2012-01-01 1.8 kB
ncp_no.h 2012-01-01 1.3 kB
neighbour.h 2012-01-01 2.6 kB
net.h 2012-01-01 1.4 kB
netdevice.h 2012-01-01 1.8 kB
netfilter.h 2012-01-01 2.7 kB
netfilter_arp.h 2012-01-01 880 Bytes
netfilter_bridge.h 2012-01-01 963 Bytes
netfilter_ipv4.h 2012-01-01 1.9 kB
kdev_t.h 2012-01-01 825 Bytes
kernel.h 2012-01-01 1.3 kB
kernel_stat.h 2012-01-01 1.2 kB
kernelcapi.h 2012-01-01 1.2 kB
kexec.h 2012-01-01 755 Bytes
key.h 2012-01-01 845 Bytes
keyboard.h 2012-01-01 12.1 kB
keychord.h 2012-01-01 877 Bytes
klist.h 2012-01-01 1.2 kB
kmod.h 2012-01-01 912 Bytes
kobject.h 2012-01-01 715 Bytes
kref.h 2012-01-01 709 Bytes
ktime.h 2012-01-01 1.7 kB
kxtf9.h 2012-01-01 2.1 kB
l3g4200d.h 2012-01-01 1.1 kB
leds-an30259a.h 2012-01-01 2.1 kB
lightsensor.h 2012-01-01 976 Bytes
limits.h 2012-01-01 1.1 kB
linkage.h 2012-01-01 1.6 kB
lis331dlh.h 2012-01-01 1.2 kB
list.h 2012-01-01 772 Bytes
lockdep.h 2012-01-01 2.1 kB
loop.h 2012-01-01 2.0 kB
magic.h 2012-01-01 1.9 kB
major.h 2012-01-01 4.4 kB
max9635.h 2012-01-01 951 Bytes
mc146818rtc.h 2012-01-01 1.9 kB
mca.h 2012-01-01 2.0 kB
mempolicy.h 2012-01-01 1.1 kB
mempool.h 2012-01-01 1.1 kB
miscdevice.h 2012-01-01 1.7 kB
mm.h 2012-01-01 796 Bytes
mmzone.h 2012-01-01 723 Bytes
mod_devicetable.h 2012-01-01 5.4 kB
module.h 2012-01-01 3.3 kB
moduleparam.h 2012-01-01 4.1 kB
mount.h 2012-01-01 720 Bytes
mroute6.h 2012-01-01 2.8 kB
msdos_fs.h 2012-01-01 4.6 kB
msg.h 2012-01-01 1.7 kB
msm_adsp.h 2012-01-01 1.9 kB
msm_audio.h 2012-01-01 2.7 kB
msm_hw3d.h 2012-01-01 1.4 kB
msm_kgsl.h 2012-01-01 5.5 kB
msm_mdp.h 2012-01-01 1.9 kB
msm_q6vdec.h 2012-01-01 4.3 kB
msm_q6venc.h 2012-01-01 6.9 kB
msm_vidc_dec.h 2012-01-01 12.8 kB
msm_vidc_enc.h 2012-01-01 12.4 kB
mt9t013.h 2012-01-01 3.5 kB
futex.h 2012-01-01 1.7 kB
genetlink.h 2012-01-01 3.5 kB
genhd.h 2012-01-01 1.5 kB
gfp.h 2012-01-01 2.9 kB
hardirq.h 2012-01-01 2.5 kB
hdreg.h 2012-01-01 11.6 kB
hdsmart.h 2012-01-01 4.0 kB
hid.h 2012-01-01 1.2 kB
hidraw.h 2012-01-01 1.3 kB
highmem.h 2012-01-01 1.2 kB
hil.h 2012-01-01 12.0 kB
i2c.h 2012-01-01 3.4 kB
icmp.h 2012-01-01 2.1 kB
icmpv6.h 2012-01-01 3.9 kB
if.h 2012-01-01 4.7 kB
if_addr.h 2012-01-01 1.6 kB
if_arcnet.h 2012-01-01 1.9 kB
if_arp.h 2012-01-01 3.1 kB
if_bridge.h 2012-01-01 2.6 kB
if_ether.h 2012-01-01 2.9 kB
if_fc.h 2012-01-01 1.0 kB
if_fddi.h 2012-01-01 2.2 kB
if_hippi.h 2012-01-01 2.3 kB
if_link.h 2012-01-01 5.6 kB
if_packet.h 2012-01-01 2.4 kB
if_ppp.h 2012-01-01 3.7 kB
if_pppol2tp.h 2012-01-01 2.1 kB
if_pppolac.h 2012-01-01 1.5 kB
if_pppopns.h 2012-01-01 1.5 kB
if_pppox.h 2012-01-01 4.6 kB
if_tr.h 2012-01-01 2.0 kB
if_tun.h 2012-01-01 2.3 kB
if_vlan.h 2012-01-01 1.5 kB
in6.h 2012-01-01 4.4 kB
in.h 2012-01-01 5.2 kB
in_route.h 2012-01-01 1.4 kB
init.h 2012-01-01 4.6 kB
inotify.h 2012-01-01 1.8 kB
input.h 2012-01-01 20.5 kB
interrupt.h 2012-01-01 3.5 kB
ioctl.h 2012-01-01 746 Bytes
ion.h 2012-01-01 2.8 kB
ioport.h 2012-01-01 3.3 kB
ioprio.h 2012-01-01 1.3 kB
ip.h 2012-01-01 3.0 kB
ipc.h 2012-01-01 1.3 kB
ipmi_msgdefs.h 2012-01-01 2.5 kB
ipmi_smi.h 2012-01-01 2.1 kB
ipsec.h 2012-01-01 1.4 kB
ipv6.h 2012-01-01 2.8 kB
ipv6_route.h 2012-01-01 1.6 kB
ipx.h 2012-01-01 2.2 kB
irq.h 2012-01-01 3.0 kB
irq_cpustat.h 2012-01-01 953 Bytes
irqflags.h 2012-01-01 1.5 kB
irqreturn.h 2012-01-01 834 Bytes
jbd.h 2012-01-01 3.0 kB
jiffies.h 2012-01-01 3.9 kB
kd.h 2012-01-01 3.8 kB
ata.h 2012-01-01 6.6 kB
atm.h 2012-01-01 3.9 kB
atmapi.h 2012-01-01 926 Bytes
atmdev.h 2012-01-01 4.7 kB
atmioc.h 2012-01-01 1.4 kB
atmppp.h 2012-01-01 917 Bytes
atmsap.h 2012-01-01 2.6 kB
attribute_container.h 2012-01-01 1.4 kB
auto_fs.h 2012-01-01 1.8 kB
autoconf.h 2012-01-01 778 Bytes
auxvec.h 2012-01-01 1.2 kB
backing-dev.h 2012-01-01 2.1 kB
binder.h 2012-01-01 4.5 kB
binfmts.h 2012-01-01 828 Bytes
bio.h 2012-01-01 5.8 kB
bitmap.h 2012-01-01 950 Bytes
bitops.h 2012-01-01 771 Bytes
blkdev.h 2012-01-01 11.7 kB
blkpg.h 2012-01-01 1.1 kB
blockgroup_lock.h 2012-01-01 1.1 kB
bmp085.h 2012-01-01 1.1 kB
cache.h 2012-01-01 1.6 kB
calc64.h 2012-01-01 907 Bytes
capability.h 2012-01-01 1.9 kB
capella_cm3602.h 2012-01-01 1.0 kB
capi.h 2012-01-01 2.4 kB
cdev.h 2012-01-01 718 Bytes
cdrom.h 2012-01-01 14.9 kB
circ_buf.h 2012-01-01 1.2 kB
clk.h 2012-01-01 852 Bytes
coda.h 2012-01-01 11.3 kB
coda_fs_i.h 2012-01-01 725 Bytes
compat.h 2012-01-01 723 Bytes
compiler-gcc.h 2012-01-01 1.2 kB
compiler.h 2012-01-01 1.2 kB
completion.h 2012-01-01 1.2 kB
config.h 2012-01-01 752 Bytes
console_struct.h 2012-01-01 3.3 kB
cpcap_audio.h 2012-01-01 2.4 kB
cpu.h 2012-01-01 1.2 kB
cpumask.h 2012-01-01 4.6 kB
ctype.h 2012-01-01 1.6 kB
dccp.h 2012-01-01 3.0 kB
debug_locks.h 2012-01-01 1.1 kB
delay.h 2012-01-01 1.0 kB
device.h 2012-01-01 6.8 kB
dirent.h 2012-01-01 942 Bytes
dm-ioctl.h 2012-01-01 3.7 kB
dma-mapping.h 2012-01-01 1.7 kB
dmaengine.h 2012-01-01 715 Bytes
efs_dir.h 2012-01-01 1.4 kB
efs_fs_i.h 2012-01-01 1.5 kB
efs_fs_sb.h 2012-01-01 1.5 kB
elevator.h 2012-01-01 3.6 kB
elf-em.h 2012-01-01 1.4 kB
elf.h 2012-01-01 7.4 kB
err.h 2012-01-01 862 Bytes
errno.h 2012-01-01 745 Bytes
errqueue.h 2012-01-01 1.0 kB
etherdevice.h 2012-01-01 817 Bytes
ethtool.h 2012-01-01 7.4 kB
ext2_fs.h 2012-01-01 11.1 kB
ext3_fs.h 2012-01-01 13.2 kB
fadvise.h 2012-01-01 1.0 kB
fb.h 2012-01-01 14.6 kB
fcntl.h 2012-01-01 1.2 kB
fd.h 2012-01-01 5.5 kB
file.h 2012-01-01 1.8 kB
filter.h 2012-01-01 2.5 kB
fs.h 2012-01-01 4.5 kB
ftape.h 2012-01-01 1.5 kB
a1026.h 2012-01-01 2.2 kB
a.out.h 2012-01-01 4.5 kB
aio_abi.h 2012-01-01 1.4 kB
akm8973.h 2012-01-01 2.0 kB
akm8975.h 2012-01-01 2.4 kB
akm8976.h 2012-01-01 3.1 kB
android_alarm.h 2012-01-01 2.0 kB
android_pmem.h 2012-01-01 1.5 kB
android_power.h 2012-01-01 1.8 kB
apm_bios.h 2012-01-01 3.0 kB
ashmem.h 2012-01-01 1.6 kB
Totals: 361 Items   1.1 MB 2
Bionic comes with a set of 'clean' Linux kernel headers that can safely be
included by userland applications and libraries without fear of hideous
conflicts. for more information why this is needed, see the "RATIONALE"
section at the end of this document.

these clean headers are automatically generated by several scripts located
in the 'bionic/kernel/tools' directory, which process a set of original
and 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.

the generation process works as follows:

  * 'bionic/kernel/original/'
    contains a set of kernel headers as normally found in the 'include'
    directory of a normal Linux kernel source tree. note that this should
    only contain the files that are really needed by Android (use
    'find_headers.py' to find these automatically).

  * 'bionic/kernel/common'
    contains the non-arch-specific clean headers and directories
    (e.g. linux, asm-generic and mtd)

  *'bionic/kernel/arch-arm/'
    contains the ARM-specific directory tree of clean headers.

  * 'bionic/kernel/arch-arm/asm'
    contains the real ARM-specific headers

  * 'bionic/kernel/arch-x86'
    similarly contains all headers and symlinks to be used on x86

  * 'bionic/kernel/tools' contains various Python and shell scripts used
    to manage and re-generate the headers

the tools you can use are:

  * tools/find_users.py
    scans a list of source files or directories and prints which ones do
    include Linux headers.

  * tools/find_headers.py
    scans a list of source files or directories and recursively finds all
    the original kernel headers they need.

  * 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 
    'bionic/kernel/original'. this is the script you're likely going to 
    run whenever you update the original headers.

NOTE:
  if ANDROID_PRODUCT_OUT is defined in your environment, both 'clean_header.py'
  and 'update_all.py' will automatically issue "p4 add/edit/delete" commands
  appropriately to reflect the changes being made.

  you will need to "p4 submit" manually though...


HOW TO BUILD BIONIC AND OTHER PROGRAMS WITH THE CLEAN HEADERS:
==============================================================

add bionic/kernel/common and bionic/kernel/arch-<yourarch> to your C
include path. that should be enough. Note that Bionic will not compile properly 
if you don't.


HOW TO SUPPORT ANOTHER ARCHITECTURE:
====================================

see the content of tools/defaults.py, you will need to make a few updates
here:

  - add a new item to the 'kernel_archs' list of supported architectures

  - add a proper definition for 'kernel_known_<arch>_statics' with
    relevant definitions.

  - update 'kernel_known_statics' to map "<arch>" to
    'kernel_known_<arch>_statics'

then, add the new architecture-specific headers to original/asm-<arch>.
(please ensure that these are really needed, e.g. with tools/find_headers.py)

finally, run tools/update_all.py



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

copy any updated kernel header into the corresponding location under
'bionic/kernel/original'.

for any new kernel header you want to add, first run tools/find_headers.py to be
sure that it is really needed by the Android sources. then add it to
'bionic/kernel/original'

then, run tools/update_all.py to re-run the auto-cleaning



HOW THE CLEANUP PROCESS WORKS:
==============================

this section describes the action performed by the cleanup program(s) when they
process the original kernel headers into clean ones:

1. Optimize well-known macros (e.g. __KERNEL__, __KERNEL_STRICT_NAMES)

    this pass gets rid of everything that is guarded by a well-known macro
    definition. this means that a block like

       #ifdef __KERNEL__
       ....
       #endif

    will be totally omitted from the output. the optimizer is smart enough to
    handle all complex C-preprocessor conditional expression appropriately.
    this means that, for example:

       #if defined(__KERNEL__) || defined(FOO)
       ...
       #endif

    will be transformed into:

       #ifdef FOO
       ...
       #endif

    see tools/defaults.py for the list of well-known macros used in this pass,
    in case you need to update it in the future.

    note that this also remove any reference to a kernel-specific configuration
    macro like CONFIG_FOO from the clean headers.


2. remove variable and function declarations:

  this pass scans non-directive text and only keeps things that look like a
  typedef/struct/union/enum declaration. this allows to get rid of any variable
  or function declaration that should only be used within the kernel anyway
  (and which normally *should* be guarded in a #ifdef __KERNEL__ ... #endif
  block, if the kernel writers were not so messy)

  there are however a few exceptions: it is seldom useful to keep the definition
  of some static inline functions performing very simple operations. a good
  example is the optimized 32-bit byte-swap function found in
  arch-arm/asm/byteorder.h

  the list of exceptions is in tools/defaults.py in case you need to update it
  in the future.

  note that we do *not* remove macro definitions, including these macro that
  perform a call to one of these kernel-header functions, or even define other
  functions. we consider it safe since userland applications have no business
  using them anyway.


3. whitespace cleanup:

  the final pass remove any comments and empty lines from the final headers.


4. add a standard disclaimer:

  prepended to each generated header, contains a message like
  "do not edit directly - file was auto-generated by ...."


RATIONALE:
==========

OVERVIEW OF THE CURRENT KERNEL HEADER MESS:
-------------------------------------------

The original kernel headers are not easily usable from userland applications.
they contain many declarations and construct that will result in a compilation
failure or even worse, incorrect behaviour. for example:

- some headers try to define Posix types (e.g. size_t, ssize_t) that can
  conflict with the corresponding definitions provided by your C library.

- some headers use constructs that cannot be compiled in ANSI C mode.

- some headers use constructs do not compile with C++ at all.

- some headers contain invalid "legacy" definitions for the benefit of old
  C libraries (e.g. glibc5) but result in incorrect behaviour if used
  directly.

  e.g. gid_t being defined in <linux/types.h> as a 16-bit type while the
  kernel uses 32-bit ids. this results in problems when getgroups() or
  setgroups() are called, since they operate on gid_t arrays.

unfortunately, these headers are also the only source of some really extensive
constant and type definitions that are required by userland applications.
think any library/program that need to access ALSA, or Video4Linux, or
anything related to a specific device or Linux-specific system interface
(e.g. IOCTLS, etc...)

As a consequence, every Linux distribution provides a set of patched kernel
headers to be used by userland applications (which installs in
/usr/include/linux/, /usr/include/asm/, etc...). these are manually maintained
by distribution packagers, and generated either manually or with various
scripts. these headers are also tailored to GNU LibC and cannot be reused
easily by Bionic.

for a really long period, the kernel authors have stated that they don't want
to fix the problem, even when someone proposed a patch to start cleaning the
official headers. from their point of view this is purely a library author
problem.

fortunately, enlightnment happened, and the kernel now provides a way to
install a set of "user-friendly" headers that are generated from the official
ones by stripping the __KERNEL__ protected declarations.

unfortunately, this is not enough for Bionic because the result still contains
a few broken declarations that are difficult to route around. (see below for
a little bit of details).

we plan to be able to support these kernel-generated user-land headers in the
future, but the priority on this issue is very low.


WHAT WE DO:
-----------

so we're doomed to repeat the same effort than anyone else. the big difference
here is that we want to automate as much as possible the generation of the
clean headers to easily support additional architectures in the future,
and keep current with upstream changes in the header definitions with the
least possible hassle.

of course, this is only a race to the bottom. the kernel maintainers still
feel free to randomly break the structure of their headers (e.g. moving the
location of some files) occasionally, so we'll need to keep up with that by
updating our build script/original headers as these cases happen.

what we do is keep a set of "original" kernel headers, and process them
automatically to generate a set of "clean" headers that can be used from
userland and the C library.

note that the "original" headers can be tweaked a little to avoid some subtle
issues. for example:

- when the location of various USB-related headers changes in the kernel
  source tree, we want to keep them at the same location in our generated
  headers (there is no reason to break the userland API for something
  like that).

- sometimes, we prefer to take certain things out of blocks guarded by a
  #ifdef __KERNEL__ .. #endif. for example, on recent kernels <linux/wireless.h>
  only includes <linux/if.h> when in kernel mode. we make it available to
  userland as well since some code out there assumes that this is the case.

- sometimes, the header is simply incorrect (e.g. it uses a type without
  including the header that defines it before-hand)

Source: README.TXT, updated 2012-01-01