Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jun 2004 14:50:29 GMT
From:      Doug Rabson <dfr@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 54315 for review
Message-ID:  <200406071450.i57EoTip030896@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54315

Change 54315 by dfr@dfr_home on 2004/06/07 14:50:12

	IFC

Affected files ...

.. //depot/projects/kse/include/wchar.h#11 integrate
.. //depot/projects/kse/lib/libc/gen/signal.3#4 integrate
.. //depot/projects/kse/lib/libc/i386/gen/signalcontext.c#4 integrate
.. //depot/projects/kse/lib/libc/sys/sigaction.2#4 integrate
.. //depot/projects/kse/lib/libc/sys/wait.2#3 integrate
.. //depot/projects/kse/sys/alpha/include/ioctl_meteor.h#2 integrate
.. //depot/projects/kse/sys/dev/sound/pcm/sound.c#15 integrate
.. //depot/projects/kse/sys/geom/nop/g_nop.c#2 integrate
.. //depot/projects/kse/sys/i386/include/ioctl_meteor.h#2 integrate
.. //depot/projects/kse/sys/kern/kern_sig.c#72 integrate
.. //depot/projects/kse/sys/kern/kern_synch.c#83 integrate
.. //depot/projects/kse/sys/kern/uipc_syscalls.c#26 integrate
.. //depot/projects/kse/sys/kern/vfs_syscalls.c#40 integrate
.. //depot/projects/kse/sys/netinet/ip_icmp.c#15 integrate

Differences ...

==== //depot/projects/kse/include/wchar.h#11 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/include/wchar.h,v 1.40 2004/05/27 10:08:44 tjr Exp $
+ * $FreeBSD: src/include/wchar.h,v 1.41 2004/06/07 10:31:10 tjr Exp $
  */
 
 /*-
@@ -180,7 +180,7 @@
 
 #define	getwc(fp)	fgetwc(fp)
 #define	getwchar()	fgetwc(__stdinp)
-#define	putwc(wc, fp)	fputwc(x, fp)
+#define	putwc(wc, fp)	fputwc(wc, fp)
 #define	putwchar(wc)	fputwc(wc, __stdoutp)
 
 #if __ISO_C_VISIBLE >= 1999

==== //depot/projects/kse/lib/libc/gen/signal.3#4 (text+ko) ====

@@ -30,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)signal.3	8.3 (Berkeley) 4/19/94
-.\" $FreeBSD: src/lib/libc/gen/signal.3,v 1.35 2004/04/27 09:18:49 ru Exp $
+.\" $FreeBSD: src/lib/libc/gen/signal.3,v 1.36 2004/06/07 11:01:39 yar Exp $
 .\"
-.Dd April 19, 1994
+.Dd June 7, 2004
 .Dt SIGNAL 3
 .Os
 .Sh NAME
@@ -204,6 +204,22 @@
 function;
 ignored signals remain ignored.
 .Pp
+If a process explicitly specifies
+.Dv SIG_IGN
+as the action for the signal
+.Dv SIGCHLD ,
+the system will not create zombie processes when children
+of the calling process exit.
+As a consequence, the system will discard the exit status
+from the child processes.
+If the calling process subsequently issues a call to
+.Xr wait 2
+or equivalent, it will block until all of the calling process's
+children terminate, and then return a value of \-1 with
+.Va errno
+set to
+.Er ECHILD .
+.Pp
 See
 .Xr sigaction 2
 for a list of functions
@@ -239,6 +255,7 @@
 .Xr sigaltstack 2 ,
 .Xr sigprocmask 2 ,
 .Xr sigsuspend 2 ,
+.Xr wait 2 ,
 .Xr fpsetmask 3 ,
 .Xr setjmp 3 ,
 .Xr siginterrupt 3 ,
@@ -248,3 +265,7 @@
 .Fn signal
 facility appeared in
 .Bx 4.0 .
+The option to avoid the creation of child zombies through ignoring
+.Dv SIGCHLD
+appeared in
+.Fx 5.0 .

==== //depot/projects/kse/lib/libc/i386/gen/signalcontext.c#4 (text+ko) ====

@@ -22,29 +22,29 @@
  * 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.
- *
- * $FreeBSD$
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD");
+__FBSDID("$FreeBSD: src/lib/libc/i386/gen/signalcontext.c,v 1.6 2004/02/10 20:42:32 cperciva Exp $");
 
 #include <sys/param.h>
-#include <sys/signal.h>
-#include <sys/signalvar.h>
 #include <sys/ucontext.h>
 #include <machine/psl.h>
 #include <machine/sigframe.h>
+#include <signal.h>
+#include <strings.h>
+
+__weak_reference(__signalcontext, signalcontext);
 
 extern void _ctx_start(ucontext_t *, int argc, ...);
 
 int
-signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func)
+__signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func)
 {
+	register_t *p;
 	struct sigframe *sfp;
-	int *p;
 
-	/*
+	/*-
 	 * Set up stack.
 	 * (n = sizeof(int))
 	 * 2n+sizeof(struct sigframe)	ucp
@@ -52,29 +52,28 @@
 	 * 1n				&func
 	 * 0n				&_ctx_start
 	 */
