summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2014-06-07 00:19:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-07 00:19:53 +0000
commit0d7271527fa48c26b657d689faffbc94c93e5b3c (patch)
treee0df94bc2ff326eebd918d393169c24ed4da4abd /opengl/libs/EGL
parent1bc1761d36b75c7df41a56de486c94953ea2f3b5 (diff)
parent17cbadf0f598b0d02179262ad5b6b270850ccb94 (diff)
downloadframeworks_native-0d7271527fa48c26b657d689faffbc94c93e5b3c.zip
frameworks_native-0d7271527fa48c26b657d689faffbc94c93e5b3c.tar.gz
frameworks_native-0d7271527fa48c26b657d689faffbc94c93e5b3c.tar.bz2
am 17cbadf0: am 6fa169fa: Merge "Add aarch64 EGL/GLES trampolines"
* commit '17cbadf0f598b0d02179262ad5b6b270850ccb94': 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