summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl_db/td_thr_tlsbase.c
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2007-11-19 15:35:12 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2007-11-19 15:35:12 +0000
commit414d8e5f2a73aff8e9404684571a65f85b27bf89 (patch)
tree879ac217d477f76cf965b244d98b383b663ff47b /libpthread/nptl_db/td_thr_tlsbase.c
parent381fb7688d356f03e35b9254796adb29c941532b (diff)
downloaduClibc-alpine-414d8e5f2a73aff8e9404684571a65f85b27bf89.tar.bz2
uClibc-alpine-414d8e5f2a73aff8e9404684571a65f85b27bf89.tar.xz
Synch nptl branch with SH port: as requested by sjhill for mips-ash4 merge
Diffstat (limited to 'libpthread/nptl_db/td_thr_tlsbase.c')
-rw-r--r--libpthread/nptl_db/td_thr_tlsbase.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libpthread/nptl_db/td_thr_tlsbase.c b/libpthread/nptl_db/td_thr_tlsbase.c
index c57009a73..aaeda6f3c 100644
--- a/libpthread/nptl_db/td_thr_tlsbase.c
+++ b/libpthread/nptl_db/td_thr_tlsbase.c
@@ -1,5 +1,5 @@
/* Locate TLS data for a thread.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@ td_thr_tlsbase (const td_thrhandle_t *th,
psaddr_t *base)
{
td_err_e err;
- psaddr_t dtv, dtvptr;
+ psaddr_t dtv, dtvslot, dtvptr;
if (modid < 1)
return TD_NOTLS;
@@ -35,8 +35,13 @@ td_thr_tlsbase (const td_thrhandle_t *th,
if (err != TD_OK)
return err;
- /* Get the corresponding entry in the DTV. */
- err = DB_GET_FIELD (dtvptr, th->th_ta_p, dtv, dtv, dtv, modid);
+ /* Find the corresponding entry in the DTV. */
+ err = DB_GET_FIELD_ADDRESS (dtvslot, th->th_ta_p, dtv, dtv, dtv, modid);
+ if (err != TD_OK)
+ return err;
+
+ /* Extract the TLS block address from that DTV slot. */
+ err = DB_GET_FIELD (dtvptr, th->th_ta_p, dtvslot, dtv_t, pointer_val, 0);
if (err != TD_OK)
return err;