diff options
author | Jesse Hall <jessehall@google.com> | 2014-05-30 23:32:12 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2014-06-06 16:31:53 -0700 |
commit | 30a41aa1ccc47de41642308a243fa5df2bfeec06 (patch) | |
tree | e8c137e767954a917f5c2323c470c7e88f49cb76 /opengl/libs/EGL | |
parent | e86420e399993e0f49e5d7733b5fc87eb9fe179b (diff) | |
download | frameworks_native-30a41aa1ccc47de41642308a243fa5df2bfeec06.zip frameworks_native-30a41aa1ccc47de41642308a243fa5df2bfeec06.tar.gz frameworks_native-30a41aa1ccc47de41642308a243fa5df2bfeec06.tar.bz2 |
Add aarch64 EGL/GLES trampolines
Change-Id: Ia90e18d26ff3bdb7e643aff8d77cbaddd2ac2a03
Diffstat (limited to 'opengl/libs/EGL')
-rw-r--r-- | opengl/libs/EGL/getProcAddress.cpp | 22 |
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 |