about summary refs log tree commit diff
path: root/nptl/sysdeps/i386
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-14 23:28:23 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-14 23:28:23 +0000
commite22a221d6b7cf1c9bfdc4d7813193f5466fb6c66 (patch)
tree32658eecbe8e88aa49eb2bd9be0ade8c031b5287 /nptl/sysdeps/i386
parent42c8f44c05148a94ba8fef62716f90b61c863287 (diff)
downloadglibc-e22a221d6b7cf1c9bfdc4d7813193f5466fb6c66.tar.gz
glibc-e22a221d6b7cf1c9bfdc4d7813193f5466fb6c66.tar.xz
glibc-e22a221d6b7cf1c9bfdc4d7813193f5466fb6c66.zip
Update.
2003-03-14  Ulrich Drepper  <drepper@redhat.com>

	* 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.
Diffstat (limited to 'nptl/sysdeps/i386')
-rw-r--r--nptl/sysdeps/i386/tls.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
index eea5e3010d..8a1f547b83 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 */