diff options
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/sig.h | 2 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 18 | ||||
-rw-r--r-- | sys/kern/kern_synch.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_sleepqueue.c | 6 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 2 | ||||
-rw-r--r-- | sys/sys/param.h | 1 | ||||
-rw-r--r-- | sys/sys/signalvar.h | 6 | ||||
-rw-r--r-- | sys/sys/sleepqueue.h | 2 |
8 files changed, 11 insertions, 28 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/sig.h b/sys/cddl/compat/opensolaris/sys/sig.h index 5053797..985896e 100644 --- a/sys/cddl/compat/opensolaris/sys/sig.h +++ b/sys/cddl/compat/opensolaris/sys/sig.h @@ -55,7 +55,7 @@ issig(int why) p = td->td_proc; PROC_LOCK(p); mtx_lock(&p->p_sigacts->ps_mtx); - sig = cursig(td, SIG_STOP_ALLOWED); + sig = cursig(td); mtx_unlock(&p->p_sigacts->ps_mtx); PROC_UNLOCK(p); if (sig != 0) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index e1dbedc..51d1b18 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -108,7 +108,7 @@ SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 2, "int"); static int coredump(struct thread *); static int killpg1(struct thread *td, int sig, int pgid, int all, ksiginfo_t *ksi); -static int issignal(struct thread *td, int stop_allowed); +static int issignal(struct thread *td); static int sigprop(int sig); static void tdsigwakeup(struct thread *, int, sig_t, int); static void sig_suspend_threads(struct thread *, struct proc *, int); @@ -565,14 +565,12 @@ sigqueue_delete_stopmask_proc(struct proc *p) * action, the process stops in issignal(). */ int -cursig(struct thread *td, int stop_allowed) +cursig(struct thread *td) { PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); - KASSERT(stop_allowed == SIG_STOP_ALLOWED || - stop_allowed == SIG_STOP_NOT_ALLOWED, ("cursig: stop_allowed")); mtx_assert(&td->td_proc->p_sigacts->ps_mtx, MA_OWNED); THREAD_LOCK_ASSERT(td, MA_NOTOWNED); - return (SIGPENDING(td) ? issignal(td, stop_allowed) : 0); + return (SIGPENDING(td) ? issignal(td) : 0); } /* @@ -1202,7 +1200,7 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, SIGSETNAND(td->td_sigmask, waitset); for (;;) { mtx_lock(&ps->ps_mtx); - sig = cursig(td, SIG_STOP_ALLOWED); + sig = cursig(td); mtx_unlock(&ps->ps_mtx); if (sig != 0 && SIGISMEMBER(waitset, sig)) { if (sigqueue_get(&td->td_sigqueue, sig, ksi) != 0 || @@ -1465,7 +1463,7 @@ kern_sigsuspend(struct thread *td, sigset_t mask) /* void */; thread_suspend_check(0); mtx_lock(&p->p_sigacts->ps_mtx); - while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) + while ((sig = cursig(td)) != 0) has_sig += postsig(sig); mtx_unlock(&p->p_sigacts->ps_mtx); } @@ -2399,12 +2397,10 @@ static void sig_suspend_threads(struct thread *td, struct proc *p, int sending) { struct thread *td2; - int wakeup_swapper; PROC_LOCK_ASSERT(p, MA_OWNED); PROC_SLOCK_ASSERT(p, MA_OWNED); - wakeup_swapper = 0; FOREACH_THREAD_IN_PROC(p, td2) { thread_lock(td2); td2->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; @@ -2431,8 +2427,6 @@ sig_suspend_threads(struct thread *td, struct proc *p, int sending) } thread_unlock(td2); } - if (wakeup_swapper) - kick_proc0(); } int @@ -2584,7 +2578,7 @@ sigallowstop() * postsig(sig); */ static int -issignal(struct thread *td, int stop_allowed) +issignal(struct thread *td) { struct proc *p; struct sigacts *ps; diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 81471ca..33d2db5 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -205,8 +205,6 @@ _sleep(void *ident, struct lock_object *lock, int priority, sleepq_flags = SLEEPQ_SLEEP; if (catch) sleepq_flags |= SLEEPQ_INTERRUPTIBLE; - if (priority & PBDRY) - sleepq_flags |= SLEEPQ_STOP_ON_BDRY; sleepq_lock(ident); CTR5(KTR_PROC, "sleep: thread %ld (pid %ld, %s) on %s (%p)", diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 1e1e263..92b5147 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -405,7 +405,7 @@ sleepq_catch_signals(void *wchan, int pri) struct thread *td; struct proc *p; struct sigacts *ps; - int sig, ret, stop_allowed; + int sig, ret; td = curthread; p = curproc; @@ -429,8 +429,6 @@ sleepq_catch_signals(void *wchan, int pri) sleepq_switch(wchan, pri); return (0); } - stop_allowed = (td->td_flags & TDF_SBDRY) ? SIG_STOP_NOT_ALLOWED : - SIG_STOP_ALLOWED; thread_unlock(td); mtx_unlock_spin(&sc->sc_lock); CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", @@ -438,7 +436,7 @@ sleepq_catch_signals(void *wchan, int pri) PROC_LOCK(p); ps = p->p_sigacts; mtx_lock(&ps->ps_mtx); - sig = cursig(td, stop_allowed); + sig = cursig(td); if (sig == 0) { mtx_unlock(&ps->ps_mtx); ret = thread_suspend_check(1); diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 11a4bc4..19729a4 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -267,7 +267,7 @@ ast(struct trapframe *framep) !SIGISEMPTY(p->p_siglist)) { PROC_LOCK(p); mtx_lock(&p->p_sigacts->ps_mtx); - while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) + while ((sig = cursig(td)) != 0) postsig(sig); mtx_unlock(&p->p_sigacts->ps_mtx); PROC_UNLOCK(p); diff --git a/sys/sys/param.h b/sys/sys/param.h index 996d47c..2be2e25 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -211,7 +211,6 @@ #define PRIMASK 0x0ff #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ #define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */ -#define PBDRY 0x400 /* for PCATCH stop is done on the user boundary */ #define NZERO 0 /* default "nice" */ diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index fcf25ad..c784cfa 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -318,16 +318,12 @@ struct thread; extern struct mtx sigio_lock; -/* Values for stop_allowed parameter for cursig(). */ -#define SIG_STOP_ALLOWED 100 -#define SIG_STOP_NOT_ALLOWED 101 - /* Flags for kern_sigprocmask(). */ #define SIGPROCMASK_OLD 0x0001 #define SIGPROCMASK_PROC_LOCKED 0x0002 #define SIGPROCMASK_PS_LOCKED 0x0004 -int cursig(struct thread *td, int stop_allowed); +int cursig(struct thread *td); int sigdeferstop(void); void sigallowstop(void); void execsigs(struct proc *p); diff --git a/sys/sys/sleepqueue.h b/sys/sys/sleepqueue.h index 1c34636..05386a9 100644 --- a/sys/sys/sleepqueue.h +++ b/sys/sys/sleepqueue.h @@ -93,8 +93,6 @@ struct thread; #define SLEEPQ_SX 0x03 /* Used by an sx lock. */ #define SLEEPQ_LK 0x04 /* Used by a lockmgr. */ #define SLEEPQ_INTERRUPTIBLE 0x100 /* Sleep is interruptible. */ -#define SLEEPQ_STOP_ON_BDRY 0x200 /* Stop sleeping thread on - user mode boundary */ void init_sleepqueues(void); int sleepq_abort(struct thread *td, int intrval); |