Compare commits
338 Commits
ics-plus-a
...
android-4.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e13338429f | ||
![]() |
40e7ed58d7 | ||
![]() |
77093f2a8b | ||
![]() |
4d0128f13a | ||
![]() |
ec2ab73b87 | ||
![]() |
ff7eae7b08 | ||
![]() |
b7630f018a | ||
![]() |
db2e7a4cb6 | ||
![]() |
e1dd3c287b | ||
![]() |
e1d591540e | ||
![]() |
7d2e24eb16 | ||
![]() |
03539a36b6 | ||
![]() |
2481468f22 | ||
![]() |
c84ff11dad | ||
![]() |
b23f193dcc | ||
![]() |
4dc3a7e1ed | ||
![]() |
08e72d0161 | ||
![]() |
e2390bff2e | ||
![]() |
08b51e2c09 | ||
![]() |
e0f1fca46c | ||
![]() |
efcf8893a9 | ||
![]() |
b091dd9bf2 | ||
![]() |
ed87404c44 | ||
![]() |
22d80c0b35 | ||
![]() |
94179a509e | ||
![]() |
5fb8130be9 | ||
![]() |
baeacba04d | ||
![]() |
6b99103c31 | ||
![]() |
91b76aa298 | ||
![]() |
4a9d6e50bb | ||
![]() |
bfb300152c | ||
![]() |
762a4fe2ee | ||
![]() |
f848321c4f | ||
![]() |
8ecb4770a0 | ||
![]() |
8266cf94d3 | ||
![]() |
35d592cc5a | ||
![]() |
ef9876569a | ||
![]() |
6b8fd05414 | ||
![]() |
ff219e57c0 | ||
![]() |
b5e8d57664 | ||
![]() |
307d1c982d | ||
![]() |
cebc8fb086 | ||
![]() |
a401160cee | ||
![]() |
f0ec06ba60 | ||
![]() |
e54cc75f59 | ||
![]() |
8565e21f4d | ||
![]() |
0613dce0a7 | ||
![]() |
1a78fbb5c8 | ||
![]() |
d5099016f7 | ||
![]() |
f0a9d98a39 | ||
![]() |
470835b215 | ||
![]() |
85611165ab | ||
![]() |
03273f8fc0 | ||
![]() |
ad7ff82771 | ||
![]() |
7f03d2356f | ||
![]() |
92cf47c006 | ||
![]() |
cd15bacf33 | ||
![]() |
8777e2f54e | ||
![]() |
61ff83475c | ||
![]() |
d09f5a2e01 | ||
![]() |
66929e845d | ||
![]() |
0fdc190cc0 | ||
![]() |
07a387e196 | ||
![]() |
048822d6af | ||
![]() |
17ed54ddcf | ||
![]() |
199213bba9 | ||
![]() |
8c4f3ce8d0 | ||
![]() |
3a7ea52f17 | ||
![]() |
8aeaa478df | ||
![]() |
485fc9f4ef | ||
![]() |
1302f6936b | ||
![]() |
fdb119297a | ||
![]() |
b955ffa5b3 | ||
![]() |
4e362f230b | ||
![]() |
cd834618c4 | ||
![]() |
ddb2f13549 | ||
![]() |
30c8b110f3 | ||
![]() |
8fd682f7f2 | ||
![]() |
ea76f41478 | ||
![]() |
32913bf7d9 | ||
![]() |
8149d73652 | ||
![]() |
b52c941ed4 | ||
![]() |
8491327448 | ||
![]() |
faca92f2f1 | ||
![]() |
2ab5bfd43f | ||
![]() |
665a2207af | ||
![]() |
126601dd3f | ||
![]() |
eaae81082c | ||
![]() |
891966d020 | ||
![]() |
1ca0b9d158 | ||
![]() |
16a8fcce9f | ||
![]() |
b8e1e9685e | ||
![]() |
2f33c5a8e4 | ||
![]() |
f082444291 | ||
![]() |
d1860ad8dd | ||
![]() |
e80f799d89 | ||
![]() |
a677907ee8 | ||
![]() |
9f7df549a2 | ||
![]() |
884147c7d0 | ||
![]() |
21eab513e7 | ||
![]() |
aac0dc97a9 | ||
![]() |
0814eea3ec | ||
![]() |
d73b5cafa0 | ||
![]() |
6e9e53d15f | ||
![]() |
6625986f3a | ||
![]() |
ad812ef2a4 | ||
![]() |
9bcaf0ea6d | ||
![]() |
adb6989786 | ||
![]() |
1a823691a2 | ||
![]() |
06823da2f0 | ||
![]() |
76d56cf4a9 | ||
![]() |
be741d4728 | ||
![]() |
26b666b35e | ||
![]() |
c59ba4595b | ||
![]() |
ca9a0712b8 | ||
![]() |
56ae6bdaa1 | ||
![]() |
654325de02 | ||
![]() |
db6d20be77 | ||
![]() |
36c8c1039f | ||
![]() |
4b29af0a1b | ||
![]() |
06e1831f19 | ||
![]() |
27a5923b24 | ||
![]() |
e5cf8166dc | ||
![]() |
3df3e672f5 | ||
![]() |
94a85f6636 | ||
![]() |
151fac68c3 | ||
![]() |
d027ffdd7a | ||
![]() |
9ec0f03a0d | ||
![]() |
fa3f72ee53 | ||
![]() |
4597687335 | ||
![]() |
be101bf39a | ||
![]() |
fa944c190c | ||
![]() |
1fe109ecf3 | ||
![]() |
93cb308137 | ||
![]() |
079989259f | ||
![]() |
6d074bb71a | ||
![]() |
da16ad11fe | ||
![]() |
a2b1bbc9a6 | ||
![]() |
3690bcb217 | ||
![]() |
4053f8530d | ||
![]() |
446a772bc4 | ||
![]() |
73c88b70b2 | ||
![]() |
cff86bdc02 | ||
![]() |
568ee0d135 | ||
![]() |
dc755140c1 | ||
![]() |
86addd65ab | ||
![]() |
67e7a93844 | ||
![]() |
4fc1273459 | ||
![]() |
16310b5582 | ||
![]() |
d638a500e9 | ||
![]() |
ec37237d69 | ||
![]() |
a1d3e0d8eb | ||
![]() |
2e236c132f | ||
![]() |
fcf16907c7 | ||
![]() |
93b8f941f2 | ||
![]() |
906dbea2b4 | ||
![]() |
83c366cf09 | ||
![]() |
1fb6662d1a | ||
![]() |
7dbbfac0fc | ||
![]() |
5d8fd2a0bc | ||
![]() |
76ab561b4d | ||
![]() |
f1a17e762b | ||
![]() |
49a05c060a | ||
![]() |
58b2c1616b | ||
![]() |
f351ae488b | ||
![]() |
d6b58b03b8 | ||
![]() |
09049311a2 | ||
![]() |
8f627eec55 | ||
![]() |
32c226d6ed | ||
![]() |
058d6d88b9 | ||
![]() |
f39a3fe67d | ||
![]() |
bec678c5a7 | ||
![]() |
1625c7a837 | ||
![]() |
a7bd1bf276 | ||
![]() |
9db064a0d3 | ||
![]() |
5d7181a71c | ||
![]() |
0245c426ee | ||
![]() |
09d695d782 | ||
![]() |
25b7a16a6e | ||
![]() |
44eae4c7af | ||
![]() |
a43debbc43 | ||
![]() |
b118b9c5cd | ||
![]() |
a7ad339910 | ||
![]() |
3350468499 | ||
![]() |
f5d1693e3c | ||
![]() |
a0b800aba9 | ||
![]() |
e1414aa96b | ||
![]() |
632c07c092 | ||
![]() |
514126b2b5 | ||
![]() |
1fc51769de | ||
![]() |
056daf6a1c | ||
![]() |
52764f5546 | ||
![]() |
8584a922dc | ||
![]() |
7cad7230ff | ||
![]() |
b70659d8ea | ||
![]() |
b57db7581c | ||
![]() |
70f0e9d86d | ||
![]() |
f20d59e691 | ||
![]() |
c3650d6a4b | ||
![]() |
73fa5fdaf9 | ||
![]() |
d8545e2690 | ||
![]() |
4a1f3cb4eb | ||
![]() |
3452e301ec | ||
![]() |
cd24e61e57 | ||
![]() |
79fcc6948d | ||
![]() |
de3c594723 | ||
![]() |
df49ebabfe | ||
![]() |
45af9ba7c4 | ||
![]() |
5f926c2679 | ||
![]() |
ea29cd5a4a | ||
![]() |
d6045cba4e | ||
![]() |
fc5ea79c5e | ||
![]() |
023e5409df | ||
![]() |
b6f40f0027 | ||
![]() |
e4cb70aef3 | ||
![]() |
09670ec2d1 | ||
![]() |
697011d3c4 | ||
![]() |
c61f990566 | ||
![]() |
208898ee77 | ||
![]() |
11f3d5a431 | ||
![]() |
e4ade69654 | ||
![]() |
a70e3eb15c | ||
![]() |
348eea2dbe | ||
![]() |
5977ee02f6 | ||
![]() |
e83c56dfbb | ||
![]() |
13585da4b4 | ||
![]() |
68d03fdbd8 | ||
![]() |
f40d3e7608 | ||
![]() |
6519c8124e | ||
![]() |
646ca9f1c9 | ||
![]() |
334379dada | ||
![]() |
f920b20654 | ||
![]() |
5936e36f6b | ||
![]() |
fbc3abcbfc | ||
![]() |
85aad90956 | ||
![]() |
a5cb76bca0 | ||
![]() |
3ea9368d92 | ||
![]() |
f6aa779383 | ||
![]() |
ddaa771cd5 | ||
![]() |
24aae1b1d4 | ||
![]() |
55b9099976 | ||
![]() |
e2bb45a7c0 | ||
![]() |
cb4d9c0e1d | ||
![]() |
e2cb764778 | ||
![]() |
61f90d1898 | ||
![]() |
7c0c379372 | ||
![]() |
b7590d784f | ||
![]() |
cb9e9ccb2b | ||
![]() |
d6da8336b8 | ||
![]() |
022d303116 | ||
![]() |
6c6de44f04 | ||
![]() |
6855359e57 | ||
![]() |
6e9d51701e | ||
![]() |
c5819d427d | ||
![]() |
04c3d4d709 | ||
![]() |
6d77a81456 | ||
![]() |
aed4a4c90b | ||
![]() |
253b763160 | ||
![]() |
5e7783097a | ||
![]() |
bec5dec947 | ||
![]() |
338a06f4bc | ||
![]() |
0e0bd58631 | ||
![]() |
d999c93401 | ||
![]() |
e796d39d80 | ||
![]() |
495f16cbac | ||
![]() |
86ad80b6be | ||
![]() |
f1a39dce60 | ||
![]() |
ca6fe7bebe | ||
![]() |
de44d0b2bd | ||
![]() |
95a17848d3 | ||
![]() |
10c8ce59a4 | ||
![]() |
f638339d09 | ||
![]() |
5f64df4bc3 | ||
![]() |
71b9eedbea | ||
![]() |
7e2daefe6c | ||
![]() |
0fec6b9d88 | ||
![]() |
b385229837 | ||
![]() |
90c4c1e82b | ||
![]() |
e31bfae2ba | ||
![]() |
a938409c0e | ||
![]() |
fd7d5acdeb | ||
![]() |
87426ed37a | ||
![]() |
8180b08fb2 | ||
![]() |
2f3309c9e3 | ||
![]() |
9831ad3ce6 | ||
![]() |
4b469eae40 | ||
![]() |
9bf330b567 | ||
![]() |
468319ce4f | ||
![]() |
0aa8289c6f | ||
![]() |
16e818f90b | ||
![]() |
7939908c83 | ||
![]() |
8e8a7b1f0f | ||
![]() |
994e9a5ed1 | ||
![]() |
9bf1daaaf9 | ||
![]() |
29992cf978 | ||
![]() |
f3dbdbe269 | ||
![]() |
31f0610798 | ||
![]() |
143970a5b0 | ||
![]() |
125207c307 | ||
![]() |
c8be370b34 | ||
![]() |
98873f6540 | ||
![]() |
a5c0d72bfb | ||
![]() |
bcb2edac65 | ||
![]() |
9ab38c67eb | ||
![]() |
d9ad62343c | ||
![]() |
c66f220c44 | ||
![]() |
f5c6dc8b7c | ||
![]() |
b7001bce52 | ||
![]() |
74cf48f0c1 | ||
![]() |
b99c197b27 | ||
![]() |
451159035a | ||
![]() |
3abc9d98c9 | ||
![]() |
3ec1bd2c7a | ||
![]() |
26bee12899 | ||
![]() |
370bbc5dea | ||
![]() |
d0e629a68e | ||
![]() |
268bec521c | ||
![]() |
fa6128ad17 | ||
![]() |
2d461c7c00 | ||
![]() |
b0d9c83041 | ||
![]() |
a0223a888f | ||
![]() |
3b242f82b5 | ||
![]() |
999f7711cd | ||
![]() |
7a796df91d | ||
![]() |
39ac5c2714 | ||
![]() |
19726f59d7 | ||
![]() |
d3f2d49f3a | ||
![]() |
68990d19e4 | ||
![]() |
9ac3e4377f | ||
![]() |
af60b29097 | ||
![]() |
fadfe40155 | ||
![]() |
dda5d14a6b | ||
![]() |
2abf4606f9 | ||
![]() |
a11bb504ec | ||
![]() |
d34ff3cb96 | ||
![]() |
a4f633ff2a | ||
![]() |
c8b9ba7d41 | ||
![]() |
88f6fa70d7 |
@@ -281,8 +281,12 @@ libc_common_src_files := \
|
||||
bionic/ssp.c \
|
||||
bionic/stubs.c \
|
||||
bionic/system_properties.c \
|
||||
bionic/tdelete.c \
|
||||
bionic/tdestroy.c \
|
||||
bionic/time64.c \
|
||||
bionic/tfind.c \
|
||||
bionic/thread_atexit.c \
|
||||
bionic/tsearch.c \
|
||||
bionic/utime.c \
|
||||
bionic/utmp.c \
|
||||
netbsd/gethnamaddr.c \
|
||||
@@ -346,13 +350,16 @@ libc_common_src_files += \
|
||||
arch-arm/bionic/__get_sp.S \
|
||||
arch-arm/bionic/_exit_with_stack_teardown.S \
|
||||
arch-arm/bionic/_setjmp.S \
|
||||
arch-arm/bionic/atomics_arm.S \
|
||||
arch-arm/bionic/abort_arm.S \
|
||||
arch-arm/bionic/atomics_arm.c \
|
||||
arch-arm/bionic/clone.S \
|
||||
arch-arm/bionic/eabi.c \
|
||||
arch-arm/bionic/ffs.S \
|
||||
arch-arm/bionic/futex_arm.S \
|
||||
arch-arm/bionic/kill.S \
|
||||
arch-arm/bionic/libgcc_compat.c \
|
||||
arch-arm/bionic/tkill.S \
|
||||
arch-arm/bionic/tgkill.S \
|
||||
arch-arm/bionic/memcmp.S \
|
||||
arch-arm/bionic/memcmp16.S \
|
||||
arch-arm/bionic/memcpy.S \
|
||||
@@ -394,9 +401,9 @@ libc_common_src_files += \
|
||||
arch-x86/bionic/__get_sp.S \
|
||||
arch-x86/bionic/__get_tls.c \
|
||||
arch-x86/bionic/__set_tls.c \
|
||||
arch-x86/bionic/atomics_x86.S \
|
||||
arch-x86/bionic/clone.S \
|
||||
arch-x86/bionic/_exit_with_stack_teardown.S \
|
||||
arch-x86/bionic/futex_x86.S \
|
||||
arch-x86/bionic/setjmp.S \
|
||||
arch-x86/bionic/_setjmp.S \
|
||||
arch-x86/bionic/sigsetjmp.S \
|
||||
@@ -471,10 +478,18 @@ ifeq ($(TARGET_ARCH),arm)
|
||||
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
||||
libc_common_cflags += -DHAVE_ARM_TLS_REGISTER
|
||||
endif
|
||||
ifeq ($(ARCH_ARM_USE_NON_NEON_MEMCPY),true)
|
||||
libc_common_cflags += -DARCH_ARM_USE_NON_NEON_MEMCPY
|
||||
endif
|
||||
else # !arm
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
libc_crt_target_cflags :=
|
||||
# TARGET_GLOBAL_CFLAGS from build/core/combo/TARGET_linux-x86.mk sets all required flags.
|
||||
ifeq ($(ARCH_X86_HAVE_SSE2),true)
|
||||
libc_crt_target_cflags += -DUSE_SSE2=1
|
||||
endif
|
||||
ifeq ($(ARCH_X86_HAVE_SSSE3),true)
|
||||
libc_crt_target_cflags += -DUSE_SSSE3=1
|
||||
endif
|
||||
endif # x86
|
||||
endif # !arm
|
||||
|
||||
@@ -503,8 +518,9 @@ libc_common_c_includes := \
|
||||
|
||||
# Needed to access private/__dso_handle.S from
|
||||
# crtbegin_xxx.S and crtend_xxx.S
|
||||
# and machine/asm.h
|
||||
#
|
||||
libc_crt_target_cflags += -I$(LOCAL_PATH)/private
|
||||
libc_crt_target_cflags += -I$(LOCAL_PATH)/private -I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include
|
||||
|
||||
# Define the libc run-time (crt) support object files that must be built,
|
||||
# which are needed to build all other objects (shared/static libs and
|
||||
@@ -640,7 +656,19 @@ include $(BUILD_STATIC_LIBRARY)
|
||||
# ========================================================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_CFLAGS := $(libc_common_cflags)
|
||||
# pthread deadlock prediction:
|
||||
# set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for
|
||||
# pthread deadlock prediction.
|
||||
# Since this code is experimental it is disabled by default.
|
||||
# see libc/bionic/pthread_debug.c for details
|
||||
|
||||
LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0
|
||||
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
# TODO: At some point, we need to remove this custom linker script.
|
||||
LOCAL_LDFLAGS := -Wl,-T,$(BUILD_SYSTEM)/armelf.xsc
|
||||
endif
|
||||
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
@@ -648,6 +676,7 @@ LOCAL_SRC_FILES := \
|
||||
$(libc_static_common_src_files) \
|
||||
bionic/dlmalloc.c \
|
||||
bionic/malloc_debug_common.c \
|
||||
bionic/pthread_debug.c \
|
||||
bionic/libc_init_dynamic.c
|
||||
|
||||
LOCAL_MODULE:= libc
|
||||
@@ -687,7 +716,10 @@ LOCAL_CFLAGS := \
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
bionic/malloc_debug_leak.c
|
||||
bionic/malloc_debug_leak.c \
|
||||
bionic/malloc_debug_check.c \
|
||||
bionic/malloc_debug_check_mapinfo.c \
|
||||
bionic/malloc_debug_stacktrace.c
|
||||
|
||||
LOCAL_MODULE:= libc_malloc_debug_leak
|
||||
|
||||
@@ -718,7 +750,7 @@ LOCAL_SRC_FILES := \
|
||||
|
||||
LOCAL_MODULE:= libc_malloc_debug_qemu
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libc
|
||||
LOCAL_SHARED_LIBRARIES := libc libdl
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
|
||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
|
||||
|
@@ -64,6 +64,7 @@ void* __brk:brk(void*) 45
|
||||
# see comments in arch-arm/bionic/kill.S to understand why we don't generate an ARM stub for kill/tkill
|
||||
int kill(pid_t, int) -1,37
|
||||
int tkill(pid_t tid, int sig) -1,238
|
||||
int tgkill(pid_t tgid, pid_t tid, int sig) -1,270
|
||||
int __ptrace:ptrace(int request, int pid, void* addr, void* data) 26
|
||||
int __set_thread_area:set_thread_area(void* user_desc) -1,243
|
||||
int __getpriority:getpriority(int, int) 96
|
||||
@@ -159,6 +160,7 @@ int rmdir(const char *) 40
|
||||
int rename(const char *, const char *) 38
|
||||
int __getcwd:getcwd(char * buf, size_t size) 183
|
||||
int access(const char *, int) 33
|
||||
int faccessat(int, const char *, int, int) 334,307
|
||||
int symlink(const char *, const char *) 83
|
||||
int fchdir(int) 133
|
||||
int truncate(const char*, off_t) 92
|
||||
@@ -190,7 +192,7 @@ int __timer_gettime:timer_gettime(timer_t, struct itimerspec*)
|
||||
int __timer_getoverrun:timer_getoverrun(timer_t) 260,262
|
||||
int __timer_delete:timer_delete(timer_t) 261,263
|
||||
int utimes(const char*, const struct timeval tvp[2]) 269, 271
|
||||
int utimensat(int, const char *, const struct timespec times[2], int) 348, 320
|
||||
int utimensat(int, const char *, const struct timespec times[2], int) 348, 320, 320
|
||||
|
||||
# signals
|
||||
int sigaction(int, const struct sigaction *, struct sigaction *) 67
|
||||
@@ -229,7 +231,7 @@ int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,
|
||||
int socketpair:socketcall:8(int, int, int, int*) -1,102
|
||||
int sendto:socketcall:11(int, const void *, size_t, int, const struct sockaddr *, socklen_t) -1,102
|
||||
int recvfrom:socketcall:12(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) -1,102
|
||||
int shutdown:socketcall:13(int, int) -1,102
|
||||
int shutdown:socketcall:13(int, int) -1,102,-1
|
||||
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,102
|
||||
int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1,102
|
||||
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102
|
||||
@@ -263,6 +265,7 @@ int delete_module(const char*, unsigned int) 129
|
||||
int klogctl:syslog(int, char *, int) 103
|
||||
int sysinfo(struct sysinfo *) 116
|
||||
int personality(unsigned long) 136
|
||||
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364
|
||||
|
||||
# futex
|
||||
int futex(void *, int, int, void *, void *, int) 240
|
||||
|
42
libc/arch-arm/bionic/abort_arm.S
Normal file
42
libc/arch-arm/bionic/abort_arm.S
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* Coding the abort function in assembly so that registers are guaranteed to
|
||||
* be preserved properly regardless of GCC's assumption on the "noreturn"
|
||||
* attribute. When the registers are not properly preserved we won't be able
|
||||
* to unwind the stack all the way to the bottom to fully reveal the call
|
||||
* sequence when the crash happens.
|
||||
*/
|
||||
ENTRY(abort)
|
||||
.save {r3, r14}
|
||||
stmfd sp!, {r3, r14}
|
||||
blx PIC_SYM(_C_LABEL(__libc_android_abort), PLT)
|
||||
END(abort)
|
@@ -1,236 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <machine/asm.h>
|
||||
#include <machine/cpu-features.h>
|
||||
|
||||
#define FUTEX_WAIT 0
|
||||
#define FUTEX_WAKE 1
|
||||
|
||||
#if defined(__ARM_HAVE_LDREX_STREX)
|
||||
/*
|
||||
* ===========================================================================
|
||||
* ARMv6+ implementation
|
||||
* ===========================================================================
|
||||
*/
|
||||
|
||||
/* r0(addr) -> r0(old) */
|
||||
ENTRY(__atomic_dec)
|
||||
mov r1, r0 @ copy addr so we don't clobber it
|
||||
1: ldrex r0, [r1] @ load current value into r0
|
||||
sub r2, r0, #1 @ generate new value into r2
|
||||
strex r3, r2, [r1] @ try to store new value; result in r3
|
||||
cmp r3, #0 @ success?
|
||||
bxeq lr @ yes, return
|
||||
b 1b @ no, retry
|
||||
END(__atomic_dec)
|
||||
|
||||
/* r0(addr) -> r0(old) */
|
||||
ENTRY(__atomic_inc)
|
||||
mov r1, r0
|
||||
1: ldrex r0, [r1]
|
||||
add r2, r0, #1
|
||||
strex r3, r2, [r1]
|
||||
cmp r3, #0
|
||||
bxeq lr
|
||||
b 1b
|
||||
END(__atomic_inc)
|
||||
|
||||
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
|
||||
ENTRY(__atomic_cmpxchg)
|
||||
1: mov ip, #2 @ ip=2 means "new != old"
|
||||
ldrex r3, [r2] @ load current value into r3
|
||||
teq r0, r3 @ new == old?
|
||||
strexeq ip, r1, [r2] @ yes, try store, set ip to 0 or 1
|
||||
teq ip, #1 @ strex failure?
|
||||
beq 1b @ yes, retry
|
||||
mov r0, ip @ return 0 on success, 2 on failure
|
||||
bx lr
|
||||
END(__atomic_cmpxchg)
|
||||
|
||||
/* r0(new) r1(addr) -> r0(old) */
|
||||
ENTRY(__atomic_swap)
|
||||
1: ldrex r2, [r1]
|
||||
strex r3, r0, [r1]
|
||||
teq r3, #0
|
||||
bne 1b
|
||||
mov r0, r2
|
||||
bx lr
|
||||
END(__atomic_swap)
|
||||
|
||||
#else /*not defined __ARM_HAVE_LDREX_STREX*/
|
||||
/*
|
||||
* ===========================================================================
|
||||
* Pre-ARMv6 implementation
|
||||
* ===========================================================================
|
||||
*/
|
||||
|
||||
/* int __kernel_cmpxchg(int oldval, int newval, int* ptr) */
|
||||
.equ kernel_cmpxchg, 0xFFFF0FC0
|
||||
.equ kernel_atomic_base, 0xFFFF0FFF
|
||||
|
||||
/* r0(addr) -> r0(old) */
|
||||
ENTRY(__atomic_dec)
|
||||
.save {r4, lr}
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r2, r0
|
||||
1: @ atomic_dec
|
||||
ldr r0, [r2]
|
||||
mov r3, #kernel_atomic_base
|
||||
add lr, pc, #4
|
||||
sub r1, r0, #1
|
||||
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
|
||||
bcc 1b
|
||||
add r0, r1, #1
|
||||
ldmia sp!, {r4, lr}
|
||||
bx lr
|
||||
END(__atomic_dec)
|
||||
|
||||
/* r0(addr) -> r0(old) */
|
||||
ENTRY(__atomic_inc)
|
||||
.save {r4, lr}
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r2, r0
|
||||
1: @ atomic_inc
|
||||
ldr r0, [r2]
|
||||
mov r3, #kernel_atomic_base
|
||||
add lr, pc, #4
|
||||
add r1, r0, #1
|
||||
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
|
||||
bcc 1b
|
||||
sub r0, r1, #1
|
||||
ldmia sp!, {r4, lr}
|
||||
bx lr
|
||||
END(__atomic_inc)
|
||||
|
||||
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
|
||||
ENTRY(__atomic_cmpxchg)
|
||||
.save {r4, lr}
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0 /* r4 = save oldvalue */
|
||||
1: @ atomic_cmpxchg
|
||||
mov r3, #kernel_atomic_base
|
||||
add lr, pc, #4
|
||||
mov r0, r4 /* r0 = oldvalue */
|
||||
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
|
||||
bcs 2f /* swap was made. we're good, return. */
|
||||
ldr r3, [r2] /* swap not made, see if it's because *ptr!=oldvalue */
|
||||
cmp r3, r4
|
||||
beq 1b
|
||||
2: @ atomic_cmpxchg
|
||||
ldmia sp!, {r4, lr}
|
||||
bx lr
|
||||
END(__atomic_cmpxchg)
|
||||
|
||||
/* r0(new) r1(addr) -> r0(old) */
|
||||
ENTRY(__atomic_swap)
|
||||
swp r0, r0, [r1]
|
||||
bx lr
|
||||
END(__atomic_swap)
|
||||
|
||||
#endif /*not defined __ARM_HAVE_LDREX_STREX*/
|
||||
|
||||
|
||||
/* __futex_wait(*ftx, val, *timespec) */
|
||||
/* __futex_wake(*ftx, counter) */
|
||||
/* __futex_syscall3(*ftx, op, val) */
|
||||
/* __futex_syscall4(*ftx, op, val, *timespec) */
|
||||
|
||||
.global __futex_wait
|
||||
.type __futex_wait, %function
|
||||
|
||||
.global __futex_wake
|
||||
.type __futex_wake, %function
|
||||
|
||||
.global __futex_syscall3
|
||||
.type __futex_syscall3, %function
|
||||
|
||||
.global __futex_syscall4
|
||||
.type __futex_syscall4, %function
|
||||
|
||||
#if __ARM_EABI__
|
||||
|
||||
ENTRY(__futex_syscall3)
|
||||
stmdb sp!, {r4, r7}
|
||||
.save {r4, r7}
|
||||
ldr r7, =__NR_futex
|
||||
swi #0
|
||||
ldmia sp!, {r4, r7}
|
||||
bx lr
|
||||
END(__futex_syscall3)
|
||||
|
||||
ENTRY(__futex_wait)
|
||||
stmdb sp!, {r4, r7}
|
||||
.save {r4, r7}
|
||||
mov r3, r2
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAIT
|
||||
ldr r7, =__NR_futex
|
||||
swi #0
|
||||
ldmia sp!, {r4, r7}
|
||||
bx lr
|
||||
END(__futex_wait)
|
||||
|
||||
ENTRY(__futex_wake)
|
||||
.save {r4, r7}
|
||||
stmdb sp!, {r4, r7}
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAKE
|
||||
ldr r7, =__NR_futex
|
||||
swi #0
|
||||
ldmia sp!, {r4, r7}
|
||||
bx lr
|
||||
END(__futex_wake)
|
||||
|
||||
#else
|
||||
|
||||
ENTRY(__futex_syscall3)
|
||||
swi #__NR_futex
|
||||
bx lr
|
||||
END(__futex_syscall3)
|
||||
|
||||
ENTRY(__futex_wait)
|
||||
mov r3, r2
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAIT
|
||||
swi #__NR_futex
|
||||
bx lr
|
||||
END(__futex_wait)
|
||||
|
||||
ENTRY(__futex_wake)
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAKE
|
||||
swi #__NR_futex
|
||||
bx lr
|
||||
END(__futex_wake)
|
||||
|
||||
#endif
|
||||
|
||||
ENTRY(__futex_syscall4)
|
||||
b __futex_syscall3
|
||||
END(__futex_syscall4)
|
87
libc/arch-arm/bionic/atomics_arm.c
Normal file
87
libc/arch-arm/bionic/atomics_arm.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
/* The purpose of this file is to export a small set of atomic-related
|
||||
* functions from the C library, to ensure binary ABI compatibility for
|
||||
* the NDK.
|
||||
*
|
||||
* These functions were initially exposed by the NDK through <sys/atomics.h>,
|
||||
* which was unfortunate because their implementation didn't provide any
|
||||
* memory barriers at all.
|
||||
*
|
||||
* This wasn't a problem for the platform code that used them, because it
|
||||
* used explicit barrier instructions around them. On the other hand, it means
|
||||
* that any NDK-generated machine code that linked against them would not
|
||||
* perform correctly when running on multi-core devices.
|
||||
*
|
||||
* To fix this, the platform code was first modified to not use any of these
|
||||
* functions (everything is now inlined through assembly statements, see
|
||||
* libc/private/bionic_arm_inline.h and the headers it includes.
|
||||
*
|
||||
* The functions here are thus only for the benefit of NDK applications,
|
||||
* and now includes full memory barriers to prevent any random memory ordering
|
||||
* issue from cropping.
|
||||
*
|
||||
* Note that we also provide an updated <sys/atomics.h> header that defines
|
||||
* always_inlined versions of the functions that use the GCC builtin
|
||||
* intrinsics to perform the same thing.
|
||||
*
|
||||
* NOTE: There is no need for a similar file for non-ARM platforms.
|
||||
*/
|
||||
|
||||
/* DO NOT INCLUDE <sys/atomics.h> HERE ! */
|
||||
|
||||
int
|
||||
__atomic_cmpxchg(int old, int _new, volatile int *ptr)
|
||||
{
|
||||
/* We must return 0 on success */
|
||||
return __sync_val_compare_and_swap(ptr, old, _new) != old;
|
||||
}
|
||||
|
||||
int
|
||||
__atomic_swap(int _new, volatile int *ptr)
|
||||
{
|
||||
int prev;
|
||||
do {
|
||||
prev = *ptr;
|
||||
} while (__sync_val_compare_and_swap(ptr, prev, _new) != prev);
|
||||
return prev;
|
||||
}
|
||||
|
||||
int
|
||||
__atomic_dec(volatile int *ptr)
|
||||
{
|
||||
return __sync_fetch_and_sub (ptr, 1);
|
||||
}
|
||||
|
||||
int
|
||||
__atomic_inc(volatile int *ptr)
|
||||
{
|
||||
return __sync_fetch_and_add (ptr, 1);
|
||||
}
|
@@ -43,21 +43,19 @@
|
||||
# - address of an "onexit" function, not used on any
|
||||
# platform supported by Bionic
|
||||
#
|
||||
# - address of the "main" function of the program. We
|
||||
# can't hard-code it in the adr pseudo instruction
|
||||
# so we use a tiny trampoline that will get relocated
|
||||
# by the dynamic linker before this code runs
|
||||
# - address of the "main" function of the program.
|
||||
#
|
||||
# - address of the constructor list
|
||||
#
|
||||
_start:
|
||||
mov r0, sp
|
||||
mov r1, #0
|
||||
adr r2, 0f
|
||||
adr r3, 1f
|
||||
b __libc_init
|
||||
|
||||
0: b main
|
||||
ldr r2, =main
|
||||
adr r3, 1f
|
||||
ldr r4, =__libc_init
|
||||
blx r4
|
||||
mov r0, #0
|
||||
bx r0
|
||||
|
||||
1: .long __PREINIT_ARRAY__
|
||||
.long __INIT_ARRAY__
|
||||
|
@@ -26,6 +26,8 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
# Implement static C++ destructors when the shared
|
||||
# library is unloaded through dlclose().
|
||||
#
|
||||
@@ -33,10 +35,11 @@
|
||||
# in the .fini_array. See 3.3.5.3.C of C++ ABI
|
||||
# standard.
|
||||
#
|
||||
__on_dlclose:
|
||||
ENTRY(__on_dlclose)
|
||||
adr r0, 0f
|
||||
ldr r0, [r0]
|
||||
b __cxa_finalize
|
||||
END(__on_dlclose)
|
||||
|
||||
0:
|
||||
.long __dso_handle
|
||||
|
@@ -43,21 +43,19 @@
|
||||
# - address of an "onexit" function, not used on any
|
||||
# platform supported by Bionic
|
||||
#
|
||||
# - address of the "main" function of the program. We
|
||||
# can't hard-code it in the adr pseudo instruction
|
||||
# so we use a tiny trampoline that will get relocated
|
||||
# by the dynamic linker before this code runs
|
||||
# - address of the "main" function of the program.
|
||||
#
|
||||
# - address of the constructor list
|
||||
#
|
||||
_start:
|
||||
mov r0, sp
|
||||
mov r1, #0
|
||||
adr r2, 0f
|
||||
adr r3, 1f
|
||||
b __libc_init
|
||||
|
||||
0: b main
|
||||
ldr r2, =main
|
||||
adr r3, 1f
|
||||
ldr r4, =__libc_init
|
||||
blx r4
|
||||
mov r0, #0
|
||||
bx r0
|
||||
|
||||
1: .long __PREINIT_ARRAY__
|
||||
.long __INIT_ARRAY__
|
||||
|
112
libc/arch-arm/bionic/futex_arm.S
Normal file
112
libc/arch-arm/bionic/futex_arm.S
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <machine/asm.h>
|
||||
#include <machine/cpu-features.h>
|
||||
|
||||
#define FUTEX_WAIT 0
|
||||
#define FUTEX_WAKE 1
|
||||
|
||||
/* __futex_wait(*ftx, val, *timespec) */
|
||||
/* __futex_wake(*ftx, counter) */
|
||||
/* __futex_syscall3(*ftx, op, val) */
|
||||
/* __futex_syscall4(*ftx, op, val, *timespec) */
|
||||
|
||||
.global __futex_wait
|
||||
.type __futex_wait, %function
|
||||
|
||||
.global __futex_wake
|
||||
.type __futex_wake, %function
|
||||
|
||||
.global __futex_syscall3
|
||||
.type __futex_syscall3, %function
|
||||
|
||||
.global __futex_syscall4
|
||||
.type __futex_syscall4, %function
|
||||
|
||||
#if __ARM_EABI__
|
||||
|
||||
ENTRY(__futex_syscall3)
|
||||
stmdb sp!, {r4, r7}
|
||||
.save {r4, r7}
|
||||
ldr r7, =__NR_futex
|
||||
swi #0
|
||||
ldmia sp!, {r4, r7}
|
||||
bx lr
|
||||
END(__futex_syscall3)
|
||||
|
||||
ENTRY(__futex_wait)
|
||||
stmdb sp!, {r4, r7}
|
||||
.save {r4, r7}
|
||||
mov r3, r2
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAIT
|
||||
ldr r7, =__NR_futex
|
||||
swi #0
|
||||
ldmia sp!, {r4, r7}
|
||||
bx lr
|
||||
END(__futex_wait)
|
||||
|
||||
ENTRY(__futex_wake)
|
||||
.save {r4, r7}
|
||||
stmdb sp!, {r4, r7}
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAKE
|
||||
ldr r7, =__NR_futex
|
||||
swi #0
|
||||
ldmia sp!, {r4, r7}
|
||||
bx lr
|
||||
END(__futex_wake)
|
||||
|
||||
#else
|
||||
|
||||
ENTRY(__futex_syscall3)
|
||||
swi #__NR_futex
|
||||
bx lr
|
||||
END(__futex_syscall3)
|
||||
|
||||
ENTRY(__futex_wait)
|
||||
mov r3, r2
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAIT
|
||||
swi #__NR_futex
|
||||
bx lr
|
||||
END(__futex_wait)
|
||||
|
||||
ENTRY(__futex_wake)
|
||||
mov r2, r1
|
||||
mov r1, #FUTEX_WAKE
|
||||
swi #__NR_futex
|
||||
bx lr
|
||||
END(__futex_wake)
|
||||
|
||||
#endif
|
||||
|
||||
ENTRY(__futex_syscall4)
|
||||
b __futex_syscall3
|
||||
END(__futex_syscall4)
|
@@ -66,7 +66,7 @@
|
||||
* any native shared library generated with it should now be safe from that
|
||||
* problem. On the other hand, existing shared libraries distributed with
|
||||
* applications that were generated with a previous version of the NDK
|
||||
* still need all 1.5/1.6 helper functions in libc.so and libn.so
|
||||
* still need all 1.5/1.6 helper functions in libc.so and libm.so
|
||||
*
|
||||
* After 3.2, the toolchain was updated again, adding __aeabi_f2uiz to the
|
||||
* list of requirements. Technically, this is due to mis-linked NDK libraries
|
||||
@@ -113,6 +113,8 @@
|
||||
XX(__aeabi_l2d) \
|
||||
XX(__aeabi_l2f) \
|
||||
XX(__aeabi_lmul) \
|
||||
XX(__aeabi_llsl) \
|
||||
XX(__aeabi_llsr) \
|
||||
XX(__aeabi_ui2d) \
|
||||
XX(__aeabi_ui2f) \
|
||||
XX(__aeabi_ul2d) \
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#if defined(__ARM_NEON__)
|
||||
#if defined(__ARM_NEON__) && !defined(ARCH_ARM_USE_NON_NEON_MEMCPY)
|
||||
|
||||
.text
|
||||
.fpu neon
|
||||
|
@@ -25,71 +25,27 @@
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/atomics.h>
|
||||
/* unlike our auto-generated syscall stubs, this code saves lr
|
||||
on the stack, as well as a few other registers. this makes
|
||||
our stack unwinder happy, when we generate debug stack
|
||||
traces after the C library or other parts of the system
|
||||
abort due to a fatal runtime error (e.g. detection
|
||||
of a corrupted malloc heap).
|
||||
*/
|
||||
|
||||
#define FUTEX_SYSCALL 240
|
||||
#define FUTEX_WAIT 0
|
||||
#define FUTEX_WAKE 1
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
int __futex_wait(volatile void *ftx, int val)
|
||||
{
|
||||
int ret;
|
||||
asm volatile (
|
||||
"int $0x80;"
|
||||
: "=a" (ret)
|
||||
: "0" (FUTEX_SYSCALL),
|
||||
"b" (ftx),
|
||||
"c" (FUTEX_WAIT),
|
||||
"d" (val),
|
||||
"S" (0)
|
||||
);
|
||||
return ret;
|
||||
}
|
||||
#ifndef __NR_tgkill
|
||||
#define __NR_tgkill 268
|
||||
#endif
|
||||
|
||||
int __futex_wake(volatile void *ftx, int count)
|
||||
{
|
||||
int ret;
|
||||
asm volatile (
|
||||
"int $0x80;"
|
||||
: "=a" (ret)
|
||||
: "0" (FUTEX_SYSCALL),
|
||||
"b" (ftx),
|
||||
"c" (FUTEX_WAKE),
|
||||
"d" (count)
|
||||
);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int __atomic_cmpxchg(int old, int new, volatile int* addr) {
|
||||
int xchg;
|
||||
asm volatile (
|
||||
"lock;"
|
||||
"cmpxchg %%ecx, (%%edx);"
|
||||
"setne %%al;"
|
||||
: "=a" (xchg)
|
||||
: "a" (old),
|
||||
"c" (new),
|
||||
"d" (addr)
|
||||
);
|
||||
return xchg;
|
||||
}
|
||||
|
||||
int __atomic_swap(int new, volatile int* addr) {
|
||||
int old;
|
||||
asm volatile (
|
||||
"lock;"
|
||||
"xchg %%ecx, (%%edx);"
|
||||
: "=c" (old)
|
||||
: "c" (new),
|
||||
"d" (addr)
|
||||
);
|
||||
return old;
|
||||
}
|
||||
|
||||
int __atomic_dec(volatile int* addr) {
|
||||
int old;
|
||||
do {
|
||||
old = *addr;
|
||||
} while (atomic_cmpxchg(old, old-1, addr));
|
||||
return old;
|
||||
}
|
||||
ENTRY(tgkill)
|
||||
stmfd sp!, {r4-r7, ip, lr}
|
||||
ldr r7, =__NR_tgkill
|
||||
swi #0
|
||||
ldmfd sp!, {r4-r7, ip, lr}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
END(tgkill)
|
@@ -108,6 +108,7 @@ syscall_src += arch-arm/syscalls/rmdir.S
|
||||
syscall_src += arch-arm/syscalls/rename.S
|
||||
syscall_src += arch-arm/syscalls/__getcwd.S
|
||||
syscall_src += arch-arm/syscalls/access.S
|
||||
syscall_src += arch-arm/syscalls/faccessat.S
|
||||
syscall_src += arch-arm/syscalls/symlink.S
|
||||
syscall_src += arch-arm/syscalls/fchdir.S
|
||||
syscall_src += arch-arm/syscalls/truncate.S
|
||||
@@ -183,6 +184,7 @@ syscall_src += arch-arm/syscalls/delete_module.S
|
||||
syscall_src += arch-arm/syscalls/klogctl.S
|
||||
syscall_src += arch-arm/syscalls/sysinfo.S
|
||||
syscall_src += arch-arm/syscalls/personality.S
|
||||
syscall_src += arch-arm/syscalls/perf_event_open.S
|
||||
syscall_src += arch-arm/syscalls/futex.S
|
||||
syscall_src += arch-arm/syscalls/epoll_create.S
|
||||
syscall_src += arch-arm/syscalls/epoll_ctl.S
|
||||
|
14
libc/arch-arm/syscalls/faccessat.S
Normal file
14
libc/arch-arm/syscalls/faccessat.S
Normal file
@@ -0,0 +1,14 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(faccessat)
|
||||
.save {r4, r7}
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_faccessat
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
END(faccessat)
|
16
libc/arch-arm/syscalls/perf_event_open.S
Normal file
16
libc/arch-arm/syscalls/perf_event_open.S
Normal file
@@ -0,0 +1,16 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(perf_event_open)
|
||||
mov ip, sp
|
||||
.save {r4, r5, r6, r7}
|
||||
stmfd sp!, {r4, r5, r6, r7}
|
||||
ldmfd ip, {r4, r5, r6}
|
||||
ldr r7, =__NR_perf_event_open
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
END(perf_event_open)
|
32
libc/arch-sh/syscalls/tgkill.S
Normal file
32
libc/arch-sh/syscalls/tgkill.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type tgkill, @function
|
||||
.globl tgkill
|
||||
.align 4
|
||||
|
||||
tgkill:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_tgkill_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_tgkill_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_tgkill
|
||||
1: .long __set_syscall_errno
|
@@ -93,7 +93,7 @@ name: \
|
||||
# define SETRTNVAL movl DEST(%esp), %eax
|
||||
#endif
|
||||
|
||||
#ifdef SHARED
|
||||
#if (defined SHARED || defined __PIC__)
|
||||
# define ENTRANCE PUSH (%ebx);
|
||||
# define RETURN_END POP (%ebx); ret
|
||||
# define RETURN RETURN_END; CFI_PUSH (%ebx)
|
||||
@@ -313,7 +313,7 @@ L(128bytesormore):
|
||||
PUSH (%ebx)
|
||||
mov $SHARED_CACHE_SIZE, %ebx
|
||||
#else
|
||||
# ifdef SHARED
|
||||
# if (defined SHARED || defined __PIC__)
|
||||
call __i686.get_pc_thunk.bx
|
||||
add $_GLOBAL_OFFSET_TABLE_, %ebx
|
||||
mov __x86_shared_cache_size@GOTOFF(%ebx), %ebx
|
||||
@@ -331,7 +331,7 @@ L(128bytesormore):
|
||||
# define RESTORE_EBX_STATE CFI_PUSH (%ebx)
|
||||
cmp $DATA_CACHE_SIZE, %ecx
|
||||
#else
|
||||
# ifdef SHARED
|
||||
# if (defined SHARED || defined __PIC__)
|
||||
# define RESTORE_EBX_STATE
|
||||
call __i686.get_pc_thunk.bx
|
||||
add $_GLOBAL_OFFSET_TABLE_, %ebx
|
||||
@@ -436,7 +436,7 @@ L(128bytesormore_nt):
|
||||
jae L(128bytesormore_nt)
|
||||
sfence
|
||||
L(shared_cache_loop_end):
|
||||
#if defined DATA_CACHE_SIZE || !defined SHARED
|
||||
#if defined DATA_CACHE_SIZE || !(defined SHARED || defined __PIC__)
|
||||
POP (%ebx)
|
||||
#endif
|
||||
BRANCH_TO_JMPTBL_ENTRY (L(table_16_128bytes))
|
||||
|
@@ -104,7 +104,7 @@ name: \
|
||||
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
|
||||
#define POP(REG) popl REG; CFI_POP (REG)
|
||||
|
||||
#ifdef SHARED
|
||||
#if (defined SHARED || defined __PIC__)
|
||||
# define PARMS 8 /* Preserve EBX. */
|
||||
# define ENTRANCE PUSH (%ebx);
|
||||
# define RETURN_END POP (%ebx); ret
|
||||
@@ -216,7 +216,7 @@ L(48bytesormore):
|
||||
#ifdef SHARED_CACHE_SIZE_HALF
|
||||
cmp $SHARED_CACHE_SIZE_HALF, %ecx
|
||||
#else
|
||||
# ifdef SHARED
|
||||
# if (defined SHARED || defined __PIC__)
|
||||
call __i686.get_pc_thunk.bx
|
||||
add $_GLOBAL_OFFSET_TABLE_, %ebx
|
||||
cmp __x86_shared_cache_size_half@GOTOFF(%ebx), %ecx
|
||||
@@ -287,7 +287,7 @@ L(shl_0_gobble):
|
||||
#ifdef DATA_CACHE_SIZE_HALF
|
||||
cmp $DATA_CACHE_SIZE_HALF, %ecx
|
||||
#else
|
||||
# ifdef SHARED
|
||||
# if (defined SHARED || defined __PIC__)
|
||||
call __i686.get_pc_thunk.bx
|
||||
add $_GLOBAL_OFFSET_TABLE_, %ebx
|
||||
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
|
||||
|
@@ -27,6 +27,7 @@ syscall_src += arch-x86/syscalls/setresgid.S
|
||||
syscall_src += arch-x86/syscalls/__brk.S
|
||||
syscall_src += arch-x86/syscalls/kill.S
|
||||
syscall_src += arch-x86/syscalls/tkill.S
|
||||
syscall_src += arch-x86/syscalls/tgkill.S
|
||||
syscall_src += arch-x86/syscalls/__ptrace.S
|
||||
syscall_src += arch-x86/syscalls/__set_thread_area.S
|
||||
syscall_src += arch-x86/syscalls/__getpriority.S
|
||||
@@ -111,6 +112,7 @@ syscall_src += arch-x86/syscalls/rmdir.S
|
||||
syscall_src += arch-x86/syscalls/rename.S
|
||||
syscall_src += arch-x86/syscalls/__getcwd.S
|
||||
syscall_src += arch-x86/syscalls/access.S
|
||||
syscall_src += arch-x86/syscalls/faccessat.S
|
||||
syscall_src += arch-x86/syscalls/symlink.S
|
||||
syscall_src += arch-x86/syscalls/fchdir.S
|
||||
syscall_src += arch-x86/syscalls/truncate.S
|
||||
@@ -186,6 +188,7 @@ syscall_src += arch-x86/syscalls/delete_module.S
|
||||
syscall_src += arch-x86/syscalls/klogctl.S
|
||||
syscall_src += arch-x86/syscalls/sysinfo.S
|
||||
syscall_src += arch-x86/syscalls/personality.S
|
||||
syscall_src += arch-x86/syscalls/perf_event_open.S
|
||||
syscall_src += arch-x86/syscalls/futex.S
|
||||
syscall_src += arch-x86/syscalls/epoll_create.S
|
||||
syscall_src += arch-x86/syscalls/epoll_ctl.S
|
||||
|
32
libc/arch-x86/syscalls/faccessat.S
Normal file
32
libc/arch-x86/syscalls/faccessat.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type faccessat, @function
|
||||
.globl faccessat
|
||||
.align 4
|
||||
|
||||
faccessat:
|
||||
pushl %ebx
|
||||
pushl %ecx
|
||||
pushl %edx
|
||||
pushl %esi
|
||||
mov 20(%esp), %ebx
|
||||
mov 24(%esp), %ecx
|
||||
mov 28(%esp), %edx
|
||||
mov 32(%esp), %esi
|
||||
movl $__NR_faccessat, %eax
|
||||
int $0x80
|
||||
cmpl $-129, %eax
|
||||
jb 1f
|
||||
negl %eax
|
||||
pushl %eax
|
||||
call __set_errno
|
||||
addl $4, %esp
|
||||
orl $-1, %eax
|
||||
1:
|
||||
popl %esi
|
||||
popl %edx
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
35
libc/arch-x86/syscalls/perf_event_open.S
Normal file
35
libc/arch-x86/syscalls/perf_event_open.S
Normal file
@@ -0,0 +1,35 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type perf_event_open, @function
|
||||
.globl perf_event_open
|
||||
.align 4
|
||||
|
||||
perf_event_open:
|
||||
pushl %ebx
|
||||
pushl %ecx
|
||||
pushl %edx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
mov 24(%esp), %ebx
|
||||
mov 28(%esp), %ecx
|
||||
mov 32(%esp), %edx
|
||||
mov 36(%esp), %esi
|
||||
mov 40(%esp), %edi
|
||||
movl $__NR_perf_event_open, %eax
|
||||
int $0x80
|
||||
cmpl $-129, %eax
|
||||
jb 1f
|
||||
negl %eax
|
||||
pushl %eax
|
||||
call __set_errno
|
||||
addl $4, %esp
|
||||
orl $-1, %eax
|
||||
1:
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %edx
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
29
libc/arch-x86/syscalls/tgkill.S
Normal file
29
libc/arch-x86/syscalls/tgkill.S
Normal file
@@ -0,0 +1,29 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type tgkill, @function
|
||||
.globl tgkill
|
||||
.align 4
|
||||
|
||||
tgkill:
|
||||
pushl %ebx
|
||||
pushl %ecx
|
||||
pushl %edx
|
||||
mov 16(%esp), %ebx
|
||||
mov 20(%esp), %ecx
|
||||
mov 24(%esp), %edx
|
||||
movl $__NR_tgkill, %eax
|
||||
int $0x80
|
||||
cmpl $-129, %eax
|
||||
jb 1f
|
||||
negl %eax
|
||||
pushl %eax
|
||||
call __set_errno
|
||||
addl $4, %esp
|
||||
orl $-1, %eax
|
||||
1:
|
||||
popl %edx
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
@@ -773,6 +773,22 @@ void* dlrealloc(void*, size_t);
|
||||
*/
|
||||
void* dlmemalign(size_t, size_t);
|
||||
|
||||
/*
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size);
|
||||
Places a pointer to a newly allocated chunk of size bytes, aligned
|
||||
in accord with the alignment argument, in *memptr.
|
||||
|
||||
The return value is 0 on success, and ENOMEM on failure.
|
||||
|
||||
The alignment argument should be a power of two. If the argument is
|
||||
not a power of two, the nearest greater power is used.
|
||||
8-byte alignment is guaranteed by normal malloc calls, so don't
|
||||
bother calling memalign with an argument of 8 or less.
|
||||
|
||||
Overreliance on posix_memalign is a sure way to fragment space.
|
||||
*/
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size);
|
||||
|
||||
/*
|
||||
valloc(size_t n);
|
||||
Equivalent to memalign(pagesize, n), where pagesize is the page
|
||||
@@ -2274,7 +2290,22 @@ static void reset_on_error(mstate m);
|
||||
|
||||
# include <private/logd.h>
|
||||
|
||||
static void __bionic_heap_error(const char* msg, const char* function)
|
||||
/* Convert a pointer into hex string */
|
||||
static void __bionic_itox(char* hex, void* ptr)
|
||||
{
|
||||
intptr_t val = (intptr_t) ptr;
|
||||
/* Terminate with NULL */
|
||||
hex[8] = 0;
|
||||
int i;
|
||||
|
||||
for (i = 7; i >= 0; i--) {
|
||||
int digit = val & 15;
|
||||
hex[i] = (digit <= 9) ? digit + '0' : digit - 10 + 'a';
|
||||
val >>= 4;
|
||||
}
|
||||
}
|
||||
|
||||
static void __bionic_heap_error(const char* msg, const char* function, void* p)
|
||||
{
|
||||
/* We format the buffer explicitely, i.e. without using snprintf()
|
||||
* which may use malloc() internally. Not something we can trust
|
||||
@@ -2287,23 +2318,33 @@ static void __bionic_heap_error(const char* msg, const char* function)
|
||||
strlcat(buffer, " IN ", sizeof(buffer));
|
||||
strlcat(buffer, function, sizeof(buffer));
|
||||
}
|
||||
|
||||
if (p != NULL) {
|
||||
char hexbuffer[9];
|
||||
__bionic_itox(hexbuffer, p);
|
||||
strlcat(buffer, " addr=0x", sizeof(buffer));
|
||||
strlcat(buffer, hexbuffer, sizeof(buffer));
|
||||
}
|
||||
|
||||
__libc_android_log_write(ANDROID_LOG_FATAL,"libc",buffer);
|
||||
abort();
|
||||
|
||||
/* So that we can get a memory dump around p */
|
||||
*((int **) 0xdeadbaad) = (int *) p;
|
||||
}
|
||||
|
||||
# ifndef CORRUPTION_ERROR_ACTION
|
||||
# define CORRUPTION_ERROR_ACTION(m) \
|
||||
__bionic_heap_error("HEAP MEMORY CORRUPTION", __FUNCTION__)
|
||||
# define CORRUPTION_ERROR_ACTION(m,p) \
|
||||
__bionic_heap_error("HEAP MEMORY CORRUPTION", __FUNCTION__, p)
|
||||
# endif
|
||||
# ifndef USAGE_ERROR_ACTION
|
||||
# define USAGE_ERROR_ACTION(m,p) \
|
||||
__bionic_heap_error("INVALID HEAP ADDRESS", __FUNCTION__)
|
||||
__bionic_heap_error("INVALID HEAP ADDRESS", __FUNCTION__, p)
|
||||
# endif
|
||||
|
||||
#else /* !LOG_ON_HEAP_ERROR */
|
||||
|
||||
# ifndef CORRUPTION_ERROR_ACTION
|
||||
# define CORRUPTION_ERROR_ACTION(m) ABORT
|
||||
# define CORRUPTION_ERROR_ACTION(m,p) ABORT
|
||||
# endif /* CORRUPTION_ERROR_ACTION */
|
||||
|
||||
# ifndef USAGE_ERROR_ACTION
|
||||
@@ -3040,7 +3081,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
else if (RTCHECK(ok_address(M, B->fd)))\
|
||||
F = B->fd;\
|
||||
else {\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, B);\
|
||||
}\
|
||||
B->fd = P;\
|
||||
F->bk = P;\
|
||||
@@ -3057,7 +3098,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
mchunkptr B = P->bk;\
|
||||
bindex_t I = small_index(S);\
|
||||
if (__builtin_expect (F->bk != P || B->fd != P, 0))\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, P);\
|
||||
assert(P != B);\
|
||||
assert(P != F);\
|
||||
assert(chunksize(P) == small_index2size(I));\
|
||||
@@ -3069,7 +3110,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
B->fd = F;\
|
||||
}\
|
||||
else {\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, P);\
|
||||
}\
|
||||
}
|
||||
|
||||
@@ -3080,7 +3121,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
#define unlink_first_small_chunk(M, B, P, I) {\
|
||||
mchunkptr F = P->fd;\
|
||||
if (__builtin_expect (F->bk != P || B->fd != P, 0))\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, P);\
|
||||
assert(P != B);\
|
||||
assert(P != F);\
|
||||
assert(chunksize(P) == small_index2size(I));\
|
||||
@@ -3091,7 +3132,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
F->bk = B;\
|
||||
}\
|
||||
else {\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, P);\
|
||||
}\
|
||||
}
|
||||
|
||||
@@ -3140,7 +3181,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
break;\
|
||||
}\
|
||||
else {\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, C);\
|
||||
break;\
|
||||
}\
|
||||
}\
|
||||
@@ -3154,7 +3195,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
break;\
|
||||
}\
|
||||
else {\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, F);\
|
||||
break;\
|
||||
}\
|
||||
}\
|
||||
@@ -3189,13 +3230,13 @@ static void internal_malloc_stats(mstate m) {
|
||||
tchunkptr F = X->fd;\
|
||||
R = X->bk;\
|
||||
if (__builtin_expect (F->bk != X || R->fd != X, 0))\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, X);\
|
||||
if (RTCHECK(ok_address(M, F))) {\
|
||||
F->bk = R;\
|
||||
R->fd = F;\
|
||||
}\
|
||||
else {\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, F);\
|
||||
}\
|
||||
}\
|
||||
else {\
|
||||
@@ -3210,7 +3251,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
if (RTCHECK(ok_address(M, RP)))\
|
||||
*RP = 0;\
|
||||
else {\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, RP);\
|
||||
}\
|
||||
}\
|
||||
}\
|
||||
@@ -3227,7 +3268,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
XP->child[1] = R;\
|
||||
}\
|
||||
else\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, XP);\
|
||||
if (R != 0) {\
|
||||
if (RTCHECK(ok_address(M, R))) {\
|
||||
tchunkptr C0, C1;\
|
||||
@@ -3238,7 +3279,7 @@ static void internal_malloc_stats(mstate m) {
|
||||
C0->parent = R;\
|
||||
}\
|
||||
else\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, C0);\
|
||||
}\
|
||||
if ((C1 = X->child[1]) != 0) {\
|
||||
if (RTCHECK(ok_address(M, C1))) {\
|
||||
@@ -3246,11 +3287,11 @@ static void internal_malloc_stats(mstate m) {
|
||||
C1->parent = R;\
|
||||
}\
|
||||
else\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, C1);\
|
||||
}\
|
||||
}\
|
||||
else\
|
||||
CORRUPTION_ERROR_ACTION(M);\
|
||||
CORRUPTION_ERROR_ACTION(M, R);\
|
||||
}\
|
||||
}\
|
||||
}
|
||||
@@ -3316,7 +3357,7 @@ static void* mmap_alloc(mstate m, size_t nb) {
|
||||
chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;
|
||||
chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0;
|
||||
|
||||
if (mm < m->least_addr)
|
||||
if (m->least_addr == 0 || mm < m->least_addr)
|
||||
m->least_addr = mm;
|
||||
if ((m->footprint += mmsize) > m->max_footprint)
|
||||
m->max_footprint = m->footprint;
|
||||
@@ -3662,7 +3703,9 @@ static void* sys_alloc(mstate m, size_t nb) {
|
||||
m->max_footprint = m->footprint;
|
||||
|
||||
if (!is_initialized(m)) { /* first-time initialization */
|
||||
m->seg.base = m->least_addr = tbase;
|
||||
if (m->least_addr == 0 || tbase < m->least_addr)
|
||||
m->least_addr = tbase;
|
||||
m->seg.base = tbase;
|
||||
m->seg.size = tsize;
|
||||
m->seg.sflags = mmap_flag;
|
||||
m->magic = mparams.magic;
|
||||
@@ -3899,7 +3942,7 @@ static void* tmalloc_large(mstate m, size_t nb) {
|
||||
return chunk2mem(v);
|
||||
}
|
||||
}
|
||||
CORRUPTION_ERROR_ACTION(m);
|
||||
CORRUPTION_ERROR_ACTION(m, v);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -3939,7 +3982,7 @@ static void* tmalloc_small(mstate m, size_t nb) {
|
||||
}
|
||||
}
|
||||
|
||||
CORRUPTION_ERROR_ACTION(m);
|
||||
CORRUPTION_ERROR_ACTION(m, v);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4507,6 +4550,18 @@ void* dlmemalign(size_t alignment, size_t bytes) {
|
||||
return internal_memalign(gm, alignment, bytes);
|
||||
}
|
||||
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size) {
|
||||
int ret = 0;
|
||||
|
||||
*memptr = dlmemalign(alignment, size);
|
||||
|
||||
if (*memptr == 0) {
|
||||
ret = ENOMEM;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void** dlindependent_calloc(size_t n_elements, size_t elem_size,
|
||||
void* chunks[]) {
|
||||
size_t sz = elem_size; /* serves as 1-element array */
|
||||
|
@@ -52,12 +52,19 @@ unsigned int __page_shift = PAGE_SHIFT;
|
||||
|
||||
int __system_properties_init(void);
|
||||
|
||||
void __libc_init_common(uintptr_t *elfdata)
|
||||
/* Init TLS for the initial thread. Called by the linker _before_ libc is mapped
|
||||
* in memory. Beware: all writes to libc globals from this function will
|
||||
* apply to linker-private copies and will not be visible from libc later on.
|
||||
*
|
||||
* Note: this function creates a pthread_internal_t for the initial thread and
|
||||
* stores the pointer in TLS, but does not add it to pthread's gThreadList. This
|
||||
* has to be done later from libc itself (see __libc_init_common).
|
||||
*
|
||||
* This function also stores elfdata argument in a specific TLS slot to be later
|
||||
* picked up by the libc constructor.
|
||||
*/
|
||||
void __libc_init_tls(unsigned** elfdata)
|
||||
{
|
||||
int argc = *elfdata;
|
||||
char** argv = (char**)(elfdata + 1);
|
||||
char** envp = argv + argc + 1;
|
||||
|
||||
pthread_attr_t thread_attr;
|
||||
static pthread_internal_t thread;
|
||||
static void* tls_area[BIONIC_TLS_SLOTS];
|
||||
@@ -72,7 +79,19 @@ void __libc_init_common(uintptr_t *elfdata)
|
||||
_init_thread(&thread, gettid(), &thread_attr, (void*)stackbottom);
|
||||
__init_tls(tls_area, &thread);
|
||||
|
||||
/* clear errno - requires TLS area */
|
||||
tls_area[TLS_SLOT_BIONIC_PREINIT] = elfdata;
|
||||
}
|
||||
|
||||
void __libc_init_common(uintptr_t *elfdata)
|
||||
{
|
||||
int argc = *elfdata;
|
||||
char** argv = (char**)(elfdata + 1);
|
||||
char** envp = argv + argc + 1;
|
||||
|
||||
/* get the initial thread from TLS and add it to gThreadList */
|
||||
_pthread_internal_add(__get_thread());
|
||||
|
||||
/* clear errno */
|
||||
errno = 0;
|
||||
|
||||
/* set program name */
|
||||
@@ -119,4 +138,12 @@ void __libc_fini(void* array)
|
||||
|
||||
func();
|
||||
}
|
||||
|
||||
#ifndef LIBC_STATIC
|
||||
{
|
||||
extern void __libc_postfini(void) __attribute__((weak));
|
||||
if (__libc_postfini)
|
||||
__libc_postfini();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -76,6 +76,12 @@ void __libc_preinit(void)
|
||||
|
||||
__libc_init_common(elfdata);
|
||||
|
||||
/* Setup pthread routines accordingly to the environment.
|
||||
* Requires system properties
|
||||
*/
|
||||
extern void pthread_debug_init(void);
|
||||
pthread_debug_init();
|
||||
|
||||
/* Setup malloc routines accordingly to the environment.
|
||||
* Requires system properties
|
||||
*/
|
||||
@@ -83,6 +89,12 @@ void __libc_preinit(void)
|
||||
malloc_debug_init();
|
||||
}
|
||||
|
||||
void __libc_postfini(void)
|
||||
{
|
||||
extern void malloc_debug_fini(void);
|
||||
malloc_debug_fini();
|
||||
}
|
||||
|
||||
/* This function is called from the executable's _start entry point
|
||||
* (see arch-$ARCH/bionic/crtbegin_dynamic.S), which is itself
|
||||
* called by the dynamic linker after it has loaded all shared
|
||||
|
@@ -65,6 +65,11 @@ __noreturn void __libc_init(uintptr_t *elfdata,
|
||||
int argc;
|
||||
char **argv, **envp;
|
||||
|
||||
__libc_init_tls(NULL);
|
||||
|
||||
/* get the initial thread from TLS and add it to gThreadList */
|
||||
_pthread_internal_add(__get_thread());
|
||||
|
||||
/* Initialize the C runtime environment */
|
||||
__libc_init_common(elfdata);
|
||||
|
||||
|
574
libc/bionic/malloc_debug_check.c
Normal file
574
libc/bionic/malloc_debug_check.c
Normal file
@@ -0,0 +1,574 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <fcntl.h>
|
||||
#include <unwind.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/system_properties.h>
|
||||
|
||||
#include "dlmalloc.h"
|
||||
#include "logd.h"
|
||||
|
||||
#include "malloc_debug_common.h"
|
||||
#include "malloc_debug_check_mapinfo.h"
|
||||
|
||||
static mapinfo *milist;
|
||||
|
||||
/* libc.debug.malloc.backlog */
|
||||
extern unsigned int malloc_double_free_backlog;
|
||||
|
||||
#define MAX_BACKTRACE_DEPTH 15
|
||||
#define ALLOCATION_TAG 0x1ee7d00d
|
||||
#define BACKLOG_TAG 0xbabecafe
|
||||
#define FREE_POISON 0xa5
|
||||
#define BACKLOG_DEFAULT_LEN 100
|
||||
#define FRONT_GUARD 0xaa
|
||||
#define FRONT_GUARD_LEN (1<<5)
|
||||
#define REAR_GUARD 0xbb
|
||||
#define REAR_GUARD_LEN (1<<5)
|
||||
|
||||
static void print_backtrace(const intptr_t *bt, unsigned int depth);
|
||||
|
||||
static void log_message(const char* format, ...)
|
||||
{
|
||||
extern pthread_mutex_t gAllocationsMutex;
|
||||
extern const MallocDebug __libc_malloc_default_dispatch;
|
||||
extern const MallocDebug* __libc_malloc_dispatch;
|
||||
|
||||
va_list args;
|
||||
|
||||
pthread_mutex_lock(&gAllocationsMutex);
|
||||
{
|
||||
const MallocDebug* current_dispatch = __libc_malloc_dispatch;
|
||||
__libc_malloc_dispatch = &__libc_malloc_default_dispatch;
|
||||
va_start(args, format);
|
||||
__libc_android_log_vprint(ANDROID_LOG_ERROR, "libc",
|
||||
format, args);
|
||||
va_end(args);
|
||||
__libc_malloc_dispatch = current_dispatch;
|
||||
}
|
||||
pthread_mutex_unlock(&gAllocationsMutex);
|
||||
}
|
||||
|
||||
struct hdr {
|
||||
uint32_t tag;
|
||||
struct hdr *prev;
|
||||
struct hdr *next;
|
||||
intptr_t bt[MAX_BACKTRACE_DEPTH];
|
||||
int bt_depth;
|
||||
intptr_t freed_bt[MAX_BACKTRACE_DEPTH];
|
||||
int freed_bt_depth;
|
||||
size_t size;
|
||||
char front_guard[FRONT_GUARD_LEN];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct ftr {
|
||||
char rear_guard[REAR_GUARD_LEN];
|
||||
} __attribute__((packed));
|
||||
|
||||
static inline struct ftr * to_ftr(struct hdr *hdr)
|
||||
{
|
||||
return (struct ftr *)(((char *)(hdr + 1)) + hdr->size);
|
||||
}
|
||||
|
||||
static inline void *user(struct hdr *hdr)
|
||||
{
|
||||
return hdr + 1;
|
||||
}
|
||||
|
||||
static inline struct hdr *meta(void *user)
|
||||
{
|
||||
return ((struct hdr *)user) - 1;
|
||||
}
|
||||
|
||||
/* Call this on exit() to get leaked memory */
|
||||
void free_leaked_memory(void);
|
||||
|
||||
static unsigned num;
|
||||
static struct hdr *tail;
|
||||
static struct hdr *head;
|
||||
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
static unsigned backlog_num;
|
||||
static struct hdr *backlog_tail;
|
||||
static struct hdr *backlog_head;
|
||||
static pthread_mutex_t backlog_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
extern __LIBC_HIDDEN__
|
||||
int get_backtrace(intptr_t* addrs, size_t max_entries);
|
||||
|
||||
static void print_backtrace(const intptr_t *bt, unsigned int depth)
|
||||
{
|
||||
const mapinfo *mi;
|
||||
unsigned int cnt;
|
||||
unsigned int rel_pc;
|
||||
intptr_t self_bt[MAX_BACKTRACE_DEPTH];
|
||||
|
||||
if (!bt) {
|
||||
depth = get_backtrace(self_bt, MAX_BACKTRACE_DEPTH);
|
||||
bt = self_bt;
|
||||
}
|
||||
|
||||
log_message("*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");
|
||||
for (cnt = 0; cnt < depth && cnt < MAX_BACKTRACE_DEPTH; cnt++) {
|
||||
mi = pc_to_mapinfo(milist, bt[cnt], &rel_pc);
|
||||
log_message("\t#%02d pc %08x %s\n", cnt,
|
||||
mi ? (intptr_t)rel_pc : bt[cnt],
|
||||
mi ? mi->name : "(unknown)");
|
||||
}
|
||||
}
|
||||
|
||||
static inline void init_front_guard(struct hdr *hdr)
|
||||
{
|
||||
memset(hdr->front_guard, FRONT_GUARD, FRONT_GUARD_LEN);
|
||||
}
|
||||
|
||||
static inline bool is_front_guard_valid(struct hdr *hdr)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < FRONT_GUARD_LEN; i++)
|
||||
if (hdr->front_guard[i] != FRONT_GUARD)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline void init_rear_guard(struct hdr *hdr)
|
||||
{
|
||||
struct ftr *ftr = to_ftr(hdr);
|
||||
memset(ftr->rear_guard, REAR_GUARD, REAR_GUARD_LEN);
|
||||
}
|
||||
|
||||
static inline bool is_rear_guard_valid(struct hdr *hdr)
|
||||
{
|
||||
unsigned i;
|
||||
int valid = 1;
|
||||
int first_mismatch = -1;
|
||||
struct ftr *ftr = to_ftr(hdr);
|
||||
for (i = 0; i < REAR_GUARD_LEN; i++) {
|
||||
if (ftr->rear_guard[i] != REAR_GUARD) {
|
||||
if (first_mismatch < 0)
|
||||
first_mismatch = i;
|
||||
valid = 0;
|
||||
}
|
||||
else if (first_mismatch >= 0) {
|
||||
log_message("+++ REAR GUARD MISMATCH [%d, %d)\n", first_mismatch, i);
|
||||
first_mismatch = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (first_mismatch >= 0)
|
||||
log_message("+++ REAR GUARD MISMATCH [%d, %d)\n", first_mismatch, i);
|
||||
return valid;
|
||||
}
|
||||
|
||||
static inline void add_locked(struct hdr *hdr, struct hdr **tail, struct hdr **head)
|
||||
{
|
||||
hdr->prev = NULL;
|
||||
hdr->next = *head;
|
||||
if (*head)
|
||||
(*head)->prev = hdr;
|
||||
else
|
||||
*tail = hdr;
|
||||
*head = hdr;
|
||||
}
|
||||
|
||||
static inline int del_locked(struct hdr *hdr, struct hdr **tail, struct hdr **head)
|
||||
{
|
||||
if (hdr->prev)
|
||||
hdr->prev->next = hdr->next;
|
||||
else
|
||||
*head = hdr->next;
|
||||
if (hdr->next)
|
||||
hdr->next->prev = hdr->prev;
|
||||
else
|
||||
*tail = hdr->prev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void add(struct hdr *hdr, size_t size)
|
||||
{
|
||||
pthread_mutex_lock(&lock);
|
||||
hdr->tag = ALLOCATION_TAG;
|
||||
hdr->size = size;
|
||||
init_front_guard(hdr);
|
||||
init_rear_guard(hdr);
|
||||
num++;
|
||||
add_locked(hdr, &tail, &head);
|
||||
pthread_mutex_unlock(&lock);
|
||||
}
|
||||
|
||||
static inline int del(struct hdr *hdr)
|
||||
{
|
||||
if (hdr->tag != ALLOCATION_TAG)
|
||||
return -1;
|
||||
|
||||
pthread_mutex_lock(&lock);
|
||||
del_locked(hdr, &tail, &head);
|
||||
num--;
|
||||
pthread_mutex_unlock(&lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void poison(struct hdr *hdr)
|
||||
{
|
||||
memset(user(hdr), FREE_POISON, hdr->size);
|
||||
}
|
||||
|
||||
static int was_used_after_free(struct hdr *hdr)
|
||||
{
|
||||
unsigned i;
|
||||
const char *data = (const char *)user(hdr);
|
||||
for (i = 0; i < hdr->size; i++)
|
||||
if (data[i] != FREE_POISON)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* returns 1 if valid, *safe == 1 if safe to dump stack */
|
||||
static inline int check_guards(struct hdr *hdr, int *safe)
|
||||
{
|
||||
*safe = 1;
|
||||
if (!is_front_guard_valid(hdr)) {
|
||||
if (hdr->front_guard[0] == FRONT_GUARD) {
|
||||
log_message("+++ ALLOCATION %p SIZE %d HAS A CORRUPTED FRONT GUARD\n",
|
||||
user(hdr), hdr->size);
|
||||
} else {
|
||||
log_message("+++ ALLOCATION %p HAS A CORRUPTED FRONT GUARD "\
|
||||
"(NOT DUMPING STACKTRACE)\n", user(hdr));
|
||||
/* Allocation header is probably corrupt, do not print stack trace */
|
||||
*safe = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!is_rear_guard_valid(hdr)) {
|
||||
log_message("+++ ALLOCATION %p SIZE %d HAS A CORRUPTED REAR GUARD\n",
|
||||
user(hdr), hdr->size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* returns 1 if valid, *safe == 1 if safe to dump stack */
|
||||
static inline int check_allocation_locked(struct hdr *hdr, int *safe)
|
||||
{
|
||||
int valid = 1;
|
||||
*safe = 1;
|
||||
|
||||
if (hdr->tag != ALLOCATION_TAG && hdr->tag != BACKLOG_TAG) {
|
||||
log_message("+++ ALLOCATION %p HAS INVALID TAG %08x (NOT DUMPING STACKTRACE)\n",
|
||||
user(hdr), hdr->tag);
|
||||
/* Allocation header is probably corrupt, do not dequeue or dump stack
|
||||
* trace.
|
||||
*/
|
||||
*safe = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (hdr->tag == BACKLOG_TAG && was_used_after_free(hdr)) {
|
||||
log_message("+++ ALLOCATION %p SIZE %d WAS USED AFTER BEING FREED\n",
|
||||
user(hdr), hdr->size);
|
||||
valid = 0;
|
||||
/* check the guards to see if it's safe to dump a stack trace */
|
||||
(void)check_guards(hdr, safe);
|
||||
}
|
||||
else
|
||||
valid = check_guards(hdr, safe);
|
||||
|
||||
if (!valid && *safe) {
|
||||
log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(hdr->bt, hdr->bt_depth);
|
||||
if (hdr->tag == BACKLOG_TAG) {
|
||||
log_message("+++ ALLOCATION %p SIZE %d FREED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(hdr->freed_bt, hdr->freed_bt_depth);
|
||||
}
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
static inline int del_and_check_locked(struct hdr *hdr,
|
||||
struct hdr **tail, struct hdr **head, unsigned *cnt,
|
||||
int *safe)
|
||||
{
|
||||
int valid;
|
||||
valid = check_allocation_locked(hdr, safe);
|
||||
if (safe) {
|
||||
(*cnt)--;
|
||||
del_locked(hdr, tail, head);
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
static inline void del_from_backlog_locked(struct hdr *hdr)
|
||||
{
|
||||
int safe;
|
||||
(void)del_and_check_locked(hdr,
|
||||
&backlog_tail, &backlog_head, &backlog_num,
|
||||
&safe);
|
||||
hdr->tag = 0; /* clear the tag */
|
||||
}
|
||||
|
||||
static inline void del_from_backlog(struct hdr *hdr)
|
||||
{
|
||||
pthread_mutex_lock(&backlog_lock);
|
||||
del_from_backlog_locked(hdr);
|
||||
pthread_mutex_unlock(&backlog_lock);
|
||||
}
|
||||
|
||||
static inline int del_leak(struct hdr *hdr, int *safe)
|
||||
{
|
||||
int valid;
|
||||
pthread_mutex_lock(&lock);
|
||||
valid = del_and_check_locked(hdr,
|
||||
&tail, &head, &num,
|
||||
safe);
|
||||
pthread_mutex_unlock(&lock);
|
||||
return valid;
|
||||
}
|
||||
|
||||
static inline void add_to_backlog(struct hdr *hdr)
|
||||
{
|
||||
pthread_mutex_lock(&backlog_lock);
|
||||
hdr->tag = BACKLOG_TAG;
|
||||
backlog_num++;
|
||||
add_locked(hdr, &backlog_tail, &backlog_head);
|
||||
poison(hdr);
|
||||
/* If we've exceeded the maximum backlog, clear it up */
|
||||
while (backlog_num > malloc_double_free_backlog) {
|
||||
struct hdr *gone = backlog_tail;
|
||||
del_from_backlog_locked(gone);
|
||||
dlfree(gone);
|
||||
}
|
||||
pthread_mutex_unlock(&backlog_lock);
|
||||
}
|
||||
|
||||
void* chk_malloc(size_t size)
|
||||
{
|
||||
struct hdr *hdr;
|
||||
|
||||
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
|
||||
|
||||
hdr = dlmalloc(sizeof(struct hdr) + size + sizeof(struct ftr));
|
||||
if (hdr) {
|
||||
hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH);
|
||||
add(hdr, size);
|
||||
return user(hdr);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* chk_memalign(size_t alignment, size_t bytes)
|
||||
{
|
||||
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
|
||||
// XXX: it's better to use malloc, than being wrong
|
||||
return chk_malloc(bytes);
|
||||
}
|
||||
|
||||
void chk_free(void *ptr)
|
||||
{
|
||||
struct hdr *hdr;
|
||||
|
||||
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
|
||||
|
||||
if (!ptr) /* ignore free(NULL) */
|
||||
return;
|
||||
|
||||
hdr = meta(ptr);
|
||||
|
||||
if (del(hdr) < 0) {
|
||||
intptr_t bt[MAX_BACKTRACE_DEPTH];
|
||||
int depth;
|
||||
depth = get_backtrace(bt, MAX_BACKTRACE_DEPTH);
|
||||
if (hdr->tag == BACKLOG_TAG) {
|
||||
log_message("+++ ALLOCATION %p SIZE %d BYTES MULTIPLY FREED!\n",
|
||||
user(hdr), hdr->size);
|
||||
log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(hdr->bt, hdr->bt_depth);
|
||||
/* hdr->freed_bt_depth should be nonzero here */
|
||||
log_message("+++ ALLOCATION %p SIZE %d FIRST FREED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(hdr->freed_bt, hdr->freed_bt_depth);
|
||||
log_message("+++ ALLOCATION %p SIZE %d NOW BEING FREED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(bt, depth);
|
||||
}
|
||||
else {
|
||||
log_message("+++ ALLOCATION %p IS CORRUPTED OR NOT ALLOCATED VIA TRACKER!\n",
|
||||
user(hdr));
|
||||
print_backtrace(bt, depth);
|
||||
/* Leak here so that we do not crash */
|
||||
//dlfree(user(hdr));
|
||||
}
|
||||
}
|
||||
else {
|
||||
hdr->freed_bt_depth = get_backtrace(hdr->freed_bt,
|
||||
MAX_BACKTRACE_DEPTH);
|
||||
add_to_backlog(hdr);
|
||||
}
|
||||
}
|
||||
|
||||
void *chk_realloc(void *ptr, size_t size)
|
||||
{
|
||||
struct hdr *hdr;
|
||||
|
||||
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
|
||||
|
||||
if (!size) {
|
||||
chk_free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ptr)
|
||||
return chk_malloc(size);
|
||||
|
||||
hdr = meta(ptr);
|
||||
|
||||
if (del(hdr) < 0) {
|
||||
intptr_t bt[MAX_BACKTRACE_DEPTH];
|
||||
int depth;
|
||||
depth = get_backtrace(bt, MAX_BACKTRACE_DEPTH);
|
||||
if (hdr->tag == BACKLOG_TAG) {
|
||||
log_message("+++ REALLOCATION %p SIZE %d OF FREED MEMORY!\n",
|
||||
user(hdr), size, hdr->size);
|
||||
log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(hdr->bt, hdr->bt_depth);
|
||||
/* hdr->freed_bt_depth should be nonzero here */
|
||||
log_message("+++ ALLOCATION %p SIZE %d FIRST FREED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(hdr->freed_bt, hdr->freed_bt_depth);
|
||||
log_message("+++ ALLOCATION %p SIZE %d NOW BEING REALLOCATED HERE:\n",
|
||||
user(hdr), hdr->size);
|
||||
print_backtrace(bt, depth);
|
||||
|
||||
/* We take the memory out of the backlog and fall through so the
|
||||
* reallocation below succeeds. Since we didn't really free it, we
|
||||
* can default to this behavior.
|
||||
*/
|
||||
del_from_backlog(hdr);
|
||||
}
|
||||
else {
|
||||
log_message("+++ REALLOCATION %p SIZE %d IS CORRUPTED OR NOT ALLOCATED VIA TRACKER!\n",
|
||||
user(hdr), size);
|
||||
print_backtrace(bt, depth);
|
||||
// just get a whole new allocation and leak the old one
|
||||
return dlrealloc(0, size);
|
||||
// return dlrealloc(user(hdr), size); // assuming it was allocated externally
|
||||
}
|
||||
}
|
||||
|
||||
hdr = dlrealloc(hdr, sizeof(struct hdr) + size + sizeof(struct ftr));
|
||||
if (hdr) {
|
||||
hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH);
|
||||
add(hdr, size);
|
||||
return user(hdr);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *chk_calloc(int nmemb, size_t size)
|
||||
{
|
||||
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
|
||||
struct hdr *hdr;
|
||||
size_t total_size = nmemb * size;
|
||||
hdr = dlcalloc(1, sizeof(struct hdr) + total_size + sizeof(struct ftr));
|
||||
if (hdr) {
|
||||
hdr->bt_depth = get_backtrace(
|
||||
hdr->bt, MAX_BACKTRACE_DEPTH);
|
||||
add(hdr, total_size);
|
||||
return user(hdr);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void heaptracker_free_leaked_memory(void)
|
||||
{
|
||||
struct hdr *del; int cnt;
|
||||
|
||||
if (num)
|
||||
log_message("+++ THERE ARE %d LEAKED ALLOCATIONS\n", num);
|
||||
|
||||
while (head) {
|
||||
int safe;
|
||||
del = head;
|
||||
log_message("+++ DELETING %d BYTES OF LEAKED MEMORY AT %p (%d REMAINING)\n",
|
||||
del->size, user(del), num);
|
||||
if (del_leak(del, &safe)) {
|
||||
/* safe == 1, because the allocation is valid */
|
||||
log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n",
|
||||
user(del), del->size);
|
||||
print_backtrace(del->bt, del->bt_depth);
|
||||
}
|
||||
dlfree(del);
|
||||
}
|
||||
|
||||
// log_message("+++ DELETING %d BACKLOGGED ALLOCATIONS\n", backlog_num);
|
||||
while (backlog_head) {
|
||||
del = backlog_tail;
|
||||
del_from_backlog(del);
|
||||
dlfree(del);
|
||||
}
|
||||
}
|
||||
|
||||
/* Initializes malloc debugging framework.
|
||||
* See comments on MallocDebugInit in malloc_debug_common.h
|
||||
*/
|
||||
int malloc_debug_initialize(void)
|
||||
{
|
||||
if (!malloc_double_free_backlog)
|
||||
malloc_double_free_backlog = BACKLOG_DEFAULT_LEN;
|
||||
milist = init_mapinfo(getpid());
|
||||
return 0;
|
||||
}
|
||||
|
||||
void malloc_debug_finalize(void)
|
||||
{
|
||||
heaptracker_free_leaked_memory();
|
||||
deinit_mapinfo(milist);
|
||||
}
|
126
libc/bionic/malloc_debug_check_mapinfo.c
Normal file
126
libc/bionic/malloc_debug_check_mapinfo.c
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "dlmalloc.h"
|
||||
#include "malloc_debug_check_mapinfo.h"
|
||||
|
||||
// 6f000000-6f01e000 rwxp 00000000 00:0c 16389419 /system/lib/libcomposer.so
|
||||
// 012345678901234567890123456789012345678901234567890123456789
|
||||
// 0 1 2 3 4 5
|
||||
|
||||
static mapinfo *parse_maps_line(char *line)
|
||||
{
|
||||
mapinfo *mi;
|
||||
int len = strlen(line);
|
||||
|
||||
if(len < 1) return 0;
|
||||
line[--len] = 0;
|
||||
|
||||
if(len < 50) return 0;
|
||||
if(line[20] != 'x') return 0;
|
||||
|
||||
mi = dlmalloc(sizeof(mapinfo) + (len - 47));
|
||||
if(mi == 0) return 0;
|
||||
|
||||
mi->start = strtoul(line, 0, 16);
|
||||
mi->end = strtoul(line + 9, 0, 16);
|
||||
/* To be filled in parse_elf_info if the mapped section starts with
|
||||
* elf_header
|
||||
*/
|
||||
mi->next = 0;
|
||||
strcpy(mi->name, line + 49);
|
||||
|
||||
return mi;
|
||||
}
|
||||
|
||||
__LIBC_HIDDEN__
|
||||
mapinfo *init_mapinfo(int pid)
|
||||
{
|
||||
struct mapinfo *milist = NULL;
|
||||
char data[1024];
|
||||
sprintf(data, "/proc/%d/maps", pid);
|
||||
FILE *fp = fopen(data, "r");
|
||||
if(fp) {
|
||||
while(fgets(data, sizeof(data), fp)) {
|
||||
mapinfo *mi = parse_maps_line(data);
|
||||
if(mi) {
|
||||
mi->next = milist;
|
||||
milist = mi;
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return milist;
|
||||
}
|
||||
|
||||
__LIBC_HIDDEN__
|
||||
void deinit_mapinfo(mapinfo *mi)
|
||||
{
|
||||
mapinfo *del;
|
||||
while(mi) {
|
||||
del = mi;
|
||||
mi = mi->next;
|
||||
dlfree(del);
|
||||
}
|
||||
}
|
||||
|
||||
/* Map a pc address to the name of the containing ELF file */
|
||||
__LIBC_HIDDEN__
|
||||
const char *map_to_name(mapinfo *mi, unsigned pc, const char* def)
|
||||
{
|
||||
while(mi) {
|
||||
if((pc >= mi->start) && (pc < mi->end)){
|
||||
return mi->name;
|
||||
}
|
||||
mi = mi->next;
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
/* Find the containing map info for the pc */
|
||||
__LIBC_HIDDEN__
|
||||
const mapinfo *pc_to_mapinfo(mapinfo *mi, unsigned pc, unsigned *rel_pc)
|
||||
{
|
||||
*rel_pc = pc;
|
||||
while(mi) {
|
||||
if((pc >= mi->start) && (pc < mi->end)){
|
||||
// Only calculate the relative offset for shared libraries
|
||||
if (strstr(mi->name, ".so")) {
|
||||
*rel_pc -= mi->start;
|
||||
}
|
||||
return mi;
|
||||
}
|
||||
mi = mi->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
46
libc/bionic/malloc_debug_check_mapinfo.h
Normal file
46
libc/bionic/malloc_debug_check_mapinfo.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef MALLOC_DEBUG_CHECK_MAPINFO_H
|
||||
#define MALLOC_DEBUG_CHECK_MAPINFO_H
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
typedef struct mapinfo {
|
||||
struct mapinfo *next;
|
||||
unsigned start;
|
||||
unsigned end;
|
||||
char name[];
|
||||
} mapinfo;
|
||||
|
||||
__LIBC_HIDDEN__ mapinfo *init_mapinfo(int pid);
|
||||
__LIBC_HIDDEN__ void deinit_mapinfo(mapinfo *mi);
|
||||
__LIBC_HIDDEN__ const char *map_to_name(mapinfo *mi, unsigned pc, const char* def);
|
||||
__LIBC_HIDDEN__ const mapinfo *pc_to_mapinfo(mapinfo *mi, unsigned pc, unsigned *rel_pc);
|
||||
|
||||
#endif/*MALLOC_DEBUG_CHECK_MAPINFO_H*/
|
@@ -240,17 +240,6 @@ void* memalign(size_t alignment, size_t bytes) {
|
||||
#include <dlfcn.h>
|
||||
#include "logd.h"
|
||||
|
||||
// =============================================================================
|
||||
// log functions
|
||||
// =============================================================================
|
||||
|
||||
#define debug_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_DEBUG, "libc", (format), ##__VA_ARGS__ )
|
||||
#define error_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_ERROR, "libc", (format), ##__VA_ARGS__ )
|
||||
#define info_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_INFO, "libc", (format), ##__VA_ARGS__ )
|
||||
|
||||
/* Table for dispatching malloc calls, depending on environment. */
|
||||
static MallocDebug gMallocUse __attribute__((aligned(32))) = {
|
||||
dlmalloc, dlfree, dlcalloc, dlrealloc, dlmemalign
|
||||
@@ -288,6 +277,14 @@ static void* libc_malloc_impl_handle = NULL;
|
||||
#define MALLOC_ALIGNMENT ((size_t)8U)
|
||||
#endif /* MALLOC_ALIGNMENT */
|
||||
|
||||
/* This variable is set to the value of property libc.debug.malloc.backlog,
|
||||
* when the value of libc.debug.malloc = 10. It determines the size of the
|
||||
* backlog we use to detect multiple frees. If the property is not set, the
|
||||
* backlog length defaults to an internal constant defined in
|
||||
* malloc_debug_check.c
|
||||
*/
|
||||
unsigned int malloc_double_free_backlog;
|
||||
|
||||
/* Initializes memory allocation framework once per process. */
|
||||
static void malloc_init_impl(void)
|
||||
{
|
||||
@@ -298,6 +295,7 @@ static void malloc_init_impl(void)
|
||||
unsigned int memcheck_enabled = 0;
|
||||
char env[PROP_VALUE_MAX];
|
||||
char memcheck_tracing[PROP_VALUE_MAX];
|
||||
char debug_program[PROP_VALUE_MAX];
|
||||
|
||||
/* Get custom malloc debug level. Note that emulator started with
|
||||
* memory checking option will have priority over debug level set in
|
||||
@@ -325,13 +323,30 @@ static void malloc_init_impl(void)
|
||||
return;
|
||||
}
|
||||
|
||||
/* If libc.debug.malloc.program is set and is not a substring of progname,
|
||||
* then exit.
|
||||
*/
|
||||
if (__system_property_get("libc.debug.malloc.program", debug_program)) {
|
||||
if (!strstr(__progname, debug_program)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Lets see which .so must be loaded for the requested debug level
|
||||
switch (debug_level) {
|
||||
case 1:
|
||||
case 5:
|
||||
case 10:
|
||||
case 10: {
|
||||
char debug_backlog[PROP_VALUE_MAX];
|
||||
if (__system_property_get("libc.debug.malloc.backlog", debug_backlog)) {
|
||||
malloc_double_free_backlog = atoi(debug_backlog);
|
||||
info_log("%s: setting backlog length to %d\n",
|
||||
__progname, malloc_double_free_backlog);
|
||||
}
|
||||
|
||||
so_name = "/system/lib/libc_malloc_debug_leak.so";
|
||||
break;
|
||||
}
|
||||
case 20:
|
||||
// Quick check: debug level 20 can only be handled in emulator.
|
||||
if (!qemu_running) {
|
||||
@@ -475,7 +490,19 @@ static void malloc_init_impl(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void malloc_fini_impl(void)
|
||||
{
|
||||
if (libc_malloc_impl_handle) {
|
||||
MallocDebugFini malloc_debug_finalize = NULL;
|
||||
malloc_debug_finalize =
|
||||
dlsym(libc_malloc_impl_handle, "malloc_debug_finalize");
|
||||
if (malloc_debug_finalize)
|
||||
malloc_debug_finalize();
|
||||
}
|
||||
}
|
||||
|
||||
static pthread_once_t malloc_init_once_ctl = PTHREAD_ONCE_INIT;
|
||||
static pthread_once_t malloc_fini_once_ctl = PTHREAD_ONCE_INIT;
|
||||
|
||||
#endif // !LIBC_STATIC
|
||||
#endif // USE_DL_PREFIX
|
||||
@@ -494,3 +521,14 @@ void malloc_debug_init(void)
|
||||
}
|
||||
#endif // USE_DL_PREFIX && !LIBC_STATIC
|
||||
}
|
||||
|
||||
void malloc_debug_fini(void)
|
||||
{
|
||||
/* We need to finalize malloc iff we implement here custom
|
||||
* malloc routines (i.e. USE_DL_PREFIX is defined) for libc.so */
|
||||
#if defined(USE_DL_PREFIX) && !defined(LIBC_STATIC)
|
||||
if (pthread_once(&malloc_fini_once_ctl, malloc_fini_impl)) {
|
||||
error_log("Unable to finalize malloc_debug component.");
|
||||
}
|
||||
#endif // USE_DL_PREFIX && !LIBC_STATIC
|
||||
}
|
||||
|
@@ -82,15 +82,31 @@ struct MallocDebug {
|
||||
void* (*memalign)(size_t alignment, size_t bytes);
|
||||
};
|
||||
|
||||
/* Malloc debugging initialization routine.
|
||||
* This routine must be implemented in .so modules that implement malloc
|
||||
* debugging. This routine is called once per process from malloc_init_impl
|
||||
* routine implemented in bionic/libc/bionic/malloc_debug_common.c when malloc
|
||||
/* Malloc debugging initialization and finalization routines.
|
||||
*
|
||||
* These routines must be implemented in .so modules that implement malloc
|
||||
* debugging. The are is called once per process from malloc_init_impl and
|
||||
* malloc_fini_impl respectively.
|
||||
*
|
||||
* They are implemented in bionic/libc/bionic/malloc_debug_common.c when malloc
|
||||
* debugging gets initialized for the process.
|
||||
* Return:
|
||||
* 0 on success, -1 on failure.
|
||||
*
|
||||
* MallocDebugInit returns:
|
||||
* 0 on success, -1 on failure.
|
||||
*/
|
||||
typedef int (*MallocDebugInit)(void);
|
||||
typedef void (*MallocDebugFini)(void);
|
||||
|
||||
// =============================================================================
|
||||
// log functions
|
||||
// =============================================================================
|
||||
|
||||
#define debug_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_DEBUG, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
||||
#define error_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_ERROR, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
||||
#define info_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_INFO, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; /* end of extern "C" */
|
||||
|
@@ -61,22 +61,11 @@
|
||||
extern int gMallocLeakZygoteChild;
|
||||
extern pthread_mutex_t gAllocationsMutex;
|
||||
extern HashTable gHashTable;
|
||||
extern const MallocDebug __libc_malloc_default_dispatch;
|
||||
extern const MallocDebug* __libc_malloc_dispatch;
|
||||
|
||||
// =============================================================================
|
||||
// log functions
|
||||
// stack trace functions
|
||||
// =============================================================================
|
||||
|
||||
#define debug_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_DEBUG, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
||||
#define error_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_ERROR, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
||||
#define info_log(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_INFO, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
||||
|
||||
static int gTrapOnError = 1;
|
||||
|
||||
#define MALLOC_ALIGNMENT 8
|
||||
#define GUARD 0x48151642
|
||||
#define DEBUG 0
|
||||
@@ -210,246 +199,12 @@ static void remove_entry(HashEntry* entry)
|
||||
gHashTable.count--;
|
||||
}
|
||||
|
||||
|
||||
// =============================================================================
|
||||
// stack trace functions
|
||||
// =============================================================================
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
intptr_t* addrs;
|
||||
} stack_crawl_state_t;
|
||||
|
||||
|
||||
/* depends how the system includes define this */
|
||||
#ifdef HAVE_UNWIND_CONTEXT_STRUCT
|
||||
typedef struct _Unwind_Context __unwind_context;
|
||||
#else
|
||||
typedef _Unwind_Context __unwind_context;
|
||||
#endif
|
||||
|
||||
static _Unwind_Reason_Code trace_function(__unwind_context *context, void *arg)
|
||||
{
|
||||
stack_crawl_state_t* state = (stack_crawl_state_t*)arg;
|
||||
if (state->count) {
|
||||
intptr_t ip = (intptr_t)_Unwind_GetIP(context);
|
||||
if (ip) {
|
||||
state->addrs[0] = ip;
|
||||
state->addrs++;
|
||||
state->count--;
|
||||
return _URC_NO_REASON;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If we run out of space to record the address or 0 has been seen, stop
|
||||
* unwinding the stack.
|
||||
*/
|
||||
return _URC_END_OF_STACK;
|
||||
}
|
||||
|
||||
static inline
|
||||
int get_backtrace(intptr_t* addrs, size_t max_entries)
|
||||
{
|
||||
stack_crawl_state_t state;
|
||||
state.count = max_entries;
|
||||
state.addrs = (intptr_t*)addrs;
|
||||
_Unwind_Backtrace(trace_function, (void*)&state);
|
||||
return max_entries - state.count;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// malloc check functions
|
||||
// malloc fill functions
|
||||
// =============================================================================
|
||||
|
||||
#define CHK_FILL_FREE 0xef
|
||||
#define CHK_SENTINEL_VALUE (char)0xeb
|
||||
#define CHK_SENTINEL_HEAD_SIZE 16
|
||||
#define CHK_SENTINEL_TAIL_SIZE 16
|
||||
#define CHK_OVERHEAD_SIZE ( CHK_SENTINEL_HEAD_SIZE + \
|
||||
CHK_SENTINEL_TAIL_SIZE + \
|
||||
sizeof(size_t) )
|
||||
|
||||
static void dump_stack_trace()
|
||||
{
|
||||
intptr_t addrs[20];
|
||||
int c = get_backtrace(addrs, 20);
|
||||
char buf[16];
|
||||
char tmp[16*20];
|
||||
int i;
|
||||
|
||||
tmp[0] = 0; // Need to initialize tmp[0] for the first strcat
|
||||
for (i=0 ; i<c; i++) {
|
||||
snprintf(buf, sizeof buf, "%2d: %08x\n", i, addrs[i]);
|
||||
strlcat(tmp, buf, sizeof tmp);
|
||||
}
|
||||
__libc_android_log_print(ANDROID_LOG_ERROR, "libc", "call stack:\n%s", tmp);
|
||||
}
|
||||
|
||||
static int is_valid_malloc_pointer(void* addr)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void assert_log_message(const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
pthread_mutex_lock(&gAllocationsMutex);
|
||||
{
|
||||
const MallocDebug* current_dispatch = __libc_malloc_dispatch;
|
||||
__libc_malloc_dispatch = &__libc_malloc_default_dispatch;
|
||||
va_start(args, format);
|
||||
__libc_android_log_vprint(ANDROID_LOG_ERROR, "libc",
|
||||
format, args);
|
||||
va_end(args);
|
||||
dump_stack_trace();
|
||||
if (gTrapOnError) {
|
||||
__builtin_trap();
|
||||
}
|
||||
__libc_malloc_dispatch = current_dispatch;
|
||||
}
|
||||
pthread_mutex_unlock(&gAllocationsMutex);
|
||||
}
|
||||
|
||||
static void assert_valid_malloc_pointer(void* mem)
|
||||
{
|
||||
if (mem && !is_valid_malloc_pointer(mem)) {
|
||||
assert_log_message(
|
||||
"*** MALLOC CHECK: buffer %p, is not a valid "
|
||||
"malloc pointer (are you mixing up new/delete "
|
||||
"and malloc/free?)", mem);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that a given address corresponds to a guarded block,
|
||||
* and returns its original allocation size in '*allocated'.
|
||||
* 'func' is the capitalized name of the caller function.
|
||||
* Returns 0 on success, or -1 on failure.
|
||||
* NOTE: Does not return if gTrapOnError is set.
|
||||
*/
|
||||
static int chk_mem_check(void* mem,
|
||||
size_t* allocated,
|
||||
const char* func)
|
||||
{
|
||||
char* buffer;
|
||||
size_t offset, bytes;
|
||||
int i;
|
||||
char* buf;
|
||||
|
||||
/* first check the bytes in the sentinel header */
|
||||
buf = (char*)mem - CHK_SENTINEL_HEAD_SIZE;
|
||||
for (i=0 ; i<CHK_SENTINEL_HEAD_SIZE ; i++) {
|
||||
if (buf[i] != CHK_SENTINEL_VALUE) {
|
||||
assert_log_message(
|
||||
"*** %s CHECK: buffer %p "
|
||||
"corrupted %d bytes before allocation",
|
||||
func, mem, CHK_SENTINEL_HEAD_SIZE-i);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* then the ones in the sentinel trailer */
|
||||
buffer = (char*)mem - CHK_SENTINEL_HEAD_SIZE;
|
||||
offset = dlmalloc_usable_size(buffer) - sizeof(size_t);
|
||||
bytes = *(size_t *)(buffer + offset);
|
||||
|
||||
buf = (char*)mem + bytes;
|
||||
for (i=CHK_SENTINEL_TAIL_SIZE-1 ; i>=0 ; i--) {
|
||||
if (buf[i] != CHK_SENTINEL_VALUE) {
|
||||
assert_log_message(
|
||||
"*** %s CHECK: buffer %p, size=%lu, "
|
||||
"corrupted %d bytes after allocation",
|
||||
func, buffer, bytes, i+1);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
*allocated = bytes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void* chk_malloc(size_t bytes)
|
||||
{
|
||||
char* buffer = (char*)dlmalloc(bytes + CHK_OVERHEAD_SIZE);
|
||||
if (buffer) {
|
||||
memset(buffer, CHK_SENTINEL_VALUE, bytes + CHK_OVERHEAD_SIZE);
|
||||
size_t offset = dlmalloc_usable_size(buffer) - sizeof(size_t);
|
||||
*(size_t *)(buffer + offset) = bytes;
|
||||
buffer += CHK_SENTINEL_HEAD_SIZE;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void chk_free(void* mem)
|
||||
{
|
||||
assert_valid_malloc_pointer(mem);
|
||||
if (mem) {
|
||||
size_t size;
|
||||
char* buffer;
|
||||
|
||||
if (chk_mem_check(mem, &size, "FREE") == 0) {
|
||||
buffer = (char*)mem - CHK_SENTINEL_HEAD_SIZE;
|
||||
memset(buffer, CHK_FILL_FREE, size + CHK_OVERHEAD_SIZE);
|
||||
dlfree(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void* chk_calloc(size_t n_elements, size_t elem_size)
|
||||
{
|
||||
size_t size;
|
||||
void* ptr;
|
||||
|
||||
/* Fail on overflow - just to be safe even though this code runs only
|
||||
* within the debugging C library, not the production one */
|
||||
if (n_elements && MAX_SIZE_T / n_elements < elem_size) {
|
||||
return NULL;
|
||||
}
|
||||
size = n_elements * elem_size;
|
||||
ptr = chk_malloc(size);
|
||||
if (ptr != NULL) {
|
||||
memset(ptr, 0, size);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* chk_realloc(void* mem, size_t bytes)
|
||||
{
|
||||
char* buffer;
|
||||
int ret;
|
||||
size_t old_bytes = 0;
|
||||
|
||||
assert_valid_malloc_pointer(mem);
|
||||
|
||||
if (mem != NULL && chk_mem_check(mem, &old_bytes, "REALLOC") < 0)
|
||||
return NULL;
|
||||
|
||||
char* new_buffer = chk_malloc(bytes);
|
||||
if (mem == NULL) {
|
||||
return new_buffer;
|
||||
}
|
||||
|
||||
if (new_buffer) {
|
||||
if (bytes > old_bytes)
|
||||
bytes = old_bytes;
|
||||
memcpy(new_buffer, mem, bytes);
|
||||
chk_free(mem);
|
||||
}
|
||||
|
||||
return new_buffer;
|
||||
}
|
||||
|
||||
void* chk_memalign(size_t alignment, size_t bytes)
|
||||
{
|
||||
// XXX: it's better to use malloc, than being wrong
|
||||
return chk_malloc(bytes);
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// malloc fill functions
|
||||
// =============================================================================
|
||||
|
||||
void* fill_malloc(size_t bytes)
|
||||
{
|
||||
@@ -497,6 +252,9 @@ void* fill_memalign(size_t alignment, size_t bytes)
|
||||
|
||||
#define MEMALIGN_GUARD ((void*)0xA1A41520)
|
||||
|
||||
extern __LIBC_HIDDEN__
|
||||
int get_backtrace(intptr_t* addrs, size_t max_entries);
|
||||
|
||||
void* leak_malloc(size_t bytes)
|
||||
{
|
||||
// allocate enough space infront of the allocation to store the pointer for
|
||||
@@ -632,12 +390,3 @@ void* leak_memalign(size_t alignment, size_t bytes)
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
/* Initializes malloc debugging framework.
|
||||
* See comments on MallocDebugInit in malloc_debug_common.h
|
||||
*/
|
||||
int malloc_debug_initialize(void)
|
||||
{
|
||||
// We don't really have anything that requires initialization here.
|
||||
return 0;
|
||||
}
|
||||
|
@@ -287,7 +287,7 @@ static void dump_malloc_descriptor(char* str,
|
||||
/*
|
||||
* Logging helper macros.
|
||||
*/
|
||||
#define debug_log(format, ...) \
|
||||
#define qemu_debug_log(format, ...) \
|
||||
do { \
|
||||
__libc_android_log_print(ANDROID_LOG_DEBUG, "memcheck", \
|
||||
(format), ##__VA_ARGS__ ); \
|
||||
@@ -296,7 +296,7 @@ static void dump_malloc_descriptor(char* str,
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define error_log(format, ...) \
|
||||
#define qemu_error_log(format, ...) \
|
||||
do { \
|
||||
__libc_android_log_print(ANDROID_LOG_ERROR, "memcheck", \
|
||||
(format), ##__VA_ARGS__ ); \
|
||||
@@ -305,7 +305,7 @@ static void dump_malloc_descriptor(char* str,
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define info_log(format, ...) \
|
||||
#define qemu_info_log(format, ...) \
|
||||
do { \
|
||||
__libc_android_log_print(ANDROID_LOG_INFO, "memcheck", \
|
||||
(format), ##__VA_ARGS__ ); \
|
||||
@@ -692,7 +692,7 @@ memcheck_initialize(int alignment, const char* memcheck_param)
|
||||
|
||||
notify_qemu_libc_initialized(malloc_pid);
|
||||
|
||||
debug_log("Instrumented for pid=%03u: malloc=%p, free=%p, calloc=%p, realloc=%p, memalign=%p",
|
||||
qemu_debug_log("Instrumented for pid=%03u: malloc=%p, free=%p, calloc=%p, realloc=%p, memalign=%p",
|
||||
malloc_pid, qemu_instrumented_malloc, qemu_instrumented_free,
|
||||
qemu_instrumented_calloc, qemu_instrumented_realloc,
|
||||
qemu_instrumented_memalign);
|
||||
@@ -717,7 +717,7 @@ qemu_instrumented_malloc(size_t bytes)
|
||||
desc.suffix_size = DEFAULT_SUFFIX_SIZE;
|
||||
desc.ptr = dlmalloc(mallocdesc_alloc_size(&desc));
|
||||
if (desc.ptr == NULL) {
|
||||
error_log("<libc_pid=%03u, pid=%03u> malloc(%u): dlmalloc(%u) failed.",
|
||||
qemu_error_log("<libc_pid=%03u, pid=%03u> malloc(%u): dlmalloc(%u) failed.",
|
||||
malloc_pid, getpid(), bytes, mallocdesc_alloc_size(&desc));
|
||||
return NULL;
|
||||
}
|
||||
@@ -797,7 +797,7 @@ qemu_instrumented_calloc(size_t n_elements, size_t elem_size)
|
||||
|
||||
if (n_elements == 0 || elem_size == 0) {
|
||||
// Just let go zero bytes allocation.
|
||||
info_log("::: <libc_pid=%03u, pid=%03u>: Zero calloc redir to malloc",
|
||||
qemu_info_log("::: <libc_pid=%03u, pid=%03u>: Zero calloc redir to malloc",
|
||||
malloc_pid, getpid());
|
||||
return qemu_instrumented_malloc(0);
|
||||
}
|
||||
@@ -874,14 +874,14 @@ qemu_instrumented_realloc(void* mem, size_t bytes)
|
||||
|
||||
if (mem == NULL) {
|
||||
// Nothing to realloc. just do regular malloc.
|
||||
info_log("::: <libc_pid=%03u, pid=%03u>: realloc(%p, %u) redir to malloc",
|
||||
qemu_info_log("::: <libc_pid=%03u, pid=%03u>: realloc(%p, %u) redir to malloc",
|
||||
malloc_pid, getpid(), mem, bytes);
|
||||
return qemu_instrumented_malloc(bytes);
|
||||
}
|
||||
|
||||
if (bytes == 0) {
|
||||
// This is a "free" condition.
|
||||
info_log("::: <libc_pid=%03u, pid=%03u>: realloc(%p, %u) redir to free and malloc",
|
||||
qemu_info_log("::: <libc_pid=%03u, pid=%03u>: realloc(%p, %u) redir to free and malloc",
|
||||
malloc_pid, getpid(), mem, bytes);
|
||||
qemu_instrumented_free(mem);
|
||||
|
||||
@@ -977,7 +977,7 @@ qemu_instrumented_memalign(size_t alignment, size_t bytes)
|
||||
|
||||
if (bytes == 0) {
|
||||
// Just let go zero bytes allocation.
|
||||
info_log("::: <libc_pid=%03u, pid=%03u>: memalign(%X, %u) redir to malloc",
|
||||
qemu_info_log("::: <libc_pid=%03u, pid=%03u>: memalign(%X, %u) redir to malloc",
|
||||
malloc_pid, getpid(), alignment, bytes);
|
||||
return qemu_instrumented_malloc(0);
|
||||
}
|
||||
|
76
libc/bionic/malloc_debug_stacktrace.c
Normal file
76
libc/bionic/malloc_debug_stacktrace.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
#include <unwind.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
// =============================================================================
|
||||
// stack trace functions
|
||||
// =============================================================================
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
intptr_t* addrs;
|
||||
} stack_crawl_state_t;
|
||||
|
||||
|
||||
/* depends how the system includes define this */
|
||||
#ifdef HAVE_UNWIND_CONTEXT_STRUCT
|
||||
typedef struct _Unwind_Context __unwind_context;
|
||||
#else
|
||||
typedef _Unwind_Context __unwind_context;
|
||||
#endif
|
||||
|
||||
static _Unwind_Reason_Code trace_function(__unwind_context *context, void *arg)
|
||||
{
|
||||
stack_crawl_state_t* state = (stack_crawl_state_t*)arg;
|
||||
if (state->count) {
|
||||
intptr_t ip = (intptr_t)_Unwind_GetIP(context);
|
||||
if (ip) {
|
||||
state->addrs[0] = ip;
|
||||
state->addrs++;
|
||||
state->count--;
|
||||
return _URC_NO_REASON;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If we run out of space to record the address or 0 has been seen, stop
|
||||
* unwinding the stack.
|
||||
*/
|
||||
return _URC_END_OF_STACK;
|
||||
}
|
||||
|
||||
__LIBC_HIDDEN__
|
||||
int get_backtrace(intptr_t* addrs, size_t max_entries)
|
||||
{
|
||||
stack_crawl_state_t state;
|
||||
state.count = max_entries;
|
||||
state.addrs = (intptr_t*)addrs;
|
||||
_Unwind_Backtrace(trace_function, (void*)&state);
|
||||
return max_entries - state.count;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
903
libc/bionic/pthread_debug.c
Normal file
903
libc/bionic/pthread_debug.c
Normal file
@@ -0,0 +1,903 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/atomics.h>
|
||||
#include <sys/system_properties.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#if HAVE_DLADDR
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <unwind.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "logd.h"
|
||||
#include "bionic_tls.h"
|
||||
|
||||
/*
|
||||
* ===========================================================================
|
||||
* Deadlock prediction
|
||||
* ===========================================================================
|
||||
*/
|
||||
/*
|
||||
The idea is to predict the possibility of deadlock by recording the order
|
||||
in which locks are acquired. If we see an attempt to acquire a lock
|
||||
out of order, we can identify the locks and offending code.
|
||||
|
||||
To make this work, we need to keep track of the locks held by each thread,
|
||||
and create history trees for each lock. When a thread tries to acquire
|
||||
a new lock, we walk through the "history children" of the lock, looking
|
||||
for a match with locks the thread already holds. If we find a match,
|
||||
it means the thread has made a request that could result in a deadlock.
|
||||
|
||||
To support recursive locks, we always allow re-locking a currently-held
|
||||
lock, and maintain a recursion depth count.
|
||||
|
||||
An ASCII-art example, where letters represent locks:
|
||||
|
||||
A
|
||||
/|\
|
||||
/ | \
|
||||
B | D
|
||||
\ |
|
||||
\|
|
||||
C
|
||||
|
||||
The above is the tree we'd have after handling lock synchronization
|
||||
sequences "ABC", "AC", "AD". A has three children, {B, C, D}. C is also
|
||||
a child of B. (The lines represent pointers between parent and child.
|
||||
Every node can have multiple parents and multiple children.)
|
||||
|
||||
If we hold AC, and want to lock B, we recursively search through B's
|
||||
children to see if A or C appears. It does, so we reject the attempt.
|
||||
(A straightforward way to implement it: add a link from C to B, then
|
||||
determine whether the graph starting at B contains a cycle.)
|
||||
|
||||
If we hold AC and want to lock D, we would succeed, creating a new link
|
||||
from C to D.
|
||||
|
||||
Updates to MutexInfo structs are only allowed for the thread that holds
|
||||
the lock, so we actually do most of our deadlock prediction work after
|
||||
the lock has been acquired.
|
||||
*/
|
||||
|
||||
// =============================================================================
|
||||
// log functions
|
||||
// =============================================================================
|
||||
|
||||
#define LOGD(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_DEBUG, \
|
||||
"pthread_debug", (format), ##__VA_ARGS__ )
|
||||
|
||||
#define LOGW(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_WARN, \
|
||||
"pthread_debug", (format), ##__VA_ARGS__ )
|
||||
|
||||
#define LOGE(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_ERROR, \
|
||||
"pthread_debug", (format), ##__VA_ARGS__ )
|
||||
|
||||
#define LOGI(format, ...) \
|
||||
__libc_android_log_print(ANDROID_LOG_INFO, \
|
||||
"pthread_debug", (format), ##__VA_ARGS__ )
|
||||
|
||||
static const char* const kStartBanner =
|
||||
"===============================================================";
|
||||
|
||||
static const char* const kEndBanner =
|
||||
"===============================================================";
|
||||
|
||||
extern char* __progname;
|
||||
|
||||
// =============================================================================
|
||||
// map info functions
|
||||
// =============================================================================
|
||||
|
||||
typedef struct mapinfo {
|
||||
struct mapinfo *next;
|
||||
unsigned start;
|
||||
unsigned end;
|
||||
char name[];
|
||||
} mapinfo;
|
||||
|
||||
static mapinfo* sMapInfo = NULL;
|
||||
|
||||
static mapinfo *parse_maps_line(char *line)
|
||||
{
|
||||
mapinfo *mi;
|
||||
int len = strlen(line);
|
||||
|
||||
if(len < 1) return 0;
|
||||
line[--len] = 0;
|
||||
|
||||
if(len < 50) return 0;
|
||||
if(line[20] != 'x') return 0;
|
||||
|
||||
mi = malloc(sizeof(mapinfo) + (len - 47));
|
||||
if(mi == 0) return 0;
|
||||
|
||||
mi->start = strtoul(line, 0, 16);
|
||||
mi->end = strtoul(line + 9, 0, 16);
|
||||
/* To be filled in parse_elf_info if the mapped section starts with
|
||||
* elf_header
|
||||
*/
|
||||
mi->next = 0;
|
||||
strcpy(mi->name, line + 49);
|
||||
|
||||
return mi;
|
||||
}
|
||||
|
||||
static mapinfo *init_mapinfo(int pid)
|
||||
{
|
||||
struct mapinfo *milist = NULL;
|
||||
char data[1024];
|
||||
sprintf(data, "/proc/%d/maps", pid);
|
||||
FILE *fp = fopen(data, "r");
|
||||
if(fp) {
|
||||
while(fgets(data, sizeof(data), fp)) {
|
||||
mapinfo *mi = parse_maps_line(data);
|
||||
if(mi) {
|
||||
mi->next = milist;
|
||||
milist = mi;
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return milist;
|
||||
}
|
||||
|
||||
static void deinit_mapinfo(mapinfo *mi)
|
||||
{
|
||||
mapinfo *del;
|
||||
while(mi) {
|
||||
del = mi;
|
||||
mi = mi->next;
|
||||
free(del);
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the containing map info for the pc */
|
||||
static const mapinfo *pc_to_mapinfo(mapinfo *mi, unsigned pc, unsigned *rel_pc)
|
||||
{
|
||||
*rel_pc = pc;
|
||||
while(mi) {
|
||||
if((pc >= mi->start) && (pc < mi->end)){
|
||||
// Only calculate the relative offset for shared libraries
|
||||
if (strstr(mi->name, ".so")) {
|
||||
*rel_pc -= mi->start;
|
||||
}
|
||||
return mi;
|
||||
}
|
||||
mi = mi->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// stack trace functions
|
||||
// =============================================================================
|
||||
|
||||
#define STACK_TRACE_DEPTH 16
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
intptr_t* addrs;
|
||||
} stack_crawl_state_t;
|
||||
|
||||
/* depends how the system includes define this */
|
||||
#ifdef HAVE_UNWIND_CONTEXT_STRUCT
|
||||
typedef struct _Unwind_Context __unwind_context;
|
||||
#else
|
||||
typedef _Unwind_Context __unwind_context;
|
||||
#endif
|
||||
|
||||
static _Unwind_Reason_Code trace_function(__unwind_context *context, void *arg)
|
||||
{
|
||||
stack_crawl_state_t* state = (stack_crawl_state_t*)arg;
|
||||
if (state->count) {
|
||||
intptr_t ip = (intptr_t)_Unwind_GetIP(context);
|
||||
if (ip) {
|
||||
state->addrs[0] = ip;
|
||||
state->addrs++;
|
||||
state->count--;
|
||||
return _URC_NO_REASON;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If we run out of space to record the address or 0 has been seen, stop
|
||||
* unwinding the stack.
|
||||
*/
|
||||
return _URC_END_OF_STACK;
|
||||
}
|
||||
|
||||
static inline
|
||||
int get_backtrace(intptr_t* addrs, size_t max_entries)
|
||||
{
|
||||
stack_crawl_state_t state;
|
||||
state.count = max_entries;
|
||||
state.addrs = (intptr_t*)addrs;
|
||||
_Unwind_Backtrace(trace_function, (void*)&state);
|
||||
return max_entries - state.count;
|
||||
}
|
||||
|
||||
static void log_backtrace(intptr_t* addrs, size_t c)
|
||||
{
|
||||
int index = 0;
|
||||
size_t i;
|
||||
for (i=0 ; i<c; i++) {
|
||||
unsigned int relpc;
|
||||
void* offset = 0;
|
||||
const char* symbol = NULL;
|
||||
|
||||
#if HAVE_DLADDR
|
||||
Dl_info info;
|
||||
if (dladdr((void*)addrs[i], &info)) {
|
||||
offset = info.dli_saddr;
|
||||
symbol = info.dli_sname;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (symbol || index>0 || !HAVE_DLADDR) {
|
||||
/*
|
||||
* this test is a bit sketchy, but it allows us to skip the
|
||||
* stack trace entries due to this debugging code. it works
|
||||
* because those don't have a symbol (they're not exported)
|
||||
*/
|
||||
mapinfo const* mi = pc_to_mapinfo(sMapInfo, addrs[i], &relpc);
|
||||
char const* soname = mi ? mi->name : NULL;
|
||||
#if HAVE_DLADDR
|
||||
if (!soname)
|
||||
soname = info.dli_fname;
|
||||
#endif
|
||||
if (!soname)
|
||||
soname = "unknown";
|
||||
|
||||
if (symbol) {
|
||||
LOGW(" "
|
||||
"#%02d pc %08lx %s (%s+0x%x)",
|
||||
index, relpc, soname, symbol,
|
||||
addrs[i] - (intptr_t)offset);
|
||||
} else {
|
||||
LOGW(" "
|
||||
"#%02d pc %08lx %s",
|
||||
index, relpc, soname);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* level <= 0 : deadlock prediction disabled
|
||||
* level 1 : deadlock prediction enabled, w/o call stacks
|
||||
* level 2 : deadlock prediction enabled w/ call stacks
|
||||
*/
|
||||
#define CAPTURE_CALLSTACK 2
|
||||
static int sPthreadDebugLevel = 0;
|
||||
static pid_t sPthreadDebugDisabledThread = -1;
|
||||
static pthread_mutex_t sDbgLock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* some simple/lame malloc replacement
|
||||
* NOT thread-safe and leaks everything
|
||||
*/
|
||||
|
||||
#define DBG_ALLOC_BLOCK_SIZE PAGESIZE
|
||||
static size_t sDbgAllocOffset = DBG_ALLOC_BLOCK_SIZE;
|
||||
static char* sDbgAllocPtr = NULL;
|
||||
|
||||
static void* DbgAllocLocked(size_t size) {
|
||||
if ((sDbgAllocOffset + size) > DBG_ALLOC_BLOCK_SIZE) {
|
||||
sDbgAllocOffset = 0;
|
||||
sDbgAllocPtr = mmap(NULL, DBG_ALLOC_BLOCK_SIZE, PROT_READ|PROT_WRITE,
|
||||
MAP_ANON | MAP_PRIVATE, 0, 0);
|
||||
if (sDbgAllocPtr == MAP_FAILED) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
void* addr = sDbgAllocPtr + sDbgAllocOffset;
|
||||
sDbgAllocOffset += size;
|
||||
return addr;
|
||||
}
|
||||
|
||||
static void* debug_realloc(void *ptr, size_t size, size_t old_size) {
|
||||
void* addr = mmap(NULL, size, PROT_READ|PROT_WRITE,
|
||||
MAP_ANON | MAP_PRIVATE, 0, 0);
|
||||
if (addr != MAP_FAILED) {
|
||||
if (ptr) {
|
||||
memcpy(addr, ptr, old_size);
|
||||
munmap(ptr, old_size);
|
||||
}
|
||||
} else {
|
||||
addr = NULL;
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
struct MutexInfo;
|
||||
|
||||
typedef struct CallStack {
|
||||
intptr_t depth;
|
||||
intptr_t* addrs;
|
||||
} CallStack;
|
||||
|
||||
typedef struct MutexInfo* MutexInfoListEntry;
|
||||
typedef struct CallStack CallStackListEntry;
|
||||
|
||||
typedef struct GrowingList {
|
||||
int alloc;
|
||||
int count;
|
||||
union {
|
||||
void* data;
|
||||
MutexInfoListEntry* list;
|
||||
CallStackListEntry* stack;
|
||||
};
|
||||
} GrowingList;
|
||||
|
||||
typedef GrowingList MutexInfoList;
|
||||
typedef GrowingList CallStackList;
|
||||
|
||||
typedef struct MutexInfo {
|
||||
// thread currently holding the lock or 0
|
||||
pid_t owner;
|
||||
|
||||
// most-recently-locked doubly-linked list
|
||||
struct MutexInfo* prev;
|
||||
struct MutexInfo* next;
|
||||
|
||||
// for reentrant locks
|
||||
int lockCount;
|
||||
// when looking for loops in the graph, marks visited nodes
|
||||
int historyMark;
|
||||
// the actual mutex
|
||||
pthread_mutex_t* mutex;
|
||||
// list of locks directly acquired AFTER this one in the same thread
|
||||
MutexInfoList children;
|
||||
// list of locks directly acquired BEFORE this one in the same thread
|
||||
MutexInfoList parents;
|
||||
// list of call stacks when a new link is established to this lock form its parent
|
||||
CallStackList stacks;
|
||||
// call stack when this lock was acquired last
|
||||
int stackDepth;
|
||||
intptr_t stackTrace[STACK_TRACE_DEPTH];
|
||||
} MutexInfo;
|
||||
|
||||
static void growingListInit(GrowingList* list) {
|
||||
list->alloc = 0;
|
||||
list->count = 0;
|
||||
list->data = NULL;
|
||||
}
|
||||
|
||||
static void growingListAdd(GrowingList* pList, size_t objSize) {
|
||||
if (pList->count == pList->alloc) {
|
||||
size_t oldsize = pList->alloc * objSize;
|
||||
pList->alloc += PAGESIZE / objSize;
|
||||
size_t size = pList->alloc * objSize;
|
||||
pList->data = debug_realloc(pList->data, size, oldsize);
|
||||
}
|
||||
pList->count++;
|
||||
}
|
||||
|
||||
static void initMutexInfo(MutexInfo* object, pthread_mutex_t* mutex) {
|
||||
object->owner = 0;
|
||||
object->prev = 0;
|
||||
object->next = 0;
|
||||
object->lockCount = 0;
|
||||
object->historyMark = 0;
|
||||
object->mutex = mutex;
|
||||
growingListInit(&object->children);
|
||||
growingListInit(&object->parents);
|
||||
growingListInit(&object->stacks);
|
||||
object->stackDepth = 0;
|
||||
}
|
||||
|
||||
typedef struct ThreadInfo {
|
||||
pid_t pid;
|
||||
MutexInfo* mrl;
|
||||
} ThreadInfo;
|
||||
|
||||
static void initThreadInfo(ThreadInfo* object, pid_t pid) {
|
||||
object->pid = pid;
|
||||
object->mrl = NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static MutexInfo* get_mutex_info(pthread_mutex_t *mutex);
|
||||
static void mutex_lock_checked(MutexInfo* mrl, MutexInfo* object);
|
||||
static void mutex_unlock_checked(MutexInfo* object);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int pthread_mutex_lock_impl(pthread_mutex_t *mutex);
|
||||
extern int pthread_mutex_unlock_impl(pthread_mutex_t *mutex);
|
||||
|
||||
static int pthread_mutex_lock_unchecked(pthread_mutex_t *mutex) {
|
||||
return pthread_mutex_lock_impl(mutex);
|
||||
}
|
||||
|
||||
static int pthread_mutex_unlock_unchecked(pthread_mutex_t *mutex) {
|
||||
return pthread_mutex_unlock_impl(mutex);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static void dup_backtrace(CallStack* stack, int count, intptr_t const* addrs) {
|
||||
stack->depth = count;
|
||||
stack->addrs = DbgAllocLocked(count * sizeof(intptr_t));
|
||||
memcpy(stack->addrs, addrs, count * sizeof(intptr_t));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static int historyListHas(
|
||||
const MutexInfoList* list, MutexInfo const * obj) {
|
||||
int i;
|
||||
for (i=0; i<list->count; i++) {
|
||||
if (list->list[i] == obj) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void historyListAdd(MutexInfoList* pList, MutexInfo* obj) {
|
||||
growingListAdd(pList, sizeof(MutexInfoListEntry));
|
||||
pList->list[pList->count - 1] = obj;
|
||||
}
|
||||
|
||||
static int historyListRemove(MutexInfoList* pList, MutexInfo* obj) {
|
||||
int i;
|
||||
for (i = pList->count-1; i >= 0; i--) {
|
||||
if (pList->list[i] == obj) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i < 0) {
|
||||
// not found!
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (i != pList->count-1) {
|
||||
// copy the last entry to the new free slot
|
||||
pList->list[i] = pList->list[pList->count-1];
|
||||
}
|
||||
pList->count--;
|
||||
memset(&pList->list[pList->count], 0, sizeof(MutexInfoListEntry));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void linkParentToChild(MutexInfo* parent, MutexInfo* child) {
|
||||
historyListAdd(&parent->children, child);
|
||||
historyListAdd(&child->parents, parent);
|
||||
}
|
||||
|
||||
static void unlinkParentFromChild(MutexInfo* parent, MutexInfo* child) {
|
||||
historyListRemove(&parent->children, child);
|
||||
historyListRemove(&child->parents, parent);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static void callstackListAdd(CallStackList* pList,
|
||||
int count, intptr_t const* addrs) {
|
||||
growingListAdd(pList, sizeof(CallStackListEntry));
|
||||
dup_backtrace(&pList->stack[pList->count - 1], count, addrs);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Recursively traverse the object hierarchy starting at "obj". We mark
|
||||
* ourselves on entry and clear the mark on exit. If we ever encounter
|
||||
* a marked object, we have a cycle.
|
||||
*
|
||||
* Returns "true" if all is well, "false" if we found a cycle.
|
||||
*/
|
||||
|
||||
static int traverseTree(MutexInfo* obj, MutexInfo const* objParent)
|
||||
{
|
||||
/*
|
||||
* Have we been here before?
|
||||
*/
|
||||
if (obj->historyMark) {
|
||||
int stackDepth;
|
||||
intptr_t addrs[STACK_TRACE_DEPTH];
|
||||
|
||||
/* Turn off prediction temporarily in this thread while logging */
|
||||
sPthreadDebugDisabledThread = gettid();
|
||||
|
||||
if (sMapInfo == NULL) {
|
||||
// note: we're protected by sDbgLock
|
||||
sMapInfo = init_mapinfo(getpid());
|
||||
}
|
||||
|
||||
LOGW("%s\n", kStartBanner);
|
||||
LOGW("pid: %d, tid: %d >>> %s <<<", getpid(), gettid(), __progname);
|
||||
LOGW("Illegal lock attempt:\n");
|
||||
LOGW("--- pthread_mutex_t at %p\n", obj->mutex);
|
||||
stackDepth = get_backtrace(addrs, STACK_TRACE_DEPTH);
|
||||
log_backtrace(addrs, stackDepth);
|
||||
|
||||
LOGW("+++ Currently held locks in this thread (in reverse order):");
|
||||
MutexInfo* cur = obj;
|
||||
pid_t ourtid = gettid();
|
||||
int i;
|
||||
for (i=0 ; i<cur->parents.count ; i++) {
|
||||
MutexInfo* parent = cur->parents.list[i];
|
||||
if (parent->owner == ourtid) {
|
||||
LOGW("--- pthread_mutex_t at %p\n", parent->mutex);
|
||||
if (sPthreadDebugLevel >= CAPTURE_CALLSTACK) {
|
||||
log_backtrace(parent->stackTrace, parent->stackDepth);
|
||||
}
|
||||
cur = parent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LOGW("+++ Earlier, the following lock order (from last to first) was established\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
obj->historyMark = 1;
|
||||
|
||||
MutexInfoList* pList = &obj->children;
|
||||
int result = 1;
|
||||
int i;
|
||||
for (i = pList->count-1; i >= 0; i--) {
|
||||
MutexInfo* child = pList->list[i];
|
||||
if (!traverseTree(child, obj)) {
|
||||
LOGW("--- pthread_mutex_t at %p\n", obj->mutex);
|
||||
if (sPthreadDebugLevel >= CAPTURE_CALLSTACK) {
|
||||
int index = historyListHas(&obj->parents, objParent);
|
||||
if ((size_t)index < (size_t)obj->stacks.count) {
|
||||
log_backtrace(
|
||||
obj->stacks.stack[index].addrs,
|
||||
obj->stacks.stack[index].depth);
|
||||
} else {
|
||||
log_backtrace(
|
||||
obj->stackTrace,
|
||||
obj->stackDepth);
|
||||
}
|
||||
}
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
obj->historyMark = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static void mutex_lock_checked(MutexInfo* mrl, MutexInfo* object)
|
||||
{
|
||||
pid_t tid = gettid();
|
||||
if (object->owner == tid) {
|
||||
object->lockCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
object->owner = tid;
|
||||
object->lockCount = 0;
|
||||
|
||||
if (sPthreadDebugLevel >= CAPTURE_CALLSTACK) {
|
||||
// always record the call stack when acquiring a lock.
|
||||
// it's not efficient, but is useful during diagnostics
|
||||
object->stackDepth = get_backtrace(object->stackTrace, STACK_TRACE_DEPTH);
|
||||
}
|
||||
|
||||
// no other locks held in this thread -- no deadlock possible!
|
||||
if (mrl == NULL)
|
||||
return;
|
||||
|
||||
// check if the lock we're trying to acquire is a direct descendant of
|
||||
// the most recently locked mutex in this thread, in which case we're
|
||||
// in a good situation -- no deadlock possible
|
||||
if (historyListHas(&mrl->children, object) >= 0)
|
||||
return;
|
||||
|
||||
pthread_mutex_lock_unchecked(&sDbgLock);
|
||||
|
||||
linkParentToChild(mrl, object);
|
||||
if (!traverseTree(object, mrl)) {
|
||||
deinit_mapinfo(sMapInfo);
|
||||
sMapInfo = NULL;
|
||||
LOGW("%s\n", kEndBanner);
|
||||
unlinkParentFromChild(mrl, object);
|
||||
// reenable pthread debugging for this thread
|
||||
sPthreadDebugDisabledThread = -1;
|
||||
} else {
|
||||
// record the call stack for this link
|
||||
// NOTE: the call stack is added at the same index
|
||||
// as mrl in object->parents[]
|
||||
// ie: object->parents.count == object->stacks.count, which is
|
||||
// also the index.
|
||||
if (sPthreadDebugLevel >= CAPTURE_CALLSTACK) {
|
||||
callstackListAdd(&object->stacks,
|
||||
object->stackDepth, object->stackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock_unchecked(&sDbgLock);
|
||||
}
|
||||
|
||||
static void mutex_unlock_checked(MutexInfo* object)
|
||||
{
|
||||
pid_t tid = gettid();
|
||||
if (object->owner == tid) {
|
||||
if (object->lockCount == 0) {
|
||||
object->owner = 0;
|
||||
} else {
|
||||
object->lockCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =============================================================================
|
||||
// Hash Table functions
|
||||
// =============================================================================
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define HASHTABLE_SIZE 256
|
||||
|
||||
typedef struct HashEntry HashEntry;
|
||||
struct HashEntry {
|
||||
size_t slot;
|
||||
HashEntry* prev;
|
||||
HashEntry* next;
|
||||
void* data;
|
||||
};
|
||||
|
||||
typedef struct HashTable HashTable;
|
||||
struct HashTable {
|
||||
HashEntry* slots[HASHTABLE_SIZE];
|
||||
};
|
||||
|
||||
static HashTable sMutexMap;
|
||||
static HashTable sThreadMap;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static uint32_t get_hashcode(void const * key, size_t keySize)
|
||||
{
|
||||
uint32_t h = keySize;
|
||||
char const* data = (char const*)key;
|
||||
size_t i;
|
||||
for (i = 0; i < keySize; i++) {
|
||||
h = h * 31 + *data;
|
||||
data++;
|
||||
}
|
||||
return (uint32_t)h;
|
||||
}
|
||||
|
||||
static size_t get_index(uint32_t h)
|
||||
{
|
||||
// We apply this secondary hashing discovered by Doug Lea to defend
|
||||
// against bad hashes.
|
||||
h += ~(h << 9);
|
||||
h ^= (((unsigned int) h) >> 14);
|
||||
h += (h << 4);
|
||||
h ^= (((unsigned int) h) >> 10);
|
||||
return (size_t)h & (HASHTABLE_SIZE - 1);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static void hashmap_init(HashTable* table) {
|
||||
memset(table, 0, sizeof(HashTable));
|
||||
}
|
||||
|
||||
static void hashmap_removeEntry(HashTable* table, HashEntry* entry)
|
||||
{
|
||||
HashEntry* prev = entry->prev;
|
||||
HashEntry* next = entry->next;
|
||||
if (prev != NULL) entry->prev->next = next;
|
||||
if (next != NULL) entry->next->prev = prev;
|
||||
if (prev == NULL) {
|
||||
// we are the head of the list. set the head to be next
|
||||
table->slots[entry->slot] = entry->next;
|
||||
}
|
||||
}
|
||||
|
||||
static HashEntry* hashmap_lookup(HashTable* table,
|
||||
void const* key, size_t ksize,
|
||||
int (*equals)(void const* data, void const* key))
|
||||
{
|
||||
const uint32_t hash = get_hashcode(key, ksize);
|
||||
const size_t slot = get_index(hash);
|
||||
|
||||
HashEntry* entry = table->slots[slot];
|
||||
while (entry) {
|
||||
if (equals(entry->data, key)) {
|
||||
break;
|
||||
}
|
||||
entry = entry->next;
|
||||
}
|
||||
|
||||
if (entry == NULL) {
|
||||
// create a new entry
|
||||
entry = (HashEntry*)DbgAllocLocked(sizeof(HashEntry));
|
||||
entry->data = NULL;
|
||||
entry->slot = slot;
|
||||
entry->prev = NULL;
|
||||
entry->next = table->slots[slot];
|
||||
if (entry->next != NULL) {
|
||||
entry->next->prev = entry;
|
||||
}
|
||||
table->slots[slot] = entry;
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static int MutexInfo_equals(void const* data, void const* key) {
|
||||
return ((MutexInfo const *)data)->mutex == *(pthread_mutex_t **)key;
|
||||
}
|
||||
|
||||
static MutexInfo* get_mutex_info(pthread_mutex_t *mutex)
|
||||
{
|
||||
pthread_mutex_lock_unchecked(&sDbgLock);
|
||||
|
||||
HashEntry* entry = hashmap_lookup(&sMutexMap,
|
||||
&mutex, sizeof(mutex),
|
||||
&MutexInfo_equals);
|
||||
if (entry->data == NULL) {
|
||||
entry->data = (MutexInfo*)DbgAllocLocked(sizeof(MutexInfo));
|
||||
initMutexInfo(entry->data, mutex);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock_unchecked(&sDbgLock);
|
||||
|
||||
return (MutexInfo *)entry->data;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static int ThreadInfo_equals(void const* data, void const* key) {
|
||||
return ((ThreadInfo const *)data)->pid == *(pid_t *)key;
|
||||
}
|
||||
|
||||
static ThreadInfo* get_thread_info(pid_t pid)
|
||||
{
|
||||
pthread_mutex_lock_unchecked(&sDbgLock);
|
||||
|
||||
HashEntry* entry = hashmap_lookup(&sThreadMap,
|
||||
&pid, sizeof(pid),
|
||||
&ThreadInfo_equals);
|
||||
if (entry->data == NULL) {
|
||||
entry->data = (ThreadInfo*)DbgAllocLocked(sizeof(ThreadInfo));
|
||||
initThreadInfo(entry->data, pid);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock_unchecked(&sDbgLock);
|
||||
|
||||
return (ThreadInfo *)entry->data;
|
||||
}
|
||||
|
||||
static void push_most_recently_locked(MutexInfo* mrl) {
|
||||
ThreadInfo* tinfo = get_thread_info(gettid());
|
||||
mrl->next = NULL;
|
||||
mrl->prev = tinfo->mrl;
|
||||
tinfo->mrl = mrl;
|
||||
}
|
||||
|
||||
static void remove_most_recently_locked(MutexInfo* mrl) {
|
||||
ThreadInfo* tinfo = get_thread_info(gettid());
|
||||
if (mrl->next) {
|
||||
(mrl->next)->prev = mrl->prev;
|
||||
}
|
||||
if (mrl->prev) {
|
||||
(mrl->prev)->next = mrl->next;
|
||||
}
|
||||
if (tinfo->mrl == mrl) {
|
||||
tinfo->mrl = mrl->next;
|
||||
}
|
||||
}
|
||||
|
||||
static MutexInfo* get_most_recently_locked() {
|
||||
ThreadInfo* tinfo = get_thread_info(gettid());
|
||||
return tinfo->mrl;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* pthread_debug_init() is called from libc_init_dynamic() just
|
||||
* after system properties have been initialized
|
||||
*/
|
||||
|
||||
__LIBC_HIDDEN__
|
||||
void pthread_debug_init(void) {
|
||||
char env[PROP_VALUE_MAX];
|
||||
if (__system_property_get("debug.libc.pthread", env)) {
|
||||
int level = atoi(env);
|
||||
if (level) {
|
||||
LOGI("pthread deadlock detection level %d enabled for pid %d (%s)",
|
||||
level, getpid(), __progname);
|
||||
hashmap_init(&sMutexMap);
|
||||
sPthreadDebugLevel = level;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we were allowed to grab the lock at this time. We do it
|
||||
* *after* acquiring the lock, rather than before, so that we can
|
||||
* freely update the MutexInfo struct. This seems counter-intuitive,
|
||||
* but our goal is deadlock *prediction* not deadlock *prevention*.
|
||||
* (If we actually deadlock, the situation is easy to diagnose from
|
||||
* a thread dump, so there's no point making a special effort to do
|
||||
* the checks before the lock is held.)
|
||||
*/
|
||||
|
||||
__LIBC_HIDDEN__
|
||||
void pthread_debug_mutex_lock_check(pthread_mutex_t *mutex)
|
||||
{
|
||||
if (sPthreadDebugLevel == 0) return;
|
||||
// prediction disabled for this thread
|
||||
if (sPthreadDebugDisabledThread == gettid())
|
||||
return;
|
||||
MutexInfo* object = get_mutex_info(mutex);
|
||||
MutexInfo* mrl = get_most_recently_locked();
|
||||
mutex_lock_checked(mrl, object);
|
||||
push_most_recently_locked(object);
|
||||
}
|
||||
|
||||
/*
|
||||
* pthread_debug_mutex_unlock_check() must be called with the mutex
|
||||
* still held (ie: before calling the real unlock)
|
||||
*/
|
||||
|
||||
__LIBC_HIDDEN__
|
||||
void pthread_debug_mutex_unlock_check(pthread_mutex_t *mutex)
|
||||
{
|
||||
if (sPthreadDebugLevel == 0) return;
|
||||
// prediction disabled for this thread
|
||||
if (sPthreadDebugDisabledThread == gettid())
|
||||
return;
|
||||
MutexInfo* object = get_mutex_info(mutex);
|
||||
remove_most_recently_locked(object);
|
||||
mutex_unlock_checked(object);
|
||||
}
|
@@ -47,6 +47,8 @@ typedef struct pthread_internal_t
|
||||
} pthread_internal_t;
|
||||
|
||||
extern void _init_thread(pthread_internal_t * thread, pid_t kernel_id, pthread_attr_t * attr, void * stack_base);
|
||||
void _pthread_internal_add( pthread_internal_t* thread );
|
||||
pthread_internal_t* __get_thread(void);
|
||||
|
||||
/* needed by posix-timers.c */
|
||||
|
||||
|
@@ -1,4 +1,3 @@
|
||||
/* $OpenBSD: realpath.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2003 Constantin S. Svintsoff <kostik@iclub.nsu.ru>
|
||||
*
|
||||
@@ -27,6 +26,12 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)realpath.c 8.1 (Berkeley) 2/16/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD: release/9.0.0/lib/libc/stdlib/realpath.c 217144 2011-01-08 11:04:30Z kib $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -36,23 +41,36 @@
|
||||
#include <unistd.h>
|
||||
|
||||
/*
|
||||
* char *realpath(const char *path, char resolved[PATH_MAX]);
|
||||
*
|
||||
* Find the real name of path, by removing all ".", ".." and symlink
|
||||
* components. Returns (resolved) on success, or (NULL) on failure,
|
||||
* in which case the path which caused trouble is left in (resolved).
|
||||
*/
|
||||
char *
|
||||
realpath(const char *path, char resolved[PATH_MAX])
|
||||
realpath(const char * __restrict path, char * __restrict resolved)
|
||||
{
|
||||
struct stat sb;
|
||||
char *p, *q, *s;
|
||||
size_t left_len, resolved_len;
|
||||
unsigned symlinks;
|
||||
int serrno, slen;
|
||||
int m, serrno, slen;
|
||||
char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX];
|
||||
|
||||
if (path == NULL) {
|
||||
errno = EINVAL;
|
||||
return (NULL);
|
||||
}
|
||||
if (path[0] == '\0') {
|
||||
errno = ENOENT;
|
||||
return (NULL);
|
||||
}
|
||||
serrno = errno;
|
||||
if (resolved == NULL) {
|
||||
resolved = malloc(PATH_MAX);
|
||||
if (resolved == NULL)
|
||||
return (NULL);
|
||||
m = 1;
|
||||
} else
|
||||
m = 0;
|
||||
symlinks = 0;
|
||||
if (path[0] == '/') {
|
||||
resolved[0] = '/';
|
||||
@@ -63,13 +81,20 @@ realpath(const char *path, char resolved[PATH_MAX])
|
||||
left_len = strlcpy(left, path + 1, sizeof(left));
|
||||
} else {
|
||||
if (getcwd(resolved, PATH_MAX) == NULL) {
|
||||
strlcpy(resolved, ".", PATH_MAX);
|
||||
if (m)
|
||||
free(resolved);
|
||||
else {
|
||||
resolved[0] = '.';
|
||||
resolved[1] = '\0';
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
resolved_len = strlen(resolved);
|
||||
left_len = strlcpy(left, path, sizeof(left));
|
||||
}
|
||||
if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -85,6 +110,8 @@ realpath(const char *path, char resolved[PATH_MAX])
|
||||
p = strchr(left, '/');
|
||||
s = p ? p : left + left_len;
|
||||
if (s - left >= sizeof(next_token)) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -95,6 +122,8 @@ realpath(const char *path, char resolved[PATH_MAX])
|
||||
memmove(left, s + 1, left_len + 1);
|
||||
if (resolved[resolved_len - 1] != '/') {
|
||||
if (resolved_len + 1 >= PATH_MAX) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -126,6 +155,8 @@ realpath(const char *path, char resolved[PATH_MAX])
|
||||
*/
|
||||
resolved_len = strlcat(resolved, next_token, PATH_MAX);
|
||||
if (resolved_len >= PATH_MAX) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -134,16 +165,23 @@ realpath(const char *path, char resolved[PATH_MAX])
|
||||
errno = serrno;
|
||||
return (resolved);
|
||||
}
|
||||
if (m)
|
||||
free(resolved);
|
||||
return (NULL);
|
||||
}
|
||||
if (S_ISLNK(sb.st_mode)) {
|
||||
if (symlinks++ > MAXSYMLINKS) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
errno = ELOOP;
|
||||
return (NULL);
|
||||
}
|
||||
slen = readlink(resolved, symlink, sizeof(symlink) - 1);
|
||||
if (slen < 0)
|
||||
if (slen < 0) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
return (NULL);
|
||||
}
|
||||
symlink[slen] = '\0';
|
||||
if (symlink[0] == '/') {
|
||||
resolved[1] = 0;
|
||||
@@ -164,6 +202,8 @@ realpath(const char *path, char resolved[PATH_MAX])
|
||||
if (p != NULL) {
|
||||
if (symlink[slen - 1] != '/') {
|
||||
if (slen + 1 >= sizeof(symlink)) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -172,6 +212,8 @@ realpath(const char *path, char resolved[PATH_MAX])
|
||||
}
|
||||
left_len = strlcat(symlink, left, sizeof(left));
|
||||
if (left_len >= sizeof(left)) {
|
||||
if (m)
|
||||
free(resolved);
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
|
@@ -174,7 +174,7 @@ __sem_dec(volatile unsigned int *pvalue)
|
||||
|
||||
new = SEMCOUNT_DECREMENT(old);
|
||||
}
|
||||
while (__atomic_cmpxchg((int)(old|shared),
|
||||
while (__bionic_cmpxchg((int)(old|shared),
|
||||
(int)(new|shared),
|
||||
(volatile int *)pvalue) != 0);
|
||||
return ret;
|
||||
@@ -198,7 +198,7 @@ __sem_trydec(volatile unsigned int *pvalue)
|
||||
|
||||
new = SEMCOUNT_DECREMENT(old);
|
||||
}
|
||||
while (__atomic_cmpxchg((int)(old|shared),
|
||||
while (__bionic_cmpxchg((int)(old|shared),
|
||||
(int)(new|shared),
|
||||
(volatile int *)pvalue) != 0);
|
||||
|
||||
@@ -235,7 +235,7 @@ __sem_inc(volatile unsigned int *pvalue)
|
||||
else
|
||||
new = SEMCOUNT_INCREMENT(old);
|
||||
}
|
||||
while ( __atomic_cmpxchg((int)(old|shared),
|
||||
while ( __bionic_cmpxchg((int)(old|shared),
|
||||
(int)(new|shared),
|
||||
(volatile int*)pvalue) != 0);
|
||||
|
||||
|
@@ -250,30 +250,58 @@ android_name_to_group( struct group *gr, const char *name )
|
||||
static unsigned
|
||||
app_id_from_name( const char* name )
|
||||
{
|
||||
unsigned long id;
|
||||
unsigned long userid;
|
||||
unsigned long appid;
|
||||
char* end;
|
||||
|
||||
if (memcmp(name, "app_", 4) != 0 || !isdigit(name[4]))
|
||||
if (name[0] != 'u' || !isdigit(name[1]))
|
||||
goto FAIL;
|
||||
|
||||
id = strtoul(name+4, &end, 10);
|
||||
if (*end != '\0')
|
||||
userid = strtoul(name+1, &end, 10);
|
||||
if (end[0] != '_' || end[1] == 0 || !isdigit(end[2]))
|
||||
goto FAIL;
|
||||
|
||||
id += AID_APP;
|
||||
|
||||
/* check for overflow and that the value can be
|
||||
* stored in our 32-bit uid_t/gid_t */
|
||||
if (id < AID_APP || (unsigned)id != id)
|
||||
if (end[1] == 'a')
|
||||
appid = strtoul(end+2, &end, 10) + AID_APP;
|
||||
else if (end[1] == 'i')
|
||||
appid = strtoul(end+2, &end, 10) + AID_ISOLATED_START;
|
||||
else
|
||||
goto FAIL;
|
||||
|
||||
return (unsigned)id;
|
||||
if (end[0] != 0)
|
||||
goto FAIL;
|
||||
|
||||
/* check that user id won't overflow */
|
||||
if (userid > 1000)
|
||||
goto FAIL;
|
||||
|
||||
/* check that app id is within range */
|
||||
if (appid < AID_APP || appid >= AID_USER)
|
||||
goto FAIL;
|
||||
|
||||
return (unsigned)(appid + userid*AID_USER);
|
||||
|
||||
FAIL:
|
||||
errno = ENOENT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
print_app_uid_name(uid_t uid, char* buffer, int bufferlen)
|
||||
{
|
||||
uid_t appid;
|
||||
uid_t userid;
|
||||
|
||||
appid = uid % AID_USER;
|
||||
userid = uid / AID_USER;
|
||||
|
||||
if (appid < AID_ISOLATED_START) {
|
||||
snprintf(buffer, bufferlen, "u%u_a%u", userid, appid - AID_APP);
|
||||
} else {
|
||||
snprintf(buffer, bufferlen, "u%u_i%u", userid, appid - AID_ISOLATED_START);
|
||||
}
|
||||
}
|
||||
|
||||
/* translate a uid into the corresponding app_<uid>
|
||||
* passwd structure (sets errno to ENOENT on failure)
|
||||
*/
|
||||
@@ -287,8 +315,7 @@ app_id_to_passwd(uid_t uid, stubs_state_t* state)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
snprintf( state->app_name_buffer, sizeof state->app_name_buffer,
|
||||
"app_%u", uid - AID_APP );
|
||||
print_app_uid_name(uid, state->app_name_buffer, sizeof state->app_name_buffer);
|
||||
|
||||
pw->pw_name = state->app_name_buffer;
|
||||
pw->pw_dir = "/data";
|
||||
@@ -306,14 +333,15 @@ static struct group*
|
||||
app_id_to_group(gid_t gid, stubs_state_t* state)
|
||||
{
|
||||
struct group* gr = &state->group;
|
||||
int appid;
|
||||
int userid;
|
||||
|
||||
if (gid < AID_APP) {
|
||||
errno = ENOENT;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
snprintf(state->group_name_buffer, sizeof state->group_name_buffer,
|
||||
"app_%u", gid - AID_APP);
|
||||
print_app_uid_name(gid, state->group_name_buffer, sizeof state->group_name_buffer);
|
||||
|
||||
gr->gr_name = state->group_name_buffer;
|
||||
gr->gr_gid = gid;
|
||||
|
71
libc/bionic/tdelete.c
Normal file
71
libc/bionic/tdelete.c
Normal file
@@ -0,0 +1,71 @@
|
||||
/* $NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
|
||||
* the AT&T man page says.
|
||||
*
|
||||
* The node_t structure is for internal use only, lint doesn't grok it.
|
||||
*
|
||||
* Written by reading the System V Interface Definition, not the code.
|
||||
*
|
||||
* Totally public domain.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if 0
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif
|
||||
__FBSDID("$FreeBSD: release/9.0.0/lib/libc/stdlib/tdelete.c 108694 2003-01-05 02:43:18Z tjr $");
|
||||
|
||||
#define _SEARCH_PRIVATE
|
||||
#include <search.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/*
|
||||
* delete node with given key
|
||||
*
|
||||
* vkey: key to be deleted
|
||||
* vrootp: address of the root of the tree
|
||||
* compar: function to carry out node comparisons
|
||||
*/
|
||||
void *
|
||||
tdelete(const void * __restrict vkey, void ** __restrict vrootp,
|
||||
int (*compar)(const void *, const void *))
|
||||
{
|
||||
node_t **rootp = (node_t **)vrootp;
|
||||
node_t *p, *q, *r;
|
||||
int cmp;
|
||||
|
||||
if (rootp == NULL || (p = *rootp) == NULL)
|
||||
return NULL;
|
||||
|
||||
while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0) {
|
||||
p = *rootp;
|
||||
rootp = (cmp < 0) ?
|
||||
&(*rootp)->llink : /* follow llink branch */
|
||||
&(*rootp)->rlink; /* follow rlink branch */
|
||||
if (*rootp == NULL)
|
||||
return NULL; /* key not found */
|
||||
}
|
||||
r = (*rootp)->rlink; /* D1: */
|
||||
if ((q = (*rootp)->llink) == NULL) /* Left NULL? */
|
||||
q = r;
|
||||
else if (r != NULL) { /* Right link is NULL? */
|
||||
if (r->llink == NULL) { /* D2: Find successor */
|
||||
r->llink = q;
|
||||
q = r;
|
||||
} else { /* D3: Find NULL link */
|
||||
for (q = r->llink; q->llink != NULL; q = r->llink)
|
||||
r = q;
|
||||
r->llink = q->rlink;
|
||||
q->llink = (*rootp)->llink;
|
||||
q->rlink = (*rootp)->rlink;
|
||||
}
|
||||
}
|
||||
free(*rootp); /* D4: Free node */
|
||||
*rootp = q; /* link parent to new node */
|
||||
return p;
|
||||
}
|
33
libc/bionic/tdestroy.c
Normal file
33
libc/bionic/tdestroy.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2012, The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define _SEARCH_PRIVATE
|
||||
#include <search.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* destroy a tree and free all allocated resources */
|
||||
void
|
||||
tdestroy(void *root, void (*destroy_func)(void *))
|
||||
{
|
||||
node_t *root_node = (node_t *) root;
|
||||
if (root_node == NULL) return;
|
||||
if (root_node->llink)
|
||||
tdestroy(root_node->llink, destroy_func);
|
||||
if (root_node->rlink)
|
||||
tdestroy(root_node->rlink, destroy_func);
|
||||
(*destroy_func)(root_node->key);
|
||||
free(root);
|
||||
}
|
48
libc/bionic/tfind.c
Normal file
48
libc/bionic/tfind.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/* $NetBSD: tfind.c,v 1.2 1999/09/16 11:45:37 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
|
||||
* the AT&T man page says.
|
||||
*
|
||||
* The node_t structure is for internal use only, lint doesn't grok it.
|
||||
*
|
||||
* Written by reading the System V Interface Definition, not the code.
|
||||
*
|
||||
* Totally public domain.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if 0
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: tfind.c,v 1.2 1999/09/16 11:45:37 lukem Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif
|
||||
__FBSDID("$FreeBSD: release/9.0.0/lib/libc/stdlib/tfind.c 108694 2003-01-05 02:43:18Z tjr $");
|
||||
|
||||
#define _SEARCH_PRIVATE
|
||||
#include <stdlib.h>
|
||||
#include <search.h>
|
||||
|
||||
/* find a node, or return 0 */
|
||||
void *
|
||||
tfind(vkey, vrootp, compar)
|
||||
const void *vkey; /* key to be found */
|
||||
void * const *vrootp; /* address of the tree root */
|
||||
int (*compar)(const void *, const void *);
|
||||
{
|
||||
node_t **rootp = (node_t **)vrootp;
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
while (*rootp != NULL) { /* T1: */
|
||||
int r;
|
||||
|
||||
if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */
|
||||
return *rootp; /* key found */
|
||||
rootp = (r < 0) ?
|
||||
&(*rootp)->llink : /* T3: follow left branch */
|
||||
&(*rootp)->rlink; /* T4: follow right branch */
|
||||
}
|
||||
return NULL;
|
||||
}
|
58
libc/bionic/tsearch.c
Normal file
58
libc/bionic/tsearch.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/* $NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
|
||||
* the AT&T man page says.
|
||||
*
|
||||
* The node_t structure is for internal use only, lint doesn't grok it.
|
||||
*
|
||||
* Written by reading the System V Interface Definition, not the code.
|
||||
*
|
||||
* Totally public domain.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if 0
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif
|
||||
__FBSDID("$FreeBSD: release/9.0.0/lib/libc/stdlib/tsearch.c 108694 2003-01-05 02:43:18Z tjr $");
|
||||
|
||||
#define _SEARCH_PRIVATE
|
||||
#include <search.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* find or insert datum into search tree */
|
||||
void *
|
||||
tsearch(vkey, vrootp, compar)
|
||||
const void *vkey; /* key to be located */
|
||||
void **vrootp; /* address of tree root */
|
||||
int (*compar)(const void *, const void *);
|
||||
{
|
||||
node_t *q;
|
||||
node_t **rootp = (node_t **)vrootp;
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
while (*rootp != NULL) { /* Knuth's T1: */
|
||||
int r;
|
||||
|
||||
if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */
|
||||
return *rootp; /* we found it! */
|
||||
|
||||
rootp = (r < 0) ?
|
||||
&(*rootp)->llink : /* T3: follow left branch */
|
||||
&(*rootp)->rlink; /* T4: follow right branch */
|
||||
}
|
||||
|
||||
q = malloc(sizeof(node_t)); /* T5: key not found */
|
||||
if (q != 0) { /* make new node */
|
||||
*rootp = q; /* link new node to old */
|
||||
/* LINTED const castaway ok */
|
||||
q->key = (void *)vkey; /* initialize new node */
|
||||
q->llink = q->rlink = NULL;
|
||||
}
|
||||
return q;
|
||||
}
|
66
libc/include/ar.h
Normal file
66
libc/include/ar.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $OpenBSD: ar.h,v 1.3 2003/06/02 19:34:12 millert Exp $ */
|
||||
/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Hugh Smith at The University of Guelph.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ar.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _AR_H_
|
||||
#define _AR_H_
|
||||
|
||||
/* Pre-4BSD archives had these magic numbers in them. */
|
||||
#define OARMAG1 0177555
|
||||
#define OARMAG2 0177545
|
||||
|
||||
#define ARMAG "!<arch>\n" /* ar "magic number" */
|
||||
#define SARMAG 8 /* strlen(ARMAG); */
|
||||
|
||||
#define AR_EFMT1 "#1/" /* extended format #1 */
|
||||
|
||||
struct ar_hdr {
|
||||
char ar_name[16]; /* name */
|
||||
char ar_date[12]; /* modification time */
|
||||
char ar_uid[6]; /* user id */
|
||||
char ar_gid[6]; /* group id */
|
||||
char ar_mode[8]; /* octal file permissions */
|
||||
char ar_size[10]; /* size in bytes */
|
||||
#define ARFMAG "`\n"
|
||||
char ar_fmag[2]; /* consistency check */
|
||||
};
|
||||
|
||||
#endif /* !_AR_H_ */
|
@@ -42,9 +42,13 @@ typedef struct
|
||||
int volatile value;
|
||||
} pthread_mutex_t;
|
||||
|
||||
#define PTHREAD_MUTEX_INITIALIZER {0}
|
||||
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER {0x4000}
|
||||
#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER {0x8000}
|
||||
#define __PTHREAD_MUTEX_INIT_VALUE 0
|
||||
#define __PTHREAD_RECURSIVE_MUTEX_INIT_VALUE 0x4000
|
||||
#define __PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE 0x8000
|
||||
|
||||
#define PTHREAD_MUTEX_INITIALIZER {__PTHREAD_MUTEX_INIT_VALUE}
|
||||
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER {__PTHREAD_RECURSIVE_MUTEX_INIT_VALUE}
|
||||
#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER {__PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE}
|
||||
|
||||
enum {
|
||||
PTHREAD_MUTEX_NORMAL = 0,
|
||||
|
@@ -50,21 +50,6 @@ extern struct __res_state *__res_state(void);
|
||||
extern int b64_ntop(u_char const *, size_t, char *, size_t);
|
||||
extern int b64_pton(char const *, u_char *, size_t);
|
||||
|
||||
/* Set name of default interface */
|
||||
extern void _resolv_set_default_iface(const char* ifname);
|
||||
|
||||
/* set name servers for an interface */
|
||||
extern void _resolv_set_nameservers_for_iface(const char* ifname, char** servers, int numservers);
|
||||
|
||||
/* tell resolver of the address of an interface */
|
||||
extern void _resolv_set_addr_of_iface(const char* ifname, struct in_addr* addr);
|
||||
|
||||
/* flush the cache associated with the default interface */
|
||||
extern void _resolv_flush_cache_for_default_iface();
|
||||
|
||||
/* flush the cache associated with a certain interface */
|
||||
extern void _resolv_flush_cache_for_iface(const char* ifname);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _RESOLV_H_ */
|
||||
|
46
libc/include/search.h
Normal file
46
libc/include/search.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*-
|
||||
* Written by J.T. Conklin <jtc@netbsd.org>
|
||||
* Public domain.
|
||||
*
|
||||
* $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $
|
||||
* $FreeBSD: release/9.0.0/include/search.h 105250 2002-10-16 14:29:23Z robert $
|
||||
*/
|
||||
|
||||
#ifndef _SEARCH_H_
|
||||
#define _SEARCH_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/_types.h>
|
||||
|
||||
#if 0
|
||||
#ifndef _SIZE_T_DECLARED
|
||||
typedef __size_t size_t;
|
||||
#define _SIZE_T_DECLARED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
preorder,
|
||||
postorder,
|
||||
endorder,
|
||||
leaf
|
||||
} VISIT;
|
||||
|
||||
#ifdef _SEARCH_PRIVATE
|
||||
typedef struct node {
|
||||
char *key;
|
||||
struct node *llink, *rlink;
|
||||
} node_t;
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
void *tdelete(const void * __restrict, void ** __restrict,
|
||||
int (*)(const void *, const void *));
|
||||
void *tfind(const void *, void * const *,
|
||||
int (*)(const void *, const void *));
|
||||
void *tsearch(const void *, void **, int (*)(const void *, const void *));
|
||||
void twalk(const void *, void (*)(const void *, VISIT, int));
|
||||
void tdestroy(void *, void (*)(void *));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_SEARCH_H_ */
|
@@ -452,8 +452,10 @@ extern int __isthreaded;
|
||||
* fdprintf is a better name, and some programs that use fdprintf use a
|
||||
* #define fdprintf dprintf for compatibility
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
int fdprintf(int, const char*, ...);
|
||||
int vfdprintf(int, const char*, __va_list);
|
||||
__END_DECLS
|
||||
#endif /* _GNU_SOURCE */
|
||||
|
||||
#endif /* _STDIO_H_ */
|
||||
|
@@ -67,6 +67,8 @@ extern unsigned long strtoul(const char *, char **, int);
|
||||
extern unsigned long long strtoull(const char *, char **, int);
|
||||
extern double strtod(const char *nptr, char **endptr);
|
||||
|
||||
extern int posix_memalign(void **memptr, size_t alignment, size_t size);
|
||||
|
||||
static __inline__ float strtof(const char *nptr, char **endptr)
|
||||
{
|
||||
return (float)strtod(nptr, endptr);
|
||||
|
@@ -35,54 +35,54 @@
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern void* memccpy(void *, const void *, int, size_t);
|
||||
extern void* memchr(const void *, int, size_t);
|
||||
extern void* memrchr(const void *, int, size_t);
|
||||
extern int memcmp(const void *, const void *, size_t);
|
||||
extern void* memchr(const void *, int, size_t) __purefunc;
|
||||
extern void* memrchr(const void *, int, size_t) __purefunc;
|
||||
extern int memcmp(const void *, const void *, size_t) __purefunc;
|
||||
extern void* memcpy(void *, const void *, size_t);
|
||||
extern void* memmove(void *, const void *, size_t);
|
||||
extern void* memset(void *, int, size_t);
|
||||
extern void* memmem(const void *, size_t, const void *, size_t);
|
||||
extern void* memmem(const void *, size_t, const void *, size_t) __purefunc;
|
||||
extern void memswap(void *, void *, size_t);
|
||||
|
||||
extern char* index(const char *, int);
|
||||
extern char* rindex(const char *, int);
|
||||
extern char* strchr(const char *, int);
|
||||
extern char* strrchr(const char *, int);
|
||||
extern char* index(const char *, int) __purefunc;
|
||||
extern char* rindex(const char *, int) __purefunc;
|
||||
extern char* strchr(const char *, int) __purefunc;
|
||||
extern char* strrchr(const char *, int) __purefunc;
|
||||
|
||||
extern size_t strlen(const char *);
|
||||
extern int strcmp(const char *, const char *);
|
||||
extern size_t strlen(const char *) __purefunc;
|
||||
extern int strcmp(const char *, const char *) __purefunc;
|
||||
extern char* strcpy(char *, const char *);
|
||||
extern char* strcat(char *, const char *);
|
||||
|
||||
extern int strcasecmp(const char *, const char *);
|
||||
extern int strncasecmp(const char *, const char *, size_t);
|
||||
extern int strcasecmp(const char *, const char *) __purefunc;
|
||||
extern int strncasecmp(const char *, const char *, size_t) __purefunc;
|
||||
extern char* strdup(const char *);
|
||||
|
||||
extern char* strstr(const char *, const char *);
|
||||
extern char* strcasestr(const char *haystack, const char *needle);
|
||||
extern char* strstr(const char *, const char *) __purefunc;
|
||||
extern char* strcasestr(const char *haystack, const char *needle) __purefunc;
|
||||
extern char* strtok(char *, const char *);
|
||||
extern char* strtok_r(char *, const char *, char**);
|
||||
|
||||
extern char* strerror(int);
|
||||
extern int strerror_r(int errnum, char *buf, size_t n);
|
||||
|
||||
extern size_t strnlen(const char *, size_t);
|
||||
extern size_t strnlen(const char *, size_t) __purefunc;
|
||||
extern char* strncat(char *, const char *, size_t);
|
||||
extern char* strndup(const char *, size_t);
|
||||
extern int strncmp(const char *, const char *, size_t);
|
||||
extern int strncmp(const char *, const char *, size_t) __purefunc;
|
||||
extern char* strncpy(char *, const char *, size_t);
|
||||
|
||||
extern size_t strlcat(char *, const char *, size_t);
|
||||
extern size_t strlcpy(char *, const char *, size_t);
|
||||
|
||||
extern size_t strcspn(const char *, const char *);
|
||||
extern char* strpbrk(const char *, const char *);
|
||||
extern size_t strcspn(const char *, const char *) __purefunc;
|
||||
extern char* strpbrk(const char *, const char *) __purefunc;
|
||||
extern char* strsep(char **, const char *);
|
||||
extern size_t strspn(const char *, const char *);
|
||||
|
||||
extern char* strsignal(int sig);
|
||||
|
||||
extern int strcoll(const char *, const char *);
|
||||
extern int strcoll(const char *, const char *) __purefunc;
|
||||
extern size_t strxfrm(char *, const char *, size_t);
|
||||
|
||||
__END_DECLS
|
||||
|
@@ -33,10 +33,48 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int __atomic_cmpxchg(int old, int _new, volatile int *ptr);
|
||||
extern int __atomic_swap(int _new, volatile int *ptr);
|
||||
extern int __atomic_dec(volatile int *ptr);
|
||||
extern int __atomic_inc(volatile int *ptr);
|
||||
/* Note: atomic operations that were exported by the C library didn't
|
||||
* provide any memory barriers, which created potential issues on
|
||||
* multi-core devices. We now define them as inlined calls to
|
||||
* GCC sync builtins, which always provide a full barrier.
|
||||
*
|
||||
* NOTE: The C library still exports atomic functions by the same
|
||||
* name to ensure ABI stability for existing NDK machine code.
|
||||
*
|
||||
* If you are an NDK developer, we encourage you to rebuild your
|
||||
* unmodified sources against this header as soon as possible.
|
||||
*/
|
||||
#define __ATOMIC_INLINE__ static __inline__ __attribute__((always_inline))
|
||||
|
||||
__ATOMIC_INLINE__ int
|
||||
__atomic_cmpxchg(int old, int _new, volatile int *ptr)
|
||||
{
|
||||
/* We must return 0 on success */
|
||||
return __sync_val_compare_and_swap(ptr, old, _new) != old;
|
||||
}
|
||||
|
||||
__ATOMIC_INLINE__ int
|
||||
__atomic_swap(int _new, volatile int *ptr)
|
||||
{
|
||||
int prev;
|
||||
do {
|
||||
prev = *ptr;
|
||||
} while (__sync_val_compare_and_swap(ptr, prev, _new) != prev);
|
||||
return prev;
|
||||
}
|
||||
|
||||
__ATOMIC_INLINE__ int
|
||||
__atomic_dec(volatile int *ptr)
|
||||
{
|
||||
return __sync_fetch_and_sub (ptr, 1);
|
||||
}
|
||||
|
||||
__ATOMIC_INLINE__ int
|
||||
__atomic_inc(volatile int *ptr)
|
||||
{
|
||||
return __sync_fetch_and_add (ptr, 1);
|
||||
}
|
||||
|
||||
|
||||
int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout);
|
||||
int __futex_wake(volatile void *ftx, int count);
|
||||
|
@@ -306,9 +306,11 @@
|
||||
#if __GNUC_PREREQ__(2, 96)
|
||||
#define __noreturn __attribute__((__noreturn__))
|
||||
#define __mallocfunc __attribute__((malloc))
|
||||
#define __purefunc __attribute__((pure))
|
||||
#else
|
||||
#define __noreturn
|
||||
#define __mallocfunc
|
||||
#define __purefunc
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@@ -130,4 +130,6 @@
|
||||
#define STT_LOPROC 13 /* reserved range for processor */
|
||||
#define STT_HIPROC 15 /* specific symbol types */
|
||||
|
||||
#define PT_GNU_RELRO 0x6474e552 /* Read-only post relocation */
|
||||
|
||||
#endif /* _SYS_EXEC_ELF_H_ */
|
||||
|
@@ -146,6 +146,7 @@
|
||||
#define __NR_syslog (__NR_SYSCALL_BASE + 103)
|
||||
#define __NR_sysinfo (__NR_SYSCALL_BASE + 116)
|
||||
#define __NR_personality (__NR_SYSCALL_BASE + 136)
|
||||
#define __NR_perf_event_open (__NR_SYSCALL_BASE + 364)
|
||||
#define __NR_futex (__NR_SYSCALL_BASE + 240)
|
||||
#define __NR_poll (__NR_SYSCALL_BASE + 168)
|
||||
|
||||
@@ -165,6 +166,7 @@
|
||||
#define __NR_fchmodat (__NR_SYSCALL_BASE + 333)
|
||||
#define __NR_renameat (__NR_SYSCALL_BASE + 329)
|
||||
#define __NR_unlinkat (__NR_SYSCALL_BASE + 328)
|
||||
#define __NR_faccessat (__NR_SYSCALL_BASE + 334)
|
||||
#define __NR_statfs64 (__NR_SYSCALL_BASE + 266)
|
||||
#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263)
|
||||
#define __NR_clock_settime (__NR_SYSCALL_BASE + 262)
|
||||
@@ -212,6 +214,7 @@
|
||||
#define __NR_waitid (__NR_SYSCALL_BASE + 284)
|
||||
#define __NR_kill (__NR_SYSCALL_BASE + 37)
|
||||
#define __NR_tkill (__NR_SYSCALL_BASE + 238)
|
||||
#define __NR_tgkill (__NR_SYSCALL_BASE + 270)
|
||||
#define __NR_set_thread_area (__NR_SYSCALL_BASE + 243)
|
||||
#define __NR_openat (__NR_SYSCALL_BASE + 295)
|
||||
#define __NR_madvise (__NR_SYSCALL_BASE + 219)
|
||||
@@ -225,6 +228,7 @@
|
||||
#define __NR_fchmodat (__NR_SYSCALL_BASE + 306)
|
||||
#define __NR_renameat (__NR_SYSCALL_BASE + 302)
|
||||
#define __NR_unlinkat (__NR_SYSCALL_BASE + 301)
|
||||
#define __NR_faccessat (__NR_SYSCALL_BASE + 307)
|
||||
#define __NR_statfs64 (__NR_SYSCALL_BASE + 268)
|
||||
#define __NR_clock_gettime (__NR_SYSCALL_BASE + 265)
|
||||
#define __NR_clock_settime (__NR_SYSCALL_BASE + 264)
|
||||
|
@@ -1,230 +0,0 @@
|
||||
/* auto-generated by gensyscalls.py, do not touch */
|
||||
#ifndef _BIONIC_LINUX_UNISTD_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void _exit (int);
|
||||
void _exit_thread (int);
|
||||
pid_t __fork (void);
|
||||
pid_t _waitpid (pid_t, int*, int, struct rusage*);
|
||||
int __waitid (int, pid_t, struct siginfo_t*, int,void*);
|
||||
pid_t __sys_clone (int, void*, int*, void*, int*);
|
||||
int execve (const char*, char* const*, char* const*);
|
||||
int __setuid (uid_t);
|
||||
uid_t getuid (void);
|
||||
gid_t getgid (void);
|
||||
uid_t geteuid (void);
|
||||
gid_t getegid (void);
|
||||
uid_t getresuid (uid_t *ruid, uid_t *euid, uid_t *suid);
|
||||
gid_t getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid);
|
||||
pid_t gettid (void);
|
||||
ssize_t readahead (int, off64_t, size_t);
|
||||
int getgroups (int, gid_t *);
|
||||
pid_t getpgid (pid_t);
|
||||
pid_t getppid (void);
|
||||
pid_t setsid (void);
|
||||
int setgid (gid_t);
|
||||
int seteuid (uid_t);
|
||||
int __setreuid (uid_t, uid_t);
|
||||
int __setresuid (uid_t, uid_t, uid_t);
|
||||
int setresgid (gid_t, gid_t, gid_t);
|
||||
void* __brk (void*);
|
||||
int kill (pid_t, int);
|
||||
int tkill (pid_t tid, int sig);
|
||||
int __ptrace (int request, int pid, void* addr, void* data);
|
||||
int __set_thread_area (void* user_desc);
|
||||
int __getpriority (int, int);
|
||||
int setpriority (int, int, int);
|
||||
int setrlimit (int resource, const struct rlimit *rlp);
|
||||
int getrlimit (int resource, struct rlimit *rlp);
|
||||
int getrusage (int who, struct rusage* r_usage);
|
||||
int setgroups (int, const gid_t *);
|
||||
pid_t getpgrp (void);
|
||||
int setpgid (pid_t, pid_t);
|
||||
pid_t vfork (void);
|
||||
int setregid (gid_t, gid_t);
|
||||
int chroot (const char *);
|
||||
int prctl (int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5);
|
||||
int capget (cap_user_header_t header, cap_user_data_t data);
|
||||
int capset (cap_user_header_t header, const cap_user_data_t data);
|
||||
int sigaltstack (const stack_t*, stack_t*);
|
||||
int acct (const char* filepath);
|
||||
ssize_t read (int, void*, size_t);
|
||||
ssize_t write (int, const void*, size_t);
|
||||
ssize_t pread64 (int, void *, size_t, off64_t);
|
||||
ssize_t pwrite64 (int, void *, size_t, off64_t);
|
||||
int __open (const char*, int, mode_t);
|
||||
int __openat (int, const char*, int, mode_t);
|
||||
int close (int);
|
||||
int creat (const char*, mode_t);
|
||||
off_t lseek (int, off_t, int);
|
||||
int __llseek (int, unsigned long, unsigned long, loff_t*, int);
|
||||
pid_t getpid (void);
|
||||
void * mmap (void *, size_t, int, int, int, long);
|
||||
void * __mmap2 (void*, size_t, int, int, int, long);
|
||||
int munmap (void *, size_t);
|
||||
void * mremap (void *, size_t, size_t, unsigned long);
|
||||
int msync (const void *, size_t, int);
|
||||
int mprotect (const void *, size_t, int);
|
||||
int madvise (const void *, size_t, int);
|
||||
int mlock (const void *addr, size_t len);
|
||||
int munlock (const void *addr, size_t len);
|
||||
int mincore (void* start, size_t length, unsigned char* vec);
|
||||
int __ioctl (int, int, void *);
|
||||
int readv (int, const struct iovec *, int);
|
||||
int writev (int, const struct iovec *, int);
|
||||
int __fcntl (int, int, void*);
|
||||
int flock (int, int);
|
||||
int fchmod (int, mode_t);
|
||||
int dup (int);
|
||||
int pipe (int *);
|
||||
int pipe2 (int *, int);
|
||||
int dup2 (int, int);
|
||||
int select (int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *);
|
||||
int ftruncate (int, off_t);
|
||||
int ftruncate64 (int, off64_t);
|
||||
int getdents (unsigned int, struct dirent *, unsigned int);
|
||||
int fsync (int);
|
||||
int fdatasync (int);
|
||||
int fchown (int, uid_t, gid_t);
|
||||
void sync (void);
|
||||
int __fcntl64 (int, int, void *);
|
||||
int __fstatfs64 (int, size_t, struct statfs *);
|
||||
ssize_t sendfile (int out_fd, int in_fd, off_t *offset, size_t count);
|
||||
int fstatat (int dirfd, const char *path, struct stat *buf, int flags);
|
||||
int mkdirat (int dirfd, const char *pathname, mode_t mode);
|
||||
int fchownat (int dirfd, const char *path, uid_t owner, gid_t group, int flags);
|
||||
int fchmodat (int dirfd, const char *path, mode_t mode, int flags);
|
||||
int renameat (int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
|
||||
int fsetxattr (int, const char *, const void *, size_t, int);
|
||||
ssize_t fgetxattr (int, const char *, void *, size_t);
|
||||
ssize_t flistxattr (int, char *, size_t);
|
||||
int fremovexattr (int, const char *);
|
||||
int link (const char*, const char*);
|
||||
int unlink (const char*);
|
||||
int unlinkat (int, const char *, int);
|
||||
int chdir (const char*);
|
||||
int mknod (const char*, mode_t, dev_t);
|
||||
int chmod (const char*,mode_t);
|
||||
int chown (const char *, uid_t, gid_t);
|
||||
int lchown (const char*, uid_t, gid_t);
|
||||
int mount (const char*, const char*, const char*, unsigned long, const void*);
|
||||
int umount (const char*);
|
||||
int umount2 (const char*, int);
|
||||
int fstat (int, struct stat*);
|
||||
int stat (const char *, struct stat *);
|
||||
int lstat (const char *, struct stat *);
|
||||
int mkdir (const char *, mode_t);
|
||||
int readlink (const char *, char *, size_t);
|
||||
int rmdir (const char *);
|
||||
int rename (const char *, const char *);
|
||||
int __getcwd (char * buf, size_t size);
|
||||
int access (const char *, int);
|
||||
int symlink (const char *, const char *);
|
||||
int fchdir (int);
|
||||
int truncate (const char*, off_t);
|
||||
int setxattr (const char *, const char *, const void *, size_t, int);
|
||||
int lsetxattr (const char *, const char *, const void *, size_t, int);
|
||||
ssize_t getxattr (const char *, const char *, void *, size_t);
|
||||
ssize_t lgetxattr (const char *, const char *, void *, size_t);
|
||||
ssize_t listxattr (const char *, char *, size_t);
|
||||
ssize_t llistxattr (const char *, char *, size_t);
|
||||
int removexattr (const char *, const char *);
|
||||
int lremovexattr (const char *, const char *);
|
||||
int __statfs64 (const char *, size_t, struct statfs *);
|
||||
int pause (void);
|
||||
int gettimeofday (struct timeval*, struct timezone*);
|
||||
int settimeofday (const struct timeval*, const struct timezone*);
|
||||
clock_t times (struct tms *);
|
||||
int nanosleep (const struct timespec *, struct timespec *);
|
||||
int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
||||
int clock_settime (clockid_t clk_id, const struct timespec *tp);
|
||||
int clock_getres (clockid_t clk_id, struct timespec *res);
|
||||
int clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, struct timespec *rem);
|
||||
int getitimer (int, const struct itimerval *);
|
||||
int setitimer (int, const struct itimerval *, struct itimerval *);
|
||||
int __timer_create (clockid_t clockid, struct sigevent *evp, timer_t *timerid);
|
||||
int __timer_settime (timer_t, int, const struct itimerspec*, struct itimerspec*);
|
||||
int __timer_gettime (timer_t, struct itimerspec*);
|
||||
int __timer_getoverrun (timer_t);
|
||||
int __timer_delete (timer_t);
|
||||
int utimes (const char*, const struct timeval tvp[2]);
|
||||
int utimensat (int, const char *, const struct timespec times[2], int);
|
||||
int sigaction (int, const struct sigaction *, struct sigaction *);
|
||||
int sigprocmask (int, const sigset_t *, sigset_t *);
|
||||
int __sigsuspend (int unused1, int unused2, unsigned mask);
|
||||
int __rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize);
|
||||
int __rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize);
|
||||
int __rt_sigtimedwait (const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size);
|
||||
int sigpending (sigset_t *);
|
||||
int socket (int, int, int);
|
||||
int socketpair (int, int, int, int*);
|
||||
int bind (int, struct sockaddr *, int);
|
||||
int connect (int, struct sockaddr *, socklen_t);
|
||||
int listen (int, int);
|
||||
int accept (int, struct sockaddr *, socklen_t *);
|
||||
int getsockname (int, struct sockaddr *, socklen_t *);
|
||||
int getpeername (int, struct sockaddr *, socklen_t *);
|
||||
int sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
|
||||
int recvfrom (int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *);
|
||||
int shutdown (int, int);
|
||||
int setsockopt (int, int, int, const void *, socklen_t);
|
||||
int getsockopt (int, int, int, void *, socklen_t *);
|
||||
int sendmsg (int, const struct msghdr *, unsigned int);
|
||||
int recvmsg (int, struct msghdr *, unsigned int);
|
||||
int socket (int, int, int);
|
||||
int bind (int, struct sockaddr *, int);
|
||||
int connect (int, struct sockaddr *, socklen_t);
|
||||
int listen (int, int);
|
||||
int accept (int, struct sockaddr *, socklen_t *);
|
||||
int getsockname (int, struct sockaddr *, socklen_t *);
|
||||
int getpeername (int, struct sockaddr *, socklen_t *);
|
||||
int socketpair (int, int, int, int*);
|
||||
int sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
|
||||
int recvfrom (int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *);
|
||||
int shutdown (int, int);
|
||||
int setsockopt (int, int, int, const void *, socklen_t);
|
||||
int getsockopt (int, int, int, void *, socklen_t *);
|
||||
int sendmsg (int, const struct msghdr *, unsigned int);
|
||||
int recvmsg (int, struct msghdr *, unsigned int);
|
||||
int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
|
||||
int sched_getscheduler (pid_t pid);
|
||||
int sched_yield (void);
|
||||
int sched_setparam (pid_t pid, const struct sched_param *param);
|
||||
int sched_getparam (pid_t pid, struct sched_param *param);
|
||||
int sched_get_priority_max (int policy);
|
||||
int sched_get_priority_min (int policy);
|
||||
int sched_rr_get_interval (pid_t pid, struct timespec *interval);
|
||||
int sched_setaffinity (pid_t pid, size_t setsize, const cpu_set_t* set);
|
||||
int __sched_getaffinity (pid_t pid, size_t setsize, cpu_set_t* set);
|
||||
int __getcpu (unsigned *cpu, unsigned *node, void *unused);
|
||||
int ioprio_set (int which, int who, int ioprio);
|
||||
int ioprio_get (int which, int who);
|
||||
int uname (struct utsname *);
|
||||
pid_t __wait4 (pid_t pid, int *status, int options, struct rusage *rusage);
|
||||
mode_t umask (mode_t);
|
||||
int __reboot (int, int, int, void *);
|
||||
int __syslog (int, char *, int);
|
||||
int init_module (void *, unsigned long, const char *);
|
||||
int delete_module (const char*, unsigned int);
|
||||
int klogctl (int, char *, int);
|
||||
int sysinfo (struct sysinfo *);
|
||||
int personality (unsigned long);
|
||||
int futex (void *, int, int, void *, void *, int);
|
||||
int epoll_create (int size);
|
||||
int epoll_ctl (int epfd, int op, int fd, struct epoll_event *event);
|
||||
int epoll_wait (int epfd, struct epoll_event *events, int max, int timeout);
|
||||
int inotify_init (void);
|
||||
int inotify_add_watch (int, const char *, unsigned int);
|
||||
int inotify_rm_watch (int, unsigned int);
|
||||
int poll (struct pollfd *, unsigned int, long);
|
||||
int eventfd (unsigned int, int);
|
||||
int __set_tls (void*);
|
||||
int cacheflush (long start, long end, long flags);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _BIONIC_LINUX_UNISTD_H_ */
|
@@ -29,56 +29,10 @@
|
||||
#ifndef _SYS_PERSONALITY_H_
|
||||
#define _SYS_PERSONALITY_H_
|
||||
|
||||
#include <linux/personality.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* constants taken from linux-3.0.4/include/linux/personality.h */
|
||||
|
||||
enum {
|
||||
UNAME26 = 0x0020000,
|
||||
ADDR_NO_RANDOMIZE = 0x0040000,
|
||||
FDPIC_FUNCPTRS = 0x0080000,
|
||||
MMAP_PAGE_ZERO = 0x0100000,
|
||||
ADDR_COMPAT_LAYOUT = 0x0200000,
|
||||
READ_IMPLIES_EXEC = 0x0400000,
|
||||
ADDR_LIMIT_32BIT = 0x0800000,
|
||||
SHORT_INODE = 0x1000000,
|
||||
WHOLE_SECONDS = 0x2000000,
|
||||
STICKY_TIMEOUTS = 0x4000000,
|
||||
ADDR_LIMIT_3GB = 0x8000000,
|
||||
};
|
||||
|
||||
#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \
|
||||
ADDR_NO_RANDOMIZE | \
|
||||
ADDR_COMPAT_LAYOUT | \
|
||||
MMAP_PAGE_ZERO)
|
||||
|
||||
enum {
|
||||
PER_LINUX = 0x0000,
|
||||
PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
|
||||
PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
|
||||
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
|
||||
WHOLE_SECONDS | SHORT_INODE,
|
||||
PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
|
||||
PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
|
||||
PER_BSD = 0x0006,
|
||||
PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
|
||||
PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_LINUX32 = 0x0008,
|
||||
PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
|
||||
PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,
|
||||
PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,
|
||||
PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,
|
||||
PER_RISCOS = 0x000c,
|
||||
PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
|
||||
PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||
PER_OSF4 = 0x000f,
|
||||
PER_HPUX = 0x0010,
|
||||
PER_MASK = 0x00ff,
|
||||
};
|
||||
|
||||
extern int personality (unsigned long persona);
|
||||
|
||||
__END_DECLS
|
||||
|
@@ -79,24 +79,6 @@ extern struct tm* gmtime_r(const time_t *timep, struct tm *result);
|
||||
extern char* strptime(const char *buf, const char *fmt, struct tm *tm);
|
||||
extern size_t strftime(char *s, size_t max, const char *format, const struct tm *tm);
|
||||
|
||||
/* ANDROID-BEGIN */
|
||||
struct strftime_locale {
|
||||
const char * mon[12];
|
||||
const char * month[12];
|
||||
const char * standalone_month[12];
|
||||
const char * wday[7];
|
||||
const char * weekday[7];
|
||||
const char * X_fmt;
|
||||
const char * x_fmt;
|
||||
const char * c_fmt;
|
||||
const char * am;
|
||||
const char * pm;
|
||||
const char * date_fmt;
|
||||
};
|
||||
|
||||
extern size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale* lc);
|
||||
/* ANDROID-END */
|
||||
|
||||
extern char *ctime(const time_t *timep);
|
||||
extern char *ctime_r(const time_t *timep, char *buf);
|
||||
|
||||
|
@@ -107,6 +107,7 @@ extern void endusershell(void);
|
||||
#define F_OK 0 /* Existence */
|
||||
|
||||
extern int access(const char *, int);
|
||||
extern int faccessat(int, const char *, int, int);
|
||||
extern int link(const char *, const char *);
|
||||
extern int unlink(const char *);
|
||||
extern int chdir(const char *);
|
||||
|
@@ -17,26 +17,27 @@ they can be also included before or after any Bionic C library header.
|
||||
|
||||
the generation process works as follows:
|
||||
|
||||
* 'bionic/kernel/original/'
|
||||
* 'external/kernel-headers/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'
|
||||
* 'bionic/libc/kernel/common'
|
||||
contains the non-arch-specific clean headers and directories
|
||||
(e.g. linux, asm-generic and mtd)
|
||||
|
||||
*'bionic/kernel/arch-arm/'
|
||||
* 'bionic/libc/kernel/arch-arm/'
|
||||
contains the ARM-specific directory tree of clean headers.
|
||||
|
||||
* 'bionic/kernel/arch-arm/asm'
|
||||
* 'bionic/libc/kernel/arch-arm/asm'
|
||||
contains the real ARM-specific headers
|
||||
|
||||
* 'bionic/kernel/arch-x86'
|
||||
* 'bionic/libc/kernel/arch-x86'
|
||||
'bionic/libc/kernel/arch-x86/asm'
|
||||
similarly contains all headers and symlinks to be used on x86
|
||||
|
||||
* 'bionic/kernel/tools' contains various Python and shell scripts used
|
||||
* 'bionic/libc/kernel/tools' contains various Python and shell scripts used
|
||||
to manage and re-generate the headers
|
||||
|
||||
the tools you can use are:
|
||||
@@ -56,7 +57,7 @@ the tools you can use are:
|
||||
|
||||
* 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
|
||||
'external/kernel-headers/original'. this is the script you're likely going to
|
||||
run whenever you update the original headers.
|
||||
|
||||
NOTE:
|
||||
|
@@ -7,36 +7,42 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ARM_A_OUT_H__
|
||||
#define __ARM_A_OUT_H__
|
||||
|
||||
#include <linux/personality.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct exec
|
||||
{
|
||||
__u32 a_info;
|
||||
__u32 a_text;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
__u32 a_data;
|
||||
__u32 a_bss;
|
||||
__u32 a_syms;
|
||||
__u32 a_entry;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
__u32 a_trsize;
|
||||
__u32 a_drsize;
|
||||
};
|
||||
|
||||
#define N_TXTADDR(a) (0x00008000)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define N_TRSIZE(a) ((a).a_trsize)
|
||||
#define N_DRSIZE(a) ((a).a_drsize)
|
||||
#define N_SYMSIZE(a) ((a).a_syms)
|
||||
|
||||
#define M_ARM 103
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#ifndef LIBRARY_START_TEXT
|
||||
#define LIBRARY_START_TEXT (0x00c00000)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,21 +7,25 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_PERSEUS2_H
|
||||
#define __ASM_ARCH_OMAP_PERSEUS2_H
|
||||
|
||||
#include <asm/arch/fpga.h>
|
||||
|
||||
#ifndef OMAP_SDRAM_DEVICE
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_SDRAM_DEVICE D256M_1X16_4B
|
||||
#endif
|
||||
|
||||
#define MAXIRQNUM IH_BOARD_BASE
|
||||
#define MAXFIQNUM MAXIRQNUM
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MAXSWINUM MAXIRQNUM
|
||||
|
||||
#define NR_IRQS (MAXIRQNUM + 1)
|
||||
|
||||
#endif
|
||||
|
@@ -7,157 +7,159 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _OMAP_BOARD_H
|
||||
#define _OMAP_BOARD_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/arch/gpio-switch.h>
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_TAG_CLOCK 0x4f01
|
||||
#define OMAP_TAG_MMC 0x4f02
|
||||
#define OMAP_TAG_SERIAL_CONSOLE 0x4f03
|
||||
#define OMAP_TAG_USB 0x4f04
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_TAG_LCD 0x4f05
|
||||
#define OMAP_TAG_GPIO_SWITCH 0x4f06
|
||||
#define OMAP_TAG_UART 0x4f07
|
||||
#define OMAP_TAG_FBMEM 0x4f08
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_TAG_STI_CONSOLE 0x4f09
|
||||
#define OMAP_TAG_CAMERA_SENSOR 0x4f0a
|
||||
#define OMAP_TAG_BT 0x4f0b
|
||||
|
||||
#define OMAP_TAG_BOOT_REASON 0x4f80
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_TAG_FLASH_PART 0x4f81
|
||||
#define OMAP_TAG_VERSION_STR 0x4f82
|
||||
|
||||
struct omap_clock_config {
|
||||
|
||||
u8 system_clock_type;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
struct omap_mmc_conf {
|
||||
unsigned enabled:1;
|
||||
|
||||
unsigned nomux:1;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
unsigned cover:1;
|
||||
|
||||
unsigned wire4:1;
|
||||
s16 power_pin;
|
||||
s16 switch_pin;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
s16 wp_pin;
|
||||
};
|
||||
|
||||
struct omap_mmc_config {
|
||||
struct omap_mmc_conf mmc[2];
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
struct omap_serial_console_config {
|
||||
u8 console_uart;
|
||||
u32 console_speed;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
struct omap_sti_console_config {
|
||||
unsigned enable:1;
|
||||
u8 channel;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
struct omap_camera_sensor_config {
|
||||
u16 reset_gpio;
|
||||
int (*power_on)(void * data);
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int (*power_off)(void * data);
|
||||
};
|
||||
|
||||
struct omap_usb_config {
|
||||
|
||||
unsigned register_host:1;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
unsigned register_dev:1;
|
||||
u8 otg;
|
||||
|
||||
u8 hmc_mode;
|
||||
|
||||
u8 rwc;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u8 pins[3];
|
||||
};
|
||||
|
||||
struct omap_lcd_config {
|
||||
char panel_name[16];
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
char ctrl_name[16];
|
||||
s16 nreset_gpio;
|
||||
u8 data_lines;
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct device;
|
||||
struct fb_info;
|
||||
struct omap_backlight_config {
|
||||
int default_intensity;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int (*set_power)(struct device *dev, int state);
|
||||
int (*check_fb)(struct fb_info *fb);
|
||||
};
|
||||
|
||||
struct omap_fbmem_config {
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u32 start;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
struct omap_pwm_led_platform_data {
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
const char *name;
|
||||
int intensity_timer;
|
||||
int blink_timer;
|
||||
void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
struct omap_gpio_switch_config {
|
||||
char name[12];
|
||||
u16 gpio;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int flags:4;
|
||||
int type:4;
|
||||
int key_code:24;
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct omap_uart_config {
|
||||
|
||||
unsigned int enabled_uarts;
|
||||
};
|
||||
|
||||
struct omap_flash_part_config {
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
char part_table[0];
|
||||
};
|
||||
|
||||
struct omap_boot_reason_config {
|
||||
char reason_str[12];
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
struct omap_version_config {
|
||||
char component[12];
|
||||
char version[12];
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
struct omap_board_config_entry {
|
||||
u16 tag;
|
||||
u16 len;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u8 data[0];
|
||||
};
|
||||
|
||||
struct omap_board_config_kernel {
|
||||
u16 tag;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
const void *data;
|
||||
};
|
||||
|
||||
struct omap_bluetooth_config {
|
||||
u8 chip_type;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u8 bt_uart;
|
||||
u8 bd_addr[6];
|
||||
u8 bt_sysclk;
|
||||
int bt_wakeup_gpio;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int host_wakeup_gpio;
|
||||
int reset_gpio;
|
||||
};
|
||||
|
||||
#define omap_get_config(tag, type) ((const type *) __omap_get_config((tag), sizeof(type), 0))
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define omap_get_nr_config(tag, type, nr) ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
|
||||
|
||||
#endif
|
||||
|
@@ -7,51 +7,60 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_CPU_H
|
||||
#define __ASM_ARCH_OMAP_CPU_H
|
||||
|
||||
#define omap2_cpu_rev() ((system_rev >> 8) & 0x0f)
|
||||
|
||||
#undef MULTI_OMAP1
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#undef MULTI_OMAP2
|
||||
#undef OMAP_NAME
|
||||
|
||||
#define GET_OMAP_CLASS (system_rev & 0xff)
|
||||
|
||||
#define IS_OMAP_CLASS(class, id) static inline int is_omap ##class (void) { return (GET_OMAP_CLASS == (id)) ? 1 : 0; }
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define GET_OMAP_SUBCLASS ((system_rev >> 20) & 0x0fff)
|
||||
|
||||
#define IS_OMAP_SUBCLASS(subclass, id) static inline int is_omap ##subclass (void) { return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; }
|
||||
|
||||
#define cpu_is_omap7xx() 0
|
||||
#define cpu_is_omap15xx() 0
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define cpu_is_omap16xx() 0
|
||||
#define cpu_is_omap24xx() 0
|
||||
#define cpu_is_omap242x() 0
|
||||
#define cpu_is_omap243x() 0
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#ifdef MULTI_OMAP1
|
||||
#else
|
||||
#endif
|
||||
#define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define IS_OMAP_TYPE(type, id) static inline int is_omap ##type (void) { return (GET_OMAP_TYPE == (id)) ? 1 : 0; }
|
||||
#define cpu_is_omap310() 0
|
||||
#define cpu_is_omap730() 0
|
||||
#define cpu_is_omap1510() 0
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define cpu_is_omap1610() 0
|
||||
#define cpu_is_omap5912() 0
|
||||
#define cpu_is_omap1611() 0
|
||||
#define cpu_is_omap1621() 0
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define cpu_is_omap1710() 0
|
||||
#define cpu_is_omap2420() 0
|
||||
#define cpu_is_omap2422() 0
|
||||
#define cpu_is_omap2423() 0
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define cpu_is_omap2430() 0
|
||||
#ifdef MULTI_OMAP1
|
||||
#else
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define cpu_class_is_omap1() (cpu_is_omap730() || cpu_is_omap15xx() || cpu_is_omap16xx())
|
||||
#define cpu_class_is_omap2() cpu_is_omap24xx()
|
||||
#endif
|
||||
|
@@ -7,312 +7,362 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_DMA_H
|
||||
#define __ASM_ARCH_DMA_H
|
||||
|
||||
#define OMAP_DMA_BASE (0xfffed800)
|
||||
#define OMAP_DMA_GCR (OMAP_DMA_BASE + 0x400)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_GSCR (OMAP_DMA_BASE + 0x404)
|
||||
#define OMAP_DMA_GRST (OMAP_DMA_BASE + 0x408)
|
||||
#define OMAP_DMA_HW_ID (OMAP_DMA_BASE + 0x442)
|
||||
#define OMAP_DMA_PCH2_ID (OMAP_DMA_BASE + 0x444)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_PCH0_ID (OMAP_DMA_BASE + 0x446)
|
||||
#define OMAP_DMA_PCH1_ID (OMAP_DMA_BASE + 0x448)
|
||||
#define OMAP_DMA_PCHG_ID (OMAP_DMA_BASE + 0x44a)
|
||||
#define OMAP_DMA_PCHD_ID (OMAP_DMA_BASE + 0x44c)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CAPS_0_U (OMAP_DMA_BASE + 0x44e)
|
||||
#define OMAP_DMA_CAPS_0_L (OMAP_DMA_BASE + 0x450)
|
||||
#define OMAP_DMA_CAPS_1_U (OMAP_DMA_BASE + 0x452)
|
||||
#define OMAP_DMA_CAPS_1_L (OMAP_DMA_BASE + 0x454)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CAPS_2 (OMAP_DMA_BASE + 0x456)
|
||||
#define OMAP_DMA_CAPS_3 (OMAP_DMA_BASE + 0x458)
|
||||
#define OMAP_DMA_CAPS_4 (OMAP_DMA_BASE + 0x45a)
|
||||
#define OMAP_DMA_PCH2_SR (OMAP_DMA_BASE + 0x460)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_PCH0_SR (OMAP_DMA_BASE + 0x480)
|
||||
#define OMAP_DMA_PCH1_SR (OMAP_DMA_BASE + 0x482)
|
||||
#define OMAP_DMA_PCHD_SR (OMAP_DMA_BASE + 0x4c0)
|
||||
|
||||
#define OMAP24XX_DMA_BASE (L4_24XX_BASE + 0x56000)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA4_REVISION (OMAP24XX_DMA_BASE + 0x00)
|
||||
#define OMAP_DMA4_GCR_REG (OMAP24XX_DMA_BASE + 0x78)
|
||||
#define OMAP_DMA4_IRQSTATUS_L0 (OMAP24XX_DMA_BASE + 0x08)
|
||||
#define OMAP_DMA4_IRQSTATUS_L1 (OMAP24XX_DMA_BASE + 0x0c)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA4_IRQSTATUS_L2 (OMAP24XX_DMA_BASE + 0x10)
|
||||
#define OMAP_DMA4_IRQSTATUS_L3 (OMAP24XX_DMA_BASE + 0x14)
|
||||
#define OMAP_DMA4_IRQENABLE_L0 (OMAP24XX_DMA_BASE + 0x18)
|
||||
#define OMAP_DMA4_IRQENABLE_L1 (OMAP24XX_DMA_BASE + 0x1c)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA4_IRQENABLE_L2 (OMAP24XX_DMA_BASE + 0x20)
|
||||
#define OMAP_DMA4_IRQENABLE_L3 (OMAP24XX_DMA_BASE + 0x24)
|
||||
#define OMAP_DMA4_SYSSTATUS (OMAP24XX_DMA_BASE + 0x28)
|
||||
#define OMAP_DMA4_CAPS_0 (OMAP24XX_DMA_BASE + 0x64)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA4_CAPS_2 (OMAP24XX_DMA_BASE + 0x6c)
|
||||
#define OMAP_DMA4_CAPS_3 (OMAP24XX_DMA_BASE + 0x70)
|
||||
#define OMAP_DMA4_CAPS_4 (OMAP24XX_DMA_BASE + 0x74)
|
||||
|
||||
#define OMAP_LOGICAL_DMA_CH_COUNT 32
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CCR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x80)
|
||||
#define OMAP_DMA_CLNK_CTRL_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x84)
|
||||
#define OMAP_DMA_CICR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x88)
|
||||
#define OMAP_DMA_CSR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x8c)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CSDP_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x90)
|
||||
#define OMAP_DMA_CEN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x94)
|
||||
#define OMAP_DMA_CFN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x98)
|
||||
#define OMAP_DMA_CSEI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CSFI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa8)
|
||||
#define OMAP_DMA_CDEI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xac)
|
||||
#define OMAP_DMA_CDFI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb0)
|
||||
#define OMAP_DMA_CSAC_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CDAC_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb8)
|
||||
|
||||
#define OMAP1_DMA_CSSA_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x08)
|
||||
#define OMAP1_DMA_CSSA_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0a)
|
||||
#define OMAP1_DMA_CDSA_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0c)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1_DMA_CDSA_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0e)
|
||||
#define OMAP1_DMA_COLOR_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x20)
|
||||
#define OMAP1_DMA_CCR2_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x24)
|
||||
#define OMAP1_DMA_COLOR_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x22)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1_DMA_LCH_CTRL_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x2a)
|
||||
|
||||
#define OMAP2_DMA_CSSA_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x9c)
|
||||
#define OMAP2_DMA_CDSA_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa0)
|
||||
#define OMAP2_DMA_CCEN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xbc)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP2_DMA_CCFN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xc0)
|
||||
#define OMAP2_DMA_COLOR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xc4)
|
||||
|
||||
#define OMAP_DMA_NO_DEVICE 0
|
||||
#define OMAP_DMA_MCSI1_TX 1
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_MCSI1_RX 2
|
||||
#define OMAP_DMA_I2C_RX 3
|
||||
#define OMAP_DMA_I2C_TX 4
|
||||
#define OMAP_DMA_EXT_NDMA_REQ 5
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_EXT_NDMA_REQ2 6
|
||||
#define OMAP_DMA_UWIRE_TX 7
|
||||
#define OMAP_DMA_MCBSP1_TX 8
|
||||
#define OMAP_DMA_MCBSP1_RX 9
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_MCBSP3_TX 10
|
||||
#define OMAP_DMA_MCBSP3_RX 11
|
||||
#define OMAP_DMA_UART1_TX 12
|
||||
#define OMAP_DMA_UART1_RX 13
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_UART2_TX 14
|
||||
#define OMAP_DMA_UART2_RX 15
|
||||
#define OMAP_DMA_MCBSP2_TX 16
|
||||
#define OMAP_DMA_MCBSP2_RX 17
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_UART3_TX 18
|
||||
#define OMAP_DMA_UART3_RX 19
|
||||
#define OMAP_DMA_CAMERA_IF_RX 20
|
||||
#define OMAP_DMA_MMC_TX 21
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_MMC_RX 22
|
||||
#define OMAP_DMA_NAND 23
|
||||
#define OMAP_DMA_IRQ_LCD_LINE 24
|
||||
#define OMAP_DMA_MEMORY_STICK 25
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_USB_W2FC_RX0 26
|
||||
#define OMAP_DMA_USB_W2FC_RX1 27
|
||||
#define OMAP_DMA_USB_W2FC_RX2 28
|
||||
#define OMAP_DMA_USB_W2FC_TX0 29
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_USB_W2FC_TX1 30
|
||||
#define OMAP_DMA_USB_W2FC_TX2 31
|
||||
|
||||
#define OMAP_DMA_CRYPTO_DES_IN 32
|
||||
#define OMAP_DMA_SPI_TX 33
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_SPI_RX 34
|
||||
#define OMAP_DMA_CRYPTO_HASH 35
|
||||
#define OMAP_DMA_CCP_ATTN 36
|
||||
#define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_0 38
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_0 39
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_1 40
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_1 41
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_2 42
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_2 43
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_3 44
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_3 45
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_4 46
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_4 47
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_5 48
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_5 49
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_6 50
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_6 51
|
||||
#define OMAP_DMA_CMT_APE_TX_CHAN_7 52
|
||||
#define OMAP_DMA_CMT_APE_RV_CHAN_7 53
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_MMC2_TX 54
|
||||
#define OMAP_DMA_MMC2_RX 55
|
||||
#define OMAP_DMA_CRYPTO_DES_OUT 56
|
||||
|
||||
#define OMAP24XX_DMA_NO_DEVICE 0
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_XTI_DMA 1
|
||||
#define OMAP24XX_DMA_EXT_DMAREQ0 2
|
||||
#define OMAP24XX_DMA_EXT_DMAREQ1 3
|
||||
#define OMAP24XX_DMA_GPMC 4
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_GFX 5
|
||||
#define OMAP24XX_DMA_DSS 6
|
||||
#define OMAP24XX_DMA_VLYNQ_TX 7
|
||||
#define OMAP24XX_DMA_CWT 8
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_AES_TX 9
|
||||
#define OMAP24XX_DMA_AES_RX 10
|
||||
#define OMAP24XX_DMA_DES_TX 11
|
||||
#define OMAP24XX_DMA_DES_RX 12
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_SHA1MD5_RX 13
|
||||
#define OMAP24XX_DMA_EXT_DMAREQ2 14
|
||||
#define OMAP24XX_DMA_EXT_DMAREQ3 15
|
||||
#define OMAP24XX_DMA_EXT_DMAREQ4 16
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_EAC_AC_RD 17
|
||||
#define OMAP24XX_DMA_EAC_AC_WR 18
|
||||
#define OMAP24XX_DMA_EAC_MD_UL_RD 19
|
||||
#define OMAP24XX_DMA_EAC_MD_UL_WR 20
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_EAC_MD_DL_RD 21
|
||||
#define OMAP24XX_DMA_EAC_MD_DL_WR 22
|
||||
#define OMAP24XX_DMA_EAC_BT_UL_RD 23
|
||||
#define OMAP24XX_DMA_EAC_BT_UL_WR 24
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_EAC_BT_DL_RD 25
|
||||
#define OMAP24XX_DMA_EAC_BT_DL_WR 26
|
||||
#define OMAP24XX_DMA_I2C1_TX 27
|
||||
#define OMAP24XX_DMA_I2C1_RX 28
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_I2C2_TX 29
|
||||
#define OMAP24XX_DMA_I2C2_RX 30
|
||||
#define OMAP24XX_DMA_MCBSP1_TX 31
|
||||
#define OMAP24XX_DMA_MCBSP1_RX 32
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_MCBSP2_TX 33
|
||||
#define OMAP24XX_DMA_MCBSP2_RX 34
|
||||
#define OMAP24XX_DMA_SPI1_TX0 35
|
||||
#define OMAP24XX_DMA_SPI1_RX0 36
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_SPI1_TX1 37
|
||||
#define OMAP24XX_DMA_SPI1_RX1 38
|
||||
#define OMAP24XX_DMA_SPI1_TX2 39
|
||||
#define OMAP24XX_DMA_SPI1_RX2 40
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_SPI1_TX3 41
|
||||
#define OMAP24XX_DMA_SPI1_RX3 42
|
||||
#define OMAP24XX_DMA_SPI2_TX0 43
|
||||
#define OMAP24XX_DMA_SPI2_RX0 44
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_SPI2_TX1 45
|
||||
#define OMAP24XX_DMA_SPI2_RX1 46
|
||||
|
||||
#define OMAP24XX_DMA_UART1_TX 49
|
||||
#define OMAP24XX_DMA_UART1_RX 50
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_UART2_TX 51
|
||||
#define OMAP24XX_DMA_UART2_RX 52
|
||||
#define OMAP24XX_DMA_UART3_TX 53
|
||||
#define OMAP24XX_DMA_UART3_RX 54
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_USB_W2FC_TX0 55
|
||||
#define OMAP24XX_DMA_USB_W2FC_RX0 56
|
||||
#define OMAP24XX_DMA_USB_W2FC_TX1 57
|
||||
#define OMAP24XX_DMA_USB_W2FC_RX1 58
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_USB_W2FC_TX2 59
|
||||
#define OMAP24XX_DMA_USB_W2FC_RX2 60
|
||||
#define OMAP24XX_DMA_MMC1_TX 61
|
||||
#define OMAP24XX_DMA_MMC1_RX 62
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_DMA_MS 63
|
||||
#define OMAP24XX_DMA_EXT_DMAREQ5 64
|
||||
|
||||
#define OMAP1510_DMA_LCD_BASE (0xfffedb00)
|
||||
#define OMAP1510_DMA_LCD_CTRL (OMAP1510_DMA_LCD_BASE + 0x00)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_DMA_LCD_TOP_F1_L (OMAP1510_DMA_LCD_BASE + 0x02)
|
||||
#define OMAP1510_DMA_LCD_TOP_F1_U (OMAP1510_DMA_LCD_BASE + 0x04)
|
||||
#define OMAP1510_DMA_LCD_BOT_F1_L (OMAP1510_DMA_LCD_BASE + 0x06)
|
||||
#define OMAP1510_DMA_LCD_BOT_F1_U (OMAP1510_DMA_LCD_BASE + 0x08)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1610_DMA_LCD_BASE (0xfffee300)
|
||||
#define OMAP1610_DMA_LCD_CSDP (OMAP1610_DMA_LCD_BASE + 0xc0)
|
||||
#define OMAP1610_DMA_LCD_CCR (OMAP1610_DMA_LCD_BASE + 0xc2)
|
||||
#define OMAP1610_DMA_LCD_CTRL (OMAP1610_DMA_LCD_BASE + 0xc4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1610_DMA_LCD_TOP_B1_L (OMAP1610_DMA_LCD_BASE + 0xc8)
|
||||
#define OMAP1610_DMA_LCD_TOP_B1_U (OMAP1610_DMA_LCD_BASE + 0xca)
|
||||
#define OMAP1610_DMA_LCD_BOT_B1_L (OMAP1610_DMA_LCD_BASE + 0xcc)
|
||||
#define OMAP1610_DMA_LCD_BOT_B1_U (OMAP1610_DMA_LCD_BASE + 0xce)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1610_DMA_LCD_TOP_B2_L (OMAP1610_DMA_LCD_BASE + 0xd0)
|
||||
#define OMAP1610_DMA_LCD_TOP_B2_U (OMAP1610_DMA_LCD_BASE + 0xd2)
|
||||
#define OMAP1610_DMA_LCD_BOT_B2_L (OMAP1610_DMA_LCD_BASE + 0xd4)
|
||||
#define OMAP1610_DMA_LCD_BOT_B2_U (OMAP1610_DMA_LCD_BASE + 0xd6)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1610_DMA_LCD_SRC_EI_B1 (OMAP1610_DMA_LCD_BASE + 0xd8)
|
||||
#define OMAP1610_DMA_LCD_SRC_FI_B1_L (OMAP1610_DMA_LCD_BASE + 0xda)
|
||||
#define OMAP1610_DMA_LCD_SRC_EN_B1 (OMAP1610_DMA_LCD_BASE + 0xe0)
|
||||
#define OMAP1610_DMA_LCD_SRC_FN_B1 (OMAP1610_DMA_LCD_BASE + 0xe4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea)
|
||||
#define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4)
|
||||
|
||||
#define OMAP1_DMA_TOUT_IRQ (1 << 0)
|
||||
#define OMAP_DMA_DROP_IRQ (1 << 1)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_HALF_IRQ (1 << 2)
|
||||
#define OMAP_DMA_FRAME_IRQ (1 << 3)
|
||||
#define OMAP_DMA_LAST_IRQ (1 << 4)
|
||||
#define OMAP_DMA_BLOCK_IRQ (1 << 5)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1_DMA_SYNC_IRQ (1 << 6)
|
||||
#define OMAP2_DMA_PKT_IRQ (1 << 7)
|
||||
#define OMAP2_DMA_TRANS_ERR_IRQ (1 << 8)
|
||||
#define OMAP2_DMA_SECURE_ERR_IRQ (1 << 9)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP2_DMA_SUPERVISOR_ERR_IRQ (1 << 10)
|
||||
#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
|
||||
|
||||
#define OMAP_DMA_DATA_TYPE_S8 0x00
|
||||
#define OMAP_DMA_DATA_TYPE_S16 0x01
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_DATA_TYPE_S32 0x02
|
||||
|
||||
#define OMAP_DMA_SYNC_ELEMENT 0x00
|
||||
#define OMAP_DMA_SYNC_FRAME 0x01
|
||||
#define OMAP_DMA_SYNC_BLOCK 0x02
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_PORT_EMIFF 0x00
|
||||
#define OMAP_DMA_PORT_EMIFS 0x01
|
||||
#define OMAP_DMA_PORT_OCP_T1 0x02
|
||||
#define OMAP_DMA_PORT_TIPB 0x03
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_PORT_OCP_T2 0x04
|
||||
#define OMAP_DMA_PORT_MPUI 0x05
|
||||
|
||||
#define OMAP_DMA_AMODE_CONSTANT 0x00
|
||||
#define OMAP_DMA_AMODE_POST_INC 0x01
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_DMA_AMODE_SINGLE_IDX 0x02
|
||||
#define OMAP_DMA_AMODE_DOUBLE_IDX 0x03
|
||||
|
||||
enum {
|
||||
OMAP_LCD_DMA_B1_TOP,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
OMAP_LCD_DMA_B1_BOTTOM,
|
||||
OMAP_LCD_DMA_B2_TOP,
|
||||
OMAP_LCD_DMA_B2_BOTTOM
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
enum omap_dma_burst_mode {
|
||||
OMAP_DMA_DATA_BURST_DIS = 0,
|
||||
OMAP_DMA_DATA_BURST_4,
|
||||
OMAP_DMA_DATA_BURST_8,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
OMAP_DMA_DATA_BURST_16,
|
||||
};
|
||||
|
||||
enum omap_dma_color_mode {
|
||||
OMAP_DMA_COLOR_DIS = 0,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
OMAP_DMA_CONSTANT_FILL,
|
||||
OMAP_DMA_TRANSPARENT_COPY
|
||||
};
|
||||
|
||||
enum omap_dma_write_mode {
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
OMAP_DMA_WRITE_NON_POSTED = 0,
|
||||
OMAP_DMA_WRITE_POSTED,
|
||||
OMAP_DMA_WRITE_LAST_NON_POSTED
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct omap_dma_channel_params {
|
||||
int data_type;
|
||||
int elem_count;
|
||||
int frame_count;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int src_port;
|
||||
int src_amode;
|
||||
unsigned long src_start;
|
||||
int src_ei;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int src_fi;
|
||||
|
||||
int dst_port;
|
||||
int dst_amode;
|
||||
unsigned long dst_start;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int dst_ei;
|
||||
int dst_fi;
|
||||
|
||||
int trigger;
|
||||
int sync_mode;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int src_or_dst_synch;
|
||||
|
||||
int ie;
|
||||
};
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,154 +7,162 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_FPGA_H
|
||||
#define __ASM_ARCH_OMAP_FPGA_H
|
||||
|
||||
#define omap1510_fpga_init_irq() (0)
|
||||
|
||||
#define fpga_read(reg) __raw_readb(reg)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define fpga_write(val, reg) __raw_writeb(val, reg)
|
||||
|
||||
#define H2P2_DBG_FPGA_BASE 0xE8000000
|
||||
#define H2P2_DBG_FPGA_SIZE SZ_4K
|
||||
#define H2P2_DBG_FPGA_START 0x04000000
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
|
||||
#define H2P2_DBG_FPGA_FPGA_REV (H2P2_DBG_FPGA_BASE + 0x10)
|
||||
#define H2P2_DBG_FPGA_BOARD_REV (H2P2_DBG_FPGA_BASE + 0x12)
|
||||
#define H2P2_DBG_FPGA_GPIO (H2P2_DBG_FPGA_BASE + 0x14)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define H2P2_DBG_FPGA_LEDS (H2P2_DBG_FPGA_BASE + 0x16)
|
||||
#define H2P2_DBG_FPGA_MISC_INPUTS (H2P2_DBG_FPGA_BASE + 0x18)
|
||||
#define H2P2_DBG_FPGA_LAN_STATUS (H2P2_DBG_FPGA_BASE + 0x1A)
|
||||
#define H2P2_DBG_FPGA_LAN_RESET (H2P2_DBG_FPGA_BASE + 0x1C)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct h2p2_dbg_fpga {
|
||||
|
||||
u16 smc91x[8];
|
||||
|
||||
u16 fpga_rev;
|
||||
u16 board_rev;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u16 gpio_outputs;
|
||||
u16 leds;
|
||||
|
||||
u16 misc_inputs;
|
||||
u16 lan_status;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u16 lan_reset;
|
||||
u16 reserved0;
|
||||
|
||||
u16 ps2_data;
|
||||
u16 ps2_ctrl;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
#define H2P2_DBG_FPGA_LED_GREEN (1 << 15)
|
||||
#define H2P2_DBG_FPGA_LED_AMBER (1 << 14)
|
||||
#define H2P2_DBG_FPGA_LED_RED (1 << 13)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define H2P2_DBG_FPGA_LED_BLUE (1 << 12)
|
||||
|
||||
#define H2P2_DBG_FPGA_LOAD_METER (1 << 0)
|
||||
#define H2P2_DBG_FPGA_LOAD_METER_SIZE 11
|
||||
#define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0)
|
||||
#define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1)
|
||||
|
||||
#define OMAP1510_FPGA_BASE 0xE8000000
|
||||
#define OMAP1510_FPGA_SIZE SZ_4K
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_START 0x08000000
|
||||
|
||||
#define OMAP1510_FPGA_REV_LOW (OMAP1510_FPGA_BASE + 0x0)
|
||||
#define OMAP1510_FPGA_REV_HIGH (OMAP1510_FPGA_BASE + 0x1)
|
||||
|
||||
#define OMAP1510_FPGA_LCD_PANEL_CONTROL (OMAP1510_FPGA_BASE + 0x2)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_LED_DIGIT (OMAP1510_FPGA_BASE + 0x3)
|
||||
#define INNOVATOR_FPGA_HID_SPI (OMAP1510_FPGA_BASE + 0x4)
|
||||
#define OMAP1510_FPGA_POWER (OMAP1510_FPGA_BASE + 0x5)
|
||||
|
||||
#define OMAP1510_FPGA_ISR_LO (OMAP1510_FPGA_BASE + 0x6)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_ISR_HI (OMAP1510_FPGA_BASE + 0x7)
|
||||
|
||||
#define OMAP1510_FPGA_IMR_LO (OMAP1510_FPGA_BASE + 0x8)
|
||||
#define OMAP1510_FPGA_IMR_HI (OMAP1510_FPGA_BASE + 0x9)
|
||||
|
||||
#define OMAP1510_FPGA_HOST_RESET (OMAP1510_FPGA_BASE + 0xa)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_RST (OMAP1510_FPGA_BASE + 0xb)
|
||||
|
||||
#define OMAP1510_FPGA_AUDIO (OMAP1510_FPGA_BASE + 0xc)
|
||||
#define OMAP1510_FPGA_DIP (OMAP1510_FPGA_BASE + 0xe)
|
||||
#define OMAP1510_FPGA_FPGA_IO (OMAP1510_FPGA_BASE + 0xf)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_UART1 (OMAP1510_FPGA_BASE + 0x14)
|
||||
#define OMAP1510_FPGA_UART2 (OMAP1510_FPGA_BASE + 0x15)
|
||||
#define OMAP1510_FPGA_OMAP1510_STATUS (OMAP1510_FPGA_BASE + 0x16)
|
||||
#define OMAP1510_FPGA_BOARD_REV (OMAP1510_FPGA_BASE + 0x18)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510P1_PPT_DATA (OMAP1510_FPGA_BASE + 0x100)
|
||||
#define OMAP1510P1_PPT_STATUS (OMAP1510_FPGA_BASE + 0x101)
|
||||
#define OMAP1510P1_PPT_CONTROL (OMAP1510_FPGA_BASE + 0x102)
|
||||
|
||||
#define OMAP1510_FPGA_TOUCHSCREEN (OMAP1510_FPGA_BASE + 0x204)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INNOVATOR_FPGA_INFO (OMAP1510_FPGA_BASE + 0x205)
|
||||
#define INNOVATOR_FPGA_LCD_BRIGHT_LO (OMAP1510_FPGA_BASE + 0x206)
|
||||
#define INNOVATOR_FPGA_LCD_BRIGHT_HI (OMAP1510_FPGA_BASE + 0x207)
|
||||
#define INNOVATOR_FPGA_LED_GRN_LO (OMAP1510_FPGA_BASE + 0x208)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INNOVATOR_FPGA_LED_GRN_HI (OMAP1510_FPGA_BASE + 0x209)
|
||||
#define INNOVATOR_FPGA_LED_RED_LO (OMAP1510_FPGA_BASE + 0x20a)
|
||||
#define INNOVATOR_FPGA_LED_RED_HI (OMAP1510_FPGA_BASE + 0x20b)
|
||||
#define INNOVATOR_FPGA_CAM_USB_CONTROL (OMAP1510_FPGA_BASE + 0x20c)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INNOVATOR_FPGA_EXP_CONTROL (OMAP1510_FPGA_BASE + 0x20d)
|
||||
#define INNOVATOR_FPGA_ISR2 (OMAP1510_FPGA_BASE + 0x20e)
|
||||
#define INNOVATOR_FPGA_IMR2 (OMAP1510_FPGA_BASE + 0x210)
|
||||
|
||||
#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_RESET_VALUE 0x42
|
||||
|
||||
#define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7)
|
||||
#define OMAP1510_FPGA_PCR_COM2_EN (1 << 6)
|
||||
#define OMAP1510_FPGA_PCR_COM1_EN (1 << 5)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4)
|
||||
#define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3)
|
||||
#define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2)
|
||||
#define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0)
|
||||
|
||||
#define OMAP1510_FPGA_HID_SCLK (1<<0)
|
||||
#define OMAP1510_FPGA_HID_MOSI (1<<1)
|
||||
#define OMAP1510_FPGA_HID_nSS (1<<2)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_HID_nHSUS (1<<3)
|
||||
#define OMAP1510_FPGA_HID_MISO (1<<4)
|
||||
#define OMAP1510_FPGA_HID_ATN (1<<5)
|
||||
#define OMAP1510_FPGA_HID_rsrvd (1<<6)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_FPGA_HID_RESETn (1<<7)
|
||||
|
||||
#define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13)
|
||||
|
||||
#define OMAP1510_IH_FPGA_BASE IH_BOARD_BASE
|
||||
#define OMAP1510_INT_FPGA_ATN (OMAP1510_IH_FPGA_BASE + 0)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_INT_FPGA_ACK (OMAP1510_IH_FPGA_BASE + 1)
|
||||
#define OMAP1510_INT_FPGA2 (OMAP1510_IH_FPGA_BASE + 2)
|
||||
#define OMAP1510_INT_FPGA3 (OMAP1510_IH_FPGA_BASE + 3)
|
||||
#define OMAP1510_INT_FPGA4 (OMAP1510_IH_FPGA_BASE + 4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_INT_FPGA5 (OMAP1510_IH_FPGA_BASE + 5)
|
||||
#define OMAP1510_INT_FPGA6 (OMAP1510_IH_FPGA_BASE + 6)
|
||||
#define OMAP1510_INT_FPGA7 (OMAP1510_IH_FPGA_BASE + 7)
|
||||
#define OMAP1510_INT_FPGA8 (OMAP1510_IH_FPGA_BASE + 8)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_INT_FPGA9 (OMAP1510_IH_FPGA_BASE + 9)
|
||||
#define OMAP1510_INT_FPGA10 (OMAP1510_IH_FPGA_BASE + 10)
|
||||
#define OMAP1510_INT_FPGA11 (OMAP1510_IH_FPGA_BASE + 11)
|
||||
#define OMAP1510_INT_FPGA12 (OMAP1510_IH_FPGA_BASE + 12)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_INT_ETHER (OMAP1510_IH_FPGA_BASE + 13)
|
||||
#define OMAP1510_INT_FPGAUART1 (OMAP1510_IH_FPGA_BASE + 14)
|
||||
#define OMAP1510_INT_FPGAUART2 (OMAP1510_IH_FPGA_BASE + 15)
|
||||
#define OMAP1510_INT_FPGA_TS (OMAP1510_IH_FPGA_BASE + 16)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_INT_FPGA17 (OMAP1510_IH_FPGA_BASE + 17)
|
||||
#define OMAP1510_INT_FPGA_CAM (OMAP1510_IH_FPGA_BASE + 18)
|
||||
#define OMAP1510_INT_FPGA_RTC_A (OMAP1510_IH_FPGA_BASE + 19)
|
||||
#define OMAP1510_INT_FPGA_RTC_B (OMAP1510_IH_FPGA_BASE + 20)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1510_INT_FPGA_CD (OMAP1510_IH_FPGA_BASE + 21)
|
||||
#define OMAP1510_INT_FPGA22 (OMAP1510_IH_FPGA_BASE + 22)
|
||||
#define OMAP1510_INT_FPGA23 (OMAP1510_IH_FPGA_BASE + 23)
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,31 +7,35 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_GPIO_SWITCH_H
|
||||
#define __ASM_ARCH_OMAP_GPIO_SWITCH_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001
|
||||
#define OMAP_GPIO_SWITCH_TYPE_ACTIVITY 0x0002
|
||||
#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
|
||||
#define OMAP_GPIO_SWITCH_FLAG_OUTPUT 0x0002
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct omap_gpio_switch {
|
||||
const char *name;
|
||||
s16 gpio;
|
||||
unsigned flags:4;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
unsigned type:4;
|
||||
|
||||
u16 debounce_rising;
|
||||
|
||||
u16 debounce_falling;
|
||||
|
||||
void (* notify)(void *data, int state);
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
void *notify_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -7,43 +7,49 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_GPIO_H
|
||||
#define __ASM_ARCH_OMAP_GPIO_H
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/irqs.h>
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include <asm/io.h>
|
||||
|
||||
#define OMAP_MPUIO_BASE (void __iomem *)0xfffb5000
|
||||
|
||||
#define OMAP_MPUIO_INPUT_LATCH 0x00
|
||||
#define OMAP_MPUIO_OUTPUT 0x04
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_MPUIO_IO_CNTL 0x08
|
||||
#define OMAP_MPUIO_KBR_LATCH 0x10
|
||||
#define OMAP_MPUIO_KBC 0x14
|
||||
#define OMAP_MPUIO_GPIO_EVENT_MODE 0x18
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_MPUIO_GPIO_INT_EDGE 0x1c
|
||||
#define OMAP_MPUIO_KBD_INT 0x20
|
||||
#define OMAP_MPUIO_GPIO_INT 0x24
|
||||
#define OMAP_MPUIO_KBD_MASKIT 0x28
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_MPUIO_GPIO_MASKIT 0x2c
|
||||
#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
|
||||
#define OMAP_MPUIO_LATCH 0x34
|
||||
|
||||
#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
|
||||
|
||||
#define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ? IH_MPUIO_BASE + ((nr) & 0x0f) : IH_GPIO_BASE + (nr))
|
||||
|
||||
struct omap_machine_gpio_bank {
|
||||
int start;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
int end;
|
||||
|
||||
void (*set_gpio_direction)(int gpio, int is_input);
|
||||
void (*set_gpio_dataout)(int gpio, int enable);
|
||||
int (*get_gpio_datain)(int gpio);
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -7,151 +7,169 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_HARDWARE_H
|
||||
#define __ASM_ARCH_OMAP_HARDWARE_H
|
||||
|
||||
#include <asm/sizes.h>
|
||||
#ifndef __ASSEMBLER__
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include <asm/types.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
#endif
|
||||
#include <asm/arch/io.h>
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include <asm/arch/serial.h>
|
||||
|
||||
#define OMAP_MPU_TIMER1_BASE (0xfffec500)
|
||||
#define OMAP_MPU_TIMER2_BASE (0xfffec600)
|
||||
#define OMAP_MPU_TIMER3_BASE (0xfffec700)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MPU_TIMER_FREE (1 << 6)
|
||||
#define MPU_TIMER_CLOCK_ENABLE (1 << 5)
|
||||
#define MPU_TIMER_AR (1 << 1)
|
||||
#define MPU_TIMER_ST (1 << 0)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define CLKGEN_REG_BASE (0xfffece00)
|
||||
#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
|
||||
#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
|
||||
#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
|
||||
#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
|
||||
#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
|
||||
#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
|
||||
|
||||
#define CK_RATEF 1
|
||||
#define CK_IDLEF 2
|
||||
#define CK_ENABLEF 4
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define CK_SELECTF 8
|
||||
#define SETARM_IDLE_SHIFT
|
||||
|
||||
#define DPLL_CTL (0xfffecf00)
|
||||
|
||||
#define DSP_CONFIG_REG_BASE (0xe1008000)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
|
||||
#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
|
||||
#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
|
||||
#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ULPD_REG_BASE (0xfffe0800)
|
||||
#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
|
||||
#define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24)
|
||||
#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DIS_USB_PVCI_CLK (1 << 5)
|
||||
#define USB_MCLK_EN (1 << 4)
|
||||
#define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34)
|
||||
#define SOFT_UDC_REQ (1 << 4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define SOFT_USB_CLK_REQ (1 << 3)
|
||||
#define SOFT_DPLL_REQ (1 << 0)
|
||||
#define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c)
|
||||
#define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c)
|
||||
#define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50)
|
||||
#define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68)
|
||||
#define DIS_MMC2_DPLL_REQ (1 << 11)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DIS_MMC1_DPLL_REQ (1 << 10)
|
||||
#define DIS_UART3_DPLL_REQ (1 << 9)
|
||||
#define DIS_UART2_DPLL_REQ (1 << 8)
|
||||
#define DIS_UART1_DPLL_REQ (1 << 7)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DIS_USB_HOST_DPLL_REQ (1 << 6)
|
||||
#define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74)
|
||||
#define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c)
|
||||
|
||||
#define OMAP_MPU_WATCHDOG_BASE (0xfffec800)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0)
|
||||
#define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
|
||||
#define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
|
||||
#define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MOD_CONF_CTRL_0 0xfffe1080
|
||||
#define MOD_CONF_CTRL_1 0xfffe1110
|
||||
|
||||
#define FUNC_MUX_CTRL_0 0xfffe1000
|
||||
#define FUNC_MUX_CTRL_1 0xfffe1004
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FUNC_MUX_CTRL_2 0xfffe1008
|
||||
#define COMP_MODE_CTRL_0 0xfffe100c
|
||||
#define FUNC_MUX_CTRL_3 0xfffe1010
|
||||
#define FUNC_MUX_CTRL_4 0xfffe1014
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FUNC_MUX_CTRL_5 0xfffe1018
|
||||
#define FUNC_MUX_CTRL_6 0xfffe101C
|
||||
#define FUNC_MUX_CTRL_7 0xfffe1020
|
||||
#define FUNC_MUX_CTRL_8 0xfffe1024
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FUNC_MUX_CTRL_9 0xfffe1028
|
||||
#define FUNC_MUX_CTRL_A 0xfffe102C
|
||||
#define FUNC_MUX_CTRL_B 0xfffe1030
|
||||
#define FUNC_MUX_CTRL_C 0xfffe1034
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FUNC_MUX_CTRL_D 0xfffe1038
|
||||
#define PULL_DWN_CTRL_0 0xfffe1040
|
||||
#define PULL_DWN_CTRL_1 0xfffe1044
|
||||
#define PULL_DWN_CTRL_2 0xfffe1048
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define PULL_DWN_CTRL_3 0xfffe104c
|
||||
#define PULL_DWN_CTRL_4 0xfffe10ac
|
||||
|
||||
#define FUNC_MUX_CTRL_E 0xfffe1090
|
||||
#define FUNC_MUX_CTRL_F 0xfffe1094
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FUNC_MUX_CTRL_10 0xfffe1098
|
||||
#define FUNC_MUX_CTRL_11 0xfffe109c
|
||||
#define FUNC_MUX_CTRL_12 0xfffe10a0
|
||||
#define PU_PD_SEL_0 0xfffe10b4
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define PU_PD_SEL_1 0xfffe10b8
|
||||
#define PU_PD_SEL_2 0xfffe10bc
|
||||
#define PU_PD_SEL_3 0xfffe10c0
|
||||
#define PU_PD_SEL_4 0xfffe10c4
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_TIMER32K_BASE 0xFFFBC400
|
||||
|
||||
#define TIPB_PUBLIC_CNTL_BASE 0xfffed300
|
||||
#define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8)
|
||||
#define TIPB_PRIVATE_CNTL_BASE 0xfffeca00
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8)
|
||||
|
||||
#define MPUI_BASE (0xfffec900)
|
||||
#define MPUI_CTRL (MPUI_BASE + 0x0)
|
||||
#define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MPUI_DEBUG_DATA (MPUI_BASE + 0x8)
|
||||
#define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc)
|
||||
#define MPUI_STATUS_REG (MPUI_BASE + 0x10)
|
||||
#define MPUI_DSP_STATUS (MPUI_BASE + 0x14)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18)
|
||||
#define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c)
|
||||
|
||||
#define OMAP_LPG1_BASE 0xfffbd000
|
||||
#define OMAP_LPG2_BASE 0xfffbd800
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00)
|
||||
#define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04)
|
||||
#define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00)
|
||||
#define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_PWL_BASE 0xfffb5800
|
||||
#define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00)
|
||||
#define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04)
|
||||
|
||||
#include "omap730.h"
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include "omap1510.h"
|
||||
#include "omap24xx.h"
|
||||
#include "omap16xx.h"
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -7,48 +7,48 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_ARCH_IO_H
|
||||
#define __ASM_ARM_ARCH_IO_H
|
||||
|
||||
#include <asm/hardware.h>
|
||||
|
||||
#define IO_SPACE_LIMIT 0xffffffff
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
|
||||
#define __mem_pci(a) (a)
|
||||
|
||||
#define PCIO_BASE 0
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define omap_readb(a) (*(volatile unsigned char *)IO_ADDRESS(a))
|
||||
#define omap_readw(a) (*(volatile unsigned short *)IO_ADDRESS(a))
|
||||
#define omap_readl(a) (*(volatile unsigned int *)IO_ADDRESS(a))
|
||||
|
||||
#define omap_writeb(v,a) (*(volatile unsigned char *)IO_ADDRESS(a) = (v))
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define omap_writew(v,a) (*(volatile unsigned short *)IO_ADDRESS(a) = (v))
|
||||
#define omap_writel(v,a) (*(volatile unsigned int *)IO_ADDRESS(a) = (v))
|
||||
|
||||
typedef struct { volatile u16 offset[256]; } __regbase16;
|
||||
#define __REGV16(vaddr) ((__regbase16 *)((vaddr)&~0xff)) ->offset[((vaddr)&0xff)>>1]
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __REG16(paddr) __REGV16(io_p2v(paddr))
|
||||
|
||||
typedef struct { volatile u8 offset[4096]; } __regbase8;
|
||||
#define __REGV8(vaddr) ((__regbase8 *)((vaddr)&~4095)) ->offset[((vaddr)&4095)>>0]
|
||||
#define __REG8(paddr) __REGV8(io_p2v(paddr))
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
typedef struct { volatile u32 offset[4096]; } __regbase32;
|
||||
#define __REGV32(vaddr) ((__regbase32 *)((vaddr)&~4095)) ->offset[((vaddr)&4095)>>2]
|
||||
#define __REG32(paddr) __REGV32(io_p2v(paddr))
|
||||
|
||||
#else
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __REG8(paddr) io_p2v(paddr)
|
||||
#define __REG16(paddr) io_p2v(paddr)
|
||||
#define __REG32(paddr) io_p2v(paddr)
|
||||
|
||||
#endif
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
@@ -7,236 +7,279 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP15XX_IRQS_H
|
||||
#define __ASM_ARCH_OMAP15XX_IRQS_H
|
||||
|
||||
#define INT_CAMERA 1
|
||||
#define INT_FIQ 3
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_RTDX 6
|
||||
#define INT_DSP_MMU_ABORT 7
|
||||
#define INT_HOST 8
|
||||
#define INT_ABORT 9
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_DSP_MAILBOX1 10
|
||||
#define INT_DSP_MAILBOX2 11
|
||||
#define INT_BRIDGE_PRIV 13
|
||||
#define INT_GPIO_BANK1 14
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_UART3 15
|
||||
#define INT_TIMER3 16
|
||||
#define INT_DMA_CH0_6 19
|
||||
#define INT_DMA_CH1_7 20
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_DMA_CH2_8 21
|
||||
#define INT_DMA_CH3 22
|
||||
#define INT_DMA_CH4 23
|
||||
#define INT_DMA_CH5 24
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_DMA_LCD 25
|
||||
#define INT_TIMER1 26
|
||||
#define INT_WD_TIMER 27
|
||||
#define INT_BRIDGE_PUB 28
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_TIMER2 30
|
||||
#define INT_LCD_CTRL 31
|
||||
|
||||
#define INT_1510_IH2_IRQ 0
|
||||
#define INT_1510_RES2 2
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1510_SPI_TX 4
|
||||
#define INT_1510_SPI_RX 5
|
||||
#define INT_1510_RES12 12
|
||||
#define INT_1510_LB_MMU 17
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1510_RES18 18
|
||||
#define INT_1510_LOCAL_BUS 29
|
||||
|
||||
#define INT_1610_IH2_IRQ 0
|
||||
#define INT_1610_IH2_FIQ 2
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_McBSP2_TX 4
|
||||
#define INT_1610_McBSP2_RX 5
|
||||
#define INT_1610_LCD_LINE 12
|
||||
#define INT_1610_GPTIMER1 17
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_GPTIMER2 18
|
||||
#define INT_1610_SSR_FIFO_0 29
|
||||
|
||||
#define INT_730_IH2_FIQ 0
|
||||
#define INT_730_IH2_IRQ 1
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_USB_NON_ISO 2
|
||||
#define INT_730_USB_ISO 3
|
||||
#define INT_730_ICR 4
|
||||
#define INT_730_EAC 5
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_GPIO_BANK1 6
|
||||
#define INT_730_GPIO_BANK2 7
|
||||
#define INT_730_GPIO_BANK3 8
|
||||
#define INT_730_McBSP2TX 10
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_McBSP2RX 11
|
||||
#define INT_730_McBSP2RX_OVF 12
|
||||
#define INT_730_LCD_LINE 14
|
||||
#define INT_730_GSM_PROTECT 15
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_TIMER3 16
|
||||
#define INT_730_GPIO_BANK5 17
|
||||
#define INT_730_GPIO_BANK6 18
|
||||
#define INT_730_SPGIO_WR 29
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define IH2_BASE 32
|
||||
|
||||
#define INT_KEYBOARD (1 + IH2_BASE)
|
||||
#define INT_uWireTX (2 + IH2_BASE)
|
||||
#define INT_uWireRX (3 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_I2C (4 + IH2_BASE)
|
||||
#define INT_MPUIO (5 + IH2_BASE)
|
||||
#define INT_USB_HHC_1 (6 + IH2_BASE)
|
||||
#define INT_McBSP3TX (10 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_McBSP3RX (11 + IH2_BASE)
|
||||
#define INT_McBSP1TX (12 + IH2_BASE)
|
||||
#define INT_McBSP1RX (13 + IH2_BASE)
|
||||
#define INT_UART2 (14 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_UART1 (15 + IH2_BASE)
|
||||
#define INT_BT_MCSI1TX (16 + IH2_BASE)
|
||||
#define INT_BT_MCSI1RX (17 + IH2_BASE)
|
||||
#define INT_USB_W2FC (20 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1WIRE (21 + IH2_BASE)
|
||||
#define INT_OS_TIMER (22 + IH2_BASE)
|
||||
#define INT_MMC (23 + IH2_BASE)
|
||||
#define INT_GAUGE_32K (24 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_RTC_TIMER (25 + IH2_BASE)
|
||||
#define INT_RTC_ALARM (26 + IH2_BASE)
|
||||
#define INT_MEM_STICK (27 + IH2_BASE)
|
||||
#define INT_DSP_MMU (28 + IH2_BASE)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1510_COM_SPI_RO (31 + IH2_BASE)
|
||||
|
||||
#define INT_1610_FAC (0 + IH2_BASE)
|
||||
#define INT_1610_USB_HHC_2 (7 + IH2_BASE)
|
||||
#define INT_1610_USB_OTG (8 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_SoSSI (9 + IH2_BASE)
|
||||
#define INT_1610_SoSSI_MATCH (19 + IH2_BASE)
|
||||
#define INT_1610_McBSP2RX_OF (31 + IH2_BASE)
|
||||
#define INT_1610_STI (32 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_STI_WAKEUP (33 + IH2_BASE)
|
||||
#define INT_1610_GPTIMER3 (34 + IH2_BASE)
|
||||
#define INT_1610_GPTIMER4 (35 + IH2_BASE)
|
||||
#define INT_1610_GPTIMER5 (36 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_GPTIMER6 (37 + IH2_BASE)
|
||||
#define INT_1610_GPTIMER7 (38 + IH2_BASE)
|
||||
#define INT_1610_GPTIMER8 (39 + IH2_BASE)
|
||||
#define INT_1610_GPIO_BANK2 (40 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_GPIO_BANK3 (41 + IH2_BASE)
|
||||
#define INT_1610_MMC2 (42 + IH2_BASE)
|
||||
#define INT_1610_CF (43 + IH2_BASE)
|
||||
#define INT_1610_WAKE_UP_REQ (46 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_GPIO_BANK4 (48 + IH2_BASE)
|
||||
#define INT_1610_SPI (49 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH6 (53 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH7 (54 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_DMA_CH8 (55 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH9 (56 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH10 (57 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH11 (58 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_DMA_CH12 (59 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH13 (60 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH14 (61 + IH2_BASE)
|
||||
#define INT_1610_DMA_CH15 (62 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_1610_NAND (63 + IH2_BASE)
|
||||
|
||||
#define INT_730_HW_ERRORS (0 + IH2_BASE)
|
||||
#define INT_730_NFIQ_PWR_FAIL (1 + IH2_BASE)
|
||||
#define INT_730_CFCD (2 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_CFIREQ (3 + IH2_BASE)
|
||||
#define INT_730_I2C (4 + IH2_BASE)
|
||||
#define INT_730_PCC (5 + IH2_BASE)
|
||||
#define INT_730_MPU_EXT_NIRQ (6 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_SPI_100K_1 (7 + IH2_BASE)
|
||||
#define INT_730_SYREN_SPI (8 + IH2_BASE)
|
||||
#define INT_730_VLYNQ (9 + IH2_BASE)
|
||||
#define INT_730_GPIO_BANK4 (10 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_McBSP1TX (11 + IH2_BASE)
|
||||
#define INT_730_McBSP1RX (12 + IH2_BASE)
|
||||
#define INT_730_McBSP1RX_OF (13 + IH2_BASE)
|
||||
#define INT_730_UART_MODEM_IRDA_2 (14 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_UART_MODEM_1 (15 + IH2_BASE)
|
||||
#define INT_730_MCSI (16 + IH2_BASE)
|
||||
#define INT_730_uWireTX (17 + IH2_BASE)
|
||||
#define INT_730_uWireRX (18 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_SMC_CD (19 + IH2_BASE)
|
||||
#define INT_730_SMC_IREQ (20 + IH2_BASE)
|
||||
#define INT_730_HDQ_1WIRE (21 + IH2_BASE)
|
||||
#define INT_730_TIMER32K (22 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_MMC_SDIO (23 + IH2_BASE)
|
||||
#define INT_730_UPLD (24 + IH2_BASE)
|
||||
#define INT_730_USB_HHC_1 (27 + IH2_BASE)
|
||||
#define INT_730_USB_HHC_2 (28 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_USB_GENI (29 + IH2_BASE)
|
||||
#define INT_730_USB_OTG (30 + IH2_BASE)
|
||||
#define INT_730_CAMERA_IF (31 + IH2_BASE)
|
||||
#define INT_730_RNG (32 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_DUAL_MODE_TIMER (33 + IH2_BASE)
|
||||
#define INT_730_DBB_RF_EN (34 + IH2_BASE)
|
||||
#define INT_730_MPUIO_KEYPAD (35 + IH2_BASE)
|
||||
#define INT_730_SHA1_MD5 (36 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_SPI_100K_2 (37 + IH2_BASE)
|
||||
#define INT_730_RNG_IDLE (38 + IH2_BASE)
|
||||
#define INT_730_MPUIO (39 + IH2_BASE)
|
||||
#define INT_730_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_LLPC_OE_FALLING (41 + IH2_BASE)
|
||||
#define INT_730_LLPC_OE_RISING (42 + IH2_BASE)
|
||||
#define INT_730_LLPC_VSYNC (43 + IH2_BASE)
|
||||
#define INT_730_WAKE_UP_REQ (46 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_DMA_CH6 (53 + IH2_BASE)
|
||||
#define INT_730_DMA_CH7 (54 + IH2_BASE)
|
||||
#define INT_730_DMA_CH8 (55 + IH2_BASE)
|
||||
#define INT_730_DMA_CH9 (56 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_DMA_CH10 (57 + IH2_BASE)
|
||||
#define INT_730_DMA_CH11 (58 + IH2_BASE)
|
||||
#define INT_730_DMA_CH12 (59 + IH2_BASE)
|
||||
#define INT_730_DMA_CH13 (60 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_730_DMA_CH14 (61 + IH2_BASE)
|
||||
#define INT_730_DMA_CH15 (62 + IH2_BASE)
|
||||
#define INT_730_NAND (63 + IH2_BASE)
|
||||
|
||||
#define INT_24XX_SYS_NIRQ 7
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_SDMA_IRQ0 12
|
||||
#define INT_24XX_SDMA_IRQ1 13
|
||||
#define INT_24XX_SDMA_IRQ2 14
|
||||
#define INT_24XX_SDMA_IRQ3 15
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_CAM_IRQ 24
|
||||
#define INT_24XX_DSS_IRQ 25
|
||||
#define INT_24XX_GPIO_BANK1 29
|
||||
#define INT_24XX_GPIO_BANK2 30
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_GPIO_BANK3 31
|
||||
#define INT_24XX_GPIO_BANK4 32
|
||||
#define INT_24XX_GPTIMER1 37
|
||||
#define INT_24XX_GPTIMER2 38
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_GPTIMER3 39
|
||||
#define INT_24XX_GPTIMER4 40
|
||||
#define INT_24XX_GPTIMER5 41
|
||||
#define INT_24XX_GPTIMER6 42
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_GPTIMER7 43
|
||||
#define INT_24XX_GPTIMER8 44
|
||||
#define INT_24XX_GPTIMER9 45
|
||||
#define INT_24XX_GPTIMER10 46
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_GPTIMER11 47
|
||||
#define INT_24XX_GPTIMER12 48
|
||||
#define INT_24XX_MCBSP1_IRQ_TX 59
|
||||
#define INT_24XX_MCBSP1_IRQ_RX 60
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_MCBSP2_IRQ_TX 62
|
||||
#define INT_24XX_MCBSP2_IRQ_RX 63
|
||||
#define INT_24XX_UART1_IRQ 72
|
||||
#define INT_24XX_UART2_IRQ 73
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define INT_24XX_UART3_IRQ 74
|
||||
#define INT_24XX_MMC_IRQ 83
|
||||
|
||||
#define OMAP_MAX_GPIO_LINES 192
|
||||
#define IH_GPIO_BASE (128 + IH2_BASE)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE)
|
||||
#define IH_BOARD_BASE (16 + IH_MPUIO_BASE)
|
||||
|
||||
#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
#include <asm/hardware.h>
|
||||
|
||||
#ifndef NR_IRQS
|
||||
#define NR_IRQS IH_BOARD_BASE
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -7,179 +7,195 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_MCBSP_H
|
||||
#define __ASM_ARCH_OMAP_MCBSP_H
|
||||
|
||||
#include <asm/hardware.h>
|
||||
|
||||
#define OMAP730_MCBSP1_BASE 0xfffb1000
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP730_MCBSP2_BASE 0xfffb1800
|
||||
|
||||
#define OMAP1510_MCBSP1_BASE 0xe1011800
|
||||
#define OMAP1510_MCBSP2_BASE 0xfffb1000
|
||||
#define OMAP1510_MCBSP3_BASE 0xe1017000
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP1610_MCBSP1_BASE 0xe1011800
|
||||
#define OMAP1610_MCBSP2_BASE 0xfffb1000
|
||||
#define OMAP1610_MCBSP3_BASE 0xe1017000
|
||||
|
||||
#define OMAP24XX_MCBSP1_BASE 0x48074000
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_MCBSP2_BASE 0x48076000
|
||||
|
||||
#define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg)
|
||||
#define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg)
|
||||
|
||||
#define RRST 0x0001
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define RRDY 0x0002
|
||||
#define RFULL 0x0004
|
||||
#define RSYNC_ERR 0x0008
|
||||
#define RINTM(value) ((value)<<4)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ABIS 0x0040
|
||||
#define DXENA 0x0080
|
||||
#define CLKSTP(value) ((value)<<11)
|
||||
#define RJUST(value) ((value)<<13)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DLB 0x8000
|
||||
|
||||
#define XRST 0x0001
|
||||
#define XRDY 0x0002
|
||||
#define XEMPTY 0x0004
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define XSYNC_ERR 0x0008
|
||||
#define XINTM(value) ((value)<<4)
|
||||
#define GRST 0x0040
|
||||
#define FRST 0x0080
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define SOFT 0x0100
|
||||
#define FREE 0x0200
|
||||
|
||||
#define CLKRP 0x0001
|
||||
#define CLKXP 0x0002
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FSRP 0x0004
|
||||
#define FSXP 0x0008
|
||||
#define DR_STAT 0x0010
|
||||
#define DX_STAT 0x0020
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define CLKS_STAT 0x0040
|
||||
#define SCLKME 0x0080
|
||||
#define CLKRM 0x0100
|
||||
#define CLKXM 0x0200
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FSRM 0x0400
|
||||
#define FSXM 0x0800
|
||||
#define RIOEN 0x1000
|
||||
#define XIOEN 0x2000
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define IDLE_EN 0x4000
|
||||
|
||||
#define RWDLEN1(value) ((value)<<5)
|
||||
#define RFRLEN1(value) ((value)<<8)
|
||||
|
||||
#define XWDLEN1(value) ((value)<<5)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define XFRLEN1(value) ((value)<<8)
|
||||
|
||||
#define RDATDLY(value) (value)
|
||||
#define RFIG 0x0004
|
||||
#define RCOMPAND(value) ((value)<<3)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define RWDLEN2(value) ((value)<<5)
|
||||
#define RFRLEN2(value) ((value)<<8)
|
||||
#define RPHASE 0x8000
|
||||
|
||||
#define XDATDLY(value) (value)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define XFIG 0x0004
|
||||
#define XCOMPAND(value) ((value)<<3)
|
||||
#define XWDLEN2(value) ((value)<<5)
|
||||
#define XFRLEN2(value) ((value)<<8)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define XPHASE 0x8000
|
||||
|
||||
#define CLKGDV(value) (value)
|
||||
#define FWID(value) ((value)<<8)
|
||||
|
||||
#define FPER(value) (value)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FSGM 0x1000
|
||||
#define CLKSM 0x2000
|
||||
#define CLKSP 0x4000
|
||||
#define GSYNC 0x8000
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define RMCM 0x0001
|
||||
#define RCBLK(value) ((value)<<2)
|
||||
#define RPABLK(value) ((value)<<5)
|
||||
#define RPBBLK(value) ((value)<<7)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define XMCM(value) (value)
|
||||
#define XCBLK(value) ((value)<<2)
|
||||
#define XPABLK(value) ((value)<<5)
|
||||
#define XPBBLK(value) ((value)<<7)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct omap_mcbsp_reg_cfg {
|
||||
u16 spcr2;
|
||||
u16 spcr1;
|
||||
u16 rcr2;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u16 rcr1;
|
||||
u16 xcr2;
|
||||
u16 xcr1;
|
||||
u16 srgr2;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u16 srgr1;
|
||||
u16 mcr2;
|
||||
u16 mcr1;
|
||||
u16 pcr0;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u16 rcerc;
|
||||
u16 rcerd;
|
||||
u16 xcerc;
|
||||
u16 xcerd;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u16 rcere;
|
||||
u16 rcerf;
|
||||
u16 xcere;
|
||||
u16 xcerf;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u16 rcerg;
|
||||
u16 rcerh;
|
||||
u16 xcerg;
|
||||
u16 xcerh;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
OMAP_MCBSP1 = 0,
|
||||
OMAP_MCBSP2,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
OMAP_MCBSP3,
|
||||
} omap_mcbsp_id;
|
||||
|
||||
typedef int __bitwise omap_mcbsp_io_type_t;
|
||||
#define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2)
|
||||
|
||||
typedef enum {
|
||||
OMAP_MCBSP_WORD_8 = 0,
|
||||
OMAP_MCBSP_WORD_12,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
OMAP_MCBSP_WORD_16,
|
||||
OMAP_MCBSP_WORD_20,
|
||||
OMAP_MCBSP_WORD_24,
|
||||
OMAP_MCBSP_WORD_32,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
} omap_mcbsp_word_length;
|
||||
|
||||
typedef enum {
|
||||
OMAP_MCBSP_CLK_RISING = 0,
|
||||
OMAP_MCBSP_CLK_FALLING,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
} omap_mcbsp_clk_polarity;
|
||||
|
||||
typedef enum {
|
||||
OMAP_MCBSP_FS_ACTIVE_HIGH = 0,
|
||||
OMAP_MCBSP_FS_ACTIVE_LOW,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
} omap_mcbsp_fs_polarity;
|
||||
|
||||
typedef enum {
|
||||
OMAP_MCBSP_CLK_STP_MODE_NO_DELAY = 0,
|
||||
OMAP_MCBSP_CLK_STP_MODE_DELAY,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
} omap_mcbsp_clk_stp_mode;
|
||||
|
||||
typedef enum {
|
||||
OMAP_MCBSP_SPI_MASTER = 0,
|
||||
OMAP_MCBSP_SPI_SLAVE,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
} omap_mcbsp_spi_mode;
|
||||
|
||||
struct omap_mcbsp_spi_cfg {
|
||||
omap_mcbsp_spi_mode spi_mode;
|
||||
omap_mcbsp_clk_polarity rx_clock_polarity;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
omap_mcbsp_clk_polarity tx_clock_polarity;
|
||||
omap_mcbsp_fs_polarity fsx_polarity;
|
||||
u8 clk_div;
|
||||
omap_mcbsp_clk_stp_mode clk_stp_mode;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
omap_mcbsp_word_length word_length;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -7,13 +7,18 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_MEMORY_H
|
||||
#define __ASM_ARCH_MEMORY_H
|
||||
|
||||
#define __virt_to_bus(x) __virt_to_phys(x)
|
||||
#define __bus_to_virt(x) __phys_to_virt(x)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
|
@@ -7,25 +7,32 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ARCH_OMAP_MTD_XIP_H__
|
||||
#define __ARCH_OMAP_MTD_XIP_H__
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#define OMAP_MPU_TIMER_BASE (0xfffec500)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP_MPU_TIMER_OFFSET 0x100
|
||||
|
||||
typedef struct {
|
||||
u32 cntl;
|
||||
u32 load_tim;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
u32 read_tim;
|
||||
} xip_omap_mpu_timer_regs_t;
|
||||
|
||||
#define xip_omap_mpu_timer_base(n) ((volatile xip_omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + (n)*OMAP_MPU_TIMER_OFFSET))
|
||||
|
||||
#define xip_irqpending() (omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR))
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define xip_currtime() (~xip_omap_mpu_timer_read(0))
|
||||
#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6)
|
||||
#define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (1))
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,385 +7,402 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_MUX_H
|
||||
#define __ASM_ARCH_MUX_H
|
||||
|
||||
#define PU_PD_SEL_NA 0
|
||||
#define PULL_DWN_CTRL_NA 0
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, .mask_offset = mode_offset, .mask = mode,
|
||||
|
||||
#define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg, .pull_bit = bit, .pull_val = status,
|
||||
|
||||
#define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, .pu_pd_val = status,
|
||||
|
||||
#define MUX_REG_730(reg, mode_offset, mode) .mux_reg = OMAP730_IO_CONF_##reg, .mask_offset = mode_offset, .mask = mode,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define PULL_REG_730(reg, bit, status) .pull_reg = OMAP730_IO_CONF_##reg, .pull_bit = bit, .pull_val = status,
|
||||
|
||||
#define MUX_CFG(desc, mux_reg, mode_offset, mode, pull_reg, pull_bit, pull_status, pu_pd_reg, pu_pd_status, debug_status) { .name = desc, .debug = debug_status, MUX_REG(mux_reg, mode_offset, mode) PULL_REG(pull_reg, pull_bit, !pull_status) PU_PD_REG(pu_pd_reg, pu_pd_status) },
|
||||
|
||||
#define MUX_CFG_730(desc, mux_reg, mode_offset, mode, pull_bit, pull_status, debug_status) { .name = desc, .debug = debug_status, MUX_REG_730(mux_reg, mode_offset, mode) PULL_REG_730(mux_reg, pull_bit, pull_status) PU_PD_REG(NA, 0) },
|
||||
|
||||
#define MUX_CFG_24XX(desc, reg_offset, mode, pull_en, pull_mode, dbg) { .name = desc, .debug = dbg, .mux_reg = reg_offset, .mask = mode, .pull_val = pull_en, .pu_pd_val = pull_mode, },
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define PULL_DISABLED 0
|
||||
#define PULL_ENABLED 1
|
||||
|
||||
#define PULL_DOWN 0
|
||||
#define PULL_UP 1
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
struct pin_config {
|
||||
char *name;
|
||||
unsigned char busy;
|
||||
unsigned char debug;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
const char *mux_reg_name;
|
||||
const unsigned int mux_reg;
|
||||
const unsigned char mask_offset;
|
||||
const unsigned char mask;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
const char *pull_name;
|
||||
const unsigned int pull_reg;
|
||||
const unsigned char pull_val;
|
||||
const unsigned char pull_bit;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
const char *pu_pd_name;
|
||||
const unsigned int pu_pd_reg;
|
||||
const unsigned char pu_pd_val;
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
enum omap730_index {
|
||||
|
||||
E2_730_KBR0,
|
||||
J7_730_KBR1,
|
||||
E1_730_KBR2,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
F3_730_KBR3,
|
||||
D2_730_KBR4,
|
||||
AA20_730_KBR5,
|
||||
V17_730_KBR6,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
C2_730_KBC0,
|
||||
D3_730_KBC1,
|
||||
E4_730_KBC2,
|
||||
F4_730_KBC3,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
E3_730_KBC4,
|
||||
|
||||
AA17_730_USB_DM,
|
||||
W16_730_USB_PU_EN,
|
||||
W17_730_USB_VBUSI,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V19_730_GPIO_15,
|
||||
M19_730_GPIO_77,
|
||||
C21_730_GPIO_121_122,
|
||||
K19_730_GPIO_126,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
K15_730_GPIO_127,
|
||||
|
||||
P15_730_GPIO_16_17,
|
||||
|
||||
M15_730_GPIO_83,
|
||||
N20_730_GPIO_82,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
N18_730_GPIO_81,
|
||||
N19_730_GPIO_80,
|
||||
L15_730_GPIO_76,
|
||||
|
||||
UART1_CTS_RTS,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
OMAP_730_GPIOS_42_43,
|
||||
UART1_TX_RX,
|
||||
OMAP_730_GPIOS_40_41,
|
||||
UART1_USB_RX_TX,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
UART1_USB_RTS,
|
||||
UART1_USB_CTS
|
||||
};
|
||||
|
||||
enum omap1xxx_index {
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
UART1_TX = 0,
|
||||
UART1_RTS,
|
||||
|
||||
UART2_TX,
|
||||
UART2_RX,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
UART2_CTS,
|
||||
UART2_RTS,
|
||||
|
||||
UART3_TX,
|
||||
UART3_RX,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
UART3_CTS,
|
||||
UART3_RTS,
|
||||
UART3_CLKREQ,
|
||||
UART3_BCLK,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
Y15_1610_UART3_RTS,
|
||||
|
||||
PWT,
|
||||
PWL,
|
||||
|
||||
R18_USB_VBUS,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
R18_1510_USB_GPIO0,
|
||||
W4_USB_PUEN,
|
||||
W4_USB_CLKO,
|
||||
W4_USB_HIGHZ,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
W4_GPIO58,
|
||||
|
||||
USB1_SUSP,
|
||||
USB1_SEO,
|
||||
W13_1610_USB1_SE0,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
USB1_TXEN,
|
||||
USB1_TXD,
|
||||
USB1_VP,
|
||||
USB1_VM,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
USB1_RCV,
|
||||
USB1_SPEED,
|
||||
R13_1610_USB1_SPEED,
|
||||
R13_1710_USB1_SE0,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
USB2_SUSP,
|
||||
USB2_VP,
|
||||
USB2_TXEN,
|
||||
USB2_VM,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
USB2_RCV,
|
||||
USB2_SEO,
|
||||
USB2_TXD,
|
||||
|
||||
R18_1510_GPIO0,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
R19_1510_GPIO1,
|
||||
M14_1510_GPIO2,
|
||||
|
||||
P18_1610_GPIO3,
|
||||
Y15_1610_GPIO17,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
R18_1710_GPIO0,
|
||||
V2_1710_GPIO10,
|
||||
N21_1710_GPIO14,
|
||||
W15_1710_GPIO40,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
MPUIO2,
|
||||
N15_1610_MPUIO2,
|
||||
MPUIO4,
|
||||
MPUIO5,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
T20_1610_MPUIO5,
|
||||
W11_1610_MPUIO6,
|
||||
V10_1610_MPUIO7,
|
||||
W11_1610_MPUIO9,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V10_1610_MPUIO10,
|
||||
W10_1610_MPUIO11,
|
||||
E20_1610_MPUIO13,
|
||||
U20_1610_MPUIO14,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
E19_1610_MPUIO15,
|
||||
|
||||
MCBSP2_CLKR,
|
||||
MCBSP2_CLKX,
|
||||
MCBSP2_DR,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
MCBSP2_DX,
|
||||
MCBSP2_FSR,
|
||||
MCBSP2_FSX,
|
||||
|
||||
MCBSP3_CLKX,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
BALLOUT_V8_ARMIO3,
|
||||
N20_HDQ,
|
||||
|
||||
W8_1610_MMC2_DAT0,
|
||||
V8_1610_MMC2_DAT1,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
W15_1610_MMC2_DAT2,
|
||||
R10_1610_MMC2_DAT3,
|
||||
Y10_1610_MMC2_CLK,
|
||||
Y8_1610_MMC2_CMD,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V9_1610_MMC2_CMDDIR,
|
||||
V5_1610_MMC2_DATDIR0,
|
||||
W19_1610_MMC2_DATDIR1,
|
||||
R18_1610_MMC2_CLKIN,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
M19_1610_ETM_PSTAT0,
|
||||
L15_1610_ETM_PSTAT1,
|
||||
L18_1610_ETM_PSTAT2,
|
||||
L19_1610_ETM_D0,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
J19_1610_ETM_D6,
|
||||
J18_1610_ETM_D7,
|
||||
|
||||
P20_1610_GPIO4,
|
||||
V9_1610_GPIO7,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
W8_1610_GPIO9,
|
||||
N20_1610_GPIO11,
|
||||
N19_1610_GPIO13,
|
||||
P10_1610_GPIO22,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V5_1610_GPIO24,
|
||||
AA20_1610_GPIO_41,
|
||||
W19_1610_GPIO48,
|
||||
M7_1610_GPIO62,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V14_16XX_GPIO37,
|
||||
R9_16XX_GPIO18,
|
||||
L14_16XX_GPIO49,
|
||||
|
||||
V19_1610_UWIRE_SCLK,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
U18_1610_UWIRE_SDI,
|
||||
W21_1610_UWIRE_SDO,
|
||||
N14_1610_UWIRE_CS0,
|
||||
P15_1610_UWIRE_CS3,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
N15_1610_UWIRE_CS1,
|
||||
|
||||
U19_1610_SPIF_SCK,
|
||||
U18_1610_SPIF_DIN,
|
||||
P20_1610_SPIF_DIN,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
W21_1610_SPIF_DOUT,
|
||||
R18_1610_SPIF_DOUT,
|
||||
N14_1610_SPIF_CS0,
|
||||
N15_1610_SPIF_CS1,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
T19_1610_SPIF_CS2,
|
||||
P15_1610_SPIF_CS3,
|
||||
|
||||
L3_1610_FLASH_CS2B_OE,
|
||||
M8_1610_FLASH_CS2B_WE,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
MMC_CMD,
|
||||
MMC_DAT1,
|
||||
MMC_DAT2,
|
||||
MMC_DAT0,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
MMC_CLK,
|
||||
MMC_DAT3,
|
||||
|
||||
M15_1710_MMC_CLKI,
|
||||
P19_1710_MMC_CMDDIR,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
P20_1710_MMC_DATDIR0,
|
||||
|
||||
W9_USB0_TXEN,
|
||||
AA9_USB0_VP,
|
||||
Y5_USB0_RCV,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
R9_USB0_VM,
|
||||
V6_USB0_TXD,
|
||||
W5_USB0_SE0,
|
||||
V9_USB0_SPEED,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V9_USB0_SUSP,
|
||||
|
||||
W9_USB2_TXEN,
|
||||
AA9_USB2_VP,
|
||||
Y5_USB2_RCV,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
R9_USB2_VM,
|
||||
V6_USB2_TXD,
|
||||
W5_USB2_SE0,
|
||||
|
||||
R13_1610_UART1_TX,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V14_16XX_UART1_RX,
|
||||
R14_1610_UART1_CTS,
|
||||
AA15_1610_UART1_RTS,
|
||||
R9_16XX_UART2_RX,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
L14_16XX_UART3_RX,
|
||||
|
||||
I2C_SCL,
|
||||
I2C_SDA,
|
||||
|
||||
F18_1610_KBC0,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
D20_1610_KBC1,
|
||||
D19_1610_KBC2,
|
||||
E18_1610_KBC3,
|
||||
C21_1610_KBC4,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
G18_1610_KBR0,
|
||||
F19_1610_KBR1,
|
||||
H14_1610_KBR2,
|
||||
E20_1610_KBR3,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
E19_1610_KBR4,
|
||||
N19_1610_KBR5,
|
||||
|
||||
T20_1610_LOW_PWR,
|
||||
|
||||
V5_1710_MCLK_ON,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V5_1710_MCLK_OFF,
|
||||
R10_1610_MCLK_ON,
|
||||
R10_1610_MCLK_OFF,
|
||||
|
||||
P11_1610_CF_CD2,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
R11_1610_CF_IOIS16,
|
||||
V10_1610_CF_IREQ,
|
||||
W10_1610_CF_RESET,
|
||||
W11_1610_CF_CD1,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
enum omap24xx_index {
|
||||
|
||||
M19_24XX_I2C1_SCL,
|
||||
L15_24XX_I2C1_SDA,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
J15_24XX_I2C2_SCL,
|
||||
H19_24XX_I2C2_SDA,
|
||||
|
||||
W19_24XX_SYS_NIRQ,
|
||||
|
||||
W14_24XX_SYS_CLKOUT,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
L3_GPMC_WAIT0,
|
||||
N7_GPMC_WAIT1,
|
||||
M1_GPMC_WAIT2,
|
||||
P1_GPMC_WAIT3,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
Y15_24XX_MCBSP2_CLKX,
|
||||
R14_24XX_MCBSP2_FSX,
|
||||
W15_24XX_MCBSP2_DR,
|
||||
V15_24XX_MCBSP2_DX,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
M21_242X_GPIO11,
|
||||
AA10_242X_GPIO13,
|
||||
AA6_242X_GPIO14,
|
||||
AA4_242X_GPIO15,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
Y11_242X_GPIO16,
|
||||
AA12_242X_GPIO17,
|
||||
AA8_242X_GPIO58,
|
||||
Y20_24XX_GPIO60,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
W4__24XX_GPIO74,
|
||||
M15_24XX_GPIO92,
|
||||
V14_24XX_GPIO117,
|
||||
|
||||
V4_242X_GPIO49,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
W2_242X_GPIO50,
|
||||
U4_242X_GPIO51,
|
||||
V3_242X_GPIO52,
|
||||
V2_242X_GPIO53,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V6_242X_GPIO53,
|
||||
T4_242X_GPIO54,
|
||||
Y4_242X_GPIO54,
|
||||
T3_242X_GPIO55,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
U2_242X_GPIO56,
|
||||
|
||||
AA10_242X_DMAREQ0,
|
||||
AA6_242X_DMAREQ1,
|
||||
E4_242X_DMAREQ2,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
G4_242X_DMAREQ3,
|
||||
D3_242X_DMAREQ4,
|
||||
E3_242X_DMAREQ5,
|
||||
|
||||
P20_24XX_TSC_IRQ,
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
K15_24XX_UART3_TX,
|
||||
K14_24XX_UART3_RX,
|
||||
|
||||
G19_24XX_MMC_CLKO,
|
||||
H18_24XX_MMC_CMD,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
F20_24XX_MMC_DAT0,
|
||||
H14_24XX_MMC_DAT1,
|
||||
E19_24XX_MMC_DAT2,
|
||||
D19_24XX_MMC_DAT3,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
F19_24XX_MMC_DAT_DIR0,
|
||||
E20_24XX_MMC_DAT_DIR1,
|
||||
F18_24XX_MMC_DAT_DIR2,
|
||||
E18_24XX_MMC_DAT_DIR3,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
G18_24XX_MMC_CMD_DIR,
|
||||
H15_24XX_MMC_CLKI,
|
||||
|
||||
T19_24XX_KBR0,
|
||||
R19_24XX_KBR1,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
V18_24XX_KBR2,
|
||||
M21_24XX_KBR3,
|
||||
E5__24XX_KBR4,
|
||||
M18_24XX_KBR5,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
R20_24XX_KBC0,
|
||||
M14_24XX_KBC1,
|
||||
H19_24XX_KBC2,
|
||||
V17_24XX_KBC3,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
P21_24XX_KBC4,
|
||||
L14_24XX_KBC5,
|
||||
N19_24XX_KBC6,
|
||||
|
||||
B3__24XX_KBR5,
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
AA4_24XX_KBC2,
|
||||
B13_24XX_KBC6,
|
||||
};
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,24 +7,28 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP24XX_H
|
||||
#define __ASM_ARCH_OMAP24XX_H
|
||||
|
||||
#define L4_24XX_BASE 0x48000000
|
||||
#define L3_24XX_BASE 0x68000000
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000)
|
||||
#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
|
||||
#define OMAP24XX_IVA_INTC_BASE 0x40000000
|
||||
#define IRQ_SIR_IRQ 0x0040
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
|
||||
#define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000)
|
||||
#define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000)
|
||||
|
||||
#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
|
@@ -7,15 +7,20 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_SERIAL_H
|
||||
#define __ASM_ARCH_SERIAL_H
|
||||
|
||||
#define OMAP_MAX_NR_PORTS 3
|
||||
#define OMAP1510_BASE_BAUD (12000000/16)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define OMAP16XX_BASE_BAUD (48000000/16)
|
||||
|
||||
#define is_omap_port(p) ({int __ret = 0; if (p == IO_ADDRESS(OMAP_UART1_BASE) || p == IO_ADDRESS(OMAP_UART2_BASE) || p == IO_ADDRESS(OMAP_UART3_BASE)) __ret = 1; __ret; })
|
||||
|
||||
#endif
|
||||
|
@@ -7,11 +7,17 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARCH_OMAP_TIMEX_H
|
||||
#define __ASM_ARCH_OMAP_TIMEX_H
|
||||
|
||||
#define CLOCK_TICK_RATE (HZ * 100000UL)
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,7 +7,13 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
|
||||
|
||||
|
@@ -7,15 +7,19 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_ATOMIC_H
|
||||
#define __ASM_ARM_ATOMIC_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
typedef struct { volatile int counter; } atomic_t;
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
#endif
|
||||
|
@@ -7,9 +7,15 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASMARM_AUXVEC_H
|
||||
#define __ASMARM_AUXVEC_H
|
||||
|
||||
#endif
|
||||
|
@@ -7,9 +7,15 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_BITOPS_H
|
||||
#define __ASM_ARM_BITOPS_H
|
||||
|
||||
#endif
|
||||
|
@@ -7,45 +7,48 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_BYTEORDER_H
|
||||
#define __ASM_ARM_BYTEORDER_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
|
||||
{
|
||||
__u32 t;
|
||||
|
||||
#ifndef __thumb__
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
if (!__builtin_constant_p(x)) {
|
||||
|
||||
__asm__ ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
|
||||
} else
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
t = x ^ ((x << 16) | (x >> 16));
|
||||
|
||||
x = (x << 24) | (x >> 8);
|
||||
t &= ~0x00FF0000;
|
||||
x ^= (t >> 8);
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
return x;
|
||||
}
|
||||
|
||||
#define __arch__swab32(x) ___arch__swab32(x)
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __BYTEORDER_HAS_U64__
|
||||
#define __SWAB_64_THRU_32__
|
||||
#endif
|
||||
|
||||
#ifdef __ARMEB__
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include <linux/byteorder/big_endian.h>
|
||||
#else
|
||||
#include <linux/byteorder/little_endian.h>
|
||||
#endif
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
|
@@ -7,12 +7,18 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASMARM_CACHE_H
|
||||
#define __ASMARM_CACHE_H
|
||||
|
||||
#define L1_CACHE_SHIFT 5
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
@@ -7,101 +7,95 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _ASMARM_CACHEFLUSH_H
|
||||
#define _ASMARM_CACHEFLUSH_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include <asm/glue.h>
|
||||
#include <asm/shmparam.h>
|
||||
|
||||
#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
|
||||
|
||||
#undef _CACHE
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#undef MULTI_CACHE
|
||||
|
||||
#if !defined(_CACHE) && !defined(MULTI_CACHE)
|
||||
#error Unknown cache maintainence model
|
||||
#endif
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define PG_dcache_dirty PG_arch_1
|
||||
|
||||
struct cpu_cache_fns {
|
||||
void (*flush_kern_all)(void);
|
||||
void (*flush_user_all)(void);
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
void (*flush_user_range)(unsigned long, unsigned long, unsigned int);
|
||||
|
||||
void (*coherent_kern_range)(unsigned long, unsigned long);
|
||||
void (*coherent_user_range)(unsigned long, unsigned long);
|
||||
void (*flush_kern_dcache_page)(void *);
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
void (*dma_inv_range)(unsigned long, unsigned long);
|
||||
void (*dma_clean_range)(unsigned long, unsigned long);
|
||||
void (*dma_flush_range)(unsigned long, unsigned long);
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#ifdef MULTI_CACHE
|
||||
|
||||
#define __cpuc_flush_kern_all cpu_cache.flush_kern_all
|
||||
#define __cpuc_flush_user_all cpu_cache.flush_user_all
|
||||
#define __cpuc_flush_user_range cpu_cache.flush_user_range
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __cpuc_coherent_kern_range cpu_cache.coherent_kern_range
|
||||
#define __cpuc_coherent_user_range cpu_cache.coherent_user_range
|
||||
#define __cpuc_flush_dcache_page cpu_cache.flush_kern_dcache_page
|
||||
|
||||
#define dmac_inv_range cpu_cache.dma_inv_range
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define dmac_clean_range cpu_cache.dma_clean_range
|
||||
#define dmac_flush_range cpu_cache.dma_flush_range
|
||||
|
||||
#else
|
||||
|
||||
#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
|
||||
#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
|
||||
#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
|
||||
#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __cpuc_flush_dcache_page __glue(_CACHE,_flush_kern_dcache_page)
|
||||
|
||||
#define dmac_inv_range __glue(_CACHE,_dma_inv_range)
|
||||
#define dmac_clean_range __glue(_CACHE,_dma_clean_range)
|
||||
#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
#define flush_cache_vmap(start, end) flush_cache_all()
|
||||
#define flush_cache_vunmap(start, end) flush_cache_all()
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) do { memcpy(dst, src, len); flush_ptrace_access(vma, page, vaddr, dst, len, 1); } while (0)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) do { memcpy(dst, src, len); } while (0)
|
||||
|
||||
#define flush_cache_all() __cpuc_flush_kern_all()
|
||||
#define flush_cache_user_range(vma,start,end) __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end))
|
||||
#define flush_icache_range(s,e) __cpuc_coherent_kern_range(s,e)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define clean_dcache_area(start,size) cpu_dcache_clean_area(start, size)
|
||||
|
||||
#define flush_dcache_mmap_lock(mapping) write_lock_irq(&(mapping)->tree_lock)
|
||||
#define flush_dcache_mmap_unlock(mapping) write_unlock_irq(&(mapping)->tree_lock)
|
||||
|
||||
#define flush_icache_user_range(vma,page,addr,len) flush_dcache_page(page)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define flush_icache_page(vma,page) do { } while (0)
|
||||
|
||||
#define __cacheid_present(val) (val != read_cpuid(CPUID_ID))
|
||||
#define __cacheid_vivt(val) ((val & (15 << 25)) != (14 << 25))
|
||||
#define __cacheid_vipt(val) ((val & (15 << 25)) == (14 << 25))
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __cacheid_vipt_nonaliasing(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25))
|
||||
#define __cacheid_vipt_aliasing(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25 | 1 << 23))
|
||||
|
||||
#define cache_is_vivt() ({ unsigned int __val = read_cpuid(CPUID_CACHETYPE); (!__cacheid_present(__val)) || __cacheid_vivt(__val); })
|
||||
|
||||
#define cache_is_vipt() ({ unsigned int __val = read_cpuid(CPUID_CACHETYPE); __cacheid_present(__val) && __cacheid_vipt(__val); })
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define cache_is_vipt_nonaliasing() ({ unsigned int __val = read_cpuid(CPUID_CACHETYPE); __cacheid_present(__val) && __cacheid_vipt_nonaliasing(__val); })
|
||||
|
||||
#define cache_is_vipt_aliasing() ({ unsigned int __val = read_cpuid(CPUID_CACHETYPE); __cacheid_present(__val) && __cacheid_vipt_aliasing(__val); })
|
||||
|
||||
#endif
|
||||
|
@@ -7,11 +7,17 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ARM_CPUTIME_H
|
||||
#define __ARM_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,16 +7,19 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_DELAY_H
|
||||
#define __ASM_ARM_DELAY_H
|
||||
|
||||
#include <asm/param.h>
|
||||
|
||||
#define MAX_UDELAY_MS 2
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define udelay(n) (__builtin_constant_p(n) ? ((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() : __const_udelay((n) * ((2199023U*HZ)>>11))) : __udelay(n))
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -7,21 +7,27 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_DIV64
|
||||
#define __ASM_ARM_DIV64
|
||||
|
||||
#include <asm/system.h>
|
||||
|
||||
#ifdef __ARMEB__
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __xh "r0"
|
||||
#define __xl "r1"
|
||||
#else
|
||||
#define __xl "r0"
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define __xh "r1"
|
||||
#endif
|
||||
|
||||
#define do_div(n,base) ({ register unsigned int __base asm("r4") = base; register unsigned long long __n asm("r0") = n; register unsigned long long __res asm("r2"); register unsigned int __rem asm(__xh); asm( __asmeq("%0", __xh) __asmeq("%1", "r2") __asmeq("%2", "r0") __asmeq("%3", "r4") "bl __do_div64" : "=r" (__rem), "=r" (__res) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); n = __res; __rem; })
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,9 +7,15 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef ASMARM_DMA_MAPPING_H
|
||||
#define ASMARM_DMA_MAPPING_H
|
||||
|
||||
#endif
|
||||
|
@@ -7,39 +7,40 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_DMA_H
|
||||
#define __ASM_ARM_DMA_H
|
||||
|
||||
typedef unsigned int dmach_t;
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include <asm/system.h>
|
||||
#include <asm/scatterlist.h>
|
||||
#include <asm/arch/dma.h>
|
||||
|
||||
#ifndef MAX_DMA_ADDRESS
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define MAX_DMA_ADDRESS 0xffffffff
|
||||
#endif
|
||||
|
||||
typedef unsigned int dmamode_t;
|
||||
|
||||
#define DMA_MODE_MASK 3
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DMA_MODE_READ 0
|
||||
#define DMA_MODE_WRITE 1
|
||||
#define DMA_MODE_CASCADE 2
|
||||
#define DMA_AUTOINIT 4
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define clear_dma_ff(channel)
|
||||
|
||||
#define set_dma_addr(channel, addr) __set_dma_addr(channel, bus_to_virt(addr))
|
||||
|
||||
#ifndef NO_DMA
|
||||
#define NO_DMA 255
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
||||
#define isa_dma_bridge_buggy (0)
|
||||
|
||||
#endif
|
||||
|
@@ -7,26 +7,30 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_PROC_DOMAIN_H
|
||||
#define __ASM_PROC_DOMAIN_H
|
||||
|
||||
#define DOMAIN_KERNEL 0
|
||||
#define DOMAIN_TABLE 0
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DOMAIN_USER 1
|
||||
#define DOMAIN_IO 2
|
||||
|
||||
#define DOMAIN_NOACCESS 0
|
||||
#define DOMAIN_CLIENT 1
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define DOMAIN_MANAGER 3
|
||||
|
||||
#define domain_val(dom,type) ((type) << (2*(dom)))
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define set_domain(x) do { } while (0)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define modify_domain(dom,type) do { } while (0)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -7,11 +7,17 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _ASMARM_DYNTICK_H
|
||||
#define _ASMARM_DYNTICK_H
|
||||
|
||||
#include <asm/mach/time.h>
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,57 +7,58 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASMARM_ELF_H
|
||||
#define __ASMARM_ELF_H
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/user.h>
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#ifdef __KERNEL
|
||||
#include <asm/procinfo.h>
|
||||
#endif
|
||||
|
||||
typedef unsigned long elf_greg_t;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
typedef unsigned long elf_freg_t[3];
|
||||
|
||||
#define EM_ARM 40
|
||||
#define EF_ARM_APCS26 0x08
|
||||
#define EF_ARM_SOFT_FLOAT 0x200
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define EF_ARM_EABI_MASK 0xFF000000
|
||||
|
||||
#define R_ARM_NONE 0
|
||||
#define R_ARM_PC24 1
|
||||
#define R_ARM_ABS32 2
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define R_ARM_CALL 28
|
||||
#define R_ARM_JUMP24 29
|
||||
|
||||
#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
|
||||
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
typedef struct user_fp elf_fpregset_t;
|
||||
|
||||
#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && (ELF_PROC_OK((x))) )
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#ifdef __ARMEB__
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ELF_DATA ELFDATA2MSB
|
||||
#else
|
||||
#define ELF_DATA ELFDATA2LSB
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ELF_ARCH EM_ARM
|
||||
|
||||
#define USE_ELF_CORE_DUMP
|
||||
#define ELF_EXEC_PAGESIZE 4096
|
||||
|
||||
#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0
|
||||
|
||||
#define ELF_HWCAP (elf_hwcap)
|
||||
|
||||
#define ELF_PLATFORM_SIZE 8
|
||||
|
||||
#define ELF_PLATFORM (elf_platform)
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
@@ -7,11 +7,17 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _ARM_ERRNO_H
|
||||
#define _ARM_ERRNO_H
|
||||
|
||||
#include <asm-generic/errno.h>
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,16 +7,22 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _ARM_FCNTL_H
|
||||
#define _ARM_FCNTL_H
|
||||
|
||||
#define O_DIRECTORY 040000
|
||||
#define O_NOFOLLOW 0100000
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define O_DIRECT 0200000
|
||||
#define O_LARGEFILE 0400000
|
||||
|
||||
#include <asm-generic/fcntl.h>
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,62 +7,63 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_ARM_FPSTATE_H
|
||||
#define __ASM_ARM_FPSTATE_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct vfp_hard_struct {
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
__u64 fpregs[16];
|
||||
#if __LINUX_ARM_ARCH__ < 6
|
||||
__u32 fpmx_state;
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
__u32 fpexc;
|
||||
__u32 fpscr;
|
||||
|
||||
__u32 fpinst;
|
||||
__u32 fpinst2;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
};
|
||||
|
||||
union vfp_state {
|
||||
struct vfp_hard_struct hard;
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FP_HARD_SIZE 35
|
||||
|
||||
struct fp_hard_struct {
|
||||
unsigned int save[FP_HARD_SIZE];
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FP_SOFT_SIZE 35
|
||||
|
||||
struct fp_soft_struct {
|
||||
unsigned int save[FP_SOFT_SIZE];
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define IWMMXT_SIZE 0x98
|
||||
|
||||
struct iwmmxt_struct {
|
||||
unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
union fp_state {
|
||||
struct fp_hard_struct hard;
|
||||
struct fp_soft_struct soft;
|
||||
};
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
|
||||
|
||||
struct crunch_state {
|
||||
unsigned int mvdx[16][2];
|
||||
unsigned int mvax[4][3];
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
unsigned int dspsc[2];
|
||||
};
|
||||
|
||||
#define CRUNCH_SIZE sizeof(struct crunch_state)
|
||||
|
||||
#endif
|
||||
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#endif
|
||||
|
@@ -7,5 +7,12 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
|
@@ -7,32 +7,37 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_HARDIRQ_H
|
||||
#define __ASM_HARDIRQ_H
|
||||
|
||||
#include <linux/cache.h>
|
||||
#include <linux/threads.h>
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#include <asm/irq.h>
|
||||
|
||||
typedef struct {
|
||||
unsigned int __softirq_pending;
|
||||
unsigned int local_timer_irqs;
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
} ____cacheline_aligned irq_cpustat_t;
|
||||
|
||||
#include <linux/irq_cpustat.h>
|
||||
|
||||
#if NR_IRQS > 256
|
||||
#define HARDIRQ_BITS 9
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#else
|
||||
#define HARDIRQ_BITS 8
|
||||
#endif
|
||||
|
||||
#if 1 << HARDIRQ_BITS < NR_IRQS
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#error HARDIRQ_BITS is too low!
|
||||
#endif
|
||||
|
||||
#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
@@ -7,11 +7,17 @@
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __ASM_HARDWARE_H
|
||||
#define __ASM_HARDWARE_H
|
||||
|
||||
#include <asm/arch/hardware.h>
|
||||
|
||||
#endif
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user