[git commit master] linuxthreads: check TLS_DTV_AT_TP define correctly

Austin Foxley austinf at cetoncorp.com
Sat Oct 17 19:00:36 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=4596f460207d5c11a363c20745e5a7b56a0600c0
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 libpthread/linuxthreads/manager.c           |    8 ++++----
 libpthread/linuxthreads/pthread.c           |   10 +++++-----
 libpthread/linuxthreads_db/td_thr_tlsbase.c |    4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libpthread/linuxthreads/manager.c b/libpthread/linuxthreads/manager.c
index b068d6c..4293741 100644
--- a/libpthread/linuxthreads/manager.c
+++ b/libpthread/linuxthreads/manager.c
@@ -601,7 +601,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
   new_thread = _dl_allocate_tls (NULL);
   if (new_thread == NULL)
     return EAGAIN;
-# if TLS_DTV_AT_TP
+# if defined(TLS_DTV_AT_TP)
   /* pthread_descr is below TP.  */
   new_thread = (pthread_descr) ((char *) new_thread - TLS_PRE_TCB_SIZE);
 # endif
@@ -622,7 +622,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
       if (sseg >= PTHREAD_THREADS_MAX)
 	{
 #ifdef USE_TLS
-# if TLS_DTV_AT_TP
+# if defined(TLS_DTV_AT_TP)
 	  new_thread = (pthread_descr) ((char *) new_thread + TLS_PRE_TCB_SIZE);
 # endif
 	  _dl_deallocate_tls (new_thread, true);
@@ -824,7 +824,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
 #endif
       }
 #ifdef USE_TLS
-# if TLS_DTV_AT_TP
+# if defined(TLS_DTV_AT_TP)
     new_thread = (pthread_descr) ((char *) new_thread + TLS_PRE_TCB_SIZE);
 # endif
     _dl_deallocate_tls (new_thread, true);
@@ -917,7 +917,7 @@ static void pthread_free(pthread_descr th)
     }
 
 #ifdef USE_TLS
-# if TLS_DTV_AT_TP
+# if defined(TLS_DTV_AT_TP)
   th = (pthread_descr) ((char *) th + TLS_PRE_TCB_SIZE);
 # endif
   _dl_deallocate_tls (th, true);
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 4d1d906..6ae9a10 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -474,10 +474,10 @@ __libc_dl_error_tsd (void)
 static __inline__ void __attribute__((always_inline))
 init_one_static_tls (pthread_descr descr, struct link_map *map)
 {
-# if TLS_TCB_AT_TP
+# if defined(TLS_TCB_AT_TP)
   dtv_t *dtv = GET_DTV (descr);
   void *dest = (char *) descr - map->l_tls_offset;
-# elif TLS_DTV_AT_TP
+# elif defined(TLS_DTV_AT_TP)
   dtv_t *dtv = GET_DTV ((pthread_descr) ((char *) descr + TLS_PRE_TCB_SIZE));
   void *dest = (char *) descr + map->l_tls_offset + TLS_PRE_TCB_SIZE;
 # else
@@ -669,9 +669,9 @@ int __pthread_initialize_manager(void)
     return -1;
   }
 
-# if TLS_TCB_AT_TP
+# if defined(TLS_TCB_AT_TP)
   mgr = (pthread_descr) tcbp;
-# elif TLS_DTV_AT_TP
+# elif defined(TLS_DTV_AT_TP)
   /* pthread_descr is located right below tcbhead_t which _dl_allocate_tls
      returns.  */
   mgr = (pthread_descr) ((char *) tcbp - TLS_PRE_TCB_SIZE);
@@ -996,7 +996,7 @@ static void pthread_onexit_process(int retcode, void *arg)
            For mtrace, we'd like to print something though.  */
 	/* #ifdef USE_TLS
 	   tcbhead_t *tcbp = (tcbhead_t *) manager_thread;
-	   # if TLS_DTV_AT_TP
+	   # if defined(TLS_DTV_AT_TP)
 	   tcbp = (tcbhead_t) ((char *) tcbp + TLS_PRE_TCB_SIZE);
 	   # endif
 	   _dl_deallocate_tls (tcbp, true);
diff --git a/libpthread/linuxthreads_db/td_thr_tlsbase.c b/libpthread/linuxthreads_db/td_thr_tlsbase.c
index 5a7e31b..00c863d 100644
--- a/libpthread/linuxthreads_db/td_thr_tlsbase.c
+++ b/libpthread/linuxthreads_db/td_thr_tlsbase.c
@@ -36,9 +36,9 @@ td_thr_tlsbase (const td_thrhandle_t *th,
   LOG ("td_thr_tlsbase");
 
   psaddr_t dtvpp = th->th_unique;
-#if TLS_TCB_AT_TP
+#if defined(TLS_TCB_AT_TP)
   dtvpp += offsetof (struct _pthread_descr_struct, p_header.data.dtvp);
-#elif TLS_DTV_AT_TP
+#elif defined(TLS_DTV_AT_TP)
 /* Special case hack.  If TLS_TCB_SIZE == 0 (on PowerPC), there is no TCB
    containing the DTV at the TP, but actually the TCB lies behind the TP,
    i.e. at the very end of the area covered by TLS_PRE_TCB_SIZE.  */
-- 
1.6.3.3



More information about the uClibc-cvs mailing list