blob: 592d8b4e5fb38ea08f26da3bcdf8974eaada6ba1 [file] [log] [blame]
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -07001# this module contains all the defaults used by the generation of cleaned-up headers
2# for the Bionic C library
3#
4
5import time, os, sys
6from utils import *
7
8# the list of supported architectures
9#
10kernel_archs = [ 'arm', 'x86' ]
11
12# the list of include directories that belong to the kernel
13# tree. used when looking for sources...
14#
15kernel_dirs = [ "linux", "asm", "asm-generic", "mtd" ]
16
17# path to the directory containing the original kernel headers
18#
19kernel_original_path = os.path.normpath( find_program_dir() + '/../original' )
20
21# a special value that is used to indicate that a given macro is known to be
22# undefined during optimization
23kCppUndefinedMacro = "<<<undefined>>>"
24
25# this is the set of known macros we want to totally optimize out from the
26# final headers
27kernel_known_macros = {
28 "__KERNEL__": kCppUndefinedMacro,
29 "__KERNEL_STRICT_NAMES":"1",
30 "__CHECKER__": kCppUndefinedMacro,
31 "__CHECK_ENDIAN__": kCppUndefinedMacro,
32 }
33
34# define to true if you want to remove all defined(CONFIG_FOO) tests
35# from the clean headers. testing shows that this is not strictly necessary
36# but just generates cleaner results
37kernel_remove_config_macros = True
38
39# this is the set of known static inline functions that we want to keep
40# in the final ARM headers. this is only used to keep optimized byteswapping
41# static functions and stuff like that.
42kernel_known_arm_statics = set(
43 [ "___arch__swab32", # asm-arm/byteorder.h
44 ]
45 )
46
47kernel_known_x86_statics = set(
48 [ "___arch__swab32", # asm-x86/byteorder.h
49 "___arch__swab64", # asm-x86/byteorder.h
50 ]
51 )
52
53kernel_known_generic_statics = set(
54 [ "__invalid_size_argument_for_IOC", # asm-generic/ioctl.h
55 "__cmsg_nxthdr", # linux/socket.h
56 "cmsg_nxthdr", # linux/socket.h
57 "ipt_get_target",
58 ]
59 )
60
61# this maps an architecture to the set of static inline functions that
62# we want to keep in the final headers
63#
64kernel_known_statics = {
65 "arm" : kernel_known_arm_statics,
66 "x86" : kernel_known_x86_statics
67 }
68
69# this is the standard disclaimer
70#
71kernel_disclaimer = """\
72/****************************************************************************
73 ****************************************************************************
74 ***
75 *** This header was automatically generated from a Linux kernel header
76 *** of the same name, to make information necessary for userspace to
77 *** call into the kernel available to libc. It contains only constants,
78 *** structures, and macros generated from the original header, and thus,
79 *** contains no copyrightable information.
80 ***
81 ****************************************************************************
82 ****************************************************************************/
83"""