diff --git a/include/sys/syscall.h b/include/sys/syscall.h index 77d1c7c6d3b..81d17e027cb 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -396,32 +396,29 @@ /* The following are defined if pthreads are enabled */ #ifndef CONFIG_DISABLE_PTHREAD -# define SYS_pthread_barrier_destroy (__SYS_pthread+0) -# define SYS_pthread_barrier_init (__SYS_pthread+1) -# define SYS_pthread_barrier_wait (__SYS_pthread+2) -# define SYS_pthread_cancel (__SYS_pthread+3) -# define SYS_pthread_cond_broadcast (__SYS_pthread+4) -# define SYS_pthread_cond_signal (__SYS_pthread+5) -# define SYS_pthread_cond_wait (__SYS_pthread+6) -# define SYS_pthread_create (__SYS_pthread+7) -# define SYS_pthread_detach (__SYS_pthread+8) -# define SYS_pthread_exit (__SYS_pthread+9) -# define SYS_pthread_getschedparam (__SYS_pthread+10) -# define SYS_pthread_getspecific (__SYS_pthread+11) -# define SYS_pthread_join (__SYS_pthread+12) -# define SYS_pthread_key_create (__SYS_pthread+13) -# define SYS_pthread_key_delete (__SYS_pthread+14) -# define SYS_pthread_mutex_destroy (__SYS_pthread+15) -# define SYS_pthread_mutex_init (__SYS_pthread+16) -# define SYS_pthread_mutex_lock (__SYS_pthread+17) -# define SYS_pthread_mutex_trylock (__SYS_pthread+18) -# define SYS_pthread_mutex_unlock (__SYS_pthread+19) +# define SYS_pthread_cancel (__SYS_pthread+0) +# define SYS_pthread_cond_broadcast (__SYS_pthread+1) +# define SYS_pthread_cond_signal (__SYS_pthread+2) +# define SYS_pthread_cond_wait (__SYS_pthread+3) +# define SYS_pthread_create (__SYS_pthread+4) +# define SYS_pthread_detach (__SYS_pthread+5) +# define SYS_pthread_exit (__SYS_pthread+6) +# define SYS_pthread_getschedparam (__SYS_pthread+7) +# define SYS_pthread_getspecific (__SYS_pthread+8) +# define SYS_pthread_join (__SYS_pthread+9) +# define SYS_pthread_key_create (__SYS_pthread+10) +# define SYS_pthread_key_delete (__SYS_pthread+11) +# define SYS_pthread_mutex_destroy (__SYS_pthread+12) +# define SYS_pthread_mutex_init (__SYS_pthread+13) +# define SYS_pthread_mutex_lock (__SYS_pthread+14) +# define SYS_pthread_mutex_trylock (__SYS_pthread+15) +# define SYS_pthread_mutex_unlock (__SYS_pthread+16) #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE -# define SYS_pthread_mutex_consistent (__SYS_pthread+20) -# define __SYS_pthread_setschedparam (__SYS_pthread+21) +# define SYS_pthread_mutex_consistent (__SYS_pthread+17) +# define __SYS_pthread_setschedparam (__SYS_pthread+18) #else -# define __SYS_pthread_setschedparam (__SYS_pthread+20) +# define __SYS_pthread_setschedparam (__SYS_pthread+17) #endif # define SYS_pthread_setschedparam (__SYS_pthread_setschedparam+0) diff --git a/libc/libc.csv b/libc/libc.csv index a97d54b70f9..d4a86fe5bf2 100644 --- a/libc/libc.csv +++ b/libc/libc.csv @@ -109,6 +109,9 @@ "pthread_barrierattr_getpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR const pthread_barrierattr_t *","FAR int *" "pthread_barrierattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrierattr_t *" "pthread_barrierattr_setpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrierattr_t *","int" +"pthread_barrier_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" +"pthread_barrier_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*","FAR const pthread_barrierattr_t*","unsigned int" +"pthread_barrier_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" "pthread_condattr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *" "pthread_condattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *" "pthread_cond_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" diff --git a/libc/pthread/Make.defs b/libc/pthread/Make.defs index 5e08cbefa8a..04ca83dc6ab 100644 --- a/libc/pthread/Make.defs +++ b/libc/pthread/Make.defs @@ -44,6 +44,7 @@ CSRCS += pthread_attr_setstacksize.c pthread_attr_getstacksize.c CSRCS += pthread_attr_setschedparam.c pthread_attr_getschedparam.c CSRCS += pthread_barrierattr_init.c pthread_barrierattr_destroy.c CSRCS += pthread_barrierattr_getpshared.c pthread_barrierattr_setpshared.c +CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c CSRCS += pthread_condattr_init.c pthread_condattr_destroy.c CSRCS += pthread_condinit.c pthread_conddestroy.c CSRCS += pthread_mutexattr_init.c pthread_mutexattr_destroy.c diff --git a/sched/pthread/pthread_barrierdestroy.c b/libc/pthread/pthread_barrierdestroy.c similarity index 96% rename from sched/pthread/pthread_barrierdestroy.c rename to libc/pthread/pthread_barrierdestroy.c index 6bf0270b13f..3f74e06c492 100644 --- a/sched/pthread/pthread_barrierdestroy.c +++ b/libc/pthread/pthread_barrierdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_barriedestroy.c + * libc/pthread/pthread_barriedestroy.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -87,5 +87,6 @@ int pthread_barrier_destroy(FAR pthread_barrier_t *barrier) sem_destroy(&barrier->sem); barrier->count = 0; } + return ret; } diff --git a/sched/pthread/pthread_barrierinit.c b/libc/pthread/pthread_barrierinit.c similarity index 97% rename from sched/pthread/pthread_barrierinit.c rename to libc/pthread/pthread_barrierinit.c index 5051601417f..6f8d427dfe2 100644 --- a/sched/pthread/pthread_barrierinit.c +++ b/libc/pthread/pthread_barrierinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_barrieinit.c + * libc/pthread/pthread_barrieinit.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread/pthread_barrierwait.c b/libc/pthread/pthread_barrierwait.c similarity index 98% rename from sched/pthread/pthread_barrierwait.c rename to libc/pthread/pthread_barrierwait.c index cf2f959c4e5..8ba29d1d94d 100644 --- a/sched/pthread/pthread_barrierwait.c +++ b/libc/pthread/pthread_barrierwait.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_barrierwait.c + * libc/pthread/pthread_barrierwait.c * - * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread/Make.defs b/sched/pthread/Make.defs index b450af29003..ebb512963dd 100644 --- a/sched/pthread/Make.defs +++ b/sched/pthread/Make.defs @@ -40,7 +40,6 @@ CSRCS += pthread_getschedparam.c pthread_setschedparam.c CSRCS += pthread_mutexinit.c pthread_mutexdestroy.c CSRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c CSRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c -CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c CSRCS += pthread_cancel.c CSRCS += pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c CSRCS += pthread_keydelete.c diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 7624b5129f2..bfb950a8ebc 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -65,9 +65,6 @@ "pwrite","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR const void*","size_t","off_t" "posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []" "posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *" -"pthread_barrier_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" -"pthread_barrier_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*","FAR const pthread_barrierattr_t*","unsigned int" -"pthread_barrier_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" "pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t" "pthread_cleanup_pop","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","int" "pthread_cleanup_push","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","pthread_cleanup_t","FAR void*" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 7c9b8709811..66a3153aa8c 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -281,9 +281,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) /* The following are defined if pthreads are enabled */ #ifndef CONFIG_DISABLE_PTHREAD - SYSCALL_LOOKUP(pthread_barrier_destroy, 1, STUB_pthread_barrier_destroy) - SYSCALL_LOOKUP(pthread_barrier_init, 3, STUB_pthread_barrier_init) - SYSCALL_LOOKUP(pthread_barrier_wait, 1, STUB_pthread_barrier_wait) SYSCALL_LOOKUP(pthread_cancel, 1, STUB_pthread_cancel) SYSCALL_LOOKUP(pthread_cond_broadcast, 1, STUB_pthread_cond_broadcast) SYSCALL_LOOKUP(pthread_cond_signal, 1, STUB_pthread_cond_signal) diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c index cdc2ef7c360..289244e7a84 100644 --- a/syscall/syscall_stublookup.c +++ b/syscall/syscall_stublookup.c @@ -275,10 +275,6 @@ uintptr_t STUB_shmdt(int nbr, uintptr_t parm1); /* The following are defined if pthreads are enabled */ -uintptr_t STUB_pthread_barrier_destroy(int nbr, uintptr_t parm1); -uintptr_t STUB_pthread_barrier_init(int nbr, uintptr_t parm1, - uintptr_t parm2, uintptr_t parm3); -uintptr_t STUB_pthread_barrier_wait(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cancel(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cond_broadcast(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cond_signal(int nbr, uintptr_t parm1);