From e22a221d6b7cf1c9bfdc4d7813193f5466fb6c66 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 14 Mar 2003 23:28:23 +0000 Subject: Update. 2003-03-14 Ulrich Drepper * tst-fork4.c: Use test-skeleton.c. * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined. * sysdeps/i386/tls.h: Define CALL_THREAD_FCT. --- nptl/ChangeLog | 7 +++++++ nptl/sysdeps/i386/tls.h | 14 ++++++++++++++ nptl/tst-fork4.c | 8 ++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 9d5af4e..7d15732 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,7 @@ +2003-03-14 Ulrich Drepper + + * tst-fork4.c: Use test-skeleton.c. + 2003-03-14 Roland McGrath * init.c: Fix typo "#eli" for "#else". @@ -39,6 +43,9 @@ 2003-03-14 Ulrich Drepper + * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined. + * sysdeps/i386/tls.h: Define CALL_THREAD_FCT. + * pthread_create.c (start_thread): setjmp is expected to return 0. * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile. diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h index eea5e30..8a1f547 100644 --- a/nptl/sysdeps/i386/tls.h +++ b/nptl/sysdeps/i386/tls.h @@ -352,6 +352,20 @@ union user_desc_init }}) +/* Call the user-provided thread function. */ +#define CALL_THREAD_FCT(descr) \ + ({ void *__res; \ + int __ignore1, __ignore2; \ + asm volatile ("subl $12, %%esp\n\t" \ + "pushl %%gs:%P4\n\t" \ + "call *%%gs:%P3\n\t" \ + "addl $16, %%esp" \ + : "=a" (__res), "=c" (__ignore1), "=d" (__ignore2) \ + : "i" (offsetof (struct pthread, start_routine)), \ + "i" (offsetof (struct pthread, arg))); \ + __res; }) + + #endif /* __ASSEMBLER__ */ #endif /* tls.h */ diff --git a/nptl/tst-fork4.c b/nptl/tst-fork4.c index 7f2b178..7cb0f9c 100644 --- a/nptl/tst-fork4.c +++ b/nptl/tst-fork4.c @@ -24,8 +24,9 @@ #include #include -int -main (void) + +static int +do_test (void) { pthread_t me = pthread_self (); @@ -58,3 +59,6 @@ main (void) return 1; } + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit v1.1