PERFORCE change 156686 for review

John Baldwin jhb at FreeBSD.org
Mon Jan 26 07:27:03 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=156686

Change 156686 by jhb at jhb_jhbbsd on 2009/01/26 15:26:58

	IFC @156684

Affected files ...

.. //depot/projects/smpng/sys/cam/cam_periph.c#29 integrate
.. //depot/projects/smpng/sys/conf/files.powerpc#46 integrate
.. //depot/projects/smpng/sys/contrib/pf/net/pf_ioctl.c#29 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iic.c#18 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iic.h#4 integrate
.. //depot/projects/smpng/sys/dev/ppbus/ppbconf.c#12 integrate
.. //depot/projects/smpng/sys/dev/sound/macio/aoa.c#1 branch
.. //depot/projects/smpng/sys/dev/sound/macio/aoa.h#1 branch
.. //depot/projects/smpng/sys/dev/sound/macio/davbus.c#1 branch
.. //depot/projects/smpng/sys/dev/sound/macio/davbusreg.h#1 branch
.. //depot/projects/smpng/sys/dev/sound/macio/i2s.c#1 branch
.. //depot/projects/smpng/sys/dev/sound/macio/snapper.c#1 branch
.. //depot/projects/smpng/sys/dev/sound/macio/tumbler.c#1 branch
.. //depot/projects/smpng/sys/dev/speaker/spkr.c#6 integrate
.. //depot/projects/smpng/sys/fs/fifofs/fifo_vnops.c#47 integrate
.. //depot/projects/smpng/sys/geom/geom_dev.c#50 integrate
.. //depot/projects/smpng/sys/kern/imgact_elf.c#63 integrate
.. //depot/projects/smpng/sys/kern/kern_jail.c#62 integrate
.. //depot/projects/smpng/sys/kern/kern_malloc.c#52 integrate
.. //depot/projects/smpng/sys/kern/kern_timeout.c#45 integrate
.. //depot/projects/smpng/sys/kern/sched_4bsd.c#89 integrate
.. //depot/projects/smpng/sys/kern/sched_ule.c#92 integrate
.. //depot/projects/smpng/sys/kern/sys_generic.c#55 integrate
.. //depot/projects/smpng/sys/kern/tty.c#82 integrate
.. //depot/projects/smpng/sys/kern/tty_pty.c#55 integrate
.. //depot/projects/smpng/sys/modules/sound/driver/Makefile#12 integrate
.. //depot/projects/smpng/sys/modules/sound/driver/ai2s/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/sound/driver/davbus/Makefile#1 branch
.. //depot/projects/smpng/sys/net/rtsock.c#68 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ioctl.c#40 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.c#90 integrate
.. //depot/projects/smpng/sys/netinet/raw_ip.c#75 integrate
.. //depot/projects/smpng/sys/netinet6/raw_ip6.c#56 integrate
.. //depot/projects/smpng/sys/powerpc/conf/GENERIC#53 integrate
.. //depot/projects/smpng/sys/powerpc/conf/NOTES#13 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/intr_machdep.c#18 integrate
.. //depot/projects/smpng/sys/security/mac/mac_audit.c#3 integrate
.. //depot/projects/smpng/sys/security/mac/mac_framework.c#4 integrate
.. //depot/projects/smpng/sys/security/mac/mac_priv.c#3 integrate
.. //depot/projects/smpng/sys/sys/jail.h#21 integrate
.. //depot/projects/smpng/sys/sys/pcpu.h#24 integrate
.. //depot/projects/smpng/sys/vm/uma.h#24 integrate
.. //depot/projects/smpng/sys/vm/uma_core.c#75 integrate
.. //depot/projects/smpng/sys/vm/uma_dbg.c#16 integrate
.. //depot/projects/smpng/sys/vm/uma_int.h#32 integrate

Differences ...

