Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2002 02:35:10 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 14021 for review
Message-ID:  <200207100935.g6A9ZAL7011052@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14021

Change 14021 by peter@peter_daintree on 2002/07/10 02:34:53

	IFC @14019

Affected files ...

.. //depot/projects/pmap/sys/conf/majors#5 integrate
.. //depot/projects/pmap/sys/dev/syscons/syscons.c#4 integrate
.. //depot/projects/pmap/sys/dev/syscons/syscons.h#3 integrate
.. //depot/projects/pmap/sys/dev/usb/ucom.c#2 integrate
.. //depot/projects/pmap/sys/dev/usb/uplcom.c#2 integrate
.. //depot/projects/pmap/sys/dev/usb/usbdevs#5 integrate
.. //depot/projects/pmap/sys/dev/usb/usbdevs.h#5 integrate
.. //depot/projects/pmap/sys/dev/usb/usbdevs_data.h#5 integrate
.. //depot/projects/pmap/sys/dev/usb/uvscom.c#2 integrate
.. //depot/projects/pmap/sys/i386/i386/exception.s#5 integrate
.. //depot/projects/pmap/sys/kern/kern_sig.c#9 integrate
.. //depot/projects/pmap/sys/kern/subr_trap.c#8 integrate
.. //depot/projects/pmap/sys/sys/consio.h#3 integrate
.. //depot/projects/pmap/sys/sys/poll.h#4 integrate
.. //depot/projects/pmap/sys/sys/stat.h#4 integrate

Differences ...

==== //depot/projects/pmap/sys/conf/majors#5 (text+ko) ====

@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/conf/majors,v 1.135 2002/04/15 10:41:47 benno Exp $
+$FreeBSD: src/sys/conf/majors,v 1.136 2002/07/10 01:42:25 joe Exp $
 
 Hopefully, this list will one day be obsoleted by DEVFS, but for now
 this is the current allocation of device major numbers.
@@ -153,7 +153,7 @@
 135	zsc		TurboLaser console uart
 136	ipr		Iprobe on-chip perf. counters (gallatin@freebsd.org)
 137	nfp		nFast PCI crypto accelerator (support@ncipher.com)
-138	usio		USB Serial support <n_hibma>
+138	ucom		USB Serial support <n_hibma>
 139	wanrouter	Sangoma Technologies Inc. (al.feldman@sangoma.com)
 140	pcfclock	PCFCLOCK <sascha@schumann.cx>
 141	pcdmx		PCDMX theatre lighting controller

==== //depot/projects/pmap/sys/dev/syscons/syscons.c#4 (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/dev/syscons/syscons.c,v 1.385 2002/06/06 06:02:17 alfred Exp $
+ * $FreeBSD: src/sys/dev/syscons/syscons.c,v 1.386 2002/07/10 03:29:38 dd Exp $
  */
 
 #include "opt_syscons.h"
@@ -981,6 +981,13 @@
 	*(int *)data = scp->index + 1;
 	return 0;
 
+    case VT_LOCKSWITCH:		/* prevent vty switching */
+	if ((*(int *)data) & 0x01)
+	    sc->flags |= SC_SCRN_VTYLOCK;
+	else
+	    sc->flags &= ~SC_SCRN_VTYLOCK;
+	return 0;
+
     case KDENABIO:      	/* allow io operations */
 	error = suser(td);
 	if (error != 0)
@@ -2075,6 +2082,13 @@
 
     DPRINTF(5, ("sc0: sc_switch_scr() %d ", next_scr + 1));
 