-	p = (int *)ucp->uc_mcontext.mc_esp;
-	*--p = (int)ucp;
-	p -= sizeof(struct sigframe);
+	p = (register_t *)(void *)(intptr_t)ucp->uc_mcontext.mc_esp;
+	*--p = (register_t)(intptr_t)ucp;
+	p = (register_t *)((u_register_t)p & ~0xF);  /* Align to 16 bytes. */
+	p = (register_t *)((u_register_t)p - sizeof(struct sigframe));
 	sfp = (struct sigframe *)p;
 	bzero(sfp, sizeof(struct sigframe));
 	sfp->sf_signum = sig;
-	sfp->sf_siginfo = (int)&sfp->sf_si;
-	sfp->sf_ucontext = (int)&sfp->sf_uc;
+	sfp->sf_siginfo = (register_t)(intptr_t)&sfp->sf_si;
+	sfp->sf_ucontext = (register_t)(intptr_t)&sfp->sf_uc;
 	sfp->sf_ahu.sf_action = (__siginfohandler_t *)func;
 	bcopy(ucp, &sfp->sf_uc, sizeof(ucontext_t));
 	sfp->sf_si.si_signo = sig;
+	*--p = (register_t)(intptr_t)func;
 
-	*--p = (int)func;
-
 	/*
 	 * Set up ucontext_t.
 	 */
 	ucp->uc_mcontext.mc_ebp = ucp->uc_mcontext.mc_esp - sizeof(int);
-	ucp->uc_mcontext.mc_esp = (int)p;
-	ucp->uc_mcontext.mc_eip = (int)_ctx_start;
+	ucp->uc_mcontext.mc_esp = (register_t)(intptr_t)p;
+	ucp->uc_mcontext.mc_eip = (register_t)(intptr_t)_ctx_start;
 	ucp->uc_mcontext.mc_eflags &= ~PSL_T;
 	ucp->uc_link = &sfp->sf_uc;
-	SIGDELSET(ucp->uc_sigmask, sig);
+	sigdelset(&ucp->uc_sigmask, sig);
 	return (0);
 }
-

==== //depot/projects/kse/lib/libc/sys/sigaction.2#4 (text+ko) ====

@@ -30,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	From: @(#)sigaction.2	8.2 (Berkeley) 4/3/94
-.\" $FreeBSD: src/lib/libc/sys/sigaction.2,v 1.49 2003/09/08 19:57:16 ru Exp $
+.\" $FreeBSD: src/lib/libc/sys/sigaction.2,v 1.50 2004/06/07 11:01:39 yar Exp $
 .\"
-.Dd April 3, 1994
+.Dd June 7, 2004
 .Dt SIGACTION 2
 .Os
 .Sh NAME
@@ -201,6 +201,12 @@
 (or equivalent), it blocks until all of the calling process's child
 processes terminate, and then returns a value of -1 with errno set to
 .Er ECHILD .
+The same effect of avoiding zombie creation can also be achieved by setting
+.Fa sa_handler
+for
+.Dv SIGCHLD
+to
+.Dv SIG_IGN .
 .It Dv SA_ONSTACK
 If this bit is set, the system will deliver the signal to the process
 on a
@@ -601,6 +607,10 @@
 .\" and
 .\" SA_SIGINFO
 flags are featuring options commonly found in other operating systems.
+The flags are approved by
+.St -susv2 ,
+along with the option to avoid zombie creation by ignoring
+.Dv SIGCHLD .
 .Sh SEE ALSO
 .Xr kill 1 ,
 .Xr kill 2 ,

==== //depot/projects/kse/lib/libc/sys/wait.2#3 (text+ko) ====

@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)wait.2	8.2 (Berkeley) 4/19/94
-.\" $FreeBSD: src/lib/libc/sys/wait.2,v 1.16 2002/12/19 09:40:25 ru Exp $
+.\" $FreeBSD: src/lib/libc/sys/wait.2,v 1.17 2004/06/07 11:01:39 yar Exp $
 .\"
 .Dd April 19, 1994
 .Dt WAIT 2
@@ -274,6 +274,14 @@
 .It Bq Er ECHILD
 The calling process has no existing unwaited-for
 child processes.