==== //depot/projects/smpng/sys/cam/cam_periph.c#29 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.75 2009/01/23 21:03:59 trasz Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.76 2009/01/26 15:01:47 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -326,7 +326,6 @@
 int
 cam_periph_hold(struct cam_periph *periph, int priority)
 {
-	struct mtx *mtx;
 	int error;
 
 	/*
@@ -339,14 +338,11 @@
 	if (cam_periph_acquire(periph) != CAM_REQ_CMP)
 		return (ENXIO);
 
-	mtx = periph->sim->mtx;
-	mtx_assert(mtx, MA_OWNED);
-	if (mtx == &Giant)
-		mtx = NULL;
-
+	mtx_assert(periph->sim->mtx, MA_OWNED);
 	while ((periph->flags & CAM_PERIPH_LOCKED) != 0) {
 		periph->flags |= CAM_PERIPH_LOCK_WANTED;
-		if ((error = msleep(periph, mtx, priority, "caplck", 0)) != 0) {
+		if ((error = mtx_sleep(periph, periph->sim->mtx, priority,
+		    "caplck", 0)) != 0) {
 			cam_periph_release_locked(periph);
 			return (error);
 		}
@@ -767,7 +763,6 @@
 cam_periph_getccb(struct cam_periph *periph, u_int32_t priority)
 {
 	struct ccb_hdr *ccb_h;
-	struct mtx *mtx;
 
 	mtx_assert(periph->sim->mtx, MA_OWNED);
 	CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdgetccb\n"));
@@ -780,11 +775,8 @@
 		 && (SLIST_FIRST(&periph->ccb_list)->pinfo.priority == priority))
 			break;
 		mtx_assert(periph->sim->mtx, MA_OWNED);
-		if (periph->sim->mtx == &Giant)
-			mtx = NULL;
-		else
-			mtx = periph->sim->mtx;
-		msleep(&periph->ccb_list, mtx, PRIBIO, "cgticb", 0);
+		mtx_sleep(&periph->ccb_list, periph->sim->mtx, PRIBIO, "cgticb",
+		    0);
 	}
 
 	ccb_h = SLIST_FIRST(&periph->ccb_list);
@@ -795,17 +787,12 @@
 void
 cam_periph_ccbwait(union ccb *ccb)
 {
-	struct mtx *mtx;
 	struct cam_sim *sim;
 
 	sim = xpt_path_sim(ccb->ccb_h.path);
-	if (sim->mtx == &Giant)
-		mtx = NULL;
-	else
-		mtx = sim->mtx;
 	if ((ccb->ccb_h.pinfo.index != CAM_UNQUEUED_INDEX)
 	 || ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG))
-		msleep(&ccb->ccb_h.cbfcnp, mtx, PRIBIO, "cbwait", 0);
+		mtx_sleep(&ccb->ccb_h.cbfcnp, sim->mtx, PRIBIO, "cbwait", 0);
 }
 
 int

==== //depot/projects/smpng/sys/conf/files.powerpc#46 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.powerpc,v 1.91 2009/01/15 02:52:31 nwhitehorn Exp $
+# $FreeBSD: src/sys/conf/files.powerpc,v 1.92 2009/01/25 18:20:15 nwhitehorn Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -39,6 +39,11 @@
 dev/powermac_nvram/powermac_nvram.c optional	powermac_nvram powermac
 dev/quicc/quicc_bfe_ocp.c	optional	quicc mpc85xx
 dev/scc/scc_bfe_macio.c		optional	scc powermac
+dev/sound/macio/aoa.c		optional	snd_davbus | snd_ai2s powermac
+dev/sound/macio/davbus.c	optional	snd_davbus powermac
+dev/sound/macio/i2s.c		optional	snd_ai2s powermac
+dev/sound/macio/snapper.c	optional	snd_ai2s iicbus powermac
+dev/sound/macio/tumbler.c	optional	snd_ai2s iicbus powermac
 dev/syscons/scgfbrndr.c		optional	sc
 dev/syscons/scterm-teken.c	optional	sc
 dev/syscons/scvtb.c		optional	sc

==== //depot/projects/smpng/sys/contrib/pf/net/pf_ioctl.c#29 (text+ko) ====

@@ -40,7 +40,7 @@
 #include "opt_inet6.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.38 2008/12/02 21:37:28 bz Exp $");
+__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.41 2009/01/25 16:52:41 ed Exp $");
 #endif
 
 #ifdef __FreeBSD__

==== //depot/projects/smpng/sys/dev/iicbus/iic.c#18 (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/iicbus/iic.c,v 1.42 2009/01/15 23:14:59 nwhitehorn Exp $
+ * $FreeBSD: src/sys/dev/iicbus/iic.c,v 1.43 2009/01/26 13:53:39 raj Exp $
  *
  */
 #include <sys/param.h>
@@ -368,6 +368,11 @@
 		}
 		free(usrbufs, M_TEMP);
 		break;
+
+	case I2CRPTSTART:
+		error = iicbus_repeated_start(parent, s->slave, 0);
+		break;
+
 	default:
 		error = ENOTTY;
 	}

