From owner-p4-projects Tue Oct 29 11: 3:40 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B6BCE37B401; Tue, 29 Oct 2002 11:03:09 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 420E037B404 for ; Tue, 29 Oct 2002 11:03:09 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE53743E77 for ; Tue, 29 Oct 2002 11:03:07 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9TJ1vmV043407 for ; Tue, 29 Oct 2002 11:01:57 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9TJ1tux043404 for perforce@freebsd.org; Tue, 29 Oct 2002 11:01:55 -0800 (PST) Date: Tue, 29 Oct 2002 11:01:55 -0800 (PST) Message-Id: <200210291901.g9TJ1tux043404@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 20357 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=20357 Change 20357 by jhb@jhb_laptop on 2002/10/29 11:01:41 IFC @20355. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/locore.s#6 integrate .. //depot/projects/smpng/sys/alpha/alpha/machdep.c#49 integrate .. //depot/projects/smpng/sys/alpha/include/md_var.h#7 integrate .. //depot/projects/smpng/sys/alpha/include/sigframe.h#4 integrate .. //depot/projects/smpng/sys/alpha/include/signal.h#5 integrate .. //depot/projects/smpng/sys/alpha/include/ucontext.h#3 integrate .. //depot/projects/smpng/sys/alpha/osf1/osf1_signal.c#13 integrate .. //depot/projects/smpng/sys/conf/files#54 integrate .. //depot/projects/smpng/sys/conf/files.pc98#33 integrate .. //depot/projects/smpng/sys/conf/options#40 integrate .. //depot/projects/smpng/sys/ddb/db_examine.c#4 integrate .. //depot/projects/smpng/sys/dev/ciss/ciss.c#8 integrate .. //depot/projects/smpng/sys/dev/ciss/cissvar.h#4 integrate .. //depot/projects/smpng/sys/dev/gem/if_gem.c#8 integrate .. //depot/projects/smpng/sys/dev/mii/bmtphy.c#2 integrate .. //depot/projects/smpng/sys/dev/mii/brgphy.c#11 integrate .. //depot/projects/smpng/sys/dev/mii/e1000phy.c#5 integrate .. //depot/projects/smpng/sys/dev/mii/inphy.c#4 integrate .. //depot/projects/smpng/sys/dev/mii/nsgphy.c#7 integrate .. //depot/projects/smpng/sys/dev/mii/pnaphy.c#7 integrate .. //depot/projects/smpng/sys/dev/mii/tdkphy.c#8 integrate .. //depot/projects/smpng/sys/dev/mii/xmphy.c#7 integrate .. //depot/projects/smpng/sys/dev/raidframe/rf_types.h#2 integrate .. //depot/projects/smpng/sys/dev/rc/rc.c#2 integrate .. //depot/projects/smpng/sys/dev/tx/if_tx.c#5 integrate .. //depot/projects/smpng/sys/dev/tx/if_txvar.h#4 integrate .. //depot/projects/smpng/sys/fs/devfs/devfs_vnops.c#22 integrate .. //depot/projects/smpng/sys/fs/fdescfs/fdesc_vnops.c#9 integrate .. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_conv.c#3 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs.c#7 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs.h#10 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs_mac.c#2 delete .. //depot/projects/smpng/sys/fs/pseudofs/pseudofs.h#15 integrate .. //depot/projects/smpng/sys/fs/pseudofs/pseudofs_vnops.c#21 integrate .. //depot/projects/smpng/sys/geom/bde/g_bde_crypt.c#2 integrate .. //depot/projects/smpng/sys/geom/geom.h#14 integrate .. //depot/projects/smpng/sys/geom/geom_bsd.c#15 integrate .. //depot/projects/smpng/sys/geom/geom_dev.c#13 integrate .. //depot/projects/smpng/sys/geom/geom_disk.c#13 integrate .. //depot/projects/smpng/sys/geom/geom_dump.c#10 integrate .. //depot/projects/smpng/sys/geom/geom_int.h#5 integrate .. //depot/projects/smpng/sys/geom/geom_kern.c#7 integrate .. //depot/projects/smpng/sys/geom/geom_mbr.c#12 integrate .. //depot/projects/smpng/sys/geom/geom_pc98.c#8 integrate .. //depot/projects/smpng/sys/geom/geom_slice.c#10 integrate .. //depot/projects/smpng/sys/geom/geom_sunlabel.c#12 integrate .. //depot/projects/smpng/sys/i386/conf/NOTES#46 integrate .. //depot/projects/smpng/sys/i386/i386/genassym.c#17 integrate .. //depot/projects/smpng/sys/i386/i386/locore.s#10 integrate .. //depot/projects/smpng/sys/i386/i386/machdep.c#49 integrate .. //depot/projects/smpng/sys/i386/include/md_var.h#14 integrate .. //depot/projects/smpng/sys/i386/include/proc.h#10 integrate .. //depot/projects/smpng/sys/i386/include/sigframe.h#4 integrate .. //depot/projects/smpng/sys/i386/include/signal.h#6 integrate .. //depot/projects/smpng/sys/i386/include/ucontext.h#5 integrate .. //depot/projects/smpng/sys/i386/isa/npx.c#28 integrate .. //depot/projects/smpng/sys/i386/isa/spkr.c#7 integrate .. //depot/projects/smpng/sys/ia64/conf/GENERIC#24 integrate .. //depot/projects/smpng/sys/ia64/ia64/interrupt.c#15 integrate .. //depot/projects/smpng/sys/ia64/ia64/locore.s#13 integrate .. //depot/projects/smpng/sys/ia64/ia64/machdep.c#47 integrate .. //depot/projects/smpng/sys/ia64/ia64/mp_machdep.c#17 integrate .. //depot/projects/smpng/sys/ia64/ia64/sapic.c#10 integrate .. //depot/projects/smpng/sys/ia64/include/cpufunc.h#14 integrate .. //depot/projects/smpng/sys/ia64/include/intrcnt.h#2 integrate .. //depot/projects/smpng/sys/ia64/include/sigframe.h#3 integrate .. //depot/projects/smpng/sys/ia64/include/signal.h#7 integrate .. //depot/projects/smpng/sys/kern/init_sysent.c#21 integrate .. //depot/projects/smpng/sys/kern/kern_descrip.c#38 integrate .. //depot/projects/smpng/sys/kern/kern_mac.c#7 integrate .. //depot/projects/smpng/sys/kern/kern_shutdown.c#30 integrate .. //depot/projects/smpng/sys/kern/kern_sig.c#48 integrate .. //depot/projects/smpng/sys/kern/kern_sysctl.c#24 integrate .. //depot/projects/smpng/sys/kern/kern_thread.c#11 integrate .. //depot/projects/smpng/sys/kern/makesyscalls.sh#13 integrate .. //depot/projects/smpng/sys/kern/subr_prf.c#21 integrate .. //depot/projects/smpng/sys/kern/subr_trap.c#41 integrate .. //depot/projects/smpng/sys/kern/syscalls.c#21 integrate .. //depot/projects/smpng/sys/kern/syscalls.master#20 integrate .. //depot/projects/smpng/sys/kern/uipc_socket.c#28 integrate .. //depot/projects/smpng/sys/kern/uipc_usrreq.c#24 integrate .. //depot/projects/smpng/sys/kern/vfs_aio.c#29 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#7 integrate .. //depot/projects/smpng/sys/kern/vfs_subr.c#37 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#48 integrate .. //depot/projects/smpng/sys/modules/ciss/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/em/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/procfs/Makefile#5 integrate .. //depot/projects/smpng/sys/net/if_tun.c#18 integrate .. //depot/projects/smpng/sys/netinet/in.h#17 integrate .. //depot/projects/smpng/sys/netinet/ip_divert.c#21 integrate .. //depot/projects/smpng/sys/netinet/ip_fw2.c#7 integrate .. //depot/projects/smpng/sys/netinet/raw_ip.c#23 integrate .. //depot/projects/smpng/sys/pc98/i386/machdep.c#44 integrate .. //depot/projects/smpng/sys/posix4/posix4_mib.c#3 integrate .. //depot/projects/smpng/sys/powerpc/include/signal.h#3 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#28 integrate .. //depot/projects/smpng/sys/security/mac_biba/mac_biba.c#7 integrate .. //depot/projects/smpng/sys/security/mac_biba/mac_biba.h#3 integrate .. //depot/projects/smpng/sys/security/mac_mls/mac_mls.c#7 integrate .. //depot/projects/smpng/sys/security/mac_mls/mac_mls.h#3 integrate .. //depot/projects/smpng/sys/security/mac_none/mac_none.c#4 integrate .. //depot/projects/smpng/sys/security/mac_test/mac_test.c#4 integrate .. //depot/projects/smpng/sys/sparc64/conf/GENERIC#23 integrate .. //depot/projects/smpng/sys/sparc64/include/signal.h#7 integrate .. //depot/projects/smpng/sys/sparc64/include/tick.h#3 integrate .. //depot/projects/smpng/sys/sparc64/include/trap.h#8 integrate .. //depot/projects/smpng/sys/sparc64/include/utrap.h#2 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/exception.S#5 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/iommu.c#8 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#38 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/rwindow.c#7 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/tick.c#8 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/trap.c#42 integrate .. //depot/projects/smpng/sys/sys/_sigset.h#3 integrate .. //depot/projects/smpng/sys/sys/mac.h#6 integrate .. //depot/projects/smpng/sys/sys/mac_policy.h#6 integrate .. //depot/projects/smpng/sys/sys/proc.h#65 integrate .. //depot/projects/smpng/sys/sys/signal.h#10 integrate .. //depot/projects/smpng/sys/sys/signalvar.h#12 integrate .. //depot/projects/smpng/sys/sys/sun_disklabel.h#2 integrate .. //depot/projects/smpng/sys/sys/syscall.h#21 integrate .. //depot/projects/smpng/sys/sys/syscall.mk#21 integrate .. //depot/projects/smpng/sys/sys/syscallsubr.h#3 integrate .. //depot/projects/smpng/sys/sys/syslimits.h#3 integrate .. //depot/projects/smpng/sys/sys/sysproto.h#23 integrate .. //depot/projects/smpng/sys/sys/ucontext.h#5 integrate .. //depot/projects/smpng/sys/sys/unistd.h#9 integrate .. //depot/projects/smpng/sys/sys/vnode.h#28 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_vfsops.c#34 integrate .. //depot/projects/smpng/sys/ufs/ufs/ufs_vnops.c#23 integrate .. //depot/projects/smpng/sys/vm/vm_swap.c#17 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/locore.s#6 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/alpha/locore.s,v 1.21 2002/02/07 20:58:42 julian Exp $ + * $FreeBSD: src/sys/alpha/alpha/locore.s,v 1.22 2002/10/25 19:10:55 peter Exp $ */ /* @@ -53,6 +53,8 @@ * rights to redistribute these changes. */ +#include "opt_compat.h" + #include #include #include @@ -190,15 +192,55 @@ jsr ra, (t12) /* call the signal handler (t12==pv) */ ldq a0, 0(sp) /* get the sigcontext pointer */ lda sp, 16(sp) - CALLSYS_NOERROR(sigreturn) /* and call sigreturn() with it. */ + ldiq v0, SYS_sigreturn + call_pal PAL_OSF1_callsys /* and call sigreturn() with it. */ mov v0, a0 /* if that failed, get error code */ - CALLSYS_NOERROR(exit) /* and call exit() with it. */ -XNESTED(esigcode,0) + ldiq v0, SYS_exit + call_pal PAL_OSF1_callsys /* and call exit() with it. */ END(sigcode) +#ifdef COMPAT_43 +NESTED(osigcode,0,0,ra,0,0) + lda sp, -16(sp) /* save the sigcontext pointer */ + stq a2, 0(sp) + jsr ra, (t12) /* call the signal handler (t12==pv) */ + ldq a0, 0(sp) /* get the sigcontext pointer */ + lda sp, 16(sp) + ldiq v0, 103 /* Old 3.x SYS_sigreturn */ + call_pal PAL_OSF1_callsys /* and call sigreturn() with it. */ + mov v0, a0 /* if that failed, get error code */ + ldiq v0, SYS_exit + call_pal PAL_OSF1_callsys /* and call exit() with it. */ + END(osigcode) +#endif + +#ifdef COMPAT_FREEBSD4 +NESTED(freebsd4_sigcode,0,0,ra,0,0) + lda sp, -16(sp) /* save the sigcontext pointer */ + stq a2, 0(sp) + jsr ra, (t12) /* call the signal handler (t12==pv) */ + ldq a0, 0(sp) /* get the sigcontext pointer */ + lda sp, 16(sp) + ldiq v0, 344 /* Old 4.x SYS_sigreturn */ + call_pal PAL_OSF1_callsys /* and call sigreturn() with it. */ + mov v0, a0 /* if that failed, get error code */ + ldiq v0, SYS_exit + call_pal PAL_OSF1_callsys /* and call exit() with it. */ + END(freebsd4_sigcode) +#endif +EXPORT(esigcode) /* end of all sigcode */ + .data - EXPORT(szsigcode) - .quad esigcode-sigcode +EXPORT(szsigcode) + .long esigcode-sigcode +#ifdef COMPAT_43 +EXPORT(szosigcode) + .long esigcode-osigcode +#endif +#ifdef COMPAT_FREEBSD4 +EXPORT(szfreebsd4_sigcode) + .long esigcode-freebsd4_sigcode +#endif .text /**************************************************************************/ ==== //depot/projects/smpng/sys/alpha/alpha/machdep.c#49 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.186 2002/09/20 17:50:50 phk Exp $ + * $FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.187 2002/10/25 19:10:55 peter Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -232,6 +232,10 @@ #ifdef COMPAT_43 void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code); #endif +#ifdef COMPAT_FREEBSD4 +static void freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask, + u_long code); +#endif static void identifycpu(void); @@ -1250,7 +1254,7 @@ /* * Set up the registers to return to sigcode. */ - frame->tf_regs[FRAME_PC] = PS_STRINGS - (esigcode - sigcode); + frame->tf_regs[FRAME_PC] = PS_STRINGS - szosigcode; frame->tf_regs[FRAME_A0] = sig; frame->tf_regs[FRAME_FLAGS] = 0; /* full restore */ PROC_LOCK(p); @@ -1264,6 +1268,121 @@ } #endif +#ifdef COMPAT_FREEBSD4 +static void +freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +{ + struct proc *p; + struct thread *td; + struct trapframe *frame; + struct sigacts *psp; + struct sigframe4 sf, *sfp; + int oonstack, rndfsize; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + psp = p->p_sigacts; + + frame = td->td_frame; + oonstack = sigonstack(alpha_pal_rdusp()); + rndfsize = ((sizeof(sf) + 15) / 16) * 16; + + /* save user context */ + bzero(&sf, sizeof(sf)); + sf.sf_uc.uc_sigmask = *mask; + sf.sf_uc.uc_stack = p->p_sigstk; + sf.sf_uc.uc_stack.ss_flags = (p->p_flag & P_ALTSTACK) + ? ((oonstack) ? SS_ONSTACK : 0) : SS_DISABLE; + sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0; + + fill_regs(td, (struct reg *)sf.sf_uc.uc_mcontext.mc_regs); + sf.sf_uc.uc_mcontext.mc_regs[R_SP] = alpha_pal_rdusp(); + sf.sf_uc.uc_mcontext.mc_regs[R_ZERO] = 0xACEDBADE; /* magic number */ + sf.sf_uc.uc_mcontext.mc_regs[R_PS] = frame->tf_regs[FRAME_PS]; + sf.sf_uc.uc_mcontext.mc_regs[R_PC] = frame->tf_regs[FRAME_PC]; + sf.sf_uc.uc_mcontext.mc_regs[R_TRAPARG_A0] = + frame->tf_regs[FRAME_TRAPARG_A0]; + sf.sf_uc.uc_mcontext.mc_regs[R_TRAPARG_A1] = + frame->tf_regs[FRAME_TRAPARG_A1]; + sf.sf_uc.uc_mcontext.mc_regs[R_TRAPARG_A2] = + frame->tf_regs[FRAME_TRAPARG_A2]; + + /* + * Allocate and validate space for the signal handler + * context. Note that if the stack is in P0 space, the + * call to grow() is a nop, and the useracc() check + * will fail if the process has not already allocated + * the space with a `brk'. + */ + if ((p->p_flag & P_ALTSTACK) != 0 && !oonstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + sfp = (struct sigframe4 *)((caddr_t)p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - rndfsize); +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) + p->p_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else + sfp = (struct sigframe4 *)(alpha_pal_rdusp() - rndfsize); + PROC_UNLOCK(p); + + /* save the floating-point state, if necessary, then copy it. */ + alpha_fpstate_save(td, 1); + sf.sf_uc.uc_mcontext.mc_ownedfp = td->td_md.md_flags & MDTD_FPUSED; + bcopy(&td->td_pcb->pcb_fp, + (struct fpreg *)sf.sf_uc.uc_mcontext.mc_fpregs, + sizeof(struct fpreg)); + sf.sf_uc.uc_mcontext.mc_fp_control = td->td_pcb->pcb_fp_control; + +#ifdef COMPAT_OSF1 + /* + * XXX Create an OSF/1-style sigcontext and associated goo. + */ +#endif + + /* + * copy the frame out to userland. + */ + if (copyout((caddr_t)&sf, (caddr_t)sfp, sizeof(sf)) != 0) { + /* + * Process has trashed its stack; give it an illegal + * instruction to halt it in its tracks. + */ + PROC_LOCK(p); + SIGACTION(p, SIGILL) = SIG_DFL; + SIGDELSET(p->p_sigignore, SIGILL); + SIGDELSET(p->p_sigcatch, SIGILL); + SIGDELSET(p->p_sigmask, SIGILL); + psignal(p, SIGILL); + return; + } + + /* + * Set up the registers to return to sigcode. + */ + frame->tf_regs[FRAME_PC] = PS_STRINGS - szfreebsd4_sigcode; + frame->tf_regs[FRAME_A0] = sig; + PROC_LOCK(p); + if (SIGISMEMBER(p->p_sigacts->ps_siginfo, sig)) { + frame->tf_regs[FRAME_A1] = (u_int64_t)&(sfp->sf_si); + + /* Fill in POSIX parts */ + sf.sf_si.si_signo = sig; + sf.sf_si.si_code = code; + sf.sf_si.si_addr = (void*)frame->tf_regs[FRAME_TRAPARG_A0]; + sf.sf_si.si_pid = p->p_pid; + sf.sf_si.si_uid = p->p_ucred->cr_uid; + } + else + frame->tf_regs[FRAME_A1] = code; + + frame->tf_regs[FRAME_A2] = (u_int64_t)&(sfp->sf_uc); + frame->tf_regs[FRAME_T12] = (u_int64_t)catcher; /* t12 is pv */ + frame->tf_regs[FRAME_FLAGS] = 0; /* full restore */ + alpha_pal_wrusp((unsigned long)sfp); +} +#endif /* COMPAT_FREEBSD4 */ + void sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) { @@ -1278,6 +1397,12 @@ p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); psp = p->p_sigacts; +#ifdef COMPAT_FREEBSD4 + if (SIGISMEMBER(psp->ps_freebsd4, sig)) { + freebsd4_sendsig(catcher, sig, mask, code); + return; + } +#endif #ifdef COMPAT_43 if (SIGISMEMBER(psp->ps_osigset, sig)) { osendsig(catcher, sig, mask, code); @@ -1377,7 +1502,7 @@ /* * Set up the registers to return to sigcode. */ - frame->tf_regs[FRAME_PC] = PS_STRINGS - (esigcode - sigcode); + frame->tf_regs[FRAME_PC] = PS_STRINGS - szsigcode; frame->tf_regs[FRAME_A0] = sig; PROC_LOCK(p); if (SIGISMEMBER(p->p_sigacts->ps_siginfo, sig)) { @@ -1419,13 +1544,13 @@ * * MPSAFE */ +#ifdef COMPAT_43 int osigreturn(struct thread *td, struct osigreturn_args /* { struct osigcontext *sigcntxp; } */ *uap) { -#ifdef COMPAT_43 struct osigcontext *scp, ksc; struct proc *p = td->td_proc; @@ -1479,10 +1604,82 @@ sizeof(struct fpreg)); td->td_pcb->pcb_fp_control = ksc.sc_fp_control; return (EJUSTRETURN); -#else /* !COMPAT_43 */ - return (ENOSYS); +} #endif /* COMPAT_43 */ + +#ifdef COMPAT_FREEBSD4 +/* + * MPSAFE + */ +int +freebsd4_sigreturn(struct thread *td, + struct freebsd4_sigreturn_args /* { + const struct ucontext4 *sigcntxp; + } */ *uap) +{ + struct ucontext4 uc; + const struct ucontext4 *ucp; + struct pcb *pcb; + unsigned long val; + struct proc *p; + int error; + + ucp = uap->sigcntxp; + pcb = td->td_pcb; + p = td->td_proc; + + /* + * Fetch the entire context structure at once for speed. + * Note that struct osigcontext is smaller than a ucontext_t, + * so even if copyin() faults, we may have actually gotten a complete + * struct osigcontext. + */ + error = copyin(ucp, &uc, sizeof(ucontext_t)); + if (error != 0) { +#ifdef COMPAT_43 + if (((struct osigcontext*)&uc)->sc_regs[R_ZERO] == 0xACEDBADE) + return osigreturn(td, (struct osigreturn_args *)uap); +#endif + return (error); + } + +#ifdef COMPAT_43 + if (((struct osigcontext*)&uc)->sc_regs[R_ZERO] == 0xACEDBADE) + return osigreturn(td, (struct osigreturn_args *)uap); +#endif + + /* + * Restore the user-supplied information + */ + set_regs(td, (struct reg *)uc.uc_mcontext.mc_regs); + val = (uc.uc_mcontext.mc_regs[R_PS] | ALPHA_PSL_USERSET) & + ~ALPHA_PSL_USERCLR; + td->td_frame->tf_regs[FRAME_PS] = val; + td->td_frame->tf_regs[FRAME_PC] = uc.uc_mcontext.mc_regs[R_PC]; + td->td_frame->tf_regs[FRAME_FLAGS] = 0; /* full restore */ + alpha_pal_wrusp(uc.uc_mcontext.mc_regs[R_SP]); + + PROC_LOCK(p); +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) + if (uc.uc_mcontext.mc_onstack & 1) + p->p_sigstk.ss_flags |= SS_ONSTACK; + else + p->p_sigstk.ss_flags &= ~SS_ONSTACK; +#endif + + p->p_sigmask = uc.uc_sigmask; + SIG_CANTMASK(p->p_sigmask); + signotify(p); + PROC_UNLOCK(p); + + /* XXX ksc.sc_ownedfp ? */ + alpha_fpstate_drop(td); + bcopy((struct fpreg *)uc.uc_mcontext.mc_fpregs, + &td->td_pcb->pcb_fp, sizeof(struct fpreg)); + td->td_pcb->pcb_fp_control = uc.uc_mcontext.mc_fp_control; + return (EJUSTRETURN); } +#endif /* COMPAT_FREEBSD4 */ /* * MPSAFE @@ -1498,6 +1695,7 @@ struct pcb *pcb; unsigned long val; struct proc *p; + int error; ucp = uap->sigcntxp; pcb = td->td_pcb; @@ -1507,21 +1705,22 @@ if (sigdebug & SDB_FOLLOW) printf("sigreturn: pid %d, scp %p\n", p->p_pid, ucp); #endif - /* * Fetch the entire context structure at once for speed. * Note that struct osigcontext is smaller than a ucontext_t, * so even if copyin() faults, we may have actually gotten a complete * struct osigcontext. + * XXX we'll *still* be getting osigcontext's here due to longjmp(3) + * brain damage. */ - if (copyin(ucp, &uc, sizeof(ucontext_t))) { + error = copyin(ucp, &uc, sizeof(ucontext_t)); + if (error != 0) { #ifdef COMPAT_43 if (((struct osigcontext*)&uc)->sc_regs[R_ZERO] == 0xACEDBADE) return osigreturn(td, (struct osigreturn_args *)uap); #endif - return (EFAULT); + return (error); } - #ifdef COMPAT_43 if (((struct osigcontext*)&uc)->sc_regs[R_ZERO] == 0xACEDBADE) return osigreturn(td, (struct osigreturn_args *)uap); ==== //depot/projects/smpng/sys/alpha/include/md_var.h#7 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/include/md_var.h,v 1.20 2002/08/30 04:04:34 peter Exp $ + * $FreeBSD: src/sys/alpha/include/md_var.h,v 1.21 2002/10/25 19:10:55 peter Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -36,6 +36,12 @@ extern char sigcode[]; extern char esigcode[]; extern int szsigcode; +#ifdef COMPAT_43 +extern int szosigcode; +#endif +#ifdef COMPAT_FREEBSD4 +extern int szfreebsd4_sigcode; +#endif extern long Maxmem; extern int busdma_swi_pending; ==== //depot/projects/smpng/sys/alpha/include/sigframe.h#4 (text+ko) ==== @@ -25,16 +25,18 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/include/sigframe.h,v 1.3 2002/02/17 17:40:25 deischen Exp $ + * $FreeBSD: src/sys/alpha/include/sigframe.h,v 1.4 2002/10/25 19:10:55 peter Exp $ */ #ifndef _MACHINE_SIGFRAME_H_ #define _MACHINE_SIGFRAME_H_ 1 -#ifdef _KERNEL -struct osigframe { - struct osigcontext sf_sc; - osiginfo_t sf_si; +#if defined(_KERNEL) && defined(COMPAT_FREEBSD4) +/* FreeBSD 4.x */ +struct sigframe4 { + unsigned long __spare__; + struct ucontext4 sf_uc; + siginfo_t sf_si; }; #endif ==== //depot/projects/smpng/sys/alpha/include/signal.h#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/signal.h,v 1.9 2002/10/13 00:31:46 mike Exp $ */ +/* $FreeBSD: src/sys/alpha/include/signal.h,v 1.10 2002/10/25 19:10:55 peter Exp $ */ /* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */ /* @@ -47,7 +47,7 @@ /* * Only the kernel should need these old type definitions. */ -#ifdef _KERNEL +#if defined(_KERNEL) && defined(COMPAT_43) /* * Information pushed on stack when a signal is delivered. * This is used by the kernel to restore state following @@ -58,8 +58,6 @@ * Note that sc_regs[] and sc_fpregs[]+sc_fpcr are inline * representations of 'struct reg' and 'struct fpreg', respectively. */ -typedef unsigned int osigset_t; - struct osigcontext { long sc_onstack; /* sigstack state to restore */ long sc_mask; /* signal mask to restore */ ==== //depot/projects/smpng/sys/alpha/include/ucontext.h#3 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/include/ucontext.h,v 1.4 2002/01/10 02:36:30 deischen Exp $ + * $FreeBSD: src/sys/alpha/include/ucontext.h,v 1.5 2002/10/25 19:10:55 peter Exp $ */ #ifndef _MACHINE_UCONTEXT_H_ @@ -50,4 +50,16 @@ long __spare__[6]; } mcontext_t; +#if defined(_KERNEL) && defined(COMPAT_FREEBSD4) +struct mcontext4 { + long mc_onstack; /* XXX - sigcontext compat. */ + unsigned long mc_regs[37]; + unsigned long mc_fpregs[32]; + unsigned long mc_fpcr; + unsigned long mc_fp_control; + long mc_ownedfp; + long __spare__[7]; +}; +#endif + #endif /* !_MACHINE_UCONTEXT_H_ */ ==== //depot/projects/smpng/sys/alpha/osf1/osf1_signal.c#13 (text+ko) ==== @@ -30,9 +30,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/osf1/osf1_signal.c,v 1.22 2002/10/01 17:15:46 jmallett Exp $ + * $FreeBSD: src/sys/alpha/osf1/osf1_signal.c,v 1.23 2002/10/25 19:10:55 peter Exp $ */ +#include "opt_compat.h" +#ifndef COMPAT_43 +#error "COMPAT_OSF1 requires COMPAT_43" +#endif + #include #include #include @@ -101,7 +106,6 @@ #define osf1_sigismember(s, n) (*(s) & sigmask(n)) #define osf1_sigaddset(s, n) (*(s) |= sigmask(n)) - void osf1_to_bsd_sigset(oss, bss) const osf1_sigset_t *oss; @@ -747,9 +751,6 @@ return (EJUSTRETURN); } -extern int -osigstack(struct thread *td, struct osf1_osigstack_args *uap); - int osf1_osigstack(td, uap) register struct thread *td; @@ -761,5 +762,5 @@ /* uprintf("osf1_osigstack: oss = %p, nss = %p",uap->oss, uap->nss); uprintf(" stack ptr = %p\n",p->p_sigacts->ps_sigstk.ss_sp);*/ - return(osigstack(td, uap)); + return(osigstack(td, (struct osigstack_args *)uap)); } ==== //depot/projects/smpng/sys/conf/files#54 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.728 2002/10/24 19:05:03 jhb Exp $ +# $FreeBSD: src/sys/conf/files,v 1.729 2002/10/26 14:38:18 rwatson Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -829,7 +829,6 @@ fs/procfs/procfs_dbregs.c optional procfs fs/procfs/procfs_fpregs.c optional procfs fs/procfs/procfs_ioctl.c optional procfs -fs/procfs/procfs_mac.c optional procfs fs/procfs/procfs_map.c optional procfs fs/procfs/procfs_mem.c optional procfs fs/procfs/procfs_note.c optional procfs ==== //depot/projects/smpng/sys/conf/files.pc98#33 (text+ko) ==== @@ -3,7 +3,7 @@ # # modified for PC-9801 # -# $FreeBSD: src/sys/conf/files.pc98,v 1.251 2002/10/24 07:18:24 nyan Exp $ +# $FreeBSD: src/sys/conf/files.pc98,v 1.252 2002/10/26 20:17:59 phk Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -135,7 +135,6 @@ dev/syscons/scterm-dumb.c optional sc dev/syscons/scvidctl.c optional sc dev/syscons/sysmouse.c optional sc -geom/geom_mbr.c standard geom/geom_bsd.c standard geom/geom_pc98.c standard gnu/i386/fpemul/div_small.s optional gpl_math_emulate \ ==== //depot/projects/smpng/sys/conf/options#40 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.361 2002/10/24 17:21:40 rwatson Exp $ +# $FreeBSD: src/sys/conf/options,v 1.362 2002/10/25 19:10:55 peter Exp $ # # On the handling of kernel options # @@ -77,6 +77,7 @@ COMPAT_43 opt_compat.h COMPAT_FREEBSD4 opt_compat.h COMPAT_SUNOS opt_compat.h +NO_COMPAT_FREEBSD4 opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR CONSPEED opt_comconsole.h ==== //depot/projects/smpng/sys/ddb/db_examine.c#4 (text+ko) ==== @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $FreeBSD: src/sys/ddb/db_examine.c,v 1.29 2002/06/25 15:59:24 tmm Exp $ + * $FreeBSD: src/sys/ddb/db_examine.c,v 1.30 2002/10/25 19:41:32 mux Exp $ */ /* @@ -129,7 +129,7 @@ case 'z': /* signed hex */ value = db_get_value(addr, size, TRUE); addr += size; - db_printf("%-*lz", width, (long)value); + db_printf("%-*ly", width, (long)value); break; case 'd': /* signed decimal */ value = db_get_value(addr, size, TRUE); @@ -213,7 +213,7 @@ db_printf("%8lx", (unsigned long)addr); break; case 'z': - db_printf("%8lz", (long)addr); + db_printf("%8ly", (long)addr); break; case 'd': db_printf("%11ld", (long)addr); ==== //depot/projects/smpng/sys/dev/ciss/ciss.c#8 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.7 2002/09/28 17:14:26 phk Exp $ + * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.10 2002/10/27 12:27:04 mux Exp $ */ /* @@ -76,6 +76,7 @@ #include #include #include +#include #include #include @@ -426,6 +427,8 @@ /* flush adapter cache */ ciss_flush_adapter(sc); + destroy_dev(sc->ciss_dev_t); + /* release all resources */ ciss_free(sc); @@ -3145,7 +3148,7 @@ } /* DDB hook */ -void +static void ciss_print0(void) { struct ciss_softc *sc; ==== //depot/projects/smpng/sys/dev/ciss/cissvar.h#4 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ciss/cissvar.h,v 1.3 2001/12/10 08:09:41 obrien Exp $ + * $FreeBSD: src/sys/dev/ciss/cissvar.h,v 1.4 2002/10/27 12:27:04 mux Exp $ */ /* @@ -261,11 +261,11 @@ do { \ if (level <= CISS_DEBUG) printf("%s: called\n", __func__); \ } while(0) -# define debug_struct(s) printf(" SIZE %s: %d\n", #s, sizeof(struct s)) -# define debug_union(s) printf(" SIZE %s: %d\n", #s, sizeof(union s)) -# define debug_type(s) printf(" SIZE %s: %d\n", #s, sizeof(s)) +# define debug_struct(s) printf(" SIZE %s: %zu\n", #s, sizeof(struct s)) +# define debug_union(s) printf(" SIZE %s: %zu\n", #s, sizeof(union s)) +# define debug_type(s) printf(" SIZE %s: %zu\n", #s, sizeof(s)) # define debug_field(s, f) printf(" OFFSET %s.%s: %d\n", #s, #f, ((int)&(((struct s *)0)->f))) -# define debug_const(c) printf(" CONST %s %d/0x%x\n", #c, c, c); +# define debug_const(c) printf(" CONST %s %jd/0x%jx\n", #c, (intmax_t)c, (intmax_t)c); #else # define debug(level, fmt, args...) # define debug_called(level) ==== //depot/projects/smpng/sys/dev/gem/if_gem.c#8 (text+ko) ==== @@ -25,7 +25,7 @@ * * from: NetBSD: gem.c,v 1.21 2002/06/01 23:50:58 lukem Exp * - * $FreeBSD: src/sys/dev/gem/if_gem.c,v 1.7 2002/07/24 01:09:38 jake Exp $ + * $FreeBSD: src/sys/dev/gem/if_gem.c,v 1.8 2002/10/26 12:32:07 tmm Exp $ */ /* @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -1224,12 +1225,14 @@ break; } - if (m != NULL) - m_freem(m0); - /* * WE ARE NOW COMMITTED TO TRANSMITTING THE PACKET. */ + if (ifp->if_bpf != NULL) + bpf_mtap(ifp, m0); + + if (m != NULL) + m_freem(m0); #ifdef GEM_DEBUG if (ifp->if_flags & IFF_DEBUG) { ==== //depot/projects/smpng/sys/dev/mii/bmtphy.c#2 (text+ko) ==== @@ -65,7 +65,7 @@ * * from: NetBSD: bmtphy.c,v 1.8 2002/07/03 06:25:50 simonb Exp * - * $FreeBSD: src/sys/dev/mii/bmtphy.c,v 1.1 2002/07/05 11:07:24 benno Exp $ + * $FreeBSD: src/sys/dev/mii/bmtphy.c,v 1.2 2002/10/29 00:20:47 semenu Exp $ */ /* @@ -77,7 +77,6 @@ #include #include #include -#include #include #include ==== //depot/projects/smpng/sys/dev/mii/brgphy.c#11 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mii/brgphy.c,v 1.15 2002/10/14 22:31:52 alfred Exp $ + * $FreeBSD: src/sys/dev/mii/brgphy.c,v 1.16 2002/10/29 00:20:47 semenu Exp $ */ /* @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -59,7 +58,7 @@ #if !defined(lint) static const char rcsid[] = - "$FreeBSD: src/sys/dev/mii/brgphy.c,v 1.15 2002/10/14 22:31:52 alfred Exp $"; + "$FreeBSD: src/sys/dev/mii/brgphy.c,v 1.16 2002/10/29 00:20:47 semenu Exp $"; #endif static int brgphy_probe(device_t); ==== //depot/projects/smpng/sys/dev/mii/e1000phy.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mii/e1000phy.c,v 1.6 2002/05/04 11:00:30 phk Exp $ */ +/* $FreeBSD: src/sys/dev/mii/e1000phy.c,v 1.7 2002/10/29 00:20:47 semenu Exp $ */ /* * Principal Author: Parag Patel * Copyright (c) 2001 @@ -37,7 +37,6 @@ #include #include #include -#include #include #include ==== //depot/projects/smpng/sys/dev/mii/inphy.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mii/inphy.c,v 1.9 2002/04/29 13:07:31 phk Exp $ + * $FreeBSD: src/sys/dev/mii/inphy.c,v 1.10 2002/10/29 00:20:47 semenu Exp $ */ /* @@ -36,7 +36,6 @@ #include #include #include -#include #include #include ==== //depot/projects/smpng/sys/dev/mii/nsgphy.c#7 (text+ko) ==== @@ -36,7 +36,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mii/nsgphy.c,v 1.11 2002/10/14 22:31:52 alfred Exp $ + * $FreeBSD: src/sys/dev/mii/nsgphy.c,v 1.12 2002/10/29 00:20:47 semenu Exp $ */ /* @@ -56,7 +56,6 @@ #include #include #include -#include #include #include @@ -75,7 +74,7 @@ #if !defined(lint) static const char rcsid[] = - "$FreeBSD: src/sys/dev/mii/nsgphy.c,v 1.11 2002/10/14 22:31:52 alfred Exp $"; + "$FreeBSD: src/sys/dev/mii/nsgphy.c,v 1.12 2002/10/29 00:20:47 semenu Exp $"; #endif static int nsgphy_probe(device_t); ==== //depot/projects/smpng/sys/dev/mii/pnaphy.c#7 (text+ko) ==== @@ -30,7 +30,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mii/pnaphy.c,v 1.9 2002/10/14 22:31:52 alfred Exp $ + * $FreeBSD: src/sys/dev/mii/pnaphy.c,v 1.10 2002/10/29 00:20:47 semenu Exp $ */ /* >>> TRUNCATED FOR MAIL (1000 lines) <<< To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message