+.It Bq Er ECHILD
+No status from the terminated child process is available
+because the calling process has asked the system to discard
+such status by ignoring the signal
+.Dv SIGCHLD
+or setting the flag
+.Dv SA_NOCLDWAIT
+for that signal.
 .It Bq Er EFAULT
 The
 .Fa status

==== //depot/projects/kse/sys/alpha/include/ioctl_meteor.h#2 (text+ko) ====

@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 1995 Mark Tinguely and Jim Lowe
+/*-
+ * Copyright (c) 2003 David O'Brien
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -10,11 +10,6 @@
  * 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 Mark Tinguely and Jim Lowe
- * 4. The name of the author may not be used to endorse or promote products 
- *    derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -28,160 +23,16 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/alpha/include/ioctl_meteor.h,v 1.1 2000/04/15 08:07:56 roger Exp $
+ * $FreeBSD: src/sys/alpha/include/ioctl_meteor.h,v 1.4 2003/12/08 07:22:41 obrien Exp $
  */
-/*
- *	ioctl constants for Matrox Meteor Capture card.
- */
 
 #ifndef	_MACHINE_IOCTL_METEOR_H_
 #define	_MACHINE_IOCTL_METEOR_H_
 
-#ifndef _KERNEL
-#include <sys/types.h>
+#ifdef __GNUC__
+#warning Include dev/bktr/ioctl_meteor.h instead of this header.
 #endif
-#include <sys/ioccom.h>
 
-struct meteor_capframe {
-	short	command;	/* see below for valid METEORCAPFRM commands */
-	short	lowat;		/* start transfer if < this number */
-	short	hiwat;		/* stop transfer if > this number */
-} ;
+#include <dev/bktr/ioctl_meteor.h>
 