+    /* prevent switch if previously requested */
+    if (sc->flags & SC_SCRN_VTYLOCK) {
+	    sc_bell(sc->cur_scp, sc->cur_scp->bell_pitch,
+		sc->cur_scp->bell_duration);
+	    return EPERM;
+    }
+
     /* delay switch if the screen is blanked or being updated */
     if ((sc->flags & SC_SCRN_BLANKED) || sc->write_in_progress
 	|| sc->blink_in_progress || sc->videoio_in_progress) {

==== //depot/projects/pmap/sys/dev/syscons/syscons.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/dev/syscons/syscons.h,v 1.74 2002/04/13 22:34:16 obrien Exp $
+ * $FreeBSD: src/sys/dev/syscons/syscons.h,v 1.75 2002/07/10 03:29:38 dd Exp $
  */
 
 #ifndef _DEV_SYSCONS_SYSCONS_H_
@@ -194,6 +194,7 @@
 #define	SC_SCRN_IDLE	(1 << 5)
 #define	SC_SCRN_BLANKED	(1 << 6)
 #define	SC_SAVER_FAILED	(1 << 7)
+#define	SC_SCRN_VTYLOCK	(1 << 8)
 
 #define	SC_INIT_DONE	(1 << 16)
 #define	SC_SPLASH_SCRN	(1 << 17)

==== //depot/projects/pmap/sys/dev/usb/ucom.c#2 (text+ko) ====

@@ -1,5 +1,5 @@
 /*	$NetBSD: ucom.c,v 1.39 2001/08/16 22:31:24 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/ucom.c,v 1.16 2002/04/01 21:30:36 jhb Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/ucom.c,v 1.19 2002/07/10 01:42:25 joe Exp $	*/
 
 /*-
  * Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
@@ -139,11 +139,14 @@
 	/* poll */      ttypoll,
 	/* mmap */      nommap,
 	/* strategy */  nostrategy,
-	/* name */      "usio",
+	/* name */      "ucom",
 	/* maj */       UCOM_CDEV_MAJOR,
 	/* dump */      nodump,
 	/* psize */     nopsize,
 	/* flags */     D_TTY | D_KQFILTER,
+#if __FreeBSD_version < 500014
+	/* bmaj */	-1,
+#endif
 	/* kqfilter */	ttykqfilter,
 };
 
@@ -188,11 +191,11 @@
 
 	DPRINTF(("ucom_attach: tty_attach tp = %p\n", tp));
 
-	DPRINTF(("ucom_attach: make_dev: usio%d\n", unit));
+	DPRINTF(("ucom_attach: make_dev: ucom%d\n", unit));
 
 	sc->dev = make_dev(&ucom_cdevsw, unit | UCOM_CALLOUT_MASK,
 			UID_UUCP, GID_DIALER, 0660,
-			"usio%d", unit);
+			"ucom%d", unit);
 	sc->dev->si_tty = tp;
 
 	return (0);
@@ -201,6 +204,9 @@
 int
 ucom_detach(struct ucom_softc *sc)
 {
+	struct tty *tp = sc->sc_tty;
+	int s;
+
 	DPRINTF(("ucom_detach: sc = %p, tp = %p\n", sc, sc->sc_tty));
 
 	sc->sc_dying = 1;
@@ -210,11 +216,28 @@
 	if (sc->sc_bulkout_pipe != NULL)
 		usbd_abort_pipe(sc->sc_bulkout_pipe);
 
-	if (sc->sc_tty == NULL) {
+	if (tp != NULL) {
+		if (tp->t_state & TS_ISOPEN) {
+			device_printf(sc->sc_dev,
+				      "still open, focing close\n");
+			(*linesw[tp->t_line].l_close)(tp, 0);
+			tp->t_gen++;
+			ttyclose(tp);
+			ttwakeup(tp);
+			ttwwakeup(tp);
+		}
+	} else {
 		DPRINTF(("ucom_detach: no tty\n"));
 		return (0);
 	}
 
+	s = splusb();
+	if (--sc->sc_refcnt >= 0) {
+		/* Wait for processes to go away. */
+		usb_detach_wait(USBDEV(sc->sc_dev));
+	}
+	splx(s);
+
 	destroy_dev(sc->dev);
 
 	return (0);
@@ -249,7 +272,7 @@
 	USB_GET_SC_OPEN(ucom, unit, sc);
 
 	if (sc->sc_dying)
-		return (EIO);
+		return (ENXIO);
 
 	tp = sc->sc_tty;
 
@@ -370,8 +393,8 @@
 		/*
 		 * Handle initial DCD.
 		 */
-		if (ISSET(sc->sc_msr, UMSR_DCD)
-		    || (minor(dev) & UCOM_CALLOUT_MASK))
+		if (ISSET(sc->sc_msr, UMSR_DCD) ||
+		    (minor(dev) & UCOM_CALLOUT_MASK))
 			(*linesw[tp->t_line].l_modem)(tp, 1);
 
 		ucomstartread(sc);
@@ -394,6 +417,7 @@
 	DPRINTF(("%s: ucomopen: success\n", USBDEVNAME(sc->sc_dev)));
 
 	sc->sc_poll = 1;
+	sc->sc_refcnt++;
 
 	return (0);
 
@@ -444,7 +468,7 @@
 		USBDEVNAME(sc->sc_dev), UCOMUNIT(dev)));
 
 	if (!ISSET(tp->t_state, TS_ISOPEN))
