From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 00:20:10 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D3B0F1065677;
	Sun,  7 Oct 2012 00:20:09 +0000 (UTC)
	(envelope-from marcel@xcllnt.net)
Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4])
	by mx1.freebsd.org (Postfix) with ESMTP id 904558FC1B;
	Sun,  7 Oct 2012 00:20:07 +0000 (UTC)
Received: from sa-nc-cs-116.static.jnpr.net (natint3.juniper.net
	[66.129.224.36]) (authenticated bits=0)
	by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q970JwEl048542
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
	Sat, 6 Oct 2012 17:20:00 -0700 (PDT)
	(envelope-from marcel@xcllnt.net)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Marcel Moolenaar <marcel@xcllnt.net>
In-Reply-To: <5070A4FC.4080802@FreeBSD.org>
Date: Sat, 6 Oct 2012 17:19:52 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <31A2ABA0-49C8-458B-A055-152C3266D9B0@xcllnt.net>
References: <201210062001.q96K16Or030755@svn.freebsd.org>
	<5070A4FC.4080802@FreeBSD.org>
To: Dimitry Andric <dim@FreeBSD.org>
X-Mailer: Apple Mail (2.1499)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r241298 - in head: . gnu/usr.bin/cc/cc_int
	gnu/usr.bin/cc/include kerberos5 kerberos5/tools/asn1_compile
	kerberos5/tools/slc lib/clang/include share/mk
	tools/build/make_check usr.sbin/c...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 00:20:10 -0000


On Oct 6, 2012, at 2:39 PM, Dimitry Andric <dim@FreeBSD.org> wrote:

> On 2012-10-06 22:01, Marcel Moolenaar wrote:
>>   2.  Remove the use of -E. It's not needed in our build because we =
use ?=3D for
>>       the respective variables, which means that we'll take the =
environment
>>       value (if any) anyway.
>=20
> No, this will break builds of 32-bit libraries on amd64, at least when
> CC/CXX etc are set in make.conf.  I put this in specifically in =
r227120.
>=20
> Please revert this particular change, unless you have tested that it
> works correctly, with e.g.  CC=3Dclang in make.conf.

I'll double-check to make sure all is fine. I'll revert if I hit
a problem and don't have an immediate fix for it.

FYI,

--=20
Marcel Moolenaar
marcel@xcllnt.net



From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 01:58:33 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 6FF671065686;
	Sun,  7 Oct 2012 01:58:33 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5A2488FC19;
	Sun,  7 Oct 2012 01:58:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q971wXiZ089976;
	Sun, 7 Oct 2012 01:58:33 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q971wXQk089972;
	Sun, 7 Oct 2012 01:58:33 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201210070158.q971wXQk089972@svn.freebsd.org>
From: Warner Losh <imp@FreeBSD.org>
Date: Sun, 7 Oct 2012 01:58:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241307 - head/sys/arm/at91
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 01:58:33 -0000

Author: imp
Date: Sun Oct  7 01:58:32 2012
New Revision: 241307
URL: http://svn.freebsd.org/changeset/base/241307

Log:
  Use the RTC unit to get the time.  This works on all known AT91SAM9*
  processors, either on reboot or after power down with battery backup.
  However, the AT91RM9200 RTC always resets on reboot making it just
  about useless at the moment (if we support a low-power mode or an
  extended sleep mode, it might become useful).
  
  Submitted by:	Ian Lepore

Modified:
  head/sys/arm/at91/at91_rtc.c
  head/sys/arm/at91/at91_rtcreg.h

Modified: head/sys/arm/at91/at91_rtc.c
==============================================================================
--- head/sys/arm/at91/at91_rtc.c	Sat Oct  6 22:14:19 2012	(r241306)
+++ head/sys/arm/at91/at91_rtc.c	Sun Oct  7 01:58:32 2012	(r241307)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2006 M. Warner Losh.  All rights reserved.
+ * Copyright (c) 2012 Ian Lepore.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,6 +24,18 @@
  * SUCH DAMAGE.
  */
 
+/*
+ * Driver for the at91 on-chip realtime clock.
+ *
+ * This driver does not currently support alarms, just date and time.
+ *
+ * Note that on an rm9200 the RTC is not your typical battery-driven clock that
+ * keeps time while the system is powered down.  In fact, it doesn't even
+ * survive a chip reset to keep time across a reboot.  About the only thing it
+ * might be good for is keeping time while the cpu clock is turned off for power
+ * savings.  On later chips, a battery backup feature is available.
+ */
+
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
@@ -39,11 +52,20 @@ __FBSDID("$FreeBSD$");
 #include <sys/mutex.h>
 #include <sys/rman.h>
 #include <machine/bus.h>
+#include <machine/cpu.h>
 
 #include <arm/at91/at91_rtcreg.h>
 
 #include "clock_if.h"
 
+/*
+ * The driver has all the infrastructure to use interrupts but doesn't actually
+ * have any need to do so right now.  There's a non-zero cost for installing the
+ * handler because the RTC shares the system interrupt (IRQ 1), and thus will
+ * get called a lot for no reason at all.
+ */
+#define	AT91_RTC_USE_INTERRUPTS_NOT
+
 struct at91_rtc_softc
 {
 	device_t dev;			/* Myself */
@@ -81,12 +103,32 @@ static devclass_t at91_rtc_devclass;
 static int at91_rtc_probe(device_t dev);
 static int at91_rtc_attach(device_t dev);
 static int at91_rtc_detach(device_t dev);
-static int at91_rtc_intr(void *);
 
 /* helper routines */
 static int at91_rtc_activate(device_t dev);
 static void at91_rtc_deactivate(device_t dev);
 
+#ifdef AT91_RTC_USE_INTERRUPTS
+static int
+at91_rtc_intr(void *xsc)
+{
+	struct at91_rtc_softc *sc;
+	uint32_t status;
+
+	sc = xsc;
+	/* Must clear the status bits after reading them to re-arm. */
+	status = RD4(sc, RTC_SR);
+	WR4(sc, RTC_SCCR, status);
+	if (status == 0)
+		return;
+	AT91_RTC_LOCK(sc);
+        /* Do something here */
+	AT91_RTC_UNLOCK(sc);
+	wakeup(sc);
+	return (FILTER_HANDLED);
+}
+#endif
+
 static int
 at91_rtc_probe(device_t dev)
 {
@@ -108,15 +150,35 @@ at91_rtc_attach(device_t dev)
 	AT91_RTC_LOCK_INIT(sc);
 
 	/*
-	 * Activate the interrupt, but disable all interrupts in the hardware
+	 * Disable all interrupts in the hardware.
+	 * Clear all bits in the status register.
+	 * Set 24-hour-clock mode.
 	 */
 	WR4(sc, RTC_IDR, 0xffffffff);
+	WR4(sc, RTC_SCCR, 0x1f);
+	WR4(sc, RTC_MR, 0);
+
+#ifdef AT91_RTC_USE_INTERRUPTS
 	err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC,
 	    at91_rtc_intr, NULL, sc, &sc->intrhand);
 	if (err) {
 		AT91_RTC_LOCK_DESTROY(sc);
 		goto out;
 	}
+#endif	
+
+	/*
+	 * Read the calendar register.  If the century is 19 then the clock has
+	 * never been set.  Try to store an invalid value into the register,
+	 * which will turn on the error bit in RTC_VER, and our getclock code
+	 * knows to return EINVAL if any error bits are on.
+	 */
+	if (RTC_CALR_CEN(RD4(sc, RTC_CALR)) == 19)
+		WR4(sc, RTC_CALR, 0);
+
+	/*
+	 * Register as a time of day clock with 1-second resolution.
+	 */
 	clock_register(dev, 1000000);
 out:
 	if (err)
@@ -142,11 +204,13 @@ at91_rtc_activate(device_t dev)
 	    RF_ACTIVE);
 	if (sc->mem_res == NULL)
 		goto errout;
+#ifdef AT91_RTC_USE_INTERRUPTS
 	rid = 0;
 	sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_ACTIVE | RF_SHAREABLE);
 	if (sc->irq_res == NULL)
 		goto errout;
+#endif	
 	return (0);
 errout:
 	at91_rtc_deactivate(dev);
@@ -159,39 +223,26 @@ at91_rtc_deactivate(device_t dev)
 	struct at91_rtc_softc *sc;
 
 	sc = device_get_softc(dev);
+#ifdef AT91_RTC_USE_INTERRUPTS
+	WR4(sc, RTC_IDR, 0xffffffff);
 	if (sc->intrhand)
 		bus_teardown_intr(dev, sc->irq_res, sc->intrhand);
 	sc->intrhand = 0;
+#endif
 	bus_generic_detach(sc->dev);
 	if (sc->mem_res)
-		bus_release_resource(dev, SYS_RES_IOPORT,
+		bus_release_resource(dev, SYS_RES_MEMORY,
 		    rman_get_rid(sc->mem_res), sc->mem_res);
 	sc->mem_res = 0;
+#ifdef AT91_RTC_USE_INTERRUPTS
 	if (sc->irq_res)
 		bus_release_resource(dev, SYS_RES_IRQ,
 		    rman_get_rid(sc->irq_res), sc->irq_res);
 	sc->irq_res = 0;
+#endif	
 	return;
 }
 
-static int
-at91_rtc_intr(void *xsc)
-{
-	struct at91_rtc_softc *sc = xsc;
-#if 0
-	uint32_t status;
-
-	/* Reading the status also clears the interrupt */
-	status = RD4(sc, RTC_SR);
-	if (status == 0)
-		return;
-	AT91_RTC_LOCK(sc);
-	AT91_RTC_UNLOCK(sc);
-#endif
-	wakeup(sc);
-	return (FILTER_HANDLED);
-}
-
 /*
  * Get the time of day clock and return it in ts.
  * Return 0 on success, an error number otherwise.
@@ -204,6 +255,12 @@ at91_rtc_gettime(device_t dev, struct ti
 	struct at91_rtc_softc *sc;
 
 	sc = device_get_softc(dev);
+
+	/* If the error bits are set we can't return useful values. */
+
+	if (RD4(sc, RTC_VER) & (RTC_VER_NVTIM | RTC_VER_NVCAL))
+		return EINVAL;
+
 	timr = RD4(sc, RTC_TIMR);
 	calr = RD4(sc, RTC_CALR);
 	ct.nsec = 0;