-/* structure for METEOR[GS]ETGEO - get/set geometry  */
-struct meteor_geomet {
-	u_short		rows;
-	u_short		columns;
-	u_short		frames;
-	u_long		oformat;
-} ;
-
-/* structure for METEORGCOUNT-get count of frames, fifo errors and dma errors */
-struct meteor_counts {
-	u_long fifo_errors;	/* count of fifo errors since open */
-	u_long dma_errors;	/* count of dma errors since open */
-	u_long frames_captured;	/* count of frames captured since open */
-	u_long even_fields_captured; /* count of even fields captured */
-	u_long odd_fields_captured; /* count of odd fields captured */
-} ;
-
-/* structure for getting and setting direct transfers to vram */
-struct meteor_video {
-	u_long	addr;	/* Address of location to dma to */
-	u_long	width;	/* Width of memory area */
-	u_long	banksize;	/* Size of Vram bank */
-	u_long	ramsize;	/* Size of Vram */
-};
-
-#define METEORCAPTUR _IOW('x', 1, int)			 /* capture a frame */
-#define METEORCAPFRM _IOW('x', 2, struct meteor_capframe)  /* sync capture */
-#define METEORSETGEO _IOW('x', 3, struct meteor_geomet)  /* set geometry */
-#define METEORGETGEO _IOR('x', 4, struct meteor_geomet)  /* get geometry */
-#define METEORSTATUS _IOR('x', 5, unsigned short)	/* get status */
-#define METEORSHUE   _IOW('x', 6, signed char)		/* set hue */
-#define METEORGHUE   _IOR('x', 6, signed char)		/* get hue */
-#define METEORSFMT   _IOW('x', 7, unsigned long)	/* set format */
-#define METEORGFMT   _IOR('x', 7, unsigned long)	/* get format */
-#define METEORSINPUT _IOW('x', 8, unsigned long)	/* set input dev */
-#define METEORGINPUT _IOR('x', 8, unsigned long)	/* get input dev */
-#define	METEORSCHCV  _IOW('x', 9, unsigned char)	/* set uv gain */
-#define	METEORGCHCV  _IOR('x', 9, unsigned char)	/* get uv gain */
-#define	METEORSCOUNT _IOW('x',10, struct meteor_counts)
-#define	METEORGCOUNT _IOR('x',10, struct meteor_counts)
-#define METEORSFPS   _IOW('x',11, unsigned short)	/* set fps */
-#define METEORGFPS   _IOR('x',11, unsigned short)	/* get fps */
-#define METEORSSIGNAL _IOW('x', 12, unsigned int)	/* set signal */
-#define METEORGSIGNAL _IOR('x', 12, unsigned int)	/* get signal */
-#define	METEORSVIDEO _IOW('x', 13, struct meteor_video)	/* set video */
-#define	METEORGVIDEO _IOR('x', 13, struct meteor_video)	/* get video */
-#define	METEORSBRIG  _IOW('x', 14, unsigned char)	/* set brightness */
-#define METEORGBRIG  _IOR('x', 14, unsigned char)	/* get brightness */
-#define	METEORSCSAT  _IOW('x', 15, unsigned char)	/* set chroma sat */
-#define METEORGCSAT  _IOR('x', 15, unsigned char)	/* get uv saturation */
-#define	METEORSCONT  _IOW('x', 16, unsigned char)	/* set contrast */
-#define	METEORGCONT  _IOR('x', 16, unsigned char)	/* get contrast */
-#define METEORSBT254 _IOW('x', 17, unsigned short)	/* set Bt254 reg */
-#define METEORGBT254 _IOR('x', 17, unsigned short)	/* get Bt254 reg */
-#define METEORSHWS   _IOW('x', 18, unsigned char)	/* set hor start reg */
-#define METEORGHWS   _IOR('x', 18, unsigned char)	/* get hor start reg */
-#define METEORSVWS   _IOW('x', 19, unsigned char)	/* set vert start reg */
-#define METEORGVWS   _IOR('x', 19, unsigned char)	/* get vert start reg */
-#define	METEORSTS    _IOW('x', 20, unsigned char)	/* set time stamp */
-#define	METEORGTS    _IOR('x', 20, unsigned char)	/* get time stamp */
-
-#define	METEOR_STATUS_ID_MASK	0xf000	/* ID of 7196 */
-#define	METEOR_STATUS_DIR	0x0800	/* Direction of Expansion port YUV */
-#define	METEOR_STATUS_OEF	0x0200	/* Field detected: Even/Odd */
-#define	METEOR_STATUS_SVP	0x0100	/* State of VRAM Port:inactive/active */
-#define	METEOR_STATUS_STTC	0x0080	/* Time Constant: TV/VCR */
-#define	METEOR_STATUS_HCLK	0x0040	/* Horiz PLL: locked/unlocked */
-#define	METEOR_STATUS_FIDT	0x0020	/* Field detect: 50/60hz */
-#define	METEOR_STATUS_ALTD	0x0002	/* Line alt: no line alt/line alt */
-#define METEOR_STATUS_CODE	0x0001	/* Colour info: no colour/colour */
-
-				/* METEORCAPTUR capture options */
-#define METEOR_CAP_SINGLE	0x0001	/* capture one frame */
-#define METEOR_CAP_CONTINOUS	0x0002	/* continuously capture */
-#define METEOR_CAP_STOP_CONT	0x0004	/* stop the continuous capture */
-
-				/* METEORCAPFRM capture commands */
-#define METEOR_CAP_N_FRAMES	0x0001	/* capture N frames */
-#define METEOR_CAP_STOP_FRAMES	0x0002	/* stop capture N frames */
-#define	METEOR_HALT_N_FRAMES	0x0003	/* halt of capture N frames */
-#define METEOR_CONT_N_FRAMES	0x0004	/* continue after above halt */
-
-				/* valid video input formats:  */
-#define METEOR_FMT_NTSC		0x00100	/* NTSC --  initialized default */
-#define METEOR_FMT_PAL		0x00200	/* PAL */
-#define METEOR_FMT_SECAM	0x00400	/* SECAM */
-#define METEOR_FMT_AUTOMODE	0x00800 /* auto-mode */
-#define METEOR_INPUT_DEV0	0x01000	/* camera input 0 -- default */
-#define METEOR_INPUT_DEV_RCA	METEOR_INPUT_DEV0
-#define METEOR_INPUT_DEV1	0x02000	/* camera input 1 */
-#define METEOR_INPUT_DEV2	0x04000	/* camera input 2 */
-#define METEOR_INPUT_DEV3	0x08000	/* camera input 3 */
-#define METEOR_INPUT_DEV_RGB	0x0a000	/* for rgb version of meteor */
-#define METEOR_INPUT_DEV_SVIDEO	0x06000 /* S-video input port */
-
-				/* valid video output formats:  */
-#define METEOR_GEO_RGB16	0x0010000 /* packed -- initialized default */
-#define METEOR_GEO_RGB24	0x0020000 /* RBG 24 bits packed */
-					  /* internally stored in 32 bits */
-#define METEOR_GEO_YUV_PACKED	0x0040000 /* 4-2-2 YUV 16 bits packed */
-#define METEOR_GEO_YUV_PLANAR	0x0080000 /* 4-2-2 YUV 16 bits planer */
-#define METEOR_GEO_YUV_PLANER	METEOR_GEO_YUV_PLANAR
-#define METEOR_GEO_UNSIGNED	0x0400000 /* unsigned uv outputs */
-#define METEOR_GEO_EVEN_ONLY	0x1000000 /* set for even only field capture */
-#define METEOR_GEO_ODD_ONLY	0x2000000 /* set for odd only field capture */
-#define METEOR_GEO_FIELD_MASK	0x3000000
-#define METEOR_GEO_YUV_422	0x4000000 /* 4-2-2 YUV in Y-U-V combined */
-#define METEOR_GEO_OUTPUT_MASK	0x40f0000
-#define METEOR_GEO_YUV_12	0x10000000	/* YUV 12 format */
-#define METEOR_GEO_YUV_9	0x40000000	/* YUV 9 format */
-
-#define	METEOR_FIELD_MODE	0x80000000	/* Field cap or Frame cap */
-
-#define	METEOR_SIG_MODE_MASK	0xffff0000
-#define	METEOR_SIG_FRAME	0x00000000	/* signal every frame */
-#define	METEOR_SIG_FIELD	0x00010000	/* signal every field */
-
-	/* following structure is used to coordinate the synchronous */
-	   
-struct meteor_mem {
-		/* kernel write only  */
-	int	frame_size;	 /* row*columns*depth */
-	unsigned num_bufs;	 /* number of frames in buffer (1-32) */
-		/* user and kernel change these */
-	int	lowat;		 /* kernel starts capture if < this number */
-	int	hiwat;		 /* kernel stops capture if > this number.
-				    hiwat <= numbufs */
-	unsigned active;	 /* bit mask of active frame buffers
-				    kernel sets, user clears */
-	int	num_active_bufs; /* count of active frame buffer
-				    kernel increments, user decrements */
-
-		/* reference to mmapped data */
-	caddr_t	buf;		 /* The real space (virtual addr) */
-} ;
-
-#endif /* !_MACHINE_IOCTL_METEOR_H_ */
+#endif	/* _MACHINE_IOCTL_METEOR_H_ */

