Revert "Revert "Pull the pthread_key_t functions out of pthread.c.""

This reverts commit 6260553d48f6fd87ca220270bea8bafdde5726ec

(Removing the accidental libm/Android.mk change.)

Change-Id: I6cddd9857c31facc05636e8221505b3d2344cb75
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index b983fbc..edf878f 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -47,27 +47,25 @@
 #define BIONIC_TLS_SLOTS            64
 
 /* Well-known TLS slots. What data goes in which slot is arbitrary unless otherwise noted. */
-#define TLS_SLOT_SELF               0  /* The kernel requires this specific slot for x86. */
-#define TLS_SLOT_THREAD_ID          1
-#define TLS_SLOT_ERRNO              2
+enum {
+  TLS_SLOT_SELF = 0, /* The kernel requires this specific slot for x86. */
+  TLS_SLOT_THREAD_ID,
+  TLS_SLOT_ERRNO,
+  TLS_SLOT_OPENGL_API = 3,
+  TLS_SLOT_OPENGL = 4,
+  TLS_SLOT_STACK_GUARD = 5, /* GCC requires this specific slot for x86. */
+  TLS_SLOT_DLERROR,
 
-#define TLS_SLOT_OPENGL_API         3
-#define TLS_SLOT_OPENGL             4
-
-#define TLS_SLOT_STACK_GUARD        5  /* GCC requires this specific slot for x86. */
-#define TLS_SLOT_DLERROR            6
-
-#define TLS_SLOT_MAX_WELL_KNOWN     TLS_SLOT_DLERROR
+  TLS_SLOT_FIRST_USER_SLOT /* Must come last! */
+};
 
 /* This slot is only used to pass information from the dynamic linker to
  * libc.so when the C library is loaded in to memory. The C runtime init
  * function will then clear it. Since its use is extremely temporary,
- * we reuse an existing location.
+ * we reuse an existing location that isn't needed during libc startup.
  */
 #define  TLS_SLOT_BIONIC_PREINIT    TLS_SLOT_OPENGL_API
 
-#define TLS_DEFAULT_ALLOC_MAP       0x0000001F
-
 /* set the Thread Local Storage, must contain at least BIONIC_TLS_SLOTS pointers */
 extern void __init_tls(void**  tls, void*  thread_info);