1 |
/* System dependent pthreads code. Hurd version. |
/* System dependent pthreads code. Hurd version. |
2 |
Copyright (C) 2000,02 Free Software Foundation, Inc. |
Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. |
3 |
This file is part of the GNU C Library. |
This file is part of the GNU C Library. |
4 |
|
|
5 |
The GNU C Library is free software; you can redistribute it and/or |
The GNU C Library is free software; you can redistribute it and/or |
29 |
#include <pt-internal.h> |
#include <pt-internal.h> |
30 |
|
|
31 |
/* Forward. */ |
/* Forward. */ |
32 |
static int init_routine (void); |
static void *init_routine (void); |
33 |
|
|
34 |
/* OK, the name of this variable isn't really appropriate, but I don't |
/* OK, the name of this variable isn't really appropriate, but I don't |
35 |
want to change it yet. */ |
want to change it yet. */ |
36 |
int (*_cthread_init_routine)(void) = &init_routine; |
void *(*_cthread_init_routine)(void) = &init_routine; |
37 |
|
|
38 |
/* This function is called from the Hurd-specific startup code. It |
/* This function is called from the Hurd-specific startup code. It |
39 |
should return a new stack pointer for the main thread. The caller |
should return a new stack pointer for the main thread. The caller |
40 |
will switch to this new stack before doing anything serious. */ |
will switch to this new stack before doing anything serious. */ |
41 |
static int |
static void * |
42 |
init_routine (void) |
init_routine (void) |
43 |
{ |
{ |
44 |
struct __pthread *thread; |
struct __pthread *thread; |
68 |
= (__pthread_default_attr.stacksize |
= (__pthread_default_attr.stacksize |
69 |
- __hurd_threadvar_max * sizeof (uintptr_t)); |
- __hurd_threadvar_max * sizeof (uintptr_t)); |
70 |
|
|
71 |
return (int) thread->mcontext.sp; |
return thread->mcontext.sp; |
72 |
} |
} |