==== //depot/projects/kse/sys/dev/sound/pcm/sound.c#15 (text+ko) ====

@@ -32,7 +32,7 @@
 
 #include "feeder_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.90 2004/02/28 19:47:02 truckman Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.91 2004/06/07 12:25:14 truckman Exp $");
 
 devclass_t pcm_devclass;
 
@@ -869,7 +869,6 @@
 
 	x = pcm_inprog(d, 1);
 	if (x != 1) {
-		printf("x: %d\n", x);
 		pcm_inprog(d, -1);
 		return EINPROGRESS;
 	}

==== //depot/projects/kse/sys/geom/nop/g_nop.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/nop/g_nop.c,v 1.2 2004/05/21 15:23:48 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/nop/g_nop.c,v 1.4 2004/06/07 13:40:40 pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,6 +124,7 @@
 	struct g_geom *gp;
 	struct g_provider *newpp;
 	struct g_consumer *cp;
+	char name[64];
 	int error;
 
 	g_topology_assert();
@@ -132,10 +133,16 @@
 	newpp = NULL;
 	cp = NULL;
 
-	gp = g_new_geomf(mp, "%s%s", pp->name, G_NOP_SUFFIX);
+	snprintf(name, sizeof(name), "%s%s", pp->name, G_NOP_SUFFIX);
+	LIST_FOREACH(gp, &mp->geom, geom) {
+		if (strcmp(gp->name, name) == 0) {
+			gctl_error(req, "Provider %s already exists.", name);
+			return (EEXIST);
+		}
+	}
+	gp = g_new_geomf(mp, name);
 	if (gp == NULL) {
-		gctl_error(req, "Cannot create geom %s%s.", pp->name,
-		    G_NOP_SUFFIX);
+		gctl_error(req, "Cannot create geom %s.", name);
 		return (ENOMEM);
 	}
 	gp->softc = NULL;
@@ -147,8 +154,7 @@
 
 	newpp = g_new_providerf(gp, gp->name);
 	if (newpp == NULL) {
-		gctl_error(req, "Cannot create provider %s%s.", pp->name,
-		    G_NOP_SUFFIX);
+		gctl_error(req, "Cannot create provider %s.", name);
 		error = ENOMEM;
 		goto fail;
 	}

==== //depot/projects/kse/sys/i386/include/ioctl_meteor.h#2 (text+ko) ====

@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 1995 Mark Tinguely and Jim Lowe
+/*-
+ * Copyright (c) 2003 David O'Brien
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -10,11 +10,6 @@
  * 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 Mark Tinguely and Jim Lowe
- * 4. The name of the author may not be used to endorse or promote products 
- *    derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -28,160 +23,16 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/include/ioctl_meteor.h,v 1.11 1999/12/29 04:33:02 peter Exp $
+ * $FreeBSD: src/sys/i386/include/ioctl_meteor.h,v 1.15 2004/03/12 21:45:30 trhodes Exp $
  */
-/*
- *	ioctl constants for Matrox Meteor Capture card.
- */
 
 #ifndef	_MACHINE_IOCTL_METEOR_H_
 #define	_MACHINE_IOCTL_METEOR_H_
 