-		return (0);
+		goto quit;
 
 	s = spltty();
 	(*linesw[tp->t_line].l_close)(tp, flag);
@@ -453,7 +477,7 @@
 	splx(s);
 
 	if (sc->sc_dying)
-		return (0);
+		goto quit;
 
 	if (!ISSET(tp->t_state, TS_ISOPEN)) {
 		/*
@@ -467,6 +491,10 @@
 	if (sc->sc_callback->ucom_close != NULL)
 		sc->sc_callback->ucom_close(sc->sc_parent, sc->sc_portno);
 
+    quit:
+	if (--sc->sc_refcnt < 0)
+		usb_detach_wakeup(USBDEV(sc->sc_dev));
+
 	return (0);
 }
 
@@ -924,6 +952,8 @@
 		}
 		splx(s);
 	}
+
+	DPRINTF(("ucomstop: done\n"));
 }
 
 Static void
@@ -1103,12 +1133,24 @@
 Static void
 ucomstopread(struct ucom_softc *sc)
 {
+	usbd_status err;
+
+	DPRINTF(("ucomstopread: enter\n"));
+
 	if (!(sc->sc_state & UCS_RXSTOP)) {
-		if (sc->sc_bulkin_pipe == NULL)
+		if (sc->sc_bulkin_pipe == NULL) {
+			DPRINTF(("ucomstopread: bulkin pipe NULL\n"));
 			return;
+		}
 		sc->sc_state |= UCS_RXSTOP;
-		usbd_abort_pipe(sc->sc_bulkin_pipe);
+		err = usbd_abort_pipe(sc->sc_bulkin_pipe);
+		if (err) {
+			DPRINTF(("ucomstopread: err = %s\n",
+				 usbd_errstr(err)));
+		}
 	}
+
+	DPRINTF(("ucomstopread: leave\n"));
 }
 
 static void

==== //depot/projects/pmap/sys/dev/usb/uplcom.c#2 (text+ko) ====

@@ -1,5 +1,5 @@
 /*	$NetBSD: uplcom.c,v 1.20 2001/07/31 12:33:11 ichiro Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/uplcom.c,v 1.1 2002/03/18 18:23:39 joe Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/uplcom.c,v 1.4 2002/07/10 01:42:25 joe Exp $	*/
 
 /*-
  * Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
@@ -204,6 +204,8 @@
 	{ USB_VENDOR_TDK, USB_PRODUCT_TDK_UHA6400 },
 	/* RATOC REX-USB60 */
 	{ USB_VENDOR_RATOC, USB_PRODUCT_RATOC_REXUSB60 },
+	/* ELECOM UC-SGT */
+	{ USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_UCSGT },
 	{ 0, 0 }
 };
 
@@ -220,7 +222,7 @@
 };
 
 Static driver_t uplcom_driver = {
-	"usio",
+	"uplcom",
 	uplcom_methods,
 	sizeof (struct uplcom_softc)
 };
@@ -678,7 +680,7 @@
 	int err;
 	
 	if (sc->sc_ucom.sc_dying)
-		return (EIO);
+		return (ENXIO);
 
 	DPRINTF(("uplcom_open: sc = %p\n", sc));
 

