diff options
Diffstat (limited to 'include')
31 files changed, 788 insertions, 3175 deletions
diff --git a/include/arch/darwin-x86/AndroidConfig.h b/include/arch/darwin-x86/AndroidConfig.h deleted file mode 100644 index 48f8d9a..0000000 --- a/include/arch/darwin-x86/AndroidConfig.h +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -/* - * Android config -- "Darwin". Used for X86 Mac OS X. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX - */ -#define HAVE_PTHREADS - -/* - * Do we have the futex syscall? - */ - -/* #define HAVE_FUTEX */ - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#define HAVE_FORKEXEC - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -/* #define HAVE_OOM_ADJ */ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_MACOSX_IPC - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#define HAVE_POSIX_FILEMAP - -/* - * Define this if you have <termio.h> - */ -#define HAVE_TERMIO_H - -/* - * Define this if you have <sys/sendfile.h> - */ -/* #define HAVE_SYS_SENDFILE_H 1 */ - -/* - * Define this if you build against MSVCRT.DLL - */ -/* #define HAVE_MS_C_RUNTIME */ - -/* - * Define this if you have sys/uio.h - */ -#define HAVE_SYS_UIO_H - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - -/* - * Define this if we have localtime_r(). - */ -#define HAVE_LOCALTIME_R 1 - -/* - * Define this if we have gethostbyname_r(). - */ -/* #define HAVE_GETHOSTBYNAME_R */ - -/* - * Define this if we have ioctl(). - */ -/* #define HAVE_IOCTL */ - -/* - * Define this if we want to use WinSock. - */ -/* #define HAVE_WINSOCK */ - -/* - * Define this if have clock_gettime() and friends - */ -/* #define HAVE_POSIX_CLOCKS */ - -/* - * Define this if we have pthread_cond_timedwait_monotonic() and - * clock_gettime(CLOCK_MONOTONIC). - */ -/* #define HAVE_TIMEDWAIT_MONOTONIC */ - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -#if (defined(__ppc__) || defined(__ppc64__)) -# define HAVE_BIG_ENDIAN -#elif (defined(__i386__) || defined(__x86_64__)) -# define HAVE_LITTLE_ENDIAN -#endif - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -#define _FILE_OFFSET_BITS 64 -#define _LARGEFILE_SOURCE 1 - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -/* #define HAVE_OFF64_T */ - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 0 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 0 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -/* #define HAVE_GETTID */ - - -/* - * Add any extra platform-specific defines here. - */ -#define _THREAD_SAFE - -/* - * Define if we have <malloc.h> header - */ -/* #define HAVE_MALLOC_H */ - -/* - * Define if tm struct has tm_gmtoff field - */ -#define HAVE_TM_GMTOFF 1 - -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - -/* - * Define if we have madvise() in <sys/mman.h> - */ -#define HAVE_MADVISE 1 - -/* - * Define if we include <sys/mount.h> for statfs() - */ -#define INCLUDE_SYS_MOUNT_FOR_STATFS 1 - -/* - * What CPU architecture does this platform use? - */ -#if (defined(__ppc__) || defined(__ppc64__)) -# define ARCH_PPC -#elif (defined(__i386__) || defined(__x86_64__)) -# define ARCH_X86 -#endif - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.dylib" - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE char * - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '/' - -/* - * Is the filesystem case sensitive? - * - * For tools apps, we'll treat is as not case sensitive. - */ -/* #define OS_CASE_SENSITIVE */ - -/* - * Define if <sys/socket.h> exists. - */ -#define HAVE_SYS_SOCKET_H 1 - -/* - * Define if the strlcpy() function exists on the system. - */ -#define HAVE_STRLCPY 1 - -/* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* - * Define if the BSD funopen() function exists on the system. - */ -#define HAVE_FUNOPEN 1 - -/* - * Define if writev() exists - */ -#define HAVE_WRITEV 1 - -/* - * Define if <stdint.h> exists. - */ -#define HAVE_STDINT_H 1 - -/* - * Define if <stdbool.h> exists. - */ -#define HAVE_STDBOOL_H 1 - -/* - * Define if <sched.h> exists. - */ -#define HAVE_SCHED_H 1 - -/* - * Define if pread() exists - */ -#define HAVE_PREAD 1 - -/* - * Define if we have st_mtim in struct stat - */ -#define HAVE_STAT_ST_MTIM 1 - -/* - * Define if printf() supports %zd for size_t arguments - */ -#define HAVE_PRINTF_ZD 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype. - */ -#define HAVE_BSD_QSORT_R 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype. - */ -#define HAVE_GNU_QSORT_R 0 - -#endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/freebsd-x86/AndroidConfig.h b/include/arch/freebsd-x86/AndroidConfig.h deleted file mode 100644 index 4bc5559..0000000 --- a/include/arch/freebsd-x86/AndroidConfig.h +++ /dev/null @@ -1,376 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -/* - * Android config -- "FreeBSD". Used for desktop x86 FreeBSD. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * make sure we are building for FreeBSD - */ -#ifndef OS_FREEBSD -#define OS_FREEBSD -#endif -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX - */ -#define HAVE_PTHREADS - -/* - * Do we have the futex syscall? - */ -/* #define HAVE_FUTEX */ - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#define HAVE_FORKEXEC - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -/* #define HAVE_OOM_ADJ */ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_SYSV_IPC - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#define HAVE_POSIX_FILEMAP - -/* - * Define this if you have <termio.h> - */ -/* #define HAVE_TERMIO_H */ - -/* - * Define this if you have <sys/sendfile.h> - */ -/* #define HAVE_SYS_SENDFILE_H 1 */ - -/* - * Define this if you build against MSVCRT.DLL - */ -/* #define HAVE_MS_C_RUNTIME */ - -/* - * Define this if you have sys/uio.h - */ -#define HAVE_SYS_UIO_H - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - -/* - * Define this if we have localtime_r(). - */ -#define HAVE_LOCALTIME_R 1 - -/* - * Define this if we have gethostbyname_r(). - */ -/* #define HAVE_GETHOSTBYNAME_R */ - -/* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* - * Define this if we want to use WinSock. - */ -/* #define HAVE_WINSOCK */ - -/* - * Define this if have clock_gettime() and friends - * - * Desktop Linux has this in librt, but it's broken in goobuntu, yielding - * mildly or wildly inaccurate results. - */ -#define HAVE_POSIX_CLOCKS - -/* - * Define this if we have pthread_cond_timedwait_monotonic() and - * clock_gettime(CLOCK_MONOTONIC). - */ -/* #define HAVE_TIMEDWAIT_MONOTONIC */ - -/* - * Define this if we have linux style epoll() - */ -/* #define HAVE_EPOLL */ - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -/* #define HAVE_ENDIAN_H */ -#define HAVE_LITTLE_ENDIAN - -/* - * Define this if you have sys/endian.h - * NOTE: mutually exclusive with HAVE_ENDIAN_H - */ -#define HAVE_SYS_ENDIAN_H - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -#define _FILE_OFFSET_BITS 64 -#define _LARGEFILE_SOURCE 1 - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -/* #define HAVE_OFF64_T */ - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 0 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 1 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -/* #define HAVE_GETTID */ - -/* - * Defined if we have the sched_setscheduler() call - */ -#define HAVE_SCHED_SETSCHEDULER - -/* - * Add any extra platform-specific defines here. - */ - -/* - * Define if we have <malloc.h> header - */ -#define HAVE_MALLOC_H - -/* - * Define if we have Linux-style non-filesystem Unix Domain Sockets - */ - -/* - * What CPU architecture does this platform use? - */ -#define ARCH_X86 - - -/* - * Define if we have Linux's inotify in <sys/inotify.h>. - */ -/*#define HAVE_INOTIFY 1*/ - -/* - * Define if we have madvise() in <sys/mman.h> - */ -#define HAVE_MADVISE 1 - -/* - * Define if tm struct has tm_gmtoff field - */ -#define HAVE_TM_GMTOFF 1 - -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - -/* - * Define if libc includes Android system properties implementation. - */ -/* #define HAVE_LIBC_SYSTEM_PROPERTIES */ - -/* - * Define if system provides a system property server (should be - * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). - */ -#define HAVE_SYSTEM_PROPERTY_SERVER - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.so" - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE char * - -/* - * Do we have the sigaction flag SA_NOCLDWAIT? - */ -#define HAVE_SA_NOCLDWAIT - -/* - * Define if we include <sys/mount.h> for statfs() - */ -#define INCLUDE_SYS_MOUNT_FOR_STATFS 1 - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '/' - -/* - * Is the filesystem case sensitive? - */ -#define OS_CASE_SENSITIVE - -/* - * Define if <sys/socket.h> exists. - */ -#define HAVE_SYS_SOCKET_H 1 - -/* - * Define if the strlcpy() function exists on the system. - */ -#define HAVE_STRLCPY 1 - -/* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* - * Define if the BSD funopen() function exists on the system. - */ -#define HAVE_FUNOPEN 1 - -/* - * Define if prctl() exists - */ -/* #define HAVE_PRCTL 1 */ - -/* - * Define if writev() exists - */ -#define HAVE_WRITEV 1 - -/* - * Define if <alloca.h> does not exist - * NOTE: <alloca.h> defines alloca() which - * on FreeBSD is defined in <stdlib.h> - */ -#define HAVE_NO_ALLOCA_H - -/* - * Defines CLOCK_PROCESS_CPUTIME_ID for clock_gettime() - * XXX: CLOCK_PROF seems to be commonly used replacement - */ -#ifndef CLOCK_PROCESS_CPUTIME_ID -#define CLOCK_PROCESS_CPUTIME_ID CLOCK_PROF -#endif - -/* - * Define if <stdint.h> exists. - */ -/* #define HAVE_STDINT_H */ - -/* - * Define if <stdbool.h> exists. - */ -/* #define HAVE_STDBOOL_H */ - -/* - * Define if <sched.h> exists. - */ -#define HAVE_SCHED_H 1 - -/* - * Define if pread() exists - */ -#define HAVE_PREAD 1 -/* - * Define if we have st_mtim in struct stat - */ -#define HAVE_STAT_ST_MTIM 1 - -/* - * Define if printf() supports %zd for size_t arguments - */ -#define HAVE_PRINTF_ZD 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype. - */ -#define HAVE_BSD_QSORT_R 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype. - */ -#define HAVE_GNU_QSORT_R 0 - -#endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/linux-arm/AndroidConfig.h b/include/arch/linux-arm/AndroidConfig.h deleted file mode 100644 index 233752b..0000000 --- a/include/arch/linux-arm/AndroidConfig.h +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -/* - * Android config -- "android-arm". Used for ARM device builds. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX - */ -#define HAVE_PTHREADS - -/* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* - * Define if we already have the futex wrapper functions defined. Yes if - * compiling against bionic. - */ -#define HAVE_FUTEX_WRAPPERS 1 - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#define HAVE_FORKEXEC - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -#define HAVE_OOM_ADJ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_ANDROID_IPC - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#define HAVE_POSIX_FILEMAP - -/* - * Define this if you have <termio.h> - */ -#define HAVE_TERMIO_H 1 - -/* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* - * Define this if you build against MSVCRT.DLL - */ -/* #define HAVE_MS_C_RUNTIME */ - -/* - * Define this if you have sys/uio.h - */ -#define HAVE_SYS_UIO_H 1 - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - -/* - * Define this if we have localtime_r(). - */ -/* #define HAVE_LOCALTIME_R 1 */ - -/* - * Define this if we have gethostbyname_r(). - */ -/* #define HAVE_GETHOSTBYNAME_R */ - -/* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* - * Define this if we want to use WinSock. - */ -/* #define HAVE_WINSOCK */ - -/* - * Define this if have clock_gettime() and friends - */ -#define HAVE_POSIX_CLOCKS - -/* - * Define this if we have pthread_cond_timedwait_monotonic() and - * clock_gettime(CLOCK_MONOTONIC). - */ -#define HAVE_TIMEDWAIT_MONOTONIC - -/* - * Define this if we have linux style epoll() - */ -#define HAVE_EPOLL - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -#define HAVE_ENDIAN_H -#define HAVE_LITTLE_ENDIAN - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -/* #define _FILE_OFFSET_BITS 64 */ -/* #define _LARGEFILE_SOURCE 1 */ - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -#define HAVE_OFF64_T - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 0 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 1 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - -/* - * Defined if we have the sched_setscheduler() call - */ -#define HAVE_SCHED_SETSCHEDULER - -/* - * Add any extra platform-specific defines here. - */ -#ifndef __linux__ -#define __linux__ -#endif - -/* - * Define if we have <malloc.h> header - */ -#define HAVE_MALLOC_H - -/* - * Define if we're running on *our* linux on device or emulator. - */ -#define HAVE_ANDROID_OS 1 - -/* - * Define if we have Linux-style non-filesystem Unix Domain Sockets - */ -#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1 - -/* - * Define if we have Linux's inotify in <sys/inotify.h>. - */ -#define HAVE_INOTIFY 1 - -/* - * Define if we have madvise() in <sys/mman.h> - */ -#define HAVE_MADVISE 1 - -/* - * Define if tm struct has tm_gmtoff field - */ -#define HAVE_TM_GMTOFF 1 - -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - -/* - * Define if libc includes Android system properties implementation. - */ -#define HAVE_LIBC_SYSTEM_PROPERTIES 1 - -/* - * Define if system provides a system property server (should be - * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). - */ -/* #define HAVE_SYSTEM_PROPERTY_SERVER */ - -/* - * What CPU architecture does this platform use? - */ -#define ARCH_ARM - -/* - * Define if the size of enums is as short as possible, - */ -/* #define HAVE_SHORT_ENUMS */ - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.so" - -/* - * Do we have __memcmp16()? - */ -#define HAVE__MEMCMP16 1 - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* - * Do we have the sigaction flag SA_NOCLDWAIT? - */ -#define HAVE_SA_NOCLDWAIT - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '/' - -/* - * Is the filesystem case sensitive? - */ -#define OS_CASE_SENSITIVE - -/* - * Define if <sys/socket.h> exists. - */ -#define HAVE_SYS_SOCKET_H 1 - -/* - * Define if the strlcpy() function exists on the system. - */ -#define HAVE_STRLCPY 1 - -/* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* - * Define if the BSD funopen() function exists on the system. - */ -#define HAVE_FUNOPEN 1 - -/* - * Define if prctl() exists - */ -#define HAVE_PRCTL 1 - -/* - * Define if writev() exists - */ -#define HAVE_WRITEV 1 - -/* - * Define if <stdint.h> exists. - */ -#define HAVE_STDINT_H 1 - -/* - * Define if <stdbool.h> exists. - */ -#define HAVE_STDBOOL_H 1 - -/* - * Define if <sched.h> exists. - */ -#define HAVE_SCHED_H 1 - -/* - * Define if pread() exists - */ -#define HAVE_PREAD 1 - -/* - * Define if we have st_mtim in struct stat - */ -#define HAVE_STAT_ST_MTIM 1 - -/* - * Define if printf() supports %zd for size_t arguments - */ -#define HAVE_PRINTF_ZD 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype. - */ -#define HAVE_BSD_QSORT_R 0 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype. - */ -#define HAVE_GNU_QSORT_R 0 - -#endif /* _ANDROID_CONFIG_H */ diff --git a/include/arch/linux-mips/AndroidConfig.h b/include/arch/linux-mips/AndroidConfig.h deleted file mode 100644 index 2d51dc7..0000000 --- a/include/arch/linux-mips/AndroidConfig.h +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -/* - * Android config -- "android-mips". Used for MIPS device builds. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX - */ -#define HAVE_PTHREADS - -/* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* - * Define if we already have the futex wrapper functions defined. Yes if - * compiling against bionic. - */ -#define HAVE_FUTEX_WRAPPERS 1 - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#define HAVE_FORKEXEC - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -#define HAVE_OOM_ADJ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_ANDROID_IPC - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#define HAVE_POSIX_FILEMAP - -/* - * Define this if you have <termio.h> - */ -#define HAVE_TERMIO_H 1 - -/* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* - * Define this if you build against MSVCRT.DLL - */ -/* #define HAVE_MS_C_RUNTIME */ - -/* - * Define this if you have sys/uio.h - */ -#define HAVE_SYS_UIO_H 1 - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - -/* - * Define this if we have localtime_r(). - */ -/* #define HAVE_LOCALTIME_R */ - -/* - * Define this if we have gethostbyname_r(). - */ -/* #define HAVE_GETHOSTBYNAME_R */ - -/* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* - * Define this if we want to use WinSock. - */ -/* #define HAVE_WINSOCK */ - -/* - * Define this if have clock_gettime() and friends - */ -#define HAVE_POSIX_CLOCKS - -/* - * Define this if we have pthread_cond_timedwait_monotonic() and - * clock_gettime(CLOCK_MONOTONIC). - */ -#define HAVE_TIMEDWAIT_MONOTONIC - -/* - * Define this if we have linux style epoll() - */ -#define HAVE_EPOLL - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -#define HAVE_ENDIAN_H -#if defined(__MIPSEB__) -#define HAVE_BIG_ENDIAN -#endif -#if defined(__MIPSEL__) -#define HAVE_LITTLE_ENDIAN -#endif - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -/* #define _FILE_OFFSET_BITS 64 */ -/* #define _LARGEFILE_SOURCE 1 */ - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -#define HAVE_OFF64_T - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 0 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 1 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - -/* - * Defined if we have the sched_setscheduler() call - */ -#define HAVE_SCHED_SETSCHEDULER - -/* - * Add any extra platform-specific defines here. - */ -#ifndef __linux__ -#define __linux__ 1 -#endif - -#ifndef __linux -#define __linux 1 -#endif - -#ifdef __unix__ -#undef __unix__ -#endif - -#ifdef __unix -#undef __unix -#endif - -/* - * Define if we have <malloc.h> header - */ -#define HAVE_MALLOC_H - -/* - * Define if we're running on *our* linux on device or emulator. - */ -#define HAVE_ANDROID_OS 1 - -/* - * Define if we have Linux-style non-filesystem Unix Domain Sockets - */ -#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1 - -/* - * Define if we have Linux's inotify in <sys/inotify.h>. - */ -#define HAVE_INOTIFY 1 - -/* - * Define if we have madvise() in <sys/mman.h> - */ -#define HAVE_MADVISE 1 - -/* - * Define if tm struct has tm_gmtoff field - */ -#define HAVE_TM_GMTOFF 1 - -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - -/* - * Define if libc includes Android system properties implementation. - */ -#define HAVE_LIBC_SYSTEM_PROPERTIES 1 - -/* - * Define if system provides a system property server (should be - * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). - */ -/* #define HAVE_SYSTEM_PROPERTY_SERVER */ - -/* - * What CPU architecture does this platform use? - */ -#define ARCH_MIPS 1 - -/* - * Define if the size of enums is as short as possible, - */ -/* #define HAVE_SHORT_ENUMS */ - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.so" - -/* - * Do we have __memcmp16()? - */ -#define HAVE__MEMCMP16 1 - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* - * Do we have the sigaction flag SA_NOCLDWAIT? - */ -#define HAVE_SA_NOCLDWAIT - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '/' - -/* - * Is the filesystem case sensitive? - */ -#define OS_CASE_SENSITIVE - -/* - * Define if <sys/socket.h> exists. - */ -#define HAVE_SYS_SOCKET_H 1 - -/* - * Define if the strlcpy() function exists on the system. - */ -#define HAVE_STRLCPY 1 - -/* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* - * Define if the BSD funopen() function exists on the system. - */ -#define HAVE_FUNOPEN 1 - -/* - * Define if prctl() exists - */ -#define HAVE_PRCTL 1 - -/* - * Define if writev() exists - */ -#define HAVE_WRITEV 1 - -/* - * Define if <stdint.h> exists. - */ -#define HAVE_STDINT_H 1 - -/* - * Define if <stdbool.h> exists. - */ -#define HAVE_STDBOOL_H 1 - -/* - * Define if <sched.h> exists. - */ -#define HAVE_SCHED_H 1 - -/* - * Define if pread() exists - */ -#define HAVE_PREAD 1 - -/* - * Define if we have st_mtim in struct stat - */ -#define HAVE_STAT_ST_MTIM 1 - -/* - * Define if printf() supports %zd for size_t arguments - */ -#define HAVE_PRINTF_ZD 1 - -/* - * Whether or not _Unwind_Context is defined as a struct. - */ -#define HAVE_UNWIND_CONTEXT_STRUCT 1 - -#endif /* _ANDROID_CONFIG_H */ diff --git a/include/arch/linux-ppc/AndroidConfig.h b/include/arch/linux-ppc/AndroidConfig.h deleted file mode 100644 index ae2569b..0000000 --- a/include/arch/linux-ppc/AndroidConfig.h +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -/* - * Android config -- "Linux". Used for desktop ppc Linux. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX - */ -#define HAVE_PTHREADS - -/* - * Do we have the futex syscall? - */ - -#define HAVE_FUTEX - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#define HAVE_FORKEXEC - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -#define HAVE_OOM_ADJ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_SYSV_IPC - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#define HAVE_POSIX_FILEMAP - -/* - * Define this if you have <termio.h> - */ -#define HAVE_TERMIO_H 1 - -/* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* - * Define this if you build against MSVCRT.DLL - */ -/* #define HAVE_MS_C_RUNTIME */ - -/* - * Define this if you have sys/uio.h - */ -#define HAVE_SYS_UIO_H 1 - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - -/* - * Define this if we have localtime_r(). - */ -#define HAVE_LOCALTIME_R 1 - -/* - * Define this if we have gethostbyname_r(). - */ -#define HAVE_GETHOSTBYNAME_R - -/* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* - * Define this if we want to use WinSock. - */ -/* #define HAVE_WINSOCK */ - -/* - * Define this if have clock_gettime() and friends - * - * Desktop Linux has this in librt, but it's broken in goobuntu, yielding - * mildly or wildly inaccurate results. - */ -/*#define HAVE_POSIX_CLOCKS*/ - -/* - * Define this if we have pthread_cond_timedwait_monotonic() and - * clock_gettime(CLOCK_MONOTONIC). - */ -/* #define HAVE_TIMEDWAIT_MONOTONIC */ - -/* - * Define this if we have linux style epoll() - */ -#define HAVE_EPOLL - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -#define HAVE_ENDIAN_H -#define HAVE_BIG_ENDIAN - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -#define _FILE_OFFSET_BITS 64 -#define _LARGEFILE_SOURCE 1 - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -#define HAVE_OFF64_T - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 1 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 1 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -/* #define HAVE_GETTID */ - -/* - * Defined if we have the sched_setscheduler() call - */ -#define HAVE_SCHED_SETSCHEDULER - -/* - * Add any extra platform-specific defines here. - */ - -/* - * Define if we have <malloc.h> header - */ -#define HAVE_MALLOC_H - -/* - * Define if we have Linux-style non-filesystem Unix Domain Sockets - */ - -/* - * What CPU architecture does this platform use? - */ -#define ARCH_PPC - - -/* - * Define if we have Linux's inotify in <sys/inotify.h>. - */ -/*#define HAVE_INOTIFY 1*/ - -/* - * Define if we have madvise() in <sys/mman.h> - */ -#define HAVE_MADVISE 1 - -/* - * Define if tm struct has tm_gmtoff field - */ -#define HAVE_TM_GMTOFF 1 - -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - -/* - * Define if libc includes Android system properties implementation. - */ -/* #define HAVE_LIBC_SYSTEM_PROPERTIES */ - -/* - * Define if system provides a system property server (should be - * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). - */ -#define HAVE_SYSTEM_PROPERTY_SERVER - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.so" - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* - * Do we have the sigaction flag SA_NOCLDWAIT? - */ -#define HAVE_SA_NOCLDWAIT - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '/' - -/* - * Is the filesystem case sensitive? - */ -#define OS_CASE_SENSITIVE - -/* - * Define if <sys/socket.h> exists. - */ -#define HAVE_SYS_SOCKET_H 1 - -/* - * Define if the strlcpy() function exists on the system. - */ -/* #define HAVE_STRLCPY 1 */ - -/* - * Define if the open_memstream() function exists on the system. - */ -#define HAVE_OPEN_MEMSTREAM 1 - -/* - * Define if the BSD funopen() function exists on the system. - */ -/* #define HAVE_FUNOPEN 1 */ - -/* - * Define if prctl() exists - */ -#define HAVE_PRCTL 1 - -/* - * Define if writev() exists - */ -#define HAVE_WRITEV 1 - -/* - * Define if <stdint.h> exists. - */ -#define HAVE_STDINT_H 1 - -/* - * Define if <stdbool.h> exists. - */ -#define HAVE_STDBOOL_H 1 - -/* - * Define if <sched.h> exists. - */ -#define HAVE_SCHED_H 1 - -/* - * Define if pread() exists - */ -#define HAVE_PREAD 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype. - */ -#define HAVE_BSD_QSORT_R 0 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype. - */ -#define HAVE_GNU_QSORT_R 1 - -#endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/linux-x86/AndroidConfig.h b/include/arch/linux-x86/AndroidConfig.h deleted file mode 100644 index 431a54b..0000000 --- a/include/arch/linux-x86/AndroidConfig.h +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -/* - * Android config -- "Linux". Used for desktop x86 Linux. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX - */ -#define HAVE_PTHREADS - -/* - * Do we have the futex syscall? - */ - -#define HAVE_FUTEX - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#define HAVE_FORKEXEC - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -#define HAVE_OOM_ADJ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_SYSV_IPC - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#define HAVE_POSIX_FILEMAP - -/* - * Define this if you have <termio.h> - */ -#define HAVE_TERMIO_H 1 - -/* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* - * Define this if you build against MSVCRT.DLL - */ -/* #define HAVE_MS_C_RUNTIME */ - -/* - * Define this if you have sys/uio.h - */ -#define HAVE_SYS_UIO_H 1 - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - -/* - * Define this if we have localtime_r(). - */ -#define HAVE_LOCALTIME_R 1 - -/* - * Define this if we have gethostbyname_r(). - */ -#define HAVE_GETHOSTBYNAME_R - -/* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* - * Define this if we want to use WinSock. - */ -/* #define HAVE_WINSOCK */ - -/* - * Define this if have clock_gettime() and friends - * - * Desktop Linux has this in librt, but it's broken in goobuntu, yielding - * mildly or wildly inaccurate results. - */ -/*#define HAVE_POSIX_CLOCKS*/ - -/* - * Define this if we have pthread_cond_timedwait_monotonic() and - * clock_gettime(CLOCK_MONOTONIC). - */ -/* #define HAVE_TIMEDWAIT_MONOTONIC */ - -/* - * Define this if we have linux style epoll() - */ -#define HAVE_EPOLL - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -#define HAVE_ENDIAN_H -#define HAVE_LITTLE_ENDIAN - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -#define _FILE_OFFSET_BITS 64 -#define _LARGEFILE_SOURCE 1 - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -#define HAVE_OFF64_T - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 1 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 1 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -/* #define HAVE_GETTID */ - -/* - * Defined if we have the sched_setscheduler() call - */ -#define HAVE_SCHED_SETSCHEDULER - -/* - * Add any extra platform-specific defines here. - */ - -/* - * Define if we have <malloc.h> header - */ -#define HAVE_MALLOC_H - -/* - * Define if we have Linux-style non-filesystem Unix Domain Sockets - */ - -/* - * What CPU architecture does this platform use? - */ -#define ARCH_X86 - - -/* - * Define if we have Linux's inotify in <sys/inotify.h>. - */ -/*#define HAVE_INOTIFY 1*/ - -/* - * Define if we have madvise() in <sys/mman.h> - */ -#define HAVE_MADVISE 1 - -/* - * Define if tm struct has tm_gmtoff field - */ -#define HAVE_TM_GMTOFF 1 - -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - -/* - * Define if libc includes Android system properties implementation. - */ -/* #define HAVE_LIBC_SYSTEM_PROPERTIES */ - -/* - * Define if system provides a system property server (should be - * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). - */ -#define HAVE_SYSTEM_PROPERTY_SERVER - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.so" - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* - * Do we have the sigaction flag SA_NOCLDWAIT? - */ -#define HAVE_SA_NOCLDWAIT - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '/' - -/* - * Is the filesystem case sensitive? - */ -#define OS_CASE_SENSITIVE - -/* - * Define if <sys/socket.h> exists. - */ -#define HAVE_SYS_SOCKET_H 1 - -/* - * Define if the strlcpy() function exists on the system. - */ -/* #define HAVE_STRLCPY 1 */ - -/* - * Define if the open_memstream() function exists on the system. - */ -#define HAVE_OPEN_MEMSTREAM 1 - -/* - * Define if the BSD funopen() function exists on the system. - */ -/* #define HAVE_FUNOPEN 1 */ - -/* - * Define if prctl() exists - */ -#define HAVE_PRCTL 1 - -/* - * Define if writev() exists - */ -#define HAVE_WRITEV 1 - -/* - * Define if <stdint.h> exists. - */ -#define HAVE_STDINT_H 1 - -/* - * Define if <stdbool.h> exists. - */ -#define HAVE_STDBOOL_H 1 - -/* - * Define if <sched.h> exists. - */ -#define HAVE_SCHED_H 1 - -/* - * Define if pread() exists - */ -#define HAVE_PREAD 1 - -/* - * Define if we have st_mtim in struct stat - */ -#define HAVE_STAT_ST_MTIM 1 - -/* - * Define if printf() supports %zd for size_t arguments - */ -#define HAVE_PRINTF_ZD 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype. - */ -#define HAVE_BSD_QSORT_R 0 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype. - */ -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) -#define HAVE_GNU_QSORT_R 1 -#else -#define HAVE_GNU_QSORT_R 0 -#endif - -#endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/target_linux-x86/AndroidConfig.h b/include/arch/target_linux-x86/AndroidConfig.h deleted file mode 100644 index ab53892..0000000 --- a/include/arch/target_linux-x86/AndroidConfig.h +++ /dev/null @@ -1,363 +0,0 @@ -/* - * Copyright 2005 The Android Open Source Project - * - * Android config -- "target_linux-x86". Used for x86 linux target devices. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX - */ -#define HAVE_PTHREADS - -/* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* - * Define if we already have the futex wrapper functions defined. Yes if - * compiling against bionic. - */ -#define HAVE_FUTEX_WRAPPERS 1 - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#define HAVE_FORKEXEC - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -#define HAVE_OOM_ADJ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_ANDROID_IPC 1 - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#define HAVE_POSIX_FILEMAP 1 - -/* - * Define this if you have <termio.h> - */ -#define HAVE_TERMIO_H 1 - -/* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* - * Define this if you build against have Microsoft C runtime (MSVCRT.DLL) - */ -/* #define HAVE_MS_C_RUNTIME */ - -/* - * Define this if you have sys/uio.h - */ -#define HAVE_SYS_UIO_H 1 - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS 1 - -/* - * Define this if we have localtime_r(). - */ -/* #define HAVE_LOCALTIME_R 1 */ - -/* - * Define this if we have gethostbyname_r(). - */ -/* #define HAVE_GETHOSTBYNAME_R */ - -/* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* - * Define this if we want to use WinSock. - */ -/* #define HAVE_WINSOCK */ - -/* - * Define this if have clock_gettime() and friends - * - */ -#define HAVE_POSIX_CLOCKS - -/* - * Define this if we have pthread_cond_timedwait_monotonic() and - * clock_gettime(CLOCK_MONOTONIC). - */ -#define HAVE_TIMEDWAIT_MONOTONIC - -/* - * Define this if we have linux style epoll() - */ -#define HAVE_EPOLL - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -#define HAVE_ENDIAN_H -#define HAVE_LITTLE_ENDIAN - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -/* - * #define _FILE_OFFSET_BITS 64 - * #define _LARGEFILE_SOURCE 1 - */ - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -#define HAVE_OFF64_T - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 0 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 0 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - -/* - * Defined if we have the sched_setscheduler() call - */ -#define HAVE_SCHED_SETSCHEDULER - -/* - * Add any extra platform-specific defines here. - */ -#ifndef __linux__ -#define __linux__ -#endif - -/* - * Define if we have <malloc.h> header - */ -#define HAVE_MALLOC_H - -/* - * Define if we're running on *our* linux on device or emulator. - */ -#define HAVE_ANDROID_OS 1 - -/* - * Define if we have Linux-style non-filesystem Unix Domain Sockets - */ -#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1 - -/* - * Define if we have Linux's inotify in <sys/inotify.h>. - */ -#define HAVE_INOTIFY 1 - -/* - * Define if we have madvise() in <sys/mman.h> - */ -#define HAVE_MADVISE 1 - -/* - * Define if we have Linux's dbus - */ -/* #define HAVE_DBUS 1 */ - -/* - * Define if tm struct has tm_gmtoff field - */ -#define HAVE_TM_GMTOFF 1 - -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - -/* - * Define if libc includes Android system properties implementation. - */ -#define HAVE_LIBC_SYSTEM_PROPERTIES 1 - -/* - * Define if system provides a system property server (should be - * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). - */ -/* #define HAVE_SYSTEM_PROPERTY_SERVER */ - -/* - * What CPU architecture does this platform use? - */ -#define ARCH_X86 - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.so" - -/* - * Do we have __memcmp16()? - */ -/* #define HAVE__MEMCMP16 1 */ - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* - * Do we have the sigaction flag SA_NOCLDWAIT? - */ -#define HAVE_SA_NOCLDWAIT - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '/' - -/* - * Is the filesystem case sensitive? - */ -#define OS_CASE_SENSITIVE - -/* - * Define if <sys/socket.h> exists. - */ -#define HAVE_SYS_SOCKET_H 1 - -/* - * Define if the strlcpy() function exists on the system. - */ -#define HAVE_STRLCPY 1 - -/* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* - * Define if the BSD funopen() function exists on the system. - */ -#define HAVE_FUNOPEN 1 - -/* - * Define if prctl() exists - */ -#define HAVE_PRCTL 1 - -/* - * Whether or not _Unwind_Context is defined as a struct. - */ -#define HAVE_UNWIND_CONTEXT_STRUCT - -/* - * Define if <stdint.h> exists. - */ -#define HAVE_STDINT_H 1 - -/* - * Define if <stdbool.h> exists. - */ -#define HAVE_STDBOOL_H 1 - -/* - * Define if <sched.h> exists. - */ -#define HAVE_SCHED_H 1 - -/* - * Define if pread() exists - */ -#define HAVE_PREAD 1 - -/* - * Define if we have st_mtim in struct stat - */ -#define HAVE_STAT_ST_MTIM 1 - -/* - * Define if printf() supports %zd for size_t arguments - */ -#define HAVE_PRINTF_ZD 1 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype. - */ -#define HAVE_BSD_QSORT_R 0 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype. - */ -#define HAVE_GNU_QSORT_R 0 - -#endif /* _ANDROID_CONFIG_H */ diff --git a/include/arch/windows/AndroidConfig.h b/include/arch/windows/AndroidConfig.h deleted file mode 100644 index 0274da5..0000000 --- a/include/arch/windows/AndroidConfig.h +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -/* - * Android config -- "CYGWIN_NT-5.1". - * - * Cygwin has pthreads, but GDB seems to get confused if you use it to - * create threads. By "confused", I mean it freezes up the first time the - * debugged process creates a thread, even if you use CreateThread. The - * mere presence of pthreads linkage seems to cause problems. - */ -#ifndef _ANDROID_CONFIG_H -#define _ANDROID_CONFIG_H - -/* - * =========================================================================== - * !!! IMPORTANT !!! - * =========================================================================== - * - * This file is included by ALL C/C++ source files. Don't put anything in - * here unless you are absolutely certain it can't go anywhere else. - * - * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//" - * comments. - */ - -/* - * Threading model. Choose one: - * - * HAVE_PTHREADS - use the pthreads library. - * HAVE_WIN32_THREADS - use Win32 thread primitives. - */ -#define HAVE_WIN32_THREADS - -/* - * Do we have the futex syscall? - */ - -/* #define HAVE_FUTEX */ - - -/* - * Process creation model. Choose one: - * - * HAVE_FORKEXEC - use fork() and exec() - * HAVE_WIN32_PROC - use CreateProcess() - */ -#ifdef __CYGWIN__ -# define HAVE_FORKEXEC -#else -# define HAVE_WIN32_PROC -#endif - -/* - * Process out-of-memory adjustment. Set if running on Linux, - * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory - * badness adjustment. - */ -/* #define HAVE_OOM_ADJ */ - -/* - * IPC model. Choose one: - * - * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget). - * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap). - * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping). - * HAVE_ANDROID_IPC - use Android versions (?, mmap). - */ -#define HAVE_WIN32_IPC - -/* - * Memory-mapping model. Choose one: - * - * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h - * HAVE_WIN32_FILEMAP - use Win32 filemaps - */ -#ifdef __CYGWIN__ -#define HAVE_POSIX_FILEMAP -#else -#define HAVE_WIN32_FILEMAP -#endif - -/* - * Define this if you have <termio.h> - */ -#ifdef __CYGWIN__ -# define HAVE_TERMIO_H -#endif - -/* - * Define this if you have <sys/sendfile.h> - */ -#ifdef __CYGWIN__ -# define HAVE_SYS_SENDFILE_H 1 -#endif - -/* - * Define this if you build against MSVCRT.DLL - */ -#ifndef __CYGWIN__ -# define HAVE_MS_C_RUNTIME -#endif - -/* - * Define this if you have sys/uio.h - */ -#ifdef __CYGWIN__ -#define HAVE_SYS_UIO_H -#endif - - -/* - * Define this if we have localtime_r(). - */ -/* #define HAVE_LOCALTIME_R 1 */ - -/* - * Define this if we have gethostbyname_r(). - */ -/* #define HAVE_GETHOSTBYNAME_R */ - -/* - * Define this if we have ioctl(). - */ -/* #define HAVE_IOCTL */ - -/* - * Define this if we want to use WinSock. - */ -#ifndef __CYGWIN__ -#define HAVE_WINSOCK -#endif - -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -/* #define HAVE_SYMLINKS */ - -/* - * Define this if have clock_gettime() and friends - */ -/* #define HAVE_POSIX_CLOCKS */ - -/* - * Endianness of the target machine. Choose one: - * - * HAVE_ENDIAN_H -- have endian.h header we can include. - * HAVE_LITTLE_ENDIAN -- we are little endian. - * HAVE_BIG_ENDIAN -- we are big endian. - */ -#ifdef __CYGWIN__ -#define HAVE_ENDIAN_H -#endif - -#define HAVE_LITTLE_ENDIAN - -/* - * We need to choose between 32-bit and 64-bit off_t. All of our code should - * agree on the same size. For desktop systems, use 64-bit values, - * because some of our libraries (e.g. wxWidgets) expect to be built that way. - */ -#define _FILE_OFFSET_BITS 64 -#define _LARGEFILE_SOURCE 1 - -/* - * Define if platform has off64_t (and lseek64 and other xxx64 functions) - */ -#define HAVE_OFF64_T - -/* - * Defined if we have the backtrace() call for retrieving a stack trace. - * Needed for CallStack to operate; if not defined, CallStack is - * non-functional. - */ -#define HAVE_BACKTRACE 0 - -/* - * Defined if we have the dladdr() call for retrieving the symbol associated - * with a memory address. If not defined, stack crawls will not have symbolic - * information. - */ -#define HAVE_DLADDR 0 - -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Define if tm struct has tm_gmtoff field - */ -/* #define HAVE_TM_GMTOFF 1 */ - -/* - * Define if dirent struct has d_type field - */ -/* #define HAVE_DIRENT_D_TYPE 1 */ - -/* - * Define if libc includes Android system properties implementation. - */ -/* #define HAVE_LIBC_SYSTEM_PROPERTIES */ - -/* - * Define if system provides a system property server (should be - * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). - */ -/* #define HAVE_SYSTEM_PROPERTY_SERVER */ - -/* - * Define if we have madvise() in <sys/mman.h> - */ -/*#define HAVE_MADVISE 1*/ - -/* - * Add any extra platform-specific defines here. - */ -#define WIN32 1 /* stock Cygwin doesn't define these */ -#define _WIN32 1 -#define _WIN32_WINNT 0x0500 /* admit to using >= Win2K */ - -#define HAVE_WINDOWS_PATHS /* needed by simulator */ - -/* - * What CPU architecture does this platform use? - */ -#define ARCH_X86 - -/* - * sprintf() format string for shared library naming. - */ -#define OS_SHARED_LIB_FORMAT_STR "lib%s.dll" - -/* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* - * The default path separator for the platform - */ -#define OS_PATH_SEPARATOR '\\' - -/* - * Is the filesystem case sensitive? - */ -/* #define OS_CASE_SENSITIVE */ - -/* - * Define if <sys/socket.h> exists. - * Cygwin has it, but not MinGW. - */ -#ifdef USE_MINGW -/* #define HAVE_SYS_SOCKET_H */ -#else -#define HAVE_SYS_SOCKET_H 1 -#endif - -/* - * Define if the strlcpy() function exists on the system. - */ -/* #define HAVE_STRLCPY 1 */ - -/* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* - * Define if the BSD funopen() function exists on the system. - */ -/* #define HAVE_FUNOPEN 1 */ - -/* - * Define if <winsock2.h> exists. - * Only MinGW has it. - */ -#ifdef USE_MINGW -#define HAVE_WINSOCK2_H 1 -#else -/* #define HAVE_WINSOCK2_H */ -#endif - -/* - * Various definitions missing in MinGW - */ -#ifdef USE_MINGW -#define S_IRGRP 0 -#endif - -/* - * Define if writev() exists. - */ -/* #define HAVE_WRITEV */ - -/* - * Define if <stdint.h> exists. - */ -/* #define HAVE_STDINT_H */ - -/* - * Define if <stdbool.h> exists. - */ -#define HAVE_STDBOOL_H - -/* - * Define if <sched.h> exists. - */ -/* #define HAVE_SCHED_H */ - -/* - * Define if pread() exists - */ -/* #define HAVE_PREAD 1 */ - -/* - * Define if we have st_mtim in struct stat - */ -/* #define HAVE_STAT_ST_MTIM 1 */ - -/* - * Define if printf() supports %zd for size_t arguments - */ -/* #define HAVE_PRINTF_ZD 1 */ - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype. - */ -#define HAVE_BSD_QSORT_R 0 - -/* - * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype. - */ -#define HAVE_GNU_QSORT_R 0 - -#endif /*_ANDROID_CONFIG_H*/ diff --git a/include/corkscrew/map_info.h b/include/corkscrew/map_info.h index c5cd8f8..c9b241d 100644 --- a/include/corkscrew/map_info.h +++ b/include/corkscrew/map_info.h @@ -21,6 +21,7 @@ #include <sys/types.h> #include <stdbool.h> +#include <stdint.h> #ifdef __cplusplus extern "C" { @@ -31,6 +32,7 @@ typedef struct map_info { uintptr_t start; uintptr_t end; bool is_readable; + bool is_writable; bool is_executable; void* data; // arbitrary data associated with the map by the user, initially NULL char name[]; @@ -45,9 +47,10 @@ void free_map_info_list(map_info_t* milist); /* Finds the memory map that contains the specified address. */ const map_info_t* find_map_info(const map_info_t* milist, uintptr_t addr); -/* Returns true if the addr is in an readable map. */ +/* Returns true if the addr is in a readable map. */ bool is_readable_map(const map_info_t* milist, uintptr_t addr); - +/* Returns true if the addr is in a writable map. */ +bool is_writable_map(const map_info_t* milist, uintptr_t addr); /* Returns true if the addr is in an executable map. */ bool is_executable_map(const map_info_t* milist, uintptr_t addr); diff --git a/include/corkscrew/ptrace.h b/include/corkscrew/ptrace.h index 9e0da78..76276d8 100644 --- a/include/corkscrew/ptrace.h +++ b/include/corkscrew/ptrace.h @@ -24,6 +24,7 @@ #include <sys/types.h> #include <stdbool.h> +#include <stdint.h> #ifdef __cplusplus extern "C" { diff --git a/include/corkscrew/symbol_table.h b/include/corkscrew/symbol_table.h index 020c8b8..4998750 100644 --- a/include/corkscrew/symbol_table.h +++ b/include/corkscrew/symbol_table.h @@ -17,6 +17,7 @@ #ifndef _CORKSCREW_SYMBOL_TABLE_H #define _CORKSCREW_SYMBOL_TABLE_H +#include <stdint.h> #include <sys/types.h> #ifdef __cplusplus diff --git a/include/cutils/atomic-arm.h b/include/cutils/atomic-arm.h index 16fe512..172a0cd 100644 --- a/include/cutils/atomic-arm.h +++ b/include/cutils/atomic-arm.h @@ -18,91 +18,75 @@ #define ANDROID_CUTILS_ATOMIC_ARM_H #include <stdint.h> -#include <machine/cpu-features.h> -extern inline void android_compiler_barrier(void) +#ifndef ANDROID_ATOMIC_INLINE +#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) +#endif + +extern ANDROID_ATOMIC_INLINE void android_compiler_barrier() { __asm__ __volatile__ ("" : : : "memory"); } -#if ANDROID_SMP == 0 -extern inline void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern inline void android_memory_store_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_barrier() { +#if ANDROID_SMP == 0 android_compiler_barrier(); -} -#elif defined(__ARM_HAVE_DMB) -extern inline void android_memory_barrier(void) -{ +#else __asm__ __volatile__ ("dmb" : : : "memory"); +#endif } -extern inline void android_memory_store_barrier(void) -{ - __asm__ __volatile__ ("dmb st" : : : "memory"); -} -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline void android_memory_barrier(void) -{ - __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); -} -extern inline void android_memory_store_barrier(void) + +extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier() { - android_memory_barrier(); -} +#if ANDROID_SMP == 0 + android_compiler_barrier(); #else -extern inline void android_memory_barrier(void) -{ - typedef void (kuser_memory_barrier)(void); - (*(kuser_memory_barrier *)0xffff0fa0)(); -} -extern inline void android_memory_store_barrier(void) -{ - android_memory_barrier(); -} + __asm__ __volatile__ ("dmb st" : : : "memory"); #endif +} -extern inline int32_t android_atomic_acquire_load(volatile const int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int32_t android_atomic_acquire_load(volatile const int32_t *ptr) { int32_t value = *ptr; android_memory_barrier(); return value; } -extern inline int32_t android_atomic_release_load(volatile const int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int32_t android_atomic_release_load(volatile const int32_t *ptr) { android_memory_barrier(); return *ptr; } -extern inline void android_atomic_acquire_store(int32_t value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +void android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) { *ptr = value; android_memory_barrier(); } -extern inline void android_atomic_release_store(int32_t value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +void android_atomic_release_store(int32_t value, volatile int32_t *ptr) { android_memory_barrier(); *ptr = value; } -#if defined(__thumb__) -extern int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int android_atomic_cas(int32_t old_value, int32_t new_value, + volatile int32_t *ptr) { int32_t prev, status; do { __asm__ __volatile__ ("ldrex %0, [%3]\n" "mov %1, #0\n" "teq %0, %4\n" +#ifdef __thumb2__ + "it eq\n" +#endif "strexeq %1, %5, [%3]" : "=&r" (prev), "=&r" (status), "+m"(*ptr) : "r" (ptr), "Ir" (old_value), "r" (new_value) @@ -110,47 +94,26 @@ extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, } while (__builtin_expect(status != 0, 0)); return prev != old_value; } -#else -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - typedef int (kuser_cmpxchg)(int32_t, int32_t, volatile int32_t *); - int32_t prev, status; - prev = *ptr; - do { - status = (*(kuser_cmpxchg *)0xffff0fc0)(old_value, new_value, ptr); - if (__builtin_expect(status == 0, 1)) - return 0; - prev = *ptr; - } while (prev == old_value); - return 1; -} -#endif -extern inline int android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int android_atomic_acquire_cas(int32_t old_value, int32_t new_value, + volatile int32_t *ptr) { int status = android_atomic_cas(old_value, new_value, ptr); android_memory_barrier(); return status; } -extern inline int android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int android_atomic_release_cas(int32_t old_value, int32_t new_value, + volatile int32_t *ptr) { android_memory_barrier(); return android_atomic_cas(old_value, new_value, ptr); } - -#if defined(__thumb__) -extern int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr) { int32_t prev, tmp, status; android_memory_barrier(); @@ -165,34 +128,19 @@ extern inline int32_t android_atomic_add(int32_t increment, } while (__builtin_expect(status != 0, 0)); return prev; } -#else -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev + increment, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif -extern inline int32_t android_atomic_inc(volatile int32_t *addr) +extern ANDROID_ATOMIC_INLINE int32_t android_atomic_inc(volatile int32_t *addr) { return android_atomic_add(1, addr); } -extern inline int32_t android_atomic_dec(volatile int32_t *addr) +extern ANDROID_ATOMIC_INLINE int32_t android_atomic_dec(volatile int32_t *addr) { return android_atomic_add(-1, addr); } -#if defined(__thumb__) -extern int32_t android_atomic_and(int32_t value, volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) { int32_t prev, tmp, status; android_memory_barrier(); @@ -207,23 +155,9 @@ extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) } while (__builtin_expect(status != 0, 0)); return prev; } -#else -extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev & value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif -#if defined(__thumb__) -extern int32_t android_atomic_or(int32_t value, volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE +int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) { int32_t prev, tmp, status; android_memory_barrier(); @@ -238,17 +172,5 @@ extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) } while (__builtin_expect(status != 0, 0)); return prev; } -#else -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev | value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif #endif /* ANDROID_CUTILS_ATOMIC_ARM_H */ diff --git a/include/cutils/atomic-mips.h b/include/cutils/atomic-mips.h index 49144a3..f9d3e25 100644 --- a/include/cutils/atomic-mips.h +++ b/include/cutils/atomic-mips.h @@ -19,60 +19,66 @@ #include <stdint.h> -extern inline void android_compiler_barrier(void) +#ifndef ANDROID_ATOMIC_INLINE +#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) +#endif + +extern ANDROID_ATOMIC_INLINE void android_compiler_barrier(void) { __asm__ __volatile__ ("" : : : "memory"); } #if ANDROID_SMP == 0 -extern inline void android_memory_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) { android_compiler_barrier(); } -extern inline void android_memory_store_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) { android_compiler_barrier(); } #else -extern inline void android_memory_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) { __asm__ __volatile__ ("sync" : : : "memory"); } -extern inline void android_memory_store_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) { __asm__ __volatile__ ("sync" : : : "memory"); } #endif -extern inline int32_t android_atomic_acquire_load(volatile const int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_acquire_load(volatile const int32_t *ptr) { int32_t value = *ptr; android_memory_barrier(); return value; } -extern inline int32_t android_atomic_release_load(volatile const int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_release_load(volatile const int32_t *ptr) { android_memory_barrier(); return *ptr; } -extern inline void android_atomic_acquire_store(int32_t value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE void +android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) { *ptr = value; android_memory_barrier(); } -extern inline void android_atomic_release_store(int32_t value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE void +android_atomic_release_store(int32_t value, volatile int32_t *ptr) { android_memory_barrier(); *ptr = value; } -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int +android_atomic_cas(int32_t old_value, int32_t new_value, volatile int32_t *ptr) { int32_t prev, status; do { @@ -90,26 +96,28 @@ extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, return prev != old_value; } -extern inline int android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int +android_atomic_acquire_cas(int32_t old_value, + int32_t new_value, + volatile int32_t *ptr) { int status = android_atomic_cas(old_value, new_value, ptr); android_memory_barrier(); return status; } -extern inline int android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int +android_atomic_release_cas(int32_t old_value, + int32_t new_value, + volatile int32_t *ptr) { android_memory_barrier(); return android_atomic_cas(old_value, new_value, ptr); } -extern inline int32_t android_atomic_swap(int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_swap(int32_t new_value, volatile int32_t *ptr) { int32_t prev, status; do { @@ -125,8 +133,8 @@ extern inline int32_t android_atomic_swap(int32_t new_value, return prev; } -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_add(int32_t increment, volatile int32_t *ptr) { int32_t prev, status; android_memory_barrier(); @@ -142,17 +150,20 @@ extern inline int32_t android_atomic_add(int32_t increment, return prev; } -extern inline int32_t android_atomic_inc(volatile int32_t *addr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_inc(volatile int32_t *addr) { return android_atomic_add(1, addr); } -extern inline int32_t android_atomic_dec(volatile int32_t *addr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_dec(volatile int32_t *addr) { return android_atomic_add(-1, addr); } -extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_and(int32_t value, volatile int32_t *ptr) { int32_t prev, status; android_memory_barrier(); @@ -168,7 +179,8 @@ extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) return prev; } -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_or(int32_t value, volatile int32_t *ptr) { int32_t prev, status; android_memory_barrier(); diff --git a/include/cutils/atomic-x86.h b/include/cutils/atomic-x86.h index 438012e..9480f57 100644 --- a/include/cutils/atomic-x86.h +++ b/include/cutils/atomic-x86.h @@ -19,60 +19,66 @@ #include <stdint.h> -extern inline void android_compiler_barrier(void) +#ifndef ANDROID_ATOMIC_INLINE +#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) +#endif + +extern ANDROID_ATOMIC_INLINE void android_compiler_barrier(void) { __asm__ __volatile__ ("" : : : "memory"); } #if ANDROID_SMP == 0 -extern inline void android_memory_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) { android_compiler_barrier(); } -extern inline void android_memory_store_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) { android_compiler_barrier(); } #else -extern inline void android_memory_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) { __asm__ __volatile__ ("mfence" : : : "memory"); } -extern inline void android_memory_store_barrier(void) +extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) { android_compiler_barrier(); } #endif -extern inline int32_t android_atomic_acquire_load(volatile const int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_acquire_load(volatile const int32_t *ptr) { int32_t value = *ptr; android_compiler_barrier(); return value; } -extern inline int32_t android_atomic_release_load(volatile const int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_release_load(volatile const int32_t *ptr) { android_memory_barrier(); return *ptr; } -extern inline void android_atomic_acquire_store(int32_t value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE void +android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) { *ptr = value; android_memory_barrier(); } -extern inline void android_atomic_release_store(int32_t value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE void +android_atomic_release_store(int32_t value, volatile int32_t *ptr) { android_compiler_barrier(); *ptr = value; } -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int +android_atomic_cas(int32_t old_value, int32_t new_value, volatile int32_t *ptr) { int32_t prev; __asm__ __volatile__ ("lock; cmpxchgl %1, %2" @@ -82,24 +88,26 @@ extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, return prev != old_value; } -extern inline int android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int +android_atomic_acquire_cas(int32_t old_value, + int32_t new_value, + volatile int32_t *ptr) { /* Loads are not reordered with other loads. */ return android_atomic_cas(old_value, new_value, ptr); } -extern inline int android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int +android_atomic_release_cas(int32_t old_value, + int32_t new_value, + volatile int32_t *ptr) { /* Stores are not reordered with other stores. */ return android_atomic_cas(old_value, new_value, ptr); } -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_add(int32_t increment, volatile int32_t *ptr) { __asm__ __volatile__ ("lock; xaddl %0, %1" : "+r" (increment), "+m" (*ptr) @@ -108,18 +116,20 @@ extern inline int32_t android_atomic_add(int32_t increment, return increment; } -extern inline int32_t android_atomic_inc(volatile int32_t *addr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_inc(volatile int32_t *addr) { return android_atomic_add(1, addr); } -extern inline int32_t android_atomic_dec(volatile int32_t *addr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_dec(volatile int32_t *addr) { return android_atomic_add(-1, addr); } -extern inline int32_t android_atomic_and(int32_t value, - volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_and(int32_t value, volatile int32_t *ptr) { int32_t prev, status; do { @@ -129,7 +139,8 @@ extern inline int32_t android_atomic_and(int32_t value, return prev; } -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) +extern ANDROID_ATOMIC_INLINE int32_t +android_atomic_or(int32_t value, volatile int32_t *ptr) { int32_t prev, status; do { diff --git a/include/cutils/fs.h b/include/cutils/fs.h new file mode 100644 index 0000000..fd5296b --- /dev/null +++ b/include/cutils/fs.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 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. + */ + +#ifndef __CUTILS_FS_H +#define __CUTILS_FS_H + +#include <sys/types.h> + +/* + * TEMP_FAILURE_RETRY is defined by some, but not all, versions of + * <unistd.h>. (Alas, it is not as standard as we'd hoped!) So, if it's + * not already defined, then define it here. + */ +#ifndef TEMP_FAILURE_RETRY +/* Used to retry syscalls that can return EINTR. */ +#define TEMP_FAILURE_RETRY(exp) ({ \ + typeof (exp) _rc; \ + do { \ + _rc = (exp); \ + } while (_rc == -1 && errno == EINTR); \ + _rc; }) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Ensure that directory exists with given mode and owners. + */ +extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); + +/* + * Read single plaintext integer from given file, correctly handling files + * partially written with fs_write_atomic_int(). + */ +extern int fs_read_atomic_int(const char* path, int* value); + +/* + * Write single plaintext integer to given file, creating backup while + * in progress. + */ +extern int fs_write_atomic_int(const char* path, int value); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_FS_H */ diff --git a/include/cutils/log.h b/include/cutils/log.h index 878952e..8b045c7 100644 --- a/include/cutils/log.h +++ b/include/cutils/log.h @@ -279,7 +279,88 @@ extern "C" { : (void)0 ) #endif - +// --------------------------------------------------------------------- + +/* + * Simplified macro to send a verbose radio log message using the current LOG_TAG. + */ +#ifndef RLOGV +#if LOG_NDEBUG +#define RLOGV(...) ((void)0) +#else +#define RLOGV(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) +#endif +#endif + +#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) + +#ifndef RLOGV_IF +#if LOG_NDEBUG +#define RLOGV_IF(cond, ...) ((void)0) +#else +#define RLOGV_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif +#endif + +/* + * Simplified macro to send a debug radio log message using the current LOG_TAG. + */ +#ifndef RLOGD +#define RLOGD(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGD_IF +#define RLOGD_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an info radio log message using the current LOG_TAG. + */ +#ifndef RLOGI +#define RLOGI(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGI_IF +#define RLOGI_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send a warning radio log message using the current LOG_TAG. + */ +#ifndef RLOGW +#define RLOGW(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGW_IF +#define RLOGW_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an error radio log message using the current LOG_TAG. + */ +#ifndef RLOGE +#define RLOGE(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef RLOGE_IF +#define RLOGE_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + // --------------------------------------------------------------------- diff --git a/include/cutils/multiuser.h b/include/cutils/multiuser.h new file mode 100644 index 0000000..635ddb1 --- /dev/null +++ b/include/cutils/multiuser.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 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. + */ + +#ifndef __CUTILS_MULTIUSER_H +#define __CUTILS_MULTIUSER_H + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// NOTE: keep in sync with android.os.UserId + +#define MULTIUSER_APP_PER_USER_RANGE 100000 + +typedef uid_t userid_t; +typedef uid_t appid_t; + +extern userid_t multiuser_get_user_id(uid_t uid); +extern appid_t multiuser_get_app_id(uid_t uid); +extern uid_t multiuser_get_uid(userid_t userId, appid_t appId); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_MULTIUSER_H */ diff --git a/include/cutils/tztime.h b/include/cutils/tztime.h index 36ac25d..dbdbd60 100644 --- a/include/cutils/tztime.h +++ b/include/cutils/tztime.h @@ -17,45 +17,8 @@ #ifndef _CUTILS_TZTIME_H #define _CUTILS_TZTIME_H -#include <time.h> - -#ifdef __cplusplus -extern "C" { -#endif - -time_t mktime_tz(struct tm * const tmp, char const * tz); -void localtime_tz(const time_t * const timep, struct tm * tmp, const char* tz); - -#ifdef HAVE_ANDROID_OS - -/* the following is defined in the Bionic C library on Android, but the - * declarations are only available through a platform-private header - */ +// TODO: fix both callers to just include <bionic_time.h> themselves. #include <bionic_time.h> -#else /* !HAVE_ANDROID_OS */ - -struct strftime_locale { - const char *mon[12]; /* short names */ - const char *month[12]; /* long names */ - const char *standalone_month[12]; /* long standalone names */ - const char *wday[7]; /* short names */ - const char *weekday[7]; /* long names */ - const char *X_fmt; - const char *x_fmt; - const char *c_fmt; - const char *am; - const char *pm; - const char *date_fmt; -}; - -size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale *locale); - -#endif /* !HAVE_ANDROID_OS */ - -#ifdef __cplusplus -} -#endif - #endif /* __CUTILS_TZTIME_H */ diff --git a/include/ion/ion.h b/include/ion/ion.h index cafead5..018c0a1 100644 --- a/include/ion/ion.h +++ b/include/ion/ion.h @@ -27,8 +27,11 @@ __BEGIN_DECLS int ion_open(); int ion_close(int fd); -int ion_alloc(int fd, size_t len, size_t align, unsigned int flags, - struct ion_handle **handle); +int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, + unsigned int flags, struct ion_handle **handle); +int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, + unsigned int flags, int *handle_fd); +int ion_sync_fd(int fd, int handle_fd); int ion_free(int fd, struct ion_handle *handle); int ion_map(int fd, struct ion_handle *handle, size_t length, int prot, int flags, off_t offset, unsigned char **ptr, int *map_fd); diff --git a/include/mincrypt/rsa.h b/include/mincrypt/rsa.h index 7d7d571..d7429fc 100644 --- a/include/mincrypt/rsa.h +++ b/include/mincrypt/rsa.h @@ -13,14 +13,14 @@ ** be used to endorse or promote products derived from this software ** without specific prior written permission. ** -** THIS SOFTWARE IS PROVIDED BY Google Inc. ``AS IS'' AND ANY EXPRESS OR +** THIS SOFTWARE IS PROVIDED BY Google Inc. ``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 +** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO ** EVENT SHALL Google Inc. 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 +** 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. */ @@ -42,6 +42,7 @@ typedef struct RSAPublicKey { uint32_t n0inv; /* -1 / n[0] mod 2^32 */ uint32_t n[RSANUMWORDS]; /* modulus as little endian array */ uint32_t rr[RSANUMWORDS]; /* R^2 as little endian array */ + int exponent; /* 3 or 65537 */ } RSAPublicKey; int RSA_verify(const RSAPublicKey *key, diff --git a/include/netutils/ifc.h b/include/netutils/ifc.h index 67a4a45..1f5421d 100644 --- a/include/netutils/ifc.h +++ b/include/netutils/ifc.h @@ -34,6 +34,9 @@ extern int ifc_down(const char *name); extern int ifc_enable(const char *ifname); extern int ifc_disable(const char *ifname); +#define RESET_IPV4_ADDRESSES 0x01 +#define RESET_IPV6_ADDRESSES 0x02 +#define RESET_ALL_ADDRESSES (RESET_IPV4_ADDRESSES | RESET_IPV6_ADDRESSES) extern int ifc_reset_connections(const char *ifname, const int reset_mask); extern int ifc_get_addr(const char *name, in_addr_t *addr); @@ -66,6 +69,8 @@ extern int ifc_configure(const char *ifname, in_addr_t address, uint32_t prefixLength, in_addr_t gateway, in_addr_t dns1, in_addr_t dns2); +extern in_addr_t prefixLengthToIpv4Netmask(int prefix_length); + __END_DECLS #endif /* _NETUTILS_IFC_H_ */ diff --git a/include/private/android_filesystem_capability.h b/include/private/android_filesystem_capability.h new file mode 100644 index 0000000..0505cda --- /dev/null +++ b/include/private/android_filesystem_capability.h @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2013 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. + */ + +/* + * Taken from linux/capability.h, with minor modifications + */ + +#ifndef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_FILESYSTEM_CAPABILITY_H +#define _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_FILESYSTEM_CAPABILITY_H + +#include <stdint.h> + +#define __user +#define __u32 uint32_t +#define __le32 uint32_t + +#define _LINUX_CAPABILITY_VERSION_1 0x19980330 +#define _LINUX_CAPABILITY_U32S_1 1 +#define _LINUX_CAPABILITY_VERSION_2 0x20071026 +#define _LINUX_CAPABILITY_U32S_2 2 +#define _LINUX_CAPABILITY_VERSION_3 0x20080522 +#define _LINUX_CAPABILITY_U32S_3 2 + +typedef struct __user_cap_header_struct { + __u32 version; + int pid; +} __user *cap_user_header_t; + +typedef struct __user_cap_data_struct { + __u32 effective; + __u32 permitted; + __u32 inheritable; +} __user *cap_user_data_t; + +#define VFS_CAP_REVISION_MASK 0xFF000000 +#define VFS_CAP_REVISION_SHIFT 24 +#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK +#define VFS_CAP_FLAGS_EFFECTIVE 0x000001 +#define VFS_CAP_REVISION_1 0x01000000 +#define VFS_CAP_U32_1 1 +#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1)) +#define VFS_CAP_REVISION_2 0x02000000 +#define VFS_CAP_U32_2 2 +#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2)) +#define XATTR_CAPS_SZ XATTR_CAPS_SZ_2 +#define VFS_CAP_U32 VFS_CAP_U32_2 +#define VFS_CAP_REVISION VFS_CAP_REVISION_2 + +struct vfs_cap_data { + __le32 magic_etc; + struct { + __le32 permitted; + __le32 inheritable; + } data[VFS_CAP_U32]; +}; + +#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1 +#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1 +#define CAP_CHOWN 0 +#define CAP_DAC_OVERRIDE 1 +#define CAP_DAC_READ_SEARCH 2 +#define CAP_FOWNER 3 +#define CAP_FSETID 4 +#define CAP_KILL 5 +#define CAP_SETGID 6 +#define CAP_SETUID 7 +#define CAP_SETPCAP 8 +#define CAP_LINUX_IMMUTABLE 9 +#define CAP_NET_BIND_SERVICE 10 +#define CAP_NET_BROADCAST 11 +#define CAP_NET_ADMIN 12 +#define CAP_NET_RAW 13 +#define CAP_IPC_LOCK 14 +#define CAP_IPC_OWNER 15 +#define CAP_SYS_MODULE 16 +#define CAP_SYS_RAWIO 17 +#define CAP_SYS_CHROOT 18 +#define CAP_SYS_PTRACE 19 +#define CAP_SYS_PACCT 20 +#define CAP_SYS_ADMIN 21 +#define CAP_SYS_BOOT 22 +#define CAP_SYS_NICE 23 +#define CAP_SYS_RESOURCE 24 +#define CAP_SYS_TIME 25 +#define CAP_SYS_TTY_CONFIG 26 +#define CAP_MKNOD 27 +#define CAP_LEASE 28 +#define CAP_AUDIT_WRITE 29 +#define CAP_AUDIT_CONTROL 30 +#define CAP_SETFCAP 31 +#define CAP_MAC_OVERRIDE 32 +#define CAP_MAC_ADMIN 33 +#define CAP_SYSLOG 34 +#define CAP_WAKE_ALARM 35 +#define CAP_LAST_CAP CAP_WAKE_ALARM +#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) +#define CAP_TO_INDEX(x) ((x) >> 5) +#define CAP_TO_MASK(x) (1 << ((x) & 31)) + +#undef __user +#undef __u32 +#undef __le32 + +#endif diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index 6521cbe..53bd166 100644 --- a/include/private/android_filesystem_config.h +++ b/include/private/android_filesystem_config.h @@ -25,6 +25,13 @@ #include <string.h> #include <sys/stat.h> #include <sys/types.h> +#include <stdint.h> + +#ifdef HAVE_ANDROID_OS +#include <linux/capability.h> +#else +#include "android_filesystem_capability.h" +#endif /* This is the master Users and Groups config for the platform. ** DO NOT EVER RENUMBER. @@ -62,6 +69,8 @@ #define AID_DRMRPC 1026 /* group for drm rpc */ #define AID_NFC 1027 /* nfc subsystem */ #define AID_SDCARD_R 1028 /* external storage read access */ +#define AID_CLAT 1029 /* clat part of nat464 */ +#define AID_LOOP_RADIO 1030 /* loop radio devices */ #define AID_SHELL 2000 /* adb and debug shell user */ #define AID_CACHE 2001 /* cache access */ @@ -76,6 +85,7 @@ #define AID_NET_ADMIN 3005 /* can configure interfaces and routing tables. */ #define AID_NET_BW_STATS 3006 /* read bandwidth statistics */ #define AID_NET_BW_ACCT 3007 /* change bandwidth statistics accounting */ +#define AID_NET_BT_STACK 3008 /* bluetooth: access config files */ #define AID_MISC 9998 /* access to misc storage */ #define AID_NOBODY 9999 @@ -87,6 +97,9 @@ #define AID_USER 100000 /* offset for uid ranges for each user */ +#define AID_SHARED_GID_START 50000 /* start of gids for apps in each user to share */ +#define AID_SHARED_GID_END 59999 /* start of gids for apps in each user to share */ + #if !defined(EXCLUDE_FS_CONFIG_STRUCTURES) struct android_id_info { const char *name; @@ -119,6 +132,7 @@ static const struct android_id_info android_ids[] = { { "diag", AID_DIAG, }, { "net_bt_admin", AID_NET_BT_ADMIN, }, { "net_bt", AID_NET_BT, }, + { "net_bt_stack", AID_NET_BT_STACK, }, { "sdcard_r", AID_SDCARD_R, }, { "sdcard_rw", AID_SDCARD_RW, }, { "media_rw", AID_MEDIA_RW, }, @@ -132,8 +146,10 @@ static const struct android_id_info android_ids[] = { { "net_admin", AID_NET_ADMIN, }, { "net_bw_stats", AID_NET_BW_STATS, }, { "net_bw_acct", AID_NET_BW_ACCT, }, + { "loop_radio", AID_LOOP_RADIO, }, { "misc", AID_MISC, }, { "nobody", AID_NOBODY, }, + { "clat", AID_CLAT, }, }; #define android_id_count \ @@ -143,6 +159,7 @@ struct fs_path_config { unsigned mode; unsigned uid; unsigned gid; + uint64_t capabilities; const char *prefix; }; @@ -152,26 +169,26 @@ struct fs_path_config { ** way up to the root. */ -static struct fs_path_config android_dirs[] = { - { 00770, AID_SYSTEM, AID_CACHE, "cache" }, - { 00771, AID_SYSTEM, AID_SYSTEM, "data/app" }, - { 00771, AID_SYSTEM, AID_SYSTEM, "data/app-private" }, - { 00771, AID_SYSTEM, AID_SYSTEM, "data/dalvik-cache" }, - { 00771, AID_SYSTEM, AID_SYSTEM, "data/data" }, - { 00771, AID_SHELL, AID_SHELL, "data/local/tmp" }, - { 00771, AID_SHELL, AID_SHELL, "data/local" }, - { 01771, AID_SYSTEM, AID_MISC, "data/misc" }, - { 00770, AID_DHCP, AID_DHCP, "data/misc/dhcp" }, - { 00775, AID_MEDIA_RW, AID_MEDIA_RW, "data/media" }, - { 00775, AID_MEDIA_RW, AID_MEDIA_RW, "data/media/Music" }, - { 00771, AID_SYSTEM, AID_SYSTEM, "data" }, - { 00750, AID_ROOT, AID_SHELL, "sbin" }, - { 00755, AID_ROOT, AID_SHELL, "system/bin" }, - { 00755, AID_ROOT, AID_SHELL, "system/vendor" }, - { 00755, AID_ROOT, AID_SHELL, "system/xbin" }, - { 00755, AID_ROOT, AID_ROOT, "system/etc/ppp" }, - { 00777, AID_ROOT, AID_ROOT, "sdcard" }, - { 00755, AID_ROOT, AID_ROOT, 0 }, +static const struct fs_path_config android_dirs[] = { + { 00770, AID_SYSTEM, AID_CACHE, 0, "cache" }, + { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data/app" }, + { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data/app-private" }, + { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data/dalvik-cache" }, + { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data/data" }, + { 00771, AID_SHELL, AID_SHELL, 0, "data/local/tmp" }, + { 00771, AID_SHELL, AID_SHELL, 0, "data/local" }, + { 01771, AID_SYSTEM, AID_MISC, 0, "data/misc" }, + { 00770, AID_DHCP, AID_DHCP, 0, "data/misc/dhcp" }, + { 00775, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media" }, + { 00775, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media/Music" }, + { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data" }, + { 00750, AID_ROOT, AID_SHELL, 0, "sbin" }, + { 00755, AID_ROOT, AID_SHELL, 0, "system/bin" }, + { 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" }, + { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin" }, + { 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" }, + { 00777, AID_ROOT, AID_ROOT, 0, "sdcard" }, + { 00755, AID_ROOT, AID_ROOT, 0, 0 }, }; /* Rules for files. @@ -180,61 +197,62 @@ static struct fs_path_config android_dirs[] = { ** way up to the root. Prefixes ending in * denotes wildcard ** and will allow partial matches. */ -static struct fs_path_config android_files[] = { - { 00440, AID_ROOT, AID_SHELL, "system/etc/init.goldfish.rc" }, - { 00550, AID_ROOT, AID_SHELL, "system/etc/init.goldfish.sh" }, - { 00440, AID_ROOT, AID_SHELL, "system/etc/init.trout.rc" }, - { 00550, AID_ROOT, AID_SHELL, "system/etc/init.ril" }, - { 00550, AID_ROOT, AID_SHELL, "system/etc/init.testmenu" }, - { 00550, AID_DHCP, AID_SHELL, "system/etc/dhcpcd/dhcpcd-run-hooks" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/dbus.conf" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluetooth/main.conf" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluetooth/input.conf" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluetooth/audio.conf" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluetooth/network.conf" }, - { 00444, AID_NET_BT, AID_NET_BT, "system/etc/bluetooth/blacklist.conf" }, - { 00640, AID_SYSTEM, AID_SYSTEM, "system/etc/bluetooth/auto_pairing.conf" }, - { 00444, AID_RADIO, AID_AUDIO, "system/etc/AudioPara4.csv" }, - { 00555, AID_ROOT, AID_ROOT, "system/etc/ppp/*" }, - { 00555, AID_ROOT, AID_ROOT, "system/etc/rc.*" }, - { 00644, AID_SYSTEM, AID_SYSTEM, "data/app/*" }, - { 00644, AID_MEDIA_RW, AID_MEDIA_RW, "data/media/*" }, - { 00644, AID_SYSTEM, AID_SYSTEM, "data/app-private/*" }, - { 00644, AID_APP, AID_APP, "data/data/*" }, - /* the following two files are INTENTIONALLY set-gid and not set-uid. - * Do not change. */ - { 02755, AID_ROOT, AID_NET_RAW, "system/bin/ping" }, - { 02750, AID_ROOT, AID_INET, "system/bin/netcfg" }, - /* the following five files are INTENTIONALLY set-uid, but they - * are NOT included on user builds. */ - { 06755, AID_ROOT, AID_ROOT, "system/xbin/su" }, - { 06755, AID_ROOT, AID_ROOT, "system/xbin/librank" }, - { 06755, AID_ROOT, AID_ROOT, "system/xbin/procrank" }, - { 06755, AID_ROOT, AID_ROOT, "system/xbin/procmem" }, - { 06755, AID_ROOT, AID_ROOT, "system/xbin/tcpdump" }, - { 04770, AID_ROOT, AID_RADIO, "system/bin/pppd-ril" }, - /* the following file is INTENTIONALLY set-uid, and IS included - * in user builds. */ - { 06750, AID_ROOT, AID_SHELL, "system/bin/run-as" }, - { 00755, AID_ROOT, AID_SHELL, "system/bin/*" }, - { 00755, AID_ROOT, AID_ROOT, "system/lib/valgrind/*" }, - { 00755, AID_ROOT, AID_SHELL, "system/xbin/*" }, - { 00755, AID_ROOT, AID_SHELL, "system/vendor/bin/*" }, - { 00750, AID_ROOT, AID_SHELL, "sbin/*" }, - { 00755, AID_ROOT, AID_ROOT, "bin/*" }, - { 00750, AID_ROOT, AID_SHELL, "init*" }, - { 00750, AID_ROOT, AID_SHELL, "charger*" }, - { 00750, AID_ROOT, AID_SHELL, "sbin/fs_mgr" }, - { 00640, AID_ROOT, AID_SHELL, "fstab.*" }, - { 00644, AID_ROOT, AID_ROOT, 0 }, +static const struct fs_path_config android_files[] = { + { 00440, AID_ROOT, AID_SHELL, 0, "system/etc/init.goldfish.rc" }, + { 00550, AID_ROOT, AID_SHELL, 0, "system/etc/init.goldfish.sh" }, + { 00440, AID_ROOT, AID_SHELL, 0, "system/etc/init.trout.rc" }, + { 00550, AID_ROOT, AID_SHELL, 0, "system/etc/init.ril" }, + { 00550, AID_ROOT, AID_SHELL, 0, "system/etc/init.testmenu" }, + { 00550, AID_DHCP, AID_SHELL, 0, "system/etc/dhcpcd/dhcpcd-run-hooks" }, + { 00440, AID_BLUETOOTH, AID_BLUETOOTH, 0, "system/etc/dbus.conf" }, + { 00444, AID_RADIO, AID_AUDIO, 0, "system/etc/AudioPara4.csv" }, + { 00555, AID_ROOT, AID_ROOT, 0, "system/etc/ppp/*" }, + { 00555, AID_ROOT, AID_ROOT, 0, "system/etc/rc.*" }, + { 00644, AID_SYSTEM, AID_SYSTEM, 0, "data/app/*" }, + { 00644, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media/*" }, + { 00644, AID_SYSTEM, AID_SYSTEM, 0, "data/app-private/*" }, + { 00644, AID_APP, AID_APP, 0, "data/data/*" }, + { 00755, AID_ROOT, AID_ROOT, 0, "system/bin/ping" }, + + /* the following file is INTENTIONALLY set-gid and not set-uid. + * Do not change. */ + { 02750, AID_ROOT, AID_INET, 0, "system/bin/netcfg" }, + + /* the following five files are INTENTIONALLY set-uid, but they + * are NOT included on user builds. */ + { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/su" }, + { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/librank" }, + { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procrank" }, + { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" }, + { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/tcpdump" }, + { 04770, AID_ROOT, AID_RADIO, 0, "system/bin/pppd-ril" }, + + /* the following file has enhanced capabilities and IS included in user builds. */ + { 00750, AID_ROOT, AID_SHELL, (1 << CAP_SETUID) | (1 << CAP_SETGID), "system/bin/run-as" }, + + { 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" }, + { 00755, AID_ROOT, AID_ROOT, 0, "system/lib/valgrind/*" }, + { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" }, + { 00755, AID_ROOT, AID_SHELL, 0, "system/vendor/bin/*" }, + { 00750, AID_ROOT, AID_SHELL, 0, "sbin/*" }, + { 00755, AID_ROOT, AID_ROOT, 0, "bin/*" }, + { 00750, AID_ROOT, AID_SHELL, 0, "init*" }, + { 00750, AID_ROOT, AID_SHELL, 0, "charger*" }, + { 00750, AID_ROOT, AID_SHELL, 0, "sbin/fs_mgr" }, + { 00640, AID_ROOT, AID_SHELL, 0, "fstab.*" }, + { 00644, AID_ROOT, AID_ROOT, 0, 0 }, }; static inline void fs_config(const char *path, int dir, - unsigned *uid, unsigned *gid, unsigned *mode) + unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities) { - struct fs_path_config *pc; + const struct fs_path_config *pc; int plen; + if (path[0] == '/') { + path++; + } + pc = dir ? android_dirs : android_files; plen = strlen(path); for(; pc->prefix; pc++){ @@ -254,6 +272,7 @@ static inline void fs_config(const char *path, int dir, *uid = pc->uid; *gid = pc->gid; *mode = (*mode & (~07777)) | pc->mode; + *capabilities = pc->capabilities; #if 0 fprintf(stderr,"< '%s' '%s' %d %d %o >\n", diff --git a/include/sync/sync.h b/include/sync/sync.h index 6aa5f2d..918acf6 100644 --- a/include/sync/sync.h +++ b/include/sync/sync.h @@ -19,13 +19,30 @@ #ifndef __SYS_CORE_SYNC_H #define __SYS_CORE_SYNC_H -#include <linux/sync.h> -#include <linux/sw_sync.h> +#include <sys/cdefs.h> +#include <stdint.h> __BEGIN_DECLS +// XXX: These structs are copied from the header "linux/sync.h". +struct sync_fence_info_data { + uint32_t len; + char name[32]; + int32_t status; + uint8_t pt_info[0]; +}; + +struct sync_pt_info { + uint32_t len; + char obj_name[32]; + char driver_name[32]; + int32_t status; + uint64_t timestamp_ns; + uint8_t driver_data[0]; +}; + /* timeout in msecs */ -int sync_wait(int fd, unsigned int timeout); +int sync_wait(int fd, int timeout); int sync_merge(const char *name, int fd1, int fd2); struct sync_fence_info_data *sync_fence_info(int fd); struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info, diff --git a/include/system/audio.h b/include/system/audio.h index 3807317..d246070 100644 --- a/include/system/audio.h +++ b/include/system/audio.h @@ -63,7 +63,10 @@ typedef enum { AUDIO_SOURCE_CAMCORDER = 5, AUDIO_SOURCE_VOICE_RECOGNITION = 6, AUDIO_SOURCE_VOICE_COMMUNICATION = 7, - + AUDIO_SOURCE_REMOTE_SUBMIX = 8, /* Source for the mix to be presented remotely. */ + /* An example of remote presentation is Wifi Display */ + /* where a dongle attached to a TV can be used to */ + /* play the mix captured by this audio source. */ AUDIO_SOURCE_CNT, AUDIO_SOURCE_MAX = AUDIO_SOURCE_CNT - 1, } audio_source_t; @@ -152,7 +155,7 @@ typedef enum { AUDIO_FORMAT_PCM_SUB_8_24_BIT), } audio_format_t; -typedef enum { +enum { /* output channels */ AUDIO_CHANNEL_OUT_FRONT_LEFT = 0x1, AUDIO_CHANNEL_OUT_FRONT_RIGHT = 0x2, @@ -275,7 +278,11 @@ typedef enum { AUDIO_IN_ACOUSTICS_TX_DISABLE = 0, } audio_in_acoustics_t; -typedef enum { +enum { + AUDIO_DEVICE_NONE = 0x0, + /* reserved bits */ + AUDIO_DEVICE_BIT_IN = 0x80000000, + AUDIO_DEVICE_BIT_DEFAULT = 0x40000000, /* output devices */ AUDIO_DEVICE_OUT_EARPIECE = 0x1, AUDIO_DEVICE_OUT_SPEAKER = 0x2, @@ -292,7 +299,8 @@ typedef enum { AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET = 0x1000, AUDIO_DEVICE_OUT_USB_ACCESSORY = 0x2000, AUDIO_DEVICE_OUT_USB_DEVICE = 0x4000, - AUDIO_DEVICE_OUT_DEFAULT = 0x8000, + AUDIO_DEVICE_OUT_REMOTE_SUBMIX = 0x8000, + AUDIO_DEVICE_OUT_DEFAULT = AUDIO_DEVICE_BIT_DEFAULT, AUDIO_DEVICE_OUT_ALL = (AUDIO_DEVICE_OUT_EARPIECE | AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_WIRED_HEADSET | @@ -308,6 +316,7 @@ typedef enum { AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | AUDIO_DEVICE_OUT_USB_ACCESSORY | AUDIO_DEVICE_OUT_USB_DEVICE | + AUDIO_DEVICE_OUT_REMOTE_SUBMIX | AUDIO_DEVICE_OUT_DEFAULT), AUDIO_DEVICE_OUT_ALL_A2DP = (AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | @@ -319,15 +328,20 @@ typedef enum { AUDIO_DEVICE_OUT_USB_DEVICE), /* input devices */ - AUDIO_DEVICE_IN_COMMUNICATION = 0x10000, - AUDIO_DEVICE_IN_AMBIENT = 0x20000, - AUDIO_DEVICE_IN_BUILTIN_MIC = 0x40000, - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET = 0x80000, - AUDIO_DEVICE_IN_WIRED_HEADSET = 0x100000, - AUDIO_DEVICE_IN_AUX_DIGITAL = 0x200000, - AUDIO_DEVICE_IN_VOICE_CALL = 0x400000, - AUDIO_DEVICE_IN_BACK_MIC = 0x800000, - AUDIO_DEVICE_IN_DEFAULT = 0x80000000, + AUDIO_DEVICE_IN_COMMUNICATION = AUDIO_DEVICE_BIT_IN | 0x1, + AUDIO_DEVICE_IN_AMBIENT = AUDIO_DEVICE_BIT_IN | 0x2, + AUDIO_DEVICE_IN_BUILTIN_MIC = AUDIO_DEVICE_BIT_IN | 0x4, + AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET = AUDIO_DEVICE_BIT_IN | 0x8, + AUDIO_DEVICE_IN_WIRED_HEADSET = AUDIO_DEVICE_BIT_IN | 0x10, + AUDIO_DEVICE_IN_AUX_DIGITAL = AUDIO_DEVICE_BIT_IN | 0x20, + AUDIO_DEVICE_IN_VOICE_CALL = AUDIO_DEVICE_BIT_IN | 0x40, + AUDIO_DEVICE_IN_BACK_MIC = AUDIO_DEVICE_BIT_IN | 0x80, + AUDIO_DEVICE_IN_REMOTE_SUBMIX = AUDIO_DEVICE_BIT_IN | 0x100, + AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET = AUDIO_DEVICE_BIT_IN | 0x200, + AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET = AUDIO_DEVICE_BIT_IN | 0x400, + AUDIO_DEVICE_IN_USB_ACCESSORY = AUDIO_DEVICE_BIT_IN | 0x800, + AUDIO_DEVICE_IN_USB_DEVICE = AUDIO_DEVICE_BIT_IN | 0x1000, + AUDIO_DEVICE_IN_DEFAULT = AUDIO_DEVICE_BIT_IN | AUDIO_DEVICE_BIT_DEFAULT, AUDIO_DEVICE_IN_ALL = (AUDIO_DEVICE_IN_COMMUNICATION | AUDIO_DEVICE_IN_AMBIENT | @@ -337,9 +351,16 @@ typedef enum { AUDIO_DEVICE_IN_AUX_DIGITAL | AUDIO_DEVICE_IN_VOICE_CALL | AUDIO_DEVICE_IN_BACK_MIC | + AUDIO_DEVICE_IN_REMOTE_SUBMIX | + AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET | + AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET | + AUDIO_DEVICE_IN_USB_ACCESSORY | + AUDIO_DEVICE_IN_USB_DEVICE | AUDIO_DEVICE_IN_DEFAULT), AUDIO_DEVICE_IN_ALL_SCO = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET, -} audio_devices_t; +}; + +typedef uint32_t audio_devices_t; /* the audio output flags serve two purposes: * - when an AudioTrack is created they indicate a "wish" to be connected to an @@ -366,7 +387,8 @@ typedef enum { static inline bool audio_is_output_device(audio_devices_t device) { - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0)) + if (((device & AUDIO_DEVICE_BIT_IN) == 0) && + (popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0)) return true; else return false; @@ -374,12 +396,20 @@ static inline bool audio_is_output_device(audio_devices_t device) static inline bool audio_is_input_device(audio_devices_t device) { - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0)) - return true; - else - return false; + if ((device & AUDIO_DEVICE_BIT_IN) != 0) { + device &= ~AUDIO_DEVICE_BIT_IN; + if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0)) + return true; + } + return false; } +static inline bool audio_is_output_devices(audio_devices_t device) +{ + return (device & AUDIO_DEVICE_BIT_IN) == 0; +} + + static inline bool audio_is_a2dp_device(audio_devices_t device) { if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_A2DP)) @@ -390,6 +420,7 @@ static inline bool audio_is_a2dp_device(audio_devices_t device) static inline bool audio_is_bluetooth_sco_device(audio_devices_t device) { + device &= ~AUDIO_DEVICE_BIT_IN; if ((popcount(device) == 1) && (device & (AUDIO_DEVICE_OUT_ALL_SCO | AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET))) return true; @@ -405,6 +436,14 @@ static inline bool audio_is_usb_device(audio_devices_t device) return false; } +static inline bool audio_is_remote_submix_device(audio_devices_t device) +{ + if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX)) + return true; + else + return false; +} + static inline bool audio_is_input_channel(uint32_t channel) { if ((channel & ~AUDIO_CHANNEL_IN_ALL) == 0) diff --git a/include/system/audio_policy.h b/include/system/audio_policy.h index 91b8e9c..a6554de 100644 --- a/include/system/audio_policy.h +++ b/include/system/audio_policy.h @@ -43,6 +43,7 @@ typedef enum { AUDIO_POLICY_FORCE_ANALOG_DOCK, AUDIO_POLICY_FORCE_DIGITAL_DOCK, AUDIO_POLICY_FORCE_NO_BT_A2DP, /* A2DP sink is not preferred to speaker or wired HS */ + AUDIO_POLICY_FORCE_SYSTEM_ENFORCED, AUDIO_POLICY_FORCE_CFG_CNT, AUDIO_POLICY_FORCE_CFG_MAX = AUDIO_POLICY_FORCE_CFG_CNT - 1, @@ -56,6 +57,7 @@ typedef enum { AUDIO_POLICY_FORCE_FOR_MEDIA, AUDIO_POLICY_FORCE_FOR_RECORD, AUDIO_POLICY_FORCE_FOR_DOCK, + AUDIO_POLICY_FORCE_FOR_SYSTEM, AUDIO_POLICY_FORCE_USE_CNT, AUDIO_POLICY_FORCE_USE_MAX = AUDIO_POLICY_FORCE_USE_CNT - 1, diff --git a/include/system/camera.h b/include/system/camera.h index e4cacc5..7a4dd53 100644 --- a/include/system/camera.h +++ b/include/system/camera.h @@ -163,6 +163,17 @@ enum { * can silently finish itself or show a dialog. */ CAMERA_CMD_PING = 9, + + /** + * Configure the number of video buffers used for recording. The intended + * video buffer count for recording is passed as arg1, which must be + * greater than 0. This command must be sent before recording is started. + * This command returns INVALID_OPERATION error if it is sent after video + * recording is started, or the command is not supported at all. This + * command also returns a BAD_VALUE error if the intended video buffer + * count is non-positive or too big to be realized. + */ + CAMERA_CMD_SET_VIDEO_BUFFER_COUNT = 10, }; /** camera fatal errors */ diff --git a/include/system/graphics.h b/include/system/graphics.h index 24e2bfb..82b5fcc 100644 --- a/include/system/graphics.h +++ b/include/system/graphics.h @@ -109,6 +109,37 @@ enum { */ HAL_PIXEL_FORMAT_RAW_SENSOR = 0x20, + /* + * Android binary blob graphics buffer format: + * + * This format is used to carry task-specific data which does not have a + * standard image structure. The details of the format are left to the two + * endpoints. + * + * A typical use case is for transporting JPEG-compressed images from the + * Camera HAL to the framework or to applications. + * + * Buffers of this format must have a height of 1, and width equal to their + * size in bytes. + */ + HAL_PIXEL_FORMAT_BLOB = 0x21, + + /* + * Android format indicating that the choice of format is entirely up to the + * device-specific Gralloc implementation. + * + * The Gralloc implementation should examine the usage bits passed in when + * allocating a buffer with this format, and it should derive the pixel + * format from those usage flags. This format will never be used with any + * of the GRALLOC_USAGE_SW_* usage flags. + * + * If a buffer of this format is to be used as an OpenGL ES texture, the + * framework will assume that sampling the texture will always return an + * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values). + * + */ + HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 0x22, + /* Legacy formats (deprecated), used by ImageFormat.java */ HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16 HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21 diff --git a/include/system/window.h b/include/system/window.h index 8e00bcd..4698fb3 100644 --- a/include/system/window.h +++ b/include/system/window.h @@ -17,11 +17,15 @@ #ifndef SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H #define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H +#include <cutils/native_handle.h> +#include <errno.h> +#include <limits.h> #include <stdint.h> #include <string.h> +#include <sync/sync.h> #include <sys/cdefs.h> #include <system/graphics.h> -#include <cutils/native_handle.h> +#include <unistd.h> __BEGIN_DECLS @@ -38,6 +42,14 @@ __BEGIN_DECLS // --------------------------------------------------------------------------- +// This #define may be used to conditionally compile device-specific code to +// support either the prior ANativeWindow interface, which did not pass libsync +// fences around, or the new interface that does. This #define is only present +// when the ANativeWindow interface does include libsync support. +#define ANDROID_NATIVE_WINDOW_HAS_SYNC 1 + +// --------------------------------------------------------------------------- + typedef const native_handle_t* buffer_handle_t; // --------------------------------------------------------------------------- @@ -379,8 +391,12 @@ struct ANativeWindow * allowed if a specific buffer count has been set. * * Returns 0 on success or -errno on error. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but the new dequeueBuffer function that + * outputs a fence file descriptor should be used in its place. */ - int (*dequeueBuffer)(struct ANativeWindow* window, + int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window, struct ANativeWindowBuffer** buffer); /* @@ -389,9 +405,14 @@ struct ANativeWindow * dequeueBuffer first. * * Returns 0 on success or -errno on error. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but it is essentially a no-op, and calls + * to it should be removed. */ - int (*lockBuffer)(struct ANativeWindow* window, + int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window, struct ANativeWindowBuffer* buffer); + /* * Hook called by EGL when modifications to the render buffer are done. * This unlocks and post the buffer. @@ -405,8 +426,13 @@ struct ANativeWindow * Buffers MUST be queued in the same order than they were dequeued. * * Returns 0 on success or -errno on error. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but the new queueBuffer function that + * takes a fence file descriptor should be used in its place (pass a value + * of -1 for the fence file descriptor if there is no valid one to pass). */ - int (*queueBuffer)(struct ANativeWindow* window, + int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window, struct ANativeWindowBuffer* buffer); /* @@ -463,12 +489,86 @@ struct ANativeWindow * reference if they might use the buffer after queueing or canceling it. * Holding a reference to a buffer after queueing or canceling it is only * allowed if a specific buffer count has been set. + * + * XXX: This function is deprecated. It will continue to work for some + * time for binary compatibility, but the new cancelBuffer function that + * takes a fence file descriptor should be used in its place (pass a value + * of -1 for the fence file descriptor if there is no valid one to pass). */ - int (*cancelBuffer)(struct ANativeWindow* window, + int (*cancelBuffer_DEPRECATED)(struct ANativeWindow* window, struct ANativeWindowBuffer* buffer); + /* + * Hook called by EGL to acquire a buffer. This call may block if no + * buffers are available. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * The libsync fence file descriptor returned in the int pointed to by the + * fenceFd argument will refer to the fence that must signal before the + * dequeued buffer may be written to. A value of -1 indicates that the + * caller may access the buffer immediately without waiting on a fence. If + * a valid file descriptor is returned (i.e. any value except -1) then the + * caller is responsible for closing the file descriptor. + * + * Returns 0 on success or -errno on error. + */ + int (*dequeueBuffer)(struct ANativeWindow* window, + struct ANativeWindowBuffer** buffer, int* fenceFd); - void* reserved_proc[2]; + /* + * Hook called by EGL when modifications to the render buffer are done. + * This unlocks and post the buffer. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * The fenceFd argument specifies a libsync fence file descriptor for a + * fence that must signal before the buffer can be accessed. If the buffer + * can be accessed immediately then a value of -1 should be used. The + * caller must not use the file descriptor after it is passed to + * queueBuffer, and the ANativeWindow implementation is responsible for + * closing it. + * + * Returns 0 on success or -errno on error. + */ + int (*queueBuffer)(struct ANativeWindow* window, + struct ANativeWindowBuffer* buffer, int fenceFd); + + /* + * Hook used to cancel a buffer that has been dequeued. + * No synchronization is performed between dequeue() and cancel(), so + * either external synchronization is needed, or these functions must be + * called from the same thread. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * The fenceFd argument specifies a libsync fence file decsriptor for a + * fence that must signal before the buffer can be accessed. If the buffer + * can be accessed immediately then a value of -1 should be used. + * + * Note that if the client has not waited on the fence that was returned + * from dequeueBuffer, that same fence should be passed to cancelBuffer to + * ensure that future uses of the buffer are preceded by a wait on that + * fence. The caller must not use the file descriptor after it is passed + * to cancelBuffer, and the ANativeWindow implementation is responsible for + * closing it. + * + * Returns 0 on success or -errno on error. + */ + int (*cancelBuffer)(struct ANativeWindow* window, + struct ANativeWindowBuffer* buffer, int fenceFd); }; /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C). @@ -551,7 +651,7 @@ static inline int native_window_set_post_transform_crop( /* * native_window_set_active_rect(..., active_rect) * - * This function is deprectated and will be removed soon. For now it simply + * This function is deprecated and will be removed soon. For now it simply * sets the post-transform crop for compatibility while multi-project commits * get checked. */ @@ -717,6 +817,17 @@ static inline int native_window_api_disconnect( return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api); } +/* + * native_window_dequeue_buffer_and_wait(...) + * Dequeue a buffer and wait on the fence associated with that buffer. The + * buffer may safely be accessed immediately upon this function returning. An + * error is returned if either of the dequeue or the wait operations fail. + */ +static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw, + struct ANativeWindowBuffer** anb) { + return anw->dequeueBuffer_DEPRECATED(anw, anb); +} + __END_DECLS diff --git a/include/sysutils/FrameworkListener.h b/include/sysutils/FrameworkListener.h index 756bacf..f1a4b43 100644 --- a/include/sysutils/FrameworkListener.h +++ b/include/sysutils/FrameworkListener.h @@ -23,10 +23,11 @@ class SocketClient; class FrameworkListener : public SocketListener { public: - static const int CMD_ARGS_MAX = 16; + static const int CMD_ARGS_MAX = 26; /* 1 out of errorRate will be dropped */ int errorRate; + private: int mCommandCount; bool mWithSeq; diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h index 9a6b59c..1d67c12 100644 --- a/include/usbhost/usbhost.h +++ b/include/usbhost/usbhost.h @@ -72,6 +72,19 @@ struct usb_host_context *usb_host_init(void); /* Call this to cleanup the USB host library. */ void usb_host_cleanup(struct usb_host_context *context); +/* Call this to get the inotify file descriptor. */ +int usb_host_get_fd(struct usb_host_context *context); + +/* Call this to initialize the usb host context. */ +int usb_host_load(struct usb_host_context *context, + usb_device_added_cb added_cb, + usb_device_removed_cb removed_cb, + usb_discovery_done_cb discovery_done_cb, + void *client_data); + +/* Call this to read and handle occuring usb event. */ +int usb_host_read_event(struct usb_host_context *context); + /* Call this to monitor the USB bus for new and removed devices. * This is intended to be called from a dedicated thread, * as it will not return until one of the callbacks returns true. |