-#ifndef _KERNEL
-#include <sys/types.h>
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
+#warning Include dev/bktr/ioctl_meteor.h instead of this header.
 #endif
-#include <sys/ioccom.h>
 
-struct meteor_capframe {
-	short	command;	/* see below for valid METEORCAPFRM commands */
-	short	lowat;		/* start transfer if < this number */
-	short	hiwat;		/* stop transfer if > this number */
-} ;
+#include <dev/bktr/ioctl_meteor.h>
 
-/* structure for METEOR[GS]ETGEO - get/set geometry  */
-struct meteor_geomet {
-	u_short		rows;
-	u_short		columns;
-	u_short		frames;
-	u_long		oformat;
-} ;
-
-/* structure for METEORGCOUNT-get count of frames, fifo errors and dma errors */
-struct meteor_counts {
-	u_long fifo_errors;	/* count of fifo errors since open */
-	u_long dma_errors;	/* count of dma errors since open */
-	u_long frames_captured;	/* count of frames captured since open */
-	u_long even_fields_captured; /* count of even fields captured */
-	u_long odd_fields_captured; /* count of odd fields captured */
-} ;
-
-/* structure for getting and setting direct transfers to vram */
-struct meteor_video {
-	u_long	addr;	/* Address of location to dma to */
-	u_long	width;	/* Width of memory area */
-	u_long	banksize;	/* Size of Vram bank */
-	u_long	ramsize;	/* Size of Vram */
-};
-
-#define METEORCAPTUR _IOW('x', 1, int)			 /* capture a frame */
-#define METEORCAPFRM _IOW('x', 2, struct meteor_capframe)  /* sync capture */
-#define METEORSETGEO _IOW('x', 3, struct meteor_geomet)  /* set geometry */
-#define METEORGETGEO _IOR('x', 4, struct meteor_geomet)  /* get geometry */
-#define METEORSTATUS _IOR('x', 5, unsigned short)	/* get status */
-#define METEORSHUE   _IOW('x', 6, signed char)		/* set hue */
-#define METEORGHUE   _IOR('x', 6, signed char)		/* get hue */
-#define METEORSFMT   _IOW('x', 7, unsigned long)	/* set format */
-#define METEORGFMT   _IOR('x', 7, unsigned long)	/* get format */
-#define METEORSINPUT _IOW('x', 8, unsigned long)	/* set input dev */
-#define METEORGINPUT _IOR('x', 8, unsigned long)	/* get input dev */
-#define	METEORSCHCV  _IOW('x', 9, unsigned char)	/* set uv gain */
-#define	METEORGCHCV  _IOR('x', 9, unsigned char)	/* get uv gain */
-#define	METEORSCOUNT _IOW('x',10, struct meteor_counts)
-#define	METEORGCOUNT _IOR('x',10, struct meteor_counts)
-#define METEORSFPS   _IOW('x',11, unsigned short)	/* set fps */
-#define METEORGFPS   _IOR('x',11, unsigned short)	/* get fps */
-#define METEORSSIGNAL _IOW('x', 12, unsigned int)	/* set signal */
-#define METEORGSIGNAL _IOR('x', 12, unsigned int)	/* get signal */
-#define	METEORSVIDEO _IOW('x', 13, struct meteor_video)	/* set video */
-#define	METEORGVIDEO _IOR('x', 13, struct meteor_video)	/* get video */
-#define	METEORSBRIG  _IOW('x', 14, unsigned char)	/* set brightness */
-#define METEORGBRIG  _IOR('x', 14, unsigned char)	/* get brightness */
-#define	METEORSCSAT  _IOW('x', 15, unsigned char)	/* set chroma sat */
-#define METEORGCSAT  _IOR('x', 15, unsigned char)	/* get uv saturation */
-#define	METEORSCONT  _IOW('x', 16, unsigned char)	/* set contrast */
-#define	METEORGCONT  _IOR('x', 16, unsigned char)	/* get contrast */
-#define METEORSBT254 _IOW('x', 17, unsigned short)	/* set Bt254 reg */
-#define METEORGBT254 _IOR('x', 17, unsigned short)	/* get Bt254 reg */
-#define METEORSHWS   _IOW('x', 18, unsigned char)	/* set hor start reg */
-#define METEORGHWS   _IOR('x', 18, unsigned char)	/* get hor start reg */
-#define METEORSVWS   _IOW('x', 19, unsigned char)	/* set vert start reg */
-#define METEORGVWS   _IOR('x', 19, unsigned char)	/* get vert start reg */
-#define	METEORSTS    _IOW('x', 20, unsigned char)	/* set time stamp */
-#define	METEORGTS    _IOR('x', 20, unsigned char)	/* get time stamp */
-
-#define	METEOR_STATUS_ID_MASK	0xf000	/* ID of 7196 */
-#define	METEOR_STATUS_DIR	0x0800	/* Direction of Expansion port YUV */
-#define	METEOR_STATUS_OEF	0x0200	/* Field detected: Even/Odd */
-#define	METEOR_STATUS_SVP	0x0100	/* State of VRAM Port:inactive/active */
-#define	METEOR_STATUS_STTC	0x0080	/* Time Constant: TV/VCR */
-#define	METEOR_STATUS_HCLK	0x0040	/* Horiz PLL: locked/unlocked */
-#define	METEOR_STATUS_FIDT	0x0020	/* Field detect: 50/60hz */
-#define	METEOR_STATUS_ALTD	0x0002	/* Line alt: no line alt/line alt */
-#define METEOR_STATUS_CODE	0x0001	/* Colour info: no colour/colour */
-
-				/* METEORCAPTUR capture options */
-#define METEOR_CAP_SINGLE	0x0001	/* capture one frame */
-#define METEOR_CAP_CONTINOUS	0x0002	/* continuously capture */
-#define METEOR_CAP_STOP_CONT	0x0004	/* stop the continuous capture */
-
-				/* METEORCAPFRM capture commands */
-#define METEOR_CAP_N_FRAMES	0x0001	/* capture N frames */
-#define METEOR_CAP_STOP_FRAMES	0x0002	/* stop capture N frames */
-#define	METEOR_HALT_N_FRAMES	0x0003	/* halt of capture N frames */
-#define METEOR_CONT_N_FRAMES	0x0004	/* continue after above halt */
-
-				/* valid video input formats:  */
-#define METEOR_FMT_NTSC		0x00100	/* NTSC --  initialized default */
-#define METEOR_FMT_PAL		0x00200	/* PAL */
-#define METEOR_FMT_SECAM	0x00400	/* SECAM */
-#define METEOR_FMT_AUTOMODE	0x00800 /* auto-mode */
-#define METEOR_INPUT_DEV0	0x01000	/* camera input 0 -- default */
-#define METEOR_INPUT_DEV_RCA	METEOR_INPUT_DEV0
-#define METEOR_INPUT_DEV1	0x02000	/* camera input 1 */
-#define METEOR_INPUT_DEV2	0x04000	/* camera input 2 */
-#define METEOR_INPUT_DEV3	0x08000	/* camera input 3 */
-#define METEOR_INPUT_DEV_RGB	0x0a000	/* for rgb version of meteor */
-#define METEOR_INPUT_DEV_SVIDEO	0x06000 /* S-video input port */
-
-				/* valid video output formats:  */
-#define METEOR_GEO_RGB16	0x0010000 /* packed -- initialized default */
-#define METEOR_GEO_RGB24	0x0020000 /* RBG 24 bits packed */
-					  /* internally stored in 32 bits */
-#define METEOR_GEO_YUV_PACKED	0x0040000 /* 4-2-2 YUV 16 bits packed */
-#define METEOR_GEO_YUV_PLANAR	0x0080000 /* 4-2-2 YUV 16 bits planer */
-#define METEOR_GEO_YUV_PLANER	METEOR_GEO_YUV_PLANAR
-#define METEOR_GEO_UNSIGNED	0x0400000 /* unsigned uv outputs */
-#define METEOR_GEO_EVEN_ONLY	0x1000000 /* set for even only field capture */
-#define METEOR_GEO_ODD_ONLY	0x2000000 /* set for odd only field capture */
-#define METEOR_GEO_FIELD_MASK	0x3000000
-#define METEOR_GEO_YUV_422	0x4000000 /* 4-2-2 YUV in Y-U-V combined */
-#define METEOR_GEO_OUTPUT_MASK	0x40f0000
-#define METEOR_GEO_YUV_12	0x10000000	/* YUV 12 format */
-#define METEOR_GEO_YUV_9	0x40000000	/* YUV 9 format */
-
-#define	METEOR_FIELD_MODE	0x80000000	/* Field cap or Frame cap */
-
-#define	METEOR_SIG_MODE_MASK	0xffff0000
-#define	METEOR_SIG_FRAME	0x00000000	/* signal every frame */
-#define	METEOR_SIG_FIELD	0x00010000	/* signal every field */
-
-	/* following structure is used to coordinate the synchronous */
-	   
-struct meteor_mem {
-		/* kernel write only  */
-	int	frame_size;	 /* row*columns*depth */
-	unsigned num_bufs;	 /* number of frames in buffer (1-32) */
-		/* user and kernel change these */
-	int	lowat;		 /* kernel starts capture if < this number */
-	int	hiwat;		 /* kernel stops capture if > this number.
-				    hiwat <= numbufs */
-	unsigned active;	 /* bit mask of active frame buffers
-				    kernel sets, user clears */
-	int	num_active_bufs; /* count of active frame buffer
-				    kernel increments, user decrements */
-
-		/* reference to mmapped data */
-	caddr_t	buf;		 /* The real space (virtual addr) */
-} ;
-
-#endif /* !_MACHINE_IOCTL_METEOR_H_ */
+#endif	/* _MACHINE_IOCTL_METEOR_H_ */

