summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/i386/pt-setup.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-08-31 00:06:31 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-08-31 00:06:31 +0200
commitfa9eb2c255e1d46beadcd81edd459b9c3d7dcb8c (patch)
treebf387b58773a9382b2b576d7c9317e2d1d1b966b /sysdeps/mach/hurd/i386/pt-setup.c
parentb1a5dd9b39835776796cdee3bd8f08adf6c9e46d (diff)
parentdd127d39712eaefc173bd41b18af1e35888e9589 (diff)
Merge commit 'refs/top-bases/tschwinge/Peter_Herbolzheimer' into tschwinge/Peter_Herbolzheimertschwinge/Peter_Herbolzheimer
Diffstat (limited to 'sysdeps/mach/hurd/i386/pt-setup.c')
-rw-r--r--sysdeps/mach/hurd/i386/pt-setup.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/i386/pt-setup.c
index 73fd43d..5420dc8 100644
--- a/sysdeps/mach/hurd/i386/pt-setup.c
+++ b/sysdeps/mach/hurd/i386/pt-setup.c
@@ -57,14 +57,16 @@ stack_setup (struct __pthread *thread,
/* Next, make room for the TSDs. */
top -= __hurd_threadvar_max;
+ /* Save the self pointer. */
+ top[_HURD_THREADVAR_THREAD] = (uintptr_t) thread;
+
if (start_routine)
{
/* And then the call frame. */
- top -= 3;
+ top -= 2;
top = (uintptr_t *) ((uintptr_t) top & ~0xf);
- top[2] = (uintptr_t) arg; /* Argument to START_ROUTINE. */
- top[1] = (uintptr_t) start_routine;
- top[0] = (uintptr_t) thread;
+ top[1] = (uintptr_t) arg; /* Argument to START_ROUTINE. */
+ top[0] = (uintptr_t) start_routine;
*--top = 0; /* Fake return address. */
}
@@ -80,7 +82,7 @@ stack_setup (struct __pthread *thread,
int
__pthread_setup (struct __pthread *thread,
- void (*entry_point)(struct __pthread *, void *(*)(void *), void *),
+ void (*entry_point)(void *(*)(void *), void *),
void *(*start_routine)(void *), void *arg)
{
error_t err;