From: Simon Schubert Date: Sun, 25 Feb 2007 23:17:13 +0000 (+0000) Subject: Get rid of struct user/UAREA. X-Git-Tag: v2.0.1~3447 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/b1b4e5a66f346a8dd1c144e01d986f9112fd0884 Get rid of struct user/UAREA. Merge procsig with sigacts and replace usage of procsig with sigacts, like it used to be in 4.4BSD. Put signal-related inline functions in sys/signal2.h. Reviewed-by: Thomas E. Spanjaard --- diff --git a/gnu/usr.bin/gdb/libgdb/Makefile.i386 b/gnu/usr.bin/gdb/libgdb/Makefile.i386 index 285b8b0edd..b75a1fc52e 100644 --- a/gnu/usr.bin/gdb/libgdb/Makefile.i386 +++ b/gnu/usr.bin/gdb/libgdb/Makefile.i386 @@ -1,10 +1,10 @@ -# $DragonFly: src/gnu/usr.bin/gdb/libgdb/Makefile.i386,v 1.2 2006/07/27 00:30:10 corecode Exp $ +# $DragonFly: src/gnu/usr.bin/gdb/libgdb/Makefile.i386,v 1.3 2007/02/25 23:17:12 corecode Exp $ SRCS+= i386-nat.c i386-tdep.c i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c SRCS+= i386fbsd-tdep.c i387-tdep.c nm.h: - echo '#include "i386/nm-fbsd.h"' > ${.TARGET} + echo '#include "nm-dragonfly.h"' > ${.TARGET} tm.h: echo '#include "i386/tm-fbsd.h"' > ${.TARGET} diff --git a/gnu/usr.bin/gdb/libgdb/patches/i386bsd-nat.c.patch b/gnu/usr.bin/gdb/libgdb/patches/i386bsd-nat.c.patch index d63131dfce..6f6e6e1c2a 100644 --- a/gnu/usr.bin/gdb/libgdb/patches/i386bsd-nat.c.patch +++ b/gnu/usr.bin/gdb/libgdb/patches/i386bsd-nat.c.patch @@ -1,13 +1,42 @@ -$DragonFly: src/gnu/usr.bin/gdb/libgdb/patches/Attic/i386bsd-nat.c.patch,v 1.1 2006/03/07 15:48:11 corecode Exp $ +$DragonFly: src/gnu/usr.bin/gdb/libgdb/patches/Attic/i386bsd-nat.c.patch,v 1.2 2007/02/25 23:17:12 corecode Exp $ -Index: i386bsd-nat.c -=================================================================== -RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/gdb-6.2.1/gdb/i386bsd-nat.c,v -retrieving revision 1.1 -diff -u -r1.1 i386bsd-nat.c ---- i386bsd-nat.c 24 Oct 2004 19:56:25 -0000 1.1 -+++ i386bsd-nat.c 26 Oct 2004 09:27:21 -0000 -@@ -349,7 +349,7 @@ +diff --git a/contrib/gdb-6.2.1/gdb/i386bsd-nat.c b/contrib/gdb-6.2.1/gdb/i386bsd-nat.c +index 4d663fc..b275aa7 100644 +--- a/contrib/gdb-6.2.1/gdb/i386bsd-nat.c ++++ b/contrib/gdb-6.2.1/gdb/i386bsd-nat.c +@@ -313,31 +313,6 @@ i386bsd_dr_get_status (void) + + #endif /* PT_GETDBREGS */ + +- +-/* Support for the user struct. */ +- +-/* Return the address register REGNUM. BLOCKEND is the value of +- u.u_ar0, which should point to the registers. */ +- +-CORE_ADDR +-register_u_addr (CORE_ADDR blockend, int regnum) +-{ +- gdb_assert (regnum >= 0 && regnum < ARRAY_SIZE (i386bsd_r_reg_offset)); +- +- return blockend + i386bsd_r_reg_offset[regnum]; +-} +- +-#include +-#include +- +-/* Return the size of the user struct. */ +- +-int +-kernel_u_size (void) +-{ +- return (sizeof (struct user)); +-} +- + void + _initialize_i386bsd_nat (void) + { +@@ -349,7 +324,7 @@ _initialize_i386bsd_nat (void) system header files and sysctl(3) to get at the relevant information. */ diff --git a/sys/dev/raid/vinum/.gdbinit.kernel b/sys/dev/raid/vinum/.gdbinit.kernel index 01eb9dce53..1de0a80214 100644 --- a/sys/dev/raid/vinum/.gdbinit.kernel +++ b/sys/dev/raid/vinum/.gdbinit.kernel @@ -1,4 +1,4 @@ -# $DragonFly: src/sys/dev/raid/vinum/.gdbinit.kernel,v 1.6 2006/09/09 19:07:27 dillon Exp $ +# $DragonFly: src/sys/dev/raid/vinum/.gdbinit.kernel,v 1.7 2007/02/25 23:17:12 corecode Exp $ set remotebaud 38400 set remotetimeout 1 set complaints 1 @@ -394,16 +394,16 @@ define ps set $nproc = nprocs set $aproc = allproc.lh_first set $proc = allproc.lh_first - printf " pid proc addr uid ppid pgrp flag stat comm wchan\n" + printf " pid proc uid ppid pgrp flag stat comm wchan\n" while (--$nproc >= 0) set $pptr = $proc.p_pptr if ($pptr == 0) set $pptr = $proc end if ($proc.p_stat) - printf "%5d %08x %08x %4d %5d %5d %06x %d %-10s ", \ + printf "%5d %08x %4d %5d %5d %06x %d %-10s ", \ $proc.p_pid, $aproc, \ - $proc.p_addr, $proc.p_cred->p_ruid, $pptr->p_pid, \ + $proc.p_cred->p_ruid, $pptr->p_pid, \ $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_stat, \ &$proc.p_comm[0] if ($proc.p_wchan) @@ -486,16 +486,16 @@ define btpa set $nproc = nprocs set $aproc = allproc.lh_first set $proc = allproc.lh_first - printf " pid proc addr uid ppid pgrp flag stat comm wchan\n" + printf " pid proc uid ppid pgrp flag stat comm wchan\n" while (--$nproc >= 0) set $pptr = $proc.p_pptr if ($pptr == 0) set $pptr = $proc end if ($proc.p_stat) - printf "%5d %08x %08x %4d %5d %5d %06x %d %-10s ", \ + printf "%5d %08x %4d %5d %5d %06x %d %-10s ", \ $proc.p_pid, $aproc, \ - $proc.p_addr, $proc.p_cred->p_ruid, $pptr->p_pid, \ + $proc.p_cred->p_ruid, $pptr->p_pid, \ $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_stat, \ &$proc.p_comm[0] if ($proc.p_wchan) @@ -543,9 +543,9 @@ define defproc end set $myvectorproc = $proc if ($proc.p_stat) - printf "%5d %08x %08x %4d %5d %5d %06x %d %-10s ", \ + printf "%5d %08x %4d %5d %5d %06x %d %-10s ", \ $proc.p_pid, $aproc, \ - $proc.p_addr, $proc.p_cred->p_ruid, $pptr->p_pid, \ + $proc.p_cred->p_ruid, $pptr->p_pid, \ $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_stat, \ &$proc.p_comm[0] if ($proc.p_wchan) diff --git a/sys/emulation/linux/linux_misc.c b/sys/emulation/linux/linux_misc.c index b59b21b582..5a11aad403 100644 --- a/sys/emulation/linux/linux_misc.c +++ b/sys/emulation/linux/linux_misc.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.85.2.9 2002/09/24 08:11:41 mdodd Exp $ - * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.36 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.37 2007/02/25 23:17:12 corecode Exp $ */ #include "opt_compat.h" @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 3311898c14..ae219a2999 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/kern/imgact_elf.c,v 1.73.2.13 2002/12/28 19:49:41 dillon Exp $ - * $DragonFly: src/sys/kern/imgact_elf.c,v 1.49 2007/02/21 15:45:36 corecode Exp $ + * $DragonFly: src/sys/kern/imgact_elf.c,v 1.50 2007/02/25 23:17:12 corecode Exp $ */ #include @@ -1419,8 +1419,7 @@ elf_putsigs(struct lwp *lp, elf_buf_t target) csi = target_reserve(target, sizeof(struct ckpt_siginfo), &error); if (csi) { csi->csi_ckptpisz = sizeof(struct ckpt_siginfo); - bcopy(p->p_procsig, &csi->csi_procsig, sizeof(struct procsig)); - bcopy(p->p_procsig->ps_sigacts, &csi->csi_sigacts, sizeof(struct sigacts)); + bcopy(p->p_sigacts, &csi->csi_sigacts, sizeof(*p->p_sigacts)); bcopy(&p->p_realtimer, &csi->csi_itimerval, sizeof(struct itimerval)); bcopy(&lp->lwp_sigmask, &csi->csi_sigmask, sizeof(sigset_t)); diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index adfb5b38d1..86f4cd4cd2 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -40,7 +40,7 @@ * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/init_main.c,v 1.134.2.8 2003/06/06 20:21:32 tegge Exp $ - * $DragonFly: src/sys/kern/init_main.c,v 1.73 2007/02/16 23:11:39 corecode Exp $ + * $DragonFly: src/sys/kern/init_main.c,v 1.74 2007/02/25 23:17:12 corecode Exp $ */ #include "opt_init_path.h" @@ -78,7 +78,7 @@ /* Components of the first process -- never freed. */ static struct session session0; static struct pgrp pgrp0; -static struct procsig procsig0; +static struct sigacts sigacts0; static struct filedesc filedesc0; static struct plimit limit0; static struct vmspace vmspace0; @@ -157,7 +157,6 @@ mi_proc0init(struct globaldata *gd, struct user *proc0paddr) { lwkt_init_thread(&thread0, proc0paddr, LWKT_THREAD_STACK, 0, gd); lwkt_set_comm(&thread0, "thread0"); - proc0.p_addr = (void *)thread0.td_kstack; LIST_INIT(&proc0.p_lwps); LIST_INSERT_HEAD(&proc0.p_lwps, &lwp0, lwp_list); lwp0.lwp_thread = &thread0; @@ -350,9 +349,9 @@ proc0_init(void *dummy __unused) /* Don't jail it */ p->p_ucred->cr_prison = NULL; - /* Create procsig. */ - p->p_procsig = &procsig0; - p->p_procsig->ps_refcnt = 1; + /* Create sigacts. */ + p->p_sigacts = &sigacts0; + p->p_sigacts->ps_refcnt = 1; /* Initialize signal state for process 0. */ siginit(p); @@ -373,14 +372,6 @@ proc0_init(void *dummy __unused) trunc_page(VM_MAX_USER_ADDRESS), vmspace_pmap(&vmspace0)); - /* - * We continue to place signal - * actions in the user struct so they're pageable. - * - * XXX old + cufty. will be removed - */ - p->p_sigacts = &p->p_addr->u_sigacts; - /* * Charge root for one process. */ diff --git a/sys/kern/kern_checkpoint.c b/sys/kern/kern_checkpoint.c index 940e243e32..4e23340e88 100644 --- a/sys/kern/kern_checkpoint.c +++ b/sys/kern/kern_checkpoint.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_checkpoint.c,v 1.17 2007/02/21 15:45:36 corecode Exp $ + * $DragonFly: src/sys/kern/kern_checkpoint.c,v 1.18 2007/02/25 23:17:12 corecode Exp $ */ #include @@ -451,7 +451,6 @@ elf_getsigs(struct lwp *lp, struct file *fp) struct proc *p = lp->lwp_proc; int error; struct ckpt_siginfo *csi; - struct sigacts *tmpsigacts; TRACE_ENTER; csi = kmalloc(sizeof(struct ckpt_siginfo), M_TEMP, M_ZERO | M_WAITOK); @@ -463,10 +462,7 @@ elf_getsigs(struct lwp *lp, struct file *fp) error = EINVAL; goto done; } - tmpsigacts = p->p_procsig->ps_sigacts; - bcopy(&csi->csi_procsig, p->p_procsig, sizeof(struct procsig)); - p->p_procsig->ps_sigacts = tmpsigacts; - bcopy(&csi->csi_sigacts, p->p_procsig->ps_sigacts, sizeof(struct sigacts)); + bcopy(&csi->csi_sigacts, p->p_sigacts, sizeof(p->p_sigacts)); bcopy(&csi->csi_itimerval, &p->p_realtimer, sizeof(struct itimerval)); SIG_CANTMASK(csi->csi_sigmask); /* XXX lwp handle more than one lwp */ diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index f0ae6542bc..a98579f24b 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_exec.c,v 1.107.2.15 2002/07/30 15:40:46 nectar Exp $ - * $DragonFly: src/sys/kern/kern_exec.c,v 1.54 2007/02/24 14:25:06 corecode Exp $ + * $DragonFly: src/sys/kern/kern_exec.c,v 1.55 2007/02/25 23:17:12 corecode Exp $ */ #include @@ -311,20 +311,15 @@ interpret: * handlers. In execsigs(), the new process will have its signals * reset. */ - if (p->p_procsig->ps_refcnt > 1) { - struct procsig *newprocsig; + if (p->p_sigacts->ps_refcnt > 1) { + struct sigacts *newsigacts; - MALLOC(newprocsig, struct procsig *, sizeof(struct procsig), + newsigacts = (struct sigacts *)kmalloc(sizeof(*newsigacts), M_SUBPROC, M_WAITOK); - bcopy(p->p_procsig, newprocsig, sizeof(*newprocsig)); - p->p_procsig->ps_refcnt--; - p->p_procsig = newprocsig; - p->p_procsig->ps_refcnt = 1; - if (p->p_sigacts == &p->p_addr->u_sigacts) - panic("shared procsig but private sigacts?"); - - p->p_addr->u_sigacts = *p->p_sigacts; - p->p_sigacts = &p->p_addr->u_sigacts; + bcopy(p->p_sigacts, newsigacts, sizeof(*newsigacts)); + p->p_sigacts->ps_refcnt--; + p->p_sigacts = newsigacts; + p->p_sigacts->ps_refcnt = 1; } /* diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index fcaf2986f6..997f012596 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -37,7 +37,7 @@ * * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94 * $FreeBSD: src/sys/kern/kern_exit.c,v 1.92.2.11 2003/01/13 22:51:16 dillon Exp $ - * $DragonFly: src/sys/kern/kern_exit.c,v 1.77 2007/02/25 14:07:13 corecode Exp $ + * $DragonFly: src/sys/kern/kern_exit.c,v 1.78 2007/02/25 23:17:12 corecode Exp $ */ #include "opt_compat.h" @@ -447,7 +447,7 @@ exit1(int rv) * flag set, notify process 1 instead (and hope it will handle * this situation). */ - if (p->p_pptr->p_procsig->ps_flag & PS_NOCLDWAIT) { + if (p->p_pptr->p_sigacts->ps_flag & PS_NOCLDWAIT) { struct proc *pp = p->p_pptr; proc_reparent(p, initproc); /* @@ -715,11 +715,9 @@ loop: proc_remove_zombie(p); leavepgrp(p); - if (--p->p_procsig->ps_refcnt == 0) { - if (p->p_sigacts != &p->p_addr->u_sigacts) - FREE(p->p_sigacts, M_SUBPROC); - FREE(p->p_procsig, M_SUBPROC); - p->p_procsig = NULL; + if (--p->p_sigacts->ps_refcnt == 0) { + kfree(p->p_sigacts, M_SUBPROC); + p->p_sigacts = NULL; } vm_waitproc(p); @@ -815,23 +813,6 @@ rm_at_exit(exitlist_fn function) return (0); } -void -check_sigacts(void) -{ - struct proc *p = curproc; - struct sigacts *pss; - - if (p->p_procsig->ps_refcnt == 1 && - p->p_sigacts != &p->p_addr->u_sigacts) { - pss = p->p_sigacts; - crit_enter(); - p->p_addr->u_sigacts = *pss; - p->p_sigacts = &p->p_addr->u_sigacts; - crit_exit(); - FREE(pss, M_SUBPROC); - } -} - /* * LWP reaper related code. diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 283ff3953a..ed15362bba 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -37,7 +37,7 @@ * * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 * $FreeBSD: src/sys/kern/kern_fork.c,v 1.72.2.14 2003/06/26 04:15:10 silby Exp $ - * $DragonFly: src/sys/kern/kern_fork.c,v 1.63 2007/02/18 16:17:09 corecode Exp $ + * $DragonFly: src/sys/kern/kern_fork.c,v 1.64 2007/02/25 23:17:12 corecode Exp $ */ #include "opt_ktrace.h" @@ -66,8 +66,8 @@ #include #include -#include #include +#include static MALLOC_DEFINE(M_ATFORK, "atfork", "atfork callback"); @@ -323,7 +323,6 @@ fork1(struct lwp *lp1, int flags, struct proc **procp) /* * Duplicate sub-structures as needed. * Increase reference counts on shared objects. - * The p_stats and p_sigacts substructs are set in vm_fork. * p_lock is in the copy area and must be cleared. */ p2->p_flag = 0; @@ -340,33 +339,13 @@ fork1(struct lwp *lp1, int flags, struct proc **procp) p2->p_args->ar_ref++; if (flags & RFSIGSHARE) { - p2->p_procsig = p1->p_procsig; - p2->p_procsig->ps_refcnt++; - if (p1->p_sigacts == &p1->p_addr->u_sigacts) { - struct sigacts *newsigacts; - - /* Create the shared sigacts structure */ - MALLOC(newsigacts, struct sigacts *, - sizeof(struct sigacts), M_SUBPROC, M_WAITOK); - crit_enter(); - /* - * Set p_sigacts to the new shared structure. - * Note that this is updating p1->p_sigacts at the - * same time, since p_sigacts is just a pointer to - * the shared p_procsig->ps_sigacts. - */ - p2->p_sigacts = newsigacts; - bcopy(&p1->p_addr->u_sigacts, p2->p_sigacts, - sizeof(*p2->p_sigacts)); - *p2->p_sigacts = p1->p_addr->u_sigacts; - crit_exit(); - } + p2->p_sigacts = p1->p_sigacts; + p2->p_sigacts->ps_refcnt++; } else { - MALLOC(p2->p_procsig, struct procsig *, sizeof(struct procsig), + p2->p_sigacts = (struct sigacts *)kmalloc(sizeof(*p2->p_sigacts), M_SUBPROC, M_WAITOK); - bcopy(p1->p_procsig, p2->p_procsig, sizeof(*p2->p_procsig)); - p2->p_procsig->ps_refcnt = 1; - p2->p_sigacts = NULL; /* finished in vm_fork() */ + bcopy(p1->p_sigacts, p2->p_sigacts, sizeof(*p2->p_sigacts)); + p2->p_sigacts->ps_refcnt = 1; } if (flags & RFLINUXTHPN) p2->p_sigparent = SIGUSR1; diff --git a/sys/kern/kern_kinfo.c b/sys/kern/kern_kinfo.c index e62b77249d..d6a154fdf7 100644 --- a/sys/kern/kern_kinfo.c +++ b/sys/kern/kern_kinfo.c @@ -32,7 +32,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_kinfo.c,v 1.8 2007/02/18 16:17:09 corecode Exp $ + * $DragonFly: src/sys/kern/kern_kinfo.c,v 1.9 2007/02/25 23:17:12 corecode Exp $ */ /* @@ -78,7 +78,7 @@ fill_kinfo_proc(struct proc *p, struct kinfo_proc *kp) kp->kp_siglist = p->p_siglist; kp->kp_sigignore = p->p_sigignore; kp->kp_sigcatch = p->p_sigcatch; - kp->kp_sigflag = p->p_procsig->ps_flag; + kp->kp_sigflag = p->p_sigacts->ps_flag; kp->kp_start = p->p_start; strncpy(kp->kp_comm, p->p_comm, sizeof(kp->kp_comm) - 1); diff --git a/sys/kern/kern_memio.c b/sys/kern/kern_memio.c index 9bfa7b16bb..93ea8da90a 100644 --- a/sys/kern/kern_memio.c +++ b/sys/kern/kern_memio.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: mem.c 1.13 89/10/08$ * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/mem.c,v 1.79.2.9 2003/01/04 22:58:01 njl Exp $ - * $DragonFly: src/sys/kern/kern_memio.c,v 1.29 2007/02/03 17:05:57 corecode Exp $ + * $DragonFly: src/sys/kern/kern_memio.c,v 1.30 2007/02/25 23:17:12 corecode Exp $ */ /* @@ -59,6 +59,7 @@ #include #include #include +#include #include #include diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 325c988149..348f32fae5 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -37,7 +37,7 @@ * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 * $FreeBSD: src/sys/kern/kern_sig.c,v 1.72.2.17 2003/05/16 16:34:34 obrien Exp $ - * $DragonFly: src/sys/kern/kern_sig.c,v 1.72 2007/02/24 14:25:07 corecode Exp $ + * $DragonFly: src/sys/kern/kern_sig.c,v 1.73 2007/02/25 23:17:12 corecode Exp $ */ #include "opt_ktrace.h" @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -251,9 +252,9 @@ kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact) oact->sa_flags |= SA_SIGINFO; if (SIGISMEMBER(ps->ps_sigmailbox, sig)) oact->sa_flags |= SA_MAILBOX; - if (sig == SIGCHLD && p->p_procsig->ps_flag & PS_NOCLDSTOP) + if (sig == SIGCHLD && p->p_sigacts->ps_flag & PS_NOCLDSTOP) oact->sa_flags |= SA_NOCLDSTOP; - if (sig == SIGCHLD && p->p_procsig->ps_flag & PS_NOCLDWAIT) + if (sig == SIGCHLD && p->p_sigacts->ps_flag & PS_NOCLDWAIT) oact->sa_flags |= SA_NOCLDWAIT; } if (act) { @@ -308,9 +309,9 @@ kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact) SIGDELSET(ps->ps_sigmailbox, sig); if (sig == SIGCHLD) { if (act->sa_flags & SA_NOCLDSTOP) - p->p_procsig->ps_flag |= PS_NOCLDSTOP; + p->p_sigacts->ps_flag |= PS_NOCLDSTOP; else - p->p_procsig->ps_flag &= ~PS_NOCLDSTOP; + p->p_sigacts->ps_flag &= ~PS_NOCLDSTOP; if (act->sa_flags & SA_NOCLDWAIT) { /* * Paranoia: since SA_NOCLDWAIT is implemented @@ -319,11 +320,11 @@ kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact) * is forbidden to set SA_NOCLDWAIT. */ if (p->p_pid == 1) - p->p_procsig->ps_flag &= ~PS_NOCLDWAIT; + p->p_sigacts->ps_flag &= ~PS_NOCLDWAIT; else - p->p_procsig->ps_flag |= PS_NOCLDWAIT; + p->p_sigacts->ps_flag |= PS_NOCLDWAIT; } else { - p->p_procsig->ps_flag &= ~PS_NOCLDWAIT; + p->p_sigacts->ps_flag &= ~PS_NOCLDWAIT; } } /* @@ -435,7 +436,7 @@ execsigs(struct proc *p) /* * Reset no zombies if child dies flag as Solaris does. */ - p->p_procsig->ps_flag &= ~PS_NOCLDWAIT; + p->p_sigacts->ps_flag &= ~PS_NOCLDWAIT; } /* @@ -1251,7 +1252,7 @@ proc_stop(struct proc *p, int notify) p->p_flag &= ~P_WAITED; wakeup(p->p_pptr); if (notify > 1 || - (notify && (p->p_pptr->p_procsig->ps_flag & PS_NOCLDSTOP) == 0)) + (notify && (p->p_pptr->p_sigacts->ps_flag & PS_NOCLDSTOP) == 0)) ksignal(p->p_pptr, SIGCHLD); } @@ -1363,6 +1364,10 @@ kern_sigtimedwait(sigset_t waitset, siginfo_t *info, struct timespec *timeout) lp->lwp_sigmask = savedmask; SIGSETNAND(lp->lwp_sigmask, waitset); + /* + * We won't ever be woken up. Instead, our sleep will + * be broken in lwpsignal(). + */ error = tsleep(&p->p_sigacts, PCATCH, "sigwt", hz); if (timeout) { if (error == ERESTART) { diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 8e2f698a2e..b2bf177d8f 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -37,7 +37,7 @@ * * @(#)kern_synch.c 8.9 (Berkeley) 5/19/95 * $FreeBSD: src/sys/kern/kern_synch.c,v 1.87.2.6 2002/10/13 07:29:53 kbyanc Exp $ - * $DragonFly: src/sys/kern/kern_synch.c,v 1.80 2007/02/24 14:23:18 corecode Exp $ + * $DragonFly: src/sys/kern/kern_synch.c,v 1.81 2007/02/25 23:17:12 corecode Exp $ */ #include "opt_ktrace.h" @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/kern/lwkt_msgport.c b/sys/kern/lwkt_msgport.c index 01d38df736..f9fbcaa08e 100644 --- a/sys/kern/lwkt_msgport.c +++ b/sys/kern/lwkt_msgport.c @@ -34,7 +34,7 @@ * NOTE! This file may be compiled for userland libraries as well as for * the kernel. * - * $DragonFly: src/sys/kern/lwkt_msgport.c,v 1.37 2007/02/18 16:12:43 corecode Exp $ + * $DragonFly: src/sys/kern/lwkt_msgport.c,v 1.38 2007/02/25 23:17:12 corecode Exp $ */ #ifdef _KERNEL @@ -48,6 +48,7 @@ #include #include #include +#include #include #include diff --git a/sys/kern/tty.c b/sys/kern/tty.c index ab70494ff1..864cc60feb 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -37,7 +37,7 @@ * * @(#)tty.c 8.8 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/tty.c,v 1.129.2.5 2002/03/11 01:32:31 dd Exp $ - * $DragonFly: src/sys/kern/tty.c,v 1.40 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/kern/tty.c,v 1.41 2007/02/25 23:17:12 corecode Exp $ */ /*- @@ -89,6 +89,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/netproto/ncp/ncp_ncp.c b/sys/netproto/ncp/ncp_ncp.c index a815e5c5a3..ce036d453b 100644 --- a/sys/netproto/ncp/ncp_ncp.c +++ b/sys/netproto/ncp/ncp_ncp.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netncp/ncp_ncp.c,v 1.3 1999/10/29 10:21:07 bp Exp $ - * $DragonFly: src/sys/netproto/ncp/ncp_ncp.c,v 1.12 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/netproto/ncp/ncp_ncp.c,v 1.13 2007/02/25 23:17:13 corecode Exp $ * * Core of NCP protocol */ @@ -43,6 +43,7 @@ #include #include #include +#include #include #include diff --git a/sys/netproto/smb/smb_subr.c b/sys/netproto/smb/smb_subr.c index d45dc010ae..15c90e2684 100644 --- a/sys/netproto/smb/smb_subr.c +++ b/sys/netproto/smb/smb_subr.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_subr.c,v 1.1.2.2 2001/09/03 08:55:11 bp Exp $ - * $DragonFly: src/sys/netproto/smb/smb_subr.c,v 1.27 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/netproto/smb/smb_subr.c,v 1.28 2007/02/25 23:17:13 corecode Exp $ */ #include #include @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -386,7 +387,7 @@ kthread_create2(void (*func)(void *), void *arg, /* this is a non-swapped system process */ p2->p_flag |= P_SYSTEM; - p2->p_procsig->ps_flag |= PS_NOCLDWAIT; + p2->p_sigacts->ps_flag |= PS_NOCLDWAIT; lp2 = ONLY_LWP_IN_PROC(p2); diff --git a/sys/platform/pc32/i386/genassym.c b/sys/platform/pc32/i386/genassym.c index 70b2824091..d9fd3fa067 100644 --- a/sys/platform/pc32/i386/genassym.c +++ b/sys/platform/pc32/i386/genassym.c @@ -35,7 +35,7 @@ * * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.86.2.3 2002/03/03 05:42:49 nyan Exp $ - * $DragonFly: src/sys/platform/pc32/i386/genassym.c,v 1.55 2007/02/16 23:11:40 corecode Exp $ + * $DragonFly: src/sys/platform/pc32/i386/genassym.c,v 1.56 2007/02/25 23:17:13 corecode Exp $ */ #include @@ -76,7 +76,6 @@ ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); -ASSYM(P_ADDR, offsetof(struct proc, p_addr)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); diff --git a/sys/platform/pc32/i386/pmap.c b/sys/platform/pc32/i386/pmap.c index 2647c4f7bd..830e566b24 100644 --- a/sys/platform/pc32/i386/pmap.c +++ b/sys/platform/pc32/i386/pmap.c @@ -40,7 +40,7 @@ * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/i386/pmap.c,v 1.250.2.18 2002/03/06 22:48:53 silby Exp $ - * $DragonFly: src/sys/platform/pc32/i386/pmap.c,v 1.75 2007/02/24 14:25:07 corecode Exp $ + * $DragonFly: src/sys/platform/pc32/i386/pmap.c,v 1.76 2007/02/25 23:17:13 corecode Exp $ */ /* @@ -900,7 +900,6 @@ pmap_init_proc(struct proc *p, struct thread *td) { struct lwp *lp = ONLY_LWP_IN_PROC(p); - p->p_addr = (void *)td->td_kstack; lp->lwp_thread = td; td->td_proc = p; td->td_lwp = lp; @@ -908,7 +907,6 @@ pmap_init_proc(struct proc *p, struct thread *td) #ifdef SMP KKASSERT(td->td_mpcount == 1); #endif - bzero(p->p_addr, sizeof(*p->p_addr)); } /* @@ -919,8 +917,6 @@ void pmap_dispose_proc(struct proc *p) { KASSERT(p->p_lock == 0, ("attempt to dispose referenced proc! %p", p)); - - p->p_addr = NULL; } /*************************************************** diff --git a/sys/platform/pc32/i386/trap.c b/sys/platform/pc32/i386/trap.c index 68cb094d33..f0568d51de 100644 --- a/sys/platform/pc32/i386/trap.c +++ b/sys/platform/pc32/i386/trap.c @@ -36,7 +36,7 @@ * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 * $FreeBSD: src/sys/i386/i386/trap.c,v 1.147.2.11 2003/02/27 19:09:59 luoqi Exp $ - * $DragonFly: src/sys/platform/pc32/i386/trap.c,v 1.101 2007/02/24 14:25:07 corecode Exp $ + * $DragonFly: src/sys/platform/pc32/i386/trap.c,v 1.102 2007/02/25 23:17:13 corecode Exp $ */ /* @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/platform/vkernel/i386/genassym.c b/sys/platform/vkernel/i386/genassym.c index 59fe3205d8..576ee04406 100644 --- a/sys/platform/vkernel/i386/genassym.c +++ b/sys/platform/vkernel/i386/genassym.c @@ -35,7 +35,7 @@ * * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.86.2.3 2002/03/03 05:42:49 nyan Exp $ - * $DragonFly: src/sys/platform/vkernel/i386/genassym.c,v 1.56 2007/02/16 23:11:40 corecode Exp $ + * $DragonFly: src/sys/platform/vkernel/i386/genassym.c,v 1.57 2007/02/25 23:17:13 corecode Exp $ */ #include @@ -74,7 +74,6 @@ ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); -ASSYM(P_ADDR, offsetof(struct proc, p_addr)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); diff --git a/sys/platform/vkernel/i386/trap.c b/sys/platform/vkernel/i386/trap.c index 8960df9ea8..d97c9909a1 100644 --- a/sys/platform/vkernel/i386/trap.c +++ b/sys/platform/vkernel/i386/trap.c @@ -36,7 +36,7 @@ * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 * $FreeBSD: src/sys/i386/i386/trap.c,v 1.147.2.11 2003/02/27 19:09:59 luoqi Exp $ - * $DragonFly: src/sys/platform/vkernel/i386/trap.c,v 1.20 2007/02/24 14:25:07 corecode Exp $ + * $DragonFly: src/sys/platform/vkernel/i386/trap.c,v 1.21 2007/02/25 23:17:13 corecode Exp $ */ /* @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/platform/vkernel/platform/pmap.c b/sys/platform/vkernel/platform/pmap.c index 29a6f01e05..224dce5b5e 100644 --- a/sys/platform/vkernel/platform/pmap.c +++ b/sys/platform/vkernel/platform/pmap.c @@ -38,7 +38,7 @@ * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/i386/pmap.c,v 1.250.2.18 2002/03/06 22:48:53 silby Exp $ - * $DragonFly: src/sys/platform/vkernel/platform/pmap.c,v 1.18 2007/02/24 14:25:07 corecode Exp $ + * $DragonFly: src/sys/platform/vkernel/platform/pmap.c,v 1.19 2007/02/25 23:17:13 corecode Exp $ */ /* * NOTE: PMAP_INVAL_ADD: In pc32 this function is called prior to adjusting @@ -857,7 +857,6 @@ pmap_init_proc(struct proc *p, struct thread *td) { struct lwp *lp = ONLY_LWP_IN_PROC(p); - p->p_addr = (void *)td->td_kstack; lp->lwp_thread = td; td->td_proc = p; td->td_lwp = lp; @@ -865,7 +864,6 @@ pmap_init_proc(struct proc *p, struct thread *td) #ifdef SMP KKASSERT(td->td_mpcount == 1); #endif - bzero(p->p_addr, sizeof(*p->p_addr)); } /* @@ -876,8 +874,6 @@ void pmap_dispose_proc(struct proc *p) { KASSERT(p->p_lock == 0, ("attempt to dispose referenced proc! %p", p)); - - p->p_addr = NULL; } /* diff --git a/sys/sys/ckpt.h b/sys/sys/ckpt.h index 145a8fdb6b..393ac50352 100644 --- a/sys/sys/ckpt.h +++ b/sys/sys/ckpt.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/ckpt.h,v 1.9 2006/12/23 00:27:03 swildner Exp $ + * $DragonFly: src/sys/sys/ckpt.h,v 1.10 2007/02/25 23:17:13 corecode Exp $ */ #ifndef _SYS_CKPT_H_ #define _SYS_CKPT_H_ @@ -74,7 +74,6 @@ struct ckpt_fileinfo { struct ckpt_siginfo { int csi_ckptpisz; - struct procsig csi_procsig; struct sigacts csi_sigacts; struct itimerval csi_itimerval; int csi_sigparent; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index bd9d584d4c..ffce3a6317 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -37,7 +37,7 @@ * * @(#)proc.h 8.15 (Berkeley) 5/19/95 * $FreeBSD: src/sys/sys/proc.h,v 1.99.2.9 2003/06/06 20:21:32 tegge Exp $ - * $DragonFly: src/sys/sys/proc.h,v 1.102 2007/02/24 14:25:07 corecode Exp $ + * $DragonFly: src/sys/sys/proc.h,v 1.103 2007/02/25 23:17:13 corecode Exp $ */ #ifndef _SYS_PROC_H_ @@ -70,6 +70,7 @@ #include #include #include /* Machine-dependent proc substruct. */ +#include LIST_HEAD(proclist, proc); LIST_HEAD(lwplist, lwp); @@ -99,14 +100,6 @@ struct pgrp { struct lock pg_lock; /* Lock during fork */ }; -struct procsig { - sigset_t ps_sigignore; /* Signals being ignored. */ - sigset_t ps_sigcatch; /* Signals being caught by user. */ - int ps_flag; - struct sigacts *ps_sigacts; - int ps_refcnt; -}; - #define PS_NOCLDWAIT 0x0001 /* No zombies if child dies */ #define PS_NOCLDSTOP 0x0002 /* No SIGCHLD when children stop. */ @@ -222,10 +215,9 @@ struct proc { struct plimit *p_limit; /* Process limits. */ struct pstats *p_stats; void *p_pad0; - struct procsig *p_procsig; -#define p_sigacts p_procsig->ps_sigacts -#define p_sigignore p_procsig->ps_sigignore -#define p_sigcatch p_procsig->ps_sigcatch + struct sigacts *p_sigacts; +#define p_sigignore p_sigacts->ps_sigignore +#define p_sigcatch p_sigacts->ps_sigcatch #define p_rlimit p_limit->pl_rlimit int p_flag; /* P_* flags. */ @@ -293,8 +285,7 @@ struct proc { struct rtprio p_rtprio; /* Realtime priority. */ struct pargs *p_args; /* End area that is copied on creation. */ -#define p_endcopy p_addr - struct user *p_addr; /* Kernel virtual addr of u-area (PROC ONLY) XXX lwp */ +#define p_endcopy p_xstat u_short p_xstat; /* Exit status or last stop signal */ u_short p_acflag; /* Accounting flags. */ diff --git a/sys/sys/signal2.h b/sys/sys/signal2.h new file mode 100644 index 0000000000..fafc100069 --- /dev/null +++ b/sys/sys/signal2.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)signalvar.h 8.6 (Berkeley) 2/19/95 + * $FreeBSD: src/sys/sys/signalvar.h,v 1.34.2.1 2000/05/16 06:58:05 dillon Exp $ + * $DragonFly: src/sys/sys/signal2.h,v 1.1 2007/02/25 23:17:13 corecode Exp $ + */ + +#ifndef _SYS_SIGNAL2_H +#define _SYS_SIGNAL2_H + +#include + +/* + * Inline functions: + */ +/* + * Determine which signals are pending for a lwp. + */ +static __inline sigset_t +lwp_sigpend(struct lwp *lp) +{ + sigset_t set; + + set = lp->lwp_proc->p_siglist; + SIGSETOR(set, lp->lwp_siglist); + return (set); +} + +/* + * Mark a signal as handled by the lwp. + */ +static __inline void +lwp_delsig(struct lwp *lp, int sig) +{ + SIGDELSET(lp->lwp_siglist, sig); + SIGDELSET(lp->lwp_proc->p_siglist, sig); +} + +#define CURSIG(lp) __cursig(lp) +#define CURSIGNB(lp) __cursignb(lp) + +/* + * 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 lwp *lp) +{ + struct proc *p; + sigset_t tmpset; + int r; + + p = lp->lwp_proc; + tmpset = lwp_sigpend(lp); + SIGSETNAND(tmpset, lp->lwp_sigmask); + if (!(p->p_flag & P_TRACED) && SIGISEMPTY(tmpset)) + return(0); + r = issignal(lp); + return(r); +} + +static __inline +int +__cursignb(struct lwp *lp) +{ + struct proc *p; + sigset_t tmpset; + + p = lp->lwp_proc; + tmpset = lwp_sigpend(lp); + SIGSETNAND(tmpset, lp->lwp_sigmask); + if ((!(p->p_flag & P_TRACED) && SIGISEMPTY(tmpset))) { + return(FALSE); + } + return (TRUE); +} + +#endif diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index 0d60fe7145..9fbdcc5eb4 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -32,7 +32,7 @@ * * @(#)signalvar.h 8.6 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/signalvar.h,v 1.34.2.1 2000/05/16 06:58:05 dillon Exp $ - * $DragonFly: src/sys/sys/signalvar.h,v 1.21 2007/02/24 14:25:07 corecode Exp $ + * $DragonFly: src/sys/sys/signalvar.h,v 1.22 2007/02/25 23:17:13 corecode Exp $ */ #ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */ @@ -59,8 +59,10 @@ * (not necessarily resident). */ struct sigacts { - sig_t ps_sigact[_SIG_MAXSIG]; /* disposition of signals */ + sig_t ps_sigact[_SIG_MAXSIG]; /* disposition of signals */ sigset_t ps_catchmask[_SIG_MAXSIG]; /* signals to be blocked */ + sigset_t ps_sigignore; /* Signals being ignored. */ + sigset_t ps_sigcatch; /* Signals being caught by user. */ sigset_t ps_sigonstack; /* signals to take on sigstack */ sigset_t ps_sigintr; /* signals that interrupt syscalls */ sigset_t ps_sigreset; /* signals that reset when caught */ @@ -68,6 +70,8 @@ struct sigacts { sigset_t ps_siginfo; /* signals that want SA_SIGINFO args */ sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */ sigset_t ps_sigmailbox; /* signals that update a mailbox */ + int ps_refcnt; + int ps_flag; }; /* additional signal action values, used only temporarily/internally */ @@ -186,7 +190,6 @@ extern int sugid_coredump; /* Sysctl variable kern.sugid_coredump */ /* * Machine-independent functions: */ -void check_sigacts (void); void execsigs (struct proc *p); void gsignal (int pgid, int sig); int issignal (struct lwp *lp); @@ -200,7 +203,6 @@ void lwpsignal (struct proc *p, struct lwp *lp, int sig); void lwp_signotify (struct lwp *lp); void siginit (struct proc *p); void trapsignal (struct lwp *p, int sig, u_long code); -static int __cursig (struct lwp *p); /* * Machine-dependent functions: @@ -211,75 +213,6 @@ int fetchupcall (struct vmupcall *vu, int morepending, void *rsp); void sigexit (struct proc *p, int sig); int checkpoint_signal_handler(struct lwp *p); -/* - * Inline functions: - */ -/* - * Determine which signals are pending for a lwp. - */ -static __inline sigset_t -lwp_sigpend(struct lwp *lp) -{ - sigset_t set; - - set = lp->lwp_proc->p_siglist; - SIGSETOR(set, lp->lwp_siglist); - return (set); -} - -/* - * Mark a signal as handled by the lwp. - */ -static __inline void -lwp_delsig(struct lwp *lp, int sig) -{ - SIGDELSET(lp->lwp_siglist, sig); - SIGDELSET(lp->lwp_proc->p_siglist, sig); -} - -#define CURSIG(lp) __cursig(lp) -#define CURSIGNB(lp) __cursignb(lp) - -/* - * 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 lwp *lp) -{ - struct proc *p; - sigset_t tmpset; - int r; - - p = lp->lwp_proc; - tmpset = lwp_sigpend(lp); - SIGSETNAND(tmpset, lp->lwp_sigmask); - if (!(p->p_flag & P_TRACED) && SIGISEMPTY(tmpset)) - return(0); - r = issignal(lp); - return(r); -} - -static __inline -int -__cursignb(struct lwp *lp) -{ - struct proc *p; - sigset_t tmpset; - - p = lp->lwp_proc; - tmpset = lwp_sigpend(lp); - SIGSETNAND(tmpset, lp->lwp_sigmask); - if ((!(p->p_flag & P_TRACED) && SIGISEMPTY(tmpset))) { - return(FALSE); - } - return (TRUE); -} - #endif /* _KERNEL */ #endif /* !_SYS_SIGNALVAR_H_ */ diff --git a/sys/sys/user.h b/sys/sys/user.h index e0a1fec0c1..25af87eea4 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -32,7 +32,7 @@ * * @(#)user.h 8.2 (Berkeley) 9/23/93 * $FreeBSD: src/sys/sys/user.h,v 1.24.2.1 2001/10/11 08:20:18 peter Exp $ - * $DragonFly: src/sys/sys/user.h,v 1.17 2007/02/01 10:33:26 corecode Exp $ + * $DragonFly: src/sys/sys/user.h,v 1.18 2007/02/25 23:17:13 corecode Exp $ */ #ifndef _SYS_USER_H_ @@ -101,16 +101,4 @@ #endif #include -/* - * Per process structure containing data that isn't needed in core - * when the process isn't running (esp. when swapped out). - */ -struct user { - struct sigacts u_sigacts; /* p_sigacts points here (use it!) */ - /* - * Remaining fields for a.out core dumps - not valid at other times! - */ - struct kinfo_proc u_kproc; /* proc + eproc */ -}; - #endif diff --git a/sys/vfs/mfs/mfs_vfsops.c b/sys/vfs/mfs/mfs_vfsops.c index 2306555014..02b9b92b13 100644 --- a/sys/vfs/mfs/mfs_vfsops.c +++ b/sys/vfs/mfs/mfs_vfsops.c @@ -32,7 +32,7 @@ * * @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95 * $FreeBSD: src/sys/ufs/mfs/mfs_vfsops.c,v 1.81.2.3 2001/07/04 17:35:21 tegge Exp $ - * $DragonFly: src/sys/vfs/mfs/mfs_vfsops.c,v 1.37 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/vfs/mfs/mfs_vfsops.c,v 1.38 2007/02/25 23:17:13 corecode Exp $ */ @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/vfs/nfs/nfs_socket.c b/sys/vfs/nfs/nfs_socket.c index 5daac50184..68ce06188d 100644 --- a/sys/vfs/nfs/nfs_socket.c +++ b/sys/vfs/nfs/nfs_socket.c @@ -35,7 +35,7 @@ * * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 * $FreeBSD: src/sys/nfs/nfs_socket.c,v 1.60.2.6 2003/03/26 01:44:46 alfred Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_socket.c,v 1.41 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_socket.c,v 1.42 2007/02/25 23:17:13 corecode Exp $ */ /* @@ -61,6 +61,7 @@ #include #include #include +#include #include #include diff --git a/sys/vfs/procfs/procfs_ctl.c b/sys/vfs/procfs/procfs_ctl.c index 90f7b2a3d7..589c0b61e2 100644 --- a/sys/vfs/procfs/procfs_ctl.c +++ b/sys/vfs/procfs/procfs_ctl.c @@ -38,7 +38,7 @@ * * From: * $FreeBSD: src/sys/miscfs/procfs/procfs_ctl.c,v 1.20.2.2 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_ctl.c,v 1.14 2007/02/22 15:50:50 corecode Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_ctl.c,v 1.15 2007/02/25 23:17:13 corecode Exp $ */ #include @@ -47,6 +47,7 @@ #include #include #include +#include #include #include diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 6166060034..d0de59ec12 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -60,7 +60,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/vm_glue.c,v 1.94.2.4 2003/01/13 22:51:17 dillon Exp $ - * $DragonFly: src/sys/vm/vm_glue.c,v 1.51 2007/02/19 01:14:24 corecode Exp $ + * $DragonFly: src/sys/vm/vm_glue.c,v 1.52 2007/02/25 23:17:13 corecode Exp $ */ #include "opt_vm.h" @@ -226,7 +226,6 @@ vsunlock(caddr_t addr, u_int len) void vm_fork(struct lwp *lp1, struct proc *p2, int flags) { - struct user *up; struct proc *p1 = lp1->lwp_proc; struct thread *td2; @@ -268,23 +267,6 @@ vm_fork(struct lwp *lp1, struct proc *p2, int flags) lwkt_setpri(td2, TDPRI_KERN_USER); lwkt_set_comm(td2, "%s", p1->p_comm); - up = p2->p_addr; - - /* - * p_stats currently points at fields in the user struct - * but not at &u, instead at p_addr. Copy parts of - * p_stats; zero the rest of p_stats (statistics). - * - * If procsig->ps_refcnt is 1 and p2->p_sigacts is NULL we dont' need - * to share sigacts, so we use the up->u_sigacts. - */ - if (p2->p_sigacts == NULL) { - if (p2->p_procsig->ps_refcnt != 1) - kprintf ("PID:%d NULL sigacts with refcnt not 1!\n",p2->p_pid); - p2->p_sigacts = &up->u_sigacts; - up->u_sigacts = *p1->p_sigacts; - } - /* * cpu_fork will copy and update the pcb, set up the kernel stack, * and make the child ready to run.