==== //depot/projects/pmap/sys/dev/usb/usbdevs#5 (text+ko) ====

@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/dev/usb/usbdevs,v 1.92 2002/07/09 16:45:03 joe Exp $
+$FreeBSD: src/sys/dev/usb/usbdevs,v 1.93 2002/07/10 00:43:10 joe Exp $
 
 /*
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -554,6 +554,7 @@
 product ELECOM LDUSBTX1		0x4002	LD-USB/TX
 product ELECOM LDUSBLTX		0x4005	LD-USBL/TX
 product ELECOM LDUSBTX2		0x400b	LD-USB/TX
+product ELECOM UCSGT		0x5003	UC-SGT
 product ELECOM LDUSBTX3		0xabc1	LD-USB/TX
 
 /* Elsa products */

==== //depot/projects/pmap/sys/dev/usb/usbdevs.h#5 (text+ko) ====

@@ -1,10 +1,10 @@
-/*	$FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.104 2002/07/09 16:46:31 joe Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.105 2002/07/10 00:43:50 joe Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	FreeBSD: src/sys/dev/usb/usbdevs,v 1.92 2002/07/09 16:45:03 joe Exp 
+ *	FreeBSD: src/sys/dev/usb/usbdevs,v 1.93 2002/07/10 00:43:10 joe Exp 
  */
 
 /*
@@ -561,6 +561,7 @@
 #define	USB_PRODUCT_ELECOM_LDUSBTX1	0x4002		/* LD-USB/TX */
 #define	USB_PRODUCT_ELECOM_LDUSBLTX	0x4005		/* LD-USBL/TX */
 #define	USB_PRODUCT_ELECOM_LDUSBTX2	0x400b		/* LD-USB/TX */
+#define	USB_PRODUCT_ELECOM_UCSGT	0x5003		/* UC-SGT */
 #define	USB_PRODUCT_ELECOM_LDUSBTX3	0xabc1		/* LD-USB/TX */
 
 /* Elsa products */

==== //depot/projects/pmap/sys/dev/usb/usbdevs_data.h#5 (text+ko) ====

@@ -1,10 +1,10 @@
-/*	$FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.104 2002/07/09 16:46:31 joe Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.105 2002/07/10 00:43:50 joe Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	FreeBSD: src/sys/dev/usb/usbdevs,v 1.92 2002/07/09 16:45:03 joe Exp 
+ *	FreeBSD: src/sys/dev/usb/usbdevs,v 1.93 2002/07/10 00:43:10 joe Exp 
  */
 
 /*
@@ -730,6 +730,12 @@
 	    "LD-USB/TX",
 	},
 	{
+	    USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_UCSGT,
+	    0,
+	    "Elecom",
+	    "UC-SGT",
+	},
+	{
 	    USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX3,
 	    0,
 	    "Elecom",

==== //depot/projects/pmap/sys/dev/usb/uvscom.c#2 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/usb/uvscom.c,v 1.4 2002/03/28 12:22:58 joe Exp $
+ * $FreeBSD: src/sys/dev/usb/uvscom.c,v 1.6 2002/07/10 01:42:25 joe Exp $
  */
 
 /*
@@ -232,7 +232,7 @@
 };
 
 Static driver_t uvscom_driver = {
-	"usio",
+	"uvscom",
 	uvscom_methods,
 	sizeof (struct uvscom_softc)
 };
@@ -712,7 +712,7 @@
 	int i;
 	
 	if (sc->sc_ucom.sc_dying)
-		return (EIO);
+		return (ENXIO);
 
 	DPRINTF(("uvscom_open: sc = %p\n", sc));
 
@@ -725,7 +725,7 @@
 		if (err) {
 			DPRINTF(("%s: uvscom_open: readstat faild\n",
 				 USBDEVNAME(sc->sc_ucom.sc_dev)));
-			return (EIO);
+			return (ENXIO);
 		}
 
 		sc->sc_intr_buf = malloc(sc->sc_isize, M_USBDEV, M_WAITOK);
@@ -742,7 +742,7 @@
 			printf("%s: cannot open interrupt pipe (addr %d)\n",
 				 USBDEVNAME(sc->sc_ucom.sc_dev),
 				 sc->sc_intr_number);
-			return (EIO);
+			return (ENXIO);
 		}
 	} else {
 		DPRINTF(("uvscom_open: did not open interrupt pipe.\n"));
@@ -759,14 +759,14 @@
 		if (i == 0) {
 			DPRINTF(("%s: unit is not ready\n",
 				 USBDEVNAME(sc->sc_ucom.sc_dev)));
-			return (EIO);
+			return (ENXIO);
 		}
 
 		/* check PC card was inserted */
 		if (ISSET(sc->sc_usr, UVSCOM_NOCARD)) {
 			DPRINTF(("%s: no card\n",
 				 USBDEVNAME(sc->sc_ucom.sc_dev)));
-			return (EIO);
+			return (ENXIO);
 		}
 	}
 

