summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2014-06-07 00:16:33 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-07 00:16:33 +0000
commit17cbadf0f598b0d02179262ad5b6b270850ccb94 (patch)
treee2ec1795f9cf7fac86a015bc0fc5a66de6345d55 /opengl/libs/EGL
parent0c96c35fe47cd84f7423f925917b5dde97155e34 (diff)
parent6fa169faa955ecc47872557a5d4fd89a95190d5e (diff)
downloadframeworks_native-17cbadf0f598b0d02179262ad5b6b270850ccb94.zip
frameworks_native-17cbadf0f598b0d02179262ad5b6b270850ccb94.tar.gz
frameworks_native-17cbadf0f598b0d02179262ad5b6b270850ccb94.tar.bz2
am 6fa169fa: Merge "Add aarch64 EGL/GLES trampolines"
* commit '6fa169faa955ecc47872557a5d4fd89a95190d5e': Add aarch64 EGL/GLES trampolines
Diffstat (limited to 'opengl/libs/EGL')
-rw-r--r--opengl/libs/EGL/getProcAddress.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/opengl/libs/EGL/getProcAddress.cpp b/opengl/libs/EGL/getProcAddress.cpp
index 5470d81..fc61134 100644
--- a/opengl/libs/EGL/getProcAddress.cpp
+++ b/opengl/libs/EGL/getProcAddress.cpp
@@ -53,9 +53,29 @@ namespace android {
: [tls] "J"(TLS_SLOT_OPENGL_API*4), \
[api] "J"(__builtin_offsetof(gl_hooks_t, \
ext.extensions[_api])) \
- : \
+ : "r12" \
);
+#elif defined(__aarch64__)
+
+ #define API_ENTRY(_api) __attribute__((noinline)) _api
+
+ #define CALL_GL_EXTENSION_API(_api) \
+ asm volatile( \
+ "mrs x16, tpidr_el0\n" \
+ "ldr x16, [x16, %[tls]]\n" \
+ "cbz x16, 1f\n" \
+ "ldr x16, [x16, %[api]]\n" \
+ "cbz x16, 1f\n" \
+ "br x16\n" \
+ "1:\n" \
+ : \
+ : [tls] "i" (TLS_SLOT_OPENGL_API * sizeof(void*)), \
+ [api] "i" (__builtin_offsetof(gl_hooks_t, \
+ ext.extensions[_api])) \
+ : "x16" \
+ );
+
#elif defined(__i386__)
#define API_ENTRY(_api) __attribute__((noinline)) _api