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

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

Name Modified Size InfoDownloads / Week
Parent folder
hd64465 2012-01-01
systemh7751.h 2012-01-01 2.3 kB
termbits.h 2012-01-01 4.3 kB
termios.h 2012-01-01 1.4 kB
thread_info.h 2012-01-01 737 Bytes
timer.h 2012-01-01 1.1 kB
timex.h 2012-01-01 816 Bytes
titan.h 2012-01-01 915 Bytes
tlb.h 2012-01-01 1.1 kB
tlb_64.h 2012-01-01 1.2 kB
tlbflush.h 2012-01-01 1.1 kB
topology.h 2012-01-01 764 Bytes
types.h 2012-01-01 1.1 kB
uaccess.h 2012-01-01 3.4 kB
uaccess_32.h 2012-01-01 2.7 kB
uaccess_64.h 2012-01-01 1.5 kB
ubc.h 2012-01-01 720 Bytes
ucontext.h 2012-01-01 878 Bytes
unaligned.h 2012-01-01 1.2 kB
unistd.h 2012-01-01 741 Bytes
unistd_32.h 2012-01-01 9.6 kB
unistd_64.h 2012-01-01 10.2 kB
user.h 2012-01-01 1.5 kB
vga.h 2012-01-01 721 Bytes
watchdog.h 2012-01-01 730 Bytes
xor.h 2012-01-01 696 Bytes
magicpanelr2.h 2012-01-01 2.0 kB
mc146818rtc.h 2012-01-01 729 Bytes
microdev.h 2012-01-01 2.1 kB
migor.h 2012-01-01 1.7 kB
mman.h 2012-01-01 1.0 kB
mmu.h 2012-01-01 1.6 kB
mmu_context.h 2012-01-01 737 Bytes
mmu_context_32.h 2012-01-01 743 Bytes
mmu_context_64.h 2012-01-01 950 Bytes
mmzone.h 2012-01-01 727 Bytes
module.h 2012-01-01 926 Bytes
msgbuf.h 2012-01-01 1.1 kB
mutex.h 2012-01-01 702 Bytes
page.h 2012-01-01 2.2 kB
param.h 2012-01-01 833 Bytes
parport.h 2012-01-01 729 Bytes
pci.h 2012-01-01 793 Bytes
percpu.h 2012-01-01 758 Bytes
pgalloc.h 2012-01-01 1.1 kB
pgtable.h 2012-01-01 2.5 kB
pgtable_32.h 2012-01-01 6.2 kB
pgtable_64.h 2012-01-01 5.3 kB
pm.h 2012-01-01 719 Bytes
poll.h 2012-01-01 697 Bytes
posix_types.h 2012-01-01 751 Bytes
posix_types_32.h 2012-01-01 3.3 kB
posix_types_64.h 2012-01-01 3.3 kB
processor.h 2012-01-01 1.4 kB
processor_32.h 2012-01-01 738 Bytes
processor_64.h 2012-01-01 3.4 kB
ptrace.h 2012-01-01 1.9 kB
push-switch.h 2012-01-01 1.1 kB
r7780rp.h 2012-01-01 1.5 kB
resource.h 2012-01-01 766 Bytes
rtc.h 2012-01-01 837 Bytes
rts7751r2d.h 2012-01-01 2.4 kB
rwsem.h 2012-01-01 832 Bytes
scatterlist.h 2012-01-01 1.0 kB
sdk7780.h 2012-01-01 2.4 kB
seccomp.h 2012-01-01 886 Bytes
sections.h 2012-01-01 767 Bytes
segment.h 2012-01-01 1.1 kB
sembuf.h 2012-01-01 966 Bytes
serial.h 2012-01-01 871 Bytes
setup.h 2012-01-01 746 Bytes
sfp-machine.h 2012-01-01 2.0 kB
sh7760fb.h 2012-01-01 2.8 kB
sh7763rdp.h 2012-01-01 1.4 kB
sh7785lcr.h 2012-01-01 1.5 kB
sh_bios.h 2012-01-01 723 Bytes
sh_eth.h 2012-01-01 831 Bytes
sh_keysc.h 2012-01-01 908 Bytes
sh_mobile_lcdc.h 2012-01-01 2.0 kB
shmbuf.h 2012-01-01 1.3 kB
shmin.h 2012-01-01 820 Bytes
shmparam.h 2012-01-01 785 Bytes
sigcontext.h 2012-01-01 1.3 kB
siginfo.h 2012-01-01 763 Bytes
signal.h 2012-01-01 2.3 kB
smc37c93x.h 2012-01-01 4.0 kB
smp.h 2012-01-01 812 Bytes
snapgear.h 2012-01-01 972 Bytes
socket.h 2012-01-01 1.7 kB
sockios.h 2012-01-01 1.0 kB
sparsemem.h 2012-01-01 733 Bytes
spi.h 2012-01-01 867 Bytes
spinlock.h 2012-01-01 1.2 kB
spinlock_types.h 2012-01-01 1.1 kB
stat.h 2012-01-01 3.2 kB
statfs.h 2012-01-01 760 Bytes
string.h 2012-01-01 690 Bytes
string_32.h 2012-01-01 727 Bytes
string_64.h 2012-01-01 761 Bytes
system.h 2012-01-01 2.7 kB
system_32.h 2012-01-01 2.8 kB
system_64.h 2012-01-01 1.3 kB
atomic-grb.h 2012-01-01 735 Bytes
atomic-irq.h 2012-01-01 735 Bytes
atomic-llsc.h 2012-01-01 737 Bytes
atomic.h 2012-01-01 1.8 kB
auxvec.h 2012-01-01 865 Bytes
bitops-grb.h 2012-01-01 735 Bytes
bitops-irq.h 2012-01-01 735 Bytes
bitops.h 2012-01-01 727 Bytes
bug.h 2012-01-01 1.6 kB
bugs.h 2012-01-01 784 Bytes
byteorder.h 2012-01-01 1.8 kB
cache.h 2012-01-01 724 Bytes
cacheflush.h 2012-01-01 735 Bytes
checksum.h 2012-01-01 692 Bytes
checksum_32.h 2012-01-01 850 Bytes
checksum_64.h 2012-01-01 737 Bytes
clock.h 2012-01-01 1.6 kB
cmpxchg-grb.h 2012-01-01 737 Bytes
cmpxchg-irq.h 2012-01-01 737 Bytes
cpu-features.h 2012-01-01 1.0 kB
cputime.h 2012-01-01 755 Bytes
current.h 2012-01-01 812 Bytes
delay.h 2012-01-01 978 Bytes
device.h 2012-01-01 725 Bytes
div64.h 2012-01-01 698 Bytes
dma-mapping.h 2012-01-01 1.3 kB
dma.h 2012-01-01 720 Bytes
dmabrg.h 2012-01-01 979 Bytes
edosk7705.h 2012-01-01 768 Bytes
elf.h 2012-01-01 2.5 kB
emergency-restart.h 2012-01-01 785 Bytes
errno.h 2012-01-01 757 Bytes
fb.h 2012-01-01 780 Bytes
fcntl.h 2012-01-01 698 Bytes
fixmap.h 2012-01-01 1.4 kB
flat.h 2012-01-01 1.4 kB
fpu.h 2012-01-01 801 Bytes
freq.h 2012-01-01 722 Bytes
futex-irq.h 2012-01-01 758 Bytes
futex.h 2012-01-01 725 Bytes
gpio.h 2012-01-01 723 Bytes
hardirq.h 2012-01-01 904 Bytes
hd64461.h 2012-01-01 8.5 kB
heartbeat.h 2012-01-01 964 Bytes
hp6xx.h 2012-01-01 1.7 kB
hugetlb.h 2012-01-01 750 Bytes
hw_irq.h 2012-01-01 2.9 kB
i2c-sh7760.h 2012-01-01 1.0 kB
ilsel.h 2012-01-01 1.1 kB
io.h 2012-01-01 875 Bytes
io_generic.h 2012-01-01 855 Bytes
io_trapped.h 2012-01-01 1.2 kB
ioctl.h 2012-01-01 698 Bytes
ioctls.h 2012-01-01 3.6 kB
ipcbuf.h 2012-01-01 1.0 kB
irq.h 2012-01-01 1.0 kB
irq_regs.h 2012-01-01 701 Bytes
irqflags.h 2012-01-01 936 Bytes
irqflags_32.h 2012-01-01 737 Bytes
irqflags_64.h 2012-01-01 844 Bytes
kdebug.h 2012-01-01 757 Bytes
kexec.h 2012-01-01 981 Bytes
kgdb.h 2012-01-01 1.1 kB
kmap_types.h 2012-01-01 1.0 kB
lboxre2.h 2012-01-01 916 Bytes
linkage.h 2012-01-01 782 Bytes
local.h 2012-01-01 758 Bytes
machvec.h 2012-01-01 2.3 kB
adc.h 2012-01-01 714 Bytes
addrspace.h 2012-01-01 733 Bytes
Totals: 172 Items   243.5 kB 0
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