==== //depot/projects/smpng/sys/dev/iicbus/iic.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/iicbus/iic.h,v 1.5 2006/11/28 06:51:36 imp Exp $
+ * $FreeBSD: src/sys/dev/iicbus/iic.h,v 1.6 2009/01/26 13:53:39 raj Exp $
  *
  */
 #ifndef __IIC_H
@@ -60,5 +60,6 @@
 #define I2CWRITE	_IOW('i', 4, struct iiccmd)	/* send data */
 #define I2CREAD		_IOW('i', 5, struct iiccmd)	/* receive data */
 #define I2CRDWR		_IOW('i', 6, struct iic_rdwr_data)	/* General read/write interface */
+#define I2CRPTSTART	_IOW('i', 7, struct iiccmd)	/* repeated start */
 
 #endif

==== //depot/projects/smpng/sys/dev/ppbus/ppbconf.c#12 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ppbus/ppbconf.c,v 1.32 2009/01/21 23:10:06 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ppbus/ppbconf.c,v 1.33 2009/01/26 14:12:12 jhb Exp $");
 #include "opt_ppb_1284.h"
 
 #include <sys/param.h>
@@ -393,8 +393,10 @@
 	ppb->ppc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_SHAREABLE);
 	if (ppb->ppc_irq_res != NULL) {
+		mtx_lock(ppb->ppc_lock);
 		error = BUS_WRITE_IVAR(device_get_parent(dev), dev,
 		    PPC_IVAR_INTR_HANDLER, (uintptr_t)&ppbus_intr);
+		mtx_unlock(ppb->ppc_lock);
 		if (error) {
 			device_printf(dev, "Unable to set interrupt handler\n");
 			return (error);

==== //depot/projects/smpng/sys/dev/speaker/spkr.c#6 (text+ko) ====

@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/speaker/spkr.c,v 1.77 2008/09/27 08:51:18 ed Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/speaker/spkr.c,v 1.78 2009/01/25 09:20:59 ed Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -419,9 +419,7 @@
 	(void) printf("spkropen: entering with dev = %s\n", devtoname(dev));
 #endif /* DEBUG */
 
-	if (dev2unit(dev) != 0)
-		return(ENXIO);
-	else if (spkr_active)
+	if (spkr_active)
 		return(EBUSY);
 	else {
 #ifdef DEBUG
@@ -444,9 +442,8 @@
 	printf("spkrwrite: entering with dev = %s, count = %d\n",
 		devtoname(dev), uio->uio_resid);
 #endif /* DEBUG */
-	if (dev2unit(dev) != 0)
-		return(ENXIO);
-	else if (uio->uio_resid > (DEV_BSIZE - 1))     /* prevent system crashes */
+
+	if (uio->uio_resid > (DEV_BSIZE - 1))     /* prevent system crashes */
 		return(E2BIG);	
 	else {
 		unsigned n;
@@ -475,15 +472,11 @@
 	(void) printf("spkrclose: entering with dev = %s\n", devtoname(dev));
 #endif /* DEBUG */
 
-	if (dev2unit(dev) != 0)
-		return(ENXIO);
-	else {
-		wakeup(&endtone);
-		wakeup(&endrest);
-		free(spkr_inbuf, M_SPKR);
-		spkr_active = FALSE;
-		return(0);
-	}
+	wakeup(&endtone);
+	wakeup(&endrest);
+	free(spkr_inbuf, M_SPKR);
+	spkr_active = FALSE;
+	return(0);
 }
 
 static int
@@ -499,9 +492,7 @@
     		devtoname(dev), cmd);
 #endif /* DEBUG */
 
-	if (dev2unit(dev) != 0)
-		return(ENXIO);
-	else if (cmd == SPKRTONE) {
+	if (cmd == SPKRTONE) {
 		tone_t	*tp = (tone_t *)cmdarg;
 
 		if (tp->frequency == 0)

==== //depot/projects/smpng/sys/fs/fifofs/fifo_vnops.c#47 (text+ko) ====

@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)fifo_vnops.c	8.10 (Berkeley) 5/27/95
- * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.145 2008/10/23 15:53:51 des Exp $
+ * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.146 2009/01/26 14:21:00 kib Exp $
  */
 
 #include <sys/param.h>
@@ -423,7 +423,10 @@
 	struct fifoinfo *fip = vp->v_fifoinfo;
 
 	ASSERT_VOP_LOCKED(vp, "fifo_close");
-	KASSERT(fip != NULL, ("fifo_close: no v_fifoinfo"));
+	if (fip == NULL) {
+		printf("fifo_close: no v_fifoinfo %p\n", vp);
+		return (0);
+	}
 	if (ap->a_fflag & FREAD) {
 		fip->fi_readers--;
 		if (fip->fi_readers == 0)

==== //depot/projects/smpng/sys/geom/geom_dev.c#50 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.99 2008/09/26 14:19:52 ed Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.100 2009/01/24 18:23:19 ed Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -72,25 +72,14 @@
 
 static g_taste_t g_dev_taste;
 static g_orphan_t g_dev_orphan;
-static g_init_t		g_dev_init;
 
 static struct g_class g_dev_class	= {
 	.name = "DEV",
 	.version = G_VERSION,
 	.taste = g_dev_taste,
 	.orphan = g_dev_orphan,
-	.init = g_dev_init,
 };
 
-static struct unrhdr *unithdr;	/* Locked by topology */
-
-static void
-g_dev_init(struct g_class *mp)
-{
-
-	unithdr = new_unrhdr(0, INT_MAX, NULL);
-}
-
 void
 g_dev_print(void)
 {
@@ -126,7 +115,6 @@
 	struct g_consumer *cp;
 	int error;
 	struct cdev *dev;
-	u_int unit;
 
 	g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
 	g_topology_assert();
@@ -138,8 +126,7 @@
 	error = g_attach(cp, pp);
 	KASSERT(error == 0,
 	    ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error));
-	unit = alloc_unr(unithdr);
-	dev = make_dev(&g_dev_cdevsw, unit,
+	dev = make_dev(&g_dev_cdevsw, 0,
 	    UID_ROOT, GID_OPERATOR, 0640, gp->name);
 	if (pp->flags & G_PF_CANDELETE)
 		dev->si_flags |= SI_CANDELETE;
@@ -432,7 +419,6 @@
 {
 	struct g_geom *gp;
 	struct cdev *dev;
-	u_int unit;
 
 	g_topology_assert();
 	gp = cp->geom;
@@ -444,9 +430,7 @@
 		set_dumper(NULL);
 
 	/* Destroy the struct cdev *so we get no more requests */
-	unit = dev2unit(dev);
 	destroy_dev(dev);
-	free_unr(unithdr, unit);
 
 	/* Wait for the cows to come home */
 	while (cp->nstart != cp->nend)

==== //depot/projects/smpng/sys/kern/imgact_elf.c#63 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/imgact_elf.c,v 1.191 2008/12/17 16:54:29 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/imgact_elf.c,v 1.192 2009/01/25 12:07:43 rwatson Exp $");
 
 #include "opt_compat.h"
 
@@ -822,7 +822,8 @@
 			uprintf("ELF interpreter %s not found\n", interp);
 			return (error);
 		}
-	}
+	} else
+		addr = 0;
 
 	/*
 	 * Construct auxargs table (used by the fixup routine)

==== //depot/projects/smpng/sys/kern/kern_jail.c#62 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_jail.c,v 1.91 2009/01/04 12:18:18 bz Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_jail.c,v 1.92 2009/01/25 10:11:58 bz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -812,7 +812,7 @@
  * Returns 0 on success, 1 on error.  Address returned in NBO.
  */
 int
-prison_getip4(struct ucred *cred, struct in_addr *ia)
+prison_get_ip4(struct ucred *cred, struct in_addr *ia)
 {
 
 	KASSERT(cred != NULL, ("%s: cred is NULL", __func__));
@@ -958,7 +958,7 @@
  * Returns 0 on success, 1 on error.
  */
 int
-prison_getip6(struct ucred *cred, struct in6_addr *ia6)
+prison_get_ip6(struct ucred *cred, struct in6_addr *ia6)
 {
 
 	KASSERT(cred != NULL, ("%s: cred is NULL", __func__));

==== //depot/projects/smpng/sys/kern/kern_malloc.c#52 (text+ko) ====

@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_malloc.c,v 1.167 2008/07/05 19:34:33 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_malloc.c,v 1.168 2009/01/25 09:11:24 jeff Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kdtrace.h"
@@ -329,7 +329,6 @@
 	int indx;
 	caddr_t va;
 	uma_zone_t zone;
-	uma_keg_t keg;
 #if defined(DIAGNOSTIC) || defined(DEBUG_REDZONE)
 	unsigned long osize = size;
 #endif
@@ -378,18 +377,16 @@
 			size = (size & ~KMEM_ZMASK) + KMEM_ZBASE;
 		indx = kmemsize[size >> KMEM_ZSHIFT];
 		zone = kmemzones[indx].kz_zone;
-		keg = zone->uz_keg;
 #ifdef MALLOC_PROFILE
 		krequests[size >> KMEM_ZSHIFT]++;
 #endif
 		va = uma_zalloc(zone, flags);
 		if (va != NULL)
-			size = keg->uk_size;
+			size = zone->uz_size;
 		malloc_type_zone_allocated(mtp, va == NULL ? 0 : size, indx);
 	} else {
 		size = roundup(size, PAGE_SIZE);
 		zone = NULL;
-		keg = NULL;
 		va = uma_large_malloc(size, flags);
 		malloc_type_allocated(mtp, va == NULL ? 0 : size);
 	}

==== //depot/projects/smpng/sys/kern/kern_timeout.c#45 (text+ko) ====

@@ -35,9 +35,10 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_timeout.c,v 1.117 2009/01/13 15:56:53 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_timeout.c,v 1.118 2009/01/24 10:22:49 rwatson Exp $");
 
 #include "opt_ddb.h"
+#include "opt_kdtrace.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -51,6 +52,7 @@
 #include <sys/malloc.h>
 #include <sys/mutex.h>
 #include <sys/proc.h>
+#include <sys/sdt.h>
 #include <sys/sleepqueue.h>
 #include <sys/sysctl.h>
 #include <sys/smp.h>
@@ -59,6 +61,14 @@
 #include <ddb/db_sym.h>
 #endif
 
+SDT_PROVIDER_DEFINE(callout_execute);
+SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start);
+SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0,
+    "struct callout *");
+SDT_PROBE_DEFINE(callout_execute, kernel, , callout_end); 
+SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_end, 0,
+    "struct callout *");
+
 static int avg_depth;
 SYSCTL_INT(_debug, OID_AUTO, to_avg_depth, CTLFLAG_RD, &avg_depth, 0,
     "Average number of items examined per softclock call. Units = 1/1000");
@@ -401,7 +411,11 @@
 				binuptime(&bt1);
 #endif
 				THREAD_NO_SLEEPING();
+				SDT_PROBE(callout_execute, kernel, ,
+				    callout_start, c, 0, 0, 0, 0);
 				c_func(c_arg);
+				SDT_PROBE(callout_execute, kernel, ,
+				    callout_end, c, 0, 0, 0, 0);
 				THREAD_SLEEPING_OK();
 #ifdef DIAGNOSTIC
 				binuptime(&bt2);

==== //depot/projects/smpng/sys/kern/sched_4bsd.c#89 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.130 2009/01/17 07:17:57 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.131 2009/01/25 07:35:10 jeff Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_sched.h"
@@ -82,7 +82,7 @@
 #endif
 #define	NICE_WEIGHT		1	/* Priorities per nice level. */
 
-#define	TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__STRING(UINT_MAX)))
+#define	TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX)))
 
 /*
  * The schedulable entity that runs a context.

==== //depot/projects/smpng/sys/kern/sched_ule.c#92 (text+ko) ====

@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.251 2009/01/17 07:17:57 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.252 2009/01/25 07:35:10 jeff Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_kdtrace.h"
@@ -86,8 +86,8 @@
 
 #define	KTR_ULE	0
 
-#define	TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__STRING(UINT_MAX)))
-#define	TDQ_NAME_LEN	(sizeof("sched lock ") + sizeof(__STRING(MAXCPU)))
+#define	TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX)))
+#define	TDQ_NAME_LEN	(sizeof("sched lock ") + sizeof(__XSTRING(MAXCPU)))
 #define	TDQ_LOADNAME_LEN	(PCPU_NAME_LEN + sizeof(" load"))
 
 /*

==== //depot/projects/smpng/sys/kern/sys_generic.c#55 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sys_generic.c,v 1.165 2008/09/23 14:25:38 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sys_generic.c,v 1.168 2009/01/25 18:38:42 jeff Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -886,6 +886,71 @@
 
 	return (error);
 }
+/* 
+ * Convert a select bit set to poll flags.
+ *
+ * The backend always returns POLLHUP/POLLERR if appropriate and we
+ * return this as a set bit in any set.
+ */
+static int select_flags[3] = {
+    POLLRDNORM | POLLHUP | POLLERR,
+    POLLWRNORM | POLLHUP | POLLERR,
+    POLLRDBAND | POLLHUP | POLLERR
+};
+
+/*
+ * Compute the fo_poll flags required for a fd given by the index and
+ * bit position in the fd_mask array.
+ */
+static __inline int
+selflags(fd_mask **ibits, int idx, int bit)
+{
+	int flags;
+	int msk;
+
+	flags = 0;
+	for (msk = 0; msk < 3; msk++) {
+		if (ibits[msk] == NULL)
+			continue;
+		if ((ibits[msk][idx] & (fd_mask)bit) == 0)
+			continue;
+		flags |= select_flags[msk];
+	}
+	return (flags);
+}
+
+/*
+ * Set the appropriate output bits given a mask of fired events and the
+ * input bits originally requested.
+ */
+static __inline int
+selsetbits(fd_mask **ibits, fd_mask **obits, int idx, fd_mask bit, int events)
+{
+	int msk;
+	int n;
+
+	n = 0;
+	for (msk = 0; msk < 3; msk++) {
+		if ((events & select_flags[msk]) == 0)
+			continue;
+		if (ibits[msk] == NULL)
+			continue;
+		if ((ibits[msk][idx] & bit) == 0)
+			continue;
+		/*
+		 * XXX Check for a duplicate set.  This can occur because a
+		 * socket calls selrecord() twice for each poll() call
+		 * resulting in two selfds per real fd.  selrescan() will
+		 * call selsetbits twice as a result.
+		 */
+		if ((obits[msk][idx] & bit) != 0)
+			continue;
+		obits[msk][idx] |= bit;
+		n++;
+	}
+
+	return (n);
+}
 
 /*
  * Traverse the list of fds attached to this thread's seltd and check for
@@ -894,18 +959,18 @@
 static int
 selrescan(struct thread *td, fd_mask **ibits, fd_mask **obits)
 {
+	struct filedesc *fdp;
+	struct selinfo *si;
 	struct seltd *stp;
 	struct selfd *sfp;
 	struct selfd *sfn;
-	struct selinfo *si;
 	struct file *fp;
-	int msk, fd;
-	int n = 0;
-	/* Note: backend also returns POLLHUP/POLLERR if appropriate. */
-	static int flag[3] = { POLLRDNORM, POLLWRNORM, POLLRDBAND };
-	struct filedesc *fdp = td->td_proc->p_fd;
+	fd_mask bit;
+	int fd, ev, n, idx;
 
+	fdp = td->td_proc->p_fd;
 	stp = td->td_sel;
+	n = 0;
 	FILEDESC_SLOCK(fdp);
 	STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) {
 		fd = (int)(uintptr_t)sfp->sf_cookie;
@@ -918,18 +983,11 @@
 			FILEDESC_SUNLOCK(fdp);
 			return (EBADF);
 		}