==== //depot/projects/pmap/sys/i386/i386/exception.s#5 (text+ko) ====

@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 1989, 1990 William F. Jolitz.
  * Copyright (c) 1990 The Regents of the University of California.
  * All rights reserved.
  *
@@ -30,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/i386/exception.s,v 1.94 2002/03/27 05:39:18 dillon Exp $
+ * $FreeBSD: src/sys/i386/i386/exception.s,v 1.95 2002/07/10 02:24:44 julian Exp $
  */
 
 #include "opt_npx.h"
@@ -264,15 +265,103 @@
  */
 #include "i386/isa/vector.s"
 
+	.data
+	ALIGN_DATA
+
 /*
- * Include what was once icu-dependent code.
- * XXX it should be merged into this file (also move the definition of
- * imen to vector.s or isa.c).
- * Before including it, set up a normal asm environment so that vector.s
- * doesn't have to know that stuff is included after it.
+ * void doreti(struct trapframe)
+ *
+ * Handle return from interrupts, traps and syscalls.
  */
-	.data
-	ALIGN_DATA
 	.text
 	SUPERALIGN_TEXT
-#include "i386/isa/ipl.s"
+	.type	doreti,@function
+doreti:
+	FAKE_MCOUNT(bintr)		/* init "from" bintr -> doreti */
+doreti_next:
+	/*
+	 * Check if ASTs can be handled now.  PSL_VM must be checked first
+	 * since segment registers only have an RPL in non-VM86 mode.
+	 */
+	testl	$PSL_VM,TF_EFLAGS(%esp)	/* are we in vm86 mode? */
+	jz	doreti_notvm86
+	cmpl	$1,in_vm86call		/* are we in a vm86 call? */
+	jne	doreti_ast		/* can handle ASTs now if not */
+  	jmp	doreti_exit
+
+doreti_notvm86:
+	testb	$SEL_RPL_MASK,TF_CS(%esp)  /* are we in user mode? */
+	jz	doreti_exit		/* can't handle ASTs now if not */
+
+doreti_ast:
+	/*
+	 * Check for ASTs atomically with returning.  Disabling CPU
+	 * interrupts provides sufficient locking evein the SMP case,
+	 * since we will be informed of any new ASTs by an IPI.
+	 */
+	cli
+	movl	PCPU(CURTHREAD),%eax
+	movl	TD_KSE(%eax), %eax
+	testl	$KEF_ASTPENDING | KEF_NEEDRESCHED,KE_FLAGS(%eax)
+	je	doreti_exit
+	sti
+	pushl	%esp			/* pass a pointer to the trapframe */
+	call	ast
+	add	$4,%esp
+	jmp	doreti_ast
+
+	/*
+	 * doreti_exit:	pop registers, iret.
+	 *
+	 *	The segment register pop is a special case, since it may
+	 *	fault if (for example) a sigreturn specifies bad segment
+	 *	registers.  The fault is handled in trap.c.
+	 */
+doreti_exit:
+	MEXITCOUNT
+
+	.globl	doreti_popl_fs
+doreti_popl_fs:
+	popl	%fs
+	.globl	doreti_popl_es
+doreti_popl_es:
+	popl	%es
+	.globl	doreti_popl_ds
+doreti_popl_ds:
+	popl	%ds
+	popal
+	addl	$8,%esp
+	.globl	doreti_iret
+doreti_iret:
+	iret
+
+  	/*
+	 * doreti_iret_fault and friends.  Alternative return code for
+	 * the case where we get a fault in the doreti_exit code
+	 * above.  trap() (i386/i386/trap.c) catches this specific
+	 * case, sends the process a signal and continues in the
+	 * corresponding place in the code below.
+	 */
+	ALIGN_TEXT
+	.globl	doreti_iret_fault
+doreti_iret_fault:
+	subl	$8,%esp
+	pushal
+	pushl	%ds
+	.globl	doreti_popl_ds_fault
+doreti_popl_ds_fault:
+	pushl	%es
+	.globl	doreti_popl_es_fault
+doreti_popl_es_fault:
+	pushl	%fs
+	.globl	doreti_popl_fs_fault
+doreti_popl_fs_fault:
+	movl	$0,TF_ERR(%esp)	/* XXX should be the error code */
+	movl	$T_PROTFLT,TF_TRAPNO(%esp)
+	jmp	alltraps_with_regs_pushed
+
+#ifdef APIC_IO
+#include "i386/isa/apic_ipl.s"
+#else
+#include "i386/isa/icu_ipl.s"
+#endif /* APIC_IO */

