From owner-svn-src-head@FreeBSD.ORG  Sun Oct  7 00:20:10 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 01:58:33 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 02:08:19 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 05:31:43 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 13:27:08 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 15:37:31 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 16:45:39 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 17:48:39 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 18:07:46 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 19:30:17 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 19:51:28 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 19:53:10 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 20:01:42 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 20:36:47 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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-head@FreeBSD.ORG  Sun Oct  7 23:45:20 2012
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@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-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-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 */

