diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index 924737e..2a5ae8b 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -41,28 +41,31 @@ using namespace android;
 
 #if USE_FAST_TLS_KEY
 
-    #ifdef HAVE_ARM_TLS_REGISTER
-        #define GET_TLS(reg) \
-            "mrc p15, 0, " #reg ", c13, c0, 3 \n"
-    #else
-        #define GET_TLS(reg) \
-            "mov   " #reg ", #0xFFFF0FFF      \n"  \
-            "ldr   " #reg ", [" #reg ", #-15] \n"
-    #endif
-
     #define API_ENTRY(_api) __attribute__((naked)) _api
 
-    #define CALL_GL_API(_api, ...)                              \
-         asm volatile(                                          \
-            GET_TLS(r12)                                        \
-            "ldr   r12, [r12, %[tls]] \n"                       \
-            "cmp   r12, #0            \n"                       \
-            "ldrne pc,  [r12, %[api]] \n"                       \
-            "bx    lr                 \n"                       \
-            :                                                   \
-            : [tls] "J"(TLS_SLOT_OPENGL_API*4),                 \
-              [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api))    \
-            :                                                   \
+    /*
+     * Using the kernel helper function (0xffff0fe0) that returns the TLS value
+     * at r0, instead of reading this directly from the register, as this is
+     * the recommended approach.
+     * Saving r0, r12, lr, and cc, as these are the ones that we corrupt,
+     * while the called function at 0xffff0fe0 guarantees that it does not
+     * clobber any registers.
+     */
+    #define CALL_GL_API(_api, ...)                               \
+         asm volatile(                                           \
+            "ldr   r12,=0xffff0fe0      \n\t"                    \
+            "push  {r0, lr}             \n\t"                    \
+            "blx   r12                  \n\t"                    \
+            "mov   r12, r0              \n\t"                    \
+            "pop   {r0, lr}             \n\t"                    \
+            "ldr   r12, [r12, %[tls]]   \n\t"                    \
+            "cmp   r12, #0              \n\t"                    \
+            "ldrne pc,  [r12, %[api]]   \n\t"                    \
+            "bx    lr                   \n\t"                    \
+            :                                                    \
+            : [tls] "J"(TLS_SLOT_OPENGL_API*4),                  \
+              [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \
+            : "r0", "r12", "lr", "cc"                            \
             );
 
     #define CALL_GL_API_RETURN(_api, ...) \
diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp
index d71ff76..da5b80b 100644
--- a/opengl/libs/GLES_CM/gl.cpp
+++ b/opengl/libs/GLES_CM/gl.cpp
@@ -97,28 +97,31 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
 
 #if USE_FAST_TLS_KEY && !CHECK_FOR_GL_ERRORS
 
-    #ifdef HAVE_ARM_TLS_REGISTER
-        #define GET_TLS(reg) \
-            "mrc p15, 0, " #reg ", c13, c0, 3 \n"
-    #else
-        #define GET_TLS(reg) \
-            "mov   " #reg ", #0xFFFF0FFF      \n"  \
-            "ldr   " #reg ", [" #reg ", #-15] \n"
-    #endif
-
     #define API_ENTRY(_api) __attribute__((naked)) _api
 
+    /*
+     * Using the kernel helper function (0xffff0fe0) that returns the TLS value 
+     * at r0, instead of reading this directly from the register, as this is 
+     * the recommended approach.
+     * Saving r0, r12, lr, and cc, as these are the ones that we corrupt,
+     * while the called function at 0xffff0fe0 guarantees that it does not
+     * clobber any registers.
+     */
     #define CALL_GL_API(_api, ...)                              \
          asm volatile(                                          \
-            GET_TLS(r12)                                        \
-            "ldr   r12, [r12, %[tls]] \n"                       \
-            "cmp   r12, #0            \n"                       \
-            "ldrne pc,  [r12, %[api]] \n"                       \
-            "bx    lr                 \n"                       \
+            "ldr   r12,=0xffff0fe0    \n\t"                     \
+            "push  {r0, lr}           \n\t"                     \
+            "blx   r12                \n\t"                     \
+            "mov   r12, r0            \n\t"                     \
+            "pop   {r0, lr}           \n\t"                     \
+            "ldr   r12, [r12, %[tls]] \n\t"                     \
+            "cmp   r12, #0            \n\t"                     \
+            "ldrne pc,  [r12, %[api]] \n\t"                     \
+            "bx    lr                 \n\t"                     \
             :                                                   \
             : [tls] "J"(TLS_SLOT_OPENGL_API*4),                 \
-              [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api))    \
-            :                                                   \
+              [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api))\
+            : "r0", "r12", "lr", "cc"\
             );
 
     #define CALL_GL_API_RETURN(_api, ...) \
