diff options
-rw-r--r-- | sys/kern/kern_sig.c | 26 | ||||
-rw-r--r-- | sys/sys/signalvar.h | 37 |
2 files changed, 27 insertions, 36 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 3f7e5d5..1e8561f 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -67,6 +67,7 @@ #include <machine/ipl.h> #include <machine/cpu.h> +#include <machine/mutex.h> #include <machine/smp.h> #define ONSIG 32 /* NSIG for osig* syscalls. XXX. */ @@ -166,6 +167,31 @@ static int sigproptbl[NSIG] = { SA_KILL, /* SIGUSR2 */ }; +/* + * Determine signal that should be delivered to process p, the current + * process, 0 if none. If there is a pending stop signal with default + * action, the process stops in issignal(). + * + * MP SAFE + */ +int +CURSIG(struct proc *p) +{ + sigset_t tmpset; + int r; + + tmpset = p->p_siglist; + SIGSETNAND(tmpset, p->p_sigmask); + if (SIGISEMPTY(p->p_siglist) || + (!(p->p_flag & P_TRACED) && SIGISEMPTY(tmpset))) { + return(0); + } + mtx_enter(&Giant, MTX_DEF); + r = issignal(p); + mtx_exit(&Giant, MTX_DEF); + return(r); +} + static __inline int sigprop(int sig) { diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index 0d1757f..d60114f 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -38,8 +38,6 @@ #define _SYS_SIGNALVAR_H_ #include <sys/signal.h> -#include <sys/proc.h> -#include <machine/smp.h> /* * Kernel signal definitions and data structures, @@ -189,10 +187,6 @@ __sigseteq(sigset_t *set1, sigset_t *set2) #ifdef _KERNEL -#include <sys/ktr.h> -#include <sys/systm.h> -#include <machine/mutex.h> - struct pgrp; struct proc; struct sigio; @@ -202,6 +196,7 @@ extern int sugid_coredump; /* Sysctl variable kern.sugid_coredump */ /* * Machine-independent functions: */ +int CURSIG(struct proc *p); void check_sigacts __P((void)); void execsigs __P((struct proc *p)); void gsignal __P((int pgid, int sig)); @@ -214,42 +209,12 @@ void psignal __P((struct proc *p, int sig)); void sigexit __P((struct proc *p, int signum)); void siginit __P((struct proc *p)); void trapsignal __P((struct proc *p, int sig, u_long code)); -static int __cursig __P((struct proc *p)); /* * Machine-dependent functions: */ void sendsig __P((sig_t action, int sig, sigset_t *retmask, u_long code)); -/* - * Inline functions: - */ -#define CURSIG(p) __cursig(p) - -/* - * Determine signal that should be delivered to process p, the current - * process, 0 if none. If there is a pending stop signal with default - * action, the process stops in issignal(). - * - * MP SAFE - */ -static __inline int __cursig(struct proc *p) -{ - sigset_t tmpset; - int r; - - tmpset = p->p_siglist; - SIGSETNAND(tmpset, p->p_sigmask); - if (SIGISEMPTY(p->p_siglist) || - (!(p->p_flag & P_TRACED) && SIGISEMPTY(tmpset))) { - return(0); - } - mtx_enter(&Giant, MTX_DEF); - r = issignal(p); - mtx_exit(&Giant, MTX_DEF); - return(r); -} - #endif /* _KERNEL */ #endif /* !_SYS_SIGNALVAR_H_ */ |