@@ -226,11 +283,46 @@ at91_rtc_settime(device_t dev, struct ti
 {
 	struct at91_rtc_softc *sc;
 	struct clocktime ct;
+	int rv;
 
 	sc = device_get_softc(dev);
 	clock_ts_to_ct(ts, &ct);
+
+	/*
+	 * Can't set the clock unless a second has elapsed since we last did so.
+	 */
+	while ((RD4(sc, RTC_SR) & RTC_SR_SECEV) == 0)
+		cpu_spinwait();
+
+	/*
+	 * Stop the clocks for an update; wait until hardware is ready.
+	 * Clear the update-ready status after it gets asserted (the manual says
+	 * to do this before updating the value registers).
+	 */
+	WR4(sc, RTC_CR, RTC_CR_UPDCAL | RTC_CR_UPDTIM);
+	while ((RD4(sc, RTC_SR) & RTC_SR_ACKUPD) == 0)
+		cpu_spinwait();
+	WR4(sc, RTC_SCCR, RTC_SR_ACKUPD);
+
+	/*
+	 * Set the values in the hardware, then check whether the hardware was
+	 * happy with them so we can return the correct status.
+	 */
 	WR4(sc, RTC_TIMR, RTC_TIMR_MK(ct.hour, ct.min, ct.sec));
-	WR4(sc, RTC_CALR, RTC_CALR_MK(ct.year, ct.mon, ct.day, ct.dow));
+	WR4(sc, RTC_CALR, RTC_CALR_MK(ct.year, ct.mon, ct.day, ct.dow+1));
+
+	if (RD4(sc, RTC_VER) & (RTC_VER_NVTIM | RTC_VER_NVCAL))
+		rv = EINVAL;
+	else
+		rv = 0;
+
+	/*
+	 * Restart the clocks (turn off the update bits).
+	 * Clear the second-event bit (because the manual says to).
+	 */
+	WR4(sc, RTC_CR, RD4(sc, RTC_CR) & ~(RTC_CR_UPDCAL | RTC_CR_UPDTIM));
+	WR4(sc, RTC_SCCR, RTC_SR_SECEV);
+
 	return (0);
 }
 
@@ -244,7 +336,7 @@ static device_method_t at91_rtc_methods[
         DEVMETHOD(clock_gettime,        at91_rtc_gettime),
         DEVMETHOD(clock_settime,        at91_rtc_settime),
 
-	{ 0, 0 }
+	DEVMETHOD_END
 };
 
 static driver_t at91_rtc_driver = {

Modified: head/sys/arm/at91/at91_rtcreg.h
==============================================================================
--- head/sys/arm/at91/at91_rtcreg.h	Sat Oct  6 22:14:19 2012	(r241306)
+++ head/sys/arm/at91/at91_rtcreg.h	Sun Oct  7 01:58:32 2012	(r241307)
@@ -42,6 +42,10 @@
 #define RTC_IMR		0x28		/* RTC Interrupt Mask Register */
 #define RTC_VER		0x2c		/* RTC Valid Entry Register */
 
+/* CR */
+#define	RTC_CR_UPDTIM	(0x1u <<  0)	/* Request update of time register */
+#define	RTC_CR_UPDCAL	(0x1u <<  1)	/* Request update of calendar reg. */
+
 /* TIMR */
 #define RTC_TIMR_SEC_M	0x7fUL
 #define RTC_TIMR_SEC_S	0
@@ -71,14 +75,29 @@
 #define RTC_CALR_DOW_M	0x00d0000UL
 #define RTC_CALR_DOW_S	21
 #define RTC_CALR_DOW(x)	FROMBCD(((x) & RTC_CALR_DOW_M) >> RTC_CALR_DOW_S)
-#define RTC_CALR_DAY_M	0x3f00000UL
+#define RTC_CALR_DAY_M	0x3f000000UL
 #define RTC_CALR_DAY_S	24
 #define RTC_CALR_DAY(x)	FROMBCD(((x) & RTC_CALR_DAY_M) >> RTC_CALR_DAY_S)
 #define RTC_CALR_MK(yr, mon, day, dow) \
-		((TOBCD((yr) / 100 + 19) << RTC_CALR_CEN_S) | \
+		((TOBCD((yr) / 100) << RTC_CALR_CEN_S) | \
 		 (TOBCD((yr) % 100) << RTC_CALR_YEAR_S) | \
 		 (TOBCD(mon) << RTC_CALR_MON_S) | \
 		 (TOBCD(dow) << RTC_CALR_DOW_S) | \
 		 (TOBCD(day) << RTC_CALR_DAY_S))
 
+/* SR */
+
+#define	RTC_SR_ACKUPD		(0x1u <<  0)	/* Acknowledge for Update */
+#define	RTC_SR_ALARM		(0x1u <<  1)	/* Alarm Flag */
+#define	RTC_SR_SECEV		(0x1u <<  2)	/* Second Event */
+#define	RTC_SR_TIMEV		(0x1u <<  3)	/* Time Event */
+#define	RTC_SR_CALEV		(0x1u <<  4)	/* Calendar event */
+
+/* VER */
+
+#define	RTC_VER_NVTIM		(0x1 << 0)	/* Non-valid time */
+#define	RTC_VER_NVCAL		(0x1 << 1)	/* Non-valid calendar */
+#define	RTC_VER_NVTIMALR	(0x1 << 2)	/* Non-valid time alarm */
+#define	RTC_VER_NVCALALR	(0x1 << 3)	/* Non-valid calendar alarm */
+
 #endif /* ARM_AT91_AT91_RTCREG_H */

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 02:08:19 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id BE66D1065670;
	Sun,  7 Oct 2012 02:08:19 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A8A5A8FC08;
	Sun,  7 Oct 2012 02:08:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9728JH9091702;
	Sun, 7 Oct 2012 02:08:19 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9728JT7091700;
	Sun, 7 Oct 2012 02:08:19 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201210070208.q9728JT7091700@svn.freebsd.org>
From: Warner Losh <imp@FreeBSD.org>
Date: Sun, 7 Oct 2012 02:08:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241308 - head/sys/arm/at91
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 02:08:19 -0000

Author: imp
Date: Sun Oct  7 02:08:19 2012
New Revision: 241308
URL: http://svn.freebsd.org/changeset/base/241308

Log:
  Improve a few comments.

Modified:
  head/sys/arm/at91/at91_rtc.c

Modified: head/sys/arm/at91/at91_rtc.c
==============================================================================
--- head/sys/arm/at91/at91_rtc.c	Sun Oct  7 01:58:32 2012	(r241307)
+++ head/sys/arm/at91/at91_rtc.c	Sun Oct  7 02:08:19 2012	(r241308)
@@ -29,11 +29,13 @@
  *
  * This driver does not currently support alarms, just date and time.
  *
- * Note that on an rm9200 the RTC is not your typical battery-driven clock that
- * keeps time while the system is powered down.  In fact, it doesn't even
- * survive a chip reset to keep time across a reboot.  About the only thing it
- * might be good for is keeping time while the cpu clock is turned off for power
- * savings.  On later chips, a battery backup feature is available.
+ * The RTC on the AT91RM9200 resets when the core rests, so it is useless as a
+ * source of time (except when the CPU clock is powered down to save power,
+ * which we don't currently do).  On AT91SAM9 chips, the RTC survives chip
+ * reset, and there's provisions for it to keep time via battery backup if the
+ * system loses power.  On those systems, we use it as a RTC.  We tell the two
+ * apart because the century field is 19 on AT91RM9200 on reset, or on AT91SAM9
+ * chips that haven't had their time properly set.
  */
 
 #include <sys/cdefs.h>
@@ -186,10 +188,13 @@ out:
 	return (err);
 }
 
+/*
+ * Cannot support detach, since there's no clock_unregister function.
+ */
 static int
 at91_rtc_detach(device_t dev)
 {
-	return (EBUSY);	/* XXX */
+	return (EBUSY);
 }
 
 static int

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 05:11:29 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id ECFD2106566C;
	Sun,  7 Oct 2012 05:11:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D52E08FC0A;
	Sun,  7 Oct 2012 05:11:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q975BT9c023809;
	Sun, 7 Oct 2012 05:11:29 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q975BTMo023801;
	Sun, 7 Oct 2012 05:11:29 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201210070511.q975BTMo023801@svn.freebsd.org>
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Sun, 7 Oct 2012 05:11:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241309 - in stable/9: include/rpc lib/libc/rpc sys/rpc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 05:11:30 -0000

Author: pfg
Date: Sun Oct  7 05:11:29 2012
New Revision: 241309
URL: http://svn.freebsd.org/changeset/base/241309

Log:
  MFC	 r241141, r241165, r241165,  r241181;
  
  rpc: convert all uid and gid variables to u_int.
  
  Follow a similar change in Solaris and linux where the uid and
  gid variables were made more similar to what the system expects.
  In our case we use u_int which is what XDR can manage,
  
  Reviewed by:	bde

Modified:
  stable/9/include/rpc/auth.h
  stable/9/include/rpc/auth_unix.h
  stable/9/lib/libc/rpc/auth_unix.c
  stable/9/lib/libc/rpc/authunix_prot.c
  stable/9/lib/libc/rpc/rpc_soc.3
  stable/9/lib/libc/rpc/svc_auth_unix.c
  stable/9/sys/rpc/auth.h

Modified: stable/9/include/rpc/auth.h
==============================================================================
--- stable/9/include/rpc/auth.h	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/include/rpc/auth.h	Sun Oct  7 05:11:29 2012	(r241309)
@@ -243,14 +243,13 @@ __END_DECLS
  * System style authentication
  * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
  *	char *machname;
- *	int uid;
- *	int gid;
+ *	u_int uid;
+ *	u_int gid;
  *	int len;
- *	int *aup_gids;
+ *	u_int *aup_gids;
  */
 __BEGIN_DECLS
-extern AUTH *authunix_create(char *, int, int, int,
-    int *);
+extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *);
 extern AUTH *authunix_create_default(void);	/* takes no parameters */
 extern AUTH *authnone_create(void);		/* takes no parameters */
 __END_DECLS

Modified: stable/9/include/rpc/auth_unix.h
==============================================================================
--- stable/9/include/rpc/auth_unix.h	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/include/rpc/auth_unix.h	Sun Oct  7 05:11:29 2012	(r241309)
@@ -60,10 +60,10 @@
 struct authunix_parms {
 	u_long	 aup_time;
 	char	*aup_machname;
-	int	 aup_uid;
-	int	 aup_gid;
+	u_int	 aup_uid;
+	u_int	 aup_gid;
 	u_int	 aup_len;
-	int	*aup_gids;
+	u_int	*aup_gids;
 };
 
 #define authsys_parms authunix_parms

Modified: stable/9/lib/libc/rpc/auth_unix.c
==============================================================================
--- stable/9/lib/libc/rpc/auth_unix.c	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/auth_unix.c	Sun Oct  7 05:11:29 2012	(r241309)
@@ -94,10 +94,10 @@ struct audata {
 AUTH *
 authunix_create(machname, uid, gid, len, aup_gids)
 	char *machname;
-	int uid;
-	int gid;
+	u_int uid;
+	u_int gid;
 	int len;
-	int *aup_gids;
+	u_int *aup_gids;
 {
 	struct authunix_parms aup;
 	char mymem[MAX_AUTH_BYTES];
@@ -189,9 +189,9 @@ authunix_create_default()
 	int ngids;
 	long ngids_max;
 	char machname[MAXHOSTNAMELEN + 1];
-	uid_t uid;
-	gid_t gid;
-	gid_t *gids;
+	u_int uid;
+	u_int gid;
+	u_int *gids;
 
 	ngids_max = sysconf(_SC_NGROUPS_MAX) + 1;
 	gids = malloc(sizeof(gid_t) * ngids_max);
@@ -207,9 +207,8 @@ authunix_create_default()
 		abort();
 	if (ngids > NGRPS)
 		ngids = NGRPS;
-	/* XXX: interface problem; those should all have been unsigned */
-	auth = authunix_create(machname, (int)uid, (int)gid, ngids,
-	    (int *)gids);
+	/* XXX: interface problem; we should translate from uid_t and gid_t */
+	auth = authunix_create(machname, uid, gid, ngids, gids);
 	free(gids);
 	return (auth);
 }

Modified: stable/9/lib/libc/rpc/authunix_prot.c
==============================================================================
--- stable/9/lib/libc/rpc/authunix_prot.c	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/authunix_prot.c	Sun Oct  7 05:11:29 2012	(r241309)
@@ -60,19 +60,19 @@ xdr_authunix_parms(xdrs, p)
 	XDR *xdrs;
 	struct authunix_parms *p;
 {
-	int **paup_gids;
+	u_int **paup_gids;
 
 	assert(xdrs != NULL);
 	assert(p != NULL);
 
 	paup_gids = &p->aup_gids;
 
-	if (xdr_u_long(xdrs, &(p->aup_time))
-	    && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
-	    && xdr_int(xdrs, &(p->aup_uid))
-	    && xdr_int(xdrs, &(p->aup_gid))
-	    && xdr_array(xdrs, (char **) paup_gids,
-		    &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) {
+	if (xdr_u_long(xdrs, &(p->aup_time)) &&
+	    xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) &&
+	    xdr_u_int(xdrs, &(p->aup_uid)) &&
+	    xdr_u_int(xdrs, &(p->aup_gid)) &&
+	    xdr_array(xdrs, (char **) paup_gids,
+	    &(p->aup_len), NGRPS, sizeof(u_int), (xdrproc_t)xdr_u_int) ) {
 		return (TRUE);
 	}
 	return (FALSE);

Modified: stable/9/lib/libc/rpc/rpc_soc.3
==============================================================================
--- stable/9/lib/libc/rpc/rpc_soc.3	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/rpc_soc.3	Sun Oct  7 05:11:29 2012	(r241309)
@@ -148,7 +148,7 @@ default authentication used by
 .Ft "AUTH *"
 .Xc
 .It Xo
-.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids"
+.Fn authunix_create "char *host" "u_int uid" "u_int gid" "int len" "u_int *aup_gids"
 .Xc
 .Pp
 Create and return an

Modified: stable/9/lib/libc/rpc/svc_auth_unix.c
==============================================================================
--- stable/9/lib/libc/rpc/svc_auth_unix.c	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/svc_auth_unix.c	Sun Oct  7 05:11:29 2012	(r241309)
@@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg)
 	struct area {
 		struct authunix_parms area_aup;
 		char area_machname[MAX_MACHINE_NAME+1];
-		int area_gids[NGRPS];
+		u_int area_gids[NGRPS];
 	} *area;
 	u_int auth_len;
 	size_t str_len, gid_len;

Modified: stable/9/sys/rpc/auth.h
==============================================================================
--- stable/9/sys/rpc/auth.h	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/sys/rpc/auth.h	Sun Oct  7 05:11:29 2012	(r241309)
@@ -234,18 +234,17 @@ __END_DECLS
  * System style authentication
  * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
  *	char *machname;
- *	int uid;
- *	int gid;
+ *	u_int uid;
+ *	u_int gid;
  *	int len;
- *	int *aup_gids;
+ *	u_int *aup_gids;
  */
 __BEGIN_DECLS
 #ifdef _KERNEL
 struct ucred;
 extern AUTH *authunix_create(struct ucred *);
 #else
-extern AUTH *authunix_create(char *, int, int, int,
-    int *);
+extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *);
 extern AUTH *authunix_create_default(void);	/* takes no parameters */
 #endif
 extern AUTH *authnone_create(void);		/* takes no parameters */

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 05:31:43 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A35A4106564A;
	Sun,  7 Oct 2012 05:31:43 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au
	[211.29.132.183])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E2208FC08;
	Sun,  7 Oct 2012 05:31:42 +0000 (UTC)
Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au
	(c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26])
	by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	q975VXU4021151
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 7 Oct 2012 16:31:34 +1100
Date: Sun, 7 Oct 2012 16:31:33 +1100 (EST)
From: Bruce Evans <brde@optusnet.com.au>
X-X-Sender: bde@besplex.bde.org
To: Marcel Moolenaar <marcel@freebsd.org>
In-Reply-To: <201210062001.q96K16Or030755@svn.freebsd.org>
Message-ID: <20121007161440.C7605@besplex.bde.org>
References: <201210062001.q96K16Or030755@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r241298 - in head: . gnu/usr.bin/cc/cc_int
 gnu/usr.bin/cc/include kerberos5 kerberos5/tools/asn1_compile
 kerberos5/tools/slc
 lib/clang/include share/mk tools/build/make_check usr.sbin/c...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 05:31:43 -0000

On Sat, 6 Oct 2012, Marcel Moolenaar wrote:

> Log:
>  Add support for bmake. This includes:
> ....
> Modified: head/share/mk/bsd.dep.mk
> ==============================================================================
> --- head/share/mk/bsd.dep.mk	Sat Oct  6 19:57:27 2012	(r241297)
> +++ head/share/mk/bsd.dep.mk	Sat Oct  6 20:01:05 2012	(r241298)
> @@ -102,8 +102,8 @@ ${_YC} y.tab.h: ${_YSRC}
> CLEANFILES+= y.tab.c y.tab.h
> .elif !empty(YFLAGS:M-d)
> .for _YH in ${_YC:R}.h
> -.ORDER: ${_YC} ${_YH}
> -${_YC} ${_YH}: ${_YSRC}
> +${_YH}: ${_YC}
> +${_YC}: ${_YSRC}
> 	${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
> SRCS+=	${_YH}
> CLEANFILES+= ${_YH}

This is broken.  Yacc headers don't depend on generated yacc .c files.
Now there is only a null rule to create the headers.  One broken case
is when the header somehow gets deleted.  It bcomes out of date, but
running make to update it only runs the null rule, so it remains
nonexistent.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 13:27:08 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 3A4AB106564A;
	Sun,  7 Oct 2012 13:27:08 +0000 (UTC)
	(envelope-from simon@FreeBSD.org)
Received: from emx.nitro.dk (leto.nitro.dk [178.63.52.6])
	by mx1.freebsd.org (Postfix) with ESMTP id E43E98FC23;
	Sun,  7 Oct 2012 13:27:07 +0000 (UTC)
Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4])
	by emx.nitro.dk (Postfix) with ESMTP id C0A5F30F10C;
	Sun,  7 Oct 2012 13:27:00 +0000 (UTC)
Received: from emx.nitro.dk ([127.0.1.2])
	by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4])
	(amavisd-new, port 10024)
	with LMTP id Xz8OiCQsfejt; Sun,  7 Oct 2012 13:26:58 +0000 (UTC)
Received: from [192.168.4.24] (unknown [89.100.2.68])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by emx.nitro.dk (Postfix) with ESMTPSA id 4824530F102;
	Sun,  7 Oct 2012 13:26:58 +0000 (UTC)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: "Simon L. B. Nielsen" <simon@FreeBSD.org>
In-Reply-To: <201210021744.q92Hi8dt077996@svn.freebsd.org>
Date: Sun, 7 Oct 2012 14:26:57 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <FA478B4F-9FE3-4928-A3C8-BC14417C5603@FreeBSD.org>
References: <201210021744.q92Hi8dt077996@svn.freebsd.org>
To: Andrey A. Chernov <ache@FreeBSD.org>
X-Mailer: Apple Mail (2.1499)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r241137 - head/lib/libc/stdlib
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 13:27:08 -0000


On 2 Oct 2012, at 18:44, Andrey A. Chernov <ache@FreeBSD.org> wrote:

> Author: ache
> Date: Tue Oct  2 17:44:08 2012
> New Revision: 241137
> URL: http://svn.freebsd.org/changeset/base/241137
>=20
> Log:
>  Using putenv() and later direct pointer contents modification it is =
possibe
>  to craft environment variables with similar names like that:
>  a=3D1
>  a=3D2
>  ...
>  unsetenv("a") should remove them all to make later getenv("a") =
impossible.
>  Fix it to do so (this is GNU autoconf test #3 failure too).
>=20
>  PR:             172273
>  MFC after:      1 week
>=20
> Modified:
>  head/lib/libc/stdlib/getenv.c

Reviewed by ?

This needs to be reviewed by someone with clue about the pittfals if =
environment manipulation before any MFC.

PS. env functions are mentioned in MAINTAINERS.

--=20
Simon L. B. Nielsen
FreeBSD Security Officer


From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 15:37:31 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A134D1065672;
	Sun,  7 Oct 2012 15:37:31 +0000 (UTC)
	(envelope-from dteske@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8BDAA8FC14;
	Sun,  7 Oct 2012 15:37:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97FbV6P024731;
	Sun, 7 Oct 2012 15:37:31 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97FbVGx024728;
	Sun, 7 Oct 2012 15:37:31 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201210071537.q97FbVGx024728@svn.freebsd.org>
From: Devin Teske <dteske@FreeBSD.org>
Date: Sun, 7 Oct 2012 15:37:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241310 - head/sys/boot/forth
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 15:37:31 -0000

Author: dteske
Date: Sun Oct  7 15:37:30 2012
New Revision: 241310
URL: http://svn.freebsd.org/changeset/base/241310

Log:
  Comment and Copyright fixes/updates.
  
  Reviewed by:	adrian (co-mentor)
  Approved by:	adrian (co-mentor)

Modified:
  head/sys/boot/forth/menu-commands.4th
  head/sys/boot/forth/menu.4th

Modified: head/sys/boot/forth/menu-commands.4th
==============================================================================
--- head/sys/boot/forth/menu-commands.4th	Sun Oct  7 05:11:29 2012	(r241309)
+++ head/sys/boot/forth/menu-commands.4th	Sun Oct  7 15:37:30 2012	(r241310)
@@ -1,4 +1,4 @@
-\ Copyright (c) 2006-2011 Devin Teske <dteske@FreeBSD.org>
+\ Copyright (c) 2006-2012 Devin Teske <dteske@FreeBSD.org>
 \ All rights reserved.
 \ 
 \ Redistribution and use in source and binary forms, with or without
@@ -144,10 +144,6 @@ marker task-menu-commands.4th
 	@                        \ dereference address into value
 	48 +                     \ convert to ASCII numeral
 
-	\ Since we are [in this file] going to override the standard `boot'
-	\ routine with a custom one, you should know that we use $kernel
-	\ when referencing the desired kernel. Set $kernel below.
-
 	s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}"
 	                          \ command to assemble full kernel-path
 	-rot tuck 36 + c! swap    \ replace 'N' with array index value
@@ -168,10 +164,6 @@ marker task-menu-commands.4th
 	@                        \ dereference address into value
 	48 +                     \ convert to ASCII numeral
 
-	\ Since we are [in this file] going to override the standard `boot'
-	\ routine with a custom one, you should know that we use $root when
-	\ booting. Set $root below.
-
 	s" set root=${root_prefix}${root[N]}${root_prefix}"
 	                          \ command to assemble full kernel-path
 	-rot tuck 30 + c! swap    \ replace 'N' with array index value

Modified: head/sys/boot/forth/menu.4th
==============================================================================
--- head/sys/boot/forth/menu.4th	Sun Oct  7 05:11:29 2012	(r241309)
+++ head/sys/boot/forth/menu.4th	Sun Oct  7 15:37:30 2012	(r241310)
@@ -1,6 +1,6 @@
 \ Copyright (c) 2003 Scott Long <scottl@freebsd.org>
 \ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com>
-\ Copyright (c) 2006-2011 Devin Teske <dteske@FreeBSD.org>
+\ Copyright (c) 2006-2012 Devin Teske <dteske@FreeBSD.org>
 \ All rights reserved.
 \ 
 \ Redistribution and use in source and binary forms, with or without
@@ -384,7 +384,7 @@ create init_text8 255 allot
 \ ACPI option is to be presented to the user, otherwise returns -1. Used
 \ internally by menu-create, you need not (nor should you) call this directly.
 \ 
-: acpimenuitem ( -- C-Addr | -1 )
+: acpimenuitem ( -- C-Addr/U | -1 )
 
 	arch-i386? if
 		acpipresent? if
@@ -493,7 +493,7 @@ create init_text8 255 allot
 
 		\ If this is the ACPI menu option, act accordingly.
 		dup menuacpi @ = if
-			acpimenuitem ( -- C-Addr | -1 )
+			acpimenuitem ( -- C-Addr/U | -1 )
 		else
 			loader_color? if
 				s" ansi_caption[x]"
@@ -502,14 +502,14 @@ create init_text8 255 allot
 			then
 		then
 
-		( C-Addr | -1 )
+		( C-Addr/U | -1 )
 		dup -1 <> if
 			\ replace 'x' with current iteration
 			-rot 2dup 13 + c! rot
         
 			\ test for environment variable
 			getenv dup -1 <> if
-				printmenuitem ( C-Addr -- N )
+				printmenuitem ( C-Addr/U -- N )
         
 				s" menukeyN !" \ generate cmd to store result
 				-rot 2dup 7 + c! rot

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 16:45:39 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 494501065672;
	Sun,  7 Oct 2012 16:45:39 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A81C8FC12;
	Sun,  7 Oct 2012 16:45:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97GjcYN033919;
	Sun, 7 Oct 2012 16:45:38 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97Gjcj4033917;
	Sun, 7 Oct 2012 16:45:38 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201210071645.q97Gjcj4033917@svn.freebsd.org>
From: Marcel Moolenaar <marcel@FreeBSD.org>
Date: Sun, 7 Oct 2012 16:45:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241311 - head
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 16:45:39 -0000

Author: marcel
Date: Sun Oct  7 16:45:38 2012
New Revision: 241311
URL: http://svn.freebsd.org/changeset/base/241311

Log:
  Fix 32-bit library builds after the removal of adding -E to make for AS,
  CC, CXX and LD. This fix implements the intended as it should have been
  implemented all along: by passing AS, CC, CXX and LD on the commandline
  of the sub-make instead of in the environment of the sub-make.
  
  Breakage pointed-out by: dim@

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sun Oct  7 15:37:30 2012	(r241310)
+++ head/Makefile.inc1	Sun Oct  7 16:45:38 2012	(r241311)
@@ -295,9 +295,10 @@ LIB32CPUFLAGS=	-march=i686 -mmmx -msse -
 LIB32CPUFLAGS=	-march=${TARGET_CPUTYPE}
 .endif
 LIB32WMAKEENV=	MACHINE=i386 MACHINE_ARCH=i386 \
-		MACHINE_CPU="i686 mmx sse sse2" \
-		LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
-		AS="${AS} --32"
+		MACHINE_CPU="i686 mmx sse sse2"
+LIB32WMAKEFLAGS=	\
+		AS="${AS} --32" \
+		LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32"
 
 .elif ${TARGET_ARCH} == "powerpc64"
 .if empty(TARGET_CPUTYPE)
@@ -305,7 +306,8 @@ LIB32CPUFLAGS=	-mcpu=powerpc
 .else
 LIB32CPUFLAGS=	-mcpu=${TARGET_CPUTYPE}
 .endif
-LIB32WMAKEENV=	MACHINE=powerpc MACHINE_ARCH=powerpc \
+LIB32WMAKEENV=	MACHINE=powerpc MACHINE_ARCH=powerpc
+LIB32WMAKEFLAGS=	\
 		LD="${LD} -m elf32ppc_fbsd"
 .endif
 
@@ -322,16 +324,20 @@ LIB32WMAKEENV+=	MAKEOBJDIRPREFIX=${OBJTR
 		VERSION="${VERSION}" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH} \
-		CC="${CC} ${LIB32FLAGS}" \
-		CXX="${CXX} ${LIB32FLAGS}" \
 		LIBDIR=/usr/lib32 \
 		SHLIBDIR=/usr/lib32 \
 		COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
+LIB32WMAKEFLAGS+=	\
+		CC="${CC} ${LIB32FLAGS}" \
+		CXX="${CXX} ${LIB32FLAGS}" \
+		DESTDIR=${LIB32TMP} \
+		-DCOMPAT_32BIT \
+		-DNO_CPU_CFLAGS \
+		-DNO_CTF \
+		-DNO_LINT
 
-LIB32WMAKE=	${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
-		-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \
-		-DWITHOUT_HTML -DNO_CTF -DNO_LINT \
-		DESTDIR=${LIB32TMP}
+LIB32WMAKE=	${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \
+		-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML
 LIB32IMAKE=	${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS
 .endif
 

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 17:48:39 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1FC87106566C;
	Sun,  7 Oct 2012 17:48:39 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F28AB8FC0A;
	Sun,  7 Oct 2012 17:48:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97HmcVA042310;
	Sun, 7 Oct 2012 17:48:38 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97HmcDM042308;
	Sun, 7 Oct 2012 17:48:38 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201210071748.q97HmcDM042308@svn.freebsd.org>
From: Marcel Moolenaar <marcel@FreeBSD.org>
Date: Sun, 7 Oct 2012 17:48:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241312 - head
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 17:48:39 -0000

Author: marcel
Date: Sun Oct  7 17:48:38 2012
New Revision: 241312
URL: http://svn.freebsd.org/changeset/base/241312

Log:
  Fix the showconfig target. bmake sends debug output to stderr.
  
  Submitted by: Simon Garrety <sjg@juniper.net>

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sun Oct  7 16:45:38 2012	(r241311)
+++ head/Makefile.inc1	Sun Oct  7 17:48:38 2012	(r241312)
@@ -1569,7 +1569,7 @@ check-old: check-old-files check-old-lib
 # showconfig - show build configuration.
 #
 showconfig:
-	@${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort
+	@${MAKE} -n -f bsd.own.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort
 
 .if !empty(KRNLOBJDIR) && !empty(KERNCONF)
 DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:07:46 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 4C041106564A;
	Sun,  7 Oct 2012 18:07:46 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D84B8FC08;
	Sun,  7 Oct 2012 18:07:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97I7jMo044929;
	Sun, 7 Oct 2012 18:07:45 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97I7jCM044927;
	Sun, 7 Oct 2012 18:07:45 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201210071807.q97I7jCM044927@svn.freebsd.org>
From: Alan Cox <alc@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:07:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241313 - head/sys/mips/mips
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:07:46 -0000

Author: alc
Date: Sun Oct  7 18:07:45 2012
New Revision: 241313
URL: http://svn.freebsd.org/changeset/base/241313

Log:
  Optimize the TLB invalidations performed by pmap_protect().  Use the new
  range-based invalidation function instead of performing per-page
  invalidations.  Don't bother invalidating mappings that don't have PTE_D
  set, since they don't allow write access.

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Sun Oct  7 17:48:38 2012	(r241312)
+++ head/sys/mips/mips/pmap.c	Sun Oct  7 18:07:45 2012	(r241313)
@@ -1913,9 +1913,11 @@ pmap_remove_all(vm_page_t m)
 void
 pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot)
 {
-	pt_entry_t *pte;
+	pt_entry_t pbits, *pte;
 	pd_entry_t *pde, *pdpe;
-	vm_offset_t va_next;
+	vm_offset_t va, va_next;
+	vm_paddr_t pa;
+	vm_page_t m;
 
 	if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
 		pmap_remove(pmap, sva, eva);
@@ -1927,10 +1929,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 	rw_wlock(&pvh_global_lock);
 	PMAP_LOCK(pmap);
 	for (; sva < eva; sva = va_next) {
-		pt_entry_t pbits;
-		vm_page_t m;
-		vm_paddr_t pa;
-
 		pdpe = pmap_segmap(pmap, sva);
 #ifdef __mips_n64
 		if (*pdpe == 0) {
@@ -1947,29 +1945,52 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 		pde = pmap_pdpe_to_pde(pdpe, sva);
 		if (*pde == NULL)
 			continue;
+
+		/*
+		 * Limit our scan to either the end of the va represented
+		 * by the current page table page, or to the end of the
+		 * range being write protected.
+		 */
 		if (va_next > eva)
 			va_next = eva;
 
+		va = va_next;
 		for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++,
-		     sva += PAGE_SIZE) {
-
-			/* Skip invalid PTEs */
-			if (!pte_test(pte, PTE_V))
-				continue;
+		    sva += PAGE_SIZE) {
 			pbits = *pte;
-			if (pte_test(&pbits, PTE_MANAGED | PTE_D)) {
-				pa = TLBLO_PTE_TO_PA(pbits);
-				m = PHYS_TO_VM_PAGE(pa);
-				vm_page_dirty(m);
+			if (!pte_test(&pbits, PTE_V) || pte_test(&pbits,
+			    PTE_RO)) {
+				if (va != va_next) {
+					pmap_invalidate_range(pmap, va, sva);
+					va = va_next;
+				}
+				continue;
 			}
-			pte_clear(&pbits, PTE_D);
 			pte_set(&pbits, PTE_RO);
-			
-			if (pbits != *pte) {
-				*pte = pbits;
-				pmap_update_page(pmap, sva, pbits);
+			if (pte_test(&pbits, PTE_D)) {
+				pte_clear(&pbits, PTE_D);
+				if (pte_test(&pbits, PTE_MANAGED)) {
+					pa = TLBLO_PTE_TO_PA(pbits);
+					m = PHYS_TO_VM_PAGE(pa);
+					vm_page_dirty(m);
+				}
+				if (va == va_next)
+					va = sva;
+			} else {
+				/*
+				 * Unless PTE_D is set, any TLB entries
+				 * mapping "sva" don't allow write access, so
+				 * they needn't be invalidated.
+				 */
+				if (va != va_next) {
+					pmap_invalidate_range(pmap, va, sva);
+					va = va_next;
+				}
 			}
+			*pte = pbits;
 		}
+		if (va != va_next)
+			pmap_invalidate_range(pmap, va, sva);
 	}
 	rw_wunlock(&pvh_global_lock);
 	PMAP_UNLOCK(pmap);

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:18:59 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D5120106564A;
	Sun,  7 Oct 2012 18:18:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BF2BD8FC0A;
	Sun,  7 Oct 2012 18:18:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IIx30046381;
	Sun, 7 Oct 2012 18:18:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IIxDd046379;
	Sun, 7 Oct 2012 18:18:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071818.q97IIxDd046379@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:18:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241314 - stable/9/sys/dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:19:00 -0000

Author: jhb
Date: Sun Oct  7 18:18:59 2012
New Revision: 241314
URL: http://svn.freebsd.org/changeset/base/241314

Log:
  MFC 239913:
  Attach interrupt handlers during attach instead of during the first time
  the interface is brought up.  Without this, the boot time interrupt
  round-robin assignment does not think the allocated interrupt resources
  are active and leaves them assigned to CPU 0.
  
  While here, add descriptive tags to each interrupt handler when MSI-X
  is used.

Modified:
  stable/9/sys/dev/cxgb/cxgb_main.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/9/sys/dev/cxgb/cxgb_main.c	Sun Oct  7 18:07:45 2012	(r241313)
+++ stable/9/sys/dev/cxgb/cxgb_main.c	Sun Oct  7 18:18:59 2012	(r241314)
@@ -675,6 +675,9 @@ cxgb_controller_attach(device_t dev)
 	for (i = 0; i < NUM_CPL_HANDLERS; i++)
 		sc->cpl_handler[i] = cpl_not_handled;
 #endif
+
+	t3_intr_clear(sc);
+	error = cxgb_setup_interrupts(sc);
 out:
 	if (error)
 		cxgb_free(sc);
@@ -922,6 +925,7 @@ cxgb_setup_interrupts(adapter_t *sc)
 	if (!(intr_flag & USING_MSIX) || err)
 		return (err);
 
+	bus_describe_intr(sc->dev, sc->irq_res, sc->intr_tag, "err");
 	for (i = 0; i < sc->msi_count - 1; i++) {
 		rid = i + 2;
 		res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid,
@@ -945,6 +949,7 @@ cxgb_setup_interrupts(adapter_t *sc)
 		sc->msix_irq_rid[i] = rid;
 		sc->msix_irq_res[i] = res;
 		sc->msix_intr_tag[i] = tag;
+		bus_describe_intr(sc->dev, res, tag, "qs%d", i);
 	}
 
 	if (err)
@@ -1611,11 +1616,6 @@ cxgb_up(struct adapter *sc)
 		alloc_filters(sc);
 		setup_rss(sc);
 
-		t3_intr_clear(sc);
-		err = cxgb_setup_interrupts(sc);
-		if (err)
-			goto out;
-
 		t3_add_configured_sysctls(sc);
 		sc->flags |= FULL_INIT_DONE;
 	}

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:19:14 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 85252106578F;
	Sun,  7 Oct 2012 18:19:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 548988FC14;
	Sun,  7 Oct 2012 18:19:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IJEjh046444;
	Sun, 7 Oct 2012 18:19:14 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IJEJJ046442;
	Sun, 7 Oct 2012 18:19:14 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071819.q97IJEJJ046442@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:19:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241315 - stable/8/sys/dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:19:14 -0000

Author: jhb
Date: Sun Oct  7 18:19:13 2012
New Revision: 241315
URL: http://svn.freebsd.org/changeset/base/241315

Log:
  MFC 239913:
  Attach interrupt handlers during attach instead of during the first time
  the interface is brought up.  Without this, the boot time interrupt
  round-robin assignment does not think the allocated interrupt resources
  are active and leaves them assigned to CPU 0.
  
  While here, add descriptive tags to each interrupt handler when MSI-X
  is used.

Modified:
  stable/8/sys/dev/cxgb/cxgb_main.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/cxgb/   (props changed)

Modified: stable/8/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_main.c	Sun Oct  7 18:18:59 2012	(r241314)
+++ stable/8/sys/dev/cxgb/cxgb_main.c	Sun Oct  7 18:19:13 2012	(r241315)
@@ -662,6 +662,9 @@ cxgb_controller_attach(device_t dev)
 	device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]);
 	callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc);
 	t3_add_attach_sysctls(sc);
+
+	t3_intr_clear(sc);
+	error = cxgb_setup_interrupts(sc);
 out:
 	if (error)
 		cxgb_free(sc);
@@ -917,6 +920,7 @@ cxgb_setup_interrupts(adapter_t *sc)
 	if (!(intr_flag & USING_MSIX) || err)
 		return (err);
 
+	bus_describe_intr(sc->dev, sc->irq_res, sc->intr_tag, "err");
 	for (i = 0; i < sc->msi_count - 1; i++) {
 		rid = i + 2;
 		res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid,
@@ -940,6 +944,7 @@ cxgb_setup_interrupts(adapter_t *sc)
 		sc->msix_irq_rid[i] = rid;
 		sc->msix_irq_res[i] = res;
 		sc->msix_intr_tag[i] = tag;
+		bus_describe_intr(sc->dev, res, tag, "qs%d", i);
 	}
 
 	if (err)
@@ -1660,11 +1665,6 @@ cxgb_up(struct adapter *sc)
 		alloc_filters(sc);
 		setup_rss(sc);
 
-		t3_intr_clear(sc);
-		err = cxgb_setup_interrupts(sc);
-		if (err)
-			goto out;
-
 		t3_add_configured_sysctls(sc);
 		sc->flags |= FULL_INIT_DONE;
 	}

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:23:00 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id F0BE1106564A;
	Sun,  7 Oct 2012 18:22:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DA4B68FC0A;
	Sun,  7 Oct 2012 18:22:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IMxJ7047052;
	Sun, 7 Oct 2012 18:22:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IMx7g047050;
	Sun, 7 Oct 2012 18:22:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071822.q97IMx7g047050@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:22:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241316 - stable/9/lib/libc/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:23:00 -0000

Author: jhb
Date: Sun Oct  7 18:22:59 2012
New Revision: 241316
URL: http://svn.freebsd.org/changeset/base/241316

Log:
  MFC 240132:
  When WIFCONTINUED was added, the number of "first" macros grew from
  three to four.

Modified:
  stable/9/lib/libc/sys/wait.2
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)

Modified: stable/9/lib/libc/sys/wait.2
==============================================================================
--- stable/9/lib/libc/sys/wait.2	Sun Oct  7 18:19:13 2012	(r241315)
+++ stable/9/lib/libc/sys/wait.2	Sun Oct  7 18:22:59 2012	(r241316)
@@ -177,7 +177,7 @@ with a
 value of -1.
 .Pp
 The following macros may be used to test the manner of exit of the process.
-One of the first three macros will evaluate to a non-zero (true) value:
+One of the first four macros will evaluate to a non-zero (true) value:
 .Bl -tag -width Ds
 .It Fn WIFCONTINUED status
 True if the process has not terminated, and

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:23:16 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 24308106567B;
	Sun,  7 Oct 2012 18:23:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0EFDE8FC08;
	Sun,  7 Oct 2012 18:23:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97INFOI047119;
	Sun, 7 Oct 2012 18:23:15 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97INFWh047117;
	Sun, 7 Oct 2012 18:23:15 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071823.q97INFWh047117@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:23:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241317 - stable/8/lib/libc/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:23:16 -0000

Author: jhb
Date: Sun Oct  7 18:23:15 2012
New Revision: 241317
URL: http://svn.freebsd.org/changeset/base/241317

Log:
  MFC 240132:
  When WIFCONTINUED was added, the number of "first" macros grew from
  three to four.

Modified:
  stable/8/lib/libc/sys/wait.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/sys/wait.2
==============================================================================
--- stable/8/lib/libc/sys/wait.2	Sun Oct  7 18:22:59 2012	(r241316)
+++ stable/8/lib/libc/sys/wait.2	Sun Oct  7 18:23:15 2012	(r241317)
@@ -164,7 +164,7 @@ with a
 value of -1.
 .Pp
 The following macros may be used to test the manner of exit of the process.
-One of the first three macros will evaluate to a non-zero (true) value:
+One of the first four macros will evaluate to a non-zero (true) value:
 .Bl -tag -width Ds
 .It Fn WIFCONTINUED status
 True if the process has not terminated, and

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:25:34 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 96606106566C;
	Sun,  7 Oct 2012 18:25:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 815D88FC08;
	Sun,  7 Oct 2012 18:25:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IPY34047461;
	Sun, 7 Oct 2012 18:25:34 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IPYXn047458;
	Sun, 7 Oct 2012 18:25:34 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071825.q97IPYXn047458@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:25:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241318 - stable/9/share/man/man9
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:25:34 -0000

Author: jhb
Date: Sun Oct  7 18:25:33 2012
New Revision: 241318
URL: http://svn.freebsd.org/changeset/base/241318

Log:
  MFC 239906:
  Clarify that bus_dma does not stall future load requests once a load is
  deferred.  The caller is required to enforce that if that is desired.

Modified:
  stable/9/share/man/man9/bus_dma.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/bus_dma.9
==============================================================================
--- stable/9/share/man/man9/bus_dma.9	Sun Oct  7 18:23:15 2012	(r241317)
+++ stable/9/share/man/man9/bus_dma.9	Sun Oct  7 18:25:33 2012	(r241318)
@@ -580,8 +580,13 @@ The status of the mapping has been deliv
 The mapping has been deferred for lack of resources.
 The callback will be called as soon as resources are available.
 Callbacks are serviced in FIFO order.
-To ensure that ordering is guaranteed, all subsequent load requests will also
-be deferred until all callbacks have been processed.
+.Pp
+Note that subsequent load operations for the same tag that do not require
+extra resources will still succeed.
+This may result in out-of-order processing of requests.
+If the caller requires the order of requests to be preserved,
+then the caller is required to stall subsequent requests until a pending
+request's callback is invoked.
 .It Er ENOMEM
 The load request has failed due to insufficient resources, and the caller
 specifically used the

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:25:49 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 311821065670;
	Sun,  7 Oct 2012 18:25:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B8408FC12;
	Sun,  7 Oct 2012 18:25:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IPmXg047525;
	Sun, 7 Oct 2012 18:25:48 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IPmsb047523;
	Sun, 7 Oct 2012 18:25:48 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071825.q97IPmsb047523@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:25:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241319 - stable/8/share/man/man9
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:25:49 -0000

Author: jhb
Date: Sun Oct  7 18:25:48 2012
New Revision: 241319
URL: http://svn.freebsd.org/changeset/base/241319

Log:
  MFC 239906:
  Clarify that bus_dma does not stall future load requests once a load is
  deferred.  The caller is required to enforce that if that is desired.

Modified:
  stable/8/share/man/man9/bus_dma.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/bus_dma.9
==============================================================================
--- stable/8/share/man/man9/bus_dma.9	Sun Oct  7 18:25:33 2012	(r241318)
+++ stable/8/share/man/man9/bus_dma.9	Sun Oct  7 18:25:48 2012	(r241319)
@@ -580,8 +580,13 @@ The status of the mapping has been deliv
 The mapping has been deferred for lack of resources.
 The callback will be called as soon as resources are available.
 Callbacks are serviced in FIFO order.
-To ensure that ordering is guaranteed, all subsequent load requests will also
-be deferred until all callbacks have been processed.
+.Pp
+Note that subsequent load operations for the same tag that do not require
+extra resources will still succeed.
+This may result in out-of-order processing of requests.
+If the caller requires the order of requests to be preserved,
+then the caller is required to stall subsequent requests until a pending
+request's callback is invoked.
 .It Er ENOMEM
 The load request has failed due to insufficient resources, and the caller
 specifically used the

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:31:01 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B79001065672;
	Sun,  7 Oct 2012 18:31:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 96FC48FC0A;
	Sun,  7 Oct 2012 18:31:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IV1Db048285;
	Sun, 7 Oct 2012 18:31:01 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IV1AA048281;
	Sun, 7 Oct 2012 18:31:01 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071831.q97IV1AA048281@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:31:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241320 - stable/9/bin/mv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:31:01 -0000

Author: jhb
Date: Sun Oct  7 18:31:01 2012
New Revision: 241320
URL: http://svn.freebsd.org/changeset/base/241320

Log:
  MFC 226961,239951:
  Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
  symbolic link to a directory for the target as a symbolic link instead of
  a directory.  This makes it possible to atomically update a symbolic
  link using rename().

Modified:
  stable/9/bin/mv/mv.1
  stable/9/bin/mv/mv.c
Directory Properties:
  stable/9/bin/mv/   (props changed)

Modified: stable/9/bin/mv/mv.1
==============================================================================
--- stable/9/bin/mv/mv.1	Sun Oct  7 18:25:48 2012	(r241319)
+++ stable/9/bin/mv/mv.1	Sun Oct  7 18:31:01 2012	(r241320)
@@ -32,7 +32,7 @@
 .\"	@(#)mv.1	8.1 (Berkeley) 5/31/93
 .\" $FreeBSD$
 .\"
-.Dd May 12, 2007
+.Dd August 28, 2012
 .Dt MV 1
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl f | i | n
-.Op Fl v
+.Op Fl hv
 .Ar source target
 .Nm
 .Op Fl f | i | n
@@ -81,6 +81,21 @@ option overrides any previous
 or
 .Fl n
 options.)
+.It Fl h
+If the
+.Ar target
+operand is a symbolic link to a directory,
+do not follow it.
+This causes the
+.Nm
+utility to rename the file
+.Ar source
+to the destination path
+.Ar target
+rather than moving
+.Ar source
+into the directory referenced by
+.Ar target .
 .It Fl i
 Cause
 .Nm
@@ -142,7 +157,8 @@ rm -rf source_file
 .Ex -std
 .Sh COMPATIBILITY
 The
-.Fl n
+.Fl h ,
+.Fl n ,
 and
 .Fl v
 options are non-standard and their use in scripts is not recommended.

Modified: stable/9/bin/mv/mv.c
==============================================================================
--- stable/9/bin/mv/mv.c	Sun Oct  7 18:25:48 2012	(r241319)
+++ stable/9/bin/mv/mv.c	Sun Oct  7 18:31:01 2012	(r241320)
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
 /* Exit code for a failed exec. */
 #define EXEC_FAILED 127
 
-int fflg, iflg, nflg, vflg;
+static int	fflg, hflg, iflg, nflg, vflg;
 
 static int	copy(const char *, const char *);
 static int	do_move(const char *, const char *);
@@ -87,8 +87,11 @@ main(int argc, char *argv[])
 	int ch;
 	char path[PATH_MAX];
 
-	while ((ch = getopt(argc, argv, "finv")) != -1)
+	while ((ch = getopt(argc, argv, "fhinv")) != -1)
 		switch (ch) {
+		case 'h':
+			hflg = 1;
+			break;
 		case 'i':
 			iflg = 1;
 			fflg = nflg = 0;
@@ -123,6 +126,17 @@ main(int argc, char *argv[])
 		exit(do_move(argv[0], argv[1]));
 	}
 
+	/*
+	 * If -h was specified, treat the target as a symlink instead of
+	 * directory.
+	 */
+	if (hflg) {
+		if (argc > 2)
+			usage();
+		if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode))
+			exit(do_move(argv[0], argv[1]));
+	}
+
 	/* It's a directory, move each file into it. */
 	if (strlen(argv[argc - 1]) > sizeof(path) - 1)
 		errx(1, "%s: destination pathname too long", *argv);