==== //depot/projects/kse/sys/kern/kern_sig.c#72 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.279 2004/06/02 07:52:35 tjr Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.280 2004/06/07 13:35:02 davidxu Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -746,12 +746,18 @@
 	int error;
 
 	error = copyin(uap->set, &set, sizeof(set));
-	if (error)
-		return (error);
+	if (error) {
+		td->td_retval[0] = error;
+		return (0);
+	}
 
 	error = kern_sigtimedwait(td, set, &info, NULL);
-	if (error)
-		return (error);
+	if (error) {
+		if (error == ERESTART)
+			return (error);
+		td->td_retval[0] = error;
+		return (0);
+	}
 
 	error = copyout(&info.si_signo, uap->sig, sizeof(info.si_signo));
 	/* Repost if we got an error. */
@@ -760,7 +766,8 @@
 		tdsignal(td, info.si_signo, SIGTARGET_TD);
 		PROC_UNLOCK(td->td_proc);
 	}
-	return (error);
+	td->td_retval[0] = error;
+	return (0);
 }
 /*
  * MPSAFE

==== //depot/projects/kse/sys/kern/kern_synch.c#83 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_synch.c,v 1.248 2004/05/14 20:51:42 bde Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_synch.c,v 1.249 2004/06/07 09:35:00 tjr Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -171,13 +171,6 @@
 	sq = sleepq_lookup(ident);
 	mtx_lock_spin(&sched_lock);
 
-	/*
-	 * If we are capable of async syscalls and there isn't already
-	 * another one ready to return, start a new thread
-	 * and queue it as ready to run. Note that there is danger here
-	 * because we need to make sure that we don't sleep allocating
-	 * the thread (recursion here might be bad).
-	 */
 	if (p->p_flag & P_SA || p->p_numthreads > 1) {
 		/*
 		 * Just don't bother if we are exiting

==== //depot/projects/kse/sys/kern/uipc_syscalls.c#26 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.186 2004/06/02 04:15:37 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.187 2004/06/07 09:59:50 ume Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -1574,11 +1574,19 @@
 			buflen = MLEN;		/* unix domain compat. hack */
 		else
 #endif
-		return (EINVAL);
+			if ((u_int)buflen > MCLBYTES)
+				return (EINVAL);
 	}
 	m = m_get(M_TRYWAIT, type);
 	if (m == NULL)
 		return (ENOBUFS);