==== //depot/projects/pmap/sys/kern/kern_sig.c#9 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_sig.c	8.7 (Berkeley) 4/18/94
- * $FreeBSD: src/sys/kern/kern_sig.c,v 1.174 2002/07/03 09:15:20 julian Exp $
+ * $FreeBSD: src/sys/kern/kern_sig.c,v 1.175 2002/07/10 06:31:35 truckman Exp $
  */
 
 #include "opt_compat.h"
@@ -1967,8 +1967,6 @@
  * then it passes on a vnode and a size limit to the process-specific
  * coredump routine if there is one; if there _is not_ one, it returns
  * ENOSYS; otherwise it returns the error from the process-specific routine.
- *
- * XXX: VOP_GETATTR() here requires holding the vnode lock.
  */
 
 static int
@@ -2021,6 +2019,14 @@
 	NDFREE(&nd, NDF_ONLY_PNBUF);
 	vp = nd.ni_vp;
 
+	/* Don't dump to non-regular files or files with links. */
+	if (vp->v_type != VREG ||
+	    VOP_GETATTR(vp, &vattr, cred, td) || vattr.va_nlink != 1) {
+		VOP_UNLOCK(vp, 0, td);
+		error = EFAULT;
+		goto out2;
+	}
+
 	VOP_UNLOCK(vp, 0, td);
 	lf.l_whence = SEEK_SET;
 	lf.l_start = 0;
@@ -2040,12 +2046,6 @@
 		goto restart;
 	}
 
-	/* Don't dump to non-regular files or files with links. */
-	if (vp->v_type != VREG ||
-	    VOP_GETATTR(vp, &vattr, cred, td) || vattr.va_nlink != 1) {
-		error = EFAULT;
-		goto out1;
-	}
 	VATTR_NULL(&vattr);
 	vattr.va_size = 0;
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
@@ -2060,7 +2060,6 @@
 	  p->p_sysent->sv_coredump(td, vp, limit) :
 	  ENOSYS;
 
-out1:
 	lf.l_type = F_UNLCK;
 	VOP_ADVLOCK(vp, (caddr_t)p, F_UNLCK, &lf, F_FLOCK);
 	vn_finished_write(mp);

==== //depot/projects/pmap/sys/kern/subr_trap.c#8 (text+ko) ====

@@ -35,7 +35,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)trap.c	7.4 (Berkeley) 5/13/91
- * $FreeBSD: src/sys/kern/subr_trap.c,v 1.219 2002/06/29 17:26:18 julian Exp $
+ * $FreeBSD: src/sys/kern/subr_trap.c,v 1.220 2002/07/10 06:40:22 julian Exp $
  */
 
 #ifdef __i386__
