diff options
author | jhb <jhb@FreeBSD.org> | 2003-05-13 20:36:02 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-05-13 20:36:02 +0000 |
commit | 89a4eb17deddba4ba8bfb0cf7c6801a608731f8c (patch) | |
tree | 0e2ba79e40f08e96bb98756b67576ff96caccfbc /sys/compat | |
parent | 3b9288c6f4df2bfdc2a41de3ae161246c310e064 (diff) | |
download | FreeBSD-src-89a4eb17deddba4ba8bfb0cf7c6801a608731f8c.zip FreeBSD-src-89a4eb17deddba4ba8bfb0cf7c6801a608731f8c.tar.gz |
- Merge struct procsig with struct sigacts.
- Move struct sigacts out of the u-area and malloc() it using the
M_SUBPROC malloc bucket.
- Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(),
sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared().
- Remove the p_sigignore, p_sigacts, and p_sigcatch macros.
- Add a mutex to struct sigacts that protects all the members of the struct.
- Add sigacts locking.
- Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now
that sigacts is locked.
- Several in-kernel functions such as psignal(), tdsignal(), trapsignal(),
and thread_stopped() are now MP safe.
Reviewed by: arch@
Approved by: re (rwatson)
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 8 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_filio.c | 15 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_misc.c | 8 |
3 files changed, 21 insertions, 10 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 033346b..14f9aeb 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -547,6 +547,7 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) char *state; segsz_t lsize; struct thread *td2; + struct sigacts *ps; int i; PROC_LOCK(p); @@ -653,8 +654,11 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) * relation to struct proc, so SigBlk is left unimplemented. */ sbuf_printf(sb, "SigBlk:\t%08x\n", 0); /* XXX */ - sbuf_printf(sb, "SigIgn:\t%08x\n", p->p_sigignore.__bits[0]); - sbuf_printf(sb, "SigCgt:\t%08x\n", p->p_sigcatch.__bits[0]); + ps = p->p_sigacts; + mtx_lock(&ps->ps_mtx); + sbuf_printf(sb, "SigIgn:\t%08x\n", ps->ps_sigignore.__bits[0]); + sbuf_printf(sb, "SigCgt:\t%08x\n", ps->ps_sigcatch.__bits[0]); + mtx_unlock(&ps->ps_mtx); PROC_UNLOCK(p); /* diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c index 870da5d..374338f 100644 --- a/sys/compat/svr4/svr4_filio.c +++ b/sys/compat/svr4/svr4_filio.c @@ -132,10 +132,21 @@ svr4_sys_read(td, uap) DPRINTF(("svr4_read(%d, 0x%0x, %d) = %d\n", uap->fd, uap->buf, uap->nbyte, rv)); if (rv == EAGAIN) { +#ifdef DEBUG_SVR4 + struct sigacts *ps; + + PROC_LOCK(td->td_proc); + ps = td->td_proc->p_sigacts; + mtx_lock(&ps->ps_mtx); +#endif DPRINTF(("sigmask = 0x%x\n", td->td_sigmask)); - DPRINTF(("sigignore = 0x%x\n", td->td_proc->p_sigignore)); - DPRINTF(("sigcaught = 0x%x\n", td->td_proc->p_sigcatch)); + DPRINTF(("sigignore = 0x%x\n", ps->ps_sigignore)); + DPRINTF(("sigcaught = 0x%x\n", ps->ps_sigcatch)); DPRINTF(("siglist = 0x%x\n", td->td_siglist)); +#ifdef DEBUG_SVR4 + mtx_unlock(&ps->ps_mtx); + PROC_UNLOCK(td->td_proc); +#endif } #if defined(GROTTY_READ_HACK) diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 81eef66..22fdc66 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1363,12 +1363,8 @@ loop: sx_xunlock(&proctree_lock); PROC_LOCK(q); - if (--q->p_procsig->ps_refcnt == 0) { - if (q->p_sigacts != &q->p_uarea->u_sigacts) - FREE(q->p_sigacts, M_SUBPROC); - FREE(q->p_procsig, M_SUBPROC); - q->p_procsig = NULL; - } + sigacts_free(q->p_sigacts); + q->p_sigacts = NULL; PROC_UNLOCK(q); /* |