+	if ((u_int)buflen > MLEN) {
+		MCLGET(m, M_TRYWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_free(m);
+			return (ENOBUFS);
+		}
+	}
 	m->m_len = buflen;
 	error = copyin(buf, mtod(m, caddr_t), (u_int)buflen);
 	if (error)

==== //depot/projects/kse/sys/kern/vfs_syscalls.c#40 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.347 2004/06/04 11:00:22 tjr Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.348 2004/06/07 12:19:55 pjd Exp $");
 
 #include "opt_compat.h"
 #include "opt_mac.h"
@@ -4097,7 +4097,7 @@
 		struct statfs *buf;
 	} */ *uap;
 {
-	struct statfs *sp, sb;
+	struct statfs *sp;
 	struct mount *mp;
 	struct vnode *vp;
 	fhandle_t fh;
@@ -4128,11 +4128,6 @@
 	sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
 	if ((error = VFS_STATFS(mp, sp, td)) != 0)
 		return (error);
-	if (suser(td)) {
-		bcopy(sp, &sb, sizeof(sb));
-		sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
-		sp = &sb;
-	}
 	return (copyout(sp, uap->buf, sizeof(*sp)));
 }
 

==== //depot/projects/kse/sys/netinet/ip_icmp.c#15 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)ip_icmp.c	8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.92 2004/05/07 01:24:53 maxim Exp $
+ * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.93 2004/06/07 09:56:59 ume Exp $
  */
 
 #include "opt_ipsec.h"
@@ -154,10 +154,13 @@
 	if (type != ICMP_REDIRECT)
 		icmpstat.icps_error++;
 	/*
+	 * Don't send error if the original packet was encrypted.
 	 * Don't send error if not the first fragment of message.
 	 * Don't error if the old packet protocol was ICMP
 	 * error message, only known informational types.
 	 */
+	if (n->m_flags & M_DECRYPTED)
+		goto freeit;
 	if (oip->ip_off &~ (IP_MF|IP_DF))
 		goto freeit;
 	if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&



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