summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-20 20:35:45 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-20 20:35:45 +0200
commit959f7365fccd1c89be9938c2655eba9122171e6a (patch)
treee6bfd2033e25a1ff84c4ed38dc6e2f3084ff3c71 /sysdeps
parente0e1f05656e0b443bcb4a5c61550925acba78cb6 (diff)
Drop threadvars entirely
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/pt-attr-setstacksize.c19
-rw-r--r--sysdeps/mach/hurd/i386/pt-setup.c11
-rw-r--r--sysdeps/mach/hurd/pt-attr-setstackaddr.c6
-rw-r--r--sysdeps/mach/hurd/pt-attr-setstacksize.c6
-rw-r--r--sysdeps/mach/hurd/pt-sigstate-init.c11
-rw-r--r--sysdeps/mach/hurd/pt-sysdep.c8
-rw-r--r--sysdeps/mach/hurd/pt-sysdep.h2
-rw-r--r--sysdeps/mach/pt-stack-alloc.c5
8 files changed, 9 insertions, 59 deletions
diff --git a/sysdeps/generic/pt-attr-setstacksize.c b/sysdeps/generic/pt-attr-setstacksize.c
index d0e5102..c88f917 100644
--- a/sysdeps/generic/pt-attr-setstacksize.c
+++ b/sysdeps/generic/pt-attr-setstacksize.c
@@ -24,18 +24,13 @@ int
pthread_attr_setstacksize (pthread_attr_t *attr,
size_t stacksize)
{
- if (stacksize == __pthread_default_attr.stacksize)
- {
- attr->stacksize = stacksize;
+ attr->stacksize = stacksize;
- /* The guard size cannot be larger than the stack itself, as
- such, if the new stack size is smaller than the guard size,
- we squash the guard size. */
- if (attr->guardsize > attr->stacksize)
- attr->guardsize = attr->stacksize;
+ /* The guard size cannot be larger than the stack itself, as
+ such, if the new stack size is smaller than the guard size,
+ we squash the guard size. */
+ if (attr->guardsize > attr->stacksize)
+ attr->guardsize = attr->stacksize;
- return 0;
- }
-
- return ENOTSUP;
+ return 0;
}
diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/i386/pt-setup.c
index 73fd43d..548858b 100644
--- a/sysdeps/mach/hurd/i386/pt-setup.c
+++ b/sysdeps/mach/hurd/i386/pt-setup.c
@@ -32,13 +32,7 @@
-----------------
| 0 |
-----------------
- | |
- | Fast TSD |
- | |
- -----------------
-
- We need to reserve __hurd_threadvar_max `unsigned long int's' of
- (fast) thread-specific data (TSD) for the Hurd. */
+ */
/* Set up the stack for THREAD, such that it appears as if
START_ROUTINE and ARG were passed to the new thread's entry-point.
@@ -54,9 +48,6 @@ stack_setup (struct __pthread *thread,
bottom = thread->stackaddr;
top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize);
- /* Next, make room for the TSDs. */
- top -= __hurd_threadvar_max;
-
if (start_routine)
{
/* And then the call frame. */
diff --git a/sysdeps/mach/hurd/pt-attr-setstackaddr.c b/sysdeps/mach/hurd/pt-attr-setstackaddr.c
index 1225ed5..a0fe536 100644
--- a/sysdeps/mach/hurd/pt-attr-setstackaddr.c
+++ b/sysdeps/mach/hurd/pt-attr-setstackaddr.c
@@ -20,16 +20,10 @@
#include <pthread.h>
#include <pt-internal.h>
-/* We use fixed sized stacks which require proper alignment. */
-#define __pthread_stacksize __pthread_default_attr.stacksize
-
int
pthread_attr_setstackaddr (pthread_attr_t *attr,
void *stackaddr)
{
- if ((long) stackaddr & (__pthread_stacksize - 1))
- return EINVAL;
-
attr->stackaddr = stackaddr;
return 0;
}
diff --git a/sysdeps/mach/hurd/pt-attr-setstacksize.c b/sysdeps/mach/hurd/pt-attr-setstacksize.c
index 6471c0a..8b90bbd 100644
--- a/sysdeps/mach/hurd/pt-attr-setstacksize.c
+++ b/sysdeps/mach/hurd/pt-attr-setstacksize.c
@@ -20,16 +20,10 @@
#include <pthread.h>
#include <pt-internal.h>
-/* We use fixed sized stacks which require proper alignment. */
-#define __pthread_stacksize __pthread_default_attr.stacksize
-
int
pthread_attr_setstacksize (pthread_attr_t *attr,
size_t stacksize)
{
- if (stacksize != __pthread_stacksize)
- return EINVAL;
-
attr->stacksize = stacksize;
return 0;
}
diff --git a/sysdeps/mach/hurd/pt-sigstate-init.c b/sysdeps/mach/hurd/pt-sigstate-init.c
index da5a945..dd56d90 100644
--- a/sysdeps/mach/hurd/pt-sigstate-init.c
+++ b/sysdeps/mach/hurd/pt-sigstate-init.c
@@ -18,20 +18,11 @@
Boston, MA 02111-1307, USA. */
#include <pthread.h>
-#include <hurd/threadvar.h>
-
#include <pt-internal.h>
error_t
__pthread_sigstate_init (struct __pthread *thread)
{
- void **location =
- (void *) __hurd_threadvar_location_from_sp (_HURD_THREADVAR_SIGSTATE,
- thread->stackaddr);
-
- /* The real initialization happens internally in glibc the first
- time that _hurd_thead_sigstate is called. */
- *location = 0;
-
+ /* Nothing to do. */
return 0;
}
diff --git a/sysdeps/mach/hurd/pt-sysdep.c b/sysdeps/mach/hurd/pt-sysdep.c
index 882af69..09f0dcb 100644
--- a/sysdeps/mach/hurd/pt-sysdep.c
+++ b/sysdeps/mach/hurd/pt-sysdep.c
@@ -24,8 +24,6 @@
#include <mach.h>
#include <mach/mig_support.h>
-#include <hurd/threadvar.h>
-
#include <pt-internal.h>
__thread struct __pthread *___pthread_self;
@@ -77,11 +75,5 @@ init_routine (void)
/* Make MiG code thread aware. */
__mig_init (thread->stackaddr);
- /* Make sure we can find the per-thread variables. */
- __hurd_threadvar_stack_mask = ~(__pthread_default_attr.stacksize - 1);
- __hurd_threadvar_stack_offset
- = (__pthread_default_attr.stacksize
- - __hurd_threadvar_max * sizeof (uintptr_t));
-
return thread->mcontext.sp;
}
diff --git a/sysdeps/mach/hurd/pt-sysdep.h b/sysdeps/mach/hurd/pt-sysdep.h
index bec1b40..89592f9 100644
--- a/sysdeps/mach/hurd/pt-sysdep.h
+++ b/sysdeps/mach/hurd/pt-sysdep.h
@@ -22,8 +22,6 @@
#include <mach.h>
-#include <hurd/threadvar.h>
-
/* XXX */
#define _POSIX_THREAD_THREADS_MAX 64
diff --git a/sysdeps/mach/pt-stack-alloc.c b/sysdeps/mach/pt-stack-alloc.c
index f545ef3..121c189 100644
--- a/sysdeps/mach/pt-stack-alloc.c
+++ b/sysdeps/mach/pt-stack-alloc.c
@@ -24,8 +24,6 @@
#include <pt-internal.h>
-#define __pthread_stacksize __pthread_default_attr.stacksize
-
/* The next address to use for stack allocation. */
static vm_address_t next_stack_base = VM_MIN_ADDRESS;
@@ -41,9 +39,6 @@ __pthread_stack_alloc (void **stackaddr, size_t stacksize)
vm_offset_t base;
int i = 0;
- if (stacksize != __pthread_stacksize)
- return EINVAL;
-
get_stack:
i ++;
for (base = next_stack_base;