summaryrefslogtreecommitdiff
path: root/hurd/hurdsig.c
AgeCommit message (Collapse)Author
2019-02-21Merge branch 't/hurdsig-fixes-2' into refs/top-bases/t/libpthread_sigsSamuel Thibault
2019-02-21Merge branch 't/hurdsig-boot-fix' into refs/top-bases/t/libpthread_sigsSamuel Thibault
2018-12-27Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Samuel Thibault
2018-12-27Merge commit 'refs/top-bases/t/hurdsig-boot-fix' into t/hurdsig-boot-fixSamuel Thibault
2018-12-27Merge commit 'refs/top-bases/t/hurdsig-SA_SIGINFO' into t/hurdsig-SA_SIGINFOSamuel Thibault
2018-12-27Merge commit 'refs/top-bases/t/hurdsig-global-dispositions' into ↵Samuel Thibault
t/hurdsig-global-dispositions
2018-12-27Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixesSamuel Thibault
2018-08-01hurd: Fix exec usage of mach_setup_threadSamuel Thibault
Exec needs that mach_setup_thread does *not* set up TLS since it works on another task, so we have to split this into mach_setup_tls. * mach/mach.h (__mach_setup_tls, mach_setup_tls): Add prototypes. * mach/setup-thread.c (__mach_setup_thread): Move TLS setup to... (__mach_setup_tls): ... new function. (mach_setup_tls): New alias. * hurd/hurdsig.c (_hurdsig_init): Call __mach_setup_tls after __mach_setup_thread. * sysdeps/mach/hurd/profil.c (update_waiter): Likewise. * sysdeps/mach/hurd/setitimer.c (setitimer_locked): Likewise. * mach/Versions [libc] (mach_setup_tls): Add symbol. * sysdeps/mach/hurd/i386/libc.abilist (mach_setup_tls): Likewise.
2018-04-04hurd: Silence warningSamuel Thibault
* hurd/hurdsig.c (interrupted_reply_port_location): Use DIAG_IGNORE_NEEDS_COMMENT to silence warning with GCC 6 and before.
2018-04-02hurd: Avoid some libc.so PLTsSamuel Thibault
* hurd/catch-signal.c (hurd_catch_signal): Rename to __hurd_catch_signal. (hurd_catch_signal): New strong alias. (hurd_safe_memset, hurd_safe_copyout, hurd_safe_copyin): Call __hurd_catch_signal instead of hurd_catch_signal. * hurd/exc2signal.c (_hurd_exception2signal): Add hidden def. * hurd/hurdexec.c (_hurd_init): Add hidden def. * hurd/hurdinit.c (_hurd_init): Add hidden def. * hurd/hurdsig.c: Include <mach/mig_support.h>. (_hurd_thread_sigstate): Add hidden def. (_hurd_internal_post_signal): Use __mutex_unlock instead of mutex_unlock. * hurd/intern-fd.c (_hurd_intern_fd): Add hidden def. * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Add hidden def. * hurd/path-lookup.c (hurd_file_name_path_lookup): Rename to __hurd_file_name_path_lookup. (hurd_file_name_path_lookup): New strong alias. (file_name_path_lookup): Call __hurd_file_name_path_lookup instead of hurd_file_name_path_lookup. * mach/errstring.c (mach_error_type): Add hidden def. * mach/msg-destroy.c (__mach_msg_destroy): Add hidden def. * mach/mutex-init.c (__mutex_init): Add hidden def. * mach/spin-lock.c (__spin_lock_locked, __spin_lock, __spin_unlock, __spin_try_lock, __mutex_lock, __mutex_trylock): Add hidden defs. * mach/spin-solid.c (__spin_lock_solid): Add hidden def. * sysdeps/mach/hurd/getcwd.c (_hurd_canonicalize_directory_name_internal): Rename to __hurd_canonicalize_directory_name_internal. (_hurd_canonicalize_directory_name_internal): New strong alias. (__canonicalize_directory_name_internal, __getcwd): Call __hurd_canonicalize_directory_name_internal instead of _hurd_canonicalize_directory_name_internal. * sysdeps/mach/hurd/mig-reply.c: Include <mach/mig_support.h>. (__mig_get_reply_port, __mig_dealloc_reply_port, __mig_init): Add hidden defs. * sysdeps/hurd/include/hurd.h: New file. * sysdeps/hurd/include/hurd/fd.h: New file. * sysdeps/hurd/include/hurd/signal.h: New file. * sysdeps/mach/include/lock-intern.h: New file. * sysdeps/mach/include/mach.h: New file. * sysdeps/mach/include/mach/mig_support.h: New file. * sysdeps/mach/include/mach_error.h: New file.
2018-03-19hurd: Fix build with latest htlSamuel Thibault
* hurd/hurdsig.c: Include <pthreadP.h> instead of <pthread.h>.
2018-03-18hurd: Reimplement libc locks using mach's gsyncAgustina Arzille
* hurd/Makefile (routines): Add hurdlock. * hurd/Versions (GLIBC_PRIVATE): Added new entry to export the above interface. (HURD_CTHREADS_0.3): Remove __libc_getspecific. * hurd/hurdpid.c: Include <lowlevellock.h> (_S_msg_proc_newids): Use lll_wait to synchronize. * hurd/hurdsig.c: (reauth_proc): Use __mutex_lock and __mutex_unlock. * hurd/setauth.c: Include <hurdlock.h>, use integer for synchronization. * mach/Makefile (lock-headers): Remove machine-lock.h. * mach/lock-intern.h: Include <lowlevellock.h> instead of <machine-lock.h>. (__spin_lock_t): New type. (__SPIN_LOCK_INITIALIZER): New macro. (__spin_lock, __spin_unlock, __spin_try_lock, __spin_lock_locked, __mutex_init, __mutex_lock_solid, __mutex_unlock_solid, __mutex_lock, __mutex_unlock, __mutex_trylock): Use lll to implement locks. * mach/mutex-init.c: Include <lowlevellock.h> instead of <cthreads.h>. (__mutex_init): Initialize with lll. * manual/errno.texi (EOWNERDEAD, ENOTRECOVERABLE): New errno values. * sysdeps/mach/Makefile: Add libmachuser as dependencies for libs needing lll. * sysdeps/mach/hurd/bits/errno.h: Regenerate. * sysdeps/mach/hurd/cthreads.c (__libc_getspecific): Remove function. * sysdeps/mach/hurd/bits/libc-lock.h: Remove file. * sysdeps/mach/hurd/setpgid.c: Include <lowlevellock.h>. (__setpgid): Use lll for synchronization. * sysdeps/mach/hurd/setsid.c: Likewise with __setsid. * sysdeps/mach/bits/libc-lock.h: Include <tls.h> and <lowlevellock.h> instead of <cthreads.h>. (_IO_lock_inexpensive): New macro (__libc_lock_recursive_t, __rtld_lock_recursive_t): New structures. (__libc_lock_self0): New declaration. (__libc_lock_owner_self): New macro. (__libc_key_t): Remove type. (_LIBC_LOCK_INITIALIZER): New macro. (__libc_lock_define_initialized, __libc_lock_init, __libc_lock_fini, __libc_lock_fini_recursive, __rtld_lock_fini_recursive, __libc_lock_lock, __libc_lock_trylock, __libc_lock_unlock, __libc_lock_define_initialized_recursive, __rtld_lock_define_initialized_recursive, __libc_lock_init_recursive, __libc_lock_trylock_recursive, __libc_lock_lock_recursive, __libc_lock_unlock_recursive, __rtld_lock_initialize, __rtld_lock_trylock_recursive, __rtld_lock_lock_recursive, __rtld_lock_unlock_recursive __libc_once_define, __libc_mutex_unlock): Reimplement with lll. (__libc_lock_define_recursive, __rtld_lock_define_recursive, _LIBC_LOCK_RECURSIVE_INITIALIZER, _RTLD_LOCK_RECURSIVE_INITIALIZER): New macros. Include <libc-lockP.h> to reimplement libc_key* with pthread_key*. * hurd/hurdlock.c: New file. * hurd/hurdlock.h: New file. * mach/lowlevellock.h: New file
2018-03-17hurd: Fix link cthread/pthread symbol exposition.Samuel Thibault
* hurd/Versions (HURD_CTHREADS_0.3): Rename weak refs cthread_fork, cthread_detach, pthread_getattr_np, pthread_attr_getstack, cthread_keycreate, cthread_getspecific, cthread_setspecific to __cthread_fork, __cthread_detach, __pthread_getattr_np, __pthread_attr_getstack, __cthread_keycreate, __cthread_getspecific, __cthread_setspecific. * hurd/hurdsig.c (_hurdsig_init): Use __cthread_fork, __cthread_detach, __pthread_getattr_np, __pthread_attr_getstack, __cthread_t instead of cthread_fork, cthread_detach, pthread_getattr_np, pthread_attr_getstack. * sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Rename to __cthread_keycreate. (cthread_getspecific): Rename to __cthread_getspecific. (cthread_setspecific): Rename to __cthread_setspecific. (__libc_getspecific): Use __cthread_getspecific instead of cthread_getspecific. * sysdeps/mach/hurd/libc-lock.h (__libc_key_create): Use __cthread_keycreate instead of cthread_keycreate. (__libc_setspecific): Use __cthread_setspecific instead of cthread_setspecific. * sysdeps/mach/libc-lock.h (__libc_key_create, __libc_setspecific): Likewise.
2018-03-17hurd: Replace threadvars with TLSSamuel Thibault
This gets rid of a lot of kludge and gets closer to other ports. * hurd/Makefile (headers): Remove threadvar.h. (inline-headers): Remove threadvar.h. * hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base, __hurd_sigthread_stack_end, __hurd_sigthread_variables, __hurd_threadvar_max, __hurd_errno_location. (HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack. * hurd/hurd/signal.h: Do not include <hurd/threadvar.h>. (_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate. (_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate, unless TLS is not initialized yet, in which case we do not need a critical section yet anyway. * hurd/hurd/threadvar.h: Include <tls.h>, do not include <machine-sp.h>. (__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables declarations. (__hurd_threadvar_index): Remove enum. (_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro. (__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove inlines. (__hurd_reply_port0): New variable declaration. (__hurd_local_reply_port): New macro. * hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable. (interrupted_reply_port_location): Add thread_t parameter. Use it with THREAD_TCB to access thread-local variables. (_hurdsig_abort_rpcs): Pass ss->thread to interrupted_reply_port_location. (_hurd_internal_post_signal): Likewise. (_hurdsig_init): Use presence of cthread_fork instead of __hurd_threadvar_stack_mask to start signal thread by hand. Remove signal thread threadvar initialization. * hurd/hurdstartup.c: Do not include <hurd/threadvar.h> * hurd/sigunwind.c: Include <hurd/threadvar.h> (_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead of threadvar. * sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add __libc_lock_self0. (ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base, __hurd_sigthread_stack_end, __hurd_sigthread_variables. (ld.GLIBC_PRIVATE): Add __libc_lock_self0. * sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0. * sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base, __hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars, __hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not define variables. * sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and <hurd/threadvar.h>. [IS_IN(rtld)] (rtld_errno): New variable. [IS_IN(rtld)] (__errno_location): New weak function. [!IS_IN(rtld)]: Include "../../../csu/errno-loc.c". * sysdeps/mach/hurd/errno.c: Remove file. * sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h> (__fork): Remove THREADVAR_SPACE macro and its use. * sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove variable. (init): Do not initialize threadvar. * sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove symbol. * sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use __hurd_local_reply_port instead of threadvar. * sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and _hurd_sigstate fields. (HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro. * sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment. * sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>. (__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF instead of threadvar. * sysdeps/mach/hurd/libc-tsd.h: Remove file. * sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros. (use_threadvar, global_reply_port): Remove variables. (__hurd_reply_port0): New variable. (__mig_get_reply_port): Use __hurd_local_reply_port and __hurd_reply_port0 instead of threadvar. (__mig_dealloc_reply_port): Likewise. (__mig_init): Do not initialize threadvar. * sysdeps/mach/hurd/profil.c: Fix comment.
2018-03-17hurd: Fix getting signal thread stack layout for forkSamuel Thibault
* hurd/hurdsig.c: Include <pthread.h>. (_hurdsig_init): Call pthread_getattr_np and pthread_attr_getstack to get the signal thread stack layout.
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2017-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
2016-10-09Merge commit 'refs/top-bases/t/hurdsig-boot-fix' into t/hurdsig-boot-fixSamuel Thibault
2016-10-09Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Samuel Thibault
2016-10-09Merge commit 'refs/top-bases/t/hurdsig-SA_SIGINFO' into t/hurdsig-SA_SIGINFOSamuel Thibault
2016-10-09Merge commit 'refs/top-bases/t/hurdsig-global-dispositions' into ↵Samuel Thibault
t/hurdsig-global-dispositions
2016-10-09Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixesSamuel Thibault
2016-09-20Merge commit 'refs/top-bases/t/hurdsig-boot-fix' into t/hurdsig-boot-fixSamuel Thibault
2016-09-20Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Samuel Thibault
2016-09-20Merge commit 'refs/top-bases/t/hurdsig-SA_SIGINFO' into t/hurdsig-SA_SIGINFOSamuel Thibault
2016-09-20Merge commit 'refs/top-bases/t/hurdsig-global-dispositions' into ↵Samuel Thibault
t/hurdsig-global-dispositions
2016-09-20Fix uninitialized valueSamuel Thibault
2016-09-20Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Samuel Thibault
2016-09-20Fix HURD_PREEMPT_SIGNAL_P call, detail->code doesn't contain the faulting ↵Samuel Thibault
address any more
2016-08-20Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Samuel Thibault
2016-08-20Merge commit 'refs/top-bases/t/hurdsig-boot-fix' into t/hurdsig-boot-fixSamuel Thibault
2016-08-20Merge commit 'refs/top-bases/t/hurdsig-global-dispositions' into ↵Samuel Thibault
t/hurdsig-global-dispositions
2016-08-20Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixesSamuel Thibault
2016-01-04Update copyright dates with scripts/update-copyrights.Joseph Myers
2015-01-23Merge commit 'refs/top-bases/t/hurdsig-boot-fix' into t/hurdsig-boot-fixThomas Schwinge
2015-01-23Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Thomas Schwinge
2015-01-23Merge commit 'refs/top-bases/t/hurdsig-global-dispositions' into ↵Thomas Schwinge
t/hurdsig-global-dispositions
2015-01-23Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixesThomas Schwinge
2015-01-02Update copyright dates with scripts/update-copyrights.Joseph Myers
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-05-21Merge commit 'refs/top-bases/t/hurdsig-boot-fix' into t/hurdsig-boot-fixThomas Schwinge
2013-05-21Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Thomas Schwinge
2013-05-21Merge commit 'refs/top-bases/t/hurdsig-global-dispositions' into ↵Thomas Schwinge
t/hurdsig-global-dispositions Conflicts: hurd/ctty-input.c hurd/ctty-output.c hurd/hurd/signal.h hurd/hurdexec.c hurd/hurdmsg.c sysdeps/mach/hurd/i386/sigreturn.c sysdeps/mach/hurd/i386/trampoline.c sysdeps/mach/hurd/sigaction.c sysdeps/mach/hurd/sigpending.c sysdeps/mach/hurd/sigprocmask.c sysdeps/mach/hurd/sigsuspend.c sysdeps/mach/hurd/sigwait.c
2013-05-21Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixesThomas Schwinge
Conflicts: hurd/hurdsig.c
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2012-11-27fix sigstate_is_global_rcv at bootRichard Braun
* hurd/hurdsig.c (sigstate_is_global_rcv): Do not return true if _HURD_GLOBAL_SIGSTATE is null.
2012-04-05Merge commit 'refs/top-bases/t/hurdsig-fixes-2' into t/hurdsig-fixes-2Thomas Schwinge
2012-04-05Merge commit 'refs/top-bases/t/hurdsig-global-dispositions' into ↵Thomas Schwinge
t/hurdsig-global-dispositions
2012-04-05Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixesThomas Schwinge
2012-02-21Small signal fixesSamuel Thibault
22e7268 Hurd signals: fix sigwait for pending signals da8bf5e Hurd signals: clear the pending mask in fork and spawn 8e87205 Hurd signals: don't drop blocked ignored signals