diff options
author | Christopher Faylor <me@cgf.cx> | 2001-11-30 06:19:58 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-11-30 06:19:58 +0000 |
commit | 1cf0d8510a4102506ce84dab72ca3381757bb106 (patch) | |
tree | 9624b673564ffdd0183eb37ee184d56085790083 /winsup/cygwin/winbase.h | |
parent | 8569e5542e4fa276337260b920bc17aea49d9cc4 (diff) | |
download | cygnal-1cf0d8510a4102506ce84dab72ca3381757bb106.tar.gz cygnal-1cf0d8510a4102506ce84dab72ca3381757bb106.tar.bz2 cygnal-1cf0d8510a4102506ce84dab72ca3381757bb106.zip |
* debug.cc (makethread): Eliminate unneeded function call.
* miscfuncs.cc (tls_ix): Predefine.
* perthread.h (set_reent): Eliminate.
(get_reent): Ditto.
* winbase.h (my_tlsalloc): Use global stack base pointer. Set newly allocated
location to NULL.
(my_tlssetvalue): Use global stack base pointer.
(my_tlsgetvalue): Ditto.
Diffstat (limited to 'winsup/cygwin/winbase.h')
-rw-r--r-- | winsup/cygwin/winbase.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/winsup/cygwin/winbase.h b/winsup/cygwin/winbase.h index 801badc44..d72bb0893 100644 --- a/winsup/cygwin/winbase.h +++ b/winsup/cygwin/winbase.h @@ -42,28 +42,27 @@ extern __inline__ long ilockexch (long *t, long v) #define InterlockedExchange ilockexch extern long tls_ix; +extern char * volatile *__stackbase __asm__ ("%fs:4"); extern __inline__ DWORD my_tlsalloc () { - return (DWORD) ilockincr (&tls_ix); + DWORD n = ilockdecr (&tls_ix); + __stackbase[tls_ix] = NULL; + return n; } extern __inline__ BOOL my_tlssetvalue (DWORD ix, void *val) { - char **stackbase; - __asm__ volatile ("movl %%fs:4,%0": "=g" (stackbase)); - stackbase[-ix] = (char *) val; + __stackbase[ix] = (char *) val; return 1; } extern __inline__ void * my_tlsgetvalue (DWORD ix) { - char **stackbase; - __asm__ volatile ("movl %%fs:4,%0": "=g" (stackbase)); - return stackbase[-ix]; + return __stackbase[ix]; } extern __inline__ BOOL |