@@ -489,7 +503,7 @@ usage(void)
 {
 
 	(void)fprintf(stderr, "%s\n%s\n",
-		      "usage: mv [-f | -i | -n] [-v] source target",
+		      "usage: mv [-f | -i | -n] [-hv] source target",
 		      "       mv [-f | -i | -n] [-v] source ... directory");
 	exit(EX_USAGE);
 }

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:31:18 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 794D910657BD;
	Sun,  7 Oct 2012 18:31:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 596468FC12;
	Sun,  7 Oct 2012 18:31:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IVIsN048357;
	Sun, 7 Oct 2012 18:31:18 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IVIQZ048354;
	Sun, 7 Oct 2012 18:31:18 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071831.q97IVIQZ048354@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:31:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241321 - stable/8/bin/mv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:31:18 -0000

Author: jhb
Date: Sun Oct  7 18:31:17 2012
New Revision: 241321
URL: http://svn.freebsd.org/changeset/base/241321

Log:
  MFC 226961,239951:
  Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
  symbolic link to a directory for the target as a symbolic link instead of
  a directory.  This makes it possible to atomically update a symbolic
  link using rename().

Modified:
  stable/8/bin/mv/mv.1
  stable/8/bin/mv/mv.c
Directory Properties:
  stable/8/bin/mv/   (props changed)

Modified: stable/8/bin/mv/mv.1
==============================================================================
--- stable/8/bin/mv/mv.1	Sun Oct  7 18:31:01 2012	(r241320)
+++ stable/8/bin/mv/mv.1	Sun Oct  7 18:31:17 2012	(r241321)
@@ -32,7 +32,7 @@
 .\"	@(#)mv.1	8.1 (Berkeley) 5/31/93
 .\" $FreeBSD$
 .\"
-.Dd May 12, 2007
+.Dd August 28, 2012
 .Dt MV 1
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl f | i | n
-.Op Fl v
+.Op Fl hv
 .Ar source target
 .Nm
 .Op Fl f | i | n
@@ -81,6 +81,21 @@ option overrides any previous
 or
 .Fl n
 options.)
+.It Fl h
+If the
+.Ar target
+operand is a symbolic link to a directory,
+do not follow it.
+This causes the
+.Nm
+utility to rename the file
+.Ar source
+to the destination path
+.Ar target
+rather than moving
+.Ar source
+into the directory referenced by
+.Ar target .
 .It Fl i
 Cause
 .Nm
@@ -142,7 +157,8 @@ rm -rf source_file
 .Ex -std
 .Sh COMPATIBILITY
 The
-.Fl n
+.Fl h ,
+.Fl n ,
 and
 .Fl v
 options are non-standard and their use in scripts is not recommended.

Modified: stable/8/bin/mv/mv.c
==============================================================================
--- stable/8/bin/mv/mv.c	Sun Oct  7 18:31:01 2012	(r241320)
+++ stable/8/bin/mv/mv.c	Sun Oct  7 18:31:17 2012	(r241321)
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
 /* Exit code for a failed exec. */
 #define EXEC_FAILED 127
 
-int fflg, iflg, nflg, vflg;
+static int	fflg, hflg, iflg, nflg, vflg;
 
 static int	copy(const char *, const char *);
 static int	do_move(const char *, const char *);
@@ -87,8 +87,11 @@ main(int argc, char *argv[])
 	int ch;
 	char path[PATH_MAX];
 
-	while ((ch = getopt(argc, argv, "finv")) != -1)
+	while ((ch = getopt(argc, argv, "fhinv")) != -1)
 		switch (ch) {
+		case 'h':
+			hflg = 1;
+			break;
 		case 'i':
 			iflg = 1;
 			fflg = nflg = 0;
@@ -123,6 +126,17 @@ main(int argc, char *argv[])
 		exit(do_move(argv[0], argv[1]));
 	}
 
+	/*
+	 * If -h was specified, treat the target as a symlink instead of
+	 * directory.
+	 */
+	if (hflg) {
+		if (argc > 2)
+			usage();
+		if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode))
+			exit(do_move(argv[0], argv[1]));
+	}
+
 	/* It's a directory, move each file into it. */
 	if (strlen(argv[argc - 1]) > sizeof(path) - 1)
 		errx(1, "%s: destination pathname too long", *argv);
@@ -489,7 +503,7 @@ usage(void)
 {
 
 	(void)fprintf(stderr, "%s\n%s\n",
-		      "usage: mv [-f | -i | -n] [-v] source target",
+		      "usage: mv [-f | -i | -n] [-hv] source target",
 		      "       mv [-f | -i | -n] [-v] source ... directory");
 	exit(EX_USAGE);
 }

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:37:48 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 2308E106566C;
	Sun,  7 Oct 2012 18:37:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E5308FC17;
	Sun,  7 Oct 2012 18:37:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IblsO049402;
	Sun, 7 Oct 2012 18:37:47 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IblVq049400;
	Sun, 7 Oct 2012 18:37:47 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071837.q97IblVq049400@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:37:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241322 - stable/9/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:37:48 -0000

Author: jhb
Date: Sun Oct  7 18:37:47 2012
New Revision: 241322
URL: http://svn.freebsd.org/changeset/base/241322

Log:
  MFC 239335:
  Remove D_NEEDGIANT from dead_devsw.  biofinish() (and thus dead_strategy)
  does not need Giant.

Modified:
  stable/9/sys/kern/kern_conf.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_conf.c
