[PATCH 2/3] nptl: Fix start_thread() for _STACK_GROWS_UP

Carmelo AMOROSO carmelo.amoroso at st.com
Wed Jan 19 09:14:41 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 1/12/2011 1:06 PM, Will Newton wrote:
> This patch adds a working implementation of pthread_create for architectures
> where STACK_GROWS_UP.
> 
> Signed-off-by: Matt Fleming <matthew.fleming at imgtec.com>
> ---
> libpthread/nptl/pthread_create.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c
> index 63e5588..42ffbaf 100644
> --- a/libpthread/nptl/pthread_create.c
> +++ b/libpthread/nptl/pthread_create.c
> @@ -383,7 +383,8 @@ start_thread (void *arg)
> char *sp = CURRENT_STACK_FRAME;
> size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1;
> #else
> -# error "to do"
> + char *sp = CURRENT_STACK_FRAME;
> + size_t freesize = ((char *) pd->stackblock - sp) & ~pagesize_m1;
> #endif
> assert (freesize < pd->stackblock_size);
> if (freesize > PTHREAD_STACK_MIN)
> --
> 1.7.2.2
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 

Lookg good. On which arch have you tested it ?

carmelo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk02q4EACgkQoRq/3BrK1s/8kQCg/LEs7BWTiRZ0onAxAXzeErHn
pJoAoLPMUT0SkwMMQ265FC3RCERy+rT8
=EbFQ
-----END PGP SIGNATURE-----


More information about the uClibc mailing list