diff --git a/apps/Development/Android.mk b/apps/Development/Android.mk index 99133e85f..9dd2e1a34 100644 --- a/apps/Development/Android.mk +++ b/apps/Development/Android.mk @@ -1,7 +1,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE_TAGS := eng +LOCAL_MODULE_TAGS := optional LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common org.apache.http.legacy diff --git a/apps/Development/AndroidManifest.xml b/apps/Development/AndroidManifest.xml index 3ac819077..d932174d1 100644 --- a/apps/Development/AndroidManifest.xml +++ b/apps/Development/AndroidManifest.xml @@ -66,6 +66,8 @@ + + @@ -86,8 +88,7 @@ - + diff --git a/build/Android.mk b/build/Android.mk index b6445a0d7..f7dcb55f2 100644 --- a/build/Android.mk +++ b/build/Android.mk @@ -83,6 +83,10 @@ ALL_SDK_FILES += $(android_jar_full_target) # ==================================================== +# The Jack & Jill compiler jars +ALL_SDK_FILES += $(HOST_OUT)/framework/jack.jar +ALL_SDK_FILES += $(HOST_OUT)/framework/jill.jar + # The uiautomator stubs ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_uiautomator_intermediates/javalib.jar @@ -111,13 +115,17 @@ ANDROID_SUPPORT_LIBRARIES := \ android-support-v7-gridlayout \ android-support-v7-mediarouter \ android-support-v7-palette \ + android-support-v7-preference \ android-support-v7-recyclerview \ android-support-v13 \ + android-support-v14-preference \ android-support-v17-leanback \ + android-support-v17-preference-leanback \ android-support-multidex \ android-support-multidex-instrumentation \ android-support-design \ android-support-percent \ + android-support-recommendation \ android-support-customtabs $(foreach lib, $(ANDROID_SUPPORT_LIBRARIES), $(eval $(call _package_sdk_library,$(lib)))) diff --git a/build/build_android_stubs.mk b/build/build_android_stubs.mk index f74d23c0f..211d4a529 100644 --- a/build/build_android_stubs.mk +++ b/build/build_android_stubs.mk @@ -51,5 +51,7 @@ $(full_target): $(stub_timestamp) $(framework_res_package) $(hide) jar -cf $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) . $(hide) jar -u0f $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) resources.arsc -$(jack_lib) : $(full_target) $(JILL_JAR) $(JACK_JAR) - $(transform-jar-to-jack) \ No newline at end of file +$(jack_lib) : $(full_target) $(JILL_JAR) $(JACK) + $(transform-jar-to-jack) + +$(call define-jar-to-toc-rule, $(full_target)) diff --git a/build/sdk-darwin-x86.atree b/build/sdk-darwin-x86.atree index 0ed8e20f1..a8447948d 100644 --- a/build/sdk-darwin-x86.atree +++ b/build/sdk-darwin-x86.atree @@ -28,11 +28,11 @@ lib/libc++.dylib strip platform-tools/lib/l # revision as specified in the source.properties. -lib/libLLVM.dylib strip build-tools/${PLATFORM_NAME}/lib/libLLVM.dylib -lib/libbcc.dylib strip build-tools/${PLATFORM_NAME}/lib/libbcc.dylib -lib/libbcinfo.dylib strip build-tools/${PLATFORM_NAME}/lib/libbcinfo.dylib -lib/libclang.dylib strip build-tools/${PLATFORM_NAME}/lib/libclang.dylib -lib/libc++.dylib strip build-tools/${PLATFORM_NAME}/lib/libc++.dylib +lib64/libLLVM.dylib strip build-tools/${PLATFORM_NAME}/lib64/libLLVM.dylib +lib64/libbcc.dylib strip build-tools/${PLATFORM_NAME}/lib64/libbcc.dylib +lib64/libbcinfo.dylib strip build-tools/${PLATFORM_NAME}/lib64/libbcinfo.dylib +lib64/libclang.dylib strip build-tools/${PLATFORM_NAME}/lib64/libclang.dylib +lib64/libc++.dylib strip build-tools/${PLATFORM_NAME}/lib64/libc++.dylib prebuilts/sdk/tools/darwin/bin/arm-linux-androideabi-ld strip build-tools/${PLATFORM_NAME}/arm-linux-androideabi-ld prebuilts/sdk/tools/darwin/bin/i686-linux-android-ld strip build-tools/${PLATFORM_NAME}/i686-linux-android-ld diff --git a/build/sdk-linux-x86.atree b/build/sdk-linux-x86.atree index 63dcbc35c..f18413d70 100644 --- a/build/sdk-linux-x86.atree +++ b/build/sdk-linux-x86.atree @@ -18,7 +18,7 @@ # Platform Tools Component ############################################################################## -lib/libc++.so strip platform-tools/lib/libc++.so +lib64/libc++.so strip platform-tools/lib64/libc++.so ############################################################################## # Build Tools Component @@ -28,11 +28,11 @@ lib/libc++.so strip platform-tools/lib/li # revision as specified in the source.properties. -lib/libLLVM.so strip build-tools/${PLATFORM_NAME}/lib/libLLVM.so -lib/libbcc.so strip build-tools/${PLATFORM_NAME}/lib/libbcc.so -lib/libbcinfo.so strip build-tools/${PLATFORM_NAME}/lib/libbcinfo.so -lib/libclang.so strip build-tools/${PLATFORM_NAME}/lib/libclang.so -lib/libc++.so strip build-tools/${PLATFORM_NAME}/lib/libc++.so +lib64/libLLVM.so strip build-tools/${PLATFORM_NAME}/lib64/libLLVM.so +lib64/libbcc.so strip build-tools/${PLATFORM_NAME}/lib64/libbcc.so +lib64/libbcinfo.so strip build-tools/${PLATFORM_NAME}/lib64/libbcinfo.so +lib64/libclang.so strip build-tools/${PLATFORM_NAME}/lib64/libclang.so +lib64/libc++.so strip build-tools/${PLATFORM_NAME}/lib64/libc++.so prebuilts/sdk/tools/linux/bin/arm-linux-androideabi-ld strip build-tools/${PLATFORM_NAME}/arm-linux-androideabi-ld prebuilts/sdk/tools/linux/bin/i686-linux-android-ld strip build-tools/${PLATFORM_NAME}/i686-linux-android-ld diff --git a/build/sdk-windows-x86.atree b/build/sdk-windows-x86.atree index 9856f987c..abad00920 100644 --- a/build/sdk-windows-x86.atree +++ b/build/sdk-windows-x86.atree @@ -79,20 +79,20 @@ rm build-tools/${PLATFORM_NAME}/llvm-rs-cc bin/llvm-rs-cc.exe strip build-tools/${PLATFORM_NAME}/llvm-rs-cc.exe # libc++.so not needed on Windows. -rm build-tools/${PLATFORM_NAME}/lib/libc++.so +rm build-tools/${PLATFORM_NAME}/lib64/libc++.so -rm build-tools/${PLATFORM_NAME}/lib/libLLVM.so +rm build-tools/${PLATFORM_NAME}/lib64/libLLVM.so lib/libLLVM.dll strip build-tools/${PLATFORM_NAME}/libLLVM.dll -rm build-tools/${PLATFORM_NAME}/lib/libclang.so +rm build-tools/${PLATFORM_NAME}/lib64/libclang.so lib/libclang.dll strip build-tools/${PLATFORM_NAME}/libclang.dll #bcc not yet compiled on windows -rm build-tools/${PLATFORM_NAME}/lib/libbcc.so +rm build-tools/${PLATFORM_NAME}/lib64/libbcc.so lib/libbcc.dll strip build-tools/${PLATFORM_NAME}/libbcc.dll -rm build-tools/${PLATFORM_NAME}/lib/libbcinfo.so +rm build-tools/${PLATFORM_NAME}/lib64/libbcinfo.so lib/libbcinfo.dll strip build-tools/${PLATFORM_NAME}/libbcinfo.dll rm build-tools/${PLATFORM_NAME}/bcc_compat diff --git a/build/sdk.atree b/build/sdk.atree index ee1e25132..14acaaa59 100644 --- a/build/sdk.atree +++ b/build/sdk.atree @@ -57,19 +57,19 @@ development/sdk/generated-api-versions.xml platform-tools/api/api-versions.xm prebuilts/sdk/sdk-annotations/annotations.zip platform-tools/api/annotations.zip # systrace -external/chromium-trace/agents/__init__.py platform-tools/systrace/agents/__init__.py -external/chromium-trace/agents/atrace_agent.py platform-tools/systrace/agents/atrace_agent.py -external/chromium-trace/systrace.py platform-tools/systrace/systrace.py -external/chromium-trace/systrace-legacy.py platform-tools/systrace/systrace-legacy.py -external/chromium-trace/systrace_agent.py platform-tools/systrace/systrace_agent.py -external/chromium-trace/util.py platform-tools/systrace/util.py -external/chromium-trace/systrace_trace_viewer.html platform-tools/systrace/systrace_trace_viewer.html -external/chromium-trace/prefix.html platform-tools/systrace/prefix.html -external/chromium-trace/suffix.html platform-tools/systrace/suffix.html -external/chromium-trace/LICENSE platform-tools/systrace/LICENSE -external/chromium-trace/AUTHORS platform-tools/systrace/AUTHORS -external/chromium-trace/NOTICE platform-tools/systrace/NOTICE -external/chromium-trace/UPSTREAM_REVISION platform-tools/systrace/UPSTREAM_REVISION +external/chromium-trace/catapult/systrace/systrace/agents/__init__.py platform-tools/systrace/agents/__init__.py +external/chromium-trace/catapult/systrace/systrace/agents/atrace_agent.py platform-tools/systrace/agents/atrace_agent.py +external/chromium-trace/catapult/systrace/systrace/systrace.py platform-tools/systrace/systrace.py +external/chromium-trace/catapult/systrace/systrace/systrace-legacy.py platform-tools/systrace/systrace-legacy.py +external/chromium-trace/catapult/systrace/systrace/systrace_agent.py platform-tools/systrace/systrace_agent.py +external/chromium-trace/catapult/systrace/systrace/util.py platform-tools/systrace/util.py +external/chromium-trace/catapult/systrace/systrace/prefix.html platform-tools/systrace/prefix.html +external/chromium-trace/catapult/systrace/systrace/suffix.html platform-tools/systrace/suffix.html +external/chromium-trace/catapult/systrace/systrace/LICENSE platform-tools/systrace/LICENSE +external/chromium-trace/catapult/systrace/systrace/AUTHORS platform-tools/systrace/AUTHORS +external/chromium-trace/systrace_trace_viewer.html platform-tools/systrace/systrace_trace_viewer.html +external/chromium-trace/NOTICE platform-tools/systrace/NOTICE +external/chromium-trace/UPSTREAM_REVISION platform-tools/systrace/UPSTREAM_REVISION ############################################################################## # Build Tools Component @@ -129,10 +129,12 @@ bin/dexdump build-tools/${PLATFORM_NAME}/dexdu # multi-dex prebuilts/sdk/tools/lib/shrinkedAndroid.jar build-tools/${PLATFORM_NAME}/lib/shrinkedAndroid.jar -prebuilts/sdk/tools/jack.jar build-tools/${PLATFORM_NAME}/jack.jar -prebuilts/sdk/tools/jill.jar build-tools/${PLATFORM_NAME}/jill.jar dalvik/dx/etc/mainDexClasses.rules build-tools/${PLATFORM_NAME}/mainDexClasses.rules +# Jack & Jill +${HOST_OUT}/framework/jack.jar build-tools/${PLATFORM_NAME}/jack.jar +${HOST_OUT}/framework/jill.jar build-tools/${PLATFORM_NAME}/jill.jar + ############################################################################## # Platform Component @@ -521,6 +523,22 @@ ${OUT_DIR}/target/common/obj/PACKAGING/android-support-percent_intermediates/and frameworks/support/customtabs/AndroidManifest.xml extras/android/support/customtabs/AndroidManifest.xml ${OUT_DIR}/target/common/obj/PACKAGING/android-support-customtabs_intermediates/android-support-customtabs.jar extras/android/support/customtabs/libs/android-support-customtabs.jar + +frameworks/support/v7/preference/AndroidManifest.xml extras/android/support/v7/preference/AndroidManifest.xml +frameworks/support/v7/preference/res extras/android/support/v7/preference/res +${OUT_DIR}/target/common/obj/PACKAGING/android-support-v7-preference_intermediates/android-support-v7-preference.jar extras/android/support/v7/preference/libs/android-support-v7-preference.jar + +frameworks/support/v14/preference/AndroidManifest.xml extras/android/support/v14/preference/AndroidManifest.xml +frameworks/support/v14/preference/res extras/android/support/v14/preference/res +${OUT_DIR}/target/common/obj/PACKAGING/android-support-v14-preference_intermediates/android-support-v14-preference.jar extras/android/support/v14/preference/libs/android-support-v14-preference.jar + +frameworks/support/v17/preference-leanback/AndroidManifest.xml extras/android/support/v17/preference-leanback/AndroidManifest.xml +frameworks/support/v17/preference-leanback/res extras/android/support/v17/preference-leanback/res +${OUT_DIR}/target/common/obj/PACKAGING/android-support-v17-preference-leanback_intermediates/android-support-v17-preference-leanback.jar extras/android/support/v17/preference-leanback/libs/android-support-v17-preference-leanback.jar + +frameworks/support/recommendation/AndroidManifest.xml extras/android/support/recommendation/AndroidManifest.xml +${OUT_DIR}/target/common/obj/PACKAGING/android-support-recommendation_intermediates/android-support-recommendation.jar extras/android/support/recommendation/libs/android-support-recommendation.jar + ############################################################################## # Tests Component ############################################################################## diff --git a/build/tools/windows_sdk.mk b/build/tools/windows_sdk.mk index 9b97a19a4..7d586a8c4 100644 --- a/build/tools/windows_sdk.mk +++ b/build/tools/windows_sdk.mk @@ -11,13 +11,10 @@ # This way we avoid the headache of building a full SDK in MinGW mode, which is # made complicated by the fact the build system does not support cross-compilation. -# We can only use this under Linux with the mingw32 package installed. +# We can only use this under Linux ifneq ($(shell uname),Linux) $(error Linux is required to create a Windows SDK) endif -ifeq ($(strip $(shell which i586-mingw32msvc-gcc 2>/dev/null)),) -$(error MinGW is required to build a Windows SDK. Please 'apt-get install mingw32') -endif ifeq ($(strip $(shell which unix2dos todos 2>/dev/null)),) $(error Need a unix2dos command. Please 'apt-get install tofrodos') endif @@ -34,26 +31,18 @@ WIN_TARGETS := \ aapt adb aidl \ aprotoc \ bcc_compat \ + clang \ etc1tool \ dexdump dmtracedump \ fastboot \ hprof-conv \ llvm-rs-cc \ - prebuilt \ sqlite3 \ zipalign \ split-select \ $(WIN_SDK_TARGETS) -# This is the list of *Linux* build tools that we need -# in order to be able to make the WIN_TARGETS. They are -# build prerequisites. -WIN_BUILD_PREREQ := \ - acp \ - llvm-tblgen \ - clang-tblgen \ - $(WIN_SDK_BUILD_PREREQ) - +WIN_TARGETS := $(foreach t,$(WIN_TARGETS),$(ALL_MODULES.host_cross_$(t).INSTALLED)) # MAIN_SDK_NAME/DIR is set in build/core/Makefile WIN_SDK_NAME := $(subst $(HOST_OS)-$(SDK_HOST_ARCH),windows,$(MAIN_SDK_NAME)) @@ -80,11 +69,10 @@ endef win_sdk: $(WIN_SDK_ZIP) $(call winsdk-banner,Done) -winsdk-tools: $(WIN_BUILD_PREREQ) - $(call winsdk-banner,Build Windows Tools) - $(hide) USE_MINGW=1 USE_CCACHE="" $(MAKE) PRODUCT-$(TARGET_PRODUCT)-$(strip $(WIN_TARGETS)) $(if $(hide),,showcommands) +winsdk-tools: $(WIN_TARGETS) + $(call winsdk-banner,Tools Done) -$(WIN_SDK_ZIP): winsdk-tools sdk +$(WIN_SDK_ZIP): $(WIN_TARGETS) $(INTERNAL_SDK_TARGET) $(call winsdk-banner,Build $(WIN_SDK_NAME)) $(call winsdk-info) $(hide) rm -rf $(WIN_SDK_DIR) diff --git a/build/windows_sdk_whitelist.mk b/build/windows_sdk_whitelist.mk deleted file mode 100644 index bf04360f0..000000000 --- a/build/windows_sdk_whitelist.mk +++ /dev/null @@ -1,83 +0,0 @@ -# Whitelist of SDK projects that can be built for the SDK on Windows - -# The Windows SDK cannot build all the projects from the SDK tree, typically -# due to obvious compiler/architectures differences. When building the Windows -# SDK, we only care about a subset of projects (e.g. generally the SDK tools -# and a few platform-specific binaries.) -# -# This file defines a whitelist of projects that can be built in the Windows -# SDK case. Note that whitelisting a project directory will NOT actually build -# it -- it will only allow one to reference it as a make dependency. -# -# This file is included by build/core/main.mk. - -# Note that there are 2 flavors of this file: -# -# - The other file: sdk/build/windows_sdk_whitelist.mk -# must list all projects that are that are NOT specific to a given platform. -# These binaries are the ones typically found in the SDK/tools directory. -# -# - This file: development/build/windows_sdk_whitelist.mk -# must list all projects that are specific to a given platform. These -# projects generate files that are generally locates in SDK/platform-tools, -# or SDK/platforms/, etc. - -# ----- -# Whitelist of platform specific projects that do NOT need Java (e.g. C libraries) - -subdirs += \ - prebuilt \ - prebuilts \ - build/libs/host \ - build/tools/zipalign \ - dalvik/dexdump \ - dalvik/libdex \ - dalvik/tools/dmtracedump \ - dalvik/tools/hprof-conv \ - development/host \ - development/tools/etc1tool \ - development/tools/line_endings \ - external/clang \ - external/easymock \ - external/expat \ - external/gtest \ - external/libcxx \ - external/libcxxabi \ - external/compiler-rt \ - external/libpng \ - external/llvm \ - external/protobuf \ - external/sqlite/dist \ - external/zlib \ - external/zopfli \ - frameworks/base \ - frameworks/compile \ - frameworks/native \ - frameworks/rs \ - frameworks/tools \ - system/core/adb \ - system/core/base \ - system/core/fastboot \ - system/core/libcutils \ - system/core/liblog \ - system/core/libsparse \ - system/core/libziparchive \ - system/core/libutils \ - system/extras/ext4_utils - -# ----- -# Whitelist of platform specific projects that DO require Java - -ifneq (,$(shell which javac 2>/dev/null)) -subdirs += \ - build/tools/signapk \ - dalvik/dx \ - libcore \ - development/apps \ - development/tools/mkstubs \ - frameworks/compile/libbcc \ - packages - -else -$(warning SDK_ONLY: javac not available.) -endif diff --git a/host/windows/.gitignore b/host/windows/.gitignore index 434a0faf9..0b5cf3137 100755 --- a/host/windows/.gitignore +++ b/host/windows/.gitignore @@ -6,7 +6,10 @@ usb/Debug usb/Release usb/api/obj* usb/api/*.log +usb/api/*.wrn usb/adb_winapi_test/obj* usb/adb_winapi_test/*.log +usb/adb_winapi_test/*.wrn usb/winusb/obj* -usb/winusb/*.log \ No newline at end of file +usb/winusb/*.log +usb/winusb/*.wrn diff --git a/host/windows/prebuilt/usb/AdbWinApi.def b/host/windows/prebuilt/usb/AdbWinApi.def deleted file mode 100644 index 18941481b..000000000 --- a/host/windows/prebuilt/usb/AdbWinApi.def +++ /dev/null @@ -1,15 +0,0 @@ -LIBRARY AdbWinApi.dll -EXPORTS -AdbEnumInterfaces -AdbNextInterface -AdbCreateInterfaceByName -AdbOpenDefaultBulkReadEndpoint -AdbOpenDefaultBulkWriteEndpoint -AdbCloseHandle -AdbGetInterfaceName -AdbWriteEndpointSync -AdbReadEndpointSync -AdbGetSerialNumber -AdbGetUsbInterfaceDescriptor -AdbGetUsbDeviceDescriptor -AdbGetEndpointInformation diff --git a/host/windows/prebuilt/usb/AdbWinApi.dll b/host/windows/prebuilt/usb/AdbWinApi.dll index b5586eb50..7abe26cf1 100755 Binary files a/host/windows/prebuilt/usb/AdbWinApi.dll and b/host/windows/prebuilt/usb/AdbWinApi.dll differ diff --git a/host/windows/prebuilt/usb/AdbWinApi.pdb b/host/windows/prebuilt/usb/AdbWinApi.pdb new file mode 100755 index 000000000..233518bb3 Binary files /dev/null and b/host/windows/prebuilt/usb/AdbWinApi.pdb differ diff --git a/host/windows/prebuilt/usb/AdbWinUsbApi.dll b/host/windows/prebuilt/usb/AdbWinUsbApi.dll index 0c9e00bd9..e7a6de120 100755 Binary files a/host/windows/prebuilt/usb/AdbWinUsbApi.dll and b/host/windows/prebuilt/usb/AdbWinUsbApi.dll differ diff --git a/host/windows/prebuilt/usb/AdbWinUsbApi.pdb b/host/windows/prebuilt/usb/AdbWinUsbApi.pdb new file mode 100755 index 000000000..0883ebf60 Binary files /dev/null and b/host/windows/prebuilt/usb/AdbWinUsbApi.pdb differ diff --git a/host/windows/prebuilt/usb/Android.mk b/host/windows/prebuilt/usb/Android.mk index e8af1678b..f1da6b915 100644 --- a/host/windows/prebuilt/usb/Android.mk +++ b/host/windows/prebuilt/usb/Android.mk @@ -7,6 +7,7 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES LOCAL_SRC_FILES_x86 := AdbWinApi.a LOCAL_MODULE_SUFFIX := .a LOCAL_MULTILIB := 32 +LOCAL_MODULE_HOST_OS := windows include $(BUILD_PREBUILT) include $(CLEAR_VARS) @@ -16,6 +17,7 @@ LOCAL_MODULE_CLASS := EXECUTABLES LOCAL_SRC_FILES_x86 := AdbWinApi.dll LOCAL_MODULE_SUFFIX := .dll LOCAL_MULTILIB := 32 +LOCAL_MODULE_HOST_OS := windows include $(BUILD_PREBUILT) include $(CLEAR_VARS) @@ -25,4 +27,5 @@ LOCAL_MODULE_CLASS := EXECUTABLES LOCAL_SRC_FILES_x86 := AdbWinUsbApi.dll LOCAL_MODULE_SUFFIX := .dll LOCAL_MULTILIB := 32 +LOCAL_MODULE_HOST_OS := windows include $(BUILD_PREBUILT) diff --git a/host/windows/usb/adb_winapi_test/BUILDME.TXT b/host/windows/usb/adb_winapi_test/BUILDME.TXT index 9365b5855..f53fee293 100755 --- a/host/windows/usb/adb_winapi_test/BUILDME.TXT +++ b/host/windows/usb/adb_winapi_test/BUILDME.TXT @@ -12,8 +12,31 @@ 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. -In order to build adb_winapi_test.dll you will need to install Windows Driver -Kit, which can be obtained from Microsoft. Assuming that WDK is installed, you -need to set one of the WDK's build environments, "cd" back into this directory, -and execute "build -cbeEIFZ" to clean and rebuild this project, or you can -execute "build -befEIF" to do a minimal build. +In order to build a directory with a SOURCES file you will need to install +the Windows Driver Kit, which can be obtained from Microsoft: + +Windows Driver Kit Version 7.1.0 +https://www.microsoft.com/en-us/download/details.aspx?id=11800 +md5: 8fe981a1706d43ad34bda496e6558f94 +sha1: de6abdb8eb4e08942add4aa270c763ed4e3d8242 + +This old version is used because it can build for Windows Vista (WDK 8.1 +cannot), it includes compilers (so it doesn't require Visual Studio), and it is +probably not too far from the WDK that this code was originally built with, so +it should be less risky. + +When installing the WDK, uncheck `Device Simulation Framework' because it is +unnecessary and it installs a kernel-mode driver that we don't need. + +Assuming that WDK is installed, you need to set one of the WDK's build +environments (Start Menu -> Windows Driver Kits -> x86 Free Build Environment; +choose the one for the oldest version of Windows you want to support), +"cd" back into this directory, and execute "build -cbeEIFZ" to clean and rebuild +this project, or you can execute "build -befEIF" to do a minimal build. + +Note that you need to build AdbWinApi.dll (..\api) before you build +this directory, as this depends on the AdbWinApi.lib import library. + +When you're done with the WDK build environment, don't forget to right-click the +OACR icon (in the lower-right notification area of the taskbar) and choose +`Close'. diff --git a/host/windows/usb/adb_winapi_test/SOURCES b/host/windows/usb/adb_winapi_test/SOURCES index ec82dee3f..3663ecb43 100755 --- a/host/windows/usb/adb_winapi_test/SOURCES +++ b/host/windows/usb/adb_winapi_test/SOURCES @@ -18,12 +18,17 @@ TARGETNAME = adb_winapi_test TARGETPATH = obj TARGETTYPE = PROGRAM +_NT_TARGET_VERSION = $(_NT_TARGET_VERSION_VISTA) + UMTYPE = console UMENTRY = main # Use statically linked atl libraries: USE_STATIC_ATL = 1 +# Use STL, default version +USE_STL = 1 + # Use multithreaded libraries USE_LIBCMT = 1 @@ -34,13 +39,19 @@ TARGETLIBS=$(SDK_LIB_PATH)\ole32.lib \ INCLUDES=$(DDK_INC_PATH)\;$(SDK_INC_PATH)\;$(CRT_INC_PATH)\;$(ATL_INC_PATH)\api # Common C defines -USER_C_FLAGS = $(USER_C_FLAGS) /FD /wd4100 /nologo +USER_C_FLAGS = $(USER_C_FLAGS) /FD /wd4100 /nologo -# Turn on all warnings, and treat warnings as errors -MSC_WARNING_LEVEL = /W4 /Wp64 /WX +# The STL uses C++ exception handling. +USE_NATIVE_EH=1 -PRECOMPILED_CXX = 1 -PRECOMPILED_INCLUDE = stdafx.h -PRECOMPILED_SOURCEFILE = stdafx.cpp +# Turn on all warnings, and treat warnings as errors +MSC_WARNING_LEVEL = /W4 /WX + +# Disable precompiled header to work-around compiler issue with interaction with +# ASLR on Windows 7 and newer. +# http://blogs.msdn.com/b/vcblog/archive/2009/11/12/visual-c-precompiled-header-errors-on-windows-7.aspx +#PRECOMPILED_CXX = 1 +#PRECOMPILED_INCLUDE = stdafx.h +#PRECOMPILED_SOURCEFILE = stdafx.cpp SOURCES = adb_winapi_test.cpp diff --git a/host/windows/usb/adb_winapi_test/adb_winapi_test.cpp b/host/windows/usb/adb_winapi_test/adb_winapi_test.cpp index 11fcadf01..75bf76a82 100755 --- a/host/windows/usb/adb_winapi_test/adb_winapi_test.cpp +++ b/host/windows/usb/adb_winapi_test/adb_winapi_test.cpp @@ -33,24 +33,35 @@ const GUID kAdbInterfaceId = ANDROID_USB_CLASS_ID; int interface_count = 0; // Constants used to initialize a "handshake" message -#define MAX_PAYLOAD 4096 -#define A_SYNC 0x434e5953 -#define A_CNXN 0x4e584e43 -#define A_OPEN 0x4e45504f -#define A_OKAY 0x59414b4f -#define A_CLSE 0x45534c43 -#define A_WRTE 0x45545257 -#define A_VERSION 0x01000000 +#define MAX_PAYLOAD 4096 +#define A_SYNC 0x434e5953 +#define A_CNXN 0x4e584e43 +#define A_OPEN 0x4e45504f +#define A_OKAY 0x59414b4f +#define A_CLSE 0x45534c43 +#define A_WRTE 0x45545257 +#define A_AUTH 0x48545541 +#define A_VERSION 0x01000000 + +// AUTH packets first argument +#define ADB_AUTH_TOKEN 1 +#define ADB_AUTH_SIGNATURE 2 +#define ADB_AUTH_RSAPUBLICKEY 3 + +// Interface descriptor constants for ADB interface +#define ADB_CLASS 0xff +#define ADB_SUBCLASS 0x42 +#define ADB_PROTOCOL 0x1 // Formats message sent to USB device -struct message { - unsigned int command; /* command identifier constant */ - unsigned int arg0; /* first argument */ - unsigned int arg1; /* second argument */ - unsigned int data_length; /* length of payload (0 is allowed) */ - unsigned int data_crc32; /* crc32 of data payload */ - unsigned int magic; /* command ^ 0xffffffff */ -}; +struct message { + unsigned int command; /* command identifier constant */ + unsigned int arg0; /* first argument */ + unsigned int arg1; /* second argument */ + unsigned int data_length; /* length of payload (0 is allowed) */ + unsigned int data_crc32; /* crc32 of data payload */ + unsigned int magic; /* command ^ 0xffffffff */ +}; // // Test routines declarations. @@ -69,7 +80,11 @@ bool TestInterface(const wchar_t* device_name); bool TestInterfaceHandle(ADBAPIHANDLE interface_handle); // Sends a "handshake" message to the given interface. -bool DeviceHandShake(ADBAPIHANDLE adb_interface); +bool DeviceHandShake(ADBAPIHANDLE adb_interface); + +// Test AdbCloseHandle race condition. +bool TestCloseRaceCondition(); + int __cdecl _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { // Test enum interfaces. if (!TestEnumInterfaces()) @@ -85,6 +100,10 @@ int __cdecl _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { if (!TestInterfaces()) return -2; + // Test for AdbCloseHandle race condition + if (!TestCloseRaceCondition()) + return -3; + return 0; } @@ -119,52 +138,60 @@ bool TestEnumInterfaces() { if (interface_info.flags & SPINT_REMOVED) printf(" REMOVED"); - buf_size = sizeof(buf);; - }; + buf_size = sizeof(buf); + } - AdbCloseHandle(enum_handle); - return true; + bool ret = true; + if (GetLastError() != ERROR_NO_MORE_ITEMS) { + printf("\n--- AdbNextInterface failure %u", GetLastError()); + ret = false; + } + + if (!AdbCloseHandle(enum_handle)) { + printf("\n--- AdbCloseHandle failure %u", GetLastError()); + ret = false; + } + + return ret; } bool TestInterfaces() { + bool ret = true; + // Enumerate interfaces ADBAPIHANDLE enum_handle = AdbEnumInterfaces(kAdbInterfaceId, true, true, true); if (NULL == enum_handle) { printf("\nTest interfaces failure:"); printf("\nUnable to enumerate ADB interfaces: %u", GetLastError()); - return false; - } - - // Unite interface info structure and buffer big enough to contain the - // largest structure. - union { - AdbInterfaceInfo interface_info; - char buf[4096]; - }; - unsigned long buf_size = sizeof(buf); - - // Test each found interface - while (AdbNextInterface(enum_handle, &interface_info, &buf_size)) { - TestInterface(interface_info.device_name); - buf_size = sizeof(buf); - }; + ret = false; + } else { + // Unite interface info structure and buffer big enough to contain the + // largest structure. + union { + AdbInterfaceInfo interface_info; + char buf[4096]; + }; + unsigned long buf_size = sizeof(buf); + + // Test each found interface + while (AdbNextInterface(enum_handle, &interface_info, &buf_size)) { + TestInterface(interface_info.device_name); + buf_size = sizeof(buf); + } - AdbCloseHandle(enum_handle); + if (GetLastError() != ERROR_NO_MORE_ITEMS) { + printf("\n--- AdbNextInterface failure %u", GetLastError()); + ret = false; + } - // Create interface by VID/PID/MI - ADBAPIHANDLE interface_handle = - AdbCreateInterface(kAdbInterfaceId, DEVICE_VENDOR_ID, - DEVICE_COMPOSITE_PRODUCT_ID, DEVICE_INTERFACE_ID); - if (NULL == interface_handle) { - printf("\nUnable to create interface by VID/PID: %u", GetLastError()); - return false; + if (!AdbCloseHandle(enum_handle)) { + printf("\n--- AdbCloseHandle failure %u", GetLastError()); + ret = false; + } } - // Test it - TestInterfaceHandle(interface_handle); - AdbCloseHandle(interface_handle); - return true; + return ret; } bool TestInterface(const wchar_t* device_name) { @@ -179,18 +206,98 @@ bool TestInterface(const wchar_t* device_name) { // Test it TestInterfaceHandle(interface_handle); - AdbCloseHandle(interface_handle); + if (!AdbCloseHandle(interface_handle)) { + printf("\n--- AdbCloseHandle failure %u", GetLastError()); + return false; + } + return true; } +bool TestInterfaceName(ADBAPIHANDLE interface_handle) { + bool ret = true; + unsigned long intr_name_size = 0; + char* buf = NULL; + + if (AdbGetInterfaceName(interface_handle, NULL, &intr_name_size, true)) { + printf("\n--- AdbGetInterfaceName unexpectedly succeeded %u", + GetLastError()); + ret = false; + goto exit; + } + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { + printf("\n--- AdbGetInterfaceName failure %u", GetLastError()); + ret = false; + goto exit; + } + if (intr_name_size == 0) { + printf("\n--- AdbGetInterfaceName returned name size of zero"); + ret = false; + goto exit; + } + + const size_t buf_size = intr_name_size + 16; // extra in case of overwrite + buf = reinterpret_cast(malloc(buf_size)); + if (buf == NULL) { + printf("\n--- could not malloc %d bytes, errno %u", buf_size, errno); + ret = false; + goto exit; + } + const char buf_fill = (unsigned char)0xFF; + memset(buf, buf_fill, buf_size); + + if (!AdbGetInterfaceName(interface_handle, buf, &intr_name_size, true)) { + printf("\n--- AdbGetInterfaceName failure %u", GetLastError()); + ret = false; + goto exit; + } + if (buf[intr_name_size - 1] != '\0') { + printf("\n--- AdbGetInterfaceName returned non-NULL terminated string"); + ret = false; + goto exit; + } + for (size_t i = intr_name_size; i < buf_size; ++i) { + if (buf[i] != buf_fill) { + printf("\n--- AdbGetInterfaceName overwrote past the end of the buffer at" + " index %u with 0x%02X", i, (unsigned char)buf[i]); + ret = false; + goto exit; + } + } + + printf("\n+++ Interface name %s", buf); + +exit: + free(buf); + + return ret; +} + +void DumpEndpointInformation(const AdbEndpointInformation* pipe_info) { + printf("\n max_packet_size = %u", pipe_info->max_packet_size); + printf("\n max_transfer_size = %u", pipe_info->max_transfer_size); + printf("\n endpoint_type = %u", pipe_info->endpoint_type); + const char* endpoint_type_desc = NULL; + switch (pipe_info->endpoint_type) { +#define CASE_TYPE(type) case type: endpoint_type_desc = #type; break + CASE_TYPE(AdbEndpointTypeInvalid); + CASE_TYPE(AdbEndpointTypeControl); + CASE_TYPE(AdbEndpointTypeIsochronous); + CASE_TYPE(AdbEndpointTypeBulk); + CASE_TYPE(AdbEndpointTypeInterrupt); +#undef CASE_TYPE + } + if (endpoint_type_desc != NULL) { + printf(" (%s)", endpoint_type_desc); + } + printf("\n endpoint_address = %02X", pipe_info->endpoint_address); + printf("\n polling_interval = %u", pipe_info->polling_interval); + printf("\n setting_index = %u", pipe_info->setting_index); +} + bool TestInterfaceHandle(ADBAPIHANDLE interface_handle) { // Get interface name. - char intr_name[4096]; - unsigned long intr_name_size = sizeof(intr_name); - if (AdbGetInterfaceName(interface_handle, intr_name, &intr_name_size, true)) { - printf("\n+++ Interface name %s", intr_name); - } else { - printf("\n--- AdbGetInterfaceName failure %u", GetLastError()); + if (!TestInterfaceName(interface_handle)) { return false; } @@ -211,7 +318,7 @@ bool TestInterfaceHandle(ADBAPIHANDLE interface_handle) { printf("\n iManufacturer = %u", dev_desc.iManufacturer); printf("\n iProduct = %u", dev_desc.iProduct); printf("\n iSerialNumber = %u", dev_desc.iSerialNumber); - printf("\n bNumConfigurations = %u", dev_desc.bDescriptorType); + printf("\n bNumConfigurations = %u", dev_desc.bNumConfigurations); } else { printf("\n--- AdbGetUsbDeviceDescriptor failure %u", GetLastError()); return false; @@ -253,8 +360,17 @@ bool TestInterfaceHandle(ADBAPIHANDLE interface_handle) { printf("\n bAlternateSetting = %u", intr_desc.bAlternateSetting); printf("\n bNumEndpoints = %u", intr_desc.bNumEndpoints); printf("\n bInterfaceClass = %u", intr_desc.bInterfaceClass); + if (intr_desc.bInterfaceClass == ADB_CLASS) { + printf(" (ADB_CLASS)"); + } printf("\n bInterfaceSubClass = %u", intr_desc.bInterfaceSubClass); + if (intr_desc.bInterfaceSubClass == ADB_SUBCLASS) { + printf(" (ADB_SUBCLASS)"); + } printf("\n bInterfaceProtocol = %u", intr_desc.bInterfaceProtocol); + if (intr_desc.bInterfaceProtocol == ADB_PROTOCOL) { + printf(" (ADB_PROTOCOL)"); + } printf("\n iInterface = %u", intr_desc.iInterface); } else { printf("\n--- AdbGetUsbInterfaceDescriptor failure %u", GetLastError()); @@ -266,14 +382,10 @@ bool TestInterfaceHandle(ADBAPIHANDLE interface_handle) { for (UCHAR pipe = 0; pipe < intr_desc.bNumEndpoints; pipe++) { if (AdbGetEndpointInformation(interface_handle, pipe, &pipe_info)) { printf("\n PIPE %u info:", pipe); - printf("\n max_packet_size = %u", pipe_info.max_packet_size); - printf("\n max_transfer_size = %u", pipe_info.max_transfer_size); - printf("\n endpoint_type = %u", pipe_info.endpoint_type); - printf("\n endpoint_address = %02X", pipe_info.endpoint_address); - printf("\n polling_interval = %u", pipe_info.polling_interval); - printf("\n setting_index = %u", pipe_info.setting_index); + DumpEndpointInformation(&pipe_info); } else { - printf("\n--- AdbGetEndpointInformation(%u) failure %u", pipe, GetLastError()); + printf("\n--- AdbGetEndpointInformation(%u) failure %u", pipe, + GetLastError()); return false; } } @@ -281,28 +393,20 @@ bool TestInterfaceHandle(ADBAPIHANDLE interface_handle) { // Get default bulk read endpoint info if (AdbGetDefaultBulkReadEndpointInformation(interface_handle, &pipe_info)) { printf("\n Default Bulk Read Pipe info:"); - printf("\n max_packet_size = %u", pipe_info.max_packet_size); - printf("\n max_transfer_size = %u", pipe_info.max_transfer_size); - printf("\n endpoint_type = %u", pipe_info.endpoint_type); - printf("\n endpoint_address = %02X", pipe_info.endpoint_address); - printf("\n polling_interval = %u", pipe_info.polling_interval); - printf("\n setting_index = %u", pipe_info.setting_index); + DumpEndpointInformation(&pipe_info); } else { - printf("\n--- AdbGetDefaultBulkReadEndpointInformation failure %u", GetLastError()); + printf("\n--- AdbGetDefaultBulkReadEndpointInformation failure %u", + GetLastError()); return false; } // Get default bulk write endpoint info if (AdbGetDefaultBulkWriteEndpointInformation(interface_handle, &pipe_info)) { printf("\n Default Bulk Write Pipe info:"); - printf("\n max_packet_size = %u", pipe_info.max_packet_size); - printf("\n max_transfer_size = %u", pipe_info.max_transfer_size); - printf("\n endpoint_type = %u", pipe_info.endpoint_type); - printf("\n endpoint_address = %02X", pipe_info.endpoint_address); - printf("\n polling_interval = %u", pipe_info.polling_interval); - printf("\n setting_index = %u", pipe_info.setting_index); + DumpEndpointInformation(&pipe_info); } else { - printf("\n--- AdbGetDefaultBulkWriteEndpointInformation failure %u", GetLastError()); + printf("\n--- AdbGetDefaultBulkWriteEndpointInformation failure %u", + GetLastError()); return false; } @@ -312,6 +416,48 @@ bool TestInterfaceHandle(ADBAPIHANDLE interface_handle) { return true; } +void HexDump(const void* data, const size_t read_bytes) { + const unsigned char* buf = reinterpret_cast(data); + const size_t line_length = 16; + for (size_t n = 0; n < read_bytes; n += line_length) { + const unsigned char* line = &buf[n]; + const size_t max_line = min(line_length, read_bytes - n); + + printf("\n "); + for (size_t i = 0; i < line_length; ++i) { + if (i >= max_line) { + printf(" "); + } else { + printf("%02X ", line[i]); + } + } + printf(" "); + for (size_t i = 0; i < max_line; ++i) { + if (isprint(line[i])) { + printf("%c", line[i]); + } else { + printf("."); + } + } + } +} + +void DumpMessageArg0(unsigned int command, unsigned int arg0) { + if (command == A_AUTH) { + const char* desc = NULL; + switch (arg0) { +#define CASE_ARG0(arg) case arg: desc = # arg; break + CASE_ARG0(ADB_AUTH_TOKEN); + CASE_ARG0(ADB_AUTH_SIGNATURE); + CASE_ARG0(ADB_AUTH_RSAPUBLICKEY); +#undef CASE_ARG0 + } + if (desc != NULL) { + printf(" (%s)", desc); + } + } +} + bool DeviceHandShake(ADBAPIHANDLE adb_interface) { // Get interface name char interf_name[512]; @@ -361,11 +507,11 @@ bool DeviceHandShake(ADBAPIHANDLE adb_interface) { // Send connect message message msg_send; msg_send.command = A_CNXN; - msg_send.arg0 = A_VERSION; - msg_send.arg1 = MAX_PAYLOAD; - msg_send.data_length = 0; - msg_send.data_crc32 = 0; - msg_send.magic = msg_send.command ^ 0xffffffff; + msg_send.arg0 = A_VERSION; + msg_send.arg1 = MAX_PAYLOAD; + msg_send.data_length = 0; + msg_send.data_crc32 = 0; + msg_send.magic = msg_send.command ^ 0xffffffff; ULONG written_bytes = 0; bool write_res = AdbWriteEndpointSync(adb_write, &msg_send, sizeof(msg_send), &written_bytes, 500); @@ -392,10 +538,13 @@ bool DeviceHandShake(ADBAPIHANDLE adb_interface) { printf("\n command = %08X (%c%c%c%c)", msg_rcv.command, cmd_ansi[0], cmd_ansi[1], cmd_ansi[2], cmd_ansi[3]); printf("\n arg0 = %08X", msg_rcv.arg0); + DumpMessageArg0(msg_rcv.command, msg_rcv.arg0); printf("\n arg1 = %08X", msg_rcv.arg1); printf("\n data_length = %u", msg_rcv.data_length); printf("\n data_crc32 = %08X", msg_rcv.data_crc32); printf("\n magic = %08X", msg_rcv.magic); + printf(" (%s)", (msg_rcv.magic == (msg_rcv.command ^ 0xffffffff)) ? + "valid" : "invalid"); if (0 != msg_rcv.data_length) { char* buf = reinterpret_cast(malloc(msg_rcv.data_length)); @@ -408,19 +557,261 @@ bool DeviceHandShake(ADBAPIHANDLE adb_interface) { return false; } - for (ULONG n = 0; n < read_bytes; n++) { - if (0 == (n % 16)) - printf("\n "); - printf("%02X ", buf[n]); + HexDump(buf, read_bytes); + + free(buf); + } + + if (!AdbCloseHandle(adb_write)) { + printf("\n--- AdbCloseHandle failure %u", GetLastError()); + } + if (!AdbCloseHandle(adb_read)) { + printf("\n--- AdbCloseHandle failure %u", GetLastError()); + } + + return true; +} + +// Randomly delay the current thread. +class RandomDelayer { +public: + // Prepare for a call to Delay() by getting random data. This call might grab + // locks, causing serialization, so this should be called before + // time-sensitive code. + void SeedRandom() { + r_ = rand(); + } + + // Randomly delay the current thread based on a previous call to SeedRandom(). + void Delay() { + switch (r_ % 5) { + case 0: + Sleep(0); // Give up time slice to another read-to-run thread. + break; + case 1: + // Try to sleep for 1 ms, but probably more based on OS scheduler + // minimum granularity. + Sleep(1); + break; + case 2: + // Yield to another thread ready-to-run on the current processor. + SwitchToThread(); + break; + case 3: + // Busy-wait for a random amount of time. + for (int i = 0; i < r_; ++i) { + GetLastError(); + } + break; + case 4: + break; // Do nothing, no delay. } + } + +private: + int r_; +}; - printf("\n %s", buf); +volatile ADBAPIHANDLE g_read_handle; +volatile ADBAPIHANDLE g_interface_handle; +volatile bool g_stop_close_race_thread; - delete buf; +unsigned __stdcall CloseRaceThread(void*) { + RandomDelayer r; + + while (!g_stop_close_race_thread) { + r.SeedRandom(); + + // Do volatile reads of both globals + ADBAPIHANDLE read_handle = g_read_handle; + ADBAPIHANDLE interface_handle = g_interface_handle; + + // If we got both handles, close them and clear the globals + if (read_handle != NULL && interface_handle != NULL) { + // Delay random amount before calling the API that conflicts with + // Adb{Read,Write}EndpointSync(). + r.Delay(); + + if (!AdbCloseHandle(read_handle)) { + printf("\nAdbCloseHandle(read) failure: %u", GetLastError()); + } + if (!AdbCloseHandle(interface_handle)) { + printf("\nAdbCloseHandle(interface) failure: %u", GetLastError()); + } + + // Clear globals so that read thread is free to set them. + g_read_handle = NULL; + g_interface_handle = NULL; + } } + return 0; +} - AdbCloseHandle(adb_write); - AdbCloseHandle(adb_read); +#define EXPECTED_ERROR_LIST(FOR_EACH) \ + FOR_EACH(ERROR_INVALID_HANDLE) \ + FOR_EACH(ERROR_HANDLES_CLOSED) \ + FOR_EACH(ERROR_OPERATION_ABORTED) + +#define MAKE_ARRAY_ITEM(x) x, +const DWORD g_expected_errors[] = { + EXPECTED_ERROR_LIST(MAKE_ARRAY_ITEM) +}; +#undef MAKE_ARRAY_ITEM + +#define MAKE_STRING_ITEM(x) #x, +const char* g_expected_error_strings[] = { + EXPECTED_ERROR_LIST(MAKE_STRING_ITEM) +}; +#undef MAKE_STRING_ITEM + +std::string get_error_description(const DWORD err) { + const DWORD* end = g_expected_errors + ARRAYSIZE(g_expected_errors); + const DWORD* found = std::find(g_expected_errors, end, err); + if (found != end) { + return g_expected_error_strings[found - g_expected_errors]; + } else { + char buf[64]; + _snprintf(buf, sizeof(buf), "%u", err); + return std::string(buf); + } +} - return true; +bool is_expected_error(const DWORD err) { + const DWORD* end = g_expected_errors + ARRAYSIZE(g_expected_errors); + return std::find(g_expected_errors, end, err) != end; +} + +// Test to reproduce https://code.google.com/p/android/issues/detail?id=161890 +bool TestCloseRaceCondition() { + const DWORD test_duration_sec = 10; + printf("\nTesting close race condition for %u seconds... ", + test_duration_sec); + + ADBAPIHANDLE enum_handle = + AdbEnumInterfaces(kAdbInterfaceId, true, true, true); + if (NULL == enum_handle) { + printf("\nUnable to enumerate ADB interfaces: %u", GetLastError()); + return false; + } + + union { + AdbInterfaceInfo interface_info; + char buf[4096]; + }; + unsigned long buf_size = sizeof(buf); + + // Get the first interface + if (!AdbNextInterface(enum_handle, &interface_info, &buf_size)) { + printf("\n--- AdbNextInterface failure %u", GetLastError()); + return false; + } + + if (!AdbCloseHandle(enum_handle)) { + printf("\nAdbCloseHandle(enum_handle) failure: %u", GetLastError()); + } + + HANDLE thread_handle = reinterpret_cast( + _beginthreadex(NULL, 0, CloseRaceThread, NULL, 0, NULL)); + if (thread_handle == NULL) { + printf("\n--- _beginthreadex failure %u", errno); + return false; + } + + // Run the test for 10 seconds. It usually reproduces the crash in 1 second. + const DWORD tick_start = GetTickCount(); + const DWORD test_duration_ticks = test_duration_sec * 1000; + RandomDelayer r; + + std::map read_errors; + + while (GetTickCount() < tick_start + test_duration_ticks) { + // Busy-wait until close thread has cleared the handles, so that we don't + // leak handles during the test. + while (g_read_handle != NULL) {} + while (g_interface_handle != NULL) {} + + ADBAPIHANDLE interface_handle = AdbCreateInterfaceByName( + interface_info.device_name); + if (interface_handle == NULL) { + // Not really expected to encounter an error here. + printf("\n--- AdbCreateInterfaceByName failure %u", GetLastError()); + continue; // try again + } + ADBAPIHANDLE read_handle = AdbOpenDefaultBulkReadEndpoint( + interface_handle, AdbOpenAccessTypeReadWrite, + AdbOpenSharingModeReadWrite); + if (read_handle == NULL) { + // Not really expected to encounter an error here, so report, cleanup, + // and retry. + printf("\n--- AdbOpenDefaultBulkReadEndpoint failure %u", GetLastError()); + AdbCloseHandle(interface_handle); + continue; + } + + r.SeedRandom(); + + // Set handles to allow other thread to close them. + g_read_handle = read_handle; + g_interface_handle = interface_handle; + + // Delay random amount before calling the API that conflicts with + // AdbCloseHandle(). + r.Delay(); + + message msg_rcv; + ULONG read_bytes = 0; + + while (AdbReadEndpointSync(read_handle, &msg_rcv, sizeof(msg_rcv), + &read_bytes, 0 /* infinite timeout */)) { + // Keep reading until a crash or we're broken out of the read + // (with an error) by the CloseRaceThread. + } + read_errors[GetLastError()]++; + } + + g_stop_close_race_thread = true; + if (WaitForSingleObject(thread_handle, INFINITE) != WAIT_OBJECT_0) { + printf("\n--- WaitForSingleObject failure %u", GetLastError()); + } + if (!CloseHandle(thread_handle)) { + printf("\n--- CloseHandle failure %u", GetLastError()); + } + + // The expected errors are the errors that would be encountered if the code + // had all the major concurrent interleavings. So the test only passes if + // we encountered all the expected errors, and thus stress tested all the + // possible major concurrent interleavings. + bool pass = true; + for (size_t i = 0; i < ARRAYSIZE(g_expected_errors); ++i) { + // If we didn't encounter the expected error code, then the test failed. + if (read_errors.count(g_expected_errors[i]) == 0) { + pass = false; + break; + } + } + + if (pass) { + printf("passed"); + } else { + printf("failed."); + printf("\nPerhaps you just need to run the test longer or again."); + } + + printf("\nRead Error Code\t\tCount"); + printf("\n============================="); + + for (std::map::iterator it = read_errors.begin(); + it != read_errors.end(); ++it) { + printf("\n%s\t%u%s", get_error_description(it->first).c_str(), it->second, + is_expected_error(it->first) ? " (expected)" : ""); + } + + for (size_t i = 0; i < ARRAYSIZE(g_expected_errors); ++i) { + if (read_errors.count(g_expected_errors[i]) == 0) { + printf("\n%s\t%u (was not encountered, but was expected)", + get_error_description(g_expected_errors[i]).c_str(), 0); + } + } + + return pass; } diff --git a/host/windows/usb/adb_winapi_test/stdafx.h b/host/windows/usb/adb_winapi_test/stdafx.h index 2aa99100a..41f6bdb5f 100755 --- a/host/windows/usb/adb_winapi_test/stdafx.h +++ b/host/windows/usb/adb_winapi_test/stdafx.h @@ -49,6 +49,9 @@ #include #include +#include +#include +#include #include diff --git a/host/windows/usb/api/BUILDME.TXT b/host/windows/usb/api/BUILDME.TXT index 8e131071f..998673ae7 100755 --- a/host/windows/usb/api/BUILDME.TXT +++ b/host/windows/usb/api/BUILDME.TXT @@ -12,8 +12,28 @@ 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. -In order to build AdbWinApi.dll you will need to install Windows Driver Kit, -which can be obtained from Microsoft. Assuming that WDK is installed, you -need to set one of the WDK's build environments, "cd" back into this directory, -and execute "build -cbeEIFZ" to clean and rebuild this project, or you can -execute "build -befEIF" to do a minimal build. +In order to build a directory with a SOURCES file you will need to install +the Windows Driver Kit, which can be obtained from Microsoft: + +Windows Driver Kit Version 7.1.0 +https://www.microsoft.com/en-us/download/details.aspx?id=11800 +md5: 8fe981a1706d43ad34bda496e6558f94 +sha1: de6abdb8eb4e08942add4aa270c763ed4e3d8242 + +This old version is used because it can build for Windows Vista (WDK 8.1 +cannot), it includes compilers (so it doesn't require Visual Studio), and it is +probably not too far from the WDK that this code was originally built with, so +it should be less risky. + +When installing the WDK, uncheck `Device Simulation Framework' because it is +unnecessary and it installs a kernel-mode driver that we don't need. + +Assuming that WDK is installed, you need to set one of the WDK's build +environments (Start Menu -> Windows Driver Kits -> x86 Free Build Environment; +choose the one for the oldest version of Windows you want to support), +"cd" back into this directory, and execute "build -cbeEIFZ" to clean and rebuild +this project, or you can execute "build -befEIF" to do a minimal build. + +When you're done with the WDK build environment, don't forget to right-click the +OACR icon (in the lower-right notification area of the taskbar) and choose +`Close'. diff --git a/host/windows/usb/api/SOURCES b/host/windows/usb/api/SOURCES index 35695217b..25cc89212 100755 --- a/host/windows/usb/api/SOURCES +++ b/host/windows/usb/api/SOURCES @@ -18,8 +18,13 @@ TARGETNAME = AdbWinApi TARGETPATH = obj TARGETTYPE = DYNLINK +_NT_TARGET_VERSION = $(_NT_TARGET_VERSION_VISTA) + UMTYPE = windows DLLDEF = AdbWinApi.def +# Use the same load address as previous versions just to be conservative. This +# really doesn't matter on newer OSes that use ASLR. +DLLBASE = 0x400000 # Use statically linked atl libraries: # - atls.lib for free build @@ -33,6 +38,12 @@ STL_VER = 60 # Use multithreaded libraries USE_LIBCMT = 1 +!IF !$(FREEBUILD) +# In checked build, ATL headers call APIs that are only in atlsd.lib. To use +# atlsd.lib in checked build, set DEBUG_CRTS. +DEBUG_CRTS=1 +!ENDIF + # Include directories INCLUDES = $(DDK_INC_PATH); \ $(SDK_INC_PATH); \ @@ -52,33 +63,28 @@ TARGETLIBS = $(SDK_LIB_PATH)\ole32.lib \ $(SDK_LIB_PATH)\setupapi.lib \ $(SDK_LIB_PATH)\usbd.lib -!IF "$(DDKBUILDENV)" == "fre" -# Libraries for release (free) builds -TARGETLIBS = $(TARGETLIBS) $(ATL_LIB_PATH)\atls.lib -!ELSE -# Libraries for debug (checked) builds -TARGETLIBS = $(TARGETLIBS) $(ATL_LIB_PATH)\atlsd.lib -!ENDIF - # Common C defines C_DEFINES= $(C_DEFINES) -DADBWIN_EXPORTS -D_UNICODE \ -DUNICODE -DWIN32 -D_WINDOWS -D_USRDLL -D_WINDLL -!IF "$(DDKBUILDENV)" == "fre" -# C defines for release (free) builds +!IF "$(DDKBUILDENV)" == "fre" +# C defines for release (free) builds C_DEFINES = $(C_DEFINES) -DNDEBUG !ELSE -# C defines for debug (checked) builds +# C defines for debug (checked) builds C_DEFINES = $(C_DEFINES) -D_DEBUG !ENDIF # Turn on all warnings, and treat warnings as errors -MSC_WARNING_LEVEL = /W4 /Wp64 /WX - +MSC_WARNING_LEVEL = /W4 /WX + +# operator new throws C++ exceptions +USE_NATIVE_EH=1 + # Common C defines -USER_C_FLAGS = $(USER_C_FLAGS) /FD /EHsc /wd4100 /wd4200 /wd4702 /nologo - -# Set precompiled header information +USER_C_FLAGS = $(USER_C_FLAGS) /FD /wd4100 /wd4200 /wd4702 /nologo + +# Set precompiled header information PRECOMPILED_CXX = 1 PRECOMPILED_INCLUDE = stdafx.h PRECOMPILED_SOURCEFILE = stdafx.cpp diff --git a/host/windows/usb/api/adb_api.h b/host/windows/usb/api/adb_api.h old mode 100644 new mode 100755 index 29c4ee360..9bd9274e9 --- a/host/windows/usb/api/adb_api.h +++ b/host/windows/usb/api/adb_api.h @@ -91,28 +91,6 @@ typedef struct _AdbEndpointInformation { #define ANDROID_USB_CLASS_ID \ {0xf72fe0d4, 0xcbcb, 0x407d, {0x88, 0x14, 0x9e, 0xd6, 0x73, 0xd0, 0xdd, 0x6b}}; -/// Defines vendor ID for HCT devices. -#define DEVICE_VENDOR_ID 0x0BB4 - -/// Defines product ID for the device with single interface. -#define DEVICE_SINGLE_PRODUCT_ID 0x0C01 - -/// Defines product ID for the Dream composite device. -#define DEVICE_COMPOSITE_PRODUCT_ID 0x0C02 - -/// Defines product ID for the Magic composite device. -#define DEVICE_MAGIC_COMPOSITE_PRODUCT_ID 0x0C03 - -/// Defines interface ID for the device. -#define DEVICE_INTERFACE_ID 0x01 - -/// Defines vendor ID for the device -#define DEVICE_EMULATOR_VENDOR_ID 0x18D1 - -/// Defines product ID for a SoftUSB device simulator that is used to test -/// the driver in isolation from hardware. -#define DEVICE_EMULATOR_PROD_ID 0xDDDD - // The following ifdef block is the standard way of creating macros which make // exporting from a DLL simpler. All files within this DLL are compiled with // the ADBWIN_EXPORTS symbol defined on the command line. this symbol should diff --git a/host/windows/usb/winusb/AdbWinUsbApi.rc b/host/windows/usb/winusb/AdbWinUsbApi.rc index 44aa100f4..a33082e07 100755 --- a/host/windows/usb/winusb/AdbWinUsbApi.rc +++ b/host/windows/usb/winusb/AdbWinUsbApi.rc @@ -57,8 +57,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,0,0,0 - PRODUCTVERSION 2,0,0,0 + FILEVERSION 2,0,0,1 + PRODUCTVERSION 2,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -75,12 +75,12 @@ BEGIN BEGIN VALUE "CompanyName", "Google, inc" VALUE "FileDescription", "Android ADB API (WinUsb)" - VALUE "FileVersion", "2.0.0.0" - VALUE "LegalCopyright", "Copyright (C) 2006 The Android Open Source Project" + VALUE "FileVersion", "2.0.0.1" + VALUE "LegalCopyright", "Copyright (C) 2006-2015 The Android Open Source Project" VALUE "InternalName", "AdbWinUsbApi.dll" VALUE "OriginalFilename", "AdbWinUsbApi.dll" VALUE "ProductName", "Android SDK" - VALUE "ProductVersion", "2.0.0.0" + VALUE "ProductVersion", "2.0.0.1" VALUE "OLESelfRegister", "" END END diff --git a/host/windows/usb/winusb/BUILDME.TXT b/host/windows/usb/winusb/BUILDME.TXT index 2a459ef53..1f7402195 100755 --- a/host/windows/usb/winusb/BUILDME.TXT +++ b/host/windows/usb/winusb/BUILDME.TXT @@ -1,7 +1,42 @@ -In order to build AdbWinUsbApi.dll you will need to install Windows Driver Kit, -which can be obtained from Microsoft. Assuming that WDK is installed, you -need to set one of the WDK's build environments, "cd" back into this directory, -and execute "build -cbeEIFZ" to clean and rebuild this project, or you can -execute "build -befEIF" to do a minimal build. +Copyright (C) 2006 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. + +In order to build a directory with a SOURCES file you will need to install +the Windows Driver Kit, which can be obtained from Microsoft: + +Windows Driver Kit Version 7.1.0 +https://www.microsoft.com/en-us/download/details.aspx?id=11800 +md5: 8fe981a1706d43ad34bda496e6558f94 +sha1: de6abdb8eb4e08942add4aa270c763ed4e3d8242 + +This old version is used because it can build for Windows Vista (WDK 8.1 +cannot), it includes compilers (so it doesn't require Visual Studio), and it is +probably not too far from the WDK that this code was originally built with, so +it should be less risky. + +When installing the WDK, uncheck `Device Simulation Framework' because it is +unnecessary and it installs a kernel-mode driver that we don't need. + +Assuming that WDK is installed, you need to set one of the WDK's build +environments (Start Menu -> Windows Driver Kits -> x86 Free Build Environment; +choose the one for the oldest version of Windows you want to support), +"cd" back into this directory, and execute "build -cbeEIFZ" to clean and rebuild +this project, or you can execute "build -befEIF" to do a minimal build. + Note that you need to build AdbWinApi.dll (..\api) before you build -AdbWinUsbApi.dll, as it depends on AdbWinApi.lib library. +this directory, as this depends on the AdbWinApi.lib import library. + +When you're done with the WDK build environment, don't forget to right-click the +OACR icon (in the lower-right notification area of the taskbar) and choose +`Close'. diff --git a/host/windows/usb/winusb/SOURCES b/host/windows/usb/winusb/SOURCES index 80d17ae1f..d61fbcd2a 100755 --- a/host/windows/usb/winusb/SOURCES +++ b/host/windows/usb/winusb/SOURCES @@ -18,8 +18,13 @@ TARGETNAME = AdbWinUsbApi TARGETPATH = obj TARGETTYPE = DYNLINK +_NT_TARGET_VERSION = $(_NT_TARGET_VERSION_VISTA) + UMTYPE = windows DLLDEF = AdbWinUsbApi.def +# Use the same load address as previous versions just to be conservative. This +# really doesn't matter on newer OSes that use ASLR. +DLLBASE = 0x400000 # Use statically linked atl libraries: # - atls.lib for free build @@ -33,6 +38,12 @@ STL_VER = 60 # Use multithreaded libraries USE_LIBCMT = 1 +!IF !$(FREEBUILD) +# In checked build, ATL headers call APIs that are only in atlsd.lib. To use +# atlsd.lib in checked build, set DEBUG_CRTS. +DEBUG_CRTS=1 +!ENDIF + # Include directories INCLUDES = $(DDK_INC_PATH); \ $(SDK_INC_PATH); \ @@ -54,33 +65,28 @@ TARGETLIBS = $(SDK_LIB_PATH)\ole32.lib \ $(SDK_LIB_PATH)\winusb.lib \ ..\api\obj$(BUILD_ALT_DIR)\i386\AdbWinApi.lib -!IF "$(DDKBUILDENV)" == "fre" -# Libraries for release (free) builds -TARGETLIBS = $(TARGETLIBS) $(ATL_LIB_PATH)\atls.lib -!ELSE -# Libraries for debug (checked) builds -TARGETLIBS = $(TARGETLIBS) $(ATL_LIB_PATH)\atlsd.lib -!ENDIF - # Common C defines C_DEFINES= $(C_DEFINES) -DADBWINUSB_EXPORTS -D_UNICODE \ -DUNICODE -DWIN32 -D_WINDOWS -D_USRDLL -D_WINDLL -!IF "$(DDKBUILDENV)" == "fre" -# C defines for release (free) builds +!IF "$(DDKBUILDENV)" == "fre" +# C defines for release (free) builds C_DEFINES = $(C_DEFINES) -DNDEBUG !ELSE -# C defines for debug (checked) builds +# C defines for debug (checked) builds C_DEFINES = $(C_DEFINES) -D_DEBUG !ENDIF # Turn on all warnings, and treat warnings as errors -MSC_WARNING_LEVEL = /W4 /Wp64 /WX - +MSC_WARNING_LEVEL = /W4 /WX + +# operator new throws C++ exceptions +USE_NATIVE_EH=1 + # Common C defines -USER_C_FLAGS = $(USER_C_FLAGS) /FD /EHsc /wd4100 /wd4200 /wd4702 /nologo - -# Set precompiled header information +USER_C_FLAGS = $(USER_C_FLAGS) /FD /wd4100 /wd4200 /wd4702 /nologo + +# Set precompiled header information PRECOMPILED_CXX = 1 PRECOMPILED_INCLUDE = stdafx.h PRECOMPILED_SOURCEFILE = stdafx.cpp diff --git a/host/windows/usb/winusb/adb_winusb_endpoint_object.cpp b/host/windows/usb/winusb/adb_winusb_endpoint_object.cpp index 16f78370c..dee916705 100755 --- a/host/windows/usb/winusb/adb_winusb_endpoint_object.cpp +++ b/host/windows/usb/winusb/adb_winusb_endpoint_object.cpp @@ -27,7 +27,8 @@ AdbWinUsbEndpointObject::AdbWinUsbEndpointObject( AdbWinUsbInterfaceObject* parent_interf, UCHAR endpoint_id, UCHAR endpoint_index) - : AdbEndpointObject(parent_interf, endpoint_id, endpoint_index) { + : AdbEndpointObject(parent_interf, endpoint_id, endpoint_index), + lock_(), is_closing_(false), pending_io_count_(0) { } AdbWinUsbEndpointObject::~AdbWinUsbEndpointObject() { @@ -44,6 +45,54 @@ LONG AdbWinUsbEndpointObject::Release() { return ret; } +bool AdbWinUsbEndpointObject::CloseHandle() { + // This method only returns once all pending IOs are aborted and after + // preventing future pending IOs. This means that once CloseHandle() + // returns, threads using this object won't be using + // parent_winusb_interface()->winusb_handle(), so it can then be safely + // released. + lock_.Lock(); + if (!is_closing_) { + // Set flag to prevent new I/Os from starting up. + is_closing_ = true; + } + + // While there are pending IOs, keep aborting the pipe. We have to do this + // repeatedly because pending_ios_ is incremented before the IO has actually + // started, and abort (probably) only works if the IO has been started. + while (pending_io_count_ > 0) { + lock_.Unlock(); + + // It has been noticed that on Windows 7, if you only call + // WinUsb_AbortPipe(), without first calling WinUsb_ResetPipe(), the call + // to WinUsb_AbortPipe() hangs. + if (!WinUsb_ResetPipe(parent_winusb_interface()->winusb_handle(), + endpoint_id()) || + !WinUsb_AbortPipe(parent_winusb_interface()->winusb_handle(), + endpoint_id())) { + // Reset or Abort failed for unexpected reason. We might not be able to + // abort pending IOs, so we shouldn't keep polling pending_io_count_ or + // else we might hang forever waiting for the IOs to abort. In this + // situation it is preferable to risk a race condition (which may or may + // not crash) and just break now. + lock_.Lock(); + break; + } + + // Give the IO threads time to break out of I/O calls and decrement + // pending_io_count_. They should finish up pretty quick. The amount of time + // "wasted" here (as opposed to if we did synchronization with an event) + // doesn't really matter since this is an uncommon corner-case. + Sleep(16); // 16 ms, old default OS scheduler granularity + + lock_.Lock(); + } + + lock_.Unlock(); + + return AdbEndpointObject::CloseHandle(); +} + ADBAPIHANDLE AdbWinUsbEndpointObject::CommonAsyncReadWrite( bool is_read, void* buffer, @@ -51,6 +100,9 @@ ADBAPIHANDLE AdbWinUsbEndpointObject::CommonAsyncReadWrite( ULONG* bytes_transferred, HANDLE event_handle, ULONG time_out) { + // TODO: Do synchronization with is_closing_ and pending_io_count_ like + // CommonSyncReadWrite(). This is not yet implemented because there are no + // callers to Adb{Read,Write}EndpointAsync() in AOSP, and hence no testing. if (!SetTimeout(time_out)) return false; @@ -110,6 +162,24 @@ bool AdbWinUsbEndpointObject::CommonSyncReadWrite(bool is_read, ULONG bytes_to_transfer, ULONG* bytes_transferred, ULONG time_out) { + lock_.Lock(); + if (is_closing_) { + lock_.Unlock(); + // AdbCloseHandle() is in progress, so don't start up any new IOs. + SetLastError(ERROR_HANDLES_CLOSED); + return false; + } else { + // Not closing down, so record the fact that we're doing IO. This will + // prevent CloseHandle() from returning until our IO completes or it aborts + // our IO. + ++pending_io_count_; + lock_.Unlock(); + } + + // Because we've incremented pending_ios_, do the matching decrement when this + // object goes out of scope. + DecrementPendingIO dec(this); + if (!SetTimeout(time_out)) return false; diff --git a/host/windows/usb/winusb/adb_winusb_endpoint_object.h b/host/windows/usb/winusb/adb_winusb_endpoint_object.h index 92b6e04fe..2da7bd206 100755 --- a/host/windows/usb/winusb/adb_winusb_endpoint_object.h +++ b/host/windows/usb/winusb/adb_winusb_endpoint_object.h @@ -72,6 +72,17 @@ class AdbWinUsbEndpointObject : public AdbEndpointObject { */ virtual LONG Release(); + /** \brief This method is called when handle to this object gets closed. + + In this call object is deleted from the AdbObjectHandleMap. We override + this method in order to abort pending IOs and to prevent new IOs from + starting up. + @return true on success or false if object is already closed. If + false is returned GetLastError() provides extended error + information. + */ + virtual bool CloseHandle(); + // // Abstract overrides // @@ -150,6 +161,32 @@ class AdbWinUsbEndpointObject : public AdbEndpointObject { WINUSB_INTERFACE_HANDLE winusb_handle() const { return parent_winusb_interface()->winusb_handle(); } + + protected: + /// Helper class whose destructor decrements pending_io_count_. + class DecrementPendingIO { + public: + DecrementPendingIO(AdbWinUsbEndpointObject* endpoint) + : endpoint_(endpoint) {} + ~DecrementPendingIO() { + endpoint_->lock_.Lock(); + ATLASSERT(endpoint_->pending_io_count_ > 0); + --(endpoint_->pending_io_count_); + endpoint_->lock_.Unlock(); + } + private: + AdbWinUsbEndpointObject* endpoint_; + }; + + protected: + /// Protects is_closing_ and pending_io_count_. + CComAutoCriticalSection lock_; + + /// Once set, prevents new IOs from starting up. + bool is_closing_; + + /// Count of pending IOs potentially blocked in WinUsb APIs. + ULONG pending_io_count_; }; #endif // ANDROID_USB_API_ADB_WINUSB_ENDPOINT_OBJECT_H__ diff --git a/ndk/Android.mk b/ndk/Android.mk index 6c93761c1..c3626940f 100644 --- a/ndk/Android.mk +++ b/ndk/Android.mk @@ -1,4 +1 @@ -# Please this file empty. It is used to make the Android build system happy. - -include development/ndk/sources/android/libportable/Android.mk include development/ndk/sources/android/native_app_glue/Android.mk diff --git a/ndk/platforms/android-21/arch-arm/include/machine/endian.h b/ndk/platforms/android-21/arch-arm/include/machine/endian.h deleted file mode 100644 index f63e7b77e..000000000 --- a/ndk/platforms/android-21/arch-arm/include/machine/endian.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $OpenBSD: endian.h,v 1.3 2005/12/13 00:35:23 millert Exp $ */ - -/* - * Copyright (C) 2010 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _ARM_ENDIAN_H_ -#define _ARM_ENDIAN_H_ - -#ifdef __GNUC__ - -/* - * REV and REV16 weren't available on ARM5 or ARM4. - * We don't include because it pollutes the - * namespace with macros like PLD. - */ -#if !defined __ARM_ARCH_5__ && !defined __ARM_ARCH_5T__ && \ - !defined __ARM_ARCH_5TE__ && !defined __ARM_ARCH_5TEJ__ && \ - !defined __ARM_ARCH_4T__ && !defined __ARM_ARCH_4__ - -/* According to RealView Assembler User's Guide, REV and REV16 are available - * in Thumb code and 16-bit instructions when used in Thumb-2 code. - * - * REV Rd, Rm - * Rd and Rm must both be Lo registers. - * - * REV16 Rd, Rm - * Rd and Rm must both be Lo registers. - * - * The +l constraint takes care of this without constraining us in ARM mode. - */ -#define __swap16md(x) ({ \ - register u_int16_t _x = (x); \ - __asm__ __volatile__("rev16 %0, %0" : "+l" (_x)); \ - _x; \ -}) - -#define __swap32md(x) ({ \ - register u_int32_t _x = (x); \ - __asm__ __volatile__("rev %0, %0" : "+l" (_x)); \ - _x; \ -}) - -#define __swap64md(x) ({ \ - u_int64_t _swap64md_x = (x); \ - (u_int64_t) __swap32md(_swap64md_x >> 32) | \ - (u_int64_t) __swap32md(_swap64md_x & 0xffffffff) << 32; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __ARM_ARCH__ */ -#endif /* __GNUC__ */ - -#if defined(__ARMEB__) -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif -#define __STRICT_ALIGNMENT -#include -#include - -#endif /* !_ARM_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/arch-arm64/include/machine/endian.h b/ndk/platforms/android-21/arch-arm64/include/machine/endian.h deleted file mode 100644 index 87a038d0e..000000000 --- a/ndk/platforms/android-21/arch-arm64/include/machine/endian.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _AARCH64_ENDIAN_H_ -#define _AARCH64_ENDIAN_H_ - -#include -#include - -#ifdef __GNUC__ - -#define __swap16md(x) ({ \ - register u_int16_t _x = (x); \ - __asm volatile ("rev16 %0, %0" : "+r" (_x)); \ - _x; \ -}) - -/* Use GCC builtins */ -#define __swap32md(x) __builtin_bswap32(x) -#define __swap64md(x) __builtin_bswap64(x) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __GNUC__ */ - -#if defined(__AARCH64EB__) -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif - -#endif /* _AARCH64_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/arch-mips/include/asm/reg.h b/ndk/platforms/android-21/arch-mips/include/asm/reg.h new file mode 100644 index 000000000..c0f003ebb --- /dev/null +++ b/ndk/platforms/android-21/arch-mips/include/asm/reg.h @@ -0,0 +1,223 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ +#ifndef __UAPI_ASM_MIPS_REG_H +#define __UAPI_ASM_MIPS_REG_H +#define MIPS32_EF_R0 6 +#define MIPS32_EF_R1 7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R2 8 +#define MIPS32_EF_R3 9 +#define MIPS32_EF_R4 10 +#define MIPS32_EF_R5 11 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R6 12 +#define MIPS32_EF_R7 13 +#define MIPS32_EF_R8 14 +#define MIPS32_EF_R9 15 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R10 16 +#define MIPS32_EF_R11 17 +#define MIPS32_EF_R12 18 +#define MIPS32_EF_R13 19 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R14 20 +#define MIPS32_EF_R15 21 +#define MIPS32_EF_R16 22 +#define MIPS32_EF_R17 23 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R18 24 +#define MIPS32_EF_R19 25 +#define MIPS32_EF_R20 26 +#define MIPS32_EF_R21 27 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R22 28 +#define MIPS32_EF_R23 29 +#define MIPS32_EF_R24 30 +#define MIPS32_EF_R25 31 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R26 32 +#define MIPS32_EF_R27 33 +#define MIPS32_EF_R28 34 +#define MIPS32_EF_R29 35 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R30 36 +#define MIPS32_EF_R31 37 +#define MIPS32_EF_LO 38 +#define MIPS32_EF_HI 39 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_CP0_EPC 40 +#define MIPS32_EF_CP0_BADVADDR 41 +#define MIPS32_EF_CP0_STATUS 42 +#define MIPS32_EF_CP0_CAUSE 43 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_UNUSED0 44 +#define MIPS32_EF_SIZE 180 +#define MIPS64_EF_R0 0 +#define MIPS64_EF_R1 1 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R2 2 +#define MIPS64_EF_R3 3 +#define MIPS64_EF_R4 4 +#define MIPS64_EF_R5 5 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R6 6 +#define MIPS64_EF_R7 7 +#define MIPS64_EF_R8 8 +#define MIPS64_EF_R9 9 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R10 10 +#define MIPS64_EF_R11 11 +#define MIPS64_EF_R12 12 +#define MIPS64_EF_R13 13 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R14 14 +#define MIPS64_EF_R15 15 +#define MIPS64_EF_R16 16 +#define MIPS64_EF_R17 17 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R18 18 +#define MIPS64_EF_R19 19 +#define MIPS64_EF_R20 20 +#define MIPS64_EF_R21 21 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R22 22 +#define MIPS64_EF_R23 23 +#define MIPS64_EF_R24 24 +#define MIPS64_EF_R25 25 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R26 26 +#define MIPS64_EF_R27 27 +#define MIPS64_EF_R28 28 +#define MIPS64_EF_R29 29 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R30 30 +#define MIPS64_EF_R31 31 +#define MIPS64_EF_LO 32 +#define MIPS64_EF_HI 33 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_CP0_EPC 34 +#define MIPS64_EF_CP0_BADVADDR 35 +#define MIPS64_EF_CP0_STATUS 36 +#define MIPS64_EF_CP0_CAUSE 37 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_SIZE 304 +#if _MIPS_SIM == _MIPS_SIM_ABI32 +#define EF_R0 MIPS32_EF_R0 +#define EF_R1 MIPS32_EF_R1 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R2 MIPS32_EF_R2 +#define EF_R3 MIPS32_EF_R3 +#define EF_R4 MIPS32_EF_R4 +#define EF_R5 MIPS32_EF_R5 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R6 MIPS32_EF_R6 +#define EF_R7 MIPS32_EF_R7 +#define EF_R8 MIPS32_EF_R8 +#define EF_R9 MIPS32_EF_R9 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R10 MIPS32_EF_R10 +#define EF_R11 MIPS32_EF_R11 +#define EF_R12 MIPS32_EF_R12 +#define EF_R13 MIPS32_EF_R13 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R14 MIPS32_EF_R14 +#define EF_R15 MIPS32_EF_R15 +#define EF_R16 MIPS32_EF_R16 +#define EF_R17 MIPS32_EF_R17 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R18 MIPS32_EF_R18 +#define EF_R19 MIPS32_EF_R19 +#define EF_R20 MIPS32_EF_R20 +#define EF_R21 MIPS32_EF_R21 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R22 MIPS32_EF_R22 +#define EF_R23 MIPS32_EF_R23 +#define EF_R24 MIPS32_EF_R24 +#define EF_R25 MIPS32_EF_R25 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R26 MIPS32_EF_R26 +#define EF_R27 MIPS32_EF_R27 +#define EF_R28 MIPS32_EF_R28 +#define EF_R29 MIPS32_EF_R29 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R30 MIPS32_EF_R30 +#define EF_R31 MIPS32_EF_R31 +#define EF_LO MIPS32_EF_LO +#define EF_HI MIPS32_EF_HI +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_CP0_EPC MIPS32_EF_CP0_EPC +#define EF_CP0_BADVADDR MIPS32_EF_CP0_BADVADDR +#define EF_CP0_STATUS MIPS32_EF_CP0_STATUS +#define EF_CP0_CAUSE MIPS32_EF_CP0_CAUSE +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_UNUSED0 MIPS32_EF_UNUSED0 +#define EF_SIZE MIPS32_EF_SIZE +#elif _MIPS_SIM==_MIPS_SIM_ABI64||_MIPS_SIM==_MIPS_SIM_NABI32 +#define EF_R0 MIPS64_EF_R0 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R1 MIPS64_EF_R1 +#define EF_R2 MIPS64_EF_R2 +#define EF_R3 MIPS64_EF_R3 +#define EF_R4 MIPS64_EF_R4 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R5 MIPS64_EF_R5 +#define EF_R6 MIPS64_EF_R6 +#define EF_R7 MIPS64_EF_R7 +#define EF_R8 MIPS64_EF_R8 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R9 MIPS64_EF_R9 +#define EF_R10 MIPS64_EF_R10 +#define EF_R11 MIPS64_EF_R11 +#define EF_R12 MIPS64_EF_R12 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R13 MIPS64_EF_R13 +#define EF_R14 MIPS64_EF_R14 +#define EF_R15 MIPS64_EF_R15 +#define EF_R16 MIPS64_EF_R16 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R17 MIPS64_EF_R17 +#define EF_R18 MIPS64_EF_R18 +#define EF_R19 MIPS64_EF_R19 +#define EF_R20 MIPS64_EF_R20 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R21 MIPS64_EF_R21 +#define EF_R22 MIPS64_EF_R22 +#define EF_R23 MIPS64_EF_R23 +#define EF_R24 MIPS64_EF_R24 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R25 MIPS64_EF_R25 +#define EF_R26 MIPS64_EF_R26 +#define EF_R27 MIPS64_EF_R27 +#define EF_R28 MIPS64_EF_R28 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R29 MIPS64_EF_R29 +#define EF_R30 MIPS64_EF_R30 +#define EF_R31 MIPS64_EF_R31 +#define EF_LO MIPS64_EF_LO +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_HI MIPS64_EF_HI +#define EF_CP0_EPC MIPS64_EF_CP0_EPC +#define EF_CP0_BADVADDR MIPS64_EF_CP0_BADVADDR +#define EF_CP0_STATUS MIPS64_EF_CP0_STATUS +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_CP0_CAUSE MIPS64_EF_CP0_CAUSE +#define EF_SIZE MIPS64_EF_SIZE +#endif +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ diff --git a/ndk/platforms/android-21/arch-mips/include/machine/elf_machdep.h b/ndk/platforms/android-21/arch-mips/include/machine/elf_machdep.h index d27d43183..339cf20e3 100644 --- a/ndk/platforms/android-21/arch-mips/include/machine/elf_machdep.h +++ b/ndk/platforms/android-21/arch-mips/include/machine/elf_machdep.h @@ -121,6 +121,8 @@ #define DT_MIPS_GOTSYM 0x70000013 /* first dynamic sym in got */ #define DT_MIPS_HIPAGENO 0x70000014 #define DT_MIPS_RLD_MAP 0x70000016 /* address of loader map */ +#define DT_MIPS_RLD_MAP2 0x70000035 /* Address of run time loader map, used for debugging. */ + /* * ELF Flags diff --git a/ndk/platforms/android-21/arch-mips/include/machine/endian.h b/ndk/platforms/android-21/arch-mips/include/machine/endian.h deleted file mode 100644 index 41a9004f4..000000000 --- a/ndk/platforms/android-21/arch-mips/include/machine/endian.h +++ /dev/null @@ -1,70 +0,0 @@ -/* $OpenBSD: endian.h,v 1.5 2006/02/27 23:35:59 miod Exp $ */ - -/* - * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef _MIPS64_ENDIAN_H_ -#define _MIPS64_ENDIAN_H_ - -#ifdef __GNUC__ - -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) -#define __swap16md(x) ({ \ - register uint16_t _x = (x); \ - register uint16_t _r; \ - __asm volatile ("wsbh %0, %1" : "=r" (_r) : "r" (_x)); \ - _r; \ -}) - -#define __swap32md(x) ({ \ - register uint32_t _x = (x); \ - register uint32_t _r; \ - __asm volatile ("wsbh %0, %1; rotr %0, %0, 16" : "=r" (_r) : "r" (_x)); \ - _r; \ -}) - -#define __swap64md(x) ({ \ - uint64_t _swap64md_x = (x); \ - (uint64_t) __swap32md(_swap64md_x >> 32) | \ - (uint64_t) __swap32md(_swap64md_x & 0xffffffff) << 32; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __mips32r2__ */ -#endif /* __GNUC__ */ - -#if defined(__MIPSEB__) -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif -#define __STRICT_ALIGNMENT -#include -#include - -#endif /* _MIPS64_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/arch-mips/include/machine/exec.h b/ndk/platforms/android-21/arch-mips/include/machine/exec.h index 3c63f7435..88f82f4ad 100644 --- a/ndk/platforms/android-21/arch-mips/include/machine/exec.h +++ b/ndk/platforms/android-21/arch-mips/include/machine/exec.h @@ -91,6 +91,7 @@ #define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in .dynsym */ #define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ #define DT_MIPS_RLD_MAP 0x70000016 /* Address of debug map pointer */ +#define DT_MIPS_RLD_MAP2 0x70000035 /* Address of run time loader map, used for debugging. */ #define DT_PROCNUM (DT_MIPS_RLD_MAP - DT_LOPROC + 1) diff --git a/ndk/platforms/android-21/arch-mips/libr2 b/ndk/platforms/android-21/arch-mips/libr2 new file mode 120000 index 000000000..7951405f8 --- /dev/null +++ b/ndk/platforms/android-21/arch-mips/libr2 @@ -0,0 +1 @@ +lib \ No newline at end of file diff --git a/ndk/platforms/android-21/arch-mips/libr6 b/ndk/platforms/android-21/arch-mips/libr6 new file mode 120000 index 000000000..22de3c971 --- /dev/null +++ b/ndk/platforms/android-21/arch-mips/libr6 @@ -0,0 +1 @@ +../arch-mips64/libr6 \ No newline at end of file diff --git a/ndk/platforms/android-21/arch-mips64/include/asm/reg.h b/ndk/platforms/android-21/arch-mips64/include/asm/reg.h new file mode 100644 index 000000000..c0f003ebb --- /dev/null +++ b/ndk/platforms/android-21/arch-mips64/include/asm/reg.h @@ -0,0 +1,223 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ +#ifndef __UAPI_ASM_MIPS_REG_H +#define __UAPI_ASM_MIPS_REG_H +#define MIPS32_EF_R0 6 +#define MIPS32_EF_R1 7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R2 8 +#define MIPS32_EF_R3 9 +#define MIPS32_EF_R4 10 +#define MIPS32_EF_R5 11 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R6 12 +#define MIPS32_EF_R7 13 +#define MIPS32_EF_R8 14 +#define MIPS32_EF_R9 15 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R10 16 +#define MIPS32_EF_R11 17 +#define MIPS32_EF_R12 18 +#define MIPS32_EF_R13 19 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R14 20 +#define MIPS32_EF_R15 21 +#define MIPS32_EF_R16 22 +#define MIPS32_EF_R17 23 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R18 24 +#define MIPS32_EF_R19 25 +#define MIPS32_EF_R20 26 +#define MIPS32_EF_R21 27 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R22 28 +#define MIPS32_EF_R23 29 +#define MIPS32_EF_R24 30 +#define MIPS32_EF_R25 31 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R26 32 +#define MIPS32_EF_R27 33 +#define MIPS32_EF_R28 34 +#define MIPS32_EF_R29 35 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_R30 36 +#define MIPS32_EF_R31 37 +#define MIPS32_EF_LO 38 +#define MIPS32_EF_HI 39 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_CP0_EPC 40 +#define MIPS32_EF_CP0_BADVADDR 41 +#define MIPS32_EF_CP0_STATUS 42 +#define MIPS32_EF_CP0_CAUSE 43 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS32_EF_UNUSED0 44 +#define MIPS32_EF_SIZE 180 +#define MIPS64_EF_R0 0 +#define MIPS64_EF_R1 1 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R2 2 +#define MIPS64_EF_R3 3 +#define MIPS64_EF_R4 4 +#define MIPS64_EF_R5 5 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R6 6 +#define MIPS64_EF_R7 7 +#define MIPS64_EF_R8 8 +#define MIPS64_EF_R9 9 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R10 10 +#define MIPS64_EF_R11 11 +#define MIPS64_EF_R12 12 +#define MIPS64_EF_R13 13 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R14 14 +#define MIPS64_EF_R15 15 +#define MIPS64_EF_R16 16 +#define MIPS64_EF_R17 17 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R18 18 +#define MIPS64_EF_R19 19 +#define MIPS64_EF_R20 20 +#define MIPS64_EF_R21 21 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R22 22 +#define MIPS64_EF_R23 23 +#define MIPS64_EF_R24 24 +#define MIPS64_EF_R25 25 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R26 26 +#define MIPS64_EF_R27 27 +#define MIPS64_EF_R28 28 +#define MIPS64_EF_R29 29 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_R30 30 +#define MIPS64_EF_R31 31 +#define MIPS64_EF_LO 32 +#define MIPS64_EF_HI 33 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_CP0_EPC 34 +#define MIPS64_EF_CP0_BADVADDR 35 +#define MIPS64_EF_CP0_STATUS 36 +#define MIPS64_EF_CP0_CAUSE 37 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define MIPS64_EF_SIZE 304 +#if _MIPS_SIM == _MIPS_SIM_ABI32 +#define EF_R0 MIPS32_EF_R0 +#define EF_R1 MIPS32_EF_R1 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R2 MIPS32_EF_R2 +#define EF_R3 MIPS32_EF_R3 +#define EF_R4 MIPS32_EF_R4 +#define EF_R5 MIPS32_EF_R5 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R6 MIPS32_EF_R6 +#define EF_R7 MIPS32_EF_R7 +#define EF_R8 MIPS32_EF_R8 +#define EF_R9 MIPS32_EF_R9 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R10 MIPS32_EF_R10 +#define EF_R11 MIPS32_EF_R11 +#define EF_R12 MIPS32_EF_R12 +#define EF_R13 MIPS32_EF_R13 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R14 MIPS32_EF_R14 +#define EF_R15 MIPS32_EF_R15 +#define EF_R16 MIPS32_EF_R16 +#define EF_R17 MIPS32_EF_R17 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R18 MIPS32_EF_R18 +#define EF_R19 MIPS32_EF_R19 +#define EF_R20 MIPS32_EF_R20 +#define EF_R21 MIPS32_EF_R21 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R22 MIPS32_EF_R22 +#define EF_R23 MIPS32_EF_R23 +#define EF_R24 MIPS32_EF_R24 +#define EF_R25 MIPS32_EF_R25 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R26 MIPS32_EF_R26 +#define EF_R27 MIPS32_EF_R27 +#define EF_R28 MIPS32_EF_R28 +#define EF_R29 MIPS32_EF_R29 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R30 MIPS32_EF_R30 +#define EF_R31 MIPS32_EF_R31 +#define EF_LO MIPS32_EF_LO +#define EF_HI MIPS32_EF_HI +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_CP0_EPC MIPS32_EF_CP0_EPC +#define EF_CP0_BADVADDR MIPS32_EF_CP0_BADVADDR +#define EF_CP0_STATUS MIPS32_EF_CP0_STATUS +#define EF_CP0_CAUSE MIPS32_EF_CP0_CAUSE +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_UNUSED0 MIPS32_EF_UNUSED0 +#define EF_SIZE MIPS32_EF_SIZE +#elif _MIPS_SIM==_MIPS_SIM_ABI64||_MIPS_SIM==_MIPS_SIM_NABI32 +#define EF_R0 MIPS64_EF_R0 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R1 MIPS64_EF_R1 +#define EF_R2 MIPS64_EF_R2 +#define EF_R3 MIPS64_EF_R3 +#define EF_R4 MIPS64_EF_R4 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R5 MIPS64_EF_R5 +#define EF_R6 MIPS64_EF_R6 +#define EF_R7 MIPS64_EF_R7 +#define EF_R8 MIPS64_EF_R8 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R9 MIPS64_EF_R9 +#define EF_R10 MIPS64_EF_R10 +#define EF_R11 MIPS64_EF_R11 +#define EF_R12 MIPS64_EF_R12 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R13 MIPS64_EF_R13 +#define EF_R14 MIPS64_EF_R14 +#define EF_R15 MIPS64_EF_R15 +#define EF_R16 MIPS64_EF_R16 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R17 MIPS64_EF_R17 +#define EF_R18 MIPS64_EF_R18 +#define EF_R19 MIPS64_EF_R19 +#define EF_R20 MIPS64_EF_R20 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R21 MIPS64_EF_R21 +#define EF_R22 MIPS64_EF_R22 +#define EF_R23 MIPS64_EF_R23 +#define EF_R24 MIPS64_EF_R24 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R25 MIPS64_EF_R25 +#define EF_R26 MIPS64_EF_R26 +#define EF_R27 MIPS64_EF_R27 +#define EF_R28 MIPS64_EF_R28 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_R29 MIPS64_EF_R29 +#define EF_R30 MIPS64_EF_R30 +#define EF_R31 MIPS64_EF_R31 +#define EF_LO MIPS64_EF_LO +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_HI MIPS64_EF_HI +#define EF_CP0_EPC MIPS64_EF_CP0_EPC +#define EF_CP0_BADVADDR MIPS64_EF_CP0_BADVADDR +#define EF_CP0_STATUS MIPS64_EF_CP0_STATUS +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EF_CP0_CAUSE MIPS64_EF_CP0_CAUSE +#define EF_SIZE MIPS64_EF_SIZE +#endif +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ diff --git a/ndk/platforms/android-21/arch-mips64/include/machine/elf_machdep.h b/ndk/platforms/android-21/arch-mips64/include/machine/elf_machdep.h index d27d43183..26fd1f123 100644 --- a/ndk/platforms/android-21/arch-mips64/include/machine/elf_machdep.h +++ b/ndk/platforms/android-21/arch-mips64/include/machine/elf_machdep.h @@ -121,6 +121,7 @@ #define DT_MIPS_GOTSYM 0x70000013 /* first dynamic sym in got */ #define DT_MIPS_HIPAGENO 0x70000014 #define DT_MIPS_RLD_MAP 0x70000016 /* address of loader map */ +#define DT_MIPS_RLD_MAP2 0x70000035 /* Address of run time loader map, used for debugging. */ /* * ELF Flags diff --git a/ndk/platforms/android-21/arch-mips64/include/machine/endian.h b/ndk/platforms/android-21/arch-mips64/include/machine/endian.h deleted file mode 100644 index 41a9004f4..000000000 --- a/ndk/platforms/android-21/arch-mips64/include/machine/endian.h +++ /dev/null @@ -1,70 +0,0 @@ -/* $OpenBSD: endian.h,v 1.5 2006/02/27 23:35:59 miod Exp $ */ - -/* - * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef _MIPS64_ENDIAN_H_ -#define _MIPS64_ENDIAN_H_ - -#ifdef __GNUC__ - -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) -#define __swap16md(x) ({ \ - register uint16_t _x = (x); \ - register uint16_t _r; \ - __asm volatile ("wsbh %0, %1" : "=r" (_r) : "r" (_x)); \ - _r; \ -}) - -#define __swap32md(x) ({ \ - register uint32_t _x = (x); \ - register uint32_t _r; \ - __asm volatile ("wsbh %0, %1; rotr %0, %0, 16" : "=r" (_r) : "r" (_x)); \ - _r; \ -}) - -#define __swap64md(x) ({ \ - uint64_t _swap64md_x = (x); \ - (uint64_t) __swap32md(_swap64md_x >> 32) | \ - (uint64_t) __swap32md(_swap64md_x & 0xffffffff) << 32; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __mips32r2__ */ -#endif /* __GNUC__ */ - -#if defined(__MIPSEB__) -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif -#define __STRICT_ALIGNMENT -#include -#include - -#endif /* _MIPS64_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/arch-mips64/include/machine/exec.h b/ndk/platforms/android-21/arch-mips64/include/machine/exec.h index 3c63f7435..88f82f4ad 100644 --- a/ndk/platforms/android-21/arch-mips64/include/machine/exec.h +++ b/ndk/platforms/android-21/arch-mips64/include/machine/exec.h @@ -91,6 +91,7 @@ #define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in .dynsym */ #define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ #define DT_MIPS_RLD_MAP 0x70000016 /* Address of debug map pointer */ +#define DT_MIPS_RLD_MAP2 0x70000035 /* Address of run time loader map, used for debugging. */ #define DT_PROCNUM (DT_MIPS_RLD_MAP - DT_LOPROC + 1) diff --git a/ndk/platforms/android-3/header-patches/include/machine/setjmp.h b/ndk/platforms/android-21/arch-mips64/src/asm_multiarch.h similarity index 81% rename from ndk/platforms/android-3/header-patches/include/machine/setjmp.h rename to ndk/platforms/android-21/arch-mips64/src/asm_multiarch.h index ff58ef1ad..91cb8af4b 100644 --- a/ndk/platforms/android-3/header-patches/include/machine/setjmp.h +++ b/ndk/platforms/android-21/arch-mips64/src/asm_multiarch.h @@ -26,14 +26,11 @@ * SUCH DAMAGE. */ -/* - * machine/setjmp.h: machine dependent setjmp-related information. - */ +#ifdef __LP64__ +# define ASM_PTR_SIZE(x) .quad x +# define ASM_ALIGN_TO_PTR_SIZE .balign 8 +#else +# define ASM_PTR_SIZE(x) .long x +# define ASM_ALIGN_TO_PTR_SIZE .balign 4 +#endif -/* _JBLEN is the size of a jmp_buf in longs. - * Do not modify this value or you will break the ABI ! - * - * This value comes from the mips machine/setjmp.h header - * because it has the biggest jump buffer length. - */ -#define _JBLEN 1024 /* 157 */ diff --git a/ndk/platforms/android-21/arch-mips64/src/crtend_android.S b/ndk/platforms/android-21/arch-mips64/src/crtend_android.S index 8a3cc6c85..c7bab47f3 100644 --- a/ndk/platforms/android-21/arch-mips64/src/crtend_android.S +++ b/ndk/platforms/android-21/arch-mips64/src/crtend_android.S @@ -25,25 +25,30 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - + +#include "asm_multiarch.h" + .section .preinit_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .init_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .fini_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .ctors, "aw" .type __CTOR_END__, @object __CTOR_END__: - .long 0 + ASM_PTR_SIZE(0) .section .dtors, "aw" .type __DTOR_END__, @object __DTOR_END__: - .long 0 + ASM_PTR_SIZE(0) .section .eh_frame,"a",@progbits .align 4 diff --git a/ndk/platforms/android-21/arch-mips64/src/crtend_so.S b/ndk/platforms/android-21/arch-mips64/src/crtend_so.S index f09c42708..490af3ccc 100644 --- a/ndk/platforms/android-21/arch-mips64/src/crtend_so.S +++ b/ndk/platforms/android-21/arch-mips64/src/crtend_so.S @@ -1,5 +1,9 @@ +#include "asm_multiarch.h" + .section .init_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .fini_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) diff --git a/ndk/platforms/android-21/arch-p/include/asm/auxvec.h b/ndk/platforms/android-21/arch-p/include/asm/auxvec.h deleted file mode 100644 index 2fa0e6b18..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/auxvec.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/bitsperlong.h b/ndk/platforms/android-21/arch-p/include/asm/bitsperlong.h deleted file mode 100644 index f7d5d7729..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/bitsperlong.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifdef __LP64__ -#define __BITS_PER_LONG 64 -#else -#define __BITS_PER_LONG 32 -#endif -#include - diff --git a/ndk/platforms/android-21/arch-p/include/asm/byteorder.h b/ndk/platforms/android-21/arch-p/include/asm/byteorder.h deleted file mode 100644 index 6f17a48ea..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/byteorder.h +++ /dev/null @@ -1,23 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef __ASM_ARM_BYTEORDER_H -#define __ASM_ARM_BYTEORDER_H -#include -#endif -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ diff --git a/ndk/platforms/android-21/arch-p/include/asm/errno.h b/ndk/platforms/android-21/arch-p/include/asm/errno.h deleted file mode 100644 index 392cd94bf..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/errno.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/fcntl.h b/ndk/platforms/android-21/arch-p/include/asm/fcntl.h deleted file mode 100644 index cb5399eea..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/fcntl.h +++ /dev/null @@ -1,28 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef _TARGET_FCNTL_H -#define _TARGET_FCNTL_H - -#define O_DIRECTORY 040000 // TODO: x86, mips family needs to be fixed -#define O_NOFOLLOW 0100000 -#define O_DIRECT 0200000 -#define O_LARGEFILE 0400000 -#include - -#endif diff --git a/ndk/platforms/android-21/arch-p/include/asm/ioctl.h b/ndk/platforms/android-21/arch-p/include/asm/ioctl.h deleted file mode 100644 index 7b7bd3779..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/ioctl.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/ioctls.h b/ndk/platforms/android-21/arch-p/include/asm/ioctls.h deleted file mode 100644 index f3381f8c3..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/ioctls.h +++ /dev/null @@ -1,23 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef __ASM_TARGET_IOCTLS_H -#define __ASM_TARGET_IOCTLS_H -#define FIOQSIZE 0x545E -#include -#endif diff --git a/ndk/platforms/android-21/arch-p/include/asm/ipcbuf.h b/ndk/platforms/android-21/arch-p/include/asm/ipcbuf.h deleted file mode 100644 index 0021f1438..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/ipcbuf.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/mman.h b/ndk/platforms/android-21/arch-p/include/asm/mman.h deleted file mode 100644 index 6c23fb647..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/mman.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/msgbuf.h b/ndk/platforms/android-21/arch-p/include/asm/msgbuf.h deleted file mode 100644 index 7809e3cea..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/msgbuf.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/param.h b/ndk/platforms/android-21/arch-p/include/asm/param.h deleted file mode 100644 index 5ccf935cc..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/param.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/poll.h b/ndk/platforms/android-21/arch-p/include/asm/poll.h deleted file mode 100644 index d7e8adca9..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/poll.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/posix_types.h b/ndk/platforms/android-21/arch-p/include/asm/posix_types.h deleted file mode 100644 index b0bebdbe7..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/posix_types.h +++ /dev/null @@ -1,22 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef __ARCH_ARM_POSIX_TYPES_H -#define __ARCH_ARM_POSIX_TYPES_H -#include -#endif diff --git a/ndk/platforms/android-21/arch-p/include/asm/resource.h b/ndk/platforms/android-21/arch-p/include/asm/resource.h deleted file mode 100644 index 371adb52f..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/resource.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/sembuf.h b/ndk/platforms/android-21/arch-p/include/asm/sembuf.h deleted file mode 100644 index 6ce6549b0..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/sembuf.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/shmbuf.h b/ndk/platforms/android-21/arch-p/include/asm/shmbuf.h deleted file mode 100644 index fe8b1bea0..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/shmbuf.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/sigcontext.h b/ndk/platforms/android-21/arch-p/include/asm/sigcontext.h deleted file mode 100644 index b671110f8..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/sigcontext.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include <_FORBIDDEN_HEADER.h> diff --git a/ndk/platforms/android-21/arch-p/include/asm/siginfo.h b/ndk/platforms/android-21/arch-p/include/asm/siginfo.h deleted file mode 100644 index eb212a0b1..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/siginfo.h +++ /dev/null @@ -1,23 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef __ASM_SIGINFO_H -#define __ASM_SIGINFO_H -#include -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ -#endif diff --git a/ndk/platforms/android-21/arch-p/include/asm/signal.h b/ndk/platforms/android-21/arch-p/include/asm/signal.h deleted file mode 100644 index c436b6f96..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/signal.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef __ASM_SIGNAL_H -#define __ASM_SIGNAL_H - -#ifdef __LP64__ - -#include - -#else // ! __LP64__ - -#include -#include -#include -struct siginfo; -#define _KERNEL_NSIG 32 -typedef unsigned long sigset_t; -#define SIGHUP 1 -#define SIGINT 2 -#define SIGQUIT 3 -#define SIGILL 4 -#define SIGTRAP 5 -#define SIGABRT 6 -#define SIGIOT 6 -#define SIGBUS 7 -#define SIGFPE 8 -#define SIGKILL 9 -#define SIGUSR1 10 -#define SIGSEGV 11 -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -#define SIGTERM 15 -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -#define SIGTTIN 21 -#define SIGTTOU 22 -#define SIGURG 23 -#define SIGXCPU 24 -#define SIGXFSZ 25 -#define SIGVTALRM 26 -#define SIGPROF 27 -#define SIGWINCH 28 -#define SIGIO 29 -#define SIGPOLL SIGIO -#define SIGPWR 30 -#define SIGSYS 31 -#define SIGUNUSED 31 -#define __SIGRTMIN 32 -#define __SIGRTMAX _KERNEL__NSIG -#define SA_NOCLDSTOP 0x00000001u -#define SA_NOCLDWAIT 0x00000002u -#define SA_SIGINFO 0x00000004u -#define SA_ONSTACK 0x08000000u -#define SA_RESTART 0x10000000u -#define SA_NODEFER 0x40000000u -#define SA_RESETHAND 0x80000000u -#define SA_NOMASK SA_NODEFER -#define SA_ONESHOT SA_RESETHAND -#define SA_RESTORER 0x04000000 -#define MINSIGSTKSZ 2048 -#define SIGSTKSZ 8192 -#include - -struct sigaction { - union { - __sighandler_t _sa_handler; - void (*_sa_sigaction)(int, struct siginfo *, void *); - } _u; - sigset_t sa_mask; - unsigned long sa_flags; - void (*sa_restorer)(void); -}; -#define sa_handler _u._sa_handler -#define sa_sigaction _u._sa_sigaction - -typedef struct sigaltstack { - void __user *ss_sp; - int ss_flags; - size_t ss_size; -} stack_t; - -#endif // __LP64__ - -#endif diff --git a/ndk/platforms/android-21/arch-p/include/asm/socket.h b/ndk/platforms/android-21/arch-p/include/asm/socket.h deleted file mode 100644 index 50a9874cc..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/socket.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/sockios.h b/ndk/platforms/android-21/arch-p/include/asm/sockios.h deleted file mode 100644 index 710db92bb..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/sockios.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/stat.h b/ndk/platforms/android-21/arch-p/include/asm/stat.h deleted file mode 100644 index af7ebfcbf..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/stat.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/statfs.h b/ndk/platforms/android-21/arch-p/include/asm/statfs.h deleted file mode 100644 index 18ee8de74..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/statfs.h +++ /dev/null @@ -1,23 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef __ASM_STATFS_H -#define __ASM_STATFS_H -#include -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ -#endif diff --git a/ndk/platforms/android-21/arch-p/include/asm/termbits.h b/ndk/platforms/android-21/arch-p/include/asm/termbits.h deleted file mode 100644 index 42af6fe24..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/termbits.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/termios.h b/ndk/platforms/android-21/arch-p/include/asm/termios.h deleted file mode 100644 index feca4c60e..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/termios.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/types.h b/ndk/platforms/android-21/arch-p/include/asm/types.h deleted file mode 100644 index 8250f4345..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/types.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/asm/unistd.h b/ndk/platforms/android-21/arch-p/include/asm/unistd.h deleted file mode 100644 index 697186ae4..000000000 --- a/ndk/platforms/android-21/arch-p/include/asm/unistd.h +++ /dev/null @@ -1,19 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#include diff --git a/ndk/platforms/android-21/arch-p/include/linux/eventpoll.h b/ndk/platforms/android-21/arch-p/include/linux/eventpoll.h deleted file mode 100644 index b671110f8..000000000 --- a/ndk/platforms/android-21/arch-p/include/linux/eventpoll.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include <_FORBIDDEN_HEADER.h> diff --git a/ndk/platforms/android-21/arch-p/include/machine/elf_machdep.h b/ndk/platforms/android-21/arch-p/include/machine/elf_machdep.h deleted file mode 100644 index b671110f8..000000000 --- a/ndk/platforms/android-21/arch-p/include/machine/elf_machdep.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include <_FORBIDDEN_HEADER.h> diff --git a/ndk/platforms/android-21/arch-p/include/machine/fenv.h b/ndk/platforms/android-21/arch-p/include/machine/fenv.h deleted file mode 100644 index 06fb4a1c9..000000000 --- a/ndk/platforms/android-21/arch-p/include/machine/fenv.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2014, 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 _MACHINE_FENV_H_ -#define _MACHINE_FENV_H_ - -#include - -typedef struct { - unsigned char a[128]; -} fenv_t; -typedef __uint32_t fexcept_t; - -/* Exception flags. */ -#define FE_INVALID 0x01 -#define FE_DIVBYZERO 0x02 -#define FE_OVERFLOW 0x04 -#define FE_UNDERFLOW 0x08 -#define FE_INEXACT 0x10 -#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID |\ - FE_OVERFLOW | FE_UNDERFLOW) - -/* Rounding modes. */ -#define FE_TONEAREST 0x0 -#define FE_UPWARD 0x1 -#define FE_DOWNWARD 0x2 -#define FE_TOWARDZERO 0x3 - -#endif /* _MACHINE_FENV_H_ */ diff --git a/ndk/platforms/android-21/arch-p/include/sys/epoll.h b/ndk/platforms/android-21/arch-p/include/sys/epoll.h deleted file mode 100644 index c85440e65..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/epoll.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _SYS_EPOLL_H_ -#define _SYS_EPOLL_H_ - -#include -#include -#include /* For O_CLOEXEC. */ -#include /* For sigset_t. */ - -__BEGIN_DECLS - -#define EPOLLIN 0x00000001 -#define EPOLLPRI 0x00000002 -#define EPOLLOUT 0x00000004 -#define EPOLLERR 0x00000008 -#define EPOLLHUP 0x00000010 -#define EPOLLRDNORM 0x00000040 -#define EPOLLRDBAND 0x00000080 -#define EPOLLWRNORM 0x00000100 -#define EPOLLWRBAND 0x00000200 -#define EPOLLMSG 0x00000400 -#define EPOLLRDHUP 0x00002000 -#define EPOLLWAKEUP 0x20000000 -#define EPOLLONESHOT 0x40000000 -#define EPOLLET 0x80000000 - -#define EPOLL_CTL_ADD 1 -#define EPOLL_CTL_DEL 2 -#define EPOLL_CTL_MOD 3 - -#define EPOLL_CLOEXEC O_CLOEXEC - -typedef union epoll_data { - void* ptr; - int fd; - uint32_t u32; - uint64_t u64; -} epoll_data_t; - -struct epoll_event { - uint32_t events; - unsigned char __padding[4]; - epoll_data_t data; -}; - -int epoll_create(int); -int epoll_create1(int); -int epoll_ctl(int, int, int, struct epoll_event*); -int epoll_wait(int, struct epoll_event*, int, int); -int epoll_pwait(int, struct epoll_event*, int, int, const sigset_t*); - -__END_DECLS - -#endif /* _SYS_EPOLL_H_ */ diff --git a/ndk/platforms/android-21/arch-p/include/sys/glibc-syscalls.h b/ndk/platforms/android-21/arch-p/include/sys/glibc-syscalls.h deleted file mode 100644 index b671110f8..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/glibc-syscalls.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include <_FORBIDDEN_HEADER.h> diff --git a/ndk/platforms/android-21/arch-p/include/sys/ioctl_compat.h b/ndk/platforms/android-21/arch-p/include/sys/ioctl_compat.h deleted file mode 100644 index 5c6b3f873..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/ioctl_compat.h +++ /dev/null @@ -1,174 +0,0 @@ -/* $NetBSD: ioctl_compat.h,v 1.15 2005/12/03 17:10:46 christos Exp $ */ - -/* - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)ioctl_compat.h 8.4 (Berkeley) 1/21/94 - */ - -#ifndef _SYS_IOCTL_COMPAT_H_ -#define _SYS_IOCTL_COMPAT_H_ - -/*#include */ -/*#include */ - -//#if !defined(__mips__) -struct tchars { - char t_intrc; /* interrupt */ - char t_quitc; /* quit */ - char t_startc; /* start output */ - char t_stopc; /* stop output */ - char t_eofc; /* end-of-file */ - char t_brkc; /* input delimiter (like nl) */ -}; - -struct ltchars { - char t_suspc; /* stop process signal */ - char t_dsuspc; /* delayed stop process signal */ - char t_rprntc; /* reprint line */ - char t_flushc; /* flush output (toggles) */ - char t_werasc; /* word erase */ - char t_lnextc; /* literal next character */ -}; - -/* - * Structure for TIOCGETP and TIOCSETP ioctls. - */ -#ifndef _SGTTYB_ -#define _SGTTYB_ -struct sgttyb { - char sg_ispeed; /* input speed */ - char sg_ospeed; /* output speed */ - char sg_erase; /* erase character */ - char sg_kill; /* kill character */ - short sg_flags; /* mode flags */ -}; -#endif -//#endif - -#ifdef USE_OLD_TTY -# undef TIOCGETD -# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ -# undef TIOCSETD -# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ -#else -# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ -# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ -#endif -#define TIOCHPCL _IO('t', 2) /* hang up on last close */ -//#if !defined(__mips__) -#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ -#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ -#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ -//#endif -#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ -#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ -#if 0 -/* BUG: a bunch of these conflict with #defines in asm/termbits.h */ -#define TANDEM 0x00000001 /* send stopc on out q full */ -#define CBREAK 0x00000002 /* half-cooked mode */ -#define LCASE 0x00000004 /* simulate lower case */ -#define ECHO 0x00000008 /* enable echoing */ -#define CRMOD 0x00000010 /* map \r to \r\n on output */ -#define RAW 0x00000020 /* no i/o processing */ -#define ODDP 0x00000040 /* get/send odd parity */ -#define EVENP 0x00000080 /* get/send even parity */ -#define ANYP 0x000000c0 /* get any parity/send none */ -#define NLDELAY 0x00000300 /* \n delay */ -#define NL0 0x00000000 -#define NL1 0x00000100 /* tty 37 */ -#define NL2 0x00000200 /* vt05 */ -#define NL3 0x00000300 -#define TBDELAY 0x00000c00 /* horizontal tab delay */ -#define TAB0 0x00000000 -#define TAB1 0x00000400 /* tty 37 */ -#define TAB2 0x00000800 -#define XTABS 0x00000c00 /* expand tabs on output */ -#define CRDELAY 0x00003000 /* \r delay */ -#define CR0 0x00000000 -#define CR1 0x00001000 /* tn 300 */ -#define CR2 0x00002000 /* tty 37 */ -#define CR3 0x00003000 /* concept 100 */ -#define VTDELAY 0x00004000 /* vertical tab delay */ -#define FF0 0x00000000 -#define FF1 0x00004000 /* tty 37 */ -#define BSDELAY 0x00008000 /* \b delay */ -#define BS0 0x00000000 -#define BS1 0x00008000 -#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) -#define CRTBS 0x00010000 /* do backspacing for crt */ -#define PRTERA 0x00020000 /* \ ... / erase */ -#define CRTERA 0x00040000 /* " \b " to wipe out char */ -#define TILDE 0x00080000 /* hazeltine tilde kludge */ -#define MDMBUF 0x00100000 /* DTR/DCD hardware flow control */ -#define LITOUT 0x00200000 /* literal output */ -#define TOSTOP 0x00400000 /* stop background jobs on output */ -#define FLUSHO 0x00800000 /* output being flushed (state) */ -#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ -#define L001000 0x02000000 -#define CRTKIL 0x04000000 /* kill line with " \b " */ -#define PASS8 0x08000000 -#define CTLECH 0x10000000 /* echo control chars as ^X */ -#define PENDIN 0x20000000 /* re-echo input buffer at next read */ -#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ -#define NOFLSH 0x80000000 /* don't flush output on signal */ -#endif -#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ -#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ -#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ -#define TIOCLGET _IOR('t', 124, int) /* get local modes */ -#define LCRTBS (CRTBS>>16) -#define LPRTERA (PRTERA>>16) -#define LCRTERA (CRTERA>>16) -#define LTILDE (TILDE>>16) -#define LMDMBUF (MDMBUF>>16) -#define LLITOUT (LITOUT>>16) -#define LTOSTOP (TOSTOP>>16) -#define LFLUSHO (FLUSHO>>16) -#define LNOHANG (NOHANG>>16) -#define LCRTKIL (CRTKIL>>16) -#define LPASS8 (PASS8>>16) -#define LCTLECH (CTLECH>>16) -#define LPENDIN (PENDIN>>16) -#define LDECCTQ (DECCTQ>>16) -#define LNOFLSH (NOFLSH>>16) -//#if !defined(__mips__) -#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ -#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ -//#endif -#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ -#define OTTYDISC 0 -#define NETLDISC 1 -#define NTTYDISC 2 - -#endif /* !_SYS_IOCTL_COMPAT_H_ */ diff --git a/ndk/platforms/android-21/arch-p/include/sys/reg.h b/ndk/platforms/android-21/arch-p/include/sys/reg.h deleted file mode 100644 index b671110f8..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/reg.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include <_FORBIDDEN_HEADER.h> diff --git a/ndk/platforms/android-21/arch-p/include/sys/socket.h b/ndk/platforms/android-21/arch-p/include/sys/socket.h deleted file mode 100644 index f8f4df383..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/socket.h +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _SYS_SOCKET_H_ -#define _SYS_SOCKET_H_ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -#define sockaddr_storage __kernel_sockaddr_storage -typedef unsigned short sa_family_t; - -struct timespec; - -#ifdef __mips__ -#define SOCK_DGRAM 1 -#define SOCK_STREAM 2 -#define SOCK_RAW 3 -#define SOCK_RDM 4 -#define SOCK_SEQPACKET 5 -#define SOCK_DCCP 6 -#define SOCK_PACKET 10 -#else -#define SOCK_STREAM 1 -#define SOCK_DGRAM 2 -#define SOCK_RAW 3 -#define SOCK_RDM 4 -#define SOCK_SEQPACKET 5 -#define SOCK_PACKET 10 -#endif - -#define SOCK_CLOEXEC O_CLOEXEC -#define SOCK_NONBLOCK O_NONBLOCK - -enum { - SHUT_RD = 0, -#define SHUT_RD SHUT_RD - SHUT_WR, -#define SHUT_WR SHUT_WR - SHUT_RDWR -#define SHUT_RDWR SHUT_RDWR -}; - -struct sockaddr { - sa_family_t sa_family; - char sa_data[14]; -}; - -struct linger { - int l_onoff; - int l_linger; -}; - -struct msghdr { - void* msg_name; - socklen_t msg_namelen; - struct iovec* msg_iov; - size_t msg_iovlen; - void* msg_control; - size_t msg_controllen; - int msg_flags; -}; - -struct mmsghdr { - struct msghdr msg_hdr; - unsigned int msg_len; -}; - -struct cmsghdr { - size_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; - -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr((mhdr), (cmsg)) -#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) -#define CMSG_DATA(cmsg) ((void*)((char*)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr)))) -#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len)) -#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) -#define CMSG_FIRSTHDR(msg) \ - ((msg)->msg_controllen >= sizeof(struct cmsghdr) \ - ? (struct cmsghdr*) (msg)->msg_control : (struct cmsghdr*) NULL) -#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && (cmsg)->cmsg_len <= (unsigned long) ((mhdr)->msg_controllen - ((char*)(cmsg) - (char*)(mhdr)->msg_control))) - -struct cmsghdr* __cmsg_nxthdr(struct msghdr*, struct cmsghdr*); - -#define SCM_RIGHTS 0x01 -#define SCM_CREDENTIALS 0x02 -#define SCM_SECURITY 0x03 - -struct ucred { - pid_t pid; - uid_t uid; - gid_t gid; -}; - -#define AF_UNSPEC 0 -#define AF_UNIX 1 -#define AF_LOCAL 1 -#define AF_INET 2 -#define AF_AX25 3 -#define AF_IPX 4 -#define AF_APPLETALK 5 -#define AF_NETROM 6 -#define AF_BRIDGE 7 -#define AF_ATMPVC 8 -#define AF_X25 9 -#define AF_INET6 10 -#define AF_ROSE 11 -#define AF_DECnet 12 -#define AF_NETBEUI 13 -#define AF_SECURITY 14 -#define AF_KEY 15 -#define AF_NETLINK 16 -#define AF_ROUTE AF_NETLINK -#define AF_PACKET 17 -#define AF_ASH 18 -#define AF_ECONET 19 -#define AF_ATMSVC 20 -#define AF_RDS 21 -#define AF_SNA 22 -#define AF_IRDA 23 -#define AF_PPPOX 24 -#define AF_WANPIPE 25 -#define AF_LLC 26 -#define AF_CAN 29 -#define AF_TIPC 30 -#define AF_BLUETOOTH 31 -#define AF_IUCV 32 -#define AF_RXRPC 33 -#define AF_ISDN 34 -#define AF_PHONET 35 -#define AF_IEEE802154 36 -#define AF_CAIF 37 -#define AF_ALG 38 -#define AF_MAX 39 - -#define PF_UNSPEC AF_UNSPEC -#define PF_UNIX AF_UNIX -#define PF_LOCAL AF_LOCAL -#define PF_INET AF_INET -#define PF_AX25 AF_AX25 -#define PF_IPX AF_IPX -#define PF_APPLETALK AF_APPLETALK -#define PF_NETROM AF_NETROM -#define PF_BRIDGE AF_BRIDGE -#define PF_ATMPVC AF_ATMPVC -#define PF_X25 AF_X25 -#define PF_INET6 AF_INET6 -#define PF_ROSE AF_ROSE -#define PF_DECnet AF_DECnet -#define PF_NETBEUI AF_NETBEUI -#define PF_SECURITY AF_SECURITY -#define PF_KEY AF_KEY -#define PF_NETLINK AF_NETLINK -#define PF_ROUTE AF_ROUTE -#define PF_PACKET AF_PACKET -#define PF_ASH AF_ASH -#define PF_ECONET AF_ECONET -#define PF_ATMSVC AF_ATMSVC -#define PF_RDS AF_RDS -#define PF_SNA AF_SNA -#define PF_IRDA AF_IRDA -#define PF_PPPOX AF_PPPOX -#define PF_WANPIPE AF_WANPIPE -#define PF_LLC AF_LLC -#define PF_CAN AF_CAN -#define PF_TIPC AF_TIPC -#define PF_BLUETOOTH AF_BLUETOOTH -#define PF_IUCV AF_IUCV -#define PF_RXRPC AF_RXRPC -#define PF_ISDN AF_ISDN -#define PF_PHONET AF_PHONET -#define PF_IEEE802154 AF_IEEE802154 -#define PF_CAIF AF_CAIF -#define PF_ALG AF_ALG -#define PF_MAX AF_MAX - -#define SOMAXCONN 128 - -#define MSG_OOB 1 -#define MSG_PEEK 2 -#define MSG_DONTROUTE 4 -#define MSG_TRYHARD 4 -#define MSG_CTRUNC 8 -#define MSG_PROBE 0x10 -#define MSG_TRUNC 0x20 -#define MSG_DONTWAIT 0x40 -#define MSG_EOR 0x80 -#define MSG_WAITALL 0x100 -#define MSG_FIN 0x200 -#define MSG_SYN 0x400 -#define MSG_CONFIRM 0x800 -#define MSG_RST 0x1000 -#define MSG_ERRQUEUE 0x2000 -#define MSG_NOSIGNAL 0x4000 -#define MSG_MORE 0x8000 -#define MSG_WAITFORONE 0x10000 -#define MSG_FASTOPEN 0x20000000 -#define MSG_CMSG_CLOEXEC 0x40000000 -#define MSG_EOF MSG_FIN -#define MSG_CMSG_COMPAT 0 - -#define SOL_IP 0 -#define SOL_TCP 6 -#define SOL_UDP 17 -#define SOL_IPV6 41 -#define SOL_ICMPV6 58 -#define SOL_SCTP 132 -#define SOL_RAW 255 -#define SOL_IPX 256 -#define SOL_AX25 257 -#define SOL_ATALK 258 -#define SOL_NETROM 259 -#define SOL_ROSE 260 -#define SOL_DECNET 261 -#define SOL_X25 262 -#define SOL_PACKET 263 -#define SOL_ATM 264 -#define SOL_AAL 265 -#define SOL_IRDA 266 -#define SOL_NETBEUI 267 -#define SOL_LLC 268 -#define SOL_DCCP 269 -#define SOL_NETLINK 270 -#define SOL_TIPC 271 - -#define IPX_TYPE 1 - -# define __socketcall extern - -__socketcall int accept(int, struct sockaddr*, socklen_t*); -__socketcall int accept4(int, struct sockaddr*, socklen_t*, int); -__socketcall int bind(int, const struct sockaddr*, int); -__socketcall int connect(int, const struct sockaddr*, socklen_t); -__socketcall int getpeername(int, struct sockaddr*, socklen_t*); -__socketcall int getsockname(int, struct sockaddr*, socklen_t*); -__socketcall int getsockopt(int, int, int, void*, socklen_t*); -__socketcall int listen(int, int); -__socketcall int recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*); -__socketcall int recvmsg(int, struct msghdr*, int); -__socketcall int sendmmsg(int, const struct mmsghdr*, unsigned int, int); -__socketcall int sendmsg(int, const struct msghdr*, int); -__socketcall int setsockopt(int, int, int, const void*, socklen_t); -__socketcall int shutdown(int, int); -__socketcall int socket(int, int, int); -__socketcall int socketpair(int, int, int, int*); - -extern ssize_t send(int, const void*, size_t, int); -extern ssize_t recv(int, void*, size_t, int); - -__socketcall ssize_t sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t); -__socketcall ssize_t recvfrom(int, void*, size_t, int, const struct sockaddr*, socklen_t*); - -#if defined(__BIONIC_FORTIFY) -__errordecl(__recvfrom_error, "recvfrom called with size bigger than buffer"); -extern ssize_t __recvfrom_chk(int, void*, size_t, size_t, int, const struct sockaddr*, socklen_t*); -extern ssize_t __recvfrom_real(int, void*, size_t, int, const struct sockaddr*, socklen_t*) - __asm__(__USER_LABEL_PREFIX__ "recvfrom"); - -__BIONIC_FORTIFY_INLINE -ssize_t recvfrom(int fd, void* buf, size_t len, int flags, const struct sockaddr* src_addr, socklen_t* addr_len) { - size_t bos = __bos0(buf); - -#if !defined(__clang__) - if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) { - return __recvfrom_real(fd, buf, len, flags, src_addr, addr_len); - } - - if (__builtin_constant_p(len) && (len <= bos)) { - return __recvfrom_real(fd, buf, len, flags, src_addr, addr_len); - } - - if (__builtin_constant_p(len) && (len > bos)) { - __recvfrom_error(); - } -#endif - - return __recvfrom_chk(fd, buf, len, bos, flags, src_addr, addr_len); -} - -__BIONIC_FORTIFY_INLINE -ssize_t recv(int socket, void* buf, size_t len, int flags) { - return recvfrom(socket, buf, len, flags, NULL, 0); -} - -#endif /* __BIONIC_FORTIFY */ - -#undef __socketcall - -__END_DECLS - -#endif /* _SYS_SOCKET_H */ diff --git a/ndk/platforms/android-21/arch-p/include/sys/stat.h b/ndk/platforms/android-21/arch-p/include/sys/stat.h deleted file mode 100644 index 95ab1de99..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/stat.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#ifndef _SYS_STAT_H_ -#define _SYS_STAT_H_ - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -#define __STAT64_BODY \ - unsigned long st_dev; \ - unsigned long st_ino; \ - unsigned long st_mode; \ - unsigned long st_nlink; \ - uid_t st_uid; /* 32-bit uid_t */ \ - unsigned char padding[4]; \ - gid_t st_gid; /* 32-bit gid_t */ \ - unsigned char padding2[4]; \ - unsigned long st_rdev; \ - long st_size; \ - long st_blksize; \ - long st_blocks; \ - long st_atime; \ - unsigned long st_atime_nsec; \ - long st_mtime; \ - unsigned long st_mtime_nsec; \ - long st_ctime; \ - unsigned long st_ctime_nsec; \ - unsigned char padding3[8]; - -struct stat { __STAT64_BODY }; -struct stat64 { __STAT64_BODY }; - -#undef __STAT64_BODY - -#define st_atimensec st_atime_nsec -#define st_mtimensec st_mtime_nsec -#define st_ctimensec st_ctime_nsec - -#ifdef __USE_BSD -/* Permission macros provided by glibc for compatibility with BSDs. */ -#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* 0777 */ -#define ALLPERMS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /* 07777 */ -#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */ -#endif - -extern int chmod(const char*, mode_t); -extern int fchmod(int, mode_t); -extern int mkdir(const char*, mode_t); - -extern int fstat(int, struct stat*); -extern int fstat64(int, struct stat64*); -extern int fstatat(int, const char*, struct stat*, int); -extern int fstatat64(int, const char*, struct stat64*, int); -extern int lstat(const char*, struct stat*); -extern int lstat64(const char*, struct stat64*); -extern int stat(const char*, struct stat*); -extern int stat64(const char*, struct stat64*); - -extern int mknod(const char*, mode_t, dev_t); -extern mode_t umask(mode_t); - -#if defined(__BIONIC_FORTIFY) - -extern mode_t __umask_chk(mode_t); -extern mode_t __umask_real(mode_t) __asm__(__USER_LABEL_PREFIX__ "umask"); -__errordecl(__umask_invalid_mode, "umask called with invalid mode"); - -__BIONIC_FORTIFY_INLINE -mode_t umask(mode_t mode) { -#if !defined(__clang__) - if (__builtin_constant_p(mode)) { - if ((mode & 0777) != mode) { - __umask_invalid_mode(); - } - return __umask_real(mode); - } -#endif - return __umask_chk(mode); -} -#endif /* defined(__BIONIC_FORTIFY) */ - -extern int mkfifo(const char*, mode_t); - -extern int fchmodat(int, const char*, mode_t, int); -extern int mkdirat(int, const char*, mode_t); -extern int mknodat(int, const char*, mode_t, dev_t); - -#define UTIME_NOW ((1L << 30) - 1L) -#define UTIME_OMIT ((1L << 30) - 2L) -extern int utimensat(int fd, const char *path, const struct timespec times[2], int flags); -extern int futimens(int fd, const struct timespec times[2]); - -__END_DECLS - -#endif /* _SYS_STAT_H_ */ diff --git a/ndk/platforms/android-21/arch-p/include/sys/ucontext.h b/ndk/platforms/android-21/arch-p/include/sys/ucontext.h deleted file mode 100644 index b671110f8..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/ucontext.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include <_FORBIDDEN_HEADER.h> diff --git a/ndk/platforms/android-21/arch-p/include/sys/user.h b/ndk/platforms/android-21/arch-p/include/sys/user.h deleted file mode 100644 index b671110f8..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/user.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include <_FORBIDDEN_HEADER.h> diff --git a/ndk/platforms/android-21/arch-p/include/sys/vfs.h b/ndk/platforms/android-21/arch-p/include/sys/vfs.h deleted file mode 100644 index 194c2292a..000000000 --- a/ndk/platforms/android-21/arch-p/include/sys/vfs.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#ifndef _SYS_VFS_H_ -#define _SYS_VFS_H_ - -#include -#include -#include - -__BEGIN_DECLS - -/* The kernel's __kernel_fsid_t has a 'val' member but glibc uses '__val'. */ -typedef struct { int __val[2]; } __fsid_t; -typedef __fsid_t fsid_t; - -#define __STATFS64_BODY \ - uint64_t f_type; \ - uint64_t f_bsize; \ - uint64_t f_blocks; \ - uint64_t f_bfree; \ - uint64_t f_bavail; \ - uint64_t f_files; \ - uint64_t f_ffree; \ - fsid_t f_fsid; \ - uint64_t f_namelen; \ - uint64_t f_frsize; \ - uint64_t f_flags; \ - uint64_t f_spare[5]; - - -struct statfs { __STATFS64_BODY }; -struct statfs64 { __STATFS64_BODY }; - -#undef __STATFS64_BODY - -/* Declare that we have the f_namelen, f_frsize, and f_flags fields. */ -#define _STATFS_F_NAMELEN -#define _STATFS_F_FRSIZE -#define _STATFS_F_FLAGS - -#define ADFS_SUPER_MAGIC 0xadf5 -#define AFFS_SUPER_MAGIC 0xADFF -#define BEFS_SUPER_MAGIC 0x42465331 -#define BFS_MAGIC 0x1BADFACE -#define CIFS_MAGIC_NUMBER 0xFF534D42 -#define CODA_SUPER_MAGIC 0x73757245 -#define COH_SUPER_MAGIC 0x012FF7B7 -#define CRAMFS_MAGIC 0x28cd3d45 -#define DEVFS_SUPER_MAGIC 0x1373 -#define EFS_SUPER_MAGIC 0x00414A53 -#define EXT_SUPER_MAGIC 0x137D -#define EXT2_OLD_SUPER_MAGIC 0xEF51 -#define EXT2_SUPER_MAGIC 0xEF53 -#define EXT3_SUPER_MAGIC 0xEF53 -#define HFS_SUPER_MAGIC 0x4244 -#define HPFS_SUPER_MAGIC 0xF995E849 -#define HUGETLBFS_MAGIC 0x958458f6 -#define ISOFS_SUPER_MAGIC 0x9660 -#define JFFS2_SUPER_MAGIC 0x72b6 -#define JFS_SUPER_MAGIC 0x3153464a -#define MINIX_SUPER_MAGIC 0x137F /* orig. minix */ -#define MINIX_SUPER_MAGIC2 0x138F /* 30 char minix */ -#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 */ -#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 char names */ -#define MSDOS_SUPER_MAGIC 0x4d44 -#define NCP_SUPER_MAGIC 0x564c -#define NFS_SUPER_MAGIC 0x6969 -#define NTFS_SB_MAGIC 0x5346544e -#define OPENPROM_SUPER_MAGIC 0x9fa1 -#define PROC_SUPER_MAGIC 0x9fa0 -#define QNX4_SUPER_MAGIC 0x002f -#define REISERFS_SUPER_MAGIC 0x52654973 -#define ROMFS_MAGIC 0x7275 -#define SMB_SUPER_MAGIC 0x517B -#define SYSV2_SUPER_MAGIC 0x012FF7B6 -#define SYSV4_SUPER_MAGIC 0x012FF7B5 -#define TMPFS_MAGIC 0x01021994 -#define UDF_SUPER_MAGIC 0x15013346 -#define UFS_MAGIC 0x00011954 -#define USBDEVICE_SUPER_MAGIC 0x9fa2 -#define VXFS_SUPER_MAGIC 0xa501FCF5 -#define XENIX_SUPER_MAGIC 0x012FF7B4 -#define XFS_SUPER_MAGIC 0x58465342 -#define _XIAFS_SUPER_MAGIC 0x012FD16D - -extern int statfs(const char*, struct statfs*) __nonnull((1, 2)); -extern int statfs64(const char*, struct statfs64*) __nonnull((1, 2)); -extern int fstatfs(int, struct statfs*) __nonnull((2)); -extern int fstatfs64(int, struct statfs64*) __nonnull((2)); - -__END_DECLS - -#endif /* _SYS_VFS_H_ */ diff --git a/ndk/platforms/android-21/arch-p/symbols/libEGL.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libEGL.so.functions.txt deleted file mode 100644 index 12d92a3e0..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libEGL.so.functions.txt +++ /dev/null @@ -1,39 +0,0 @@ -eglBindAPI -eglBindTexImage -eglChooseConfig -eglCopyBuffers -eglCreateContext -eglCreateImageKHR -eglCreatePbufferFromClientBuffer -eglCreatePbufferSurface -eglCreatePixmapSurface -eglCreateWindowSurface -eglDestroyContext -eglDestroyImageKHR -eglDestroySurface -eglGetConfigAttrib -eglGetConfigs -eglGetCurrentContext -eglGetCurrentDisplay -eglGetCurrentSurface -eglGetDisplay -eglGetError -eglGetProcAddress -eglInitialize -eglLockSurfaceKHR -eglMakeCurrent -eglQueryAPI -eglQueryContext -eglQueryString -eglQuerySurface -eglReleaseTexImage -eglReleaseThread -eglSetSwapRectangleANDROID -eglSurfaceAttrib -eglSwapBuffers -eglSwapInterval -eglTerminate -eglUnlockSurfaceKHR -eglWaitClient -eglWaitGL -eglWaitNative diff --git a/ndk/platforms/android-21/arch-p/symbols/libGLESv1_CM.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libGLESv1_CM.so.functions.txt deleted file mode 100644 index af65b58ae..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libGLESv1_CM.so.functions.txt +++ /dev/null @@ -1,239 +0,0 @@ -glActiveTexture -glAlphaFunc -glAlphaFuncx -glAlphaFuncxOES -glBindBuffer -glBindFramebufferOES -glBindRenderbufferOES -glBindTexture -glBlendEquationOES -glBlendEquationSeparateOES -glBlendFunc -glBlendFuncSeparateOES -glBufferData -glBufferSubData -glCheckFramebufferStatusOES -glClear -glClearColor -glClearColorx -glClearColorxOES -glClearDepthf -glClearDepthfOES -glClearDepthx -glClearDepthxOES -glClearStencil -glClientActiveTexture -glClipPlanef -glClipPlanefOES -glClipPlanex -glClipPlanexOES -glColor4f -glColor4ub -glColor4x -glColor4xOES -glColorMask -glColorPointer -glColorPointerBounds -glCompressedTexImage2D -glCompressedTexSubImage2D -glCopyTexImage2D -glCopyTexSubImage2D -glCullFace -glCurrentPaletteMatrixOES -glDeleteBuffers -glDeleteFramebuffersOES -glDeleteRenderbuffersOES -glDeleteTextures -glDepthFunc -glDepthMask -glDepthRangef -glDepthRangefOES -glDepthRangex -glDepthRangexOES -glDisable -glDisableClientState -glDrawArrays -glDrawElements -glDrawTexfOES -glDrawTexfvOES -glDrawTexiOES -glDrawTexivOES -glDrawTexsOES -glDrawTexsvOES -glDrawTexxOES -glDrawTexxvOES -glEGLImageTargetRenderbufferStorageOES -glEGLImageTargetTexture2DOES -glEnable -glEnableClientState -glFinish -glFlush -glFogf -glFogfv -glFogx -glFogxOES -glFogxv -glFogxvOES -glFramebufferRenderbufferOES -glFramebufferTexture2DOES -glFrontFace -glFrustumf -glFrustumfOES -glFrustumx -glFrustumxOES -glGenBuffers -glGenerateMipmapOES -glGenFramebuffersOES -glGenRenderbuffersOES -glGenTextures -glGetBooleanv -glGetBufferParameteriv -glGetBufferPointervOES -glGetClipPlanef -glGetClipPlanefOES -glGetClipPlanex -glGetClipPlanexOES -glGetError -glGetFixedv -glGetFixedvOES -glGetFloatv -glGetFramebufferAttachmentParameterivOES -glGetIntegerv -glGetLightfv -glGetLightxv -glGetLightxvOES -glGetMaterialfv -glGetMaterialxv -glGetMaterialxvOES -glGetPointerv -glGetRenderbufferParameterivOES -glGetString -glGetTexEnvfv -glGetTexEnviv -glGetTexEnvxv -glGetTexEnvxvOES -glGetTexGenfvOES -glGetTexGenivOES -glGetTexGenxvOES -glGetTexParameterfv -glGetTexParameteriv -glGetTexParameterxv -glGetTexParameterxvOES -glHint -glIsBuffer -glIsEnabled -glIsFramebufferOES -glIsRenderbufferOES -glIsTexture -glLightf -glLightfv -glLightModelf -glLightModelfv -glLightModelx -glLightModelxOES -glLightModelxv -glLightModelxvOES -glLightx -glLightxOES -glLightxv -glLightxvOES -glLineWidth -glLineWidthx -glLineWidthxOES -glLoadIdentity -glLoadMatrixf -glLoadMatrixx -glLoadMatrixxOES -glLoadPaletteFromModelViewMatrixOES -glLogicOp -glMapBufferOES -glMaterialf -glMaterialfv -glMaterialx -glMaterialxOES -glMaterialxv -glMaterialxvOES -glMatrixIndexPointerOES -glMatrixMode -glMultiTexCoord4f -glMultiTexCoord4x -glMultiTexCoord4xOES -glMultMatrixf -glMultMatrixx -glMultMatrixxOES -glNormal3f -glNormal3x -glNormal3xOES -glNormalPointer -glNormalPointerBounds -glOrthof -glOrthofOES -glOrthox -glOrthoxOES -glPixelStorei -glPointParameterf -glPointParameterfv -glPointParameterx -glPointParameterxOES -glPointParameterxv -glPointParameterxvOES -glPointSize -glPointSizePointerOES -glPointSizex -glPointSizexOES -glPolygonOffset -glPolygonOffsetx -glPolygonOffsetxOES -glPopMatrix -glPushMatrix -glQueryMatrixxOES -glReadPixels -glRenderbufferStorageOES -glRotatef -glRotatex -glRotatexOES -glSampleCoverage -glSampleCoveragex -glSampleCoveragexOES -glScalef -glScalex -glScalexOES -glScissor -glShadeModel -glStencilFunc -glStencilMask -glStencilOp -glTexCoordPointer -glTexCoordPointerBounds -glTexEnvf -glTexEnvfv -glTexEnvi -glTexEnviv -glTexEnvx -glTexEnvxOES -glTexEnvxv -glTexEnvxvOES -glTexGenfOES -glTexGenfvOES -glTexGeniOES -glTexGenivOES -glTexGenxOES -glTexGenxvOES -glTexImage2D -glTexParameterf -glTexParameterfv -glTexParameteri -glTexParameteriv -glTexParameterx -glTexParameterxOES -glTexParameterxv -glTexParameterxvOES -glTexSubImage2D -glTranslatef -glTranslatex -glTranslatexOES -glUnmapBufferOES -glVertexPointer -glVertexPointerBounds -glViewport -glWeightPointerOES diff --git a/ndk/platforms/android-21/arch-p/symbols/libGLESv2.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libGLESv2.so.functions.txt deleted file mode 100644 index 8739b3d14..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libGLESv2.so.functions.txt +++ /dev/null @@ -1,177 +0,0 @@ -glActiveTexture -glAttachShader -glBeginPerfMonitorAMD -glBindAttribLocation -glBindBuffer -glBindFramebuffer -glBindRenderbuffer -glBindTexture -glBlendColor -glBlendEquation -glBlendEquationSeparate -glBlendFunc -glBlendFuncSeparate -glBufferData -glBufferSubData -glCheckFramebufferStatus -glClear -glClearColor -glClearDepthf -glClearStencil -glColorMask -glCompileShader -glCompressedTexImage2D -glCompressedTexImage3DOES -glCompressedTexSubImage2D -glCompressedTexSubImage3DOES -glCopyTexImage2D -glCopyTexSubImage2D -glCopyTexSubImage3DOES -glCreateProgram -glCreateShader -glCullFace -glDeleteBuffers -glDeleteFencesNV -glDeleteFramebuffers -glDeletePerfMonitorsAMD -glDeleteProgram -glDeleteRenderbuffers -glDeleteShader -glDeleteTextures -glDepthFunc -glDepthMask -glDepthRangef -glDetachShader -glDisable -glDisableDriverControlQCOM -glDisableVertexAttribArray -glDrawArrays -glDrawElements -glEGLImageTargetRenderbufferStorageOES -glEGLImageTargetTexture2DOES -glEnable -glEnableDriverControlQCOM -glEnableVertexAttribArray -glEndPerfMonitorAMD -glFinish -glFinishFenceNV -glFlush -glFramebufferRenderbuffer -glFramebufferTexture2D -glFramebufferTexture3DOES -glFrontFace -glGenBuffers -glGenerateMipmap -glGenFencesNV -glGenFramebuffers -glGenPerfMonitorsAMD -glGenRenderbuffers -glGenTextures -glGetActiveAttrib -glGetActiveUniform -glGetAttachedShaders -glGetAttribLocation -glGetBooleanv -glGetBufferParameteriv -glGetBufferPointervOES -glGetDriverControlsQCOM -glGetDriverControlStringQCOM -glGetError -glGetFenceivNV -glGetFloatv -glGetFramebufferAttachmentParameteriv -glGetIntegerv -glGetPerfMonitorCounterDataAMD -glGetPerfMonitorCounterInfoAMD -glGetPerfMonitorCountersAMD -glGetPerfMonitorCounterStringAMD -glGetPerfMonitorGroupsAMD -glGetPerfMonitorGroupStringAMD -glGetProgramBinaryOES -glGetProgramInfoLog -glGetProgramiv -glGetRenderbufferParameteriv -glGetShaderInfoLog -glGetShaderiv -glGetShaderPrecisionFormat -glGetShaderSource -glGetString -glGetTexParameterfv -glGetTexParameteriv -glGetUniformfv -glGetUniformiv -glGetUniformLocation -glGetVertexAttribfv -glGetVertexAttribiv -glGetVertexAttribPointerv -glHint -glIsBuffer -glIsEnabled -glIsFenceNV -glIsFramebuffer -glIsProgram -glIsRenderbuffer -glIsShader -glIsTexture -glLineWidth -glLinkProgram -glMapBufferOES -glPixelStorei -glPolygonOffset -glProgramBinaryOES -glReadPixels -glReleaseShaderCompiler -glRenderbufferStorage -glSampleCoverage -glScissor -glSelectPerfMonitorCountersAMD -glSetFenceNV -glShaderBinary -glShaderSource -glStencilFunc -glStencilFuncSeparate -glStencilMask -glStencilMaskSeparate -glStencilOp -glStencilOpSeparate -glTestFenceNV -glTexImage2D -glTexImage3DOES -glTexParameterf -glTexParameterfv -glTexParameteri -glTexParameteriv -glTexSubImage2D -glTexSubImage3DOES -glUniform1f -glUniform1fv -glUniform1i -glUniform1iv -glUniform2f -glUniform2fv -glUniform2i -glUniform2iv -glUniform3f -glUniform3fv -glUniform3i -glUniform3iv -glUniform4f -glUniform4fv -glUniform4i -glUniform4iv -glUniformMatrix2fv -glUniformMatrix3fv -glUniformMatrix4fv -glUnmapBufferOES -glUseProgram -glValidateProgram -glVertexAttrib1f -glVertexAttrib1fv -glVertexAttrib2f -glVertexAttrib2fv -glVertexAttrib3f -glVertexAttrib3fv -glVertexAttrib4f -glVertexAttrib4fv -glVertexAttribPointer -glViewport diff --git a/ndk/platforms/android-21/arch-p/symbols/libGLESv3.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libGLESv3.so.functions.txt deleted file mode 100644 index b2510e0d9..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libGLESv3.so.functions.txt +++ /dev/null @@ -1,367 +0,0 @@ -glActiveShaderProgram -glActiveTexture -glAttachShader -glBeginQuery -glBeginTransformFeedback -glBindAttribLocation -glBindBuffer -glBindBufferBase -glBindBufferRange -glBindFramebuffer -glBindImageTexture -glBindProgramPipeline -glBindRenderbuffer -glBindSampler -glBindTexture -glBindTransformFeedback -glBindVertexArray -glBindVertexArrayOES -glBindVertexBuffer -glBlendBarrierKHR -glBlendColor -glBlendEquation -glBlendEquationiEXT -glBlendEquationSeparate -glBlendEquationSeparateiEXT -glBlendFunc -glBlendFunciEXT -glBlendFuncSeparate -glBlendFuncSeparateiEXT -glBlitFramebuffer -glBufferData -glBufferSubData -glCheckFramebufferStatus -glClear -glClearBufferfi -glClearBufferfv -glClearBufferiv -glClearBufferuiv -glClearColor -glClearDepthf -glClearStencil -glClientWaitSync -glColorMask -glColorMaskiEXT -glCompileShader -glCompressedTexImage2D -glCompressedTexImage3D -glCompressedTexImage3DOES -glCompressedTexSubImage2D -glCompressedTexSubImage3D -glCompressedTexSubImage3DOES -glCopyBufferSubData -glCopyImageSubDataEXT -glCopyTexImage2D -glCopyTexSubImage2D -glCopyTexSubImage3D -glCopyTexSubImage3DOES -glCreateProgram -glCreateShader -glCreateShaderProgramv -glCullFace -glDebugMessageCallbackKHR -glDebugMessageControlKHR -glDebugMessageInsertKHR -glDeleteBuffers -glDeleteFramebuffers -glDeleteProgram -glDeleteProgramPipelines -glDeleteQueries -glDeleteRenderbuffers -glDeleteSamplers -glDeleteShader -glDeleteSync -glDeleteTextures -glDeleteTransformFeedbacks -glDeleteVertexArrays -glDeleteVertexArraysOES -glDepthFunc -glDepthMask -glDepthRangef -glDetachShader -glDisable -glDisableiEXT -glDisableVertexAttribArray -glDispatchCompute -glDispatchComputeIndirect -glDrawArrays -glDrawArraysIndirect -glDrawArraysInstanced -glDrawBuffers -glDrawElements -glDrawElementsIndirect -glDrawElementsInstanced -glDrawRangeElements -glEGLImageTargetRenderbufferStorageOES -glEGLImageTargetTexture2DOES -glEnable -glEnableiEXT -glEnableVertexAttribArray -glEndQuery -glEndTransformFeedback -glFenceSync -glFinish -glFlush -glFlushMappedBufferRange -glFramebufferParameteri -glFramebufferRenderbuffer -glFramebufferTexture2D -glFramebufferTexture3DOES -glFramebufferTextureEXT -glFramebufferTextureLayer -glFrontFace -glGenBuffers -glGenerateMipmap -glGenFramebuffers -glGenProgramPipelines -glGenQueries -glGenRenderbuffers -glGenSamplers -glGenTextures -glGenTransformFeedbacks -glGenVertexArrays -glGenVertexArraysOES -glGetActiveAttrib -glGetActiveUniform -glGetActiveUniformBlockiv -glGetActiveUniformBlockName -glGetActiveUniformsiv -glGetAttachedShaders -glGetAttribLocation -glGetBooleani_v -glGetBooleanv -glGetBufferParameteri64v -glGetBufferParameteriv -glGetBufferPointerv -glGetBufferPointervOES -glGetDebugMessageLogKHR -glGetError -glGetFloatv -glGetFragDataLocation -glGetFramebufferAttachmentParameteriv -glGetFramebufferParameteriv -glGetInteger64i_v -glGetInteger64v -glGetIntegeri_v -glGetIntegerv -glGetInternalformativ -glGetMultisamplefv -glGetObjectLabelKHR -glGetObjectPtrLabelKHR -glGetPointervKHR -glGetProgramBinary -glGetProgramBinaryOES -glGetProgramInfoLog -glGetProgramInterfaceiv -glGetProgramiv -glGetProgramPipelineInfoLog -glGetProgramPipelineiv -glGetProgramResourceIndex -glGetProgramResourceiv -glGetProgramResourceLocation -glGetProgramResourceName -glGetQueryiv -glGetQueryObjectuiv -glGetRenderbufferParameteriv -glGetSamplerParameterfv -glGetSamplerParameterIivEXT -glGetSamplerParameterIuivEXT -glGetSamplerParameteriv -glGetShaderInfoLog -glGetShaderiv -glGetShaderPrecisionFormat -glGetShaderSource -glGetString -glGetStringi -glGetSynciv -glGetTexLevelParameterfv -glGetTexLevelParameteriv -glGetTexParameterfv -glGetTexParameterIivEXT -glGetTexParameterIuivEXT -glGetTexParameteriv -glGetTransformFeedbackVarying -glGetUniformBlockIndex -glGetUniformfv -glGetUniformIndices -glGetUniformiv -glGetUniformLocation -glGetUniformuiv -glGetVertexAttribfv -glGetVertexAttribIiv -glGetVertexAttribIuiv -glGetVertexAttribiv -glGetVertexAttribPointerv -glHint -glInvalidateFramebuffer -glInvalidateSubFramebuffer -glIsBuffer -glIsEnabled -glIsEnablediEXT -glIsFramebuffer -glIsProgram -glIsProgramPipeline -glIsQuery -glIsRenderbuffer -glIsSampler -glIsShader -glIsSync -glIsTexture -glIsTransformFeedback -glIsVertexArray -glIsVertexArrayOES -glLineWidth -glLinkProgram -glMapBufferOES -glMapBufferRange -glMemoryBarrier -glMemoryBarrierByRegion -glMinSampleShadingOES -glObjectLabelKHR -glObjectPtrLabelKHR -glPatchParameteriEXT -glPauseTransformFeedback -glPixelStorei -glPolygonOffset -glPopDebugGroupKHR -glPrimitiveBoundingBoxEXT -glProgramBinary -glProgramBinaryOES -glProgramParameteri -glProgramUniform1f -glProgramUniform1fv -glProgramUniform1i -glProgramUniform1iv -glProgramUniform1ui -glProgramUniform1uiv -glProgramUniform2f -glProgramUniform2fv -glProgramUniform2i -glProgramUniform2iv -glProgramUniform2ui -glProgramUniform2uiv -glProgramUniform3f -glProgramUniform3fv -glProgramUniform3i -glProgramUniform3iv -glProgramUniform3ui -glProgramUniform3uiv -glProgramUniform4f -glProgramUniform4fv -glProgramUniform4i -glProgramUniform4iv -glProgramUniform4ui -glProgramUniform4uiv -glProgramUniformMatrix2fv -glProgramUniformMatrix2x3fv -glProgramUniformMatrix2x4fv -glProgramUniformMatrix3fv -glProgramUniformMatrix3x2fv -glProgramUniformMatrix3x4fv -glProgramUniformMatrix4fv -glProgramUniformMatrix4x2fv -glProgramUniformMatrix4x3fv -glPushDebugGroupKHR -glReadBuffer -glReadPixels -glReleaseShaderCompiler -glRenderbufferStorage -glRenderbufferStorageMultisample -glResumeTransformFeedback -glSampleCoverage -glSampleMaski -glSamplerParameterf -glSamplerParameterfv -glSamplerParameteri -glSamplerParameterIivEXT -glSamplerParameterIuivEXT -glSamplerParameteriv -glScissor -glShaderBinary -glShaderSource -glStencilFunc -glStencilFuncSeparate -glStencilMask -glStencilMaskSeparate -glStencilOp -glStencilOpSeparate -glTexBufferEXT -glTexBufferRangeEXT -glTexImage2D -glTexImage3D -glTexImage3DOES -glTexParameterf -glTexParameterfv -glTexParameteri -glTexParameterIivEXT -glTexParameterIuivEXT -glTexParameteriv -glTexStorage2D -glTexStorage2DMultisample -glTexStorage3D -glTexStorage3DMultisampleOES -glTexSubImage2D -glTexSubImage3D -glTexSubImage3DOES -glTransformFeedbackVaryings -glUniform1f -glUniform1fv -glUniform1i -glUniform1iv -glUniform1ui -glUniform1uiv -glUniform2f -glUniform2fv -glUniform2i -glUniform2iv -glUniform2ui -glUniform2uiv -glUniform3f -glUniform3fv -glUniform3i -glUniform3iv -glUniform3ui -glUniform3uiv -glUniform4f -glUniform4fv -glUniform4i -glUniform4iv -glUniform4ui -glUniform4uiv -glUniformBlockBinding -glUniformMatrix2fv -glUniformMatrix2x3fv -glUniformMatrix2x4fv -glUniformMatrix3fv -glUniformMatrix3x2fv -glUniformMatrix3x4fv -glUniformMatrix4fv -glUniformMatrix4x2fv -glUniformMatrix4x3fv -glUnmapBuffer -glUnmapBufferOES -glUseProgram -glUseProgramStages -glValidateProgram -glValidateProgramPipeline -glVertexAttrib1f -glVertexAttrib1fv -glVertexAttrib2f -glVertexAttrib2fv -glVertexAttrib3f -glVertexAttrib3fv -glVertexAttrib4f -glVertexAttrib4fv -glVertexAttribBinding -glVertexAttribDivisor -glVertexAttribFormat -glVertexAttribI4i -glVertexAttribI4iv -glVertexAttribI4ui -glVertexAttribI4uiv -glVertexAttribIFormat -glVertexAttribIPointer -glVertexAttribPointer -glVertexBindingDivisor -glViewport -glWaitSync diff --git a/ndk/platforms/android-21/arch-p/symbols/libOpenMAXAL.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libOpenMAXAL.so.functions.txt deleted file mode 100644 index c3a190c1f..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libOpenMAXAL.so.functions.txt +++ /dev/null @@ -1,3 +0,0 @@ -xaCreateEngine -xaQueryNumSupportedEngineInterfaces -xaQuerySupportedEngineInterfaces diff --git a/ndk/platforms/android-21/arch-p/symbols/libOpenMAXAL.so.variables.txt b/ndk/platforms/android-21/arch-p/symbols/libOpenMAXAL.so.variables.txt deleted file mode 100644 index 7ceda9cbf..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libOpenMAXAL.so.variables.txt +++ /dev/null @@ -1,41 +0,0 @@ -XA_IID_ANDROIDBUFFERQUEUESOURCE -XA_IID_AUDIODECODERCAPABILITIES -XA_IID_AUDIOENCODER -XA_IID_AUDIOENCODERCAPABILITIES -XA_IID_AUDIOIODEVICECAPABILITIES -XA_IID_CAMERA -XA_IID_CAMERACAPABILITIES -XA_IID_CONFIGEXTENSION -XA_IID_DEVICEVOLUME -XA_IID_DYNAMICINTERFACEMANAGEMENT -XA_IID_DYNAMICSOURCE -XA_IID_ENGINE -XA_IID_EQUALIZER -XA_IID_IMAGECONTROLS -XA_IID_IMAGEDECODERCAPABILITIES -XA_IID_IMAGEEFFECTS -XA_IID_IMAGEENCODER -XA_IID_IMAGEENCODERCAPABILITIES -XA_IID_LED -XA_IID_METADATAEXTRACTION -XA_IID_METADATAINSERTION -XA_IID_METADATATRAVERSAL -XA_IID_NULL -XA_IID_OBJECT -XA_IID_OUTPUTMIX -XA_IID_PLAY -XA_IID_PLAYBACKRATE -XA_IID_PREFETCHSTATUS -XA_IID_RADIO -XA_IID_RDS -XA_IID_RECORD -XA_IID_SEEK -XA_IID_SNAPSHOT -XA_IID_STREAMINFORMATION -XA_IID_THREADSYNC -XA_IID_VIBRA -XA_IID_VIDEODECODERCAPABILITIES -XA_IID_VIDEOENCODER -XA_IID_VIDEOENCODERCAPABILITIES -XA_IID_VIDEOPOSTPROCESSING -XA_IID_VOLUME diff --git a/ndk/platforms/android-21/arch-p/symbols/libOpenSLES.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libOpenSLES.so.functions.txt deleted file mode 100644 index f69a3e5a1..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libOpenSLES.so.functions.txt +++ /dev/null @@ -1,3 +0,0 @@ -slCreateEngine -slQueryNumSupportedEngineInterfaces -slQuerySupportedEngineInterfaces diff --git a/ndk/platforms/android-21/arch-p/symbols/libOpenSLES.so.variables.txt b/ndk/platforms/android-21/arch-p/symbols/libOpenSLES.so.variables.txt deleted file mode 100644 index c7ee7d1ec..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libOpenSLES.so.variables.txt +++ /dev/null @@ -1,50 +0,0 @@ -SL_IID_3DCOMMIT -SL_IID_3DDOPPLER -SL_IID_3DGROUPING -SL_IID_3DLOCATION -SL_IID_3DMACROSCOPIC -SL_IID_3DSOURCE -SL_IID_ANDROIDBUFFERQUEUESOURCE -SL_IID_ANDROIDCONFIGURATION -SL_IID_ANDROIDEFFECT -SL_IID_ANDROIDEFFECTCAPABILITIES -SL_IID_ANDROIDEFFECTSEND -SL_IID_ANDROIDSIMPLEBUFFERQUEUE -SL_IID_AUDIODECODERCAPABILITIES -SL_IID_AUDIOENCODER -SL_IID_AUDIOENCODERCAPABILITIES -SL_IID_AUDIOIODEVICECAPABILITIES -SL_IID_BASSBOOST -SL_IID_BUFFERQUEUE -SL_IID_DEVICEVOLUME -SL_IID_DYNAMICINTERFACEMANAGEMENT -SL_IID_DYNAMICSOURCE -SL_IID_EFFECTSEND -SL_IID_ENGINE -SL_IID_ENGINECAPABILITIES -SL_IID_ENVIRONMENTALREVERB -SL_IID_EQUALIZER -SL_IID_LED -SL_IID_METADATAEXTRACTION -SL_IID_METADATATRAVERSAL -SL_IID_MIDIMESSAGE -SL_IID_MIDIMUTESOLO -SL_IID_MIDITEMPO -SL_IID_MIDITIME -SL_IID_MUTESOLO -SL_IID_NULL -SL_IID_OBJECT -SL_IID_OUTPUTMIX -SL_IID_PITCH -SL_IID_PLAY -SL_IID_PLAYBACKRATE -SL_IID_PREFETCHSTATUS -SL_IID_PRESETREVERB -SL_IID_RATEPITCH -SL_IID_RECORD -SL_IID_SEEK -SL_IID_THREADSYNC -SL_IID_VIBRA -SL_IID_VIRTUALIZER -SL_IID_VISUALIZATION -SL_IID_VOLUME diff --git a/ndk/platforms/android-21/arch-p/symbols/libandroid.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libandroid.so.functions.txt deleted file mode 100644 index a164f8c0f..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libandroid.so.functions.txt +++ /dev/null @@ -1,179 +0,0 @@ -AAsset_close -AAssetDir_close -AAssetDir_getNextFileName -AAssetDir_rewind -AAsset_getBuffer -AAsset_getLength -AAsset_getLength64 -AAsset_getRemainingLength -AAsset_getRemainingLength64 -AAsset_isAllocated -AAssetManager_fromJava -AAssetManager_open -AAssetManager_openDir -AAsset_openFileDescriptor -AAsset_openFileDescriptor64 -AAsset_read -AAsset_seek -AAsset_seek64 -AConfiguration_copy -AConfiguration_delete -AConfiguration_diff -AConfiguration_fromAssetManager -AConfiguration_getCountry -AConfiguration_getDensity -AConfiguration_getKeyboard -AConfiguration_getKeysHidden -AConfiguration_getLanguage -AConfiguration_getLayoutDirection -AConfiguration_getMcc -AConfiguration_getMnc -AConfiguration_getNavHidden -AConfiguration_getNavigation -AConfiguration_getOrientation -AConfiguration_getScreenHeightDp -AConfiguration_getScreenLong -AConfiguration_getScreenSize -AConfiguration_getScreenWidthDp -AConfiguration_getSdkVersion -AConfiguration_getSmallestScreenWidthDp -AConfiguration_getTouchscreen -AConfiguration_getUiModeNight -AConfiguration_getUiModeType -AConfiguration_isBetterThan -AConfiguration_match -AConfiguration_new -AConfiguration_setCountry -AConfiguration_setDensity -AConfiguration_setKeyboard -AConfiguration_setKeysHidden -AConfiguration_setLanguage -AConfiguration_setLayoutDirection -AConfiguration_setMcc -AConfiguration_setMnc -AConfiguration_setNavHidden -AConfiguration_setNavigation -AConfiguration_setOrientation -AConfiguration_setScreenHeightDp -AConfiguration_setScreenLong -AConfiguration_setScreenSize -AConfiguration_setScreenWidthDp -AConfiguration_setSdkVersion -AConfiguration_setSmallestScreenWidthDp -AConfiguration_setTouchscreen -AConfiguration_setUiModeNight -AConfiguration_setUiModeType -AInputEvent_getDeviceId -AInputEvent_getSource -AInputEvent_getType -AInputQueue_attachLooper -AInputQueue_detachLooper -AInputQueue_finishEvent -AInputQueue_getEvent -AInputQueue_hasEvents -AInputQueue_preDispatchEvent -AKeyEvent_getAction -AKeyEvent_getDownTime -AKeyEvent_getEventTime -AKeyEvent_getFlags -AKeyEvent_getKeyCode -AKeyEvent_getMetaState -AKeyEvent_getRepeatCount -AKeyEvent_getScanCode -ALooper_acquire -ALooper_addFd -ALooper_forThread -ALooper_pollAll -ALooper_pollOnce -ALooper_prepare -ALooper_release -ALooper_removeFd -ALooper_wake -AMotionEvent_getAction -AMotionEvent_getAxisValue -AMotionEvent_getButtonState -AMotionEvent_getDownTime -AMotionEvent_getEdgeFlags -AMotionEvent_getEventTime -AMotionEvent_getFlags -AMotionEvent_getHistoricalAxisValue -AMotionEvent_getHistoricalEventTime -AMotionEvent_getHistoricalOrientation -AMotionEvent_getHistoricalPressure -AMotionEvent_getHistoricalRawX -AMotionEvent_getHistoricalRawY -AMotionEvent_getHistoricalSize -AMotionEvent_getHistoricalToolMajor -AMotionEvent_getHistoricalToolMinor -AMotionEvent_getHistoricalTouchMajor -AMotionEvent_getHistoricalTouchMinor -AMotionEvent_getHistoricalX -AMotionEvent_getHistoricalY -AMotionEvent_getHistorySize -AMotionEvent_getMetaState -AMotionEvent_getOrientation -AMotionEvent_getPointerCount -AMotionEvent_getPointerId -AMotionEvent_getPressure -AMotionEvent_getRawX -AMotionEvent_getRawY -AMotionEvent_getSize -AMotionEvent_getToolMajor -AMotionEvent_getToolMinor -AMotionEvent_getToolType -AMotionEvent_getTouchMajor -AMotionEvent_getTouchMinor -AMotionEvent_getX -AMotionEvent_getXOffset -AMotionEvent_getXPrecision -AMotionEvent_getY -AMotionEvent_getYOffset -AMotionEvent_getYPrecision -ANativeActivity_finish -ANativeActivity_hideSoftInput -ANativeActivity_setWindowFlags -ANativeActivity_setWindowFormat -ANativeActivity_showSoftInput -ANativeWindow_acquire -ANativeWindow_fromSurface -ANativeWindow_getFormat -ANativeWindow_getHeight -ANativeWindow_getWidth -ANativeWindow_lock -ANativeWindow_release -ANativeWindow_setBuffersGeometry -ANativeWindow_unlockAndPost -android_getTtsEngine -AObbInfo_delete -AObbInfo_getFlags -AObbInfo_getPackageName -AObbInfo_getVersion -AObbScanner_getObbInfo -ASensorEventQueue_disableSensor -ASensorEventQueue_enableSensor -ASensorEventQueue_getEvents -ASensorEventQueue_hasEvents -ASensorEventQueue_setEventRate -ASensor_getFifoMaxEventCount -ASensor_getFifoReservedEventCount -ASensor_getMinDelay -ASensor_getName -ASensor_getReportingMode -ASensor_getResolution -ASensor_getStringType -ASensor_getType -ASensor_getVendor -ASensor_isWakeUpSensor -ASensorManager_createEventQueue -ASensorManager_destroyEventQueue -ASensorManager_getDefaultSensor -ASensorManager_getDefaultSensorEx -ASensorManager_getInstance -ASensorManager_getSensorList -AStorageManager_delete -AStorageManager_getMountedObbPath -AStorageManager_isObbMounted -AStorageManager_mountObb -AStorageManager_new -AStorageManager_unmountObb -getTtsEngine diff --git a/ndk/platforms/android-21/arch-p/symbols/libc.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libc.so.functions.txt deleted file mode 100644 index 431be50eb..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libc.so.functions.txt +++ /dev/null @@ -1,1287 +0,0 @@ -abort -abs -accept -accept4 -__accept4 -access -acct -__adddf3 -__addsf3 -__aeabi_atexit -__aeabi_cdcmpeq -__aeabi_cdcmple -__aeabi_cdrcmple -__aeabi_d2f -__aeabi_d2iz -__aeabi_dadd -__aeabi_dcmpeq -__aeabi_dcmpge -__aeabi_dcmpgt -__aeabi_dcmple -__aeabi_dcmplt -__aeabi_dcmpun -__aeabi_ddiv -__aeabi_dmul -__aeabi_drsub -__aeabi_dsub -__aeabi_f2d -__aeabi_f2iz -__aeabi_f2uiz -__aeabi_fadd -__aeabi_fcmpun -__aeabi_fdiv -__aeabi_fmul -__aeabi_frsub -__aeabi_fsub -__aeabi_i2d -__aeabi_i2f -__aeabi_idiv -__aeabi_idiv0 -__aeabi_idivmod -__aeabi_l2d -__aeabi_l2f -__aeabi_lasr -__aeabi_ldiv0 -__aeabi_ldivmod -__aeabi_llsl -__aeabi_llsr -__aeabi_lmul -__aeabi_memclr -__aeabi_memclr4 -__aeabi_memclr8 -__aeabi_memcpy -__aeabi_memcpy4 -__aeabi_memcpy8 -__aeabi_memmove -__aeabi_memmove4 -__aeabi_memmove8 -__aeabi_memset -__aeabi_memset4 -__aeabi_memset8 -__aeabi_ui2d -__aeabi_ui2f -__aeabi_uidiv -__aeabi_uidivmod -__aeabi_ul2d -__aeabi_ul2f -__aeabi_uldivmod -__aeabi_unwind_cpp_pr0 -__aeabi_unwind_cpp_pr1 -__aeabi_unwind_cpp_pr2 -alarm -alphasort -alphasort64 -android_getaddrinfofornet -android_gethostbyaddrfornet -android_gethostbynamefornet -android_set_abort_message -arc4random -arc4random_addrandom -arc4random_buf -arc4random_stir -arc4random_uniform -__arm_fadvise64_64 -asctime -asctime64 -asctime64_r -asctime_r -__ashldi3 -__ashrdi3 -asprintf -__assert -__assert2 -atexit -atof -atoi -atol -atoll -__atomic_cmpxchg -__atomic_dec -__atomic_inc -__atomic_swap -at_quick_exit -__b64_ntop -__b64_pton -basename -basename_r -bcopy -bind -bindresvport -brk -__brk -bsd_signal -bsearch -btowc -bzero -c16rtomb -c32rtomb -cacheflush -calloc -capget -capset -cfgetispeed -cfgetospeed -cfmakeraw -cfsetispeed -cfsetospeed -cfsetspeed -chdir -chmod -chown -chroot -clearenv -clearerr -clock -clock_getres -clock_gettime -clock_nanosleep -clock_settime -clone -close -closedir -closelog -__cmpdf2 -__cmsg_nxthdr -connect -__connect -creat -creat64 -ctime -ctime64 -ctime64_r -ctime_r -__ctype_get_mb_cur_max -__cxa_atexit -__cxa_finalize -daemon -delete_module -difftime -dirfd -dirname -dirname_r -div -__divdf3 -__divdi3 -__divsf3 -__divsi3 -dlmalloc_usable_size -__dn_comp -__dn_count_labels -dn_expand -__dn_skipname -dprintf -drand48 -dup -dup2 -dup3 -duplocale -endmntent -endpwent -endservent -endusershell -endutent -epoll_create -epoll_create1 -epoll_ctl -__epoll_pwait -epoll_pwait -epoll_wait -__eqdf2 -erand48 -err -__errno -errx -ether_aton -ether_aton_r -ether_ntoa -ether_ntoa_r -eventfd -eventfd_read -eventfd_write -execl -execle -execlp -execv -execve -execvp -execvpe -exit -_exit -__exit -_Exit -__extendsfdf2 -faccessat -__fadvise64 -fallocate -fallocate64 -fchdir -fchmod -fchmodat -fchown -fchownat -fclose -fcntl -__fcntl64 -fdatasync -__FD_CLR_chk -__FD_ISSET_chk -fdopen -fdopendir -fdprintf -__FD_SET_chk -feof -ferror -fflush -ffs -fgetc -fgetln -fgetpos -fgets -__fgets_chk -fgetwc -fgetws -fgetxattr -fileno -__fixdfsi -__fixsfsi -__fixunssfsi -flistxattr -__floatdidf -__floatdisf -__floatsidf -__floatsisf -__floatundidf -__floatundisf -__floatunsidf -__floatunsisf -flock -flockfile -_flush_cache -fnmatch -fopen -fork -fpathconf -__fpclassify -__fpclassifyd -__fpclassifyf -__fpclassifyl -__fp_nquery -__fp_query -fprintf -fpurge -fputc -fputs -fputwc -fputws -fread -free -freeaddrinfo -freelocale -fremovexattr -freopen -fscanf -fseek -fseeko -fsetpos -fsetxattr -fstat -fstat64 -fstatat -fstatat64 -fstatfs -fstatfs64 -__fstatfs64 -fstatvfs -fstatvfs64 -fsync -ftell -ftello -ftime -ftok -ftruncate -ftruncate64 -ftrylockfile -fts_children -fts_close -fts_open -fts_read -fts_set -ftw -ftw64 -funlockfile -funopen -__futex_wait -__futex_wake -futimens -fwide -fwprintf -fwrite -fwscanf -gai_strerror -__gedf2 -getaddrinfo -getauxval -getc -getchar -getchar_unlocked -__getcpu -getc_unlocked -getcwd -__getcwd -getdelim -getdents -__getdents64 -getdtablesize -getegid -getenv -geteuid -getgid -getgrgid -getgrnam -getgrouplist -getgroups -__get_h_errno -gethostbyaddr -gethostbyname -gethostbyname2 -gethostbyname_r -gethostent -gethostname -getitimer -getline -getlogin -_getlong -get_malloc_leak_info -getmntent -getmntent_r -getnameinfo -getnetbyaddr -getnetbyname -getopt -getopt_long -getopt_long_only -getpagesize -getpeername -getpgid -getpgrp -getpid -__getpid -getppid -getpriority -__getpriority -getprogname -getprotobyname -getprotobynumber -getpt -getpwnam -getpwnam_r -getpwuid -getpwuid_r -getresgid -getresuid -getrlimit -getrlimit64 -getrusage -gets -getservbyname -getservbyport -getservent -_getshort -getsid -getsockname -getsockopt -__get_thread -gettid -gettimeofday -__get_tls -getuid -getusershell -getutent -getwc -getwchar -getxattr -gmtime -gmtime64 -gmtime64_r -gmtime_r -__gnu_ldivmod_helper -__gnu_uldivmod_helper -__gnu_Unwind_Backtrace -__gnu_unwind_execute -__gnu_Unwind_Find_exidx -__gnu_Unwind_ForcedUnwind -__gnu_unwind_frame -__gnu_Unwind_RaiseException -__gnu_Unwind_Restore_VFP -__gnu_Unwind_Restore_VFP_D -__gnu_Unwind_Restore_VFP_D_16_to_31 -__gnu_Unwind_Restore_WMMXC -__gnu_Unwind_Restore_WMMXD -__gnu_Unwind_Resume -__gnu_Unwind_Resume_or_Rethrow -__gnu_Unwind_Save_VFP -__gnu_Unwind_Save_VFP_D -__gnu_Unwind_Save_VFP_D_16_to_31 -__gnu_Unwind_Save_WMMXC -__gnu_Unwind_Save_WMMXD -grantpt -__gtdf2 -herror -__hostalias -hstrerror -htonl -htons -if_indextoname -if_nametoindex -imaxabs -imaxdiv -index -inet_addr -inet_aton -inet_lnaof -inet_makeaddr -inet_netof -inet_network -inet_nsap_addr -inet_nsap_ntoa -inet_ntoa -inet_ntop -inet_pton -initgroups -init_module -initstate -inotify_add_watch -inotify_init -inotify_init1 -inotify_rm_watch -insque -ioctl -__ioctl -isalnum -isalnum_l -isalpha -isalpha_l -isascii -isatty -isblank -isblank_l -iscntrl -iscntrl_l -isdigit -isdigit_l -isfinite -__isfinite -isfinitef -__isfinitef -isfinitel -__isfinitel -isgraph -isgraph_l -isinf -__isinf -isinff -__isinff -isinfl -__isinfl -islower -islower_l -isnan -__isnan -isnanf -__isnanf -isnanl -__isnanl -isnormal -__isnormal -isnormalf -__isnormalf -isnormall -__isnormall -isprint -isprint_l -ispunct -ispunct_l -issetugid -isspace -isspace_l -isupper -isupper_l -iswalnum -iswalnum_l -iswalpha -iswalpha_l -iswblank -iswblank_l -iswcntrl -iswcntrl_l -iswctype -iswctype_l -iswdigit -iswdigit_l -iswgraph -iswgraph_l -iswlower -iswlower_l -iswprint -iswprint_l -iswpunct -iswpunct_l -iswspace -iswspace_l -iswupper -iswupper_l -iswxdigit -iswxdigit_l -isxdigit -isxdigit_l -jrand48 -kill -killpg -klogctl -labs -lchown -ldexp -ldiv -__ledf2 -lfind -lgetxattr -__libc_current_sigrtmax -__libc_current_sigrtmin -__libc_init -link -linkat -listen -listxattr -llabs -lldiv -llistxattr -__llseek -localeconv -localtime -localtime64 -localtime64_r -localtime_r -__loc_aton -__loc_ntoa -longjmp -_longjmp -lrand48 -lremovexattr -lsearch -lseek -lseek64 -lsetxattr -__lshrdi3 -lstat -lstat64 -__ltdf2 -madvise -mallinfo -malloc -malloc_usable_size -mbrlen -mbrtoc16 -mbrtoc32 -mbrtowc -mbsinit -mbsnrtowcs -mbsrtowcs -mbstowcs -mbtowc -memalign -memccpy -memchr -memcmp -memcpy -__memcpy_chk -memmem -memmove -__memmove_chk -memrchr -memset -_memset16 -_memset32 -__memset_chk -memswap -mincore -mkdir -mkdirat -mkdtemp -mkfifo -mknod -mknodat -mkstemp -mkstemp64 -mkstemps -mktemp -mktime -mktime64 -mktime_tz -mlock -mlockall -mmap -__mmap2 -mmap64 -__moddi3 -mount -mprotect -mrand48 -mremap -msync -__muldf3 -__muldi3 -__mulsf3 -munlock -munlockall -munmap -nanosleep -__nedf2 -newlocale -nftw -nftw64 -nice -nrand48 -nsdispatch -ntohl -ntohs -open -__open -__open_2 -open64 -openat -__openat -__openat_2 -openat64 -opendir -openlog -pathconf -pause -__p_cdname -__p_cdnname -__p_class -pclose -perror -personality -__p_fqname -__p_fqnname -pipe -pipe2 -poll -__popcountsi2 -popen -__p_option -posix_fadvise -posix_fadvise64 -posix_fallocate -posix_fallocate64 -posix_memalign -posix_openpt -ppoll -__ppoll -__p_query -__p_rcode -prctl -pread -pread64 -printf -prlimit -prlimit64 -__p_secstodate -pselect -__pselect6 -psiginfo -psignal -pthread_atfork -pthread_attr_destroy -pthread_attr_getdetachstate -pthread_attr_getguardsize -pthread_attr_getschedparam -pthread_attr_getschedpolicy -pthread_attr_getscope -pthread_attr_getstack -pthread_attr_getstackaddr -pthread_attr_getstacksize -pthread_attr_init -pthread_attr_setdetachstate -pthread_attr_setguardsize -pthread_attr_setschedparam -pthread_attr_setschedpolicy -pthread_attr_setscope -pthread_attr_setstack -pthread_attr_setstackaddr -pthread_attr_setstacksize -__pthread_cleanup_pop -__pthread_cleanup_push -pthread_condattr_destroy -pthread_condattr_getclock -pthread_condattr_getpshared -pthread_condattr_init -pthread_condattr_setclock -pthread_condattr_setpshared -pthread_cond_broadcast -pthread_cond_destroy -pthread_cond_init -pthread_cond_signal -pthread_cond_timedwait -pthread_cond_timedwait_monotonic -pthread_cond_timedwait_monotonic_np -pthread_cond_timedwait_relative_np -pthread_cond_timeout_np -pthread_cond_wait -pthread_create -pthread_detach -pthread_equal -pthread_exit -pthread_getattr_np -pthread_getcpuclockid -pthread_getschedparam -pthread_getspecific -__pthread_gettid -pthread_gettid_np -pthread_join -pthread_key_create -pthread_key_delete -pthread_kill -pthread_mutexattr_destroy -pthread_mutexattr_getpshared -pthread_mutexattr_gettype -pthread_mutexattr_init -pthread_mutexattr_setpshared -pthread_mutexattr_settype -pthread_mutex_destroy -pthread_mutex_init -pthread_mutex_lock -pthread_mutex_lock_timeout_np -pthread_mutex_timedlock -pthread_mutex_trylock -pthread_mutex_unlock -pthread_once -pthread_rwlockattr_destroy -pthread_rwlockattr_getpshared -pthread_rwlockattr_init -pthread_rwlockattr_setpshared -pthread_rwlock_destroy -pthread_rwlock_init -pthread_rwlock_rdlock -pthread_rwlock_timedrdlock -pthread_rwlock_timedwrlock -pthread_rwlock_tryrdlock -pthread_rwlock_trywrlock -pthread_rwlock_unlock -pthread_rwlock_wrlock -pthread_self -pthread_setname_np -pthread_setschedparam -pthread_setspecific -pthread_sigmask -__p_time -ptrace -__ptrace -ptsname -ptsname_r -__p_type -putc -putchar -putchar_unlocked -putc_unlocked -putenv -__putlong -puts -__putshort -pututline -putw -putwc -putwchar -pvalloc -pwrite -pwrite64 -qsort -quick_exit -raise -rand -random -rand_r -read -readahead -__read_chk -readdir -readdir64 -readdir64_r -readdir_r -readlink -readlinkat -readv -realloc -realpath -reboot -__reboot -recv -recvfrom -__recvfrom_chk -recvmmsg -recvmsg -regcomp -regerror -regexec -regfree -remove -removexattr -remque -rename -renameat -__res_close -__res_dnok -__res_hnok -__res_hostalias -res_init -__res_isourserver -__res_mailok -res_mkquery -__res_nameinquery -__res_nclose -__res_ninit -__res_nmkquery -__res_nquery -__res_nquerydomain -__res_nsearch -__res_nsend -_resolv_delete_cache_for_net -_resolv_flush_cache_for_net -_resolv_set_nameservers_for_net -__res_ownok -__res_queriesmatch -res_query -__res_querydomain -__res_randomid -res_search -__res_send -__res_send_setqhook -__res_send_setrhook -__restore_core_regs -restore_core_regs -rewind -rewinddir -rmdir -__rt_sigaction -__rt_sigpending -__rt_sigprocmask -__rt_sigsuspend -__rt_sigtimedwait -sbrk -scandir -scandir64 -scanf -__sched_cpualloc -__sched_cpucount -__sched_cpufree -__sched_getaffinity -sched_getaffinity -sched_getcpu -sched_getparam -sched_get_priority_max -sched_get_priority_min -sched_getscheduler -sched_rr_get_interval -sched_setaffinity -sched_setparam -sched_setscheduler -sched_yield -seed48 -select -sem_close -sem_destroy -sem_getvalue -sem_init -sem_open -sem_post -sem_timedwait -sem_trywait -sem_unlink -sem_wait -send -sendfile -sendfile64 -sendmmsg -sendmsg -sendto -setbuf -setbuffer -setegid -setenv -__set_errno -seteuid -setfsgid -setfsuid -setgid -setgroups -setitimer -setjmp -_setjmp -setlinebuf -setlocale -setlogmask -setmntent -setns -setpgid -setpgrp -setpriority -setprogname -setregid -setresgid -setresuid -setreuid -setrlimit -setrlimit64 -setservent -setsid -setsockopt -setstate -__set_thread_area -__set_tid_address -settimeofday -__set_tls -setuid -setusershell -setutent -setvbuf -setxattr -SHA1Final -SHA1Init -SHA1Transform -SHA1Update -shutdown -sigaction -__sigaction -sigaddset -sigaltstack -sigblock -sigdelset -sigemptyset -sigfillset -siginterrupt -sigismember -siglongjmp -signal -signalfd -sigpending -sigprocmask -sigsetjmp -sigsetmask -sigsuspend -sigwait -sleep -snprintf -__snprintf_chk -socket -__socket -socketpair -splice -sprintf -__sprintf_chk -srand -srand48 -srandom -__srefill -__srget -sscanf -__stack_chk_fail -stat -stat64 -statfs -statfs64 -__statfs64 -statvfs -statvfs64 -stpcpy -__stpcpy_chk -stpncpy -__stpncpy_chk -__stpncpy_chk2 -strcasecmp -strcasestr -strcat -__strcat_chk -strchr -__strchr_chk -strcmp -strcoll -strcoll_l -strcpy -__strcpy_chk -strcspn -strdup -strerror -strerror_r -strftime -strftime_l -strlcat -__strlcat_chk -strlcpy -__strlcpy_chk -strlen -__strlen_chk -strncasecmp -strncat -__strncat_chk -strncmp -strncpy -__strncpy_chk -__strncpy_chk2 -strndup -strnlen -strntoimax -strntoumax -strpbrk -strptime -strrchr -__strrchr_chk -strsep -strsignal -strspn -strstr -strtod -strtof -strtoimax -strtok -strtok_r -strtol -strtold -strtold_l -strtoll -strtoll_l -strtoq -strtotimeval -strtoul -strtoull -strtoull_l -strtoumax -strtouq -strxfrm -strxfrm_l -__subdf3 -__subsf3 -swapoff -swapon -__swbuf -swprintf -swscanf -__swsetup -symlink -symlinkat -__sym_ntop -__sym_ntos -__sym_ston -sync -syscall -sysconf -sysinfo -syslog -system -__system_properties_init -__system_property_add -__system_property_area_init -__system_property_find -__system_property_find_nth -__system_property_foreach -__system_property_get -__system_property_read -__system_property_serial -__system_property_set -__system_property_set_filename -__system_property_update -__system_property_wait_any -sysv_signal -tcdrain -tcflow -tcflush -tcgetattr -tcgetpgrp -tcgetsid -tcsendbreak -tcsetattr -tcsetpgrp -tdelete -tdestroy -tee -tempnam -tfind -tgkill -time -timegm -timegm64 -timelocal -timelocal64 -__timer_create -timer_create -__timer_delete -timer_delete -timerfd_create -timerfd_gettime -timerfd_settime -__timer_getoverrun -timer_getoverrun -__timer_gettime -timer_gettime -__timer_settime -timer_settime -times -tkill -tmpfile -tmpnam -toascii -tolower -_tolower -tolower_l -toupper -_toupper -toupper_l -towlower -towlower_l -towupper -towupper_l -truncate -truncate64 -__truncdfsf2 -tsearch -ttyname -ttyname_r -twalk -tzset -__udivdi3 -__udivsi3 -umask -__umask_chk -__umoddi3 -umount -umount2 -uname -ungetc -ungetwc -unlink -unlinkat -unlockpt -__unorddf2 -__unordsf2 -unsetenv -unshare -___Unwind_Backtrace -_Unwind_Backtrace -_Unwind_Complete -_Unwind_DeleteException -___Unwind_ForcedUnwind -_Unwind_ForcedUnwind -_Unwind_GetCFA -_Unwind_GetDataRelBase -_Unwind_GetLanguageSpecificData -_Unwind_GetRegionStart -_Unwind_GetTextRelBase -___Unwind_RaiseException -_Unwind_RaiseException -___Unwind_Resume -_Unwind_Resume -___Unwind_Resume_or_Rethrow -_Unwind_Resume_or_Rethrow -_Unwind_VRS_Get -_Unwind_VRS_Pop -_Unwind_VRS_Set -uselocale -usleep -utime -utimensat -utimes -utmpname -valloc -vasprintf -vdprintf -verr -verrx -vfdprintf -vfork -vfprintf -vfscanf -vfwprintf -vfwscanf -vmsplice -vprintf -vscanf -vsnprintf -__vsnprintf_chk -vsprintf -__vsprintf_chk -vsscanf -vswprintf -vswscanf -vsyslog -vwarn -vwarnx -vwprintf -vwscanf -wait -wait3 -wait4 -__wait4 -waitid -__waitid -waitpid -warn -warnx -wcpcpy -wcpncpy -wcrtomb -wcscasecmp -wcscat -wcschr -wcscmp -wcscoll -wcscoll_l -wcscpy -wcscspn -wcsdup -wcsftime -wcslcat -wcslcpy -wcslen -wcsncasecmp -wcsncat -wcsncmp -wcsncpy -wcsnlen -wcsnrtombs -wcspbrk -wcsrchr -wcsrtombs -wcsspn -wcsstr -wcstod -wcstof -wcstoimax -wcstok -wcstol -wcstold -wcstold_l -wcstoll -wcstoll_l -wcstombs -wcstoul -wcstoull -wcstoull_l -wcstoumax -wcswcs -wcswidth -wcsxfrm -wcsxfrm_l -wctob -wctomb -wctype -wctype_l -wcwidth -wmemchr -wmemcmp -wmemcpy -wmemmove -wmemset -wprintf -write -writev -wscanf -_Z16__libc_init_vdsov diff --git a/ndk/platforms/android-21/arch-p/symbols/libc.so.variables.txt b/ndk/platforms/android-21/arch-p/symbols/libc.so.variables.txt deleted file mode 100644 index 954448aaa..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libc.so.variables.txt +++ /dev/null @@ -1,27 +0,0 @@ -__bionic_brk -__bionic_libgcc_compat_symbols -_ctype_ -daylight -__dso_handle -environ -__isthreaded -optarg -opterr -optind -optopt -optreset -__page_shift -__page_size -__p_class_syms -__popcount_tab -__progname -__p_type_syms -__sF -__stack_chk_guard -sys_siglist -sys_signame -__system_property_area__ -timezone -_tolower_tab_ -_toupper_tab_ -tzname diff --git a/ndk/platforms/android-21/arch-p/symbols/libdl.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libdl.so.functions.txt deleted file mode 100644 index bc295eba6..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libdl.so.functions.txt +++ /dev/null @@ -1,10 +0,0 @@ -android_dlopen_ext -android_get_LD_LIBRARY_PATH -android_update_LD_LIBRARY_PATH -dladdr -dlclose -dlerror -dl_iterate_phdr -dlopen -dlsym -dl_unwind_find_exidx diff --git a/ndk/platforms/android-21/arch-p/symbols/libjnigraphics.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libjnigraphics.so.functions.txt deleted file mode 100644 index 61612d4d8..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libjnigraphics.so.functions.txt +++ /dev/null @@ -1,3 +0,0 @@ -AndroidBitmap_getInfo -AndroidBitmap_lockPixels -AndroidBitmap_unlockPixels diff --git a/ndk/platforms/android-21/arch-p/symbols/liblog.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/liblog.so.functions.txt deleted file mode 100644 index d7a4b7248..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/liblog.so.functions.txt +++ /dev/null @@ -1,9 +0,0 @@ -__android_log_assert -__android_log_btwrite -__android_log_buf_print -__android_log_buf_write -__android_log_bwrite -__android_log_dev_available -__android_log_print -__android_log_vprint -__android_log_write diff --git a/ndk/platforms/android-21/arch-p/symbols/libm.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libm.so.functions.txt deleted file mode 100644 index 2aa8c6c5f..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libm.so.functions.txt +++ /dev/null @@ -1,245 +0,0 @@ -acos -acosf -acosh -acoshf -acoshl -acosl -__aeabi_cfcmpeq -__aeabi_cfcmple -__aeabi_cfrcmple -__aeabi_d2lz -__aeabi_d2uiz -__aeabi_d2ulz -__aeabi_f2lz -__aeabi_f2ulz -__aeabi_fcmpeq -__aeabi_fcmpge -__aeabi_fcmpgt -__aeabi_fcmple -__aeabi_fcmplt -asin -asinf -asinh -asinhf -asinhl -asinl -atan -atan2 -atan2f -atan2l -atanf -atanh -atanhf -atanhl -atanl -cabsl -cbrt -cbrtf -cbrtl -ceil -ceilf -ceill -__cmpsf2 -copysign -copysignf -copysignl -cos -cosf -cosh -coshf -coshl -cosl -cprojl -csqrtl -drem -dremf -__eqsf2 -erf -erfc -erfcf -erfcl -erff -erfl -exp -exp2 -exp2f -exp2l -expf -expl -expm1 -expm1f -expm1l -fabs -fabsf -fabsl -fdim -fdimf -fdiml -feclearexcept -fedisableexcept -feenableexcept -fegetenv -fegetexcept -fegetexceptflag -fegetround -feholdexcept -feraiseexcept -fesetenv -fesetexceptflag -fesetround -fetestexcept -feupdateenv -finite -finitef -__fixdfdi -__fixsfdi -__fixunsdfdi -__fixunsdfsi -__fixunssfdi -floor -floorf -floorl -fma -fmaf -fmal -fmax -fmaxf -fmaxl -fmin -fminf -fminl -fmod -fmodf -fmodl -frexp -frexpf -frexpl -gamma -gammaf -gammaf_r -gamma_r -__gesf2 -__gtsf2 -hypot -hypotf -hypotl -ilogb -ilogbf -ilogbl -j0 -j0f -j1 -j1f -jn -jnf -ldexpf -ldexpl -__lesf2 -lgamma -lgammaf -lgammaf_r -lgammal -lgamma_r -llrint -llrintf -llrintl -llround -llroundf -llroundl -log -log10 -log10f -log10l -log1p -log1pf -log1pl -log2 -log2f -log2l -logb -logbf -logbl -logf -logl -lrint -lrintf -lrintl -lround -lroundf -lroundl -__ltsf2 -modf -modff -modfl -nan -nanf -nanl -nearbyint -nearbyintf -nearbyintl -__nesf2 -nextafter -nextafterf -nextafterl -nexttoward -nexttowardf -nexttowardl -pow -powf -powl -remainder -remainderf -remainderl -remquo -remquof -remquol -rint -rintf -rintl -round -roundf -roundl -scalb -scalbf -scalbln -scalblnf -scalblnl -scalbn -scalbnf -scalbnl -__signbit -__signbitf -__signbitl -significand -significandf -significandl -sin -sincos -sincosf -sincosl -sinf -sinh -sinhf -sinhl -sinl -sqrt -sqrtf -sqrtl -tan -tanf -tanh -tanhf -tanhl -tanl -tgamma -tgammaf -tgammal -trunc -truncf -truncl -y0 -y0f -y1 -y1f -yn -ynf diff --git a/ndk/platforms/android-21/arch-p/symbols/libm.so.variables.txt b/ndk/platforms/android-21/arch-p/symbols/libm.so.variables.txt deleted file mode 100644 index a1b63fcbc..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libm.so.variables.txt +++ /dev/null @@ -1,2 +0,0 @@ -__fe_dfl_env -signgam diff --git a/ndk/platforms/android-21/arch-p/symbols/libmediandk.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libmediandk.so.functions.txt deleted file mode 100644 index cdf1681a3..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libmediandk.so.functions.txt +++ /dev/null @@ -1,91 +0,0 @@ -AMediaCodec_configure -AMediaCodec_createCodecByName -AMediaCodec_createDecoderByType -AMediaCodec_createEncoderByType -AMediaCodecCryptoInfo_delete -AMediaCodecCryptoInfo_getClearBytes -AMediaCodecCryptoInfo_getEncryptedBytes -AMediaCodecCryptoInfo_getIV -AMediaCodecCryptoInfo_getKey -AMediaCodecCryptoInfo_getMode -AMediaCodecCryptoInfo_getNumSubSamples -AMediaCodecCryptoInfo_new -AMediaCodec_delete -AMediaCodec_dequeueInputBuffer -AMediaCodec_dequeueOutputBuffer -AMediaCodec_flush -AMediaCodec_getInputBuffer -AMediaCodec_getOutputBuffer -AMediaCodec_getOutputFormat -AMediaCodec_queueInputBuffer -AMediaCodec_queueSecureInputBuffer -AMediaCodec_releaseOutputBuffer -AMediaCodec_releaseOutputBufferAtTime -AMediaCodec_start -AMediaCodec_stop -AMediaCrypto_delete -AMediaCrypto_isCryptoSchemeSupported -AMediaCrypto_new -AMediaCrypto_requiresSecureDecoderComponent -AMediaDrm_closeSession -AMediaDrm_createByUUID -AMediaDrm_decrypt -AMediaDrm_encrypt -AMediaDrm_getKeyRequest -AMediaDrm_getPropertyByteArray -AMediaDrm_getPropertyString -AMediaDrm_getProvisionRequest -AMediaDrm_getSecureStops -AMediaDrm_isCryptoSchemeSupported -AMediaDrm_openSession -AMediaDrm_provideKeyResponse -AMediaDrm_provideProvisionResponse -AMediaDrm_queryKeyStatus -AMediaDrm_release -AMediaDrm_releaseSecureStops -AMediaDrm_removeKeys -AMediaDrm_restoreKeys -AMediaDrm_setOnEventListener -AMediaDrm_setPropertyByteArray -AMediaDrm_setPropertyString -AMediaDrm_sign -AMediaDrm_verify -AMediaExtractor_advance -AMediaExtractor_delete -AMediaExtractor_getPsshInfo -AMediaExtractor_getSampleCryptoInfo -AMediaExtractor_getSampleFlags -AMediaExtractor_getSampleTime -AMediaExtractor_getSampleTrackIndex -AMediaExtractor_getTrackCount -AMediaExtractor_getTrackFormat -AMediaExtractor_new -AMediaExtractor_readSampleData -AMediaExtractor_seekTo -AMediaExtractor_selectTrack -AMediaExtractor_setDataSource -AMediaExtractor_setDataSourceFd -AMediaExtractor_unselectTrack -AMediaFormat_delete -AMediaFormat_getBuffer -AMediaFormat_getFloat -AMediaFormat_getInt32 -AMediaFormat_getInt64 -AMediaFormat_getSize -AMediaFormat_getString -AMediaFormat_new -AMediaFormat_setBuffer -AMediaFormat_setFloat -AMediaFormat_setInt32 -AMediaFormat_setInt64 -AMediaFormat_setString -AMediaFormat_toString -AMediaMuxer_addTrack -AMediaMuxer_delete -AMediaMuxer_new -AMediaMuxer_setLocation -AMediaMuxer_setOrientationHint -AMediaMuxer_start -AMediaMuxer_stop -AMediaMuxer_writeSampleData -__popcountdi2 diff --git a/ndk/platforms/android-21/arch-p/symbols/libmediandk.so.variables.txt b/ndk/platforms/android-21/arch-p/symbols/libmediandk.so.variables.txt deleted file mode 100644 index 6b0fbd5f9..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libmediandk.so.variables.txt +++ /dev/null @@ -1,24 +0,0 @@ -AMEDIAFORMAT_KEY_AAC_PROFILE -AMEDIAFORMAT_KEY_BIT_RATE -AMEDIAFORMAT_KEY_CHANNEL_COUNT -AMEDIAFORMAT_KEY_CHANNEL_MASK -AMEDIAFORMAT_KEY_COLOR_FORMAT -AMEDIAFORMAT_KEY_DURATION -AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL -AMEDIAFORMAT_KEY_FRAME_RATE -AMEDIAFORMAT_KEY_HEIGHT -AMEDIAFORMAT_KEY_I_FRAME_INTERVAL -AMEDIAFORMAT_KEY_IS_ADTS -AMEDIAFORMAT_KEY_IS_AUTOSELECT -AMEDIAFORMAT_KEY_IS_DEFAULT -AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE -AMEDIAFORMAT_KEY_LANGUAGE -AMEDIAFORMAT_KEY_MAX_HEIGHT -AMEDIAFORMAT_KEY_MAX_INPUT_SIZE -AMEDIAFORMAT_KEY_MAX_WIDTH -AMEDIAFORMAT_KEY_MIME -AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP -AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER -AMEDIAFORMAT_KEY_SAMPLE_RATE -AMEDIAFORMAT_KEY_STRIDE -AMEDIAFORMAT_KEY_WIDTH diff --git a/ndk/platforms/android-21/arch-p/symbols/libstdc++.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libstdc++.so.functions.txt deleted file mode 100644 index 3924a3bed..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libstdc++.so.functions.txt +++ /dev/null @@ -1,17 +0,0 @@ -android_set_abort_message -__cxa_guard_abort -__cxa_guard_acquire -__cxa_guard_release -__cxa_pure_virtual -_ZdaPv -_ZdaPvRKSt9nothrow_t -_ZdlPv -_ZdlPvRKSt9nothrow_t -_Znaj -_ZnajRKSt9nothrow_t -_Znam -_ZnamRKSt9nothrow_t -_Znwj -_ZnwjRKSt9nothrow_t -_Znwm -_ZnwmRKSt9nothrow_t diff --git a/ndk/platforms/android-21/arch-p/symbols/libstdc++.so.variables.txt b/ndk/platforms/android-21/arch-p/symbols/libstdc++.so.variables.txt deleted file mode 100644 index 62e9acdfe..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libstdc++.so.variables.txt +++ /dev/null @@ -1 +0,0 @@ -_ZSt7nothrow diff --git a/ndk/platforms/android-21/arch-p/symbols/libz.so.functions.txt b/ndk/platforms/android-21/arch-p/symbols/libz.so.functions.txt deleted file mode 100644 index a007fa3b0..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libz.so.functions.txt +++ /dev/null @@ -1,130 +0,0 @@ -adler32 -adler32_combine -adler32_combine64 -__aeabi_unwind_cpp_pr0 -__aeabi_unwind_cpp_pr1 -__aeabi_unwind_cpp_pr2 -compress -compress2 -compressBound -crc32 -crc32_combine -crc32_combine64 -deflate -deflateBound -deflateCopy -deflateEnd -deflateInit_ -deflateInit2_ -deflateParams -deflatePending -deflatePrime -deflateReset -deflateResetKeep -deflateSetDictionary -deflateSetHeader -deflateTune -get_crc_table -__gnu_Unwind_Backtrace -__gnu_unwind_execute -__gnu_Unwind_ForcedUnwind -__gnu_unwind_frame -__gnu_Unwind_RaiseException -__gnu_Unwind_Restore_VFP -__gnu_Unwind_Restore_VFP_D -__gnu_Unwind_Restore_VFP_D_16_to_31 -__gnu_Unwind_Restore_WMMXC -__gnu_Unwind_Restore_WMMXD -__gnu_Unwind_Resume -__gnu_Unwind_Resume_or_Rethrow -__gnu_Unwind_Save_VFP -__gnu_Unwind_Save_VFP_D -__gnu_Unwind_Save_VFP_D_16_to_31 -__gnu_Unwind_Save_WMMXC -__gnu_Unwind_Save_WMMXD -gzbuffer -gzclearerr -gzclose -gzclose_r -gzclose_w -gzdirect -gzdopen -gzeof -gzerror -gz_error -gzflush -gzgetc -gzgetc_ -gzgets -gzoffset -gzoffset64 -gzopen -gzopen64 -gzprintf -gzputc -gzputs -gzread -gzrewind -gzseek -gzseek64 -gzsetparams -gztell -gztell64 -gzungetc -gzvprintf -gzwrite -inflate -inflateBack -inflateBackEnd -inflateBackInit_ -inflateCopy -inflateEnd -inflate_fast -inflateGetDictionary -inflateGetHeader -inflateInit_ -inflateInit2_ -inflateMark -inflatePrime -inflateReset -inflateReset2 -inflateResetKeep -inflateSetDictionary -inflateSync -inflateSyncPoint -inflate_table -inflateUndermine -__restore_core_regs -restore_core_regs -_tr_align -_tr_flush_bits -_tr_flush_block -_tr_init -_tr_stored_block -_tr_tally -uncompress -___Unwind_Backtrace -_Unwind_Backtrace -_Unwind_Complete -_Unwind_DeleteException -___Unwind_ForcedUnwind -_Unwind_ForcedUnwind -_Unwind_GetCFA -_Unwind_GetDataRelBase -_Unwind_GetLanguageSpecificData -_Unwind_GetRegionStart -_Unwind_GetTextRelBase -___Unwind_RaiseException -_Unwind_RaiseException -___Unwind_Resume -_Unwind_Resume -___Unwind_Resume_or_Rethrow -_Unwind_Resume_or_Rethrow -_Unwind_VRS_Get -_Unwind_VRS_Pop -_Unwind_VRS_Set -zcalloc -zcfree -zError -zlibCompileFlags -zlibVersion diff --git a/ndk/platforms/android-21/arch-p/symbols/libz.so.variables.txt b/ndk/platforms/android-21/arch-p/symbols/libz.so.variables.txt deleted file mode 100644 index b09771a70..000000000 --- a/ndk/platforms/android-21/arch-p/symbols/libz.so.variables.txt +++ /dev/null @@ -1,5 +0,0 @@ -deflate_copyright -_dist_code -inflate_copyright -_length_code -z_errmsg diff --git a/ndk/platforms/android-21/arch-x86/include/machine/endian.h b/ndk/platforms/android-21/arch-x86/include/machine/endian.h deleted file mode 100644 index e1506b110..000000000 --- a/ndk/platforms/android-21/arch-x86/include/machine/endian.h +++ /dev/null @@ -1,61 +0,0 @@ -/* $OpenBSD: endian.h,v 1.17 2011/03/12 04:03:04 guenther Exp $ */ - -/*- - * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ - -#ifdef __GNUC__ - -#define __swap32md(x) __statement({ \ - uint32_t __swap32md_x = (x); \ - \ - __asm ("bswap %0" : "+r" (__swap32md_x)); \ - __swap32md_x; \ -}) - -#define __swap64md(x) __statement({ \ - uint64_t __swap64md_x = (x); \ - \ - (uint64_t)__swap32md(__swap64md_x >> 32) | \ - (uint64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \ -}) -#define __swap16md(x) __statement({ \ - uint16_t __swap16md_x = (x); \ - \ - __asm ("rorw $8, %w0" : "+r" (__swap16md_x)); \ - __swap16md_x; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __GNUC__ */ - -#define _BYTE_ORDER _LITTLE_ENDIAN -#include -#include - -#endif /* _MACHINE_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/arch-x86_64/include/machine/endian.h b/ndk/platforms/android-21/arch-x86_64/include/machine/endian.h deleted file mode 100644 index 4d9060ba7..000000000 --- a/ndk/platforms/android-21/arch-x86_64/include/machine/endian.h +++ /dev/null @@ -1,63 +0,0 @@ -/* $OpenBSD: endian.h,v 1.5 2011/03/12 22:27:48 guenther Exp $ */ - -/*- - * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ - -#include - -#ifdef __GNUC__ - -#define __swap32md(x) __statement({ \ - u_int32_t __swap32md_x = (x); \ - \ - __asm ("bswap %0" : "+r" (__swap32md_x)); \ - __swap32md_x; \ -}) - -#define __swap64md(x) __statement({ \ - u_int64_t __swap64md_x = (x); \ - \ - __asm ("bswapq %0" : "+r" (__swap64md_x)); \ - __swap64md_x; \ -}) - -#define __swap16md(x) __statement({ \ - u_int16_t __swap16md_x = (x); \ - \ - __asm ("rorw $8, %w0" : "+r" (__swap16md_x)); \ - __swap16md_x; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __GNUC__ */ - -#define _BYTE_ORDER _LITTLE_ENDIAN -#include - -#endif /* _MACHINE_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/include/byteswap.h b/ndk/platforms/android-21/include/byteswap.h index 74b0e9180..628fb7f3e 100644 --- a/ndk/platforms/android-21/include/byteswap.h +++ b/ndk/platforms/android-21/include/byteswap.h @@ -28,11 +28,10 @@ #ifndef _BYTESWAP_H_ #define _BYTESWAP_H_ -/* endian.h rather than sys/endian.h so we get the machine-specific file. */ -#include +#include -#define bswap_16(x) swap16(x) -#define bswap_32(x) swap32(x) -#define bswap_64(x) swap64(x) +#define bswap_16(x) __swap16(x) +#define bswap_32(x) __swap32(x) +#define bswap_64(x) __swap64(x) #endif /* _BYTESWAP_H_ */ diff --git a/ndk/platforms/android-21/include/complex.h b/ndk/platforms/android-21/include/complex.h index e6fdacdfd..db93e7b09 100644 --- a/ndk/platforms/android-21/include/complex.h +++ b/ndk/platforms/android-21/include/complex.h @@ -48,44 +48,44 @@ _Static_assert(__generic(_Complex_I, float _Complex, 1, 0), __BEGIN_DECLS -double cabs(double complex) __NDK_FPABI__; -float cabsf(float complex) __NDK_FPABI__; -long double cabsl(long double complex) __NDK_FPABI__; -double carg(double complex) __NDK_FPABI__; -float cargf(float complex) __NDK_FPABI__; -long double cargl(long double complex) __NDK_FPABI__; -double complex ccos(double complex) __NDK_FPABI__; -float complex ccosf(float complex) __NDK_FPABI__; -double complex ccosh(double complex) __NDK_FPABI__; -float complex ccoshf(float complex) __NDK_FPABI__; -double complex cexp(double complex) __NDK_FPABI__; -float complex cexpf(float complex) __NDK_FPABI__; -double cimag(double complex) __pure2 __NDK_FPABI__; -float cimagf(float complex) __pure2 __NDK_FPABI__; -long double cimagl(long double complex) __pure2 __NDK_FPABI__; -double complex conj(double complex) __pure2 __NDK_FPABI__; -float complex conjf(float complex) __pure2 __NDK_FPABI__; +double cabs(double complex) __NDK_FPABI_MATH__; +float cabsf(float complex) __NDK_FPABI_MATH__; +long double cabsl(long double complex) __NDK_FPABI_MATH__; +double carg(double complex) __NDK_FPABI_MATH__; +float cargf(float complex) __NDK_FPABI_MATH__; +long double cargl(long double complex) __NDK_FPABI_MATH__; +double complex ccos(double complex) __NDK_FPABI_MATH__; +float complex ccosf(float complex) __NDK_FPABI_MATH__; +double complex ccosh(double complex) __NDK_FPABI_MATH__; +float complex ccoshf(float complex) __NDK_FPABI_MATH__; +double complex cexp(double complex) __NDK_FPABI_MATH__; +float complex cexpf(float complex) __NDK_FPABI_MATH__; +double cimag(double complex) __pure2 __NDK_FPABI_MATH__; +float cimagf(float complex) __pure2 __NDK_FPABI_MATH__; +long double cimagl(long double complex) __pure2 __NDK_FPABI_MATH__; +double complex conj(double complex) __pure2 __NDK_FPABI_MATH__; +float complex conjf(float complex) __pure2 __NDK_FPABI_MATH__; long double complex - conjl(long double complex) __pure2 __NDK_FPABI__; -float complex cprojf(float complex) __pure2 __NDK_FPABI__; -double complex cproj(double complex) __pure2 __NDK_FPABI__; + conjl(long double complex) __pure2 __NDK_FPABI_MATH__; +float complex cprojf(float complex) __pure2 __NDK_FPABI_MATH__; +double complex cproj(double complex) __pure2 __NDK_FPABI_MATH__; long double complex - cprojl(long double complex) __pure2 __NDK_FPABI__; -double creal(double complex) __pure2 __NDK_FPABI__; -float crealf(float complex) __pure2 __NDK_FPABI__; -long double creall(long double complex) __pure2 __NDK_FPABI__; -double complex csin(double complex) __NDK_FPABI__; -float complex csinf(float complex) __NDK_FPABI__; -double complex csinh(double complex) __NDK_FPABI__; -float complex csinhf(float complex) __NDK_FPABI__; -double complex csqrt(double complex) __NDK_FPABI__; -float complex csqrtf(float complex) __NDK_FPABI__; + cprojl(long double complex) __pure2 __NDK_FPABI_MATH__; +double creal(double complex) __pure2 __NDK_FPABI_MATH__; +float crealf(float complex) __pure2 __NDK_FPABI_MATH__; +long double creall(long double complex) __pure2 __NDK_FPABI_MATH__; +double complex csin(double complex) __NDK_FPABI_MATH__; +float complex csinf(float complex) __NDK_FPABI_MATH__; +double complex csinh(double complex) __NDK_FPABI_MATH__; +float complex csinhf(float complex) __NDK_FPABI_MATH__; +double complex csqrt(double complex) __NDK_FPABI_MATH__; +float complex csqrtf(float complex) __NDK_FPABI_MATH__; long double complex - csqrtl(long double complex) __NDK_FPABI__; -double complex ctan(double complex) __NDK_FPABI__; -float complex ctanf(float complex) __NDK_FPABI__; -double complex ctanh(double complex) __NDK_FPABI__; -float complex ctanhf(float complex) __NDK_FPABI__; + csqrtl(long double complex) __NDK_FPABI_MATH__; +double complex ctan(double complex) __NDK_FPABI_MATH__; +float complex ctanf(float complex) __NDK_FPABI_MATH__; +double complex ctanh(double complex) __NDK_FPABI_MATH__; +float complex ctanhf(float complex) __NDK_FPABI_MATH__; __END_DECLS diff --git a/ndk/platforms/android-21/arch-p/include/machine/endian.h b/ndk/platforms/android-21/include/machine/endian.h similarity index 90% rename from ndk/platforms/android-21/arch-p/include/machine/endian.h rename to ndk/platforms/android-21/include/machine/endian.h index d54fc5247..ac8951920 100644 --- a/ndk/platforms/android-21/arch-p/include/machine/endian.h +++ b/ndk/platforms/android-21/include/machine/endian.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 The Android Open Source Project + * Copyright (C) 2014 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,9 +29,7 @@ #ifndef _MACHINE_ENDIAN_H_ #define _MACHINE_ENDIAN_H_ -#include +/* This file is for BSD source compatibility only. Use or instead. */ #include -#define _BYTE_ORDER _LITTLE_ENDIAN - #endif /* _MACHINE_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/include/sys/cdefs.h b/ndk/platforms/android-21/include/sys/cdefs.h index 8ee34f720..314504908 100644 --- a/ndk/platforms/android-21/include/sys/cdefs.h +++ b/ndk/platforms/android-21/include/sys/cdefs.h @@ -577,7 +577,21 @@ #endif #define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1) +/* __NDK_FPABI__ or __NDK_FPABI_MATH__ are applied to APIs taking or returning float or + [long] double, to ensure even at the presence of -mhard-float (which implies + -mfloat-abi=hard), calling to 32-bit Android native APIs still follow -mfloat-abi=softfp. + __NDK_FPABI_MATH__ is applied to APIs in math.h. It normally equals to __NDK_FPABI__, + but allows use of customized libm.a compiled with -mhard-float by -D_NDK_MATH_NO_SOFTFP=1 + + NOTE: Disable for clang for now unless _NDK_MATH_NO_SOFTFP=1, because clang before 3.4 doesn't + allow change of calling convension for builtin and produces error message reads: + + a.i:564:6: error: function declared 'aapcs' here was previously declared without calling convention + int sin(double d) __attribute__((pcs("aapcs"))); + ^ + a.i:564:6: note: previous declaration is here + */ #if defined(__ANDROID__) && !defined(__LP64__) && defined( __arm__) #define __NDK_FPABI__ __attribute__((pcs("aapcs"))) #else diff --git a/ndk/platforms/android-21/include/sys/endian.h b/ndk/platforms/android-21/include/sys/endian.h index be4c90561..60cc0304c 100644 --- a/ndk/platforms/android-21/include/sys/endian.h +++ b/ndk/platforms/android-21/include/sys/endian.h @@ -1,5 +1,3 @@ -/* $OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $ */ - /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. * @@ -24,169 +22,30 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * Generic definitions for little- and big-endian systems. Other endianesses - * has to be dealt with in the specific machine/endian.h file for that port. - * - * This file is meant to be included from a little- or big-endian port's - * machine/endian.h after setting _BYTE_ORDER to either 1234 for little endian - * or 4321 for big.. - */ - #ifndef _SYS_ENDIAN_H_ #define _SYS_ENDIAN_H_ #include -#include #include #define _LITTLE_ENDIAN 1234 #define _BIG_ENDIAN 4321 #define _PDP_ENDIAN 3412 +#define _BYTE_ORDER _LITTLE_ENDIAN +#define __LITTLE_ENDIAN_BITFIELD -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#ifdef __GNUC__ - -#define __swap16gen(x) __statement({ \ - __uint16_t __swap16gen_x = (x); \ - \ - (__uint16_t)((__swap16gen_x & 0xff) << 8 | \ - (__swap16gen_x & 0xff00) >> 8); \ -}) - -#define __swap32gen(x) __statement({ \ - __uint32_t __swap32gen_x = (x); \ - \ - (__uint32_t)((__swap32gen_x & 0xff) << 24 | \ - (__swap32gen_x & 0xff00) << 8 | \ - (__swap32gen_x & 0xff0000) >> 8 | \ - (__swap32gen_x & 0xff000000) >> 24); \ -}) - -#define __swap64gen(x) __statement({ \ - __uint64_t __swap64gen_x = (x); \ - \ - (__uint64_t)((__swap64gen_x & 0xff) << 56 | \ - (__swap64gen_x & 0xff00ULL) << 40 | \ - (__swap64gen_x & 0xff0000ULL) << 24 | \ - (__swap64gen_x & 0xff000000ULL) << 8 | \ - (__swap64gen_x & 0xff00000000ULL) >> 8 | \ - (__swap64gen_x & 0xff0000000000ULL) >> 24 | \ - (__swap64gen_x & 0xff000000000000ULL) >> 40 | \ - (__swap64gen_x & 0xff00000000000000ULL) >> 56); \ -}) - -#else /* __GNUC__ */ - -/* Note that these macros evaluate their arguments several times. */ -#define __swap16gen(x) \ - (__uint16_t)(((__uint16_t)(x) & 0xff) << 8 | ((__uint16_t)(x) & 0xff00) >> 8) - -#define __swap32gen(x) \ - (__uint32_t)(((__uint32_t)(x) & 0xff) << 24 | \ - ((__uint32_t)(x) & 0xff00) << 8 | ((__uint32_t)(x) & 0xff0000) >> 8 |\ - ((__uint32_t)(x) & 0xff000000) >> 24) - -#define __swap64gen(x) \ - (__uint64_t)((((__uint64_t)(x) & 0xff) << 56) | \ - ((__uint64_t)(x) & 0xff00ULL) << 40 | \ - ((__uint64_t)(x) & 0xff0000ULL) << 24 | \ - ((__uint64_t)(x) & 0xff000000ULL) << 8 | \ - ((__uint64_t)(x) & 0xff00000000ULL) >> 8 | \ - ((__uint64_t)(x) & 0xff0000000000ULL) >> 24 | \ - ((__uint64_t)(x) & 0xff000000000000ULL) >> 40 | \ - ((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) - -#endif /* __GNUC__ */ - -/* - * Define MD_SWAP if you provide swap{16,32}md functions/macros that are - * optimized for your architecture, These will be used for swap{16,32} - * unless the argument is a constant and we are using GCC, where we can - * take advantage of the CSE phase much better by using the generic version. - */ -#ifdef MD_SWAP -#if __GNUC__ - -#define __swap16(x) __statement({ \ - __uint16_t __swap16_x = (x); \ - \ - __builtin_constant_p(x) ? __swap16gen(__swap16_x) : \ - __swap16md(__swap16_x); \ -}) - -#define __swap32(x) __statement({ \ - __uint32_t __swap32_x = (x); \ - \ - __builtin_constant_p(x) ? __swap32gen(__swap32_x) : \ - __swap32md(__swap32_x); \ -}) - -#define __swap64(x) __statement({ \ - __uint64_t __swap64_x = (x); \ - \ - __builtin_constant_p(x) ? __swap64gen(__swap64_x) : \ - __swap64md(__swap64_x); \ -}) - -#endif /* __GNUC__ */ - -#else /* MD_SWAP */ -#define __swap16 __swap16gen -#define __swap32 __swap32gen -#define __swap64 __swap64gen -#endif /* MD_SWAP */ - -#define __swap16_multi(v, n) do { \ - __size_t __swap16_multi_n = (n); \ - __uint16_t *__swap16_multi_v = (v); \ - \ - while (__swap16_multi_n) { \ - *__swap16_multi_v = swap16(*__swap16_multi_v); \ - __swap16_multi_v++; \ - __swap16_multi_n--; \ - } \ -} while (0) - -#if __BSD_VISIBLE -#define swap16 __swap16 -#define swap32 __swap32 -#define swap64 __swap64 -#define swap16_multi __swap16_multi -#endif /* __BSD_VISIBLE */ - -#if _BYTE_ORDER == _LITTLE_ENDIAN - -/* Can be overridden by machine/endian.h before inclusion of this file. */ -#ifndef _QUAD_HIGHWORD -#define _QUAD_HIGHWORD 1 +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN _LITTLE_ENDIAN #endif -#ifndef _QUAD_LOWWORD -#define _QUAD_LOWWORD 0 +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN _BIG_ENDIAN #endif +#define __BYTE_ORDER _BYTE_ORDER -#if __BSD_VISIBLE -#define htobe16 __swap16 -#define htobe32 __swap32 -#define htobe64 __swap64 -#define betoh16 __swap16 -#define betoh32 __swap32 -#define betoh64 __swap64 - -#define htole16(x) (x) -#define htole32(x) (x) -#define htole64(x) (x) -#define letoh16(x) (x) -#define letoh32(x) (x) -#define letoh64(x) (x) -#endif /* __BSD_VISIBLE */ +#define __swap16 __builtin_bswap16 +#define __swap32 __builtin_bswap32 +#define __swap64 __builtin_bswap64 /* glibc compatibility. */ __BEGIN_DECLS @@ -205,67 +64,31 @@ __END_DECLS #define htonq(x) __swap64(x) #define ntohq(x) __swap64(x) -#define __LITTLE_ENDIAN_BITFIELD - -#endif /* _BYTE_ORDER */ - -#if _BYTE_ORDER == _BIG_ENDIAN - -/* Can be overridden by machine/endian.h before inclusion of this file. */ -#ifndef _QUAD_HIGHWORD -#define _QUAD_HIGHWORD 0 -#endif -#ifndef _QUAD_LOWWORD -#define _QUAD_LOWWORD 1 -#endif - #if __BSD_VISIBLE -#define htole16 __swap16 -#define htole32 __swap32 -#define htole64 __swap64 -#define letoh16 __swap16 -#define letoh32 __swap32 -#define letoh64 __swap64 - -#define htobe16(x) (x) -#define htobe32(x) (x) -#define htobe64(x) (x) -#define betoh16(x) (x) -#define betoh32(x) (x) -#define betoh64(x) (x) -#endif /* __BSD_VISIBLE */ - -#define htons(x) (x) -#define htonl(x) (x) -#define ntohs(x) (x) -#define ntohl(x) (x) - -/* Bionic additions */ -#define ntohq(x) (x) -#define htonq(x) (x) - -#define __BIG_ENDIAN_BITFIELD - -#endif /* _BYTE_ORDER */ +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER -#if __BSD_VISIBLE #define NTOHL(x) (x) = ntohl((u_int32_t)(x)) #define NTOHS(x) (x) = ntohs((u_int16_t)(x)) #define HTONL(x) (x) = htonl((u_int32_t)(x)) #define HTONS(x) (x) = htons((u_int16_t)(x)) -#endif - -#define __BYTE_ORDER _BYTE_ORDER -#ifndef __LITTLE_ENDIAN -#define __LITTLE_ENDIAN _LITTLE_ENDIAN -#endif -#ifndef __BIG_ENDIAN -#define __BIG_ENDIAN _BIG_ENDIAN -#endif +#define htobe16 __swap16 +#define htobe32 __swap32 +#define htobe64 __swap64 +#define betoh16 __swap16 +#define betoh32 __swap32 +#define betoh64 __swap64 +#define htole16(x) (x) +#define htole32(x) (x) +#define htole64(x) (x) +#define letoh16(x) (x) +#define letoh32(x) (x) +#define letoh64(x) (x) -#ifdef __BSD_VISIBLE /* * glibc-compatible beXXtoh/leXXtoh synonyms for htobeXX/htoleXX. * The BSDs export both sets of names, bionic historically only @@ -278,6 +101,6 @@ __END_DECLS #define le16toh(x) htole16(x) #define le32toh(x) htole32(x) #define le64toh(x) htole64(x) -#endif +#endif /* __BSD_VISIBLE */ #endif /* _SYS_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/include/sys/procfs.h b/ndk/platforms/android-21/include/sys/procfs.h new file mode 100644 index 000000000..7ef5023ab --- /dev/null +++ b/ndk/platforms/android-21/include/sys/procfs.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_PROCFS_H_ +#define _SYS_PROCFS_H_ + +#include +#include + +__BEGIN_DECLS + +typedef unsigned long elf_greg_t; +typedef elf_greg_t elf_gregset_t[NGREG]; + +typedef fpregset_t elf_fpregset_t; + +#if defined(__i386__) +typedef struct user_fpxregs_struct elf_fpxregset_t; +#endif + +typedef elf_gregset_t prgregset_t; +typedef elf_fpregset_t prfpregset_t; + +typedef pid_t lwpid_t; +typedef void* psaddr_t; + +__END_DECLS + +#endif /* _SYS_PROCFS_H_ */ diff --git a/ndk/platforms/android-21/include/sys/ucontext.h b/ndk/platforms/android-21/include/sys/ucontext.h index dd2a0bba6..9e3c6530d 100644 --- a/ndk/platforms/android-21/include/sys/ucontext.h +++ b/ndk/platforms/android-21/include/sys/ucontext.h @@ -59,6 +59,7 @@ enum { typedef int greg_t; typedef greg_t gregset_t[NGREG]; +typedef struct user_fpregs fpregset_t; #include typedef struct sigcontext mcontext_t; @@ -81,6 +82,7 @@ typedef struct ucontext { #define NGREG 34 /* x0..x30 + sp + pc + pstate */ typedef unsigned long greg_t; typedef greg_t gregset_t[NGREG]; +typedef struct user_fpsimd_struct fpregset_t; #include typedef struct sigcontext mcontext_t; @@ -180,6 +182,25 @@ typedef struct fpregset { } fp_r; } fpregset_t; +#ifdef __LP64__ +typedef struct { + gregset_t gregs; + fpregset_t fpregs; + greg_t mdhi; + greg_t hi1; + greg_t hi2; + greg_t hi3; + greg_t mdlo; + greg_t lo1; + greg_t lo2; + greg_t lo3; + greg_t pc; + uint32_t fpc_csr; + uint32_t used_math; + uint32_t dsp; + uint32_t reserved; +} mcontext_t; +#else typedef struct { unsigned regmask; unsigned status; @@ -200,6 +221,7 @@ typedef struct { unsigned long hi3; unsigned long lo3; } mcontext_t; +#endif typedef struct ucontext { unsigned long uc_flags; @@ -209,10 +231,6 @@ typedef struct ucontext { sigset_t uc_sigmask; } ucontext_t; -#elif defined(__mips64__) - -#error TODO - #elif defined(__x86_64__) enum { diff --git a/ndk/platforms/android-21/include/sys/user.h b/ndk/platforms/android-21/include/sys/user.h index c969726a4..3312981d3 100644 --- a/ndk/platforms/android-21/include/sys/user.h +++ b/ndk/platforms/android-21/include/sys/user.h @@ -30,11 +30,13 @@ #define _SYS_USER_H_ #include -#include /* For PAGE_SIZE. */ #include /* For size_t. */ __BEGIN_DECLS +#define PAGE_SIZE 4096 +#define PAGE_MASK (~(PAGE_SIZE - 1)) + #if __i386__ struct user_fpregs_struct { @@ -47,7 +49,7 @@ struct user_fpregs_struct { long fos; long st_space[20]; }; -struct user_fxsr_struct { +struct user_fpxregs_struct { unsigned short cwd; unsigned short swd; unsigned short twd; @@ -166,10 +168,6 @@ struct user { }; #elif defined(__mips__) -struct user_regs_struct -{ - unsigned long regs[180 / sizeof(unsigned long) + 64]; -}; struct user { unsigned long regs[180 / sizeof(unsigned long) + 64]; @@ -234,7 +232,17 @@ struct user { #elif defined(__aarch64__) -// There are no user structures for 64 bit arm. +struct user_regs_struct { + uint64_t regs[31]; + uint64_t sp; + uint64_t pc; + uint64_t pstate; +}; +struct user_fpsimd_struct { + __uint128_t vregs[32]; + uint32_t fpsr; + uint32_t fpcr; +}; #else diff --git a/ndk/platforms/android-21/include/uchar.h b/ndk/platforms/android-21/include/uchar.h index e1fcb5c65..a5e72eade 100644 --- a/ndk/platforms/android-21/include/uchar.h +++ b/ndk/platforms/android-21/include/uchar.h @@ -34,6 +34,11 @@ __BEGIN_DECLS +#if __STDC_VERSION__ >= 201112L && !defined(__cplusplus) +typedef __CHAR16_TYPE__ char16_t; +typedef __CHAR32_TYPE__ char32_t; +#endif + #define __STD_UTF_16__ 1 #define __STD_UTF_32__ 1 diff --git a/ndk/platforms/android-M/include/android/multinetwork.h b/ndk/platforms/android-23/include/android/multinetwork.h similarity index 100% rename from ndk/platforms/android-M/include/android/multinetwork.h rename to ndk/platforms/android-23/include/android/multinetwork.h diff --git a/ndk/platforms/android-M/include/android/trace.h b/ndk/platforms/android-23/include/android/trace.h similarity index 100% rename from ndk/platforms/android-M/include/android/trace.h rename to ndk/platforms/android-23/include/android/trace.h diff --git a/ndk/platforms/android-3/arch-arm/include/fenv.h b/ndk/platforms/android-3/arch-arm/include/fenv.h index a96f99ed8..126396065 100644 --- a/ndk/platforms/android-3/arch-arm/include/fenv.h +++ b/ndk/platforms/android-3/arch-arm/include/fenv.h @@ -66,14 +66,50 @@ extern const fenv_t __fe_dfl_env; static __inline int fegetenv(fenv_t* __envp) { fenv_t _fpscr; +#if !defined(__SOFTFP__) + #if !defined(__thumb__) || defined(__thumb2__) __asm__ __volatile__("vmrs %0,fpscr" : "=r" (_fpscr)); + #else + /* Switching from thumb1 to arm, do vmrs, then switch back */ + __asm__ __volatile__( + ".balign 4 \n\t" + "mov ip, pc \n\t" + "bx ip \n\t" + ".arm \n\t" + "vmrs %0, fpscr \n\t" + "add ip, pc, #1 \n\t" + "bx ip \n\t" + ".thumb \n\t" + : "=r" (_fpscr) : : "ip"); + #endif +#else + _fpscr = 0; +#endif *__envp = _fpscr; return 0; } static __inline int fesetenv(const fenv_t* __envp) { fenv_t _fpscr = *__envp; +#if !defined(__SOFTFP__) + #if !defined(__thumb__) || defined(__thumb2__) __asm__ __volatile__("vmsr fpscr,%0" : :"ri" (_fpscr)); + #else + /* Switching from thumb1 to arm, do vmsr, then switch back */ + __asm__ __volatile__( + ".balign 4 \n\t" + "mov ip, pc \n\t" + "bx ip \n\t" + ".arm \n\t" + "vmsr fpscr, %0 \n\t" + "add ip, pc, #1 \n\t" + "bx ip \n\t" + ".thumb \n\t" + : : "ri" (_fpscr) : "ip"); + #endif +#else + _fpscr = _fpscr; +#endif return 0; } diff --git a/ndk/platforms/android-3/arch-arm/include/machine/endian.h b/ndk/platforms/android-3/arch-arm/include/machine/endian.h deleted file mode 100644 index 7cba3b942..000000000 --- a/ndk/platforms/android-3/arch-arm/include/machine/endian.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $OpenBSD: endian.h,v 1.3 2005/12/13 00:35:23 millert Exp $ */ - -/* - * Copyright (C) 2010 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _ARM_ENDIAN_H_ -#define _ARM_ENDIAN_H_ - -#ifdef __GNUC__ - -/* - * REV and REV16 weren't available on ARM5 or ARM4. - * We don't include because it pollutes the - * namespace with macros like PLD. - */ -#if !defined __ARM_ARCH_5__ && !defined __ARM_ARCH_5T__ && \ - !defined __ARM_ARCH_5TE__ && !defined __ARM_ARCH_5TEJ__ && \ - !defined __ARM_ARCH_4T__ && !defined __ARM_ARCH_4__ - -/* According to RealView Assembler User's Guide, REV and REV16 are available - * in Thumb code and 16-bit instructions when used in Thumb-2 code. - * - * REV Rd, Rm - * Rd and Rm must both be Lo registers. - * - * REV16 Rd, Rm - * Rd and Rm must both be Lo registers. - * - * The +l constraint takes care of this without constraining us in ARM mode. - */ -#define __swap16md(x) ({ \ - register u_int16_t _x = (x); \ - __asm volatile ("rev16 %0, %0" : "+l" (_x)); \ - _x; \ -}) - -#define __swap32md(x) ({ \ - register u_int32_t _x = (x); \ - __asm volatile ("rev %0, %0" : "+l" (_x)); \ - _x; \ -}) - -#define __swap64md(x) ({ \ - u_int64_t _swap64md_x = (x); \ - (u_int64_t) __swap32md(_swap64md_x >> 32) | \ - (u_int64_t) __swap32md(_swap64md_x & 0xffffffff) << 32; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __ARM_ARCH__ */ -#endif /* __GNUC__ */ - -#if defined(__ARMEB__) -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif -#define __STRICT_ALIGNMENT -#include -#include - -#endif /* !_ARM_ENDIAN_H_ */ diff --git a/ndk/platforms/android-3/arch-arm/symbols/libthread_db.so.functions.txt b/ndk/platforms/android-3/arch-arm/symbols/libthread_db.so.functions.txt deleted file mode 100644 index 473500dc8..000000000 --- a/ndk/platforms/android-3/arch-arm/symbols/libthread_db.so.functions.txt +++ /dev/null @@ -1,42 +0,0 @@ -_Unwind_Backtrace -_Unwind_Complete -_Unwind_DeleteException -_Unwind_ForcedUnwind -_Unwind_GetCFA -_Unwind_GetDataRelBase -_Unwind_GetLanguageSpecificData -_Unwind_GetRegionStart -_Unwind_GetTextRelBase -_Unwind_RaiseException -_Unwind_Resume -_Unwind_Resume_or_Rethrow -_Unwind_VRS_Get -_Unwind_VRS_Pop -_Unwind_VRS_Set -___Unwind_Backtrace -___Unwind_ForcedUnwind -___Unwind_RaiseException -___Unwind_Resume -___Unwind_Resume_or_Rethrow -__aeabi_unwind_cpp_pr0 -__aeabi_unwind_cpp_pr1 -__aeabi_unwind_cpp_pr2 -__gnu_Unwind_Backtrace -__gnu_Unwind_ForcedUnwind -__gnu_Unwind_RaiseException -__gnu_Unwind_Restore_VFP -__gnu_Unwind_Resume -__gnu_Unwind_Resume_or_Rethrow -__gnu_Unwind_Save_VFP -__gnu_unwind_execute -__gnu_unwind_frame -__restore_core_regs -restore_core_regs -td_symbol_list -td_ta_event_addr -td_ta_event_getmsg -td_ta_new -td_ta_set_event -td_ta_thr_iter -td_thr_event_enable -td_thr_get_info diff --git a/ndk/platforms/android-3/arch-arm/symbols/libthread_db.so.variables.txt b/ndk/platforms/android-3/arch-arm/symbols/libthread_db.so.variables.txt deleted file mode 100644 index 8b1378917..000000000 --- a/ndk/platforms/android-3/arch-arm/symbols/libthread_db.so.variables.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ndk/platforms/android-3/header-patches/headers.patch b/ndk/platforms/android-3/header-patches/headers.patch deleted file mode 100644 index 56b44a410..000000000 --- a/ndk/platforms/android-3/header-patches/headers.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff -Naur a/include/asm/a.out.h b/include/asm/a.out.h ---- a/include/asm/a.out.h 2013-06-10 08:16:13.496310000 +0800 -+++ b/include/asm/a.out.h 2013-09-06 14:13:28.366275000 +0800 -@@ -33,7 +33,7 @@ - #define N_DRSIZE(a) ((a).a_drsize) - #define N_SYMSIZE(a) ((a).a_syms) - --#define M_MACHINE 103 -+#define M_ARM 103 - - #ifndef LIBRARY_START_TEXT - #define LIBRARY_START_TEXT (0x00c00000) -diff -Naur a/include/asm/byteorder.h b/include/asm/byteorder.h ---- a/include/asm/byteorder.h 2013-09-03 12:33:37.353419000 +0800 -+++ b/include/asm/byteorder.h 2013-08-30 17:41:09.234265000 +0800 -@@ -19,12 +19,6 @@ - { - __u32 t; - --#ifndef __thumb__ -- if (!__builtin_constant_p(x)) { -- -- __asm__ ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x)); -- } else --#endif - t = x ^ ((x << 16) | (x >> 16)); - - x = (x << 24) | (x >> 8); -diff -Naur a/include/asm/stat.h b/include/asm/stat.h ---- a/include/asm/stat.h 2013-09-03 12:33:37.367418000 +0800 -+++ b/include/asm/stat.h 2013-08-30 17:41:09.431302000 +0800 -@@ -29,23 +29,13 @@ - #define STAT_HAVE_NSEC - - struct stat { --#ifdef __ARMEB__ -- unsigned short st_dev; -- unsigned short __pad1; --#else - unsigned long st_dev; --#endif - unsigned long st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; --#ifdef __ARMEB__ -- unsigned short st_rdev; -- unsigned short __pad2; --#else - unsigned long st_rdev; --#endif - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; -diff -Naur a/include/asm/types.h b/include/asm/types.h ---- a/include/asm/types.h 2013-09-03 12:33:37.313428000 +0800 -+++ b/include/asm/types.h 2013-08-30 17:41:09.467274000 +0800 -@@ -25,7 +25,7 @@ - typedef __signed__ int __s32; - typedef unsigned int __u32; - --#ifdef __GNUC__ -+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) - typedef __signed__ long long __s64; - typedef unsigned long long __u64; - #endif -diff -Naur a/include/asm/unaligned.h b/include/asm/unaligned.h ---- a/include/asm/unaligned.h 2013-09-03 12:33:37.376422000 +0800 -+++ b/include/asm/unaligned.h 2013-08-30 17:41:09.500316000 +0800 -@@ -28,11 +28,6 @@ - - #define __put_unaligned_le(val,ptr) ({ switch (sizeof(*(ptr))) { case 1: *(ptr) = (val); break; case 2: __put_unaligned_2_le((val),(__u8 *)(ptr)); break; case 4: __put_unaligned_4_le((val),(__u8 *)(ptr)); break; case 8: __put_unaligned_8_le((val),(__u8 *)(ptr)); break; default: __bug_unaligned_x(ptr); break; } (void) 0; }) - #define __put_unaligned_be(val,ptr) ({ switch (sizeof(*(ptr))) { case 1: *(ptr) = (val); break; case 2: __put_unaligned_2_be((val),(__u8 *)(ptr)); break; case 4: __put_unaligned_4_be((val),(__u8 *)(ptr)); break; case 8: __put_unaligned_8_be((val),(__u8 *)(ptr)); break; default: __bug_unaligned_x(ptr); break; } (void) 0; }) --#ifndef __ARMEB__ - #define get_unaligned __get_unaligned_le - #define put_unaligned __put_unaligned_le --#else --#define get_unaligned __get_unaligned_be --#define put_unaligned __put_unaligned_be --#endif - #endif -diff -Naur a/include/asm/unistd.h b/include/asm/unistd.h ---- a/include/asm/unistd.h 2013-09-03 12:33:37.322427000 +0800 -+++ b/include/asm/unistd.h 2013-08-30 17:41:09.506276000 +0800 -@@ -19,12 +19,7 @@ - #ifndef __ASM_MACHINE_UNISTD_H - #define __ASM_MACHINE_UNISTD_H - #define __NR_OABI_SYSCALL_BASE 0x900000 --#if defined(__thumb__) || defined(__ARM_EABI__) --/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - #define __NR_SYSCALL_BASE 0 --#else --#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE --#endif - /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - #define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0) - #define __NR_exit (__NR_SYSCALL_BASE+ 1) -diff -Naur a/include/asm/user.h b/include/asm/user.h ---- a/include/asm/user.h 2013-09-03 12:33:37.118421000 +0800 -+++ b/include/asm/user.h 2013-08-30 17:41:09.519301000 +0800 -@@ -58,15 +58,4 @@ - #define HOST_TEXT_START_ADDR (u.start_code) - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) - --struct user_vfp { -- unsigned long long fpregs[32]; -- unsigned long fpscr; --}; -- --struct user_vfp_exc { -- unsigned long fpexc; -- unsigned long fpinst; -- unsigned long fpinst2; --}; -- - #endif -diff -Naur a/include/machine/asm.h b/include/machine/asm.h ---- a/include/machine/asm.h 2013-09-03 12:33:37.135419000 +0800 -+++ b/include/machine/asm.h 2013-08-30 17:41:09.533294000 +0800 -@@ -78,17 +78,7 @@ - .fnend; \ - _ASM_SIZE(x) - --#ifdef GPROF --# ifdef __ELF__ --# define _PROF_PROLOGUE \ -- mov ip, lr; bl __mcount --# else --# define _PROF_PROLOGUE \ -- mov ip,lr; bl mcount --# endif --#else - # define _PROF_PROLOGUE --#endif - - #define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE - #define ENTRY_NP(y) _ENTRY(_C_LABEL(y)) diff --git a/ndk/platforms/android-3/header-patches/include/asm-generic/fcntl.h b/ndk/platforms/android-3/header-patches/include/asm-generic/fcntl.h deleted file mode 100644 index 83c58e615..000000000 --- a/ndk/platforms/android-3/header-patches/include/asm-generic/fcntl.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef _ASM_GENERIC_FCNTL_H -#define _ASM_GENERIC_FCNTL_H - -#include - -#define O_ACCMODE 00000003 -#define O_RDONLY 00000000 -#define O_WRONLY 00000001 -#define O_RDWR 00000002 -#ifndef O_CREAT -#define O_CREAT 00000100 -#endif -#ifndef O_EXCL -#define O_EXCL 00000200 -#endif -#ifndef O_NOCTTY -#define O_NOCTTY 00000400 -#endif -#ifndef O_TRUNC -#define O_TRUNC 00001000 -#endif -#ifndef O_APPEND -#define O_APPEND 00002000 -#endif -#ifndef O_NONBLOCK -#define O_NONBLOCK 00004000 -#endif -#ifndef O_SYNC -#define O_SYNC 00010000 -#endif -#ifndef FASYNC -#define FASYNC 00020000 -#endif -#ifndef O_DIRECT -#define O_DIRECT 00040000 -#endif -#ifndef O_LARGEFILE -#define O_LARGEFILE 00100000 -#endif -#ifndef O_DIRECTORY -#define O_DIRECTORY 00200000 -#endif -#ifndef O_NOFOLLOW -#define O_NOFOLLOW 00400000 -#endif -#ifndef O_NOATIME -#define O_NOATIME 01000000 -#endif -#ifndef O_NDELAY -#define O_NDELAY O_NONBLOCK -#endif - -#define F_DUPFD 0 -#define F_GETFD 1 -#define F_SETFD 2 -#define F_GETFL 3 -#define F_SETFL 4 -#ifndef F_GETLK -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 -#endif -#ifndef F_SETOWN -#define F_SETOWN 8 -#define F_GETOWN 9 -#endif -#ifndef F_SETSIG -#define F_SETSIG 10 -#define F_GETSIG 11 -#endif - -#define FD_CLOEXEC 1 - -#ifndef F_RDLCK -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 -#endif - -#ifndef F_EXLCK -#define F_EXLCK 4 -#define F_SHLCK 8 -#endif - -#ifndef F_INPROGRESS -#define F_INPROGRESS 16 -#endif - -#define LOCK_SH 1 -#define LOCK_EX 2 -#define LOCK_NB 4 -#define LOCK_UN 8 - -#define LOCK_MAND 32 -#define LOCK_READ 64 -#define LOCK_WRITE 128 -#define LOCK_RW 192 - -#define F_LINUX_SPECIFIC_BASE 1024 - -#ifndef HAVE_ARCH_STRUCT_FLOCK -#ifndef __ARCH_FLOCK_PAD -#define __ARCH_FLOCK_PAD -#endif - -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; - __ARCH_FLOCK_PAD -}; -#endif - -#ifndef F_GETLK64 -#define F_GETLK64 12 -#define F_SETLK64 13 -#define F_SETLKW64 14 -#endif - -#ifndef HAVE_ARCH_STRUCT_FLOCK64 -#ifndef __ARCH_FLOCK64_PAD -#define __ARCH_FLOCK64_PAD -#endif - -struct flock64 { - short l_type; - short l_whence; - unsigned char __padding[4]; - loff_t l_start; - loff_t l_len; - pid_t l_pid; - __ARCH_FLOCK64_PAD -}; - -#endif -#endif diff --git a/ndk/platforms/android-3/header-patches/include/asm/div64.h b/ndk/platforms/android-3/header-patches/include/asm/div64.h deleted file mode 100644 index cde72748b..000000000 --- a/ndk/platforms/android-3/header-patches/include/asm/div64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_DIV64_H -#define __ASM_DIV64_H - -#include - -#endif diff --git a/ndk/platforms/android-3/header-patches/include/asm/elf.h b/ndk/platforms/android-3/header-patches/include/asm/elf.h deleted file mode 100644 index cec933801..000000000 --- a/ndk/platforms/android-3/header-patches/include/asm/elf.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __ASM_ELF_H -#define __ASM_ELF_H - -#include -#include - -typedef unsigned long elf_greg_t; -typedef unsigned long elf_freg_t[3]; - - -#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -typedef struct user_fp elf_fpregset_t; - -#define ELF_CLASS ELFCLASS32 -#define ELF_DATA ELFDATA2LSB - -#define USE_ELF_CORE_DUMP -#define ELF_EXEC_PAGESIZE 4096 - -#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) - - -#define ELF_HWCAP (elf_hwcap) - -#define ELF_PLATFORM_SIZE 8 - -#define ELF_PLATFORM (elf_platform) - -#endif diff --git a/ndk/platforms/android-3/header-patches/include/asm/locks.h b/ndk/platforms/android-3/header-patches/include/asm/locks.h deleted file mode 100644 index 446360330..000000000 --- a/ndk/platforms/android-3/header-patches/include/asm/locks.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_PROC_LOCKS_H -#define __ASM_PROC_LOCKS_H - -#define RW_LOCK_BIAS 0x01000000 -#define RW_LOCK_BIAS_STR "0x01000000" - -#endif diff --git a/ndk/platforms/android-3/header-patches/include/asm/ptrace.h b/ndk/platforms/android-3/header-patches/include/asm/ptrace.h deleted file mode 100644 index a0877cfc6..000000000 --- a/ndk/platforms/android-3/header-patches/include/asm/ptrace.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef __ASM_PTRACE_H -#define __ASM_PTRACE_H - -#define PTRACE_GETREGS 12 -#define PTRACE_SETREGS 13 -#define PTRACE_GETFPREGS 14 -#define PTRACE_SETFPREGS 15 - -#define PTRACE_GETWMMXREGS 18 -#define PTRACE_SETWMMXREGS 19 - -#define PTRACE_OLDSETOPTIONS 21 - -#define PTRACE_GET_THREAD_AREA 22 - -#define PTRACE_SET_SYSCALL 23 - -#define PTRACE_GETCRUNCHREGS 25 -#define PTRACE_SETCRUNCHREGS 26 - -#define USR26_MODE 0x00000000 -#define FIQ26_MODE 0x00000001 -#define IRQ26_MODE 0x00000002 -#define SVC26_MODE 0x00000003 -#define USR_MODE 0x00000010 -#define FIQ_MODE 0x00000011 -#define IRQ_MODE 0x00000012 -#define SVC_MODE 0x00000013 -#define ABT_MODE 0x00000017 -#define UND_MODE 0x0000001b -#define SYSTEM_MODE 0x0000001f -#define MODE32_BIT 0x00000010 -#define MODE_MASK 0x0000001f -#define PSR_T_BIT 0x00000020 -#define PSR_F_BIT 0x00000040 -#define PSR_I_BIT 0x00000080 -#define PSR_J_BIT 0x01000000 -#define PSR_Q_BIT 0x08000000 -#define PSR_V_BIT 0x10000000 -#define PSR_C_BIT 0x20000000 -#define PSR_Z_BIT 0x40000000 -#define PSR_N_BIT 0x80000000 -#define PCMASK 0 - -#define PSR_f 0xff000000 -#define PSR_s 0x00ff0000 -#define PSR_x 0x0000ff00 -#define PSR_c 0x000000ff - -#ifndef __ASSEMBLY__ - -struct pt_regs { - long uregs[44]; // Increase array size for ARM/x86/MIPS compatibility -}; - -#define ARM_cpsr uregs[16] -#define ARM_pc uregs[15] -#define ARM_lr uregs[14] -#define ARM_sp uregs[13] -#define ARM_ip uregs[12] -#define ARM_fp uregs[11] -#define ARM_r10 uregs[10] -#define ARM_r9 uregs[9] -#define ARM_r8 uregs[8] -#define ARM_r7 uregs[7] -#define ARM_r6 uregs[6] -#define ARM_r5 uregs[5] -#define ARM_r4 uregs[4] -#define ARM_r3 uregs[3] -#define ARM_r2 uregs[2] -#define ARM_r1 uregs[1] -#define ARM_r0 uregs[0] -#define ARM_ORIG_r0 uregs[17] - -#define x86_r15 uregs[0] -#define x86_r14 uregs[1] -#define x86_r13 uregs[2] -#define x86_r12 uregs[3] -#define x86_rbp uregs[4] -#define x86_rbx uregs[5] -#define x86_r11 uregs[6] -#define x86_r10 uregs[7] -#define x86_r9 uregs[8] -#define x86_r8 uregs[9] -#define x86_rax uregs[10] -#define x86_rcx uregs[11] -#define x86_rdx uregs[12] -#define x86_rsi uregs[13] -#define x86_rdi uregs[14] -#define x86_orig_rax uregs[15] -#define x86_rip uregs[16] -#define x86_cs uregs[17] -#define x86_eflags uregs[18] -#define x86_rsp uregs[19] -#define x86_ss uregs[20] - -#define pc_pointer(v) ((v) & ~PCMASK) - -#define instruction_pointer(regs) (pc_pointer((regs)->ARM_pc)) - -#define profile_pc(regs) instruction_pointer(regs) - -#endif - -#endif diff --git a/ndk/platforms/android-3/header-patches/include/asm/sigcontext.h b/ndk/platforms/android-3/header-patches/include/asm/sigcontext.h deleted file mode 100644 index ebbcafab9..000000000 --- a/ndk/platforms/android-3/header-patches/include/asm/sigcontext.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H - -#endif diff --git a/ndk/platforms/android-3/header-patches/include/asm/uaccess.h b/ndk/platforms/android-3/header-patches/include/asm/uaccess.h deleted file mode 100644 index ace935e9e..000000000 --- a/ndk/platforms/android-3/header-patches/include/asm/uaccess.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _ASM_UACCESS_H -#define _ASM_UACCESS_H - -#include -#include -#include -#include - -#define VERIFY_READ 0 -#define VERIFY_WRITE 1 - -struct exception_table_entry -{ - unsigned long insn, fixup; -}; - -#define KERNEL_DS 0x00000000 -#define get_ds() (KERNEL_DS) - -#define USER_DS KERNEL_DS - -#define segment_eq(a,b) (1) -#define __addr_ok(addr) (1) -#define __range_ok(addr,size) (0) -#define get_fs() (KERNEL_DS) - -#define get_user(x,p) -#define put_user(x,p) -#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) -#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) -#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) -#define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0) - -#define __copy_to_user_inatomic __copy_to_user -#define __copy_from_user_inatomic __copy_from_user -#define strlen_user(s) strnlen_user(s, ~0UL >> 1) -#endif diff --git a/ndk/platforms/android-3/header-patches/include/fenv.h b/ndk/platforms/android-3/header-patches/include/fenv.h deleted file mode 100644 index 2ee530d09..000000000 --- a/ndk/platforms/android-3/header-patches/include/fenv.h +++ /dev/null @@ -1,101 +0,0 @@ -/*- - * Copyright (c) 2004-2005 David Schultz - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/msun/arm/fenv.h,v 1.5 2005/03/16 19:03:45 das Exp $ - */ - -/* - * Rewritten for Android. - * - * The ARM FPSCR is described here: - * http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344b/Chdfafia.html - */ - -#ifndef _FENV_H_ -#define _FENV_H_ - -#include - -__BEGIN_DECLS - -/* - * arm/mips definition - */ -typedef __uint32_t fenv_t; -typedef __uint32_t fexcept_t; - -/* - * x86 definition - */ -/* -typedef struct { - __uint16_t __control; - __uint16_t __mxcsr_hi; - __uint16_t __status; - __uint16_t __mxcsr_lo; - __uint32_t __tag; - char __other[16]; -} fenv_t; -*/ - - -/* Exception flags. */ -#define FE_INVALID 0x01 -#define FE_DIVBYZERO 0x02 -#define FE_OVERFLOW 0x04 -#define FE_UNDERFLOW 0x08 -#define FE_INEXACT 0x10 -#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) - -/* Rounding modes. */ -#define FE_TONEAREST 0x0 -#define FE_UPWARD 0x1 -#define FE_DOWNWARD 0x2 -#define FE_TOWARDZERO 0x3 - -/* Default floating-point environment. */ -extern const fenv_t __fe_dfl_env; -#define FE_DFL_ENV (&__fe_dfl_env) - -/* - * Need implementations in libportable to enable following functions - * - * int fegetenv(fenv_t* __envp); - * int fesetenv(const fenv_t* __envp); - * int feholdexcept(fenv_t* __envp); - * int feupdateenv(const fenv_t* __envp); - */ - -int feclearexcept(int __excepts); -int fegetexceptflag(fexcept_t* __flagp, int __excepts); -int fesetexceptflag(const fexcept_t* __flagp, int __excepts); -int feraiseexcept(int __excepts); -int fetestexcept(int __excepts); -int fegetround(void); -int fesetround(int __round); - -__END_DECLS - -#endif /* !_FENV_H_ */ diff --git a/ndk/platforms/android-3/header-patches/include/machine/endian.h b/ndk/platforms/android-3/header-patches/include/machine/endian.h deleted file mode 100644 index 5f693579a..000000000 --- a/ndk/platforms/android-3/header-patches/include/machine/endian.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $OpenBSD: endian.h,v 1.3 2005/12/13 00:35:23 millert Exp $ */ - -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ - -#ifdef __GNUC__ - -/* - * Implement below swap{16,32,64}md functions in libportable - * that are optimized for your architecture. - * - * uint16_t __swap16md(uint16_t x); - * uint32_t __swap32md(uint32_t x); - * uint64_t __swap64md(uint64_t x); - */ - -/* Tell sys/endian.h we have MD variants of the swap macros. - * #define MD_SWAP - */ -#endif /* __GNUC__ */ - -#define _BYTE_ORDER _LITTLE_ENDIAN -#define __STRICT_ALIGNMENT -#include -#include - -#endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/ndk/platforms/android-3/header-patches/include/machine/ieee.h b/ndk/platforms/android-3/header-patches/include/machine/ieee.h deleted file mode 100644 index 823f5efa9..000000000 --- a/ndk/platforms/android-3/header-patches/include/machine/ieee.h +++ /dev/null @@ -1,151 +0,0 @@ -/* $OpenBSD: ieee.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */ -/* $NetBSD: ieee.h,v 1.2 2001/02/21 17:43:50 bjh21 Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Lawrence Berkeley Laboratory. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)ieee.h 8.1 (Berkeley) 6/11/93 - */ - -/* - * ieee.h defines the machine-dependent layout of the machine's IEEE - * floating point. - */ - -/* - * Define the number of bits in each fraction and exponent. - * - * k k+1 - * Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented - * - * (-exp_bias+1) - * as fractions that look like 0.fffff x 2 . This means that - * - * -126 - * the number 0.10000 x 2 , for instance, is the same as the normalized - * - * -127 -128 - * float 1.0 x 2 . Thus, to represent 2 , we need one leading zero - * - * -129 - * in the fraction; to represent 2 , we need two, and so on. This - * - * (-exp_bias-fracbits+1) - * implies that the smallest denormalized number is 2 - * - * for whichever format we are talking about: for single precision, for - * - * -126 -149 - * instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and - * - * -149 == -127 - 23 + 1. - */ - -/* - * The ARM has two sets of FP data formats. The FPA supports 32-bit, 64-bit - * and 96-bit IEEE formats, with the words in big-endian order. VFP supports - * 32-bin and 64-bit IEEE formats with the words in the CPU's native byte - * order. - * - * The FPA also has two packed decimal formats, but we ignore them here. - */ - -#define SNG_EXPBITS 8 -#define SNG_FRACBITS 23 - -#define DBL_EXPBITS 11 -#define DBL_FRACBITS 52 - -#define EXT_EXPBITS 15 -#define EXT_FRACBITS 112 - -struct ieee_single { - u_int sng_frac:23; - u_int sng_exp:8; - u_int sng_sign:1; -}; - -struct ieee_double { - u_int dbl_fracl; - u_int dbl_frach:20; - u_int dbl_exp:11; - u_int dbl_sign:1; -}; - -union ieee_double_u { - double dblu_d; - struct ieee_double dblu_dbl; -}; - -struct ieee_ext { - u_int ext_frach:16; - u_int ext_exp:15; - u_int ext_sign:1; - u_int ext_frachm; - u_int ext_fraclm; - u_int ext_fracl; -}; - -/* - * Floats whose exponent is in [1..INFNAN) (of whatever type) are - * `normal'. Floats whose exponent is INFNAN are either Inf or NaN. - * Floats whose exponent is zero are either zero (iff all fraction - * bits are zero) or subnormal values. - * - * A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its - * high fraction; if the bit is set, it is a `quiet NaN'. - */ -#define SNG_EXP_INFNAN 255 -#define DBL_EXP_INFNAN 2047 -#define EXT_EXP_INFNAN 32767 - -#if 0 -#define SNG_QUIETNAN (1 << 22) -#define DBL_QUIETNAN (1 << 19) -#define EXT_QUIETNAN (1 << 15) -#endif - -/* - * Exponent biases. - */ -#define SNG_EXP_BIAS 127 -#define DBL_EXP_BIAS 1023 -#define EXT_EXP_BIAS 16383 diff --git a/ndk/platforms/android-3/header-patches/include/sys/epoll.h b/ndk/platforms/android-3/header-patches/include/sys/epoll.h deleted file mode 100644 index c6b08821b..000000000 --- a/ndk/platforms/android-3/header-patches/include/sys/epoll.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#ifndef _SYS_EPOLL_H_ -#define _SYS_EPOLL_H_ - -#include - -__BEGIN_DECLS - -#define EPOLLIN 0x00000001 -#define EPOLLPRI 0x00000002 -#define EPOLLOUT 0x00000004 -#define EPOLLERR 0x00000008 -#define EPOLLHUP 0x00000010 -#define EPOLLRDNORM 0x00000040 -#define EPOLLRDBAND 0x00000080 -#define EPOLLWRNORM 0x00000100 -#define EPOLLWRBAND 0x00000200 -#define EPOLLMSG 0x00000400 -#define EPOLLET 0x80000000 - -#define EPOLL_CTL_ADD 1 -#define EPOLL_CTL_DEL 2 -#define EPOLL_CTL_MOD 3 - -typedef union epoll_data -{ - void *ptr; - int fd; - unsigned int u32; - unsigned long long u64; -} epoll_data_t; - -struct epoll_event -{ - unsigned int events; - unsigned char __padding[4]; - epoll_data_t data; -}; - -int epoll_create(int size); -int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); -int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); - -__END_DECLS - -#endif /* _SYS_EPOLL_H_ */ diff --git a/ndk/platforms/android-3/header-patches/include/sys/stat.h b/ndk/platforms/android-3/header-patches/include/sys/stat.h deleted file mode 100644 index 0a9af5bbd..000000000 --- a/ndk/platforms/android-3/header-patches/include/sys/stat.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#ifndef _SYS_STAT_H_ -#define _SYS_STAT_H_ - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* really matches stat64 in the kernel, hence the padding - * Note: The kernel zero's the padded region because glibc might read them - * in the hope that the kernel has stretched to using larger sizes. - */ -struct stat { - unsigned long long st_dev; - unsigned char __pad0[4]; - - unsigned long __st_ino; - unsigned int st_mode; - unsigned int st_nlink; - - unsigned long st_uid; - unsigned long st_gid; - - unsigned long long st_rdev; - unsigned char __pad3[4]; - - unsigned char __pad4[4]; - long long st_size; - unsigned long st_blksize; - unsigned char __pad5[4]; - unsigned long long st_blocks; - - unsigned long st_atime; - unsigned long st_atime_nsec; - - unsigned long st_mtime; - unsigned long st_mtime_nsec; - - unsigned long st_ctime; - unsigned long st_ctime_nsec; - - unsigned long long st_ino; -}; - -/* For compatibility with GLibc, we provide macro aliases - * for the non-Posix nano-seconds accessors. - */ -#define st_atimensec st_atime_nsec -#define st_mtimensec st_mtime_nsec -#define st_ctimensec st_ctime_nsec - -extern int chmod(const char *, mode_t); -extern int fchmod(int, mode_t); -extern int mkdir(const char *, mode_t); - -extern int stat(const char *, struct stat *); -extern int fstat(int, struct stat *); -extern int lstat(const char *, struct stat *); -extern int mknod(const char *, mode_t, dev_t); -extern mode_t umask(mode_t); - -#define stat64 stat -#define fstat64 fstat -#define lstat64 lstat - -static __inline__ int mkfifo(const char *__p, mode_t __m) -{ - return mknod(__p, (__m & ~S_IFMT) | S_IFIFO, (dev_t)0); -} - -extern int fstatat(int dirfd, const char *path, struct stat *buf, int flags); -extern int mkdirat(int dirfd, const char *pathname, mode_t mode); -extern int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags); -extern int fchmodat(int dirfd, const char *path, mode_t mode, int flags); -extern int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); - -__END_DECLS - -#endif /* _SYS_STAT_H_ */ diff --git a/ndk/platforms/android-3/include/byteswap.h b/ndk/platforms/android-3/include/byteswap.h index 74b0e9180..628fb7f3e 100644 --- a/ndk/platforms/android-3/include/byteswap.h +++ b/ndk/platforms/android-3/include/byteswap.h @@ -28,11 +28,10 @@ #ifndef _BYTESWAP_H_ #define _BYTESWAP_H_ -/* endian.h rather than sys/endian.h so we get the machine-specific file. */ -#include +#include -#define bswap_16(x) swap16(x) -#define bswap_32(x) swap32(x) -#define bswap_64(x) swap64(x) +#define bswap_16(x) __swap16(x) +#define bswap_32(x) __swap32(x) +#define bswap_64(x) __swap64(x) #endif /* _BYTESWAP_H_ */ diff --git a/ndk/platforms/android-3/include/ctype.h b/ndk/platforms/android-3/include/ctype.h index 58b76eae6..711e64689 100644 --- a/ndk/platforms/android-3/include/ctype.h +++ b/ndk/platforms/android-3/include/ctype.h @@ -59,7 +59,7 @@ extern const short *_toupper_tab_; /* extern __inline is a GNU C extension */ #ifdef __GNUC__ -# if defined(__GNUC_STDC_INLINE__) +# if defined(__GNUC_STDC_INLINE__) || defined(__cplusplus) || defined(__cplusplus) #define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__)) # else #define __CTYPE_INLINE extern __inline diff --git a/ndk/platforms/android-21/arch-p/include/sys/cachectl.h b/ndk/platforms/android-3/include/machine/endian.h similarity index 79% rename from ndk/platforms/android-21/arch-p/include/sys/cachectl.h rename to ndk/platforms/android-3/include/machine/endian.h index b2b333c55..ac8951920 100644 --- a/ndk/platforms/android-21/arch-p/include/sys/cachectl.h +++ b/ndk/platforms/android-3/include/machine/endian.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 The Android Open Source Project + * Copyright (C) 2014 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,12 +25,11 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef _SYS_CACHECTL_H -#define _SYS_CACHECTL_H 1 -//#ifdef __mips__ -//#include -//extern int __cachectl (void *addr, __const int nbytes, __const int op); -//extern int _flush_cache (char *addr, __const int nbytes, __const int op); -//#endif -#endif /* sys/cachectl.h */ +#ifndef _MACHINE_ENDIAN_H_ +#define _MACHINE_ENDIAN_H_ + +/* This file is for BSD source compatibility only. Use or instead. */ +#include + +#endif /* _MACHINE_ENDIAN_H_ */ diff --git a/ndk/platforms/android-3/include/sys/cdefs.h b/ndk/platforms/android-3/include/sys/cdefs.h index 10743f6d2..314504908 100644 --- a/ndk/platforms/android-3/include/sys/cdefs.h +++ b/ndk/platforms/android-3/include/sys/cdefs.h @@ -37,54 +37,41 @@ #ifndef _SYS_CDEFS_H_ #define _SYS_CDEFS_H_ -/* In previous NDK releases, wchar_t was defined as 'unsigned char' - * when targetting API level < 9 (i.e. Froyo or older). - * - * This is no longer the case, but you can define _WCHAR_IS_8BIT - * at compile time to restore the old behaviour. - * - * The reason for this redefine is purely historical. Until Android 2.3, - * i.e. API level 9, there was absolutely no official support for wchar_t - * in the C library, but compiling GCC and the GNU libstdc++ required a - * working . - * - * To allow this while keeping the C library small, wchar_t was redefined - * explicitely as an 8-bit unsigned integer (which is perfectly allowed - * by the standard) and a very small set of wcs-xxx functions provided - * as wrappers around the corresponding str-xxx ones. - * - * Starting with API level 9, wchar_t is properly defined as a 32-bit - * type (as mandated by the compiler itself), and the lines below - * were removed (see $NDK/platforms/android-9/include/sys/cdefs.h). - * - * Note that this only affects C source compilation. For C++, wchar_t - * is a compiler keyboard that cannot be redefined and is always 32-bit. - * - * On the other hand, _WCHAR_IS_8BIT also affects the definition of - * WCHAR_MIN, WCHAR_MAX and WEOF (see comments). +/* + * Testing against Clang-specific extensions. */ -#ifdef _WCHAR_IS_8BIT -#undef __WCHAR_TYPE__ -#define __WCHAR_TYPE__ unsigned char + +#ifndef __has_extension +#define __has_extension __has_feature +#endif +#ifndef __has_feature +#define __has_feature(x) 0 #endif +#ifndef __has_include +#define __has_include(x) 0 +#endif +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + /* * Macro to test if we're using a GNU C compiler of a specific vintage * or later, for e.g. features that appeared in a particular version * of GNU C. Usage: * - * #if __GNUC_PREREQ__(major, minor) + * #if __GNUC_PREREQ(major, minor) * ...cool feature... * #else * ...delete feature... * #endif */ #ifdef __GNUC__ -#define __GNUC_PREREQ__(x, y) \ +#define __GNUC_PREREQ(x, y) \ ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \ (__GNUC__ > (x))) #else -#define __GNUC_PREREQ__(x, y) 0 +#define __GNUC_PREREQ(x, y) 0 #endif #include @@ -176,7 +163,7 @@ * GCC2 provides __extension__ to suppress warnings for various GNU C * language extensions under "-ansi -pedantic". */ -#if !__GNUC_PREREQ__(2, 0) +#if !__GNUC_PREREQ(2, 0) #define __extension__ /* delete __extension__ if non-gcc or gcc1 */ #endif @@ -188,7 +175,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !__GNUC_PREREQ__(2, 5) +#if !__GNUC_PREREQ(2, 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile @@ -202,19 +189,21 @@ #define __pure #endif -#if __GNUC_PREREQ__(2, 7) +#if __GNUC_PREREQ(2, 7) #define __unused __attribute__((__unused__)) #else #define __unused /* delete */ #endif -#if __GNUC_PREREQ__(3, 1) +#define __pure2 __attribute__((__const__)) /* Android-added: used by FreeBSD libm */ + +#if __GNUC_PREREQ(3, 1) #define __used __attribute__((__used__)) #else #define __used /* delete */ #endif -#if __GNUC_PREREQ__(2, 7) +#if __GNUC_PREREQ(2, 7) #define __packed __attribute__((__packed__)) #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) @@ -228,11 +217,11 @@ #define __section(x) error: no __section for this compiler #endif -#if !__GNUC_PREREQ__(2, 8) +#if !__GNUC_PREREQ(2, 8) #define __extension__ #endif -#if __GNUC_PREREQ__(2, 8) +#if __GNUC_PREREQ(2, 8) #define __statement(x) __extension__(x) #elif defined(lint) #define __statement(x) (0) @@ -240,6 +229,11 @@ #define __statement(x) (x) #endif +#define __nonnull(args) __attribute__((__nonnull__ args)) + +#define __printflike(x, y) __attribute__((__format__(printf, x, y))) __nonnull((x)) +#define __scanflike(x, y) __attribute__((__format__(scanf, x, y))) __nonnull((x)) + /* * C99 defines the restrict type qualifier keyword, which was made available * in GCC 2.92. @@ -247,7 +241,7 @@ #if defined(__STDC__VERSION__) && __STDC_VERSION__ >= 199901L #define __restrict restrict #else -#if !__GNUC_PREREQ__(2, 92) +#if !__GNUC_PREREQ(2, 92) #define __restrict /* delete __restrict when not supported */ #endif #endif @@ -257,9 +251,9 @@ * in GCC 2.95. */ #if !defined(__STDC_VERSION__) || !(__STDC_VERSION__ >= 199901L) -#if __GNUC_PREREQ__(2, 6) +#if __GNUC_PREREQ(2, 6) #define __func__ __PRETTY_FUNCTION__ -#elif __GNUC_PREREQ__(2, 4) +#elif __GNUC_PREREQ(2, 4) #define __func__ __FUNCTION__ #else #define __func__ "" @@ -292,7 +286,7 @@ * register values. This is gcc specific, the version is more or less * arbitrary, might work with older compilers. */ -#if __GNUC_PREREQ__(2, 95) +#if __GNUC_PREREQ(2, 95) #define __insn_barrier() __asm __volatile("":::"memory") #else #define __insn_barrier() /* */ @@ -326,7 +320,7 @@ * basic block reordering that this affects can often generate * larger code. */ -#if __GNUC_PREREQ__(2, 96) +#if __GNUC_PREREQ(2, 96) #define __predict_true(exp) __builtin_expect((exp) != 0, 1) #define __predict_false(exp) __builtin_expect((exp) != 0, 0) #else @@ -334,12 +328,34 @@ #define __predict_false(exp) (exp) #endif -#if __GNUC_PREREQ__(2, 96) +#if __GNUC_PREREQ(2, 96) #define __noreturn __attribute__((__noreturn__)) #define __mallocfunc __attribute__((malloc)) +#define __purefunc __attribute__((pure)) #else #define __noreturn #define __mallocfunc +#define __purefunc +#endif + +#if __GNUC_PREREQ(3, 1) +#define __always_inline __attribute__((__always_inline__)) +#else +#define __always_inline +#endif + +#if __GNUC_PREREQ(3, 4) +#define __wur __attribute__((__warn_unused_result__)) +#else +#define __wur +#endif + +#if __GNUC_PREREQ(4, 3) +#define __errordecl(name, msg) extern void name(void) __attribute__((__error__(msg))) +#define __warnattr(msg) __attribute__((__warning__(msg))) +#else +#define __errordecl(name, msg) extern void name(void) +#define __warnattr(msg) #endif /* @@ -392,11 +408,11 @@ #define __link_set_entry(set, idx) (__link_set_begin(set)[idx]) /* - * Some of the recend FreeBSD sources used in Bionic need this. + * Some of the FreeBSD sources used in Bionic need this. * Originally, this is used to embed the rcs versions of each source file * in the generated binary. We certainly don't want this in Bionic. */ -#define __FBSDID(s) struct __hack +#define __FBSDID(s) /* nothing */ /*- * The following definitions are an extension of the behavior originally @@ -530,6 +546,37 @@ #define __BIONIC__ 1 #include +/* glibc compatibility. */ +#if __LP64__ +#define __WORDSIZE 64 +#else +#define __WORDSIZE 32 +#endif + +/* + * When _FORTIFY_SOURCE is defined, automatic bounds checking is + * added to commonly used libc functions. If a buffer overrun is + * detected, the program is safely aborted. + * + * See + * http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html for details. + */ +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 +#define __BIONIC_FORTIFY 1 +#if _FORTIFY_SOURCE == 2 +#define __bos(s) __builtin_object_size((s), 1) +#else +#define __bos(s) __builtin_object_size((s), 0) +#endif +#define __bos0(s) __builtin_object_size((s), 0) + +#define __BIONIC_FORTIFY_INLINE \ + extern __inline__ \ + __attribute__ ((always_inline)) \ + __attribute__ ((gnu_inline)) +#endif +#define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1) + /* __NDK_FPABI__ or __NDK_FPABI_MATH__ are applied to APIs taking or returning float or [long] double, to ensure even at the presence of -mhard-float (which implies -mfloat-abi=hard), calling to 32-bit Android native APIs still follow -mfloat-abi=softfp. diff --git a/ndk/platforms/android-3/include/sys/endian.h b/ndk/platforms/android-3/include/sys/endian.h index 2a0c65870..60cc0304c 100644 --- a/ndk/platforms/android-3/include/sys/endian.h +++ b/ndk/platforms/android-3/include/sys/endian.h @@ -1,5 +1,3 @@ -/* $OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $ */ - /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. * @@ -24,170 +22,59 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * Generic definitions for little- and big-endian systems. Other endianesses - * has to be dealt with in the specific machine/endian.h file for that port. - * - * This file is meant to be included from a little- or big-endian port's - * machine/endian.h after setting _BYTE_ORDER to either 1234 for little endian - * or 4321 for big.. - */ - #ifndef _SYS_ENDIAN_H_ #define _SYS_ENDIAN_H_ #include -#include -#include + +#include #define _LITTLE_ENDIAN 1234 #define _BIG_ENDIAN 4321 #define _PDP_ENDIAN 3412 +#define _BYTE_ORDER _LITTLE_ENDIAN +#define __LITTLE_ENDIAN_BITFIELD -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN _LITTLE_ENDIAN #endif +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN _BIG_ENDIAN +#endif +#define __BYTE_ORDER _BYTE_ORDER -#ifdef __GNUC__ - -#define __swap16gen(x) __statement({ \ - __uint16_t __swap16gen_x = (x); \ - \ - (__uint16_t)((__swap16gen_x & 0xff) << 8 | \ - (__swap16gen_x & 0xff00) >> 8); \ -}) - -#define __swap32gen(x) __statement({ \ - __uint32_t __swap32gen_x = (x); \ - \ - (__uint32_t)((__swap32gen_x & 0xff) << 24 | \ - (__swap32gen_x & 0xff00) << 8 | \ - (__swap32gen_x & 0xff0000) >> 8 | \ - (__swap32gen_x & 0xff000000) >> 24); \ -}) - -#define __swap64gen(x) __statement({ \ - __uint64_t __swap64gen_x = (x); \ - \ - (__uint64_t)((__swap64gen_x & 0xff) << 56 | \ - (__swap64gen_x & 0xff00ULL) << 40 | \ - (__swap64gen_x & 0xff0000ULL) << 24 | \ - (__swap64gen_x & 0xff000000ULL) << 8 | \ - (__swap64gen_x & 0xff00000000ULL) >> 8 | \ - (__swap64gen_x & 0xff0000000000ULL) >> 24 | \ - (__swap64gen_x & 0xff000000000000ULL) >> 40 | \ - (__swap64gen_x & 0xff00000000000000ULL) >> 56); \ -}) - -#else /* __GNUC__ */ - -/* Note that these macros evaluate their arguments several times. */ -#define __swap16gen(x) \ - (__uint16_t)(((__uint16_t)(x) & 0xff) << 8 | ((__uint16_t)(x) & 0xff00) >> 8) - -#define __swap32gen(x) \ - (__uint32_t)(((__uint32_t)(x) & 0xff) << 24 | \ - ((__uint32_t)(x) & 0xff00) << 8 | ((__uint32_t)(x) & 0xff0000) >> 8 |\ - ((__uint32_t)(x) & 0xff000000) >> 24) - -#define __swap64gen(x) \ - (__uint64_t)((((__uint64_t)(x) & 0xff) << 56) | \ - ((__uint64_t)(x) & 0xff00ULL) << 40 | \ - ((__uint64_t)(x) & 0xff0000ULL) << 24 | \ - ((__uint64_t)(x) & 0xff000000ULL) << 8 | \ - ((__uint64_t)(x) & 0xff00000000ULL) >> 8 | \ - ((__uint64_t)(x) & 0xff0000000000ULL) >> 24 | \ - ((__uint64_t)(x) & 0xff000000000000ULL) >> 40 | \ - ((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) - -#endif /* __GNUC__ */ - -/* - * Define MD_SWAP if you provide swap{16,32}md functions/macros that are - * optimized for your architecture, These will be used for swap{16,32} - * unless the argument is a constant and we are using GCC, where we can - * take advantage of the CSE phase much better by using the generic version. - */ -#ifdef MD_SWAP -#if __GNUC__ - -#define __swap16(x) __statement({ \ - __uint16_t __swap16_x = (x); \ - \ - __builtin_constant_p(x) ? __swap16gen(__swap16_x) : \ - __swap16md(__swap16_x); \ -}) - -#define __swap32(x) __statement({ \ - __uint32_t __swap32_x = (x); \ - \ - __builtin_constant_p(x) ? __swap32gen(__swap32_x) : \ - __swap32md(__swap32_x); \ -}) - -#define __swap64(x) __statement({ \ - __uint64_t __swap64_x = (x); \ - \ - __builtin_constant_p(x) ? __swap64gen(__swap64_x) : \ - __swap64md(__swap64_x); \ -}) - -#endif /* __GNUC__ */ - -#else /* MD_SWAP */ -#define __swap16 __swap16gen -#define __swap32 __swap32gen -#define __swap64 __swap64gen -#endif /* MD_SWAP */ - -#define __swap16_multi(v, n) do { \ - __size_t __swap16_multi_n = (n); \ - __uint16_t *__swap16_multi_v = (v); \ - \ - while (__swap16_multi_n) { \ - *__swap16_multi_v = swap16(*__swap16_multi_v); \ - __swap16_multi_v++; \ - __swap16_multi_n--; \ - } \ -} while (0) - -#if __BSD_VISIBLE -#define swap16 __swap16 -#define swap32 __swap32 -#define swap64 __swap64 -#define swap16_multi __swap16_multi +#define __swap16 __builtin_bswap16 +#define __swap32 __builtin_bswap32 +#define __swap64 __builtin_bswap64 +/* glibc compatibility. */ __BEGIN_DECLS -__uint64_t htobe64(__uint64_t); -__uint32_t htobe32(__uint32_t); -__uint16_t htobe16(__uint16_t); -__uint64_t betoh64(__uint64_t); -__uint32_t betoh32(__uint32_t); -__uint16_t betoh16(__uint16_t); - -__uint64_t htole64(__uint64_t); -__uint32_t htole32(__uint32_t); -__uint16_t htole16(__uint16_t); -__uint64_t letoh64(__uint64_t); -__uint32_t letoh32(__uint32_t); -__uint16_t letoh16(__uint16_t); +uint32_t htonl(uint32_t) __pure2; +uint16_t htons(uint16_t) __pure2; +uint32_t ntohl(uint32_t) __pure2; +uint16_t ntohs(uint16_t) __pure2; __END_DECLS -#endif /* __BSD_VISIBLE */ -#if _BYTE_ORDER == _LITTLE_ENDIAN +#define htonl(x) __swap32(x) +#define htons(x) __swap16(x) +#define ntohl(x) __swap32(x) +#define ntohs(x) __swap16(x) -/* Can be overridden by machine/endian.h before inclusion of this file. */ -#ifndef _QUAD_HIGHWORD -#define _QUAD_HIGHWORD 1 -#endif -#ifndef _QUAD_LOWWORD -#define _QUAD_LOWWORD 0 -#endif +/* Bionic additions */ +#define htonq(x) __swap64(x) +#define ntohq(x) __swap64(x) #if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER + +#define NTOHL(x) (x) = ntohl((u_int32_t)(x)) +#define NTOHS(x) (x) = ntohs((u_int16_t)(x)) +#define HTONL(x) (x) = htonl((u_int32_t)(x)) +#define HTONS(x) (x) = htons((u_int16_t)(x)) + #define htobe16 __swap16 #define htobe32 __swap32 #define htobe64 __swap64 @@ -201,74 +88,19 @@ __END_DECLS #define letoh16(x) (x) #define letoh32(x) (x) #define letoh64(x) (x) -#endif /* __BSD_VISIBLE */ - -#define htons(x) __swap16(x) -#define htonl(x) __swap32(x) -#define ntohs(x) __swap16(x) -#define ntohl(x) __swap32(x) - -/* Bionic additions */ -#define ntohq(x) __swap64(x) -#define htonq(x) __swap64(x) - -#define __LITTLE_ENDIAN_BITFIELD - -#endif /* _BYTE_ORDER */ - -#if _BYTE_ORDER == _BIG_ENDIAN - -/* Can be overridden by machine/endian.h before inclusion of this file. */ -#ifndef _QUAD_HIGHWORD -#define _QUAD_HIGHWORD 0 -#endif -#ifndef _QUAD_LOWWORD -#define _QUAD_LOWWORD 1 -#endif -#if __BSD_VISIBLE -#define htole16 __swap16 -#define htole32 __swap32 -#define htole64 __swap64 -#define letoh16 __swap16 -#define letoh32 __swap32 -#define letoh64 __swap64 - -#define htobe16(x) (x) -#define htobe32(x) (x) -#define htobe64(x) (x) -#define betoh16(x) (x) -#define betoh32(x) (x) -#define betoh64(x) (x) +/* + * glibc-compatible beXXtoh/leXXtoh synonyms for htobeXX/htoleXX. + * The BSDs export both sets of names, bionic historically only + * exported the ones above (or on the rhs here), and glibc only + * exports these names (on the lhs). + */ +#define be16toh(x) htobe16(x) +#define be32toh(x) htobe32(x) +#define be64toh(x) htobe64(x) +#define le16toh(x) htole16(x) +#define le32toh(x) htole32(x) +#define le64toh(x) htole64(x) #endif /* __BSD_VISIBLE */ -#define htons(x) (x) -#define htonl(x) (x) -#define ntohs(x) (x) -#define ntohl(x) (x) - -/* Bionic additions */ -#define ntohq(x) (x) -#define htonq(x) (x) - -#define __BIG_ENDIAN_BITFIELD - -#endif /* _BYTE_ORDER */ - -#if __BSD_VISIBLE -#define NTOHL(x) (x) = ntohl((u_int32_t)(x)) -#define NTOHS(x) (x) = ntohs((u_int16_t)(x)) -#define HTONL(x) (x) = htonl((u_int32_t)(x)) -#define HTONS(x) (x) = htons((u_int16_t)(x)) -#endif - - -#define __BYTE_ORDER _BYTE_ORDER -#ifndef __LITTLE_ENDIAN -#define __LITTLE_ENDIAN _LITTLE_ENDIAN -#endif -#ifndef __BIG_ENDIAN -#define __BIG_ENDIAN _BIG_ENDIAN -#endif - #endif /* _SYS_ENDIAN_H_ */ diff --git a/ndk/platforms/android-9/arch-mips/include/asm/elf.h b/ndk/platforms/android-9/arch-mips/include/asm/elf.h index 6f79694cf..831f54c59 100644 --- a/ndk/platforms/android-9/arch-mips/include/asm/elf.h +++ b/ndk/platforms/android-9/arch-mips/include/asm/elf.h @@ -70,6 +70,8 @@ #define DT_MIPS_GOTSYM 0x70000013 #define DT_MIPS_HIPAGENO 0x70000014 #define DT_MIPS_RLD_MAP 0x70000016 +#define DT_MIPS_RLD_MAP2 0x70000035 + /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define R_MIPS_NONE 0 #define R_MIPS_16 1 diff --git a/ndk/platforms/android-9/arch-mips/include/machine/endian.h b/ndk/platforms/android-9/arch-mips/include/machine/endian.h deleted file mode 100644 index 41a9004f4..000000000 --- a/ndk/platforms/android-9/arch-mips/include/machine/endian.h +++ /dev/null @@ -1,70 +0,0 @@ -/* $OpenBSD: endian.h,v 1.5 2006/02/27 23:35:59 miod Exp $ */ - -/* - * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef _MIPS64_ENDIAN_H_ -#define _MIPS64_ENDIAN_H_ - -#ifdef __GNUC__ - -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) -#define __swap16md(x) ({ \ - register uint16_t _x = (x); \ - register uint16_t _r; \ - __asm volatile ("wsbh %0, %1" : "=r" (_r) : "r" (_x)); \ - _r; \ -}) - -#define __swap32md(x) ({ \ - register uint32_t _x = (x); \ - register uint32_t _r; \ - __asm volatile ("wsbh %0, %1; rotr %0, %0, 16" : "=r" (_r) : "r" (_x)); \ - _r; \ -}) - -#define __swap64md(x) ({ \ - uint64_t _swap64md_x = (x); \ - (uint64_t) __swap32md(_swap64md_x >> 32) | \ - (uint64_t) __swap32md(_swap64md_x & 0xffffffff) << 32; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __mips32r2__ */ -#endif /* __GNUC__ */ - -#if defined(__MIPSEB__) -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif -#define __STRICT_ALIGNMENT -#include -#include - -#endif /* _MIPS64_ENDIAN_H_ */ diff --git a/ndk/platforms/android-9/arch-mips/include/machine/exec.h b/ndk/platforms/android-9/arch-mips/include/machine/exec.h index 3c63f7435..88f82f4ad 100644 --- a/ndk/platforms/android-9/arch-mips/include/machine/exec.h +++ b/ndk/platforms/android-9/arch-mips/include/machine/exec.h @@ -91,6 +91,7 @@ #define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in .dynsym */ #define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ #define DT_MIPS_RLD_MAP 0x70000016 /* Address of debug map pointer */ +#define DT_MIPS_RLD_MAP2 0x70000035 /* Address of run time loader map, used for debugging. */ #define DT_PROCNUM (DT_MIPS_RLD_MAP - DT_LOPROC + 1) diff --git a/ndk/platforms/android-9/arch-mips/symbols/libthread_db.so.functions.txt b/ndk/platforms/android-9/arch-mips/symbols/libthread_db.so.functions.txt deleted file mode 100644 index e31e4478e..000000000 --- a/ndk/platforms/android-9/arch-mips/symbols/libthread_db.so.functions.txt +++ /dev/null @@ -1,12 +0,0 @@ -td_symbol_list -td_ta_clear_event -td_ta_delete -td_ta_event_addr -td_ta_event_getmsg -td_ta_map_lwp2thr -td_ta_new -td_ta_set_event -td_ta_thr_iter -td_thr_event_enable -td_thr_get_info -td_thr_tls_get_addr diff --git a/ndk/platforms/android-9/arch-mips/symbols/libthread_db.so.variables.txt b/ndk/platforms/android-9/arch-mips/symbols/libthread_db.so.variables.txt deleted file mode 100644 index 8b1378917..000000000 --- a/ndk/platforms/android-9/arch-mips/symbols/libthread_db.so.variables.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ndk/platforms/android-9/arch-x86/include/machine/endian.h b/ndk/platforms/android-9/arch-x86/include/machine/endian.h deleted file mode 100644 index e1506b110..000000000 --- a/ndk/platforms/android-9/arch-x86/include/machine/endian.h +++ /dev/null @@ -1,61 +0,0 @@ -/* $OpenBSD: endian.h,v 1.17 2011/03/12 04:03:04 guenther Exp $ */ - -/*- - * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ - -#ifdef __GNUC__ - -#define __swap32md(x) __statement({ \ - uint32_t __swap32md_x = (x); \ - \ - __asm ("bswap %0" : "+r" (__swap32md_x)); \ - __swap32md_x; \ -}) - -#define __swap64md(x) __statement({ \ - uint64_t __swap64md_x = (x); \ - \ - (uint64_t)__swap32md(__swap64md_x >> 32) | \ - (uint64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \ -}) -#define __swap16md(x) __statement({ \ - uint16_t __swap16md_x = (x); \ - \ - __asm ("rorw $8, %w0" : "+r" (__swap16md_x)); \ - __swap16md_x; \ -}) - -/* Tell sys/endian.h we have MD variants of the swap macros. */ -#define MD_SWAP - -#endif /* __GNUC__ */ - -#define _BYTE_ORDER _LITTLE_ENDIAN -#include -#include - -#endif /* _MACHINE_ENDIAN_H_ */ diff --git a/ndk/platforms/android-21/arch-p/include/machine/setjmp.h b/ndk/platforms/android-9/arch-x86/src/asm_multiarch.h similarity index 79% rename from ndk/platforms/android-21/arch-p/include/machine/setjmp.h rename to ndk/platforms/android-9/arch-x86/src/asm_multiarch.h index 4e157bdd3..91cb8af4b 100644 --- a/ndk/platforms/android-21/arch-p/include/machine/setjmp.h +++ b/ndk/platforms/android-9/arch-x86/src/asm_multiarch.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 The Android Open Source Project + * Copyright (C) 2013 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,14 +26,11 @@ * SUCH DAMAGE. */ -/* - * machine/setjmp.h: machine dependent setjmp-related information. - */ +#ifdef __LP64__ +# define ASM_PTR_SIZE(x) .quad x +# define ASM_ALIGN_TO_PTR_SIZE .balign 8 +#else +# define ASM_PTR_SIZE(x) .long x +# define ASM_ALIGN_TO_PTR_SIZE .balign 4 +#endif -/* _JBLEN is the size of a jmp_buf in longs. - * Do not modify this value or you will break the ABI ! - * - * This value comes from the original OpenBSD ARM-specific header - * that was replaced by this one. - */ -#define _JBLEN 160 diff --git a/ndk/platforms/android-9/arch-x86/src/crtend.S b/ndk/platforms/android-9/arch-x86/src/crtend.S index 68447e7db..9796ea024 100644 --- a/ndk/platforms/android-9/arch-x86/src/crtend.S +++ b/ndk/platforms/android-9/arch-x86/src/crtend.S @@ -1,11 +1,16 @@ +#include "asm_multiarch.h" + .section .preinit_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .init_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .fini_array, "aw" - .long 0 + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .eh_frame,"a",@progbits .align 4 diff --git a/ndk/platforms/android-9/arch-x86/src/crtend_so.S b/ndk/platforms/android-9/arch-x86/src/crtend_so.S index 63e58b970..6ef493b94 100644 --- a/ndk/platforms/android-9/arch-x86/src/crtend_so.S +++ b/ndk/platforms/android-9/arch-x86/src/crtend_so.S @@ -1,8 +1,12 @@ -.section .init_array, "aw" - .long 0 +#include "asm_multiarch.h" -.section .fini_array, "aw" - .long 0 + .section .init_array, "aw" + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) + + .section .fini_array, "aw" + ASM_ALIGN_TO_PTR_SIZE + ASM_PTR_SIZE(0) .section .eh_frame,"a",@progbits .align 4 diff --git a/ndk/platforms/android-9/include/sys/cdefs.h b/ndk/platforms/android-9/include/sys/cdefs.h deleted file mode 100644 index e17e36143..000000000 --- a/ndk/platforms/android-9/include/sys/cdefs.h +++ /dev/null @@ -1,529 +0,0 @@ -/* $NetBSD: cdefs.h,v 1.58 2004/12/11 05:59:00 christos Exp $ */ - -/* - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Berkeley Software Design, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 - */ - -#ifndef _SYS_CDEFS_H_ -#define _SYS_CDEFS_H_ - -/* - * Macro to test if we're using a GNU C compiler of a specific vintage - * or later, for e.g. features that appeared in a particular version - * of GNU C. Usage: - * - * #if __GNUC_PREREQ__(major, minor) - * ...cool feature... - * #else - * ...delete feature... - * #endif - */ -#ifdef __GNUC__ -#define __GNUC_PREREQ__(x, y) \ - ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \ - (__GNUC__ > (x))) -#else -#define __GNUC_PREREQ__(x, y) 0 -#endif - -#include - -#if defined(__cplusplus) -#define __BEGIN_DECLS extern "C" { -#define __END_DECLS } -#define __static_cast(x,y) static_cast(y) -#else -#define __BEGIN_DECLS -#define __END_DECLS -#define __static_cast(x,y) (x)y -#endif - -/* - * The __CONCAT macro is used to concatenate parts of symbol names, e.g. - * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. - * The __CONCAT macro is a bit tricky -- make sure you don't put spaces - * in between its arguments. __CONCAT can also concatenate double-quoted - * strings produced by the __STRING macro, but this only works with ANSI C. - */ - -#define ___STRING(x) __STRING(x) -#define ___CONCAT(x,y) __CONCAT(x,y) - -#if defined(__STDC__) || defined(__cplusplus) -#define __P(protos) protos /* full-blown ANSI C */ -#define __CONCAT(x,y) x ## y -#define __STRING(x) #x - -#define __const const /* define reserved names to standard */ -#define __signed signed -#define __volatile volatile -#if defined(__cplusplus) -#define __inline inline /* convert to C++ keyword */ -#else -#if !defined(__GNUC__) && !defined(__lint__) -#define __inline /* delete GCC keyword */ -#endif /* !__GNUC__ && !__lint__ */ -#endif /* !__cplusplus */ - -#else /* !(__STDC__ || __cplusplus) */ -#define __P(protos) () /* traditional C preprocessor */ -#define __CONCAT(x,y) x/**/y -#define __STRING(x) "x" - -#ifndef __GNUC__ -#define __const /* delete pseudo-ANSI C keywords */ -#define __inline -#define __signed -#define __volatile -#endif /* !__GNUC__ */ - -/* - * In non-ANSI C environments, new programs will want ANSI-only C keywords - * deleted from the program and old programs will want them left alone. - * Programs using the ANSI C keywords const, inline etc. as normal - * identifiers should define -DNO_ANSI_KEYWORDS. - */ -#ifndef NO_ANSI_KEYWORDS -#define const __const /* convert ANSI C keywords */ -#define inline __inline -#define signed __signed -#define volatile __volatile -#endif /* !NO_ANSI_KEYWORDS */ -#endif /* !(__STDC__ || __cplusplus) */ - -/* - * Used for internal auditing of the NetBSD source tree. - */ -#ifdef __AUDIT__ -#define __aconst __const -#else -#define __aconst -#endif - -/* - * The following macro is used to remove const cast-away warnings - * from gcc -Wcast-qual; it should be used with caution because it - * can hide valid errors; in particular most valid uses are in - * situations where the API requires it, not to cast away string - * constants. We don't use *intptr_t on purpose here and we are - * explicit about unsigned long so that we don't have additional - * dependencies. - */ -#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) - -/* - * GCC2 provides __extension__ to suppress warnings for various GNU C - * language extensions under "-ansi -pedantic". - */ -#if !__GNUC_PREREQ__(2, 0) -#define __extension__ /* delete __extension__ if non-gcc or gcc1 */ -#endif - -/* - * GCC1 and some versions of GCC2 declare dead (non-returning) and - * pure (no side effects) functions using "volatile" and "const"; - * unfortunately, these then cause warnings under "-ansi -pedantic". - * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of - * these work for GNU C++ (modulo a slight glitch in the C++ grammar - * in the distribution version of 2.5.5). - */ -#if !__GNUC_PREREQ__(2, 5) -#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -#define __dead __volatile -#define __pure __const -#endif -#endif - -/* Delete pseudo-keywords wherever they are not available or needed. */ -#ifndef __dead -#define __dead -#define __pure -#endif - -#if __GNUC_PREREQ__(2, 7) -#define __unused __attribute__((__unused__)) -#else -#define __unused /* delete */ -#endif - -#if __GNUC_PREREQ__(3, 1) -#define __used __attribute__((__used__)) -#else -#define __used /* delete */ -#endif - -#if __GNUC_PREREQ__(2, 7) -#define __packed __attribute__((__packed__)) -#define __aligned(x) __attribute__((__aligned__(x))) -#define __section(x) __attribute__((__section__(x))) -#elif defined(__lint__) -#define __packed /* delete */ -#define __aligned(x) /* delete */ -#define __section(x) /* delete */ -#else -#define __packed error: no __packed for this compiler -#define __aligned(x) error: no __aligned for this compiler -#define __section(x) error: no __section for this compiler -#endif - -#if !__GNUC_PREREQ__(2, 8) -#define __extension__ -#endif - -#if __GNUC_PREREQ__(2, 8) -#define __statement(x) __extension__(x) -#elif defined(lint) -#define __statement(x) (0) -#else -#define __statement(x) (x) -#endif - -/* - * C99 defines the restrict type qualifier keyword, which was made available - * in GCC 2.92. - */ -#if defined(__STDC__VERSION__) && __STDC_VERSION__ >= 199901L -#define __restrict restrict -#else -#if !__GNUC_PREREQ__(2, 92) -#define __restrict /* delete __restrict when not supported */ -#endif -#endif - -/* - * C99 defines __func__ predefined identifier, which was made available - * in GCC 2.95. - */ -#if !defined(__STDC_VERSION__) || !(__STDC_VERSION__ >= 199901L) -#if __GNUC_PREREQ__(2, 6) -#define __func__ __PRETTY_FUNCTION__ -#elif __GNUC_PREREQ__(2, 4) -#define __func__ __FUNCTION__ -#else -#define __func__ "" -#endif -#endif /* !(__STDC_VERSION__ >= 199901L) */ - -#if defined(_KERNEL) -#if defined(NO_KERNEL_RCSIDS) -#undef __KERNEL_RCSID -#define __KERNEL_RCSID(_n, _s) /* nothing */ -#endif /* NO_KERNEL_RCSIDS */ -#endif /* _KERNEL */ - -#if !defined(_STANDALONE) && !defined(_KERNEL) -#ifdef __GNUC__ -#define __RENAME(x) ___RENAME(x) -#else -#ifdef __lint__ -#define __RENAME(x) __symbolrename(x) -#else -#error "No function renaming possible" -#endif /* __lint__ */ -#endif /* __GNUC__ */ -#else /* _STANDALONE || _KERNEL */ -#define __RENAME(x) no renaming in kernel or standalone environment -#endif - -/* - * A barrier to stop the optimizer from moving code or assume live - * register values. This is gcc specific, the version is more or less - * arbitrary, might work with older compilers. - */ -#if __GNUC_PREREQ__(2, 95) -#define __insn_barrier() __asm __volatile("":::"memory") -#else -#define __insn_barrier() /* */ -#endif - -/* - * GNU C version 2.96 adds explicit branch prediction so that - * the CPU back-end can hint the processor and also so that - * code blocks can be reordered such that the predicted path - * sees a more linear flow, thus improving cache behavior, etc. - * - * The following two macros provide us with a way to use this - * compiler feature. Use __predict_true() if you expect the expression - * to evaluate to true, and __predict_false() if you expect the - * expression to evaluate to false. - * - * A few notes about usage: - * - * * Generally, __predict_false() error condition checks (unless - * you have some _strong_ reason to do otherwise, in which case - * document it), and/or __predict_true() `no-error' condition - * checks, assuming you want to optimize for the no-error case. - * - * * Other than that, if you don't know the likelihood of a test - * succeeding from empirical or other `hard' evidence, don't - * make predictions. - * - * * These are meant to be used in places that are run `a lot'. - * It is wasteful to make predictions in code that is run - * seldomly (e.g. at subsystem initialization time) as the - * basic block reordering that this affects can often generate - * larger code. - */ -#if __GNUC_PREREQ__(2, 96) -#define __predict_true(exp) __builtin_expect((exp) != 0, 1) -#define __predict_false(exp) __builtin_expect((exp) != 0, 0) -#else -#define __predict_true(exp) (exp) -#define __predict_false(exp) (exp) -#endif - -#if __GNUC_PREREQ__(2, 96) -#define __noreturn __attribute__((__noreturn__)) -#define __mallocfunc __attribute__((malloc)) -#else -#define __noreturn -#define __mallocfunc -#endif - -/* - * Macros for manipulating "link sets". Link sets are arrays of pointers - * to objects, which are gathered up by the linker. - * - * Object format-specific code has provided us with the following macros: - * - * __link_set_add_text(set, sym) - * Add a reference to the .text symbol `sym' to `set'. - * - * __link_set_add_rodata(set, sym) - * Add a reference to the .rodata symbol `sym' to `set'. - * - * __link_set_add_data(set, sym) - * Add a reference to the .data symbol `sym' to `set'. - * - * __link_set_add_bss(set, sym) - * Add a reference to the .bss symbol `sym' to `set'. - * - * __link_set_decl(set, ptype) - * Provide an extern declaration of the set `set', which - * contains an array of the pointer type `ptype'. This - * macro must be used by any code which wishes to reference - * the elements of a link set. - * - * __link_set_start(set) - * This points to the first slot in the link set. - * - * __link_set_end(set) - * This points to the (non-existent) slot after the last - * entry in the link set. - * - * __link_set_count(set) - * Count the number of entries in link set `set'. - * - * In addition, we provide the following macros for accessing link sets: - * - * __link_set_foreach(pvar, set) - * Iterate over the link set `set'. Because a link set is - * an array of pointers, pvar must be declared as "type **pvar", - * and the actual entry accessed as "*pvar". - * - * __link_set_entry(set, idx) - * Access the link set entry at index `idx' from set `set'. - */ -#define __link_set_foreach(pvar, set) \ - for (pvar = __link_set_start(set); pvar < __link_set_end(set); pvar++) - -#define __link_set_entry(set, idx) (__link_set_begin(set)[idx]) - -/* - * Some of the recend FreeBSD sources used in Bionic need this. - * Originally, this is used to embed the rcs versions of each source file - * in the generated binary. We certainly don't want this in Bionic. - */ -#define __FBSDID(s) struct __hack - -/*- - * The following definitions are an extension of the behavior originally - * implemented in , but with a different level of granularity. - * POSIX.1 requires that the macros we test be defined before any standard - * header file is included. - * - * Here's a quick run-down of the versions: - * defined(_POSIX_SOURCE) 1003.1-1988 - * _POSIX_C_SOURCE == 1 1003.1-1990 - * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option - * _POSIX_C_SOURCE == 199309 1003.1b-1993 - * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, - * and the omnibus ISO/IEC 9945-1: 1996 - * _POSIX_C_SOURCE == 200112 1003.1-2001 - * _POSIX_C_SOURCE == 200809 1003.1-2008 - * - * In addition, the X/Open Portability Guide, which is now the Single UNIX - * Specification, defines a feature-test macro which indicates the version of - * that specification, and which subsumes _POSIX_C_SOURCE. - * - * Our macros begin with two underscores to avoid namespace screwage. - */ - -/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 -#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ -#define _POSIX_C_SOURCE 199009 -#endif - -/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199209 -#endif - -/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ -#ifdef _XOPEN_SOURCE -#if _XOPEN_SOURCE - 0 >= 700 -#define __XSI_VISIBLE 700 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809 -#elif _XOPEN_SOURCE - 0 >= 600 -#define __XSI_VISIBLE 600 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200112 -#elif _XOPEN_SOURCE - 0 >= 500 -#define __XSI_VISIBLE 500 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199506 -#endif -#endif - -/* - * Deal with all versions of POSIX. The ordering relative to the tests above is - * important. - */ -#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) -#define _POSIX_C_SOURCE 198808 -#endif -#ifdef _POSIX_C_SOURCE -#if _POSIX_C_SOURCE >= 200809 -#define __POSIX_VISIBLE 200809 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 200112 -#define __POSIX_VISIBLE 200112 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 199506 -#define __POSIX_VISIBLE 199506 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199309 -#define __POSIX_VISIBLE 199309 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199209 -#define __POSIX_VISIBLE 199209 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199009 -#define __POSIX_VISIBLE 199009 -#define __ISO_C_VISIBLE 1990 -#else -#define __POSIX_VISIBLE 198808 -#define __ISO_C_VISIBLE 0 -#endif /* _POSIX_C_SOURCE */ -#else -/*- - * Deal with _ANSI_SOURCE: - * If it is defined, and no other compilation environment is explicitly - * requested, then define our internal feature-test macros to zero. This - * makes no difference to the preprocessor (undefined symbols in preprocessing - * expressions are defined to have value zero), but makes it more convenient for - * a test program to print out the values. - * - * If a program mistakenly defines _ANSI_SOURCE and some other macro such as - * _POSIX_C_SOURCE, we will assume that it wants the broader compilation - * environment (and in fact we will never get here). - */ -#if defined(_ANSI_SOURCE) /* Hide almost everything. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1990 -#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1999 -#else /* Default environment: show everything. */ -#define __POSIX_VISIBLE 200809 -#define __XSI_VISIBLE 700 -#define __BSD_VISIBLE 1 -#define __ISO_C_VISIBLE 1999 -#endif -#endif - -/* - * Default values. - */ -#ifndef __XPG_VISIBLE -# define __XPG_VISIBLE 700 -#endif -#ifndef __POSIX_VISIBLE -# define __POSIX_VISIBLE 200809 -#endif -#ifndef __ISO_C_VISIBLE -# define __ISO_C_VISIBLE 1999 -#endif -#ifndef __BSD_VISIBLE -# define __BSD_VISIBLE 1 -#endif - -#define __BIONIC__ 1 -#include - -/* __NDK_FPABI__ or __NDK_FPABI_MATH__ are applied to APIs taking or returning float or - [long] double, to ensure even at the presence of -mhard-float (which implies - -mfloat-abi=hard), calling to 32-bit Android native APIs still follow -mfloat-abi=softfp. - - __NDK_FPABI_MATH__ is applied to APIs in math.h. It normally equals to __NDK_FPABI__, - but allows use of customized libm.a compiled with -mhard-float by -D_NDK_MATH_NO_SOFTFP=1 - - NOTE: Disable for clang for now unless _NDK_MATH_NO_SOFTFP=1, because clang before 3.4 doesn't - allow change of calling convension for builtin and produces error message reads: - - a.i:564:6: error: function declared 'aapcs' here was previously declared without calling convention - int sin(double d) __attribute__((pcs("aapcs"))); - ^ - a.i:564:6: note: previous declaration is here - */ -#if defined(__ANDROID__) && !defined(__LP64__) && defined( __arm__) -#define __NDK_FPABI__ __attribute__((pcs("aapcs"))) -#else -#define __NDK_FPABI__ -#endif - -#if (!defined(_NDK_MATH_NO_SOFTFP) || _NDK_MATH_NO_SOFTFP != 1) && !defined(__clang__) -#define __NDK_FPABI_MATH__ __NDK_FPABI__ -#else -#define __NDK_FPABI_MATH__ /* nothing */ -#endif - -#endif /* !_SYS_CDEFS_H_ */ diff --git a/ndk/samples/hello-neon/jni/Android.mk b/ndk/samples/hello-neon/jni/Android.mk index eeaae966f..7bb69762f 100644 --- a/ndk/samples/hello-neon/jni/Android.mk +++ b/ndk/samples/hello-neon/jni/Android.mk @@ -6,7 +6,7 @@ LOCAL_MODULE := helloneon LOCAL_SRC_FILES := helloneon.c -ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI), armeabi-v7a x86)) +ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI), armeabi-v7a x86 x86_64 arm64-v8a)) LOCAL_CFLAGS := -DHAVE_NEON=1 ifeq ($(TARGET_ARCH_ABI),x86) LOCAL_CFLAGS += -mssse3 diff --git a/ndk/samples/hello-neon/jni/Application.mk b/ndk/samples/hello-neon/jni/Application.mk index 7985a6898..ceeb0b40e 100644 --- a/ndk/samples/hello-neon/jni/Application.mk +++ b/ndk/samples/hello-neon/jni/Application.mk @@ -1 +1 @@ -APP_ABI := armeabi armeabi-v7a arm64-v8a x86 +APP_ABI := armeabi armeabi-v7a arm64-v8a x86 x86_64 diff --git a/ndk/sources/android/libportable/Android.mk b/ndk/sources/android/libportable/Android.mk deleted file mode 100644 index 6c52e894c..000000000 --- a/ndk/sources/android/libportable/Android.mk +++ /dev/null @@ -1,48 +0,0 @@ -# -# 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. -# - -LOCAL_PATH := $(call my-dir) - -ifeq ($(BUILD_LIBPORTABLE_TOO),true) - -#===================================================================== -# Device Shared Library libportable -#===================================================================== - -include $(CLEAR_VARS) - -LOCAL_MODULE := libportable -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/common/include - -# Uncomment the next line to easily enable Lib-Portable logging during development. -# LOCAL_CFLAGS += -DLOG_NDEBUG=0 - -libportable_src_files = \ - $(patsubst $(LOCAL_PATH)/%,%,$(wildcard $(LOCAL_PATH)/arch-$(TARGET_ARCH)/*.c)) \ - $(patsubst $(LOCAL_PATH)/%,%,$(wildcard $(LOCAL_PATH)/arch-$(TARGET_ARCH)/*.S)) - -LOCAL_SRC_FILES := \ - $(libportable_src_files) - -LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures -LOCAL_SHARED_LIBRARIES += liblog libdl - -include $(BUILD_SHARED_LIBRARY) - -endif # BUILD_LIBPORTABLE_TOO diff --git a/ndk/sources/android/libportable/arch-arm/fenv.c b/ndk/sources/android/libportable/arch-arm/fenv.c deleted file mode 100644 index d3c18af07..000000000 --- a/ndk/sources/android/libportable/arch-arm/fenv.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-arm/md_swap.c b/ndk/sources/android/libportable/arch-arm/md_swap.c deleted file mode 100644 index 47652e6cc..000000000 --- a/ndk/sources/android/libportable/arch-arm/md_swap.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 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. - */ - -#include -#include - -/* - * REV and REV16 weren't available on ARM5 or ARM4. - */ -#if !defined __ARM_ARCH_5__ && !defined __ARM_ARCH_5T__ && \ - !defined __ARM_ARCH_5TE__ && !defined __ARM_ARCH_5TEJ__ && \ - !defined __ARM_ARCH_4T__ && !defined __ARM_ARCH_4__ - -uint16_t WRAP(__swap16md)(uint16_t x) { - register uint16_t _x = (x); - __asm volatile ("rev16 %0, %0" : "+l" (_x)); - return _x; -} - -uint32_t WRAP(__swap32md)(uint32_t x) { - register uint32_t _x = (x); - __asm volatile ("rev %0, %0" : "+l" (_x)); - return _x; -} - -#endif - diff --git a/ndk/sources/android/libportable/arch-arm/stat.c b/ndk/sources/android/libportable/arch-arm/stat.c deleted file mode 100644 index 8a2a477bc..000000000 --- a/ndk/sources/android/libportable/arch-arm/stat.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-arm/unwind.c b/ndk/sources/android/libportable/arch-arm/unwind.c deleted file mode 100644 index f7e63264f..000000000 --- a/ndk/sources/android/libportable/arch-arm/unwind.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include -#include - -struct _Unwind_Context; - -typedef enum { - _UVRSC_CORE = 0, // integer register - _UVRSC_VFP = 1, // vfp - _UVRSC_WMMXD = 3, // Intel WMMX data register - _UVRSC_WMMXC = 4 // Intel WMMX control register -} _Unwind_VRS_RegClass; - -typedef enum { - _UVRSD_UINT32 = 0, - _UVRSD_VFPX = 1, - _UVRSD_UINT64 = 3, - _UVRSD_FLOAT = 4, - _UVRSD_DOUBLE = 5 -} _Unwind_VRS_DataRepresentation; - -typedef enum { - _UVRSR_OK = 0, - _UVRSR_NOT_IMPLEMENTED = 1, - _UVRSR_FAILED = 2 -} _Unwind_VRS_Result; - -_Unwind_VRS_Result _Unwind_VRS_Get(struct _Unwind_Context *context, - _Unwind_VRS_RegClass regclass, - uint32_t regno, - _Unwind_VRS_DataRepresentation representation, - void* valuep); - -_Unwind_VRS_Result _Unwind_VRS_Set(struct _Unwind_Context *context, - _Unwind_VRS_RegClass regclass, - uint32_t regno, - _Unwind_VRS_DataRepresentation representation, - void* valuep); - -#define UNWIND_POINTER_REG 12 -#define UNWIND_STACK_REG 13 -#define UNWIND_IP_REG 15 - -uint64_t WRAP(_Unwind_GetGR)(struct _Unwind_Context* ctx, int index) { - uint32_t val; - _Unwind_VRS_Get(ctx, _UVRSC_CORE, index, _UVRSD_UINT32, &val); - return (uint64_t)val; -} - -void WRAP(_Unwind_SetGR)(struct _Unwind_Context* ctx, int index, uint64_t new_value) { - uint32_t val = (uint32_t)new_value; - _Unwind_VRS_Set(ctx, _UVRSC_CORE, index, _UVRSD_UINT32, &val); -} - -uint64_t WRAP(_Unwind_GetIP)(struct _Unwind_Context* ctx) { - return WRAP(_Unwind_GetGR)(ctx, UNWIND_IP_REG) & ~1; // thumb bit -} - -void WRAP(_Unwind_SetIP)(struct _Unwind_Context* ctx, uintptr_t new_value) { - uint32_t val = (uint32_t)new_value; - // Propagate thumb bit to instruction pointer - uint32_t thumbState = WRAP(_Unwind_GetGR)(ctx, UNWIND_IP_REG) & 1; - uint64_t new_val = (uint64_t)(val | thumbState); - WRAP(_Unwind_SetGR)(ctx, UNWIND_IP_REG, new_val); -} diff --git a/ndk/sources/android/libportable/arch-arm/vfs.c b/ndk/sources/android/libportable/arch-arm/vfs.c deleted file mode 100644 index fe8becd43..000000000 --- a/ndk/sources/android/libportable/arch-arm/vfs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-arm64/fenv.c b/ndk/sources/android/libportable/arch-arm64/fenv.c deleted file mode 100644 index d3c18af07..000000000 --- a/ndk/sources/android/libportable/arch-arm64/fenv.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-arm64/stat.c b/ndk/sources/android/libportable/arch-arm64/stat.c deleted file mode 100644 index 8a2a477bc..000000000 --- a/ndk/sources/android/libportable/arch-arm64/stat.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-arm64/vfs.c b/ndk/sources/android/libportable/arch-arm64/vfs.c deleted file mode 100644 index fe8becd43..000000000 --- a/ndk/sources/android/libportable/arch-arm64/vfs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips/errno.c b/ndk/sources/android/libportable/arch-mips/errno.c deleted file mode 100644 index b9ed45657..000000000 --- a/ndk/sources/android/libportable/arch-mips/errno.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips/fcntl.c b/ndk/sources/android/libportable/arch-mips/fcntl.c deleted file mode 100644 index de620c550..000000000 --- a/ndk/sources/android/libportable/arch-mips/fcntl.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips/fenv.c b/ndk/sources/android/libportable/arch-mips/fenv.c deleted file mode 100644 index d3c18af07..000000000 --- a/ndk/sources/android/libportable/arch-mips/fenv.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips/signal.c b/ndk/sources/android/libportable/arch-mips/signal.c deleted file mode 100644 index 7da280157..000000000 --- a/ndk/sources/android/libportable/arch-mips/signal.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips/stat.c b/ndk/sources/android/libportable/arch-mips/stat.c deleted file mode 100644 index 8a2a477bc..000000000 --- a/ndk/sources/android/libportable/arch-mips/stat.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips/vfs.c b/ndk/sources/android/libportable/arch-mips/vfs.c deleted file mode 100644 index fe8becd43..000000000 --- a/ndk/sources/android/libportable/arch-mips/vfs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips64/errno.c b/ndk/sources/android/libportable/arch-mips64/errno.c deleted file mode 100644 index b9ed45657..000000000 --- a/ndk/sources/android/libportable/arch-mips64/errno.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips64/fcntl.c b/ndk/sources/android/libportable/arch-mips64/fcntl.c deleted file mode 100644 index de620c550..000000000 --- a/ndk/sources/android/libportable/arch-mips64/fcntl.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips64/fenv.c b/ndk/sources/android/libportable/arch-mips64/fenv.c deleted file mode 100644 index d3c18af07..000000000 --- a/ndk/sources/android/libportable/arch-mips64/fenv.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips64/stat.c b/ndk/sources/android/libportable/arch-mips64/stat.c deleted file mode 100644 index 8a2a477bc..000000000 --- a/ndk/sources/android/libportable/arch-mips64/stat.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-mips64/vfs.c b/ndk/sources/android/libportable/arch-mips64/vfs.c deleted file mode 100644 index fe8becd43..000000000 --- a/ndk/sources/android/libportable/arch-mips64/vfs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86/epoll.c b/ndk/sources/android/libportable/arch-x86/epoll.c deleted file mode 100644 index ef929af68..000000000 --- a/ndk/sources/android/libportable/arch-x86/epoll.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86/fcntl.c b/ndk/sources/android/libportable/arch-x86/fcntl.c deleted file mode 100644 index de620c550..000000000 --- a/ndk/sources/android/libportable/arch-x86/fcntl.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86/fenv.c b/ndk/sources/android/libportable/arch-x86/fenv.c deleted file mode 100644 index d3c18af07..000000000 --- a/ndk/sources/android/libportable/arch-x86/fenv.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86/stat.c b/ndk/sources/android/libportable/arch-x86/stat.c deleted file mode 100644 index 8a2a477bc..000000000 --- a/ndk/sources/android/libportable/arch-x86/stat.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86/vfs.c b/ndk/sources/android/libportable/arch-x86/vfs.c deleted file mode 100644 index fe8becd43..000000000 --- a/ndk/sources/android/libportable/arch-x86/vfs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86_64/epoll.c b/ndk/sources/android/libportable/arch-x86_64/epoll.c deleted file mode 100644 index ef929af68..000000000 --- a/ndk/sources/android/libportable/arch-x86_64/epoll.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86_64/fcntl.c b/ndk/sources/android/libportable/arch-x86_64/fcntl.c deleted file mode 100644 index de620c550..000000000 --- a/ndk/sources/android/libportable/arch-x86_64/fcntl.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86_64/fenv.c b/ndk/sources/android/libportable/arch-x86_64/fenv.c deleted file mode 100644 index d3c18af07..000000000 --- a/ndk/sources/android/libportable/arch-x86_64/fenv.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86_64/stat.c b/ndk/sources/android/libportable/arch-x86_64/stat.c deleted file mode 100644 index 8a2a477bc..000000000 --- a/ndk/sources/android/libportable/arch-x86_64/stat.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/arch-x86_64/vfs.c b/ndk/sources/android/libportable/arch-x86_64/vfs.c deleted file mode 100644 index fe8becd43..000000000 --- a/ndk/sources/android/libportable/arch-x86_64/vfs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, 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. - */ - -#include diff --git a/ndk/sources/android/libportable/common/include/epoll_portable.h b/ndk/sources/android/libportable/common/include/epoll_portable.h deleted file mode 100644 index ebf4389d0..000000000 --- a/ndk/sources/android/libportable/common/include/epoll_portable.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2014, 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 _EPOLL_PORTABLE_H_ -#define _EPOLL_PORTABLE_H_ - -#include -#include -#include -#include - -struct epoll_event_portable -{ - uint32_t events; - uint8_t __padding[4]; - epoll_data_t data; -}; - - -int WRAP(epoll_ctl)(int epfd, int op, int fd, struct epoll_event_portable *event) -{ - struct epoll_event machine_epoll_event; - - machine_epoll_event.events = event->events; - machine_epoll_event.data = event->data; - - return REAL(epoll_ctl)(epfd, op, fd, &machine_epoll_event); -} - -int WRAP(epoll_wait)(int epfd, struct epoll_event_portable *events, int max, int timeout) -{ - struct epoll_event machine_epoll_event; - int ret = REAL(epoll_wait)(epfd, &machine_epoll_event, max, timeout); - - events->events = machine_epoll_event.events; - events->data = machine_epoll_event.data; - - return ret; -} - -int WRAP(epoll_pwait)(int fd, struct epoll_event_portable* events, int max_events, int timeout, const sigset_t* ss) -{ - struct epoll_event machine_epoll_event; - int ret = REAL(epoll_pwait)(fd, &machine_epoll_event, max_events, timeout, ss); - - events->events = machine_epoll_event.events; - events->data = machine_epoll_event.data; - - return ret; -} - -#endif /* _EPOLL_PORTABLE_H */ diff --git a/ndk/sources/android/libportable/common/include/errno_portable.h b/ndk/sources/android/libportable/common/include/errno_portable.h deleted file mode 100644 index 8966c7775..000000000 --- a/ndk/sources/android/libportable/common/include/errno_portable.h +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Copyright 2014, 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 _ERRNO_PORTABLE_H_ -#define _ERRNO_PORTABLE_H_ - -#include -#include -#include -#include - -#define ALOGV(...) - -#define EDEADLK_PORTABLE 35 -#define ENAMETOOLONG_PORTABLE 36 -#define ENOLCK_PORTABLE 37 -#define ENOSYS_PORTABLE 38 -#define ENOTEMPTY_PORTABLE 39 -#define ELOOP_PORTABLE 40 -#define EWOULDBLOCK_PORTABLE 11 /* EAGAIN */ -#define ENOMSG_PORTABLE 42 -#define EIDRM_PORTABLE 43 -#define ECHRNG_PORTABLE 44 -#define EL2NSYNC_PORTABLE 45 -#define EL3HLT_PORTABLE 46 -#define EL3RST_PORTABLE 47 -#define ELNRNG_PORTABLE 48 -#define EUNATCH_PORTABLE 49 -#define ENOCSI_PORTABLE 50 -#define EL2HLT_PORTABLE 51 -#define EBADE_PORTABLE 52 -#define EBADR_PORTABLE 53 -#define EXFULL_PORTABLE 54 -#define ENOANO_PORTABLE 55 -#define EBADRQC_PORTABLE 56 -#define EBADSLT_PORTABLE 57 - -#define EDEADLOCK_PORTABLE EDEADLK_PORTABLE - -#define EBFONT_PORTABLE 59 -#define ENOSTR_PORTABLE 60 -#define ENODATA_PORTABLE 61 -#define ETIME_PORTABLE 62 -#define ENOSR_PORTABLE 63 -#define ENONET_PORTABLE 64 -#define ENOPKG_PORTABLE 65 -#define EREMOTE_PORTABLE 66 -#define ENOLINK_PORTABLE 67 -#define EADV_PORTABLE 68 -#define ESRMNT_PORTABLE 69 -#define ECOMM_PORTABLE 70 -#define EPROTO_PORTABLE 71 -#define EMULTIHOP_PORTABLE 72 -#define EDOTDOT_PORTABLE 73 -#define EBADMSG_PORTABLE 74 -#define EOVERFLOW_PORTABLE 75 -#define ENOTUNIQ_PORTABLE 76 -#define EBADFD_PORTABLE 77 -#define EREMCHG_PORTABLE 78 -#define ELIBACC_PORTABLE 79 -#define ELIBBAD_PORTABLE 80 -#define ELIBSCN_PORTABLE 81 -#define ELIBMAX_PORTABLE 82 -#define ELIBEXEC_PORTABLE 83 -#define EILSEQ_PORTABLE 84 -#define ERESTART_PORTABLE 85 -#define ESTRPIPE_PORTABLE 86 -#define EUSERS_PORTABLE 87 -#define ENOTSOCK_PORTABLE 88 -#define EDESTADDRREQ_PORTABLE 89 -#define EMSGSIZE_PORTABLE 90 -#define EPROTOTYPE_PORTABLE 91 -#define ENOPROTOOPT_PORTABLE 92 -#define EPROTONOSUPPORT_PORTABLE 93 -#define ESOCKTNOSUPPORT_PORTABLE 94 -#define EOPNOTSUPP_PORTABLE 95 -#define EPFNOSUPPORT_PORTABLE 96 -#define EAFNOSUPPORT_PORTABLE 97 -#define EADDRINUSE_PORTABLE 98 -#define EADDRNOTAVAIL_PORTABLE 99 -#define ENETDOWN_PORTABLE 100 -#define ENETUNREACH_PORTABLE 101 -#define ENETRESET_PORTABLE 102 -#define ECONNABORTED_PORTABLE 103 -#define ECONNRESET_PORTABLE 104 -#define ENOBUFS_PORTABLE 105 -#define EISCONN_PORTABLE 106 -#define ENOTCONN_PORTABLE 107 -#define ESHUTDOWN_PORTABLE 108 -#define ETOOMANYREFS_PORTABLE 109 -#define ETIMEDOUT_PORTABLE 110 -#define ECONNREFUSED_PORTABLE 111 -#define EHOSTDOWN_PORTABLE 112 -#define EHOSTUNREACH_PORTABLE 113 -#define EALREADY_PORTABLE 114 -#define EINPROGRESS_PORTABLE 115 -#define ESTALE_PORTABLE 116 -#define EUCLEAN_PORTABLE 117 -#define ENOTNAM_PORTABLE 118 -#define ENAVAIL_PORTABLE 119 -#define EISNAM_PORTABLE 120 -#define EREMOTEIO_PORTABLE 121 -#define EDQUOT_PORTABLE 122 - -#define ENOMEDIUM_PORTABLE 123 -#define EMEDIUMTYPE_PORTABLE 124 -#define ECANCELED_PORTABLE 125 -#define ENOKEY_PORTABLE 126 -#define EKEYEXPIRED_PORTABLE 127 -#define EKEYREVOKED_PORTABLE 128 -#define EKEYREJECTED_PORTABLE 129 - -#define EOWNERDEAD_PORTABLE 130 -#define ENOTRECOVERABLE_PORTABLE 131 -#define ERFKILL_PORTABLE 132 -#define EHWPOISON_PORTABLE 133 - -extern volatile int* REAL(__errno)(); - -static int errno_ntop(int native_errno) -{ - switch (native_errno) { - case ENAMETOOLONG: return ENAMETOOLONG_PORTABLE; - case ENOLCK: return ENOLCK_PORTABLE; - case ENOSYS: return ENOSYS_PORTABLE; - case ENOTEMPTY: return ENOTEMPTY_PORTABLE; - case ELOOP: return ELOOP_PORTABLE; - case EWOULDBLOCK: return EWOULDBLOCK_PORTABLE; - case ENOMSG: return ENOMSG_PORTABLE; - case EIDRM: return EIDRM_PORTABLE; - case ECHRNG: return ECHRNG_PORTABLE; - case EL2NSYNC: return EL2NSYNC_PORTABLE; - case EL3HLT: return EL3HLT_PORTABLE; - case EL3RST: return EL3RST_PORTABLE; - case ELNRNG: return ELNRNG_PORTABLE; - case EUNATCH: return EUNATCH_PORTABLE; - case ENOCSI: return ENOCSI_PORTABLE; - case EL2HLT: return EL2HLT_PORTABLE; - case EBADE: return EBADE_PORTABLE; - case EBADR: return EBADR_PORTABLE; - case EXFULL: return EXFULL_PORTABLE; - case ENOANO: return ENOANO_PORTABLE; - case EBADRQC: return EBADRQC_PORTABLE; - case EBADSLT: return EBADSLT_PORTABLE; - case EDEADLOCK: return EDEADLOCK_PORTABLE; - case EBFONT: return EBFONT_PORTABLE; - case ENOSTR: return ENOSTR_PORTABLE; - case ENODATA: return ENODATA_PORTABLE; - case ETIME: return ETIME_PORTABLE; - case ENOSR: return ENOSR_PORTABLE; - case ENONET: return ENONET_PORTABLE; - case ENOPKG: return ENOPKG_PORTABLE; - case EREMOTE: return EREMOTE_PORTABLE; - case ENOLINK: return ENOLINK_PORTABLE; - case EADV: return EADV_PORTABLE; - case ESRMNT: return ESRMNT_PORTABLE; - case ECOMM: return ECOMM_PORTABLE; - case EPROTO: return EPROTO_PORTABLE; - case EMULTIHOP: return EMULTIHOP_PORTABLE; - case EDOTDOT: return EDOTDOT_PORTABLE; - case EBADMSG: return EBADMSG_PORTABLE; - case EOVERFLOW: return EOVERFLOW_PORTABLE; - case ENOTUNIQ: return ENOTUNIQ_PORTABLE; - case EBADFD: return EBADFD_PORTABLE; - case EREMCHG: return EREMCHG_PORTABLE; - case ELIBACC: return ELIBACC_PORTABLE; - case ELIBBAD: return ELIBBAD_PORTABLE; - case ELIBSCN: return ELIBSCN_PORTABLE; - case ELIBMAX: return ELIBMAX_PORTABLE; - case ELIBEXEC: return ELIBEXEC_PORTABLE; - case EILSEQ: return EILSEQ_PORTABLE; - case ERESTART: return ERESTART_PORTABLE; - case ESTRPIPE: return ESTRPIPE_PORTABLE; - case EUSERS: return EUSERS_PORTABLE; - case ENOTSOCK: return ENOTSOCK_PORTABLE; - case EDESTADDRREQ: return EDESTADDRREQ_PORTABLE; - case EMSGSIZE: return EMSGSIZE_PORTABLE; - case EPROTOTYPE: return EPROTOTYPE_PORTABLE; - case ENOPROTOOPT: return ENOPROTOOPT_PORTABLE; - case EPROTONOSUPPORT: return EPROTONOSUPPORT_PORTABLE; - case ESOCKTNOSUPPORT: return ESOCKTNOSUPPORT_PORTABLE; - case EOPNOTSUPP: return EOPNOTSUPP_PORTABLE; - case EPFNOSUPPORT: return EPFNOSUPPORT_PORTABLE; - case EAFNOSUPPORT: return EAFNOSUPPORT_PORTABLE; - case EADDRINUSE: return EADDRINUSE_PORTABLE; - case EADDRNOTAVAIL: return EADDRNOTAVAIL_PORTABLE; - case ENETDOWN: return ENETDOWN_PORTABLE; - case ENETUNREACH: return ENETUNREACH_PORTABLE; - case ENETRESET: return ENETRESET_PORTABLE; - case ECONNABORTED: return ECONNABORTED_PORTABLE; - case ECONNRESET: return ECONNRESET_PORTABLE; - case ENOBUFS: return ENOBUFS_PORTABLE; - case EISCONN: return EISCONN_PORTABLE; - case ENOTCONN: return ENOTCONN_PORTABLE; - case ESHUTDOWN: return ESHUTDOWN_PORTABLE; - case ETOOMANYREFS: return ETOOMANYREFS_PORTABLE; - case ETIMEDOUT: return ETIMEDOUT_PORTABLE; - case ECONNREFUSED: return ECONNREFUSED_PORTABLE; - case EHOSTDOWN: return EHOSTDOWN_PORTABLE; - case EHOSTUNREACH: return EHOSTUNREACH_PORTABLE; - case EALREADY: return EALREADY_PORTABLE; - case EINPROGRESS: return EINPROGRESS_PORTABLE; - case ESTALE: return ESTALE_PORTABLE; - case EUCLEAN: return EUCLEAN_PORTABLE; - case ENOTNAM: return ENOTNAM_PORTABLE; - case ENAVAIL: return ENAVAIL_PORTABLE; - case EISNAM: return EISNAM_PORTABLE; - case EREMOTEIO: return EREMOTEIO_PORTABLE; - case EDQUOT: return EDQUOT_PORTABLE; - case ENOMEDIUM: return ENOMEDIUM_PORTABLE; - case EMEDIUMTYPE: return EMEDIUMTYPE_PORTABLE; - case ECANCELED: return ECANCELED_PORTABLE; - case ENOKEY: return ENOKEY_PORTABLE; - case EKEYEXPIRED: return EKEYEXPIRED_PORTABLE; - case EKEYREVOKED: return EKEYREVOKED_PORTABLE; - case EKEYREJECTED: return EKEYREJECTED_PORTABLE; - case EOWNERDEAD: return EOWNERDEAD_PORTABLE; - case ENOTRECOVERABLE: return ENOTRECOVERABLE_PORTABLE; - } - return native_errno; -} - -static int errno_pton(int portable_errno) -{ - switch (portable_errno) { - case ENAMETOOLONG_PORTABLE: return ENAMETOOLONG; - case ENOLCK_PORTABLE: return ENOLCK; - case ENOSYS_PORTABLE: return ENOSYS; - case ENOTEMPTY_PORTABLE: return ENOTEMPTY; - case ELOOP_PORTABLE: return ELOOP; - case EWOULDBLOCK_PORTABLE: return EWOULDBLOCK; - case ENOMSG_PORTABLE: return ENOMSG; - case EIDRM_PORTABLE: return EIDRM; - case ECHRNG_PORTABLE: return ECHRNG; - case EL2NSYNC_PORTABLE: return EL2NSYNC; - case EL3HLT_PORTABLE: return EL3HLT; - case EL3RST_PORTABLE: return EL3RST; - case ELNRNG_PORTABLE: return ELNRNG; - case EUNATCH_PORTABLE: return EUNATCH; - case ENOCSI_PORTABLE: return ENOCSI; - case EL2HLT_PORTABLE: return EL2HLT; - case EBADE_PORTABLE: return EBADE; - case EBADR_PORTABLE: return EBADR; - case EXFULL_PORTABLE: return EXFULL; - case ENOANO_PORTABLE: return ENOANO; - case EBADRQC_PORTABLE: return EBADRQC; - case EBADSLT_PORTABLE: return EBADSLT; - case EDEADLOCK_PORTABLE: return EDEADLOCK; - case EBFONT_PORTABLE: return EBFONT; - case ENOSTR_PORTABLE: return ENOSTR; - case ENODATA_PORTABLE: return ENODATA; - case ETIME_PORTABLE: return ETIME; - case ENOSR_PORTABLE: return ENOSR; - case ENONET_PORTABLE: return ENONET; - case ENOPKG_PORTABLE: return ENOPKG; - case EREMOTE_PORTABLE: return EREMOTE; - case ENOLINK_PORTABLE: return ENOLINK; - case EADV_PORTABLE: return EADV; - case ESRMNT_PORTABLE: return ESRMNT; - case ECOMM_PORTABLE: return ECOMM; - case EPROTO_PORTABLE: return EPROTO; - case EMULTIHOP_PORTABLE: return EMULTIHOP; - case EDOTDOT_PORTABLE: return EDOTDOT; - case EBADMSG_PORTABLE: return EBADMSG; - case EOVERFLOW_PORTABLE: return EOVERFLOW; - case ENOTUNIQ_PORTABLE: return ENOTUNIQ; - case EBADFD_PORTABLE: return EBADFD; - case EREMCHG_PORTABLE: return EREMCHG; - case ELIBACC_PORTABLE: return ELIBACC; - case ELIBBAD_PORTABLE: return ELIBBAD; - case ELIBSCN_PORTABLE: return ELIBSCN; - case ELIBMAX_PORTABLE: return ELIBMAX; - case ELIBEXEC_PORTABLE: return ELIBEXEC; - case EILSEQ_PORTABLE: return EILSEQ; - case ERESTART_PORTABLE: return ERESTART; - case ESTRPIPE_PORTABLE: return ESTRPIPE; - case EUSERS_PORTABLE: return EUSERS; - case ENOTSOCK_PORTABLE: return ENOTSOCK; - case EDESTADDRREQ_PORTABLE: return EDESTADDRREQ; - case EMSGSIZE_PORTABLE: return EMSGSIZE; - case EPROTOTYPE_PORTABLE: return EPROTOTYPE; - case ENOPROTOOPT_PORTABLE: return ENOPROTOOPT; - case EPROTONOSUPPORT_PORTABLE: return EPROTONOSUPPORT; - case ESOCKTNOSUPPORT_PORTABLE: return ESOCKTNOSUPPORT; - case EOPNOTSUPP_PORTABLE: return EOPNOTSUPP; - case EPFNOSUPPORT_PORTABLE: return EPFNOSUPPORT; - case EAFNOSUPPORT_PORTABLE: return EAFNOSUPPORT; - case EADDRINUSE_PORTABLE: return EADDRINUSE; - case EADDRNOTAVAIL_PORTABLE: return EADDRNOTAVAIL; - case ENETDOWN_PORTABLE: return ENETDOWN; - case ENETUNREACH_PORTABLE: return ENETUNREACH; - case ENETRESET_PORTABLE: return ENETRESET; - case ECONNABORTED_PORTABLE: return ECONNABORTED; - case ECONNRESET_PORTABLE: return ECONNRESET; - case ENOBUFS_PORTABLE: return ENOBUFS; - case EISCONN_PORTABLE: return EISCONN; - case ENOTCONN_PORTABLE: return ENOTCONN; - case ESHUTDOWN_PORTABLE: return ESHUTDOWN; - case ETOOMANYREFS_PORTABLE: return ETOOMANYREFS; - case ETIMEDOUT_PORTABLE: return ETIMEDOUT; - case ECONNREFUSED_PORTABLE: return ECONNREFUSED; - case EHOSTDOWN_PORTABLE: return EHOSTDOWN; - case EHOSTUNREACH_PORTABLE: return EHOSTUNREACH; - case EALREADY_PORTABLE: return EALREADY; - case EINPROGRESS_PORTABLE: return EINPROGRESS; - case ESTALE_PORTABLE: return ESTALE; - case EUCLEAN_PORTABLE: return EUCLEAN; - case ENOTNAM_PORTABLE: return ENOTNAM; - case ENAVAIL_PORTABLE: return ENAVAIL; - case EISNAM_PORTABLE: return EISNAM; - case EREMOTEIO_PORTABLE: return EREMOTEIO; - case EDQUOT_PORTABLE: return EDQUOT; - case ENOMEDIUM_PORTABLE: return ENOMEDIUM; - case EMEDIUMTYPE_PORTABLE: return EMEDIUMTYPE; - case ECANCELED_PORTABLE: return ECANCELED; - case ENOKEY_PORTABLE: return ENOKEY; - case EKEYEXPIRED_PORTABLE: return EKEYEXPIRED; - case EKEYREVOKED_PORTABLE: return EKEYREVOKED; - case EKEYREJECTED_PORTABLE: return EKEYREJECTED; - case EOWNERDEAD_PORTABLE: return EOWNERDEAD; - case ENOTRECOVERABLE_PORTABLE: return ENOTRECOVERABLE; - } - return portable_errno; -} - -/* Key for the thread-specific portable errno */ -static pthread_key_t errno_key; - -/* Once-only initialisation of the key */ -static pthread_once_t errno_key_once = PTHREAD_ONCE_INIT; - -/* Free the thread-specific portable errno */ -static void errno_key_destroy(void *buf) -{ - if (buf) - free(buf); -} - -/* Allocate the key */ -static void errno_key_create(void) -{ - pthread_key_create(&errno_key, errno_key_destroy); -} - -struct errno_state { - int pshadow; /* copy of last portable errno */ - int perrno; /* portable errno that may be modified by app */ -}; - -/* Return the thread-specific portable errno */ -static struct errno_state *errno_key_data(void) -{ - struct errno_state *data; - static struct errno_state errno_state; - - pthread_once(&errno_key_once, errno_key_create); - data = (struct errno_state *)pthread_getspecific(errno_key); - if (data == NULL) { - data = malloc(sizeof(struct errno_state)); - pthread_setspecific(errno_key, data); - } - if (data == NULL) - data = &errno_state; - return data; -} - -/* - * Attempt to return a thread specific location containnig the portable errno. - * This can be assigned to without affecting the native errno. If the key - * allocation fails fall back to using the native errno location. - */ -volatile int* WRAP(__errno)() -{ - struct errno_state *p; - int save_errno; - - /* pthread_* calls may modify errno so use a copy */ - save_errno = *REAL(__errno)(); - - p = errno_key_data(); - - ALOGV(" "); - ALOGV("%s(): { save_errno = errno:%d, (p:%p)->{pshadow:%d, perrno:%d}", __func__, - save_errno, p, p->pshadow, p->perrno); - - if (save_errno == 0 && p->pshadow != p->perrno) { - /* - * portable errno has changed but native hasn't - * - copy portable error back to native - */ - p->pshadow = p->perrno; - save_errno = errno_pton(p->perrno); - } - else if (save_errno != 0 && p->pshadow == p->perrno) { - /* - * Native errno has changed but portable hasn't - * - copy native error to portable. - */ - p->pshadow = p->perrno = errno_ntop(save_errno); - save_errno = 0; - } - else if (save_errno != 0 && p->pshadow != p->perrno) { - /* - * Both native and portable errno values have changed - * so give priority to native errno - * - copy native error to portable - */ - p->pshadow = p->perrno = errno_ntop(save_errno); - save_errno = 0; - } - - ALOGV("%s: new save_errno:%d p:%p->{pshadow:%d, perrno:%d}", __func__, - save_errno, p, p->pshadow, p->perrno); - - *REAL(__errno)() = save_errno; - - ALOGV("%s: return (&p->perrno):%p; }", __func__, &p->perrno); - - /* return pointer to the modifiable portable errno value */ - return &p->perrno; -} - - -/* set portable errno */ -void WRAP(__set_errno)(int portable_errno) -{ - struct errno_state *p; - int save_errno; - - /* pthread_* calls may modify errno so use a copy */ - save_errno = *REAL(__errno)(); - - p = errno_key_data(); - - ALOGV("%s(): { save_errno = errno:%d, p:%p->{pshadow:%d, perrno:%d}", __func__, - save_errno, p, p->pshadow, p->perrno); - - p->pshadow = p->perrno = portable_errno; - - save_errno = errno_pton(portable_errno); - - ALOGV("%s: new save_errno:%d, p:%p->{pshadow:%d, perrno:%d}", __func__, - save_errno, p, p->pshadow, p->perrno); - - *REAL(__errno)() = save_errno; - - ALOGV("%s: return; }", __func__); -} - -extern char* REAL(strerror)(int); -char *WRAP(strerror)(int errnum) -{ - return REAL(strerror)(errno_pton(errnum)); -} - -/* BSD style strerror_r */ -int WRAP(strerror_r)(int errnum, char *buf, size_t buflen) -{ - return REAL(strerror_r)(errno_pton(errnum), buf, buflen); -} -#endif /* _ERRNO_PORTABLE_H */ diff --git a/ndk/sources/android/libportable/common/include/fcntl_portable.h b/ndk/sources/android/libportable/common/include/fcntl_portable.h deleted file mode 100644 index 08b3b2bcc..000000000 --- a/ndk/sources/android/libportable/common/include/fcntl_portable.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2014, 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 _FCNTL_PORTABLE_H_ -#define _FCNTL_PORTABLE_H_ -#endif - -#include -#include -#include - -#define O_DIRECTORY_PORTABLE 040000 -#define O_NOFOLLOW_PORTABLE 0100000 -#define O_DIRECT_PORTABLE 0200000 -#define O_LARGEFILE_PORTABLE 0400000 - -static int flags_p2n(int p_flags) -{ - int machine_flags = p_flags; - if (p_flags & O_DIRECTORY_PORTABLE) { - machine_flags ^= O_DIRECTORY_PORTABLE; - machine_flags |= O_DIRECTORY; - } - if (p_flags & O_NOFOLLOW_PORTABLE) { - machine_flags ^= O_NOFOLLOW_PORTABLE; - machine_flags |= O_NOFOLLOW; - } - if (p_flags & O_DIRECT_PORTABLE) { - machine_flags ^= O_DIRECT_PORTABLE; - machine_flags |= O_DIRECT; - } - if (p_flags & O_LARGEFILE_PORTABLE) { - machine_flags ^= O_LARGEFILE_PORTABLE; - machine_flags |= O_LARGEFILE; - } - - return machine_flags; -} - -#define FLAGS_VAARGS_TRANSLATE \ - flags = flags_p2n(flags); \ - mode_t mode = 0; \ - if ((flags & O_CREAT) != 0) { \ - va_list args; \ - va_start(args, flags); \ - mode = (mode_t) va_arg(args, int); \ - va_end(args);\ - } - - -int WRAP(openat)(int fd, const char* path, int flags, ...) -{ - FLAGS_VAARGS_TRANSLATE - return REAL(openat)(fd, path, flags, mode); -} - -int WRAP(openat64)(int fd, const char* path, int flags, ...) -{ - FLAGS_VAARGS_TRANSLATE - return REAL(openat64)(fd, path, flags, mode); -} - -int WRAP(open)(const char* path, int flags, ...) -{ - FLAGS_VAARGS_TRANSLATE - return REAL(open)(path, flags, mode); -} - -int WRAP(open64)(const char* path, int flags, ...) -{ - FLAGS_VAARGS_TRANSLATE - return REAL(open64)(path, flags, mode); -} diff --git a/ndk/sources/android/libportable/common/include/fenv_portable.h b/ndk/sources/android/libportable/common/include/fenv_portable.h deleted file mode 100644 index 97a287673..000000000 --- a/ndk/sources/android/libportable/common/include/fenv_portable.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright 2014, 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 _FENV_PORTABLE_H_ -#define _FENV_PORTABLE_H_ - -#include -#include -#include -#include - -typedef struct { - unsigned char a[128]; -} fenv_t_portable; -typedef uint32_t fexcept_t_portable; - -/* Exception flags. */ -#define FE_INVALID_PORTABLE 0x01 -#define FE_DIVBYZERO_PORTABLE 0x02 -#define FE_OVERFLOW_PORTABLE 0x04 -#define FE_UNDERFLOW_PORTABLE 0x08 -#define FE_INEXACT_PORTABLE 0x10 -#define FE_ALL_EXCEPT_PORTABLE (FE_DIVBYZERO_PORTABLE | FE_INEXACT_PORTABLE | FE_INVALID_PORTABLE |\ - FE_OVERFLOW_PORTABLE | FE_UNDERFLOW_PORTABLE) - -/* Rounding modes. */ -#define FE_TONEAREST_PORTABLE 0x0 -#define FE_UPWARD_PORTABLE 0x1 -#define FE_DOWNWARD_PORTABLE 0x2 -#define FE_TOWARDZERO_PORTABLE 0x3 - - -static inline int target_change_except(int flags) -{ - int targetflags = 0; - - if (flags & FE_INVALID_PORTABLE) - targetflags |= FE_INVALID; - if (flags & FE_DIVBYZERO_PORTABLE) - targetflags |= FE_DIVBYZERO; - if (flags & FE_OVERFLOW_PORTABLE) - targetflags |= FE_OVERFLOW; - if (flags & FE_UNDERFLOW_PORTABLE) - targetflags |= FE_UNDERFLOW; - if (flags & FE_INEXACT_PORTABLE) - targetflags |= FE_INEXACT; - - return targetflags; -} - -static inline int target_change_rounding(int flags) -{ - int targetflags = 0; - - switch(flags) - { - case FE_TONEAREST_PORTABLE: - targetflags = FE_TONEAREST; - break; - case FE_DOWNWARD_PORTABLE: - targetflags = FE_DOWNWARD; - break; - case FE_UPWARD_PORTABLE: - targetflags = FE_UPWARD; - break; - case FE_TOWARDZERO_PORTABLE: - targetflags = FE_TOWARDZERO; - break; - } - return targetflags; -} - -static inline int target_get_except(int targetflags) -{ - int flags = 0; - - if (targetflags & FE_INVALID) - flags |= FE_INVALID_PORTABLE; - if (targetflags & FE_DIVBYZERO) - flags |= FE_DIVBYZERO_PORTABLE; - if (targetflags & FE_OVERFLOW) - flags |= FE_OVERFLOW_PORTABLE; - if (targetflags & FE_UNDERFLOW) - flags |= FE_UNDERFLOW_PORTABLE; - if (targetflags & FE_INEXACT) - flags |= FE_INEXACT_PORTABLE; - return flags; -} - -static inline int target_get_rounding(int targetflags) -{ - int flags = 0; - - switch(targetflags) - { - case FE_TONEAREST: - flags = FE_TONEAREST_PORTABLE; - break; - case FE_DOWNWARD: - flags = FE_DOWNWARD_PORTABLE; - break; - case FE_UPWARD: - flags = FE_UPWARD_PORTABLE; - break; - case FE_TOWARDZERO: - flags = FE_TOWARDZERO_PORTABLE; - break; - } - return flags; -} - - -int WRAP(fegetenv)(fenv_t_portable* __envp) { - return REAL(fegetenv)((fenv_t*) __envp); -} - -int WRAP(fesetenv)(const fenv_t_portable* __envp) { - return REAL(fesetenv)((fenv_t*) __envp); -} - -int WRAP(feclearexcept)(int __excepts) { - __excepts = target_change_except(__excepts); - return REAL(feclearexcept)(__excepts); -} - -int WRAP(fegetexceptflag)(fexcept_t_portable* __flagp, int __excepts) { - __excepts = target_change_except(__excepts); - int ret = REAL(fegetexceptflag)((fexcept_t*) __flagp, __excepts); - *__flagp = target_get_except(*__flagp); - return ret; -} - -int WRAP(fesetexceptflag)(const fexcept_t_portable* __flagp, int __excepts) { - __excepts = target_change_except(__excepts); - return REAL(fesetexceptflag)((const fexcept_t*) __flagp, __excepts); -} - -int WRAP(feraiseexcept)(int __excepts) { - __excepts = target_change_except(__excepts); - return REAL(feraiseexcept)(__excepts); -} - -int WRAP(fetestexcept)(int __excepts) { - __excepts = target_change_except(__excepts); - return target_get_except(REAL(fetestexcept)(__excepts)); -} - -int WRAP(fegetround)(void) { - int rounding = REAL(fegetround)(); - return target_get_rounding(rounding); -} - -int WRAP(fesetround)(int __round) { - __round = target_change_rounding(__round); - return REAL(fesetround)(__round); -} - -int WRAP(feholdexcept)(fenv_t_portable* __envp) { - memset(__envp, '\0', sizeof(fenv_t_portable)); - fenv_t env; - int ret = REAL(feholdexcept)(&env); - memcpy(__envp, &env, sizeof(env)); - return ret; -} - -int WRAP(feupdateenv)(const fenv_t_portable* __envp) { - fenv_t env; - memcpy(&env, __envp, sizeof(env)); - return REAL(feupdateenv)(&env); -} - -int WRAP(feenableexcept)(int __excepts) { - __excepts = target_change_except(__excepts); - return REAL(feenableexcept)(__excepts); -} - -int WRAP(fedisableexcept)(int __excepts) { - __excepts = target_change_except(__excepts); - return REAL(fedisableexcept)(__excepts); -} - -#endif /* _FENV_PORTABLE_H_ */ diff --git a/ndk/sources/android/libportable/common/include/portability.h b/ndk/sources/android/libportable/common/include/portability.h deleted file mode 100644 index 21bcb5090..000000000 --- a/ndk/sources/android/libportable/common/include/portability.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2014, 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 _PORTABILITY_H_ -#define _PORTABILITY_H_ - -/* - * Hidden functions are exposed while linking the libportable shared object - * but are not exposed thereafter. - */ -#define __hidden __attribute__((visibility("hidden"))) - -#if !defined(__HOST__) -#define WRAP(f) f ## _portable -#define REAL(f) f -#else -/* On host app link with libpportable.a with -Wl,--wrap=symbol, which resolves undefined symbol to __wrap_symbol, - * and undefined __real_symbol to the original symbol - */ -#define WRAP(f) __wrap_ ## f -#define REAL(f) __real_ ## f -#endif - - -#endif /* _PORTABILITY_H_ */ diff --git a/ndk/sources/android/libportable/common/include/signal_portable.h b/ndk/sources/android/libportable/common/include/signal_portable.h deleted file mode 100644 index e80db4b85..000000000 --- a/ndk/sources/android/libportable/common/include/signal_portable.h +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Copyright 2014, 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 _SIGNAL_PORTABLE_H_ -#define _SIGNAL_PORTABLE_H_ - -#if (__mips__) - -#include -#include -#include -#include - -struct stack_t_portable { - void *ss_sp; - int ss_flags; - size_t ss_size; -}; - -static inline void stack_t_pton(const struct stack_t_portable *ptr_p, stack_t *ptr_n) { - memset(ptr_n, '\0', sizeof(stack_t)); - ptr_n->ss_sp = ptr_p->ss_sp; - ptr_n->ss_flags = ptr_p->ss_flags; - ptr_n->ss_size = ptr_p->ss_size; -} - -static inline void stack_t_ntop(const stack_t *ptr_n, struct stack_t_portable *ptr_p) { - memset(ptr_p, '\0', sizeof(struct stack_t_portable)); - ptr_p->ss_sp = ptr_n->ss_sp; - ptr_p->ss_flags = ptr_n->ss_flags; - ptr_p->ss_size = ptr_n->ss_size; -} - -int WRAP(sigaltstack)(const struct stack_t_portable *ss, struct stack_t_portable *oss) { - stack_t ss_n, oss_n; - if (ss != NULL) { - stack_t_pton(ss, &ss_n); - if (oss != NULL){ - int ret = REAL(sigaltstack)(&ss_n, &oss_n); - stack_t_ntop(&oss_n, oss); - return ret; - } - else - return REAL(sigaltstack)(&ss_n, NULL); - } - else if (oss != NULL) { - int ret = REAL(sigaltstack)(NULL, &oss_n); - stack_t_ntop(&oss_n, oss); - return ret; - } - else - return REAL(sigaltstack)(NULL, NULL); -} - -#define SIGHUP_PORTABLE 1 -#define SIGINT_PORTABLE 2 -#define SIGQUIT_PORTABLE 3 -#define SIGILL_PORTABLE 4 -#define SIGTRAP_PORTABLE 5 -#define SIGABRT_PORTABLE 6 -#define SIGIOT_PORTABLE 6 -#define SIGBUS_PORTABLE 7 -#define SIGFPE_PORTABLE 8 -#define SIGKILL_PORTABLE 9 -#define SIGUSR1_PORTABLE 10 -#define SIGSEGV_PORTABLE 11 -#define SIGUSR2_PORTABLE 12 -#define SIGPIPE_PORTABLE 13 -#define SIGALRM_PORTABLE 14 -#define SIGTERM_PORTABLE 15 -// unsupported in MIPS -#define SIGSTKFLT_PORTABLE 16 -// -#define SIGCHLD_PORTABLE 17 -#define SIGCONT_PORTABLE 18 -#define SIGSTOP_PORTABLE 19 -#define SIGTSTP_PORTABLE 20 -#define SIGTTIN_PORTABLE 21 -#define SIGTTOU_PORTABLE 22 -#define SIGURG_PORTABLE 23 -#define SIGXCPU_PORTABLE 24 -#define SIGXFSZ_PORTABLE 25 -#define SIGVTALRM_PORTABLE 26 -#define SIGPROF_PORTABLE 27 -#define SIGWINCH_PORTABLE 28 -#define SIGIO_PORTABLE 29 -#define SIGPOLL_PORTABLE SIGIO_PORTABLE -#define SIGPWR_PORTABLE 30 -#define SIGSYS_PORTABLE 31 -#define SIGUNUSED_PORTABLE 31 -// unsupported in MIPS -#define SIGSWI_PORTABLE 32 -// - -static inline int signo_pton(int signum_p) { - switch(signum_p) { - case SIGHUP_PORTABLE: return SIGHUP; - case SIGINT_PORTABLE: return SIGINT; - case SIGQUIT_PORTABLE: return SIGQUIT; - case SIGILL_PORTABLE: return SIGILL; - case SIGTRAP_PORTABLE: return SIGTRAP; - case SIGABRT_PORTABLE: return SIGABRT; - case SIGBUS_PORTABLE: return SIGBUS; - case SIGFPE_PORTABLE: return SIGFPE; - case SIGKILL_PORTABLE: return SIGKILL; - case SIGUSR1_PORTABLE: return SIGUSR1; - case SIGSEGV_PORTABLE: return SIGSEGV; - case SIGUSR2_PORTABLE: return SIGUSR2; - case SIGPIPE_PORTABLE: return SIGPIPE; - case SIGALRM_PORTABLE: return SIGALRM; - case SIGTERM_PORTABLE: return SIGTERM; - case SIGCHLD_PORTABLE: return SIGCHLD; - case SIGCONT_PORTABLE: return SIGCONT; - case SIGSTOP_PORTABLE: return SIGSTOP; - case SIGTSTP_PORTABLE: return SIGTSTP; - case SIGTTIN_PORTABLE: return SIGTTIN; - case SIGTTOU_PORTABLE: return SIGTTOU; - case SIGURG_PORTABLE: return SIGURG; - case SIGXCPU_PORTABLE: return SIGXCPU; - case SIGXFSZ_PORTABLE: return SIGXFSZ; - case SIGVTALRM_PORTABLE: return SIGVTALRM; - case SIGPROF_PORTABLE: return SIGPROF; - case SIGWINCH_PORTABLE: return SIGWINCH; - case SIGIO_PORTABLE: return SIGIO; - case SIGPWR_PORTABLE: return SIGPWR; - case SIGSYS_PORTABLE: return SIGSYS; - default: - fprintf(stderr, "Unknown SIGNAL:%d\n", signum_p); - abort(); - } -} - -static inline int signo_ntop(int signum_n) { - switch(signum_n) { - case SIGHUP: return SIGHUP_PORTABLE; - case SIGINT: return SIGINT_PORTABLE; - case SIGQUIT: return SIGQUIT_PORTABLE; - case SIGILL: return SIGILL_PORTABLE; - case SIGTRAP: return SIGTRAP_PORTABLE; - case SIGABRT: return SIGABRT_PORTABLE; - case SIGBUS: return SIGBUS_PORTABLE; - case SIGFPE: return SIGFPE_PORTABLE; - case SIGKILL: return SIGKILL_PORTABLE; - case SIGUSR1: return SIGUSR1_PORTABLE; - case SIGSEGV: return SIGSEGV_PORTABLE; - case SIGUSR2: return SIGUSR2_PORTABLE; - case SIGPIPE: return SIGPIPE_PORTABLE; - case SIGALRM: return SIGALRM_PORTABLE; - case SIGTERM: return SIGTERM_PORTABLE; - case SIGCHLD: return SIGCHLD_PORTABLE; - case SIGCONT: return SIGCONT_PORTABLE; - case SIGSTOP: return SIGSTOP_PORTABLE; - case SIGTSTP: return SIGTSTP_PORTABLE; - case SIGTTIN: return SIGTTIN_PORTABLE; - case SIGTTOU: return SIGTTOU_PORTABLE; - case SIGURG: return SIGURG_PORTABLE; - case SIGXCPU: return SIGXCPU_PORTABLE; - case SIGXFSZ: return SIGXFSZ_PORTABLE; - case SIGVTALRM: return SIGVTALRM_PORTABLE; - case SIGPROF: return SIGPROF_PORTABLE; - case SIGWINCH: return SIGWINCH_PORTABLE; - case SIGIO: return SIGIO_PORTABLE; - case SIGPWR: return SIGPWR_PORTABLE; - case SIGSYS: return SIGSYS_PORTABLE; - default: - fprintf(stderr, "Unknown SIGNAL:%d\n", signum_n); - abort(); - } -} - -#define SA_NOCLDSTOP_PORTABLE 0x00000001 -#define SA_NOCLDWAIT_PORTABLE 0x00000002 -#define SA_SIGINFO_PORTABLE 0x00000004 -// unsupported in MIPS -#define SA_THIRTYTWO_PORTABLE 0x02000000 -#define SA_RESTORER_PORTABLE 0x04000000 -// -#define SA_ONSTACK_PORTABLE 0x08000000 -#define SA_RESTART_PORTABLE 0x10000000 -#define SA_NODEFER_PORTABLE 0x40000000 -#define SA_RESETHAND_PORTABLE 0x80000000 -#define SA_NOMASK_PORTABLE SA_NODEFER_PORTABLE -#define SA_ONESHOT_PORTABLE SA_RESETHAND_PORTABLE - -static inline int sa_flags_pton(int sa_flags_p) { - int sa_flags_n = 0; - sa_flags_n |= (sa_flags_p & SA_NOCLDSTOP_PORTABLE) ? SA_NOCLDSTOP : 0; - sa_flags_n |= (sa_flags_p & SA_NOCLDWAIT_PORTABLE) ? SA_NOCLDWAIT : 0; - sa_flags_n |= (sa_flags_p & SA_SIGINFO_PORTABLE) ? SA_SIGINFO : 0; - sa_flags_n |= (sa_flags_p & SA_ONSTACK_PORTABLE) ? SA_ONSTACK : 0; - sa_flags_n |= (sa_flags_p & SA_RESTART_PORTABLE) ? SA_RESTART : 0; - sa_flags_n |= (sa_flags_p & SA_NODEFER_PORTABLE) ? SA_NODEFER : 0; - sa_flags_n |= (sa_flags_p & SA_RESETHAND_PORTABLE) ? SA_RESETHAND : 0; - return sa_flags_n; -} - -static inline int sa_flags_ntop(int sa_flags_n) { - int sa_flags_p = 0; - sa_flags_p |= (sa_flags_n & SA_NOCLDSTOP) ? SA_NOCLDSTOP_PORTABLE : 0; - sa_flags_p |= (sa_flags_n & SA_NOCLDWAIT) ? SA_NOCLDWAIT_PORTABLE : 0; - sa_flags_p |= (sa_flags_n & SA_SIGINFO) ? SA_SIGINFO_PORTABLE : 0; - sa_flags_p |= (sa_flags_n & SA_ONSTACK) ? SA_ONSTACK_PORTABLE : 0; - sa_flags_p |= (sa_flags_n & SA_RESTART) ? SA_RESTART_PORTABLE : 0; - sa_flags_p |= (sa_flags_n & SA_NODEFER) ? SA_NODEFER_PORTABLE : 0; - sa_flags_p |= (sa_flags_n & SA_RESETHAND) ? SA_RESETHAND_PORTABLE : 0; - return sa_flags_p; -} - -typedef unsigned long sigset_t_portable; -struct sigaction_portable { - union { - __sighandler_t _sa_handler; - void (*_sa_sigaction)(int, struct siginfo *, void *); - } _u; - sigset_t_portable sa_mask; - unsigned long sa_flags; - void (*sa_restorer)(void); // obsolete -}; - -static inline void sigset_t_pton(const sigset_t_portable *ptr_p, sigset_t *ptr_n) { - memset(ptr_n, '\0', sizeof(sigset_t)); - ptr_n->sig[0] = *ptr_p; -} - -static inline void sigset_t_ntop(const sigset_t *ptr_n, sigset_t_portable *ptr_p) { - memset(ptr_p, '\0', sizeof(sigset_t_portable)); - *ptr_p = ptr_n->sig[0]; -} - -static inline void sigaction_pton(const struct sigaction_portable *ptr_p, struct sigaction *ptr_n) { - memset(ptr_n, '\0', sizeof(struct sigaction)); - ptr_n->sa_sigaction = ptr_p->_u._sa_sigaction; - sigset_t_pton(&ptr_p->sa_mask, &ptr_n->sa_mask); - ptr_n->sa_flags = sa_flags_pton(ptr_p->sa_flags); -} - -static inline void sigaction_ntop(const struct sigaction *ptr_n, struct sigaction_portable *ptr_p) { - memset(ptr_p, '\0', sizeof(struct sigaction_portable)); - ptr_p->_u._sa_sigaction = ptr_n->sa_sigaction; - sigset_t_ntop(&ptr_n->sa_mask, &ptr_p->sa_mask); - ptr_p->sa_flags = sa_flags_ntop(ptr_n->sa_flags); -} - -int WRAP(sigaction)(int signum, const struct sigaction_portable *act, struct sigaction_portable *oldact) { - struct sigaction act_n, oldact_n; - int signum_n = signo_pton(signum); - - if (act != NULL) { - sigaction_pton(act, &act_n); - if (oldact != NULL) { - int ret = REAL(sigaction)(signum_n, &act_n, &oldact_n); - sigaction_ntop(&oldact_n, oldact); - return ret; - } - else - return REAL(sigaction)(signum_n, &act_n, NULL); - } - else if (oldact != NULL) { - int ret = REAL(sigaction)(signum_n, NULL, &oldact_n); - sigaction_ntop(&oldact_n, oldact); - return ret; - } - else - return REAL(sigaction)(signum_n, NULL, NULL); -} - -int WRAP(sigaddset)(sigset_t_portable *set, int signum) { - int signum_n = signo_pton(signum); - sigset_t set_n; - sigset_t_pton(set, &set_n); - int ret = REAL(sigaddset)(&set_n, signum_n); - sigset_t_ntop(&set_n, set); - return ret; -} - -int WRAP(sigdelset)(sigset_t_portable *set, int signum) { - int signum_n = signo_pton(signum); - sigset_t set_n; - sigset_t_pton(set, &set_n); - int ret = REAL(sigdelset)(&set_n, signum_n); - sigset_t_ntop(&set_n, set); - return ret; -} - -int WRAP(sigemptyset)(sigset_t_portable *set){ - sigset_t set_n; - sigset_t_pton(set, &set_n); - int ret = REAL(sigemptyset)(&set_n); - sigset_t_ntop(&set_n, set); - return ret; -} - -int WRAP(sigfillset)(sigset_t_portable *set){ - sigset_t set_n; - sigset_t_pton(set, &set_n); - int ret = REAL(sigfillset)(&set_n); - sigset_t_ntop(&set_n, set); - return ret; -} - -int WRAP(sigismember)(const sigset_t_portable *set, int signum) { - int signum_n = signo_pton(signum); - sigset_t set_n; - sigset_t_pton(set, &set_n); - return REAL(sigismember)(&set_n, signum_n); -} - -int WRAP(sigpending)(sigset_t_portable *set) { - sigset_t set_n; - sigset_t_pton(set, &set_n); - int ret = REAL(sigpending)(&set_n); - sigset_t_ntop(&set_n, set); - return ret; -} - -#define SIG_BLOCK_PORTABLE 0 -#define SIG_UNBLOCK_PORTABLE 1 -#define SIG_SETMASK_PORTABLE 2 - -int WRAP(sigprocmask)(int how, const sigset_t_portable *set, sigset_t_portable *oldset) { - int how_n; - switch(how) { - case SIG_BLOCK_PORTABLE: how_n = SIG_BLOCK; break; - case SIG_UNBLOCK_PORTABLE: how_n = SIG_UNBLOCK; break; - case SIG_SETMASK_PORTABLE: how_n = SIG_SETMASK; break; - default: - fprintf(stderr, "Unknown sigprocmask action:%d\n", how); - abort(); - } - sigset_t set_n, oldset_n; - if (set != NULL) { - sigset_t_pton(set, &set_n); - if (oldset != NULL) { - int ret = REAL(sigprocmask)(how_n, &set_n, &oldset_n); - sigset_t_ntop(&oldset_n, oldset); - return ret; - } - else - return REAL(sigprocmask)(how_n, &set_n, NULL); - } - else if (oldset != NULL) { - int ret = REAL(sigprocmask)(how_n, NULL, &oldset_n); - sigset_t_ntop(&oldset_n, oldset); - return ret; - } - else - return REAL(sigprocmask)(how_n, NULL, NULL); -} - -int WRAP(sigsuspend)(const sigset_t_portable *mask) { - sigset_t mask_n; - sigset_t_pton(mask, &mask_n); - return REAL(sigsuspend)(&mask_n); -} - -int WRAP(sigwait)(const sigset_t_portable *set, int *sig) { - sigset_t set_n; - sigset_t_pton(set, &set_n); - int ret = REAL(sigwait)(&set_n, sig); - *sig = signo_ntop(*sig); - return ret; -} - -int WRAP(kill)(pid_t pid, int sig) { - int sig_n = signo_pton(sig); - return REAL(kill)(pid, sig_n); -} - -// sigset_t related function -#include -int WRAP(pselect)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t_portable *sigmask) { - sigset_t sigmask_n; - sigset_t_pton(sigmask, &sigmask_n); - return REAL(pselect)(nfds, readfds, writefds, exceptfds, timeout, sigmask_n); -} - -#include -int WRAP(signalfd)(int fd, const sigset_t_portable* mask, int flags) { - sigset_t mask_n; - sigset_t_pton(mask, &mask_n); - return REAL(signalfd)(fd, mask_n, flags); -} - -#include -int WRAP(ppoll)(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts, const sigset_t_portable *sigmask) { - sigset_t sigmask_n; - sigset_t_pton(sigmask, &sigmask_n); - return REAL(ppoll)(fds, nfds, timeout_ts, sigmask_n); -} - -#include -int WRAP(pthread_sigmask)(int how, const sigset_t_portable *set, sigset_t_portable *oldset) { - int how_n; - switch(how) { - case SIG_BLOCK_PORTABLE: how_n = SIG_BLOCK; break; - case SIG_UNBLOCK_PORTABLE: how_n = SIG_UNBLOCK; break; - case SIG_SETMASK_PORTABLE: how_n = SIG_SETMASK; break; - default: - fprintf(stderr, "Unknown pthread_sigmask action:%d\n", how); - abort(); - } - sigset_t set_n, oldset_n; - if (set != NULL) { - sigset_t_pton(set, &set_n); - if (oldset != NULL) { - int ret = REAL(pthread_sigmask)(how_n, &set_n, &oldset_n); - sigset_t_ntop(&oldset_n, oldset); - return ret; - } - else - return REAL(pthread_sigmask)(how_n, &set_n, NULL); - } - else if (oldset != NULL) { - int ret = REAL(pthread_sigmask)(how_n, NULL, &oldset_n); - sigset_t_ntop(&oldset_n, oldset); - return ret; - } - else - return REAL(pthread_sigmask)(how_n, NULL, NULL); -} - -#include -int WRAP(epoll_pwait)(int fd, struct epoll_event* events, int max_events, int timeout, const sigset_t_portable* ss) { - sigset_t ss_n; - sigset_t_pton(ss, &ss_n); - return REAL(epoll_pwait)(fd, events, max_events, timeout, ss_n); -} -#endif /* __mips__ */ -#endif /* _SIGNAL_PORTABLE_H */ diff --git a/ndk/sources/android/libportable/common/include/stat_portable.h b/ndk/sources/android/libportable/common/include/stat_portable.h deleted file mode 100644 index a2f3be7f1..000000000 --- a/ndk/sources/android/libportable/common/include/stat_portable.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2014, 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 _StatPortable_H_ -#define _StatPortable_H_ - -#include -#include -#include -#include - -#define __STAT64_BODY_PORTABLE \ - unsigned long st_dev; \ - unsigned long st_ino; \ - unsigned long st_mode; \ - unsigned long st_nlink; \ - uid_t st_uid; /* 32-bit uid_t */ \ - unsigned char padding[4]; \ - gid_t st_gid; /* 32-bit gid_t */ \ - unsigned char padding2[4]; \ - unsigned long st_rdev; \ - long st_size; \ - long st_blksize; \ - long st_blocks; \ - long st_atime; \ - unsigned long st_atime_nsec; \ - long st_mtime; \ - unsigned long st_mtime_nsec; \ - long st_ctime; \ - unsigned long st_ctime_nsec; \ - unsigned char padding3[8]; - -struct StatPortable { __STAT64_BODY_PORTABLE }; -typedef struct StatPortable Stat64Portable; - -static inline void stat_n2p(struct stat* pn, struct StatPortable* pp) -{ - memset(pp, '\0', sizeof(struct StatPortable)); - pp->st_dev = pn->st_dev; - pp->st_ino = pn->st_ino; - pp->st_mode = pn->st_mode; - pp->st_nlink = pn->st_nlink; - pp->st_uid = pn->st_uid; - pp->st_gid = pn->st_gid; - pp->st_rdev = pn->st_rdev; - pp->st_size = pn->st_size; - pp->st_blksize = pn->st_blksize; - pp->st_blocks = pn->st_blocks; - pp->st_atime = pn->st_atime; - pp->st_atime_nsec = pn->st_atime_nsec; - pp->st_mtime = pn->st_mtime; - pp->st_mtime_nsec = pn->st_mtime_nsec; - pp->st_ctime = pn->st_ctime; - pp->st_ctime_nsec = pn->st_ctime_nsec; -} - -int WRAP(fstat)(int a, struct StatPortable* p) -{ - struct stat target_stat_obj; - int ret = REAL(fstat)(a, &target_stat_obj); - stat_n2p(&target_stat_obj, p); - return ret; -} - -int WRAP(fstat64)(int a, Stat64Portable* p) -{ - return WRAP(fstat)(a, p); -} - -int WRAP(fstatat)(int a, const char* p1, struct StatPortable* p2, int b) -{ - struct stat target_stat_obj; - int ret = REAL(fstatat)(a, p1, &target_stat_obj, b); - stat_n2p(&target_stat_obj, p2); - return ret; -} - -int WRAP(fstatat64)(int a, const char* b, Stat64Portable* c, int d) -{ - return WRAP(fstatat)(a, b, c, d); -} - -int WRAP(lstat)(const char* a, struct StatPortable* p) -{ - struct stat target_stat_obj; - int ret = REAL(lstat)(a, &target_stat_obj); - stat_n2p(&target_stat_obj, p); - return ret; -} - -int WRAP(lstat64)(const char* a, Stat64Portable* p) -{ - return WRAP(lstat)(a, p); -} - -int WRAP(stat)(const char* a, struct StatPortable* p) -{ - struct stat target_stat_obj; - int ret = REAL(stat)(a, &target_stat_obj); - stat_n2p(&target_stat_obj, p); - return ret; -} - -int WRAP(stat64)(const char* a, Stat64Portable* p) -{ - return WRAP(stat)(a, p); -} - -#endif /* _StatPortable_H */ diff --git a/ndk/sources/android/libportable/common/include/vfs_portable.h b/ndk/sources/android/libportable/common/include/vfs_portable.h deleted file mode 100644 index ac57dedea..000000000 --- a/ndk/sources/android/libportable/common/include/vfs_portable.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2014, 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 _VFS_PORTABLE_H_ -#define _VFS_PORTABLE_H_ - -#include -#include -#include -#include - -typedef __fsid_t fsid_t; - -#define __STATFS64_BODY_PORTABLE \ - uint64_t f_type; \ - uint64_t f_bsize; \ - uint64_t f_blocks; \ - uint64_t f_bfree; \ - uint64_t f_bavail; \ - uint64_t f_files; \ - uint64_t f_ffree; \ - fsid_t f_fsid; \ - uint64_t f_namelen; \ - uint64_t f_frsize; \ - uint64_t f_flags; \ - uint64_t f_spare[5]; - - -struct StatfsPortable { __STATFS64_BODY_PORTABLE }; -typedef struct StatfsPortable Statfs64Portable; - -#undef __STATFS64_BODY_PORTABLE - -static void statfs_n2p(const struct statfs* pn, struct StatfsPortable* pp) -{ - memset(pp, '\0', sizeof(struct StatfsPortable)); - pp->f_type = pn->f_type; - pp->f_bsize = pn->f_bsize; - pp->f_blocks = pn->f_blocks; - pp->f_bfree = pn->f_bfree; - pp->f_bavail = pn->f_bavail; - pp->f_files = pn->f_files; - pp->f_ffree = pn->f_ffree; - memcpy(&pp->f_fsid, &pn->f_fsid, sizeof(int)*2); - pp->f_namelen = pn->f_namelen; - pp->f_frsize = pn->f_frsize; - pp->f_flags = pn->f_flags; -#ifdef __mips__ - memcpy(&pp->f_spare, &pn->f_spare, 4); -#else - memcpy(&pp->f_spare, &pn->f_spare, 5); -#endif -} - -int WRAP(statfs)(const char* path, struct StatfsPortable* stat) -{ - struct statfs target_stat; - int ret = REAL(statfs)(path, &target_stat); - statfs_n2p(&target_stat, stat); - return ret; -} - -int WRAP(statfs64)(const char* path, Statfs64Portable* stat) -{ - return WRAP(statfs)(path, stat); -} - -int WRAP(fstatfs)(int fd, struct StatfsPortable* stat) -{ - struct statfs target_stat; - int ret = REAL(fstatfs)(fd, &target_stat); - statfs_n2p(&target_stat, stat); - return ret; -} - -int WRAP(fstatfs64)(int fd, Statfs64Portable* stat) -{ - return WRAP(fstatfs)(fd, stat); -} - -#endif /* _VFS_PORTABLE_H */ diff --git a/python-packages/.gitignore b/python-packages/.gitignore new file mode 100644 index 000000000..a65d04669 --- /dev/null +++ b/python-packages/.gitignore @@ -0,0 +1,58 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ diff --git a/host/Android.mk b/python-packages/adb/__init__.py similarity index 73% rename from host/Android.mk rename to python-packages/adb/__init__.py index 5e318e121..6b509c643 100644 --- a/host/Android.mk +++ b/python-packages/adb/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2008 The Android Open Source Project +# Copyright (C) 2015 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. @@ -13,9 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # -LOCAL_PATH := $(my-dir) - -dir := $(wildcard $(LOCAL_PATH)/$(HOST_PREBUILT_TAG)) -ifdef dir - include $(call first-makefiles-under,$(dir)) -endif +from __future__ import absolute_import +from .device import * # pylint: disable=wildcard-import diff --git a/python-packages/adb/device.py b/python-packages/adb/device.py new file mode 100644 index 000000000..29347c3f6 --- /dev/null +++ b/python-packages/adb/device.py @@ -0,0 +1,478 @@ +# +# Copyright (C) 2015 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. +# +import atexit +import base64 +import logging +import os +import re +import subprocess + + +class FindDeviceError(RuntimeError): + pass + + +class DeviceNotFoundError(FindDeviceError): + def __init__(self, serial): + self.serial = serial + super(DeviceNotFoundError, self).__init__( + 'No device with serial {}'.format(serial)) + + +class NoUniqueDeviceError(FindDeviceError): + def __init__(self): + super(NoUniqueDeviceError, self).__init__('No unique device') + + +class ShellError(RuntimeError): + def __init__(self, cmd, stdout, stderr, exit_code): + super(ShellError, self).__init__( + '`{0}` exited with code {1}'.format(cmd, exit_code)) + self.cmd = cmd + self.stdout = stdout + self.stderr = stderr + self.exit_code = exit_code + + +def get_devices(adb_path='adb'): + with open(os.devnull, 'wb') as devnull: + subprocess.check_call([adb_path, 'start-server'], stdout=devnull, + stderr=devnull) + out = subprocess.check_output([adb_path, 'devices']).splitlines() + + # The first line of `adb devices` just says "List of attached devices", so + # skip that. + devices = [] + for line in out[1:]: + if not line.strip(): + continue + if 'offline' in line: + continue + + serial, _ = re.split(r'\s+', line, maxsplit=1) + devices.append(serial) + return devices + + +def _get_unique_device(product=None, adb_path='adb'): + devices = get_devices(adb_path=adb_path) + if len(devices) != 1: + raise NoUniqueDeviceError() + return AndroidDevice(devices[0], product, adb_path) + + +def _get_device_by_serial(serial, product=None, adb_path='adb'): + for device in get_devices(adb_path=adb_path): + if device == serial: + return AndroidDevice(serial, product, adb_path) + raise DeviceNotFoundError(serial) + + +def get_device(serial=None, product=None, adb_path='adb'): + """Get a uniquely identified AndroidDevice if one is available. + + Raises: + DeviceNotFoundError: + The serial specified by `serial` or $ANDROID_SERIAL is not + connected. + + NoUniqueDeviceError: + Neither `serial` nor $ANDROID_SERIAL was set, and the number of + devices connected to the system is not 1. Having 0 connected + devices will also result in this error. + + Returns: + An AndroidDevice associated with the first non-None identifier in the + following order of preference: + + 1) The `serial` argument. + 2) The environment variable $ANDROID_SERIAL. + 3) The single device connnected to the system. + """ + if serial is not None: + return _get_device_by_serial(serial, product, adb_path) + + android_serial = os.getenv('ANDROID_SERIAL') + if android_serial is not None: + return _get_device_by_serial(android_serial, product, adb_path) + + return _get_unique_device(product, adb_path=adb_path) + + +def _get_device_by_type(flag, adb_path): + with open(os.devnull, 'wb') as devnull: + subprocess.check_call([adb_path, 'start-server'], stdout=devnull, + stderr=devnull) + try: + serial = subprocess.check_output([adb_path, flag, 'get-serialno']).strip() + except subprocess.CalledProcessError: + raise RuntimeError('adb unexpectedly returned nonzero') + if serial == 'unknown': + raise NoUniqueDeviceError() + return _get_device_by_serial(serial, adb_path=adb_path) + + +def get_usb_device(adb_path='adb'): + """Get the unique USB-connected AndroidDevice if it is available. + + Raises: + NoUniqueDeviceError: + 0 or multiple devices are connected via USB. + + Returns: + An AndroidDevice associated with the unique USB-connected device. + """ + return _get_device_by_type('-d', adb_path=adb_path) + + +def get_emulator_device(adb_path='adb'): + """Get the unique emulator AndroidDevice if it is available. + + Raises: + NoUniqueDeviceError: + 0 or multiple emulators are running. + + Returns: + An AndroidDevice associated with the unique running emulator. + """ + return _get_device_by_type('-e', adb_path=adb_path) + + +# If necessary, modifies subprocess.check_output() or subprocess.Popen() args to run the subprocess +# via Windows PowerShell to work-around an issue in Python 2's subprocess class on Windows where it +# doesn't support Unicode. +def _get_subprocess_args(args): + # Only do this slow work-around if Unicode is in the cmd line on Windows. PowerShell takes + # 600-700ms to startup on a 2013-2014 machine, which is very slow. + if (os.name != 'nt' or all(not isinstance(arg, unicode) for arg in args[0])): + return args + + def escape_arg(arg): + # Escape for the parsing that the C Runtime does in Windows apps. In particular, this will + # take care of double-quotes. + arg = subprocess.list2cmdline([arg]) + # Escape single-quote with another single-quote because we're about to... + arg = arg.replace(u"'", u"''") + # ...put the arg in a single-quoted string for PowerShell to parse. + arg = u"'" + arg + u"'" + return arg + + # Escape command line args. + argv = map(escape_arg, args[0]) + # Cause script errors (such as adb not found) to stop script immediately with an error. + ps_code = u'$ErrorActionPreference = "Stop"\r\n'; + # Add current directory to the PATH var, to match cmd.exe/CreateProcess() behavior. + ps_code += u'$env:Path = ".;" + $env:Path\r\n'; + # Precede by &, the PowerShell call operator, and separate args by space. + ps_code += u'& ' + u' '.join(argv) + # Make the PowerShell exit code the exit code of the subprocess. + ps_code += u'\r\nExit $LastExitCode' + # Encode as UTF-16LE (without Byte-Order-Mark) which Windows natively understands. + ps_code = ps_code.encode('utf-16le') + + # Encode the PowerShell command as base64 and use the special -EncodedCommand option that base64 + # decodes. Base64 is just plain ASCII, so it should have no problem passing through Win32 + # CreateProcessA() (which python erroneously calls instead of CreateProcessW()). + return (['powershell.exe', '-NoProfile', '-NonInteractive', '-EncodedCommand', + base64.b64encode(ps_code)],) + args[1:] + + +# Call this instead of subprocess.check_output() to work-around issue in Python +# 2's subprocess class on Windows where it doesn't support Unicode. +def _subprocess_check_output(*args, **kwargs): + try: + return subprocess.check_output(*_get_subprocess_args(args), **kwargs) + except subprocess.CalledProcessError as e: + # Show real command line instead of the powershell.exe command line. + raise subprocess.CalledProcessError(e.returncode, args[0], + output=e.output) + + +# Call this instead of subprocess.Popen(). Like _subprocess_check_output(). +def _subprocess_Popen(*args, **kwargs): + return subprocess.Popen(*_get_subprocess_args(args), **kwargs) + + +class AndroidDevice(object): + # Delimiter string to indicate the start of the exit code. + _RETURN_CODE_DELIMITER = 'x' + + # Follow any shell command with this string to get the exit + # status of a program since this isn't propagated by adb. + # + # The delimiter is needed because `printf 1; echo $?` would print + # "10", and we wouldn't be able to distinguish the exit code. + _RETURN_CODE_PROBE = [';', 'echo', '{0}$?'.format(_RETURN_CODE_DELIMITER)] + + # Maximum search distance from the output end to find the delimiter. + # adb on Windows returns \r\n even if adbd returns \n. + _RETURN_CODE_SEARCH_LENGTH = len('{0}255\r\n'.format(_RETURN_CODE_DELIMITER)) + + # Feature name strings. + SHELL_PROTOCOL_FEATURE = 'shell_v2' + + def __init__(self, serial, product=None, adb_path='adb'): + self.serial = serial + self.product = product + self.adb_cmd = [adb_path] + + if self.serial is not None: + self.adb_cmd.extend(['-s', serial]) + if self.product is not None: + self.adb_cmd.extend(['-p', product]) + self._linesep = None + self._features = None + + @property + def linesep(self): + if self._linesep is None: + self._linesep = subprocess.check_output(self.adb_cmd + + ['shell', 'echo']) + return self._linesep + + @property + def features(self): + if self._features is None: + try: + self._features = self._simple_call(['features']).splitlines() + except subprocess.CalledProcessError: + self._features = [] + return self._features + + def _make_shell_cmd(self, user_cmd): + command = self.adb_cmd + ['shell'] + user_cmd + if self.SHELL_PROTOCOL_FEATURE not in self.features: + command += self._RETURN_CODE_PROBE + return command + + def _parse_shell_output(self, out): + """Finds the exit code string from shell output. + + Args: + out: Shell output string. + + Returns: + An (exit_code, output_string) tuple. The output string is + cleaned of any additional stuff we appended to find the + exit code. + + Raises: + RuntimeError: Could not find the exit code in |out|. + """ + search_text = out + if len(search_text) > self._RETURN_CODE_SEARCH_LENGTH: + # We don't want to search over massive amounts of data when we know + # the part we want is right at the end. + search_text = search_text[-self._RETURN_CODE_SEARCH_LENGTH:] + partition = search_text.rpartition(self._RETURN_CODE_DELIMITER) + if partition[1] == '': + raise RuntimeError('Could not find exit status in shell output.') + result = int(partition[2]) + # partition[0] won't contain the full text if search_text was truncated, + # pull from the original string instead. + out = out[:-len(partition[1]) - len(partition[2])] + return result, out + + def _simple_call(self, cmd): + logging.info(' '.join(self.adb_cmd + cmd)) + return _subprocess_check_output( + self.adb_cmd + cmd, stderr=subprocess.STDOUT) + + def shell(self, cmd): + """Calls `adb shell` + + Args: + cmd: command to execute as a list of strings. + + Returns: + A (stdout, stderr) tuple. Stderr may be combined into stdout + if the device doesn't support separate streams. + + Raises: + ShellError: the exit code was non-zero. + """ + exit_code, stdout, stderr = self.shell_nocheck(cmd) + if exit_code != 0: + raise ShellError(cmd, stdout, stderr, exit_code) + return stdout, stderr + + def shell_nocheck(self, cmd): + """Calls `adb shell` + + Args: + cmd: command to execute as a list of strings. + + Returns: + An (exit_code, stdout, stderr) tuple. Stderr may be combined + into stdout if the device doesn't support separate streams. + """ + cmd = self._make_shell_cmd(cmd) + logging.info(' '.join(cmd)) + p = _subprocess_Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + if self.SHELL_PROTOCOL_FEATURE in self.features: + exit_code = p.returncode + else: + exit_code, stdout = self._parse_shell_output(stdout) + return exit_code, stdout, stderr + + def shell_popen(self, cmd, kill_atexit=True, preexec_fn=None, + creationflags=0, **kwargs): + """Calls `adb shell` and returns a handle to the adb process. + + This function provides direct access to the subprocess used to run the + command, without special return code handling. Users that need the + return value must retrieve it themselves. + + Args: + cmd: Array of command arguments to execute. + kill_atexit: Whether to kill the process upon exiting. + preexec_fn: Argument forwarded to subprocess.Popen. + creationflags: Argument forwarded to subprocess.Popen. + **kwargs: Arguments forwarded to subprocess.Popen. + + Returns: + subprocess.Popen handle to the adb shell instance + """ + + command = self.adb_cmd + ['shell'] + cmd + + # Make sure a ctrl-c in the parent script doesn't kill gdbserver. + if os.name == 'nt': + creationflags |= subprocess.CREATE_NEW_PROCESS_GROUP + else: + if preexec_fn is None: + preexec_fn = os.setpgrp + elif preexec_fn is not os.setpgrp: + fn = preexec_fn + def _wrapper(): + fn() + os.setpgrp() + preexec_fn = _wrapper + + p = _subprocess_Popen(command, creationflags=creationflags, + preexec_fn=preexec_fn, **kwargs) + + if kill_atexit: + atexit.register(p.kill) + + return p + + def install(self, filename, replace=False): + cmd = ['install'] + if replace: + cmd.append('-r') + cmd.append(filename) + return self._simple_call(cmd) + + def push(self, local, remote): + return self._simple_call(['push', local, remote]) + + def pull(self, remote, local): + return self._simple_call(['pull', remote, local]) + + def sync(self, directory=None): + cmd = ['sync'] + if directory is not None: + cmd.append(directory) + return self._simple_call(cmd) + + def tcpip(self, port): + return self._simple_call(['tcpip', port]) + + def usb(self): + return self._simple_call(['usb']) + + def reboot(self): + return self._simple_call(['reboot']) + + def remount(self): + return self._simple_call(['remount']) + + def root(self): + return self._simple_call(['root']) + + def unroot(self): + return self._simple_call(['unroot']) + + def connect(self, host): + return self._simple_call(['connect', host]) + + def disconnect(self, host): + return self._simple_call(['disconnect', host]) + + def forward(self, local, remote): + return self._simple_call(['forward', local, remote]) + + def forward_list(self): + return self._simple_call(['forward', '--list']) + + def forward_no_rebind(self, local, remote): + return self._simple_call(['forward', '--no-rebind', local, remote]) + + def forward_remove(self, local): + return self._simple_call(['forward', '--remove', local]) + + def forward_remove_all(self): + return self._simple_call(['forward', '--remove-all']) + + def reverse(self, remote, local): + return self._simple_call(['reverse', remote, local]) + + def reverse_list(self): + return self._simple_call(['reverse', '--list']) + + def reverse_no_rebind(self, local, remote): + return self._simple_call(['reverse', '--no-rebind', local, remote]) + + def reverse_remove_all(self): + return self._simple_call(['reverse', '--remove-all']) + + def reverse_remove(self, remote): + return self._simple_call(['reverse', '--remove', remote]) + + def wait(self): + return self._simple_call(['wait-for-device']) + + def get_props(self): + result = {} + output, _ = self.shell(['getprop']) + output = output.splitlines() + pattern = re.compile(r'^\[([^]]+)\]: \[(.*)\]') + for line in output: + match = pattern.match(line) + if match is None: + raise RuntimeError('invalid getprop line: "{}"'.format(line)) + key = match.group(1) + value = match.group(2) + if key in result: + raise RuntimeError('duplicate getprop key: "{}"'.format(key)) + result[key] = value + return result + + def get_prop(self, prop_name): + output = self.shell(['getprop', prop_name])[0].splitlines() + if len(output) != 1: + raise RuntimeError('Too many lines in getprop output:\n' + + '\n'.join(output)) + value = output[0] + if not value.strip(): + return None + return value + + def set_prop(self, prop_name, value): + self.shell(['setprop', prop_name, value]) diff --git a/python-packages/adb/setup.py b/python-packages/adb/setup.py new file mode 100644 index 000000000..5595cdd1d --- /dev/null +++ b/python-packages/adb/setup.py @@ -0,0 +1,32 @@ +# +# Copyright (C) 2015 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. +# +from distutils.core import setup + + +setup( + name='adb', + version='0.0.1', + description='A Python interface to the Android Debug Bridge.', + license='Apache 2.0', + keywords='adb android', + package_dir={'adb': ''}, + packages=['adb'], + classifiers=[ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + ] +) diff --git a/python-packages/gdbrunner/__init__.py b/python-packages/gdbrunner/__init__.py new file mode 100644 index 000000000..493a4e71f --- /dev/null +++ b/python-packages/gdbrunner/__init__.py @@ -0,0 +1,304 @@ +# +# Copyright (C) 2015 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. +# + +"""Helpers used by both gdbclient.py and ndk-gdb.py.""" + +import adb +import argparse +import atexit +import os +import subprocess +import sys +import tempfile + +class ArgumentParser(argparse.ArgumentParser): + """ArgumentParser subclass that provides adb device selection.""" + + def __init__(self): + super(ArgumentParser, self).__init__() + self.add_argument( + "--adb", dest="adb_path", + help="Use specific adb command") + + group = self.add_argument_group(title="device selection") + group = group.add_mutually_exclusive_group() + group.add_argument( + "-a", action="store_const", dest="device", const="-a", + help="directs commands to all interfaces") + group.add_argument( + "-d", action="store_const", dest="device", const="-d", + help="directs commands to the only connected USB device") + group.add_argument( + "-e", action="store_const", dest="device", const="-e", + help="directs commands to the only connected emulator") + group.add_argument( + "-s", metavar="SERIAL", action="store", dest="serial", + help="directs commands to device/emulator with the given serial") + + def parse_args(self, args=None, namespace=None): + result = super(ArgumentParser, self).parse_args(args, namespace) + + adb_path = result.adb_path or "adb" + + # Try to run the specified adb command + try: + subprocess.check_output([adb_path, "version"], + stderr=subprocess.STDOUT) + except (OSError, subprocess.CalledProcessError): + msg = "ERROR: Unable to run adb executable (tried '{}')." + if not result.adb_path: + msg += "\n Try specifying its location with --adb." + sys.exit(msg.format(adb_path)) + + try: + if result.device == "-a": + result.device = adb.get_device(adb_path=adb_path) + elif result.device == "-d": + result.device = adb.get_usb_device(adb_path=adb_path) + elif result.device == "-e": + result.device = adb.get_emulator_device(adb_path=adb_path) + else: + result.device = adb.get_device(result.serial, adb_path=adb_path) + except (adb.DeviceNotFoundError, adb.NoUniqueDeviceError, RuntimeError): + # Don't error out if we can't find a device. + result.device = None + + return result + + +def get_run_as_cmd(user, cmd): + """Generate a run-as or su command depending on user.""" + + if user is None: + return cmd + elif user == "root": + return ["su", "0"] + cmd + else: + return ["run-as", user] + cmd + + +def get_processes(device): + """Return a dict from process name to list of running PIDs on the device.""" + + # Some custom ROMs use busybox instead of toolbox for ps. Without -w, + # busybox truncates the output, and very long package names like + # com.exampleisverylongtoolongbyfar.plasma exceed the limit. + # + # Perform the check for this on the device to avoid an adb roundtrip + # Some devices might not have readlink or which, so we need to handle + # this as well. + + ps_script = """ + if [ ! -x /system/bin/readlink -o ! -x /system/bin/which ]; then + ps; + elif [ $(readlink $(which ps)) == "toolbox" ]; then + ps; + else + ps -w; + fi + """ + ps_script = " ".join([line.strip() for line in ps_script.splitlines()]) + + output, _ = device.shell([ps_script]) + + processes = dict() + output = output.replace("\r", "").splitlines() + columns = output.pop(0).split() + try: + pid_column = columns.index("PID") + except ValueError: + pid_column = 1 + while output: + columns = output.pop().split() + process_name = columns[-1] + pid = int(columns[pid_column]) + if process_name in processes: + processes[process_name].append(pid) + else: + processes[process_name] = [pid] + + return processes + + +def get_pids(device, process_name): + processes = get_processes(device) + return processes.get(process_name, []) + + +def start_gdbserver(device, gdbserver_local_path, gdbserver_remote_path, + target_pid, run_cmd, debug_socket, port, user=None): + """Start gdbserver in the background and forward necessary ports. + + Args: + device: ADB device to start gdbserver on. + gdbserver_local_path: Host path to push gdbserver from, can be None. + gdbserver_remote_path: Device path to push gdbserver to. + target_pid: PID of device process to attach to. + run_cmd: Command to run on the device. + debug_socket: Device path to place gdbserver unix domain socket. + port: Host port to forward the debug_socket to. + user: Device user to run gdbserver as. + + Returns: + Popen handle to the `adb shell` process gdbserver was started with. + """ + + assert target_pid is None or run_cmd is None + + # Push gdbserver to the target. + if gdbserver_local_path is not None: + device.push(gdbserver_local_path, gdbserver_remote_path) + + # Run gdbserver. + gdbserver_cmd = [gdbserver_remote_path, "--once", + "+{}".format(debug_socket)] + + if target_pid is not None: + gdbserver_cmd += ["--attach", str(target_pid)] + else: + gdbserver_cmd += run_cmd + + device.forward("tcp:{}".format(port), + "localfilesystem:{}".format(debug_socket)) + atexit.register(lambda: device.forward_remove("tcp:{}".format(port))) + gdbserver_cmd = get_run_as_cmd(user, gdbserver_cmd) + + # Use ppid so that the file path stays the same. + gdbclient_output_path = os.path.join(tempfile.gettempdir(), + "gdbclient-{}".format(os.getppid())) + print "Redirecting gdbclient output to {}".format(gdbclient_output_path) + gdbclient_output = file(gdbclient_output_path, 'w') + return device.shell_popen(gdbserver_cmd, stdout=gdbclient_output, + stderr=gdbclient_output) + + +def find_file(device, executable_path, sysroot, user=None): + """Finds a device executable file. + + This function first attempts to find the local file which will + contain debug symbols. If that fails, it will fall back to + downloading the stripped file from the device. + + Args: + device: the AndroidDevice object to use. + executable_path: absolute path to the executable or symlink. + sysroot: absolute path to the built symbol sysroot. + user: if necessary, the user to download the file as. + + Returns: + A tuple containing (, ). + + Raises: + RuntimeError: could not find the executable binary. + ValueError: |executable_path| is not absolute. + """ + if not os.path.isabs(executable_path): + raise ValueError("'{}' is not an absolute path".format(executable_path)) + + def generate_files(): + """Yields (, ) tuples.""" + # First look locally to avoid shelling into the device if possible. + # os.path.join() doesn't combine absolute paths, use + instead. + yield (sysroot + executable_path, True) + + # Next check if the path is a symlink. + try: + target = device.shell(['readlink', '-e', '-n', executable_path])[0] + yield (sysroot + target, True) + except adb.ShellError: + pass + + # Last, download the stripped executable from the device if necessary. + file_name = "gdbclient-binary-{}".format(os.getppid()) + remote_temp_path = "/data/local/tmp/{}".format(file_name) + local_path = os.path.join(tempfile.gettempdir(), file_name) + cmd = get_run_as_cmd(user, + ["cat", executable_path, ">", remote_temp_path]) + try: + device.shell(cmd) + except adb.ShellError: + raise RuntimeError("Failed to copy '{}' to temporary folder on " + "device".format(executable_path)) + device.pull(remote_temp_path, local_path) + yield (local_path, False) + + for path, found_locally in generate_files(): + if os.path.isfile(path): + return (open(path, "r"), found_locally) + raise RuntimeError('Could not find executable {}'.format(executable_path)) + + +def find_binary(device, pid, sysroot, user=None): + """Finds a device executable file corresponding to |pid|.""" + return find_file(device, "/proc/{}/exe".format(pid), sysroot, user) + + +def get_binary_arch(binary_file): + """Parse a binary's ELF header for arch.""" + try: + binary_file.seek(0) + binary = binary_file.read(0x14) + except IOError: + raise RuntimeError("failed to read binary file") + ei_class = ord(binary[0x4]) # 1 = 32-bit, 2 = 64-bit + ei_data = ord(binary[0x5]) # Endianness + + assert ei_class == 1 or ei_class == 2 + if ei_data != 1: + raise RuntimeError("binary isn't little-endian?") + + e_machine = ord(binary[0x13]) << 8 | ord(binary[0x12]) + if e_machine == 0x28: + assert ei_class == 1 + return "arm" + elif e_machine == 0xB7: + assert ei_class == 2 + return "arm64" + elif e_machine == 0x03: + assert ei_class == 1 + return "x86" + elif e_machine == 0x3E: + assert ei_class == 2 + return "x86_64" + elif e_machine == 0x08: + if ei_class == 1: + return "mips" + else: + return "mips64" + else: + raise RuntimeError("unknown architecture: 0x{:x}".format(e_machine)) + + +def start_gdb(gdb_path, gdb_commands, gdb_flags=None): + """Start gdb in the background and block until it finishes. + + Args: + gdb_path: Path of the gdb binary. + gdb_commands: Contents of GDB script to run. + gdb_flags: List of flags to append to gdb command. + """ + + with tempfile.NamedTemporaryFile() as gdb_script: + gdb_script.write(gdb_commands) + gdb_script.flush() + gdb_args = [gdb_path, "-x", gdb_script.name] + (gdb_flags or []) + gdb_process = subprocess.Popen(gdb_args) + while gdb_process.returncode is None: + try: + gdb_process.communicate() + except KeyboardInterrupt: + pass + diff --git a/samples/Support4Demos/AndroidManifest.xml b/samples/Support4Demos/AndroidManifest.xml index e662cf4b9..9d4f69d79 100644 --- a/samples/Support4Demos/AndroidManifest.xml +++ b/samples/Support4Demos/AndroidManifest.xml @@ -359,6 +359,14 @@ + + + + + + + @@ -367,6 +375,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/Support4Demos/res/drawable-hdpi/ic_favorite.png b/samples/Support4Demos/res/drawable-hdpi/ic_favorite.png new file mode 100644 index 000000000..1de4e583d Binary files /dev/null and b/samples/Support4Demos/res/drawable-hdpi/ic_favorite.png differ diff --git a/samples/Support4Demos/res/drawable-mdpi/ic_favorite.png b/samples/Support4Demos/res/drawable-mdpi/ic_favorite.png new file mode 100644 index 000000000..aa5d340db Binary files /dev/null and b/samples/Support4Demos/res/drawable-mdpi/ic_favorite.png differ diff --git a/samples/Support4Demos/res/drawable-xhdpi/ic_favorite.png b/samples/Support4Demos/res/drawable-xhdpi/ic_favorite.png new file mode 100644 index 000000000..5868c34bf Binary files /dev/null and b/samples/Support4Demos/res/drawable-xhdpi/ic_favorite.png differ diff --git a/samples/Support4Demos/res/drawable-xxhdpi/ic_favorite.png b/samples/Support4Demos/res/drawable-xxhdpi/ic_favorite.png new file mode 100644 index 000000000..02b46e3bd Binary files /dev/null and b/samples/Support4Demos/res/drawable-xxhdpi/ic_favorite.png differ diff --git a/samples/Support4Demos/res/drawable-xxxhdpi/ic_favorite.png b/samples/Support4Demos/res/drawable-xxxhdpi/ic_favorite.png new file mode 100644 index 000000000..d7684c4cf Binary files /dev/null and b/samples/Support4Demos/res/drawable-xxxhdpi/ic_favorite.png differ diff --git a/samples/Support4Demos/res/layout/drawable_compat.xml b/samples/Support4Demos/res/layout/drawable_compat.xml new file mode 100644 index 000000000..dbf0413c9 --- /dev/null +++ b/samples/Support4Demos/res/layout/drawable_compat.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + diff --git a/samples/Support4Demos/res/layout/drawer_layout.xml b/samples/Support4Demos/res/layout/drawer_layout.xml index 375c8027a..496bd88d5 100644 --- a/samples/Support4Demos/res/layout/drawer_layout.xml +++ b/samples/Support4Demos/res/layout/drawer_layout.xml @@ -24,7 +24,8 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + space available using match_parent in both dimensions. Note that + this child does not specify android:layout_gravity attribute. --> + + + + + + + + + +