diff options
author | deischen <deischen@FreeBSD.org> | 2006-03-05 18:10:28 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2006-03-05 18:10:28 +0000 |
commit | e586a0042e10fd3b8cd186195c3363e8a99ef63c (patch) | |
tree | e6564232c43be20321cd3a1bb8dd416991b7d132 /lib | |
parent | 182ee5abd3c41001929cb318f8df6696fb4f4ac4 (diff) | |
download | FreeBSD-src-e586a0042e10fd3b8cd186195c3363e8a99ef63c.zip FreeBSD-src-e586a0042e10fd3b8cd186195c3363e8a99ef63c.tar.gz |
Add some more pthread stubs so that librt can use them.
The thread jump table has been resorted, so you need to
keep libc, libpthread, and libthr in sync.
Submitted by: xu
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/_pthread_stubs.c | 133 | ||||
-rw-r--r-- | lib/libc/include/libc_private.h | 37 | ||||
-rw-r--r-- | lib/libc/include/namespace.h | 29 | ||||
-rw-r--r-- | lib/libkse/thread/thr_init.c | 39 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_init.c | 39 | ||||
-rw-r--r-- | lib/libthr/thread/thr_init.c | 39 |
6 files changed, 273 insertions, 43 deletions
diff --git a/lib/libc/gen/_pthread_stubs.c b/lib/libc/gen/_pthread_stubs.c index 840f64a..a3e55b0 100644 --- a/lib/libc/gen/_pthread_stubs.c +++ b/lib/libc/gen/_pthread_stubs.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include <signal.h> #include <pthread.h> +#include <stdlib.h> #include "libc_private.h" @@ -52,39 +53,72 @@ static int stub_main(void); static void *stub_null(void); static struct pthread *stub_self(void); static int stub_zero(void); +static int stub_true(void); +static void stub_exit(void); #define PJT_DUAL_ENTRY(entry) \ (pthread_func_t)entry, (pthread_func_t)entry pthread_func_entry_t __thr_jtable[PJT_MAX] = { - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_BROADCAST */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_SIGNAL */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_WAIT */ - {PJT_DUAL_ENTRY(stub_null)}, /* PJT_GETSPECIFIC */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KEY_CREATE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KEY_DELETE */ - {PJT_DUAL_ENTRY(stub_main)}, /* PJT_MAIN_NP */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_LOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_TRYLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_UNLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_SETTYPE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ONCE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_RDLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_TRYRDLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_TRYWRLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_UNLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_WRLOCK */ - {PJT_DUAL_ENTRY(stub_self)}, /* PJT_SELF */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETSPECIFIC */ - {PJT_DUAL_ENTRY(stub_zero)} /* PJT_SIGMASK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATFORK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_DESTROY */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETDETACHSTATE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETGUARDSIZE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETINHERITSCHED */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSCHEDPARAM */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSCHEDPOLICY */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSCOPE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSTACKADDR */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSTACKSIZE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_INIT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETDETACHSTATE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETGUARDSIZE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETINHERITSCHED */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSCHEDPARAM */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSCHEDPOLICY */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSCOPE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSTACKADDR */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSTACKSIZE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_POP */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_PUSH */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_BROADCAST */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_DESTROY */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_INIT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_SIGNAL */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_TIMEDWAIT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_WAIT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_DETACH */ + {PJT_DUAL_ENTRY(stub_true)}, /* PJT_EQUAL */ + {PJT_DUAL_ENTRY(stub_exit)}, /* PJT_EXIT */ + {PJT_DUAL_ENTRY(stub_null)}, /* PJT_GETSPECIFIC */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_JOIN */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KEY_CREATE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KEY_DELETE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KILL */ + {PJT_DUAL_ENTRY(stub_main)}, /* PJT_MAIN_NP */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_DESTROY */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_INIT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_SETTYPE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_DESTROY */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_INIT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_LOCK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_TRYLOCK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_UNLOCK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ONCE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_DESTROY */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_INIT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_RDLOCK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_TRYRDLOCK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_TRYWRLOCK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_UNLOCK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_WRLOCK */ + {PJT_DUAL_ENTRY(stub_self)}, /* PJT_SELF */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETCANCELSTATE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETCANCELTYPE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETSPECIFIC */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SIGMASK */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_TESTCANCEL */ }; /* @@ -200,6 +234,37 @@ STUB_FUNC1(pthread_rwlock_wrlock, PJT_RWLOCK_WRLOCK, int, void *) STUB_FUNC(pthread_self, PJT_SELF, pthread_t) STUB_FUNC2(pthread_setspecific, PJT_SETSPECIFIC, int, pthread_key_t, void *) STUB_FUNC3(pthread_sigmask, PJT_SIGMASK, int, int, void *, void *) +STUB_FUNC3(pthread_atfork, PJT_ATFORK, int, void *, void *, void*) +STUB_FUNC1(pthread_attr_destroy, PJT_ATTR_DESTROY, int, void *); +STUB_FUNC2(pthread_attr_getdetachstate, PJT_ATTR_GETDETACHSTATE, int, void *, void *) +STUB_FUNC2(pthread_attr_getguardsize, PJT_ATTR_GETGUARDSIZE, int, void *, void *) +STUB_FUNC2(pthread_attr_getstackaddr, PJT_ATTR_GETSTACKADDR, int, void *, void *) +STUB_FUNC2(pthread_attr_getstacksize, PJT_ATTR_GETSTACKSIZE, int, void *, void *) +STUB_FUNC2(pthread_attr_getinheritsched, PJT_ATTR_GETINHERITSCHED, int, void *, void *) +STUB_FUNC2(pthread_attr_getschedparam, PJT_ATTR_GETSCHEDPARAM, int, void *, void *) +STUB_FUNC2(pthread_attr_getschedpolicy, PJT_ATTR_GETSCHEDPOLICY, int, void *, void *) +STUB_FUNC2(pthread_attr_getscope, PJT_ATTR_GETSCOPE, int, void *, void *) +STUB_FUNC1(pthread_attr_init, PJT_ATTR_INIT, int, void *) +STUB_FUNC2(pthread_attr_setdetachstate, PJT_ATTR_SETDETACHSTATE, int, void *, int) +STUB_FUNC2(pthread_attr_setguardsize, PJT_ATTR_SETGUARDSIZE, int, void *, size_t) +STUB_FUNC2(pthread_attr_setstackaddr, PJT_ATTR_SETSTACKADDR, int, void *, void *) +STUB_FUNC2(pthread_attr_setstacksize, PJT_ATTR_SETSTACKSIZE, int, void *, size_t) +STUB_FUNC2(pthread_attr_setinheritsched, PJT_ATTR_SETINHERITSCHED, int, void *, int) +STUB_FUNC2(pthread_attr_setschedparam, PJT_ATTR_SETSCHEDPARAM, int, void *, void *) +STUB_FUNC2(pthread_attr_setschedpolicy, PJT_ATTR_SETSCHEDPOLICY, int, void *, int) +STUB_FUNC2(pthread_attr_setscope, PJT_ATTR_SETSCOPE, int, void *, int) +STUB_FUNC1(pthread_cancel, PJT_CANCEL, int, void *) +STUB_FUNC1(pthread_cleanup_pop, PJT_CLEANUP_POP, int, int) +STUB_FUNC2(pthread_cleanup_push, PJT_CLEANUP_PUSH, void, void *, void *) +STUB_FUNC3(pthread_cond_timedwait, PJT_COND_TIMEDWAIT, int, void *, void *, void *) +STUB_FUNC1(pthread_detach, PJT_DETACH, int, void *) +STUB_FUNC2(pthread_equal, PJT_EQUAL, int, void *, void *) +STUB_FUNC1(pthread_exit, PJT_EXIT, void, void *) +STUB_FUNC2(pthread_join, PJT_JOIN, int, void *, void *) +STUB_FUNC2(pthread_kill, PJT_KILL, int, void *, int) +STUB_FUNC2(pthread_setcancelstate, PJT_SETCANCELSTATE, int, int, void *) +STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, int, int, void *) +STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void) static int stub_zero(void) @@ -224,3 +289,15 @@ stub_main(void) { return (-1); } + +static int +stub_true(void) +{ + return (1); +} + +static void +stub_exit(void) +{ + exit(0); +} diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 0959c6c..cd5769e 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -70,23 +70,51 @@ extern int __isthreaded; * libraries that reference it (libc_r, libpthread). */ typedef enum { + PJT_ATFORK, + PJT_ATTR_DESTROY, + PJT_ATTR_GETDETACHSTATE, + PJT_ATTR_GETGUARDSIZE, + PJT_ATTR_GETINHERITSCHED, + PJT_ATTR_GETSCHEDPARAM, + PJT_ATTR_GETSCHEDPOLICY, + PJT_ATTR_GETSCOPE, + PJT_ATTR_GETSTACKADDR, + PJT_ATTR_GETSTACKSIZE, + PJT_ATTR_INIT, + PJT_ATTR_SETDETACHSTATE, + PJT_ATTR_SETGUARDSIZE, + PJT_ATTR_SETINHERITSCHED, + PJT_ATTR_SETSCHEDPARAM, + PJT_ATTR_SETSCHEDPOLICY, + PJT_ATTR_SETSCOPE, + PJT_ATTR_SETSTACKADDR, + PJT_ATTR_SETSTACKSIZE, + PJT_CANCEL, + PJT_CLEANUP_POP, + PJT_CLEANUP_PUSH, PJT_COND_BROADCAST, PJT_COND_DESTROY, PJT_COND_INIT, PJT_COND_SIGNAL, + PJT_COND_TIMEDWAIT, PJT_COND_WAIT, + PJT_DETACH, + PJT_EQUAL, + PJT_EXIT, PJT_GETSPECIFIC, + PJT_JOIN, PJT_KEY_CREATE, PJT_KEY_DELETE, + PJT_KILL, PJT_MAIN_NP, + PJT_MUTEXATTR_DESTROY, + PJT_MUTEXATTR_INIT, + PJT_MUTEXATTR_SETTYPE, PJT_MUTEX_DESTROY, PJT_MUTEX_INIT, PJT_MUTEX_LOCK, PJT_MUTEX_TRYLOCK, PJT_MUTEX_UNLOCK, - PJT_MUTEXATTR_DESTROY, - PJT_MUTEXATTR_INIT, - PJT_MUTEXATTR_SETTYPE, PJT_ONCE, PJT_RWLOCK_DESTROY, PJT_RWLOCK_INIT, @@ -96,8 +124,11 @@ typedef enum { PJT_RWLOCK_UNLOCK, PJT_RWLOCK_WRLOCK, PJT_SELF, + PJT_SETCANCELSTATE, + PJT_SETCANCELTYPE, PJT_SETSPECIFIC, PJT_SIGMASK, + PJT_TESTCANCEL, PJT_MAX } pjt_index_t; diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index f369a75..c6e22cc 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -81,14 +81,40 @@ #define nanosleep _nanosleep #define open _open #define poll _poll +#define pthread_atfork _pthread_atfork +#define pthread_attr_destroy _pthread_attr_destroy +#define pthread_attr_getdetachstate _pthread_attr_getdetachstate +#define pthread_attr_getguardsize _pthread_attr_getguardsize +#define pthread_attr_getstackaddr _pthread_attr_getstackaddr +#define pthread_attr_getstacksize _pthread_attr_getstacksize +#define pthread_attr_getinheritsched _pthread_attr_getinheritsched +#define pthread_attr_getschedparam _pthread_attr_getschedparam +#define pthread_attr_getschedpolicy _pthread_attr_getschedpolicy +#define pthread_attr_getscope _pthread_attr_getscope +#define pthread_attr_init _pthread_attr_init +#define pthread_attr_setdetachstate _pthread_attr_setdetachstate +#define pthread_attr_setguardsize _pthread_attr_setguardsize +#define pthread_attr_setstackaddr _pthread_attr_setstackaddr +#define pthread_attr_setstacksize _pthread_attr_setstacksize +#define pthread_attr_setinheritsched _pthread_attr_setinheritsched +#define pthread_attr_setschedparam _pthread_attr_setschedparam +#define pthread_attr_setschedpolicy _pthread_attr_setschedpolicy +#define pthread_attr_setscope _pthread_attr_setscope +#define pthread_cancel _pthread_cancel +#define pthread_cleanup_pop _pthread_cleanup_pop +#define pthread_cleanup_push _pthread_cleanup_push #define pthread_cond_broadcast _pthread_cond_broadcast #define pthread_cond_destroy _pthread_cond_destroy #define pthread_cond_init _pthread_cond_init #define pthread_cond_signal _pthread_cond_signal #define pthread_cond_timedwait _pthread_cond_timedwait #define pthread_cond_wait _pthread_cond_wait +#define pthread_detach _pthread_detach +#define pthread_equal _pthread_equal #define pthread_exit _pthread_exit #define pthread_getspecific _pthread_getspecific +#define pthread_join _pthread_join +#define pthread_kill _pthread_kill #define pthread_key_create _pthread_key_create #define pthread_key_delete _pthread_key_delete #define pthread_main_np _pthread_main_np @@ -109,8 +135,11 @@ #define pthread_rwlock_trywrlock _pthread_rwlock_trywrlock #define pthread_rwlock_unlock _pthread_rwlock_unlock #define pthread_self _pthread_self +#define pthread_setcancelstate _pthread_setcancelstate +#define pthread_setcanceltype _pthread_setcanceltype #define pthread_setspecific _pthread_setspecific #define pthread_sigmask _pthread_sigmask +#define pthread_testcancel _pthread_testcancel #define read _read #define readv _readv #define recvfrom _recvfrom diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c index e5439ad..7945ed9 100644 --- a/lib/libkse/thread/thr_init.c +++ b/lib/libkse/thread/thr_init.c @@ -162,16 +162,47 @@ static void *libgcc_references[] = { (pthread_func_t)entry, (pthread_func_t)entry static pthread_func_t jmp_table[][2] = { + {DUAL_ENTRY(_pthread_atfork)}, /* PJT_ATFORK */ + {DUAL_ENTRY(_pthread_attr_destroy)}, /* PJT_ATTR_DESTROY */ + {DUAL_ENTRY(_pthread_attr_getdetachstate)}, /* PJT_ATTR_GETDETACHSTATE */ + {DUAL_ENTRY(_pthread_attr_getguardsize)}, /* PJT_ATTR_GETGUARDSIZE */ + {DUAL_ENTRY(_pthread_attr_getinheritsched)}, /* PJT_ATTR_GETINHERITSCHED */ + {DUAL_ENTRY(_pthread_attr_getschedparam)}, /* PJT_ATTR_GETSCHEDPARAM */ + {DUAL_ENTRY(_pthread_attr_getschedpolicy)}, /* PJT_ATTR_GETSCHEDPOLICY */ + {DUAL_ENTRY(_pthread_attr_getscope)}, /* PJT_ATTR_GETSCOPE */ + {DUAL_ENTRY(_pthread_attr_getstackaddr)}, /* PJT_ATTR_GETSTACKADDR */ + {DUAL_ENTRY(_pthread_attr_getstacksize)}, /* PJT_ATTR_GETSTACKSIZE */ + {DUAL_ENTRY(_pthread_attr_init)}, /* PJT_ATTR_INIT */ + {DUAL_ENTRY(_pthread_attr_setdetachstate)}, /* PJT_ATTR_SETDETACHSTATE */ + {DUAL_ENTRY(_pthread_attr_setguardsize)}, /* PJT_ATTR_SETGUARDSIZE */ + {DUAL_ENTRY(_pthread_attr_setinheritsched)}, /* PJT_ATTR_SETINHERITSCHED */ + {DUAL_ENTRY(_pthread_attr_setschedparam)}, /* PJT_ATTR_SETSCHEDPARAM */ + {DUAL_ENTRY(_pthread_attr_setschedpolicy)}, /* PJT_ATTR_SETSCHEDPOLICY */ + {DUAL_ENTRY(_pthread_attr_setscope)}, /* PJT_ATTR_SETSCOPE */ + {DUAL_ENTRY(_pthread_attr_setstackaddr)}, /* PJT_ATTR_SETSTACKADDR */ + {DUAL_ENTRY(_pthread_attr_setstacksize)}, /* PJT_ATTR_SETSTACKSIZE */ + {DUAL_ENTRY(_pthread_cancel)}, /* PJT_CANCEL */ + {DUAL_ENTRY(_pthread_cleanup_pop)}, /* PJT_CLEANUP_POP */ + {DUAL_ENTRY(_pthread_cleanup_push)}, /* PJT_CLEANUP_PUSH */ {DUAL_ENTRY(_pthread_cond_broadcast)}, /* PJT_COND_BROADCAST */ {DUAL_ENTRY(_pthread_cond_destroy)}, /* PJT_COND_DESTROY */ {DUAL_ENTRY(_pthread_cond_init)}, /* PJT_COND_INIT */ {DUAL_ENTRY(_pthread_cond_signal)}, /* PJT_COND_SIGNAL */ + {DUAL_ENTRY(_pthread_cond_timedwait)}, /* PJT_COND_TIMEDWAIT */ {(pthread_func_t)__pthread_cond_wait, (pthread_func_t)_pthread_cond_wait}, /* PJT_COND_WAIT */ + {DUAL_ENTRY(_pthread_detach)}, /* PJT_DETACH */ + {DUAL_ENTRY(_pthread_equal)}, /* PJT_EQUAL */ + {DUAL_ENTRY(_pthread_exit)}, /* PJT_EXIT */ {DUAL_ENTRY(_pthread_getspecific)}, /* PJT_GETSPECIFIC */ + {DUAL_ENTRY(_pthread_join)}, /* PJT_JOIN */ {DUAL_ENTRY(_pthread_key_create)}, /* PJT_KEY_CREATE */ {DUAL_ENTRY(_pthread_key_delete)}, /* PJT_KEY_DELETE*/ + {DUAL_ENTRY(_pthread_kill)}, /* PJT_KILL */ {DUAL_ENTRY(_pthread_main_np)}, /* PJT_MAIN_NP */ + {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ + {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ + {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ {DUAL_ENTRY(_pthread_mutex_destroy)}, /* PJT_MUTEX_DESTROY */ {DUAL_ENTRY(_pthread_mutex_init)}, /* PJT_MUTEX_INIT */ {(pthread_func_t)__pthread_mutex_lock, @@ -179,9 +210,6 @@ static pthread_func_t jmp_table[][2] = { {(pthread_func_t)__pthread_mutex_trylock, (pthread_func_t)_pthread_mutex_trylock},/* PJT_MUTEX_TRYLOCK */ {DUAL_ENTRY(_pthread_mutex_unlock)}, /* PJT_MUTEX_UNLOCK */ - {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ - {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ - {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ {DUAL_ENTRY(_pthread_once)}, /* PJT_ONCE */ {DUAL_ENTRY(_pthread_rwlock_destroy)}, /* PJT_RWLOCK_DESTROY */ {DUAL_ENTRY(_pthread_rwlock_init)}, /* PJT_RWLOCK_INIT */ @@ -191,8 +219,11 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(_pthread_rwlock_unlock)}, /* PJT_RWLOCK_UNLOCK */ {DUAL_ENTRY(_pthread_rwlock_wrlock)}, /* PJT_RWLOCK_WRLOCK */ {DUAL_ENTRY(_pthread_self)}, /* PJT_SELF */ + {DUAL_ENTRY(_pthread_setcancelstate)}, /* PJT_SETCANCELSTATE */ + {DUAL_ENTRY(_pthread_setcanceltype)}, /* PJT_SETCANCELTYPE */ {DUAL_ENTRY(_pthread_setspecific)}, /* PJT_SETSPECIFIC */ - {DUAL_ENTRY(_pthread_sigmask)} /* PJT_SIGMASK */ + {DUAL_ENTRY(_pthread_sigmask)}, /* PJT_SIGMASK */ + {DUAL_ENTRY(_pthread_testcancel)} /* PJT_TESTCANCEL */ }; static int init_once = 0; diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index e5439ad..7945ed9 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/thread/thr_init.c @@ -162,16 +162,47 @@ static void *libgcc_references[] = { (pthread_func_t)entry, (pthread_func_t)entry static pthread_func_t jmp_table[][2] = { + {DUAL_ENTRY(_pthread_atfork)}, /* PJT_ATFORK */ + {DUAL_ENTRY(_pthread_attr_destroy)}, /* PJT_ATTR_DESTROY */ + {DUAL_ENTRY(_pthread_attr_getdetachstate)}, /* PJT_ATTR_GETDETACHSTATE */ + {DUAL_ENTRY(_pthread_attr_getguardsize)}, /* PJT_ATTR_GETGUARDSIZE */ + {DUAL_ENTRY(_pthread_attr_getinheritsched)}, /* PJT_ATTR_GETINHERITSCHED */ + {DUAL_ENTRY(_pthread_attr_getschedparam)}, /* PJT_ATTR_GETSCHEDPARAM */ + {DUAL_ENTRY(_pthread_attr_getschedpolicy)}, /* PJT_ATTR_GETSCHEDPOLICY */ + {DUAL_ENTRY(_pthread_attr_getscope)}, /* PJT_ATTR_GETSCOPE */ + {DUAL_ENTRY(_pthread_attr_getstackaddr)}, /* PJT_ATTR_GETSTACKADDR */ + {DUAL_ENTRY(_pthread_attr_getstacksize)}, /* PJT_ATTR_GETSTACKSIZE */ + {DUAL_ENTRY(_pthread_attr_init)}, /* PJT_ATTR_INIT */ + {DUAL_ENTRY(_pthread_attr_setdetachstate)}, /* PJT_ATTR_SETDETACHSTATE */ + {DUAL_ENTRY(_pthread_attr_setguardsize)}, /* PJT_ATTR_SETGUARDSIZE */ + {DUAL_ENTRY(_pthread_attr_setinheritsched)}, /* PJT_ATTR_SETINHERITSCHED */ + {DUAL_ENTRY(_pthread_attr_setschedparam)}, /* PJT_ATTR_SETSCHEDPARAM */ + {DUAL_ENTRY(_pthread_attr_setschedpolicy)}, /* PJT_ATTR_SETSCHEDPOLICY */ + {DUAL_ENTRY(_pthread_attr_setscope)}, /* PJT_ATTR_SETSCOPE */ + {DUAL_ENTRY(_pthread_attr_setstackaddr)}, /* PJT_ATTR_SETSTACKADDR */ + {DUAL_ENTRY(_pthread_attr_setstacksize)}, /* PJT_ATTR_SETSTACKSIZE */ + {DUAL_ENTRY(_pthread_cancel)}, /* PJT_CANCEL */ + {DUAL_ENTRY(_pthread_cleanup_pop)}, /* PJT_CLEANUP_POP */ + {DUAL_ENTRY(_pthread_cleanup_push)}, /* PJT_CLEANUP_PUSH */ {DUAL_ENTRY(_pthread_cond_broadcast)}, /* PJT_COND_BROADCAST */ {DUAL_ENTRY(_pthread_cond_destroy)}, /* PJT_COND_DESTROY */ {DUAL_ENTRY(_pthread_cond_init)}, /* PJT_COND_INIT */ {DUAL_ENTRY(_pthread_cond_signal)}, /* PJT_COND_SIGNAL */ + {DUAL_ENTRY(_pthread_cond_timedwait)}, /* PJT_COND_TIMEDWAIT */ {(pthread_func_t)__pthread_cond_wait, (pthread_func_t)_pthread_cond_wait}, /* PJT_COND_WAIT */ + {DUAL_ENTRY(_pthread_detach)}, /* PJT_DETACH */ + {DUAL_ENTRY(_pthread_equal)}, /* PJT_EQUAL */ + {DUAL_ENTRY(_pthread_exit)}, /* PJT_EXIT */ {DUAL_ENTRY(_pthread_getspecific)}, /* PJT_GETSPECIFIC */ + {DUAL_ENTRY(_pthread_join)}, /* PJT_JOIN */ {DUAL_ENTRY(_pthread_key_create)}, /* PJT_KEY_CREATE */ {DUAL_ENTRY(_pthread_key_delete)}, /* PJT_KEY_DELETE*/ + {DUAL_ENTRY(_pthread_kill)}, /* PJT_KILL */ {DUAL_ENTRY(_pthread_main_np)}, /* PJT_MAIN_NP */ + {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ + {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ + {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ {DUAL_ENTRY(_pthread_mutex_destroy)}, /* PJT_MUTEX_DESTROY */ {DUAL_ENTRY(_pthread_mutex_init)}, /* PJT_MUTEX_INIT */ {(pthread_func_t)__pthread_mutex_lock, @@ -179,9 +210,6 @@ static pthread_func_t jmp_table[][2] = { {(pthread_func_t)__pthread_mutex_trylock, (pthread_func_t)_pthread_mutex_trylock},/* PJT_MUTEX_TRYLOCK */ {DUAL_ENTRY(_pthread_mutex_unlock)}, /* PJT_MUTEX_UNLOCK */ - {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ - {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ - {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ {DUAL_ENTRY(_pthread_once)}, /* PJT_ONCE */ {DUAL_ENTRY(_pthread_rwlock_destroy)}, /* PJT_RWLOCK_DESTROY */ {DUAL_ENTRY(_pthread_rwlock_init)}, /* PJT_RWLOCK_INIT */ @@ -191,8 +219,11 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(_pthread_rwlock_unlock)}, /* PJT_RWLOCK_UNLOCK */ {DUAL_ENTRY(_pthread_rwlock_wrlock)}, /* PJT_RWLOCK_WRLOCK */ {DUAL_ENTRY(_pthread_self)}, /* PJT_SELF */ + {DUAL_ENTRY(_pthread_setcancelstate)}, /* PJT_SETCANCELSTATE */ + {DUAL_ENTRY(_pthread_setcanceltype)}, /* PJT_SETCANCELTYPE */ {DUAL_ENTRY(_pthread_setspecific)}, /* PJT_SETSPECIFIC */ - {DUAL_ENTRY(_pthread_sigmask)} /* PJT_SIGMASK */ + {DUAL_ENTRY(_pthread_sigmask)}, /* PJT_SIGMASK */ + {DUAL_ENTRY(_pthread_testcancel)} /* PJT_TESTCANCEL */ }; static int init_once = 0; diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 026f73c..68610e4 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -198,16 +198,47 @@ STATIC_LIB_REQUIRE(_thread_state_running); (pthread_func_t)entry, (pthread_func_t)entry static pthread_func_t jmp_table[][2] = { + {DUAL_ENTRY(_pthread_atfork)}, /* PJT_ATFORK */ + {DUAL_ENTRY(_pthread_attr_destroy)}, /* PJT_ATTR_DESTROY */ + {DUAL_ENTRY(_pthread_attr_getdetachstate)}, /* PJT_ATTR_GETDETACHSTATE */ + {DUAL_ENTRY(_pthread_attr_getguardsize)}, /* PJT_ATTR_GETGUARDSIZE */ + {DUAL_ENTRY(_pthread_attr_getinheritsched)}, /* PJT_ATTR_GETINHERITSCHED */ + {DUAL_ENTRY(_pthread_attr_getschedparam)}, /* PJT_ATTR_GETSCHEDPARAM */ + {DUAL_ENTRY(_pthread_attr_getschedpolicy)}, /* PJT_ATTR_GETSCHEDPOLICY */ + {DUAL_ENTRY(_pthread_attr_getscope)}, /* PJT_ATTR_GETSCOPE */ + {DUAL_ENTRY(_pthread_attr_getstackaddr)}, /* PJT_ATTR_GETSTACKADDR */ + {DUAL_ENTRY(_pthread_attr_getstacksize)}, /* PJT_ATTR_GETSTACKSIZE */ + {DUAL_ENTRY(_pthread_attr_init)}, /* PJT_ATTR_INIT */ + {DUAL_ENTRY(_pthread_attr_setdetachstate)}, /* PJT_ATTR_SETDETACHSTATE */ + {DUAL_ENTRY(_pthread_attr_setguardsize)}, /* PJT_ATTR_SETGUARDSIZE */ + {DUAL_ENTRY(_pthread_attr_setinheritsched)}, /* PJT_ATTR_SETINHERITSCHED */ + {DUAL_ENTRY(_pthread_attr_setschedparam)}, /* PJT_ATTR_SETSCHEDPARAM */ + {DUAL_ENTRY(_pthread_attr_setschedpolicy)}, /* PJT_ATTR_SETSCHEDPOLICY */ + {DUAL_ENTRY(_pthread_attr_setscope)}, /* PJT_ATTR_SETSCOPE */ + {DUAL_ENTRY(_pthread_attr_setstackaddr)}, /* PJT_ATTR_SETSTACKADDR */ + {DUAL_ENTRY(_pthread_attr_setstacksize)}, /* PJT_ATTR_SETSTACKSIZE */ + {DUAL_ENTRY(_pthread_cancel)}, /* PJT_CANCEL */ + {DUAL_ENTRY(_pthread_cleanup_pop)}, /* PJT_CLEANUP_POP */ + {DUAL_ENTRY(_pthread_cleanup_push)}, /* PJT_CLEANUP_PUSH */ {DUAL_ENTRY(_pthread_cond_broadcast)}, /* PJT_COND_BROADCAST */ {DUAL_ENTRY(_pthread_cond_destroy)}, /* PJT_COND_DESTROY */ {DUAL_ENTRY(_pthread_cond_init)}, /* PJT_COND_INIT */ {DUAL_ENTRY(_pthread_cond_signal)}, /* PJT_COND_SIGNAL */ + {DUAL_ENTRY(_pthread_cond_timedwait)}, /* PJT_COND_TIMEDWAIT */ {(pthread_func_t)__pthread_cond_wait, (pthread_func_t)_pthread_cond_wait}, /* PJT_COND_WAIT */ + {DUAL_ENTRY(_pthread_detach)}, /* PJT_DETACH */ + {DUAL_ENTRY(_pthread_equal)}, /* PJT_EQUAL */ + {DUAL_ENTRY(_pthread_exit)}, /* PJT_EXIT */ {DUAL_ENTRY(_pthread_getspecific)}, /* PJT_GETSPECIFIC */ + {DUAL_ENTRY(_pthread_join)}, /* PJT_JOIN */ {DUAL_ENTRY(_pthread_key_create)}, /* PJT_KEY_CREATE */ {DUAL_ENTRY(_pthread_key_delete)}, /* PJT_KEY_DELETE*/ + {DUAL_ENTRY(_pthread_kill)}, /* PJT_KILL */ {DUAL_ENTRY(_pthread_main_np)}, /* PJT_MAIN_NP */ + {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ + {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ + {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ {DUAL_ENTRY(_pthread_mutex_destroy)}, /* PJT_MUTEX_DESTROY */ {DUAL_ENTRY(_pthread_mutex_init)}, /* PJT_MUTEX_INIT */ {(pthread_func_t)__pthread_mutex_lock, @@ -215,9 +246,6 @@ static pthread_func_t jmp_table[][2] = { {(pthread_func_t)__pthread_mutex_trylock, (pthread_func_t)_pthread_mutex_trylock},/* PJT_MUTEX_TRYLOCK */ {DUAL_ENTRY(_pthread_mutex_unlock)}, /* PJT_MUTEX_UNLOCK */ - {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ - {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ - {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ {DUAL_ENTRY(_pthread_once)}, /* PJT_ONCE */ {DUAL_ENTRY(_pthread_rwlock_destroy)}, /* PJT_RWLOCK_DESTROY */ {DUAL_ENTRY(_pthread_rwlock_init)}, /* PJT_RWLOCK_INIT */ @@ -227,8 +255,11 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(_pthread_rwlock_unlock)}, /* PJT_RWLOCK_UNLOCK */ {DUAL_ENTRY(_pthread_rwlock_wrlock)}, /* PJT_RWLOCK_WRLOCK */ {DUAL_ENTRY(_pthread_self)}, /* PJT_SELF */ + {DUAL_ENTRY(_pthread_setcancelstate)}, /* PJT_SETCANCELSTATE */ + {DUAL_ENTRY(_pthread_setcanceltype)}, /* PJT_SETCANCELTYPE */ {DUAL_ENTRY(_pthread_setspecific)}, /* PJT_SETSPECIFIC */ - {DUAL_ENTRY(_pthread_sigmask)} /* PJT_SIGMASK */ + {DUAL_ENTRY(_pthread_sigmask)}, /* PJT_SIGMASK */ + {DUAL_ENTRY(_pthread_testcancel)} /* PJT_TESTCANCEL */ }; static int init_once = 0; |