1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

* sysdeps/unix/sysv/linux/speed.c

(cfsetospeed): Only set c_ospeed under [_HAVE_STRUCT_TERMIOS_C_OSPEED].
	(cfsetispeed): Only set c_ispeed under [_HAVE_STRUCT_TERMIOS_C_ISPEED].
	* sysdeps/unix/sysv/linux/bits/termios.h
	(_HAVE_STRUCT_TERMIOS_C_ISPEED, _HAVE_STRUCT_TERMIOS_C_OSPEED): Define.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
This commit is contained in:
Roland McGrath
2003-09-09 07:01:01 +00:00
parent 416be7f049
commit 7f08f55a9f
52 changed files with 1702 additions and 1004 deletions

View File

@ -19,49 +19,32 @@
#include "thread_dbP.h"
/* Value used for dtv entries for which the allocation is delayed. */
# define TLS_DTV_UNALLOCATED ((void *) -1l)
td_err_e
td_thr_tlsbase (const td_thrhandle_t *th,
unsigned long int modid,
psaddr_t *base)
{
td_err_e err;
psaddr_t dtv, dtvptr;
if (modid < 1)
return TD_NOTLS;
#if USE_TLS
union dtv pdtv, *dtvp;
LOG ("td_thr_tlsbase");
psaddr_t dtvpp = th->th_unique;
#if TLS_TCB_AT_TP
dtvpp += offsetof (struct pthread, header.dtv);
#elif TLS_DTV_AT_TP
dtvpp += TLS_PRE_TCB_SIZE + offsetof (tcbhead_t, dtv);
#else
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined."
#endif
/* Get the DTV pointer from the thread descriptor. */
if (ps_pdread (th->th_ta_p->ph, dtvpp, &dtvp, sizeof dtvp) != PS_OK)
return TD_ERR; /* XXX Other error value? */
err = DB_GET_FIELD (dtv, th->th_ta_p, th->th_unique, pthread, dtvp, 0);
if (err != TD_OK)
return err;
/* Get the corresponding entry in the DTV. */
if (ps_pdread (th->th_ta_p->ph, dtvp + modid,
&pdtv, sizeof (union dtv)) != PS_OK)
return TD_ERR; /* XXX Other error value? */
err = DB_GET_FIELD (dtvptr, th->th_ta_p, dtv, dtv, dtv, modid);
if (err != TD_OK)
return err;
/* It could be that the memory for this module is not allocated for
the given thread. */
if (pdtv.pointer == TLS_DTV_UNALLOCATED)
if ((uintptr_t) dtvptr & 1)
return TD_TLSDEFER;
*base = (char *) pdtv.pointer;
*base = dtvptr;
return TD_OK;
#else
return TD_ERR;
#endif
}