From 30a41aa1ccc47de41642308a243fa5df2bfeec06 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Fri, 30 May 2014 23:32:12 -0700 Subject: Add aarch64 EGL/GLES trampolines Change-Id: Ia90e18d26ff3bdb7e643aff8d77cbaddd2ac2a03 --- opengl/libs/EGL/getProcAddress.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'opengl/libs/EGL') 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 -- cgit v1.1