Skip to content

Commit

Permalink
* db_info.c: Don't use TLS_TP_OFFSET in the #if, but
Browse files Browse the repository at this point in the history
	TLS_TCB_SIZE == 0 ?: in the DESC macro.
  • Loading branch information
Roland McGrath committed Mar 14, 2004
1 parent 6964ccb commit 743fa97
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions linuxthreads_db/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2004-03-13 Jakub Jelinek <jakub@redhat.com>

* td_thr_tlsbase.c: Remove dl-tls.h include. Don't use
TLS_TP_OFFSET in the #if, but TLS_TCB_SIZE == 0 ?:.

2004-03-12 Roland McGrath <roland@redhat.com>

* td_thr_tlsbase.c [TLS_DTV_AT_TP && TLS_TP_OFFSET > 0]: Handle this
14 changes: 5 additions & 9 deletions linuxthreads_db/td_thr_tlsbase.c
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@
02111-1307 USA. */

#include "thread_dbP.h"
#include <dl-tls.h>

/* Value used for dtv entries for which the allocation is delayed. */
# define TLS_DTV_UNALLOCATED ((void *) -1l)
@@ -39,15 +38,12 @@ td_thr_tlsbase (const td_thrhandle_t *th,
psaddr_t dtvpp = th->th_unique;
#if TLS_TCB_AT_TP
dtvpp += offsetof (struct _pthread_descr_struct, p_header.data.dtvp);
#elif TLS_DTV_AT_TP && TLS_TP_OFFSET > 0
/* Special case hack. Really this #if should be TLS_TCB_SIZE == 0, but
when untrue it's a sizeof expression, and that wouldn't fly. In this
flavor (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. */
dtvpp += TLS_PRE_TCB_SIZE - sizeof (tcbhead_t) + offsetof (tcbhead_t, dtv);
#elif TLS_DTV_AT_TP
dtvpp += TLS_PRE_TCB_SIZE + offsetof (tcbhead_t, dtv);
/* 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. */
dtvpp += TLS_PRE_TCB_SIZE + offsetof (tcbhead_t, dtv)
- (TLS_TCB_SIZE == 0 ? sizeof (tcbhead_t) : 0);
#else
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined."
#endif
5 changes: 5 additions & 0 deletions nptl_db/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2004-03-13 Jakub Jelinek <jakub@redhat.com>

* db_info.c: Don't use TLS_TP_OFFSET in the #if, but
TLS_TCB_SIZE == 0 ?: in the DESC macro.

2004-03-12 Roland McGrath <roland@redhat.com>

* db_info.c [TLS_DTV_AT_TP && TLS_TP_OFFSET > 0]

0 comments on commit 743fa97

Please sign in to comment.