@@ -106,10 +106,14 @@
 	/*
 	 * We need to check to see if we have to exit or wait due to a
 	 * single threading requirement or some other STOP condition.
+	 * Don't bother doing all the work if the stop bits are not set
+	 * at this time.. If we miss it, we miss it.. no big deal.
 	 */
-	PROC_LOCK(p);
-	thread_suspend_check(0);	/* Can suspend or kill */
-	PROC_UNLOCK(p);
+	if (P_SHOULDSTOP(p)) {
+		PROC_LOCK(p);
+		thread_suspend_check(0);	/* Can suspend or kill */
+		PROC_UNLOCK(p);
+	}
 
 	/*
 	 * DO special thread processing, e.g. upcall tweaking and such

==== //depot/projects/pmap/sys/sys/consio.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/sys/consio.h,v 1.14 2002/05/16 10:57:10 sobomax Exp $
+ * $FreeBSD: src/sys/sys/consio.h,v 1.15 2002/07/10 03:29:38 dd Exp $
  */
 
 #ifndef	_SYS_CONSIO_H_
@@ -335,6 +335,9 @@
 /* get the index of the vty */
 #define VT_GETINDEX	_IOR('v', 8, int)
 
+/* prevent switching vtys */
+#define VT_LOCKSWITCH	_IOW('v', 9, int)
+
 /*
  * Video mode switching ioctl.  See sys/fbio.h for mode numbers.
  */

==== //depot/projects/pmap/sys/sys/poll.h#4 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/poll.h,v 1.12 2002/07/08 16:37:34 mike Exp $
+ * $FreeBSD: src/sys/sys/poll.h,v 1.13 2002/07/10 04:47:25 mike Exp $
  */
 
 #ifndef _SYS_POLL_H_
@@ -66,8 +66,8 @@
 #define	POLLRDBAND	0x0080		/* OOB/Urgent readable data */
 #define	POLLWRBAND	0x0100		/* OOB/Urgent data can be written */
 
+#if __BSD_VISIBLE
 /* General FreeBSD extension (currently only supported for sockets): */
-#if __BSD_VISIBLE
 #define	POLLINIGNEOF	0x2000		/* like POLLIN, except ignore EOF */
 #endif
 

==== //depot/projects/pmap/sys/sys/stat.h#4 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)stat.h	8.12 (Berkeley) 6/16/95
- * $FreeBSD: src/sys/sys/stat.h,v 1.26 2002/06/22 22:01:09 mckusick Exp $
+ * $FreeBSD: src/sys/sys/stat.h,v 1.27 2002/07/10 05:21:14 bde Exp $
  */
 
 #ifndef _SYS_STAT_H_
@@ -58,6 +58,10 @@
 #include <sys/time.h>
 #endif
 
+#ifdef _POSIX_SOURCE
+#include <sys/_timespec.h>
+#endif
+
 #ifdef _KERNEL
 #define __dev_t	udev_t
 #else
@@ -112,10 +116,6 @@
 	int32_t	  st_lspare;
 #ifndef _POSIX_SOURCE
 	struct timespec st_createtimespec; /* time of file creation */
-#else
-	time_t	  st_createtime;	/* time of file creation */
-	long	  st_createtimensec;	/* nsec of file creation */
-#endif
 	/*
 	 * Explicitly pad st_createtimespec to 16 bytes so that the size of
 	 * struct stat is backwards compatible.  We use bitfields instead
@@ -126,6 +126,12 @@
 	 */
 	int	:(8 / 2) * (16 - (int)sizeof(struct timespec));
 	int	:(8 / 2) * (16 - (int)sizeof(struct timespec));
+#else
+	time_t	  st_createtime;	/* time of file creation */
+	long	  st_createtimensec;	/* nsec of file creation */
+	int	:(8 / 2) * (16 - (int)sizeof(struct __timespec));
+	int	:(8 / 2) * (16 - (int)sizeof(struct __timespec));
+#endif
 };
 
 #ifndef _POSIX_SOURCE

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207100935.g6A9ZAL7011052>