-		for (msk = 0; msk < 3; msk++) {
-			if (ibits[msk] == NULL)
-				continue;
-			if ((ibits[msk][fd/NFDBITS] &
-			    ((fd_mask) 1 << (fd % NFDBITS))) == 0)
-				continue;
-			if (fo_poll(fp, flag[msk], td->td_ucred, td)) {
-				obits[msk][(fd)/NFDBITS] |=
-				    ((fd_mask)1 << ((fd) % NFDBITS));
-				n++;
-			}
-		}
+		idx = fd / NFDBITS;
+		bit = (fd_mask)1 << (fd % NFDBITS);
+		ev = fo_poll(fp, selflags(ibits, idx, bit), td->td_ucred, td);
+		if (ev != 0)
+			n += selsetbits(ibits, obits, idx, bit, ev);
 	}
 	FILEDESC_SUNLOCK(fdp);
 	stp->st_flags = 0;
@@ -947,38 +1005,33 @@
 	fd_mask **ibits, **obits;
 	int nfd;
 {
-	int msk, i, fd;
-	fd_mask bits;
+	struct filedesc *fdp;
 	struct file *fp;
-	int n = 0;
-	/* Note: backend also returns POLLHUP/POLLERR if appropriate. */
-	static int flag[3] = { POLLRDNORM, POLLWRNORM, POLLRDBAND };
-	struct filedesc *fdp = td->td_proc->p_fd;
+	fd_mask bit;
+	int ev, flags, end, fd;
+	int n, idx;
 
+	fdp = td->td_proc->p_fd;
+	n = 0;
 	FILEDESC_SLOCK(fdp);
-	for (msk = 0; msk < 3; msk++) {
-		if (ibits[msk] == NULL)
-			continue;
-		for (i = 0; i < nfd; i += NFDBITS) {
-			bits = ibits[msk][i/NFDBITS];
-			/* ffs(int mask) not portable, fd_mask is long */
-			for (fd = i; bits && fd < nfd; fd++, bits >>= 1) {
-				if (!(bits & 1))
-					continue;
-				if ((fp = fget_locked(fdp, fd)) == NULL) {
-					FILEDESC_SUNLOCK(fdp);
-					return (EBADF);
-				}
-				selfdalloc(td, (void *)(uintptr_t)fd);
-				if (fo_poll(fp, flag[msk], td->td_ucred,
-				    td)) {
-					obits[msk][(fd)/NFDBITS] |=
-					    ((fd_mask)1 << ((fd) % NFDBITS));
-					n++;
-				}
+	for (idx = 0, fd = 0; fd < nfd; idx++) {
+		end = imin(fd + NFDBITS, nfd);
+		for (bit = 1; fd < end; bit <<= 1, fd++) {
+			/* Compute the list of events we're interested in. */
+			flags = selflags(ibits, idx, bit);
+			if (flags == 0)
+				continue;
+			if ((fp = fget_locked(fdp, fd)) == NULL) {
+				FILEDESC_SUNLOCK(fdp);
+				return (EBADF);
 			}
+			selfdalloc(td, (void *)(uintptr_t)fd);
+			ev = fo_poll(fp, flags, td->td_ucred, td);
+			if (ev != 0)
+				n += selsetbits(ibits, obits, idx, bit, ev);
 		}
 	}
+
 	FILEDESC_SUNLOCK(fdp);
 	td->td_retval[0] = n;
 	return (0);

==== //depot/projects/smpng/sys/kern/tty.c#82 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.304 2009/01/02 23:39:29 ed Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.305 2009/01/24 18:20:15 ed Exp $");
 
 #include "opt_compat.h"
 
@@ -1053,7 +1053,7 @@
 	return (error);
 }
 
-SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTYPE_OPAQUE|CTLFLAG_RD,
+SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_NOLOCK,
 	0, 0, sysctl_kern_ttys, "S,xtty", "List of TTYs");
 
 /*

==== //depot/projects/smpng/sys/kern/tty_pty.c#55 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/tty_pty.c,v 1.161 2008/08/23 16:03:00 ed Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/tty_pty.c,v 1.162 2009/01/25 08:27:11 ed Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -55,16 +55,15 @@
 static int
 ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp)
 {
-	int u, error;
-	char name[] = "ttyXX";
+	int error;
+	char name[6]; /* "ttyXX" */
 
 	if (!atomic_cmpset_ptr((uintptr_t *)&dev->si_drv1, 0, 1))
 		return (EBUSY);
 
 	/* Generate device name and create PTY. */
-	u = dev2unit(dev);
-	name[3] = u >> 8;
-	name[4] = u;
+	strcpy(name, devtoname(dev));
+	name[0] = 't';
 
 	error = pts_alloc_external(fflags & (FREAD|FWRITE), td, fp, dev, name);
 	if (error != 0) {
@@ -93,7 +92,6 @@
 pty_clone(void *arg, struct ucred *cr, char *name, int namelen,
     struct cdev **dev)
 {
-	int u;
 
 	/* Cloning is already satisfied. */
 	if (*dev != NULL)
@@ -114,8 +112,7 @@
 		return;
 
 	/* Create the controller device node. */
-	u = (unsigned int)name[3] << 8 | name[4];
-	*dev = make_dev_credf(MAKEDEV_REF, &ptydev_cdevsw, u,
+	*dev = make_dev_credf(MAKEDEV_REF, &ptydev_cdevsw, 0,
 	    NULL, UID_ROOT, GID_WHEEL, 0666, name);
 }
 

==== //depot/projects/smpng/sys/modules/sound/driver/Makefile#12 (text+ko) ====

@@ -1,15 +1,22 @@
-# $FreeBSD: src/sys/modules/sound/driver/Makefile,v 1.26 2008/05/04 16:02:45 marius Exp $
+# $FreeBSD: src/sys/modules/sound/driver/Makefile,v 1.27 2009/01/25 18:20:15 nwhitehorn Exp $
+
+SUBDIR=		ad1816 als4000 atiixp cs4281 csa ds1 emu10k1 emu10kx
+SUBDIR+=	envy24 envy24ht es137x ess fm801 hda ich maestro maestro3
+SUBDIR+=	neomagic sb16 sb8 sbc solo spicds t4dwave via8233
+SUBDIR+=	via82c686 vibes driver uaudio
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+SUBDIR+=	cmi mss
+.endif
 
 .if ${MACHINE_ARCH} == "sparc64"
 .if ${MACHINE} == "sparc64"
-audiocs=	audiocs
+SUBDIR+=	audiocs
+.endif
 .endif
-SUBDIR=	${audiocs} es137x
-.else
-SUBDIR=		ad1816 als4000 atiixp cmi cs4281 csa ds1 emu10k1 emu10kx
-SUBDIR+=	envy24 envy24ht es137x ess fm801 hda ich maestro maestro3
-SUBDIR+=	mss neomagic sb16 sb8 sbc solo spicds t4dwave via8233
-SUBDIR+=	via82c686 vibes driver uaudio
+
+.if ${MACHINE_ARCH} == "powerpc"
+SUBDIR+=	ai2s davbus
 .endif
 
 .include <bsd.subdir.mk>

==== //depot/projects/smpng/sys/net/rtsock.c#68 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)rtsock.c	8.7 (Berkeley) 10/12/95
- * $FreeBSD: src/sys/net/rtsock.c,v 1.164 2009/01/16 09:01:45 qingli Exp $
+ * $FreeBSD: src/sys/net/rtsock.c,v 1.165 2009/01/25 10:11:58 bz Exp $
  */
 #include "opt_sctp.h"
 #include "opt_mpath.h"
@@ -376,7 +376,7 @@
 				 * 3. As a last resort return the 'default'
 				 * jail address.
 				 */
-				if (prison_getip4(cred, &ia) != 0)
+				if (prison_get_ip4(cred, &ia) != 0)
 					return (ESRCH);
 			}
 			bzero(&saun->sin, sizeof(struct sockaddr_in));
@@ -428,7 +428,7 @@
 				 * 3. As a last resort return the 'default'
 				 * jail address.
 				 */
-				if (prison_getip6(cred, &ia6) != 0)
+				if (prison_get_ip6(cred, &ia6) != 0)
 					return (ESRCH);
 			}
 			bzero(&saun->sin6, sizeof(struct sockaddr_in6));

==== //depot/projects/smpng/sys/net80211/ieee80211_ioctl.c#40 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.72 2009/01/11 18:59:14 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.73 2009/01/25 07:31:51 thompsa Exp $");
 
 /*
  * IEEE 802.11 ioctl support (FreeBSD-specific)
@@ -42,6 +42,7 @@
 #include <sys/socket.h>
 #include <sys/sockio.h>
 #include <sys/systm.h>
+#include <sys/taskqueue.h>
  
 #include <net/if.h>
 #include <net/if_dl.h>
@@ -3233,6 +3234,8 @@
 			ieee80211_stop_locked(vap);
 		}
 		IEEE80211_UNLOCK(ic);
+		/* Wait for parent ioctl handler if it was queued */
+		taskqueue_drain(taskqueue_thread, &ic->ic_parent_task);
 		break;
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:

==== //depot/projects/smpng/sys/netinet/in_pcb.c#90 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet/in_pcb.c,v 1.239 2009/01/09 18:38:57 adrian Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet/in_pcb.c,v 1.240 2009/01/25 10:11:58 bz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -625,7 +625,7 @@
 		}
 
 		/* 3. As a last resort return the 'default' jail address. */
-		if (prison_getip4(cred, laddr) != 0)
+		if (prison_get_ip4(cred, laddr) != 0)
 			error = EADDRNOTAVAIL;
 		goto done;
 	}
@@ -678,7 +678,7 @@
 		}
 
 		/* 3. As a last resort return the 'default' jail address. */
-		if (prison_getip4(cred, laddr) != 0)
+		if (prison_get_ip4(cred, laddr) != 0)
 			error = EADDRNOTAVAIL;
 		goto done;
 	}
@@ -741,7 +741,7 @@
 		}
 
 		/* 3. As a last resort return the 'default' jail address. */
-		if (prison_getip4(cred, laddr) != 0)
+		if (prison_get_ip4(cred, laddr) != 0)
 			error = EADDRNOTAVAIL;
 		goto done;
 	}
@@ -810,7 +810,7 @@
 		 */
 		if (faddr.s_addr == INADDR_ANY) {
 			if (cred != NULL && jailed(cred)) {
-				if (prison_getip4(cred, &jailia) != 0)
+				if (prison_get_ip4(cred, &jailia) != 0)
 					return (EADDRNOTAVAIL);
 				faddr.s_addr = jailia.s_addr;
 			} else {

==== //depot/projects/smpng/sys/netinet/raw_ip.c#75 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet/raw_ip.c,v 1.203 2008/12/16 03:18:59 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet/raw_ip.c,v 1.204 2009/01/25 10:11:58 bz Exp $");

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list