==============================================================================
--- stable/9/sys/kern/kern_conf.c	Sun Oct  7 18:31:17 2012	(r241321)
+++ stable/9/sys/kern/kern_conf.c	Sun Oct  7 18:37:47 2012	(r241322)
@@ -306,7 +306,6 @@ dead_strategy(struct bio *bp)
 
 static struct cdevsw dead_cdevsw = {
 	.d_version =	D_VERSION,
-	.d_flags =	D_NEEDGIANT, /* XXX: does dead_strategy need this ? */
 	.d_open =	dead_open,
 	.d_close =	dead_close,
 	.d_read =	dead_read,

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:37:59 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id C676E10657D9;
	Sun,  7 Oct 2012 18:37:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AFCF38FC08;
	Sun,  7 Oct 2012 18:37:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97Ibx8v049462;
	Sun, 7 Oct 2012 18:37:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IbxHV049460;
	Sun, 7 Oct 2012 18:37:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071837.q97IbxHV049460@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:37:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241323 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:37:59 -0000

Author: jhb
Date: Sun Oct  7 18:37:59 2012
New Revision: 241323
URL: http://svn.freebsd.org/changeset/base/241323

Log:
  MFC 239335:
  Remove D_NEEDGIANT from dead_devsw.  biofinish() (and thus dead_strategy)
  does not need Giant.

Modified:
  stable/8/sys/kern/kern_conf.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/kern_conf.c
==============================================================================
--- stable/8/sys/kern/kern_conf.c	Sun Oct  7 18:37:47 2012	(r241322)
+++ stable/8/sys/kern/kern_conf.c	Sun Oct  7 18:37:59 2012	(r241323)
@@ -306,7 +306,6 @@ dead_strategy(struct bio *bp)
 
 static struct cdevsw dead_cdevsw = {
 	.d_version =	D_VERSION,
-	.d_flags =	D_NEEDGIANT, /* XXX: does dead_strategy need this ? */
 	.d_open =	dead_open,
 	.d_close =	dead_close,
 	.d_read =	dead_read,

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:41:49 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1822A106566B;
	Sun,  7 Oct 2012 18:41:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 03A818FC08;
	Sun,  7 Oct 2012 18:41:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IfmiS050037;
	Sun, 7 Oct 2012 18:41:48 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IfmJt050035;
	Sun, 7 Oct 2012 18:41:48 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071841.q97IfmJt050035@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:41:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241324 - stable/9/sys/dev/mfi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:41:49 -0000

Author: jhb
Date: Sun Oct  7 18:41:48 2012
New Revision: 241324
URL: http://svn.freebsd.org/changeset/base/241324

Log:
  MFC 240962:
  Grab the mfi_config_lock while performing a MFI_DCMD_CFG_FOREIGN_IMPORT
  request on behalf of a user utility.

Modified:
  stable/9/sys/dev/mfi/mfi.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/mfi/mfi.c
==============================================================================
--- stable/9/sys/dev/mfi/mfi.c	Sun Oct  7 18:37:59 2012	(r241323)
+++ stable/9/sys/dev/mfi/mfi.c	Sun Oct  7 18:41:48 2012	(r241324)
@@ -2550,6 +2550,7 @@ mfi_config_lock(struct mfi_softc *sc, ui
 	case MFI_DCMD_LD_DELETE:
 	case MFI_DCMD_CFG_ADD:
 	case MFI_DCMD_CFG_CLEAR:
+	case MFI_DCMD_CFG_FOREIGN_IMPORT:
 		sx_xlock(&sc->mfi_config_lock);
 		return (1);
 	default:

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:42:03 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1903F10657C4;
	Sun,  7 Oct 2012 18:42:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 049638FC0A;
	Sun,  7 Oct 2012 18:42:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97Ig2ts050107;
	Sun, 7 Oct 2012 18:42:02 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97Ig2s4050104;
	Sun, 7 Oct 2012 18:42:02 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071842.q97Ig2s4050104@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:42:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241325 - stable/8/sys/dev/mfi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:42:03 -0000

Author: jhb
Date: Sun Oct  7 18:42:02 2012
New Revision: 241325
URL: http://svn.freebsd.org/changeset/base/241325

Log:
  MFC 240962:
  Grab the mfi_config_lock while performing a MFI_DCMD_CFG_FOREIGN_IMPORT
  request on behalf of a user utility.

Modified:
  stable/8/sys/dev/mfi/mfi.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/mfi/   (props changed)

Modified: stable/8/sys/dev/mfi/mfi.c
==============================================================================
--- stable/8/sys/dev/mfi/mfi.c	Sun Oct  7 18:41:48 2012	(r241324)
+++ stable/8/sys/dev/mfi/mfi.c	Sun Oct  7 18:42:02 2012	(r241325)
@@ -2550,6 +2550,7 @@ mfi_config_lock(struct mfi_softc *sc, ui
 	case MFI_DCMD_LD_DELETE:
 	case MFI_DCMD_CFG_ADD:
 	case MFI_DCMD_CFG_CLEAR:
+	case MFI_DCMD_CFG_FOREIGN_IMPORT:
 		sx_xlock(&sc->mfi_config_lock);
 		return (1);
 	default:

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:47:53 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D72BD106575F;
	Sun,  7 Oct 2012 18:47:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C179E8FC08;
	Sun,  7 Oct 2012 18:47:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IlrOG051078;
	Sun, 7 Oct 2012 18:47:53 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97Ilrp5051076;
	Sun, 7 Oct 2012 18:47:53 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071847.q97Ilrp5051076@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:47:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241326 - stable/9/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:47:54 -0000

Author: jhb
Date: Sun Oct  7 18:47:53 2012
New Revision: 241326
URL: http://svn.freebsd.org/changeset/base/241326

Log:
  MFC 239354:
  Allow static DMA allocations that allow for enough segments to do page-sized
  segments for the entire allocation to use kmem_alloc_attr() to allocate
  KVM rather than using kmem_alloc_contig().  This avoids requiring
  a single physically contiguous chunk in this case.

Modified:
  stable/9/sys/x86/x86/busdma_machdep.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/x86/x86/busdma_machdep.c
==============================================================================
--- stable/9/sys/x86/x86/busdma_machdep.c	Sun Oct  7 18:42:02 2012	(r241325)
+++ stable/9/sys/x86/x86/busdma_machdep.c	Sun Oct  7 18:47:53 2012	(r241326)
@@ -541,13 +541,14 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi
 	    dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) &&
 	    attr == VM_MEMATTR_DEFAULT) {
 		*vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags);
+	} else if (dmat->nsegments >= btoc(dmat->maxsize) &&
+	    dmat->alignment <= PAGE_SIZE &&
+	    (dmat->boundary == 0 || dmat->boundary >= dmat->lowaddr)) {
+		/* Page-based multi-segment allocations allowed */
+		*vaddr = (void *)kmem_alloc_attr(kernel_map, dmat->maxsize,
+		    mflags, 0ul, dmat->lowaddr, attr);
+		*mapp = &contig_dmamap;
 	} else {
-		/*
-		 * XXX Use Contigmalloc until it is merged into this facility
-		 *     and handles multi-seg allocations.  Nobody is doing
-		 *     multi-seg allocations yet though.
-		 * XXX Certain AGP hardware does.
-		 */
 		*vaddr = (void *)kmem_alloc_contig(kernel_map, dmat->maxsize,
 		    mflags, 0ul, dmat->lowaddr, dmat->alignment ?
 		    dmat->alignment : 1ul, dmat->boundary, attr);

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:57:29 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id BCD111065670;
	Sun,  7 Oct 2012 18:57:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A641A8FC17;
	Sun,  7 Oct 2012 18:57:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IvTJd052578;
	Sun, 7 Oct 2012 18:57:29 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IvTNO052576;
	Sun, 7 Oct 2012 18:57:29 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071857.q97IvTNO052576@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:57:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241327 - stable/9/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:57:30 -0000

Author: jhb
Date: Sun Oct  7 18:57:29 2012
New Revision: 241327
URL: http://svn.freebsd.org/changeset/base/241327

Log:
  MFC 239440,239519:
  Refine the changes made in r208212 to avoid bogus failures from
  if_delmulti() when clearing the configuration for a subinterface when
  the parent interface is being detached.  The current code was still
  triggering an assertion in if_delmulti() due to the parent interface being
  partially detached.  Fix this by not calling if_delmulti() at all if the
  parent interface is being detached.  Warn if if_delmulti() fails when the
  parent is not being detached (but similar to 208212, still proceed with
  tearing down the vlan state).

Modified:
  stable/9/sys/net/if_vlan.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/net/if_vlan.c
==============================================================================
--- stable/9/sys/net/if_vlan.c	Sun Oct  7 18:47:53 2012	(r241326)
+++ stable/9/sys/net/if_vlan.c	Sun Oct  7 18:57:29 2012	(r241327)
@@ -190,7 +190,7 @@ static	int vlan_setflags(struct ifnet *i
 static	int vlan_setmulti(struct ifnet *ifp);
 static	int vlan_transmit(struct ifnet *ifp, struct mbuf *m);
 static	void vlan_unconfig(struct ifnet *ifp);
-static	void vlan_unconfig_locked(struct ifnet *ifp);
+static	void vlan_unconfig_locked(struct ifnet *ifp, int departing);
 static	int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag);
 static	void vlan_link_state(struct ifnet *ifp);
 static	void vlan_capabilities(struct ifvlan *ifv);
@@ -575,7 +575,7 @@ vlan_ifdetach(void *arg __unused, struct
 #ifdef VLAN_ARRAY
 	for (i = 0; i < VLAN_ARRAY_SIZE; i++)
 		if ((ifv = ifp->if_vlantrunk->vlans[i])) {
-			vlan_unconfig_locked(ifv->ifv_ifp);
+			vlan_unconfig_locked(ifv->ifv_ifp, 1);
 			if (ifp->if_vlantrunk == NULL)
 				break;
 		}
@@ -583,7 +583,7 @@ vlan_ifdetach(void *arg __unused, struct
 restart:
 	for (i = 0; i < (1 << ifp->if_vlantrunk->hwidth); i++)
 		if ((ifv = LIST_FIRST(&ifp->if_vlantrunk->hash[i]))) {
-			vlan_unconfig_locked(ifv->ifv_ifp);
+			vlan_unconfig_locked(ifv->ifv_ifp, 1);
 			if (ifp->if_vlantrunk)
 				goto restart;	/* trunk->hwidth can change */
 			else
@@ -959,7 +959,7 @@ vlan_clone_create(struct if_clone *ifc, 
 		error = vlan_config(ifv, p, tag);
 		if (error != 0) {
 			/*
-			 * Since we've partialy failed, we need to back
+			 * Since we've partially failed, we need to back
 			 * out all the way, otherwise userland could get
 			 * confused.  Thus, we destroy the interface.
 			 */
@@ -1298,17 +1298,18 @@ vlan_unconfig(struct ifnet *ifp)
 {
 
 	VLAN_LOCK();
-	vlan_unconfig_locked(ifp);
+	vlan_unconfig_locked(ifp, 0);
 	VLAN_UNLOCK();
 }
 
 static void
-vlan_unconfig_locked(struct ifnet *ifp)
+vlan_unconfig_locked(struct ifnet *ifp, int departing)
 {
 	struct ifvlantrunk *trunk;
 	struct vlan_mc_entry *mc;
 	struct ifvlan *ifv;
 	struct ifnet  *parent;
+	int error;
 
 	VLAN_LOCK_ASSERT();
 
@@ -1328,14 +1329,21 @@ vlan_unconfig_locked(struct ifnet *ifp)
 		 */
 		while ((mc = SLIST_FIRST(&ifv->vlan_mc_listhead)) != NULL) {
 			/*
-			 * This may fail if the parent interface is
-			 * being detached.  Regardless, we should do a
-			 * best effort to free this interface as much
-			 * as possible as all callers expect vlan
-			 * destruction to succeed.
+			 * If the parent interface is being detached,
+			 * all its multicast addresses have already
+			 * been removed.  Warn about errors if
+			 * if_delmulti() does fail, but don't abort as
+			 * all callers expect vlan destruction to
+			 * succeed.
 			 */
-			(void)if_delmulti(parent,
-			    (struct sockaddr *)&mc->mc_addr);
+			if (!departing) {
+				error = if_delmulti(parent,
+				    (struct sockaddr *)&mc->mc_addr);
+				if (error)
+					if_printf(ifp,
+		    "Failed to delete multicast address from parent: %d\n",
+					    error);
+			}
 			SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries);
 			free(mc, M_VLAN);
 		}

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 18:57:53 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 032251065690;
	Sun,  7 Oct 2012 18:57:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E17008FC08;
	Sun,  7 Oct 2012 18:57:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IvqNH052665;
	Sun, 7 Oct 2012 18:57:52 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IvqVO052663;
	Sun, 7 Oct 2012 18:57:52 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071857.q97IvqVO052663@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:57:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241328 - stable/8/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:57:53 -0000

Author: jhb
Date: Sun Oct  7 18:57:52 2012
New Revision: 241328
URL: http://svn.freebsd.org/changeset/base/241328

Log:
  MFC 239440,239519:
  Refine the changes made in r208212 to avoid bogus failures from
  if_delmulti() when clearing the configuration for a subinterface when
  the parent interface is being detached.  The current code was still
  triggering an assertion in if_delmulti() due to the parent interface being
  partially detached.  Fix this by not calling if_delmulti() at all if the
  parent interface is being detached.  Warn if if_delmulti() fails when the
  parent is not being detached (but similar to 208212, still proceed with
  tearing down the vlan state).

Modified:
  stable/8/sys/net/if_vlan.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/net/   (props changed)

Modified: stable/8/sys/net/if_vlan.c
==============================================================================
--- stable/8/sys/net/if_vlan.c	Sun Oct  7 18:57:29 2012	(r241327)
+++ stable/8/sys/net/if_vlan.c	Sun Oct  7 18:57:52 2012	(r241328)
@@ -188,7 +188,7 @@ static	int vlan_setflags(struct ifnet *i
 static	int vlan_setmulti(struct ifnet *ifp);
 static	int vlan_transmit(struct ifnet *ifp, struct mbuf *m);
 static	void vlan_unconfig(struct ifnet *ifp);
-static	void vlan_unconfig_locked(struct ifnet *ifp);
+static	void vlan_unconfig_locked(struct ifnet *ifp, int departing);
 static	int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag);
 static	void vlan_link_state(struct ifnet *ifp, int link);
 static	void vlan_capabilities(struct ifvlan *ifv);
@@ -543,7 +543,7 @@ vlan_ifdetach(void *arg __unused, struct
 #ifdef VLAN_ARRAY
 	for (i = 0; i < VLAN_ARRAY_SIZE; i++)
 		if ((ifv = ifp->if_vlantrunk->vlans[i])) {
-			vlan_unconfig_locked(ifv->ifv_ifp);
+			vlan_unconfig_locked(ifv->ifv_ifp, 1);
 			if (ifp->if_vlantrunk == NULL)
 				break;
 		}
@@ -551,7 +551,7 @@ vlan_ifdetach(void *arg __unused, struct
 restart:
 	for (i = 0; i < (1 << ifp->if_vlantrunk->hwidth); i++)
 		if ((ifv = LIST_FIRST(&ifp->if_vlantrunk->hash[i]))) {
-			vlan_unconfig_locked(ifv->ifv_ifp);
+			vlan_unconfig_locked(ifv->ifv_ifp, 1);
 			if (ifp->if_vlantrunk)
 				goto restart;	/* trunk->hwidth can change */
 			else
@@ -821,7 +821,7 @@ vlan_clone_create(struct if_clone *ifc, 
 		error = vlan_config(ifv, p, tag);
 		if (error != 0) {
 			/*
-			 * Since we've partialy failed, we need to back
+			 * Since we've partially failed, we need to back
 			 * out all the way, otherwise userland could get
 			 * confused.  Thus, we destroy the interface.
 			 */
@@ -1163,17 +1163,18 @@ vlan_unconfig(struct ifnet *ifp)
 {
 
 	VLAN_LOCK();
-	vlan_unconfig_locked(ifp);
+	vlan_unconfig_locked(ifp, 0);
 	VLAN_UNLOCK();
 }
 
 static void
-vlan_unconfig_locked(struct ifnet *ifp)
+vlan_unconfig_locked(struct ifnet *ifp, int departing)
 {
 	struct ifvlantrunk *trunk;
 	struct vlan_mc_entry *mc;
 	struct ifvlan *ifv;
 	struct ifnet  *parent;
+	int error;
 
 	VLAN_LOCK_ASSERT();
 
@@ -1204,13 +1205,21 @@ vlan_unconfig_locked(struct ifnet *ifp)
 			    ETHER_ADDR_LEN);
 
 			/*
-			 * This may fail if the parent interface is
-			 * being detached.  Regardless, we should do a
-			 * best effort to free this interface as much
-			 * as possible as all callers expect vlan
-			 * destruction to succeed.
+			 * If the parent interface is being detached,
+			 * all its multicast addresses have already
+			 * been removed.  Warn about errors if
+			 * if_delmulti() does fail, but don't abort as
+			 * all callers expect vlan destruction to
+			 * succeed.
 			 */
-			(void)if_delmulti(parent, (struct sockaddr *)&sdl);
+			if (!departing) {
+				error = if_delmulti(parent,
+				    (struct sockaddr *)&sdl);
+				if (error)
+					if_printf(ifp,
+		    "Failed to delete multicast address from parent: %d\n",
+					    error);
+			}
 			SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries);
 			free(mc, M_VLAN);
 		}

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 19:30:17 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 666141065670;
	Sun,  7 Oct 2012 19:30:17 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4FDE88FC08;
	Sun,  7 Oct 2012 19:30:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97JUHKx056957;
	Sun, 7 Oct 2012 19:30:17 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97JUHCZ056952;
	Sun, 7 Oct 2012 19:30:17 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201210071930.q97JUHCZ056952@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sun, 7 Oct 2012 19:30:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241329 - head/sys/geom/raid
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 19:30:17 -0000

Author: mav
Date: Sun Oct  7 19:30:16 2012
New Revision: 241329
URL: http://svn.freebsd.org/changeset/base/241329

Log:
  Make graid command line a bit more friendly by allowing volume name or
  provider name to be specified instead of geom name (first argument in all
  subcommands except label).  In most cases there is only one array used
  any way, so it is not really useful to make user type ugly geom names like
  Intel-f0bdf223 or SiI-732c2b9448cf.  Though they can be used in some cases.
  
  Sponsored by:	iXsystems, Inc.
  MFC after:	1 month

Modified:
  head/sys/geom/raid/g_raid_ctl.c
  head/sys/geom/raid/md_ddf.c
  head/sys/geom/raid/md_intel.c
  head/sys/geom/raid/md_promise.c

Modified: head/sys/geom/raid/g_raid_ctl.c
==============================================================================
--- head/sys/geom/raid/g_raid_ctl.c	Sun Oct  7 18:57:52 2012	(r241328)
+++ head/sys/geom/raid/g_raid_ctl.c	Sun Oct  7 19:30:16 2012	(r241329)
@@ -51,7 +51,10 @@ g_raid_find_node(struct g_class *mp, con
 {
 	struct g_raid_softc *sc;
 	struct g_geom *gp;
+	struct g_provider *pp;
+	struct g_raid_volume *vol;
 
+	/* Look for geom with specified name. */
 	LIST_FOREACH(gp, &mp->geom, geom) {
 		sc = gp->softc;
 		if (sc == NULL)
@@ -61,6 +64,35 @@ g_raid_find_node(struct g_class *mp, con
 		if (strcasecmp(sc->sc_name, name) == 0)
 			return (sc);
 	}
+
+	/* Look for provider with specified name. */
+	LIST_FOREACH(gp, &mp->geom, geom) {
+		sc = gp->softc;
+		if (sc == NULL)
+			continue;
+		if (sc->sc_stopping != 0)
+			continue;
+		LIST_FOREACH(pp, &gp->provider, provider) {
+			if (strcmp(pp->name, name) == 0)
+				return (sc);
+			if (strncmp(pp->name, "raid/", 5) == 0 &&
+			    strcmp(pp->name + 5, name) == 0)
+				return (sc);
+		}
+	}
+
+	/* Look for volume with specified name. */
+	LIST_FOREACH(gp, &mp->geom, geom) {
+		sc = gp->softc;
+		if (sc == NULL)
+			continue;
+		if (sc->sc_stopping != 0)
+			continue;
+		TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) {
+			if (strcmp(vol->v_name, name) == 0)
+				return (sc);
+		}
+	}
 	return (NULL);
 }
 

Modified: head/sys/geom/raid/md_ddf.c
==============================================================================
--- head/sys/geom/raid/md_ddf.c	Sun Oct  7 18:57:52 2012	(r241328)
+++ head/sys/geom/raid/md_ddf.c	Sun Oct  7 19:30:16 2012	(r241329)
@@ -2231,7 +2231,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec
 	struct g_consumer *cp;
 	struct g_provider *pp;
 	char arg[16];
-	const char *verb, *volname, *levelname, *diskname;
+	const char *nodename, *verb, *volname, *levelname, *diskname;
 	char *tmp;
 	int *nargs, *force;
 	off_t size, sectorsize, strip, offs[DDF_MAX_DISKS_HARD], esize;
@@ -2502,8 +2502,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec
 	}
 	if (strcmp(verb, "delete") == 0) {
 
+		nodename = gctl_get_asciiparam(req, "arg0");
+		if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0)
+			nodename = NULL;
+
 		/* Full node destruction. */
-		if (*nargs == 1) {
+		if (*nargs == 1 && nodename != NULL) {
 			/* Check if some volume is still open. */
 			force = gctl_get_paraml(req, "force", sizeof(*force));
 			if (force != NULL && *force == 0 &&
@@ -2521,11 +2525,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec
 		}
 
 		/* Destroy specified volume. If it was last - all node. */
-		if (*nargs != 2) {
+		if (*nargs > 2) {
 			gctl_error(req, "Invalid number of arguments.");
 			return (-1);
 		}
-		volname = gctl_get_asciiparam(req, "arg1");
+		volname = gctl_get_asciiparam(req,
+		    nodename != NULL ? "arg1" : "arg0");
 		if (volname == NULL) {
 			gctl_error(req, "No volume name.");
 			return (-2);
@@ -2535,6 +2540,14 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec
 		TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) {
 			if (strcmp(vol->v_name, volname) == 0)
 				break;
+			pp = vol->v_provider;
+			if (pp == NULL)
+				continue;
+			if (strcmp(pp->name, volname) == 0)
+				break;
+			if (strncmp(pp->name, "raid/", 5) == 0 &&
+			    strcmp(pp->name + 5, volname) == 0)
+				break;
 		}
 		if (vol == NULL) {
 			i = strtol(volname, &tmp, 10);

Modified: head/sys/geom/raid/md_intel.c
==============================================================================
--- head/sys/geom/raid/md_intel.c	Sun Oct  7 18:57:52 2012	(r241328)
+++ head/sys/geom/raid/md_intel.c	Sun Oct  7 19:30:16 2012	(r241329)
@@ -1461,7 +1461,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
 	struct g_consumer *cp;
 	struct g_provider *pp;
 	char arg[16], serial[INTEL_SERIAL_LEN];
-	const char *verb, *volname, *levelname, *diskname;
+	const char *nodename, *verb, *volname, *levelname, *diskname;
 	char *tmp;
 	int *nargs, *force;
 	off_t off, size, sectorsize, strip, disk_sectors;
@@ -1876,8 +1876,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
 	}
 	if (strcmp(verb, "delete") == 0) {
 
+		nodename = gctl_get_asciiparam(req, "arg0");
+		if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0)
+			nodename = NULL;
+
 		/* Full node destruction. */
-		if (*nargs == 1) {
+		if (*nargs == 1 && nodename != NULL) {
 			/* Check if some volume is still open. */
 			force = gctl_get_paraml(req, "force", sizeof(*force));
 			if (force != NULL && *force == 0 &&
@@ -1895,11 +1899,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
 		}
 
 		/* Destroy specified volume. If it was last - all node. */
-		if (*nargs != 2) {
+		if (*nargs > 2) {
 			gctl_error(req, "Invalid number of arguments.");
 			return (-1);
 		}
-		volname = gctl_get_asciiparam(req, "arg1");
+		volname = gctl_get_asciiparam(req,
+		    nodename != NULL ? "arg1" : "arg0");
 		if (volname == NULL) {
 			gctl_error(req, "No volume name.");
 			return (-2);
@@ -1909,6 +1914,14 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
 		TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) {
 			if (strcmp(vol->v_name, volname) == 0)
 				break;
+			pp = vol->v_provider;
+			if (pp == NULL)
+				continue;
+			if (strcmp(pp->name, volname) == 0)
+				break;
+			if (strncmp(pp->name, "raid/", 5) == 0 &&
+			    strcmp(pp->name + 5, volname) == 0)
+				break;
 		}
 		if (vol == NULL) {
 			i = strtol(volname, &tmp, 10);

Modified: head/sys/geom/raid/md_promise.c
==============================================================================
--- head/sys/geom/raid/md_promise.c	Sun Oct  7 18:57:52 2012	(r241328)
+++ head/sys/geom/raid/md_promise.c	Sun Oct  7 19:30:16 2012	(r241329)
@@ -1217,7 +1217,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o
 	struct g_consumer *cp;
 	struct g_provider *pp;
 	char arg[16];
-	const char *verb, *volname, *levelname, *diskname;
+	const char *nodename, *verb, *volname, *levelname, *diskname;
 	char *tmp;
 	int *nargs, *force;
 	off_t size, sectorsize, strip;
@@ -1478,8 +1478,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o
 	}
 	if (strcmp(verb, "delete") == 0) {
 
+		nodename = gctl_get_asciiparam(req, "arg0");
+		if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0)
+			nodename = NULL;
+
 		/* Full node destruction. */
-		if (*nargs == 1) {
+		if (*nargs == 1 && nodename != NULL) {
 			/* Check if some volume is still open. */
 			force = gctl_get_paraml(req, "force", sizeof(*force));
 			if (force != NULL && *force == 0 &&
@@ -1497,11 +1501,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o
 		}
 
 		/* Destroy specified volume. If it was last - all node. */
-		if (*nargs != 2) {
+		if (*nargs > 2) {
 			gctl_error(req, "Invalid number of arguments.");
 			return (-1);
 		}
-		volname = gctl_get_asciiparam(req, "arg1");
+		volname = gctl_get_asciiparam(req,
+		    nodename != NULL ? "arg1" : "arg0");
 		if (volname == NULL) {
 			gctl_error(req, "No volume name.");
 			return (-2);
@@ -1511,6 +1516,14 @@ g_raid_md_ctl_promise(struct g_raid_md_o
 		TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) {
 			if (strcmp(vol->v_name, volname) == 0)
 				break;
+			pp = vol->v_provider;
+			if (pp == NULL)
+				continue;
+			if (strcmp(pp->name, volname) == 0)
+				break;
+			if (strncmp(pp->name, "raid/", 5) == 0 &&
+			    strcmp(pp->name + 5, volname) == 0)
+				break;
 		}
 		if (vol == NULL) {
 			i = strtol(volname, &tmp, 10);

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 19:51:28 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 5826D106568A;
	Sun,  7 Oct 2012 19:51:28 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from tensor.andric.com (tensor.andric.com [87.251.56.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 0F3CB8FC21;
	Sun,  7 Oct 2012 19:51:28 +0000 (UTC)
Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tensor.andric.com (Postfix) with ESMTPSA id BBEF65C59;
	Sun,  7 Oct 2012 21:51:26 +0200 (CEST)
Message-ID: <5071DD3B.4020301@FreeBSD.org>
Date: Sun, 07 Oct 2012 21:51:23 +0200
From: Dimitry Andric <dim@FreeBSD.org>
Organization: The FreeBSD Project
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121002 Thunderbird/16.0
MIME-Version: 1.0
To: Marcel Moolenaar <marcel@FreeBSD.org>
References: <201210071645.q97Gjcj4033917@svn.freebsd.org>
In-Reply-To: <201210071645.q97Gjcj4033917@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r241311 - head
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 19:51:28 -0000

On 2012-10-07 18:45, Marcel Moolenaar wrote:
> Author: marcel
> Date: Sun Oct  7 16:45:38 2012
> New Revision: 241311
> URL: http://svn.freebsd.org/changeset/base/241311
>
> Log:
>    Fix 32-bit library builds after the removal of adding -E to make for AS,
>    CC, CXX and LD. This fix implements the intended as it should have been
>    implemented all along: by passing AS, CC, CXX and LD on the commandline
>    of the sub-make instead of in the environment of the sub-make.

Thanks!  This works very nicely.


From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 19:53:10 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D4B7A106566B;
	Sun,  7 Oct 2012 19:53:05 +0000 (UTC)
	(envelope-from joel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 86BCE8FC22;
	Sun,  7 Oct 2012 19:53:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97Jr5lJ059994;
	Sun, 7 Oct 2012 19:53:05 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97Jr5u0059990;
	Sun, 7 Oct 2012 19:53:05 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201210071953.q97Jr5u0059990@svn.freebsd.org>
From: Joel Dahl <joel@FreeBSD.org>
Date: Sun, 7 Oct 2012 19:53:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241330 - in head/usr.sbin: bsdconfig chroot mountd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 19:53:10 -0000

Author: joel (doc committer)
Date: Sun Oct  7 19:53:04 2012
New Revision: 241330
URL: http://svn.freebsd.org/changeset/base/241330

Log:
  Minor mdoc fixes.

Modified:
  head/usr.sbin/bsdconfig/bsdconfig.8
  head/usr.sbin/chroot/chroot.8
  head/usr.sbin/mountd/exports.5

Modified: head/usr.sbin/bsdconfig/bsdconfig.8
==============================================================================
--- head/usr.sbin/bsdconfig/bsdconfig.8	Sun Oct  7 19:30:16 2012	(r241329)
+++ head/usr.sbin/bsdconfig/bsdconfig.8	Sun Oct  7 19:53:04 2012	(r241330)
@@ -129,7 +129,7 @@ Generate a graphviz
 language file
 .Pq printed on stdout
 visualizing the
-.Xr bsdconfig 8
+.Nm
 menu, include, and shortcut structure and relationships.  See
 .Dq bsdconfig dot -h
 for more details.

Modified: head/usr.sbin/chroot/chroot.8
==============================================================================
--- head/usr.sbin/chroot/chroot.8	Sun Oct  7 19:30:16 2012	(r241329)
+++ head/usr.sbin/chroot/chroot.8	Sun Oct  7 19:53:04 2012	(r241330)
@@ -60,7 +60,7 @@ options are given,
 the user,
 group and group list of the process are set to
 these values after the
-.Xr chroot 8
+.Nm
 has taken place.
 .Sh ENVIRONMENT
 The following environment variable is referenced by

Modified: head/usr.sbin/mountd/exports.5
==============================================================================
--- head/usr.sbin/mountd/exports.5	Sun Oct  7 19:30:16 2012	(r241329)
+++ head/usr.sbin/mountd/exports.5	Sun Oct  7 19:53:04 2012	(r241330)
@@ -101,7 +101,7 @@ This line does not export any file syste
 of the server's directory tree is for NFSv4 clients.
 The exported file systems for NFSv4 are specified via the other lines
 in the
-.Xr exports 5
+.Nm
 file in the same way as for NFSv2 and NFSv3.
 The pathnames must not have any symbolic links in them and should not have
 any

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 20:01:42 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0ADD9106572A;
	Sun,  7 Oct 2012 20:01:42 +0000 (UTC)
	(envelope-from joel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E7CBC8FC16;
	Sun,  7 Oct 2012 20:01:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97K1f3S061129;
	Sun, 7 Oct 2012 20:01:41 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97K1foA061122;
	Sun, 7 Oct 2012 20:01:41 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201210072001.q97K1foA061122@svn.freebsd.org>
From: Joel Dahl <joel@FreeBSD.org>
Date: Sun, 7 Oct 2012 20:01:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241331 - in head/usr.bin: calendar m4 m4/lib script
	unzip who
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 20:01:42 -0000

Author: joel (doc committer)
Date: Sun Oct  7 20:01:41 2012
New Revision: 241331
URL: http://svn.freebsd.org/changeset/base/241331

Log:
  Remove contractions.

Modified:
  head/usr.bin/calendar/calendar.1
  head/usr.bin/m4/lib/ohash_init.3
  head/usr.bin/m4/m4.1
  head/usr.bin/script/script.1
  head/usr.bin/unzip/unzip.1
  head/usr.bin/who/who.1

Modified: head/usr.bin/calendar/calendar.1
==============================================================================
--- head/usr.bin/calendar/calendar.1	Sun Oct  7 19:53:04 2012	(r241330)
+++ head/usr.bin/calendar/calendar.1	Sun Oct  7 20:01:41 2012	(r241331)
@@ -313,7 +313,7 @@ the time-difference towards Greenwich.
 The new and full moons are happening on the day indicated: They
 might happen in the time period in the early night or in the late
 evening.
-It doesn't indicate that they are starting in the night on that date.
+It does not indicate that they are starting in the night on that date.
 .Pp
 Because of minor differences between the output of the formulas
 used and other sources on the Internet, Druids and Werewolves should

Modified: head/usr.bin/m4/lib/ohash_init.3
==============================================================================
--- head/usr.bin/m4/lib/ohash_init.3	Sun Oct  7 19:53:04 2012	(r241330)
+++ head/usr.bin/m4/lib/ohash_init.3	Sun Oct  7 20:01:41 2012	(r241331)
@@ -166,7 +166,7 @@ for (n = ohash_first(h, &i); n != NULL; 
 points to an auxiliary unsigned integer used to record the current position
 in the ohash table.
 Those functions are safe to use even while entries are added to/removed
-from the table, but in such a case they don't guarantee that new entries
+from the table, but in such a case they do not guarantee that new entries
 will be returned.
 As a special case, they can safely be used to free elements in the table.
 .Pp

Modified: head/usr.bin/m4/m4.1
==============================================================================
--- head/usr.bin/m4/m4.1	Sun Oct  7 19:53:04 2012	(r241330)
+++ head/usr.bin/m4/m4.1	Sun Oct  7 20:01:41 2012	(r241331)
@@ -97,7 +97,7 @@ You can change the quote characters with
 .Ic changequote
 built-in macro.
 .Pp
-Most built-ins don't make any sense without arguments, and hence are not
+Most built-ins do not make any sense without arguments, and hence are not
 recognized as special when not followed by an open parenthesis.
 .Pp
 The options are as follows:

Modified: head/usr.bin/script/script.1
==============================================================================
--- head/usr.bin/script/script.1	Sun Oct  7 19:53:04 2012	(r241330)
+++ head/usr.bin/script/script.1	Sun Oct  7 20:01:41 2012	(r241331)
@@ -75,7 +75,7 @@ retaining the prior contents.
 .It Fl d
 When playing back a session with the
 .Fl p
-flag, don't sleep between records when playing back a timestamped session.
+flag, do not sleep between records when playing back a timestamped session.
 .It Fl k
 Log keys sent to the program as well as output.
 .It Fl p

Modified: head/usr.bin/unzip/unzip.1
==============================================================================
--- head/usr.bin/unzip/unzip.1	Sun Oct  7 19:53:04 2012	(r241330)
+++ head/usr.bin/unzip/unzip.1	Sun Oct  7 20:01:41 2012	(r241331)
@@ -50,7 +50,7 @@ Extract to stdout/screen.
 When extracting files from the zipfile, they are written to stdout.
 This is similar to
 .Fl p ,
-but doesn't suppress normal output.
+but does not suppress normal output.
 .It Fl d Ar dir
 Extract files into the specified directory rather than the current
 directory.

Modified: head/usr.bin/who/who.1
==============================================================================
--- head/usr.bin/who/who.1	Sun Oct  7 19:53:04 2012	(r241330)
+++ head/usr.bin/who/who.1	Sun Oct  7 20:01:41 2012	(r241331)
@@ -51,7 +51,7 @@ The options are as follows:
 .It Fl a
 Equivalent to
 .Fl bTu ,
-with the exception that output isn't restricted to the time and date of
+with the exception that output is not restricted to the time and date of
 the last system reboot.
 .It Fl b
 Write the time and date of the last system reboot.

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 20:17:25 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 8A771106566C;
	Sun,  7 Oct 2012 20:17:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 746668FC08;
	Sun,  7 Oct 2012 20:17:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97KHPCP063175;
	Sun, 7 Oct 2012 20:17:25 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97KHPPE063173;
	Sun, 7 Oct 2012 20:17:25 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210072017.q97KHPPE063173@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 20:17:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241332 - stable/8/sys/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 20:17:25 -0000

Author: jhb
Date: Sun Oct  7 20:17:24 2012
New Revision: 241332
URL: http://svn.freebsd.org/changeset/base/241332

Log:
  MFC 212429:
  Add real dependancies on the uuencoded firmwares.
  Now when one does 'make kernel ; make kernel' the second invocation
  only does:  `kernel.ko' is up to date.
  rather than reproduce all the .fw files and relink the kernel.

Modified:
  stable/8/sys/conf/files
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/conf/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Sun Oct  7 20:01:41 2012	(r241331)
+++ stable/8/sys/conf/files	Sun Oct  7 20:17:24 2012	(r241332)
@@ -1027,7 +1027,7 @@ ipw_bss.fwo			optional ipwbssfw | ipwfw	
 	no-implicit-rule						\
 	clean		"ipw_bss.fwo"
 ipw_bss.fw			optional ipwbssfw | ipwfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/ipw/ipw2100-1.3.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"ipw_bss.fw"
@@ -1041,7 +1041,7 @@ ipw_ibss.fwo			optional ipwibssfw | ipwf
 	no-implicit-rule						\
 	clean		"ipw_ibss.fwo"
 ipw_ibss.fw			optional ipwibssfw | ipwfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu"	\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"ipw_ibss.fw"
@@ -1055,7 +1055,7 @@ ipw_monitor.fwo			optional ipwmonitorfw 
 	no-implicit-rule						\
 	clean		"ipw_monitor.fwo"
 ipw_monitor.fw			optional ipwmonitorfw | ipwfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu"	\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"ipw_monitor.fw"
@@ -1083,7 +1083,7 @@ iwi_bss.fwo			optional iwibssfw | iwifw	
 	no-implicit-rule						\
 	clean		"iwi_bss.fwo"
 iwi_bss.fw			optional iwibssfw | iwifw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/iwi/ipw2200-bss.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"iwi_bss.fw"
@@ -1097,7 +1097,7 @@ iwi_ibss.fwo			optional iwiibssfw | iwif
 	no-implicit-rule						\
 	clean		"iwi_ibss.fwo"
 iwi_ibss.fw			optional iwiibssfw | iwifw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/iwi/ipw2200-ibss.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"iwi_ibss.fw"
@@ -1111,7 +1111,7 @@ iwi_monitor.fwo			optional iwimonitorfw 
 	no-implicit-rule						\
 	clean		"iwi_monitor.fwo"
 iwi_monitor.fw			optional iwimonitorfw | iwifw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu"	\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"iwi_monitor.fw"
@@ -1140,7 +1140,7 @@ iwn4965fw.fwo			optional iwn4965fw | iwn
 	no-implicit-rule						\
 	clean		"iwn4965fw.fwo"
 iwn4965.fw			optional iwn4965fw | iwnfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"iwn4965.fw"
@@ -1168,7 +1168,7 @@ iwn5150fw.fwo			optional iwn5150fw | iwn
 	no-implicit-rule						\
 	clean		"iwn5150fw.fwo"
 iwn5150.fw			optional iwn5150fw | iwnfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"iwn5150.fw"
@@ -1182,7 +1182,7 @@ iwn6000fw.fwo			optional iwn6000fw | iwn
 	no-implicit-rule						\
 	clean		"iwn6000fw.fwo"
 iwn6000.fw			optional iwn6000fw | iwnfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"iwn6000.fw"
@@ -1365,7 +1365,7 @@ mw88W8363.fwo		optional mwlfw					\
 	no-implicit-rule						\
 	clean		"mw88W8363.fwo"
 mw88W8363.fw		optional mwlfw					\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/mwl/mw88W8363.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu"	\
 	no-obj no-implicit-rule						\
 	clean		"mw88W8363.fw"
@@ -1375,7 +1375,7 @@ mwlboot.fwo		optional mwlfw					\
 	no-implicit-rule						\
 	clean		"mwlboot.fwo"
 mwlboot.fw		optional mwlfw					\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/mwl/mwlboot.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu"	\
 	no-obj no-implicit-rule						\
 	clean		"mwlboot.fw"
@@ -1487,7 +1487,7 @@ rt2561fw.fwo			optional rt2561fw | ralfw
 	no-implicit-rule						\
 	clean		"rt2561fw.fwo"
 rt2561.fw			optional rt2561fw | ralfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/ral/rt2561.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \
 	no-obj no-implicit-rule						\
 	clean		"rt2561.fw"
@@ -1501,7 +1501,7 @@ rt2561sfw.fwo			optional rt2561sfw | ral
 	no-implicit-rule						\
 	clean		"rt2561sfw.fwo"
 rt2561s.fw			optional rt2561sfw | ralfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/ral/rt2561s.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu"	\
 	no-obj no-implicit-rule						\
 	clean		"rt2561s.fw"
@@ -1515,7 +1515,7 @@ rt2661fw.fwo			optional rt2661fw | ralfw
 	no-implicit-rule						\
 	clean		"rt2661fw.fwo"
 rt2661.fw			optional rt2661fw | ralfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/ral/rt2661.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu"	\
 	no-obj no-implicit-rule						\
 	clean		"rt2661.fw"
@@ -1529,7 +1529,7 @@ rt2860fw.fwo			optional rt2860fw | ralfw
 	no-implicit-rule						\
 	clean		"rt2860fw.fwo"
 rt2860.fw			optional rt2860fw | ralfw		\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/ral/rt2860.fw.uu"		\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu"	\
 	no-obj no-implicit-rule						\
 	clean		"rt2860.fw"
@@ -1894,7 +1894,7 @@ wpifw.fwo			optional wpifw				\
 	no-implicit-rule						\
 	clean		"wpifw.fwo"
 wpi.fw			optional wpifw					\
-	dependency	".PHONY"					\
+	dependency	"$S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu"	\
 	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu"	\
 	no-obj no-implicit-rule						\
 	clean		"wpi.fw"

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 20:36:47 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 642911065708;
	Sun,  7 Oct 2012 20:36:47 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4F0468FC23;
	Sun,  7 Oct 2012 20:36:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97Kal7O066722;
	Sun, 7 Oct 2012 20:36:47 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97KalP6066720;
	Sun, 7 Oct 2012 20:36:47 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201210072036.q97KalP6066720@svn.freebsd.org>
From: Warner Losh <imp@FreeBSD.org>
Date: Sun, 7 Oct 2012 20:36:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241333 - head/sys/arm/at91
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 20:36:47 -0000

Author: imp
Date: Sun Oct  7 20:36:46 2012
New Revision: 241333
URL: http://svn.freebsd.org/changeset/base/241333

Log:
  Loop reading the RTC registers until the same values are obtained
  twice, as advised in the atmel docs.
  
  Submitted by:	Ian Lapore

Modified:
  head/sys/arm/at91/at91_rtc.c

Modified: head/sys/arm/at91/at91_rtc.c
==============================================================================
--- head/sys/arm/at91/at91_rtc.c	Sun Oct  7 20:17:24 2012	(r241332)
+++ head/sys/arm/at91/at91_rtc.c	Sun Oct  7 20:36:46 2012	(r241333)
@@ -256,7 +256,7 @@ static int
 at91_rtc_gettime(device_t dev, struct timespec *ts)
 {
 	struct clocktime ct;
-	uint32_t timr, calr;
+	uint32_t calr, calr2, timr, timr2;
 	struct at91_rtc_softc *sc;
 
 	sc = device_get_softc(dev);
@@ -266,8 +266,19 @@ at91_rtc_gettime(device_t dev, struct ti
 	if (RD4(sc, RTC_VER) & (RTC_VER_NVTIM | RTC_VER_NVCAL))
 		return EINVAL;
 
-	timr = RD4(sc, RTC_TIMR);
-	calr = RD4(sc, RTC_CALR);
+	/*
+	 * The RTC hardware can update registers while the CPU is reading them.
+	 * The manual advises reading until you obtain the same values twice.
+	 * Interleaving the reads (rather than timr, timr2, calr, calr2 order)
+	 * also ensures we don't miss a midnight rollover/carry between reads.
+	 */
+	do {
+		timr = RD4(sc, RTC_TIMR);
+		calr = RD4(sc, RTC_CALR);
+		timr2 = RD4(sc, RTC_TIMR);
+		calr2 = RD4(sc, RTC_CALR);
+	} while (timr != timr2 || calr != calr2);
+
 	ct.nsec = 0;
 	ct.sec = RTC_TIMR_SEC(timr);
 	ct.min = RTC_TIMR_MIN(timr);

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 21:32:42 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 8055A106566C;
	Sun,  7 Oct 2012 21:32:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66DCF8FC08;
	Sun,  7 Oct 2012 21:32:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97LWgmS074081;
	Sun, 7 Oct 2012 21:32:42 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97LWgDc074078;
	Sun, 7 Oct 2012 21:32:42 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210072132.q97LWgDc074078@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 21:32:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241334 - stable/9/sys/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 21:32:42 -0000

Author: jhb
Date: Sun Oct  7 21:32:41 2012
New Revision: 241334
URL: http://svn.freebsd.org/changeset/base/241334

Log:
  MFC 239955-239957:
  Cleanups and fixes for building firmware modules into a kernel:
  - Add common rules for building firmware object files (NORMAL_FW to run
    uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those
    instead of explicit ld/uudecode invocations in sys/conf/files.  Apart from
    increasing readability, this makes it possible to adjust the flags used for
    firmware objects in one place.
  - Similar to how r171350 fixed linking of kernel modules containing
    firmware objects by adding --no-warn-mismatch to the linker flags,
    add --no-warn-mismatch when linking firmware objects (*.fwo) as
    well as to the link of the main kernel file.  This permits firmware
    modules to be statically linked into an ia64 kernel.

Modified:
  stable/9/sys/conf/files
  stable/9/sys/conf/kern.pre.mk
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)

Modified: stable/9/sys/conf/files
==============================================================================
--- stable/9/sys/conf/files	Sun Oct  7 20:36:46 2012	(r241333)
+++ stable/9/sys/conf/files	Sun Oct  7 21:32:41 2012	(r241334)
@@ -1163,12 +1163,12 @@ ipwbssfw.c			optional ipwbssfw | ipwfw		
 	clean		"ipwbssfw.c"
 ipw_bss.fwo			optional ipwbssfw | ipwfw		\
 	dependency	"ipw_bss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_bss.fwo"
 ipw_bss.fw			optional ipwbssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_bss.fw"
 ipwibssfw.c			optional ipwibssfw | ipwfw		\
@@ -1177,12 +1177,12 @@ ipwibssfw.c			optional ipwibssfw | ipwfw
 	clean		"ipwibssfw.c"
 ipw_ibss.fwo			optional ipwibssfw | ipwfw		\
 	dependency	"ipw_ibss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_ibss.fwo"
 ipw_ibss.fw			optional ipwibssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_ibss.fw"
 ipwmonitorfw.c			optional ipwmonitorfw | ipwfw		\
@@ -1191,12 +1191,12 @@ ipwmonitorfw.c			optional ipwmonitorfw |
 	clean		"ipwmonitorfw.c"
 ipw_monitor.fwo			optional ipwmonitorfw | ipwfw		\
 	dependency	"ipw_monitor.fw"				\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_monitor.fwo"
 ipw_monitor.fw			optional ipwmonitorfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_monitor.fw"
 dev/iscsi/initiator/iscsi.c	optional iscsi_initiator scbus
@@ -1219,12 +1219,12 @@ iwibssfw.c			optional iwibssfw | iwifw		
 	clean		"iwibssfw.c"
 iwi_bss.fwo			optional iwibssfw | iwifw		\
 	dependency	"iwi_bss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_bss.fwo"
 iwi_bss.fw			optional iwibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-bss.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_bss.fw"
 iwiibssfw.c			optional iwiibssfw | iwifw		\
@@ -1233,12 +1233,12 @@ iwiibssfw.c			optional iwiibssfw | iwifw
 	clean		"iwiibssfw.c"
 iwi_ibss.fwo			optional iwiibssfw | iwifw		\
 	dependency	"iwi_ibss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_ibss.fwo"
 iwi_ibss.fw			optional iwiibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-ibss.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_ibss.fw"
 iwimonitorfw.c			optional iwimonitorfw | iwifw		\
@@ -1247,12 +1247,12 @@ iwimonitorfw.c			optional iwimonitorfw |
 	clean		"iwimonitorfw.c"
 iwi_monitor.fwo			optional iwimonitorfw | iwifw		\
 	dependency	"iwi_monitor.fw"				\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_monitor.fwo"
 iwi_monitor.fw			optional iwimonitorfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_monitor.fw"
 dev/iwn/if_iwn.c		optional iwn
@@ -1262,12 +1262,12 @@ iwn1000fw.c			optional iwn1000fw | iwnfw
 	clean		"iwn1000fw.c"
 iwn1000fw.fwo			optional iwn1000fw | iwnfw		\
 	dependency	"iwn1000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn1000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn1000fw.fwo"
 iwn1000.fw			optional iwn1000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn1000.fw"
 iwn4965fw.c			optional iwn4965fw | iwnfw		\
@@ -1276,12 +1276,12 @@ iwn4965fw.c			optional iwn4965fw | iwnfw
 	clean		"iwn4965fw.c"
 iwn4965fw.fwo			optional iwn4965fw | iwnfw		\
 	dependency	"iwn4965.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn4965.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn4965fw.fwo"
 iwn4965.fw			optional iwn4965fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn4965.fw"
 iwn5000fw.c			optional iwn5000fw | iwnfw		\
@@ -1290,12 +1290,12 @@ iwn5000fw.c			optional iwn5000fw | iwnfw
 	clean		"iwn5000fw.c"
 iwn5000fw.fwo		optional iwn5000fw | iwnfw			\
 	dependency	"iwn5000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5000fw.fwo"
 iwn5000.fw			optional iwn5000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5000.fw"
 iwn5150fw.c			optional iwn5150fw | iwnfw		\
@@ -1304,12 +1304,12 @@ iwn5150fw.c			optional iwn5150fw | iwnfw
 	clean		"iwn5150fw.c"
 iwn5150fw.fwo			optional iwn5150fw | iwnfw		\
 	dependency	"iwn5150.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5150.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5150fw.fwo"
 iwn5150.fw			optional iwn5150fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5150.fw"
 iwn6000fw.c			optional iwn6000fw | iwnfw		\
@@ -1318,12 +1318,12 @@ iwn6000fw.c			optional iwn6000fw | iwnfw
 	clean		"iwn6000fw.c"
 iwn6000fw.fwo			optional iwn6000fw | iwnfw		\
 	dependency	"iwn6000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000fw.fwo"
 iwn6000.fw			optional iwn6000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000.fw"
 iwn6000g2afw.c			optional iwn6000g2afw | iwnfw		\
@@ -1332,12 +1332,12 @@ iwn6000g2afw.c			optional iwn6000g2afw |
 	clean		"iwn6000g2afw.c"
 iwn6000g2afw.fwo		optional iwn6000g2afw | iwnfw		\
 	dependency	"iwn6000g2a.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2a.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2afw.fwo"
 iwn6000g2a.fw			optional iwn6000g2afw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2a.fw"
 iwn6000g2bfw.c			optional iwn6000g2bfw | iwnfw		\
@@ -1346,12 +1346,12 @@ iwn6000g2bfw.c			optional iwn6000g2bfw |
 	clean		"iwn6000g2bfw.c"
 iwn6000g2bfw.fwo		optional iwn6000g2bfw | iwnfw		\
 	dependency	"iwn6000g2b.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2b.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2bfw.fwo"
 iwn6000g2b.fw			optional iwn6000g2bfw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2b.fw"
 iwn6050fw.c			optional iwn6050fw | iwnfw		\
@@ -1360,12 +1360,12 @@ iwn6050fw.c			optional iwn6050fw | iwnfw
 	clean		"iwn6050fw.c"
 iwn6050fw.fwo			optional iwn6050fw | iwnfw		\
 	dependency	"iwn6050.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6050.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6050fw.fwo"
 iwn6050.fw			optional iwn6050fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6050.fw"
 dev/ixgb/if_ixgb.c		optional ixgb
@@ -1494,22 +1494,22 @@ mwlfw.c				optional mwlfw				\
 	clean		"mwlfw.c"
 mw88W8363.fwo		optional mwlfw					\
 	dependency	"mw88W8363.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mw88W8363.fwo"
 mw88W8363.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mw88W8363.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mw88W8363.fw"
 mwlboot.fwo		optional mwlfw					\
 	dependency	"mwlboot.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mwlboot.fwo"
 mwlboot.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mwlboot.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mwlboot.fw"
 dev/mxge/if_mxge.c		optional mxge pci
@@ -1626,12 +1626,12 @@ rt2561fw.c			optional rt2561fw | ralfw		
 	clean		"rt2561fw.c"
 rt2561fw.fwo			optional rt2561fw | ralfw		\
 	dependency	"rt2561.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561fw.fwo"
 rt2561.fw			optional rt2561fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561.fw"
 rt2561sfw.c			optional rt2561sfw | ralfw		\
@@ -1640,12 +1640,12 @@ rt2561sfw.c			optional rt2561sfw | ralfw
 	clean		"rt2561sfw.c"
 rt2561sfw.fwo			optional rt2561sfw | ralfw		\
 	dependency	"rt2561s.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561sfw.fwo"
 rt2561s.fw			optional rt2561sfw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561s.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561s.fw"
 rt2661fw.c			optional rt2661fw | ralfw		\
@@ -1654,12 +1654,12 @@ rt2661fw.c			optional rt2661fw | ralfw		
 	clean		"rt2661fw.c"
 rt2661fw.fwo			optional rt2661fw | ralfw		\
 	dependency	"rt2661.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2661fw.fwo"
 rt2661.fw			optional rt2661fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2661.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2661.fw"
 rt2860fw.c			optional rt2860fw | ralfw		\
@@ -1668,12 +1668,12 @@ rt2860fw.c			optional rt2860fw | ralfw		
 	clean		"rt2860fw.c"
 rt2860fw.fwo			optional rt2860fw | ralfw		\
 	dependency	"rt2860.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2860fw.fwo"
 rt2860.fw			optional rt2860fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2860.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2860.fw"
 dev/random/harvest.c		standard
@@ -1958,12 +1958,12 @@ runfw.c				optional runfw							\
 	clean		"runfw.c"
 runfw.fwo			optional runfw							\
 	dependency	"runfw"									\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} runfw"		\
+	compile-with	"${NORMAL_FWO}"								\
 	no-implicit-rule									\
 	clean		"runfw.fwo"
 runfw				optional runfw							\
 	dependency	"$S/contrib/dev/run/rt2870.fw.uu"					\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/run/rt2870.fw.uu"		\
+	compile-with	"${NORMAL_FW}"								\
 	no-obj no-implicit-rule									\
 	clean		"runfw"
 dev/usb/wlan/if_uath.c		optional uath
@@ -2071,12 +2071,12 @@ wpifw.c			optional wpifw					\
 	clean		"wpifw.c"
 wpifw.fwo			optional wpifw				\
 	dependency	"wpi.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"wpifw.fwo"
 wpi.fw			optional wpifw					\
 	dependency	"$S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"wpi.fw"
 dev/xe/if_xe.c			optional xe

Modified: stable/9/sys/conf/kern.pre.mk
==============================================================================
--- stable/9/sys/conf/kern.pre.mk	Sun Oct  7 20:36:46 2012	(r241333)
+++ stable/9/sys/conf/kern.pre.mk	Sun Oct  7 21:32:41 2012	(r241334)
@@ -131,6 +131,10 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${
 NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
 	  ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
 
+NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
+NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \
+	-o ${.TARGET} ${.ALLSRC:M*.fw}
+
 NORMAL_CTFCONVERT= [ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \
 		   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 
@@ -151,7 +155,7 @@ SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
 SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
 SYSTEM_OBJS+= hack.So
 SYSTEM_CTFMERGE= [ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
-SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \
+SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \
 	-warn-common -export-dynamic -dynamic-linker /red/herring \
 	-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 21:33:05 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 27D9110656C2;
	Sun,  7 Oct 2012 21:33:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0F5168FC14;
	Sun,  7 Oct 2012 21:33:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97LX5nG074178;
	Sun, 7 Oct 2012 21:33:05 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97LX4eC074175;
	Sun, 7 Oct 2012 21:33:04 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210072133.q97LX4eC074175@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 21:33:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241335 - stable/8/sys/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 21:33:05 -0000

Author: jhb
Date: Sun Oct  7 21:33:04 2012
New Revision: 241335
URL: http://svn.freebsd.org/changeset/base/241335

Log:
  MFC 239955-239957:
  Cleanups and fixes for building firmware modules into a kernel:
  - Add common rules for building firmware object files (NORMAL_FW to run
    uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those
    instead of explicit ld/uudecode invocations in sys/conf/files.  Apart from
    increasing readability, this makes it possible to adjust the flags used for
    firmware objects in one place.
  - Similar to how r171350 fixed linking of kernel modules containing
    firmware objects by adding --no-warn-mismatch to the linker flags,
    add --no-warn-mismatch when linking firmware objects (*.fwo) as
    well as to the link of the main kernel file.  This permits firmware
    modules to be statically linked into an ia64 kernel.

Modified:
  stable/8/sys/conf/files
  stable/8/sys/conf/kern.pre.mk
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/conf/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Sun Oct  7 21:32:41 2012	(r241334)
+++ stable/8/sys/conf/files	Sun Oct  7 21:33:04 2012	(r241335)
@@ -1023,12 +1023,12 @@ ipwbssfw.c			optional ipwbssfw | ipwfw		
 	clean		"ipwbssfw.c"
 ipw_bss.fwo			optional ipwbssfw | ipwfw		\
 	dependency	"ipw_bss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_bss.fwo"
 ipw_bss.fw			optional ipwbssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_bss.fw"
 ipwibssfw.c			optional ipwibssfw | ipwfw		\
@@ -1037,12 +1037,12 @@ ipwibssfw.c			optional ipwibssfw | ipwfw
 	clean		"ipwibssfw.c"
 ipw_ibss.fwo			optional ipwibssfw | ipwfw		\
 	dependency	"ipw_ibss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_ibss.fwo"
 ipw_ibss.fw			optional ipwibssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_ibss.fw"
 ipwmonitorfw.c			optional ipwmonitorfw | ipwfw		\
@@ -1051,12 +1051,12 @@ ipwmonitorfw.c			optional ipwmonitorfw |
 	clean		"ipwmonitorfw.c"
 ipw_monitor.fwo			optional ipwmonitorfw | ipwfw		\
 	dependency	"ipw_monitor.fw"				\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_monitor.fwo"
 ipw_monitor.fw			optional ipwmonitorfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_monitor.fw"
 dev/iscsi/initiator/iscsi.c	optional iscsi_initiator scbus
@@ -1079,12 +1079,12 @@ iwibssfw.c			optional iwibssfw | iwifw		
 	clean		"iwibssfw.c"
 iwi_bss.fwo			optional iwibssfw | iwifw		\
 	dependency	"iwi_bss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_bss.fwo"
 iwi_bss.fw			optional iwibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-bss.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_bss.fw"
 iwiibssfw.c			optional iwiibssfw | iwifw		\
@@ -1093,12 +1093,12 @@ iwiibssfw.c			optional iwiibssfw | iwifw
 	clean		"iwiibssfw.c"
 iwi_ibss.fwo			optional iwiibssfw | iwifw		\
 	dependency	"iwi_ibss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_ibss.fwo"
 iwi_ibss.fw			optional iwiibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-ibss.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_ibss.fw"
 iwimonitorfw.c			optional iwimonitorfw | iwifw		\
@@ -1107,12 +1107,12 @@ iwimonitorfw.c			optional iwimonitorfw |
 	clean		"iwimonitorfw.c"
 iwi_monitor.fwo			optional iwimonitorfw | iwifw		\
 	dependency	"iwi_monitor.fw"				\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_monitor.fwo"
 iwi_monitor.fw			optional iwimonitorfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_monitor.fw"
 dev/iwn/if_iwn.c		optional iwn
@@ -1122,12 +1122,12 @@ iwn1000fw.c			optional iwn1000fw | iwnfw
 	clean		"iwn1000fw.c"
 iwn1000fw.fwo			optional iwn1000fw | iwnfw		\
 	dependency	"iwn1000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn1000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn1000fw.fwo"
 iwn1000.fw			optional iwn1000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn1000.fw"
 iwn4965fw.c			optional iwn4965fw | iwnfw		\
@@ -1136,12 +1136,12 @@ iwn4965fw.c			optional iwn4965fw | iwnfw
 	clean		"iwn4965fw.c"
 iwn4965fw.fwo			optional iwn4965fw | iwnfw		\
 	dependency	"iwn4965.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn4965.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn4965fw.fwo"
 iwn4965.fw			optional iwn4965fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn4965.fw"
 iwn5000fw.c			optional iwn5000fw | iwnfw		\
@@ -1150,12 +1150,12 @@ iwn5000fw.c			optional iwn5000fw | iwnfw
 	clean		"iwn5000fw.c"
 iwn5000fw.fwo		optional iwn5000fw | iwnfw			\
 	dependency	"iwn5000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5000fw.fwo"
 iwn5000.fw			optional iwn5000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5000.fw"
 iwn5150fw.c			optional iwn5150fw | iwnfw		\
@@ -1164,12 +1164,12 @@ iwn5150fw.c			optional iwn5150fw | iwnfw
 	clean		"iwn5150fw.c"
 iwn5150fw.fwo			optional iwn5150fw | iwnfw		\
 	dependency	"iwn5150.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5150.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5150fw.fwo"
 iwn5150.fw			optional iwn5150fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5150.fw"
 iwn6000fw.c			optional iwn6000fw | iwnfw		\
@@ -1178,12 +1178,12 @@ iwn6000fw.c			optional iwn6000fw | iwnfw
 	clean		"iwn6000fw.c"
 iwn6000fw.fwo			optional iwn6000fw | iwnfw		\
 	dependency	"iwn6000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000fw.fwo"
 iwn6000.fw			optional iwn6000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000.fw"
 iwn6000g2afw.c			optional iwn6000g2afw | iwnfw		\
@@ -1192,12 +1192,12 @@ iwn6000g2afw.c			optional iwn6000g2afw |
 	clean		"iwn6000g2afw.c"
 iwn6000g2afw.fwo		optional iwn6000g2afw | iwnfw		\
 	dependency	"iwn6000g2a.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2a.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2afw.fwo"
 iwn6000g2a.fw			optional iwn6000g2afw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2a.fw"
 iwn6000g2bfw.c			optional iwn6000g2bfw | iwnfw		\
@@ -1206,12 +1206,12 @@ iwn6000g2bfw.c			optional iwn6000g2bfw |
 	clean		"iwn6000g2bfw.c"
 iwn6000g2bfw.fwo		optional iwn6000g2bfw | iwnfw		\
 	dependency	"iwn6000g2b.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2b.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2bfw.fwo"
 iwn6000g2b.fw			optional iwn6000g2bfw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2b.fw"
 iwn6050fw.c			optional iwn6050fw | iwnfw		\
@@ -1220,12 +1220,12 @@ iwn6050fw.c			optional iwn6050fw | iwnfw
 	clean		"iwn6050fw.c"
 iwn6050fw.fwo			optional iwn6050fw | iwnfw		\
 	dependency	"iwn6050.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6050.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6050fw.fwo"
 iwn6050.fw			optional iwn6050fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6050.fw"
 dev/ixgb/if_ixgb.c		optional ixgb
@@ -1361,22 +1361,22 @@ mwlfw.c				optional mwlfw				\
 	clean		"mwlfw.c"
 mw88W8363.fwo		optional mwlfw					\
 	dependency	"mw88W8363.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mw88W8363.fwo"
 mw88W8363.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mw88W8363.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mw88W8363.fw"
 mwlboot.fwo		optional mwlfw					\
 	dependency	"mwlboot.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mwlboot.fwo"
 mwlboot.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mwlboot.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mwlboot.fw"
 dev/mxge/if_mxge.c		optional mxge pci
@@ -1483,12 +1483,12 @@ rt2561fw.c			optional rt2561fw | ralfw		
 	clean		"rt2561fw.c"
 rt2561fw.fwo			optional rt2561fw | ralfw		\
 	dependency	"rt2561.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561fw.fwo"
 rt2561.fw			optional rt2561fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561.fw"
 rt2561sfw.c			optional rt2561sfw | ralfw		\
@@ -1497,12 +1497,12 @@ rt2561sfw.c			optional rt2561sfw | ralfw
 	clean		"rt2561sfw.c"
 rt2561sfw.fwo			optional rt2561sfw | ralfw		\
 	dependency	"rt2561s.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561sfw.fwo"
 rt2561s.fw			optional rt2561sfw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561s.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561s.fw"
 rt2661fw.c			optional rt2661fw | ralfw		\
@@ -1511,12 +1511,12 @@ rt2661fw.c			optional rt2661fw | ralfw		
 	clean		"rt2661fw.c"
 rt2661fw.fwo			optional rt2661fw | ralfw		\
 	dependency	"rt2661.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2661fw.fwo"
 rt2661.fw			optional rt2661fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2661.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2661.fw"
 rt2860fw.c			optional rt2860fw | ralfw		\
@@ -1525,12 +1525,12 @@ rt2860fw.c			optional rt2860fw | ralfw		
 	clean		"rt2860fw.c"
 rt2860fw.fwo			optional rt2860fw | ralfw		\
 	dependency	"rt2860.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2860fw.fwo"
 rt2860.fw			optional rt2860fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2860.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2860.fw"
 dev/random/harvest.c		standard
@@ -1890,12 +1890,12 @@ wpifw.c			optional wpifw					\
 	clean		"wpifw.c"
 wpifw.fwo			optional wpifw				\
 	dependency	"wpi.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"wpifw.fwo"
 wpi.fw			optional wpifw					\
 	dependency	"$S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"wpi.fw"
 dev/xe/if_xe.c			optional xe

Modified: stable/8/sys/conf/kern.pre.mk
==============================================================================
--- stable/8/sys/conf/kern.pre.mk	Sun Oct  7 21:32:41 2012	(r241334)
+++ stable/8/sys/conf/kern.pre.mk	Sun Oct  7 21:33:04 2012	(r241335)
@@ -131,6 +131,10 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${
 NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
 	  ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
 
+NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
+NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \
+	-o ${.TARGET} ${.ALLSRC:M*.fw}
+
 .if defined(CTFCONVERT)
 NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 .else
@@ -149,7 +153,7 @@ SYSTEM_OBJS+= hack.So
 SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
 LD+= -g
 .endif
-SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \
+SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \
 	-warn-common -export-dynamic -dynamic-linker /red/herring \
 	-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \

From owner-svn-src-all@FreeBSD.ORG  Sun Oct  7 23:45:20 2012
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 39930106566B;
	Sun,  7 Oct 2012 23:45:20 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2227B8FC08;
	Sun,  7 Oct 2012 23:45:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97NjJhn091566;
	Sun, 7 Oct 2012 23:45:19 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97NjJ0i091562;
	Sun, 7 Oct 2012 23:45:19 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201210072345.q97NjJ0i091562@svn.freebsd.org>
From: Adrian Chadd <adrian@FreeBSD.org>
Date: Sun, 7 Oct 2012 23:45:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241336 - head/sys/dev/ath
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 23:45:20 -0000

Author: adrian
Date: Sun Oct  7 23:45:19 2012
New Revision: 241336
URL: http://svn.freebsd.org/changeset/base/241336

Log:
  Migrate the TID TXQ accesses to a new set of macros, rather than reusing
  the ATH_TXQ_* macros.
  
  * Introduce the new macros;
  * rename the TID queue and TID filtered frame queue so the compiler
    tells me I'm using the wrong macro.
  
  These should correspond 1:1 to the existing code.

Modified:
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx_ht.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Sun Oct  7 21:33:04 2012	(r241335)
+++ head/sys/dev/ath/if_ath_tx.c	Sun Oct  7 23:45:19 2012	(r241336)
@@ -2669,7 +2669,7 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s
 
 	/* paused? queue */
 	if (tid->paused) {
-		ATH_TXQ_INSERT_HEAD(tid, bf, bf_list);
+		ATH_TID_INSERT_HEAD(tid, bf, bf_list);
 		/* XXX don't sched - we're paused! */
 		return;
 	}
@@ -2678,7 +2678,7 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s
 	if (bf->bf_state.bfs_dobaw &&
 	    (! BAW_WITHIN(tap->txa_start, tap->txa_wnd,
 	    SEQNO(bf->bf_state.bfs_seqno)))) {
-		ATH_TXQ_INSERT_HEAD(tid, bf, bf_list);
+		ATH_TID_INSERT_HEAD(tid, bf, bf_list);
 		ath_tx_tid_sched(sc, tid);
 		return;
 	}
@@ -2777,11 +2777,11 @@ ath_tx_swq(struct ath_softc *sc, struct 
 	if (atid->paused) {
 		/* TID is paused, queue */
 		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: paused\n", __func__);
-		ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
+		ATH_TID_INSERT_TAIL(atid, bf, bf_list);
 	} else if (ath_tx_ampdu_pending(sc, an, tid)) {
 		/* AMPDU pending; queue */
 		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pending\n", __func__);
-		ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
+		ATH_TID_INSERT_TAIL(atid, bf, bf_list);
 		/* XXX sched? */
 	} else if (ath_tx_ampdu_running(sc, an, tid)) {
 		/* AMPDU running, attempt direct dispatch if possible */
@@ -2789,7 +2789,7 @@ ath_tx_swq(struct ath_softc *sc, struct 
 		/*
 		 * Always queue the frame to the tail of the list.
 		 */
-		ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
+		ATH_TID_INSERT_TAIL(atid, bf, bf_list);
 
 		/*
 		 * If the hardware queue isn't busy, direct dispatch
@@ -2799,8 +2799,8 @@ ath_tx_swq(struct ath_softc *sc, struct 
 		 * Otherwise, schedule the TID.
 		 */
 		if (txq->axq_depth < sc->sc_hwq_limit) {
-			bf = TAILQ_FIRST(&atid->axq_q);
-			ATH_TXQ_REMOVE(atid, bf, bf_list);
+			bf = ATH_TID_FIRST(atid);
+			ATH_TID_REMOVE(atid, bf, bf_list);
 
 			/*
 			 * Ensure it's definitely treated as a non-AMPDU
@@ -2831,7 +2831,7 @@ ath_tx_swq(struct ath_softc *sc, struct 
 	} else {
 		/* Busy; queue */
 		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: swq'ing\n", __func__);
-		ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
+		ATH_TID_INSERT_TAIL(atid, bf, bf_list);
 		ath_tx_tid_sched(sc, atid);
 	}
 }
@@ -2856,8 +2856,8 @@ ath_tx_tid_init(struct ath_softc *sc, st
 		/* XXX now with this bzer(), is the field 0'ing needed? */
 		bzero(atid, sizeof(*atid));
 
-		TAILQ_INIT(&atid->axq_q);
-		TAILQ_INIT(&atid->filtq.axq_q);
+		TAILQ_INIT(&atid->tid_q);
+		TAILQ_INIT(&atid->filtq.tid_q);
 		atid->tid = i;
 		atid->an = an;
 		for (j = 0; j < ATH_TID_MAX_BUFS; j++)
@@ -2948,7 +2948,7 @@ ath_tx_tid_filt_addbuf(struct ath_softc 
 	ath_tx_set_retry(sc, bf);
 	sc->sc_stats.ast_tx_swfiltered++;
 
-	ATH_TXQ_INSERT_TAIL(&tid->filtq, bf, bf_list);
+	ATH_TID_INSERT_TAIL(&tid->filtq, bf, bf_list);
 }
 
 /*
@@ -2997,9 +2997,9 @@ ath_tx_tid_filt_comp_complete(struct ath
 	tid->clrdmask = 1;
 
 	/* XXX this is really quite inefficient */
-	while ((bf = TAILQ_LAST(&tid->filtq.axq_q, ath_bufhead_s)) != NULL) {
-		ATH_TXQ_REMOVE(&tid->filtq, bf, bf_list);
-		ATH_TXQ_INSERT_HEAD(tid, bf, bf_list);
+	while ((bf = ATH_TID_LAST(&tid->filtq, ath_bufhead_s)) != NULL) {
+		ATH_TID_REMOVE(&tid->filtq, bf, bf_list);
+		ATH_TID_INSERT_HEAD(tid, bf, bf_list);
 	}
 
 	ath_tx_tid_resume(sc, tid);
@@ -3392,7 +3392,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s
 	/* Walk the queue, free frames */
 	t = 0;
 	for (;;) {
-		bf = TAILQ_FIRST(&tid->axq_q);
+		bf = ATH_TID_FIRST(tid);
 		if (bf == NULL) {
 			break;
 		}
@@ -3402,14 +3402,14 @@ ath_tx_tid_drain(struct ath_softc *sc, s
 			t = 1;
 		}
 
-		ATH_TXQ_REMOVE(tid, bf, bf_list);
+		ATH_TID_REMOVE(tid, bf, bf_list);
 		ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf);
 	}
 
 	/* And now, drain the filtered frame queue */
 	t = 0;
 	for (;;) {
-		bf = TAILQ_FIRST(&tid->filtq.axq_q);
+		bf = ATH_TID_FIRST(&tid->filtq);
 		if (bf == NULL)
 			break;
 
@@ -3418,7 +3418,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s
 			t = 1;
 		}
 
-		ATH_TXQ_REMOVE(&tid->filtq, bf, bf_list);
+		ATH_TID_REMOVE(&tid->filtq, bf, bf_list);
 		ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf);
 	}
 
@@ -3668,9 +3668,9 @@ ath_tx_tid_cleanup(struct ath_softc *sc,
 	 * we run off and discard/process things.
 	 */
 	/* XXX this is really quite inefficient */
-	while ((bf = TAILQ_LAST(&atid->filtq.axq_q, ath_bufhead_s)) != NULL) {
-		ATH_TXQ_REMOVE(&atid->filtq, bf, bf_list);
-		ATH_TXQ_INSERT_HEAD(atid, bf, bf_list);
+	while ((bf = ATH_TID_LAST(&atid->filtq, ath_bufhead_s)) != NULL) {
+		ATH_TID_REMOVE(&atid->filtq, bf, bf_list);
+		ATH_TID_INSERT_HEAD(atid, bf, bf_list);
 	}
 
 	/*
@@ -3679,11 +3679,11 @@ ath_tx_tid_cleanup(struct ath_softc *sc,
 	 * + Discard retry frames in the queue
 	 * + Fix the completion function to be non-aggregate
 	 */
-	bf = TAILQ_FIRST(&atid->axq_q);
+	bf = ATH_TID_FIRST(atid);
 	while (bf) {
 		if (bf->bf_state.bfs_isretried) {
 			bf_next = TAILQ_NEXT(bf, bf_list);
-			TAILQ_REMOVE(&atid->axq_q, bf, bf_list);
+			ATH_TID_REMOVE(atid, bf, bf_list);
 			atid->axq_depth--;
 			if (bf->bf_state.bfs_dobaw) {
 				ath_tx_update_baw(sc, an, atid, bf);
@@ -3888,7 +3888,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft
 	 * Insert this at the head of the queue, so it's
 	 * retried before any current/subsequent frames.
 	 */
-	ATH_TXQ_INSERT_HEAD(atid, bf, bf_list);
+	ATH_TID_INSERT_HEAD(atid, bf, bf_list);
 	ath_tx_tid_sched(sc, atid);
 	/* Send the BAR if there are no other frames waiting */
 	if (ath_tx_tid_bar_tx_ready(sc, atid))
@@ -4017,7 +4017,7 @@ ath_tx_comp_aggr_error(struct ath_softc 
 	/* Prepend all frames to the beginning of the queue */
 	while ((bf = TAILQ_LAST(&bf_q, ath_bufhead_s)) != NULL) {
 		TAILQ_REMOVE(&bf_q, bf, bf_list);
-		ATH_TXQ_INSERT_HEAD(tid, bf, bf_list);
+		ATH_TID_INSERT_HEAD(tid, bf, bf_list);
 	}
 
 	/*
@@ -4387,7 +4387,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 	/* Prepend all frames to the beginning of the queue */
 	while ((bf = TAILQ_LAST(&bf_q, ath_bufhead_s)) != NULL) {
 		TAILQ_REMOVE(&bf_q, bf, bf_list);
-		ATH_TXQ_INSERT_HEAD(atid, bf, bf_list);
+		ATH_TID_INSERT_HEAD(atid, bf, bf_list);
 	}
 
 	/*
@@ -4665,7 +4665,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 		if (tid->paused)
 			break;
 
-		bf = TAILQ_FIRST(&tid->axq_q);
+		bf = ATH_TID_FIRST(tid);
 		if (bf == NULL) {
 			break;
 		}
@@ -4678,7 +4678,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 			DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 			    "%s: non-baw packet\n",
 			    __func__);
-			ATH_TXQ_REMOVE(tid, bf, bf_list);
+			ATH_TID_REMOVE(tid, bf, bf_list);
 
 			if (bf->bf_state.bfs_nframes > 1)
 				device_printf(sc->sc_dev,
@@ -4868,12 +4868,12 @@ ath_tx_tid_hw_queue_norm(struct ath_soft
 		if (tid->paused)
 			break;
 
-		bf = TAILQ_FIRST(&tid->axq_q);
+		bf = ATH_TID_FIRST(tid);
 		if (bf == NULL) {
 			break;
 		}
 
-		ATH_TXQ_REMOVE(tid, bf, bf_list);
+		ATH_TID_REMOVE(tid, bf, bf_list);
 
 		KASSERT(txq == bf->bf_state.bfs_txq, ("txqs not equal!\n"));
 

Modified: head/sys/dev/ath/if_ath_tx_ht.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx_ht.c	Sun Oct  7 21:33:04 2012	(r241335)
+++ head/sys/dev/ath/if_ath_tx_ht.c	Sun Oct  7 23:45:19 2012	(r241336)
@@ -661,7 +661,7 @@ ath_tx_form_aggr(struct ath_softc *sc, s
 	h_baw = tap->txa_wnd / 2;
 
 	for (;;) {
-		bf = TAILQ_FIRST(&tid->axq_q);
+		bf = ATH_TID_FIRST(tid);
 		if (bf_first == NULL)
 			bf_first = bf;
 		if (bf == NULL) {
@@ -760,7 +760,7 @@ ath_tx_form_aggr(struct ath_softc *sc, s
 		/*
 		 * this packet is part of an aggregate.
 		 */
-		ATH_TXQ_REMOVE(tid, bf, bf_list);
+		ATH_TID_REMOVE(tid, bf, bf_list);
 
 		/* The TID lock is required for the BAW update */
 		ath_tx_addto_baw(sc, an, tid, bf);

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Sun Oct  7 21:33:04 2012	(r241335)
+++ head/sys/dev/ath/if_athvar.h	Sun Oct  7 23:45:19 2012	(r241336)
@@ -99,7 +99,7 @@ struct ath_buf;
  * Note that TID 16 (WME_NUM_TID+1) is for handling non-QoS frames.
  */
 struct ath_tid {
-	TAILQ_HEAD(,ath_buf) axq_q;		/* pending buffers */
+	TAILQ_HEAD(,ath_buf)	tid_q;		/* pending buffers */
 	u_int			axq_depth;	/* SW queue depth */
 	char			axq_name[48];	/* lock name */
 	struct ath_node		*an;		/* pointer to parent */
@@ -108,7 +108,7 @@ struct ath_tid {
 	int			hwq_depth;	/* how many buffers are on HW */
 
 	struct {
-		TAILQ_HEAD(,ath_buf) axq_q;		/* filtered queue */
+		TAILQ_HEAD(,ath_buf)	tid_q;		/* filtered queue */
 		u_int			axq_depth;	/* SW queue depth */
 		char			axq_name[48];	/* lock name */
 	} filtq;
@@ -355,6 +355,9 @@ struct ath_txq {
 #define	ATH_TID_UNLOCK_ASSERT(_sc, _tid)	\
 	    ATH_TXQ_UNLOCK_ASSERT((_sc)->sc_ac2q[(_tid)->ac])
 
+/*
+ * These are for the hardware queue.
+ */
 #define ATH_TXQ_INSERT_HEAD(_tq, _elm, _field) do { \
 	TAILQ_INSERT_HEAD(&(_tq)->axq_q, (_elm), _field); \
 	(_tq)->axq_depth++; \
@@ -370,6 +373,24 @@ struct ath_txq {
 #define	ATH_TXQ_FIRST(_tq)		TAILQ_FIRST(&(_tq)->axq_q)
 #define	ATH_TXQ_LAST(_tq, _field)	TAILQ_LAST(&(_tq)->axq_q, _field)
 
+/*
+ * These are for the TID software queue and filtered frames queues.
+ */
+#define ATH_TID_INSERT_HEAD(_tq, _elm, _field) do { \
+	TAILQ_INSERT_HEAD(&(_tq)->tid_q, (_elm), _field); \
+	(_tq)->axq_depth++; \
+} while (0)
+#define ATH_TID_INSERT_TAIL(_tq, _elm, _field) do { \
+	TAILQ_INSERT_TAIL(&(_tq)->tid_q, (_elm), _field); \
+	(_tq)->axq_depth++; \
+} while (0)
+#define ATH_TID_REMOVE(_tq, _elm, _field) do { \
+	TAILQ_REMOVE(&(_tq)->tid_q, _elm, _field); \
+	(_tq)->axq_depth--; \
+} while (0)
+#define	ATH_TID_FIRST(_tq)		TAILQ_FIRST(&(_tq)->tid_q)
+#define	ATH_TID_LAST(_tq, _field)	TAILQ_LAST(&(_tq)->tid_q, _field)
+
 struct ath_vap {
 	struct ieee80211vap av_vap;	/* base class */
 	int		av_bslot;	/* beacon slot index */

