CVS commit: src/sys/dev/pci

2014-10-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Oct  7 07:04:35 UTC 2014

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Don't call ifmedia_ioctl with holding locks


To generate a diff of this commit:
cvs rdiff -u -r1.301 -r1.302 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.301 src/sys/dev/pci/if_wm.c:1.302
--- src/sys/dev/pci/if_wm.c:1.301	Mon Oct  6 07:52:50 2014
+++ src/sys/dev/pci/if_wm.c	Tue Oct  7 07:04:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.301 2014/10/06 07:52:50 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.302 2014/10/07 07:04:35 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.301 2014/10/06 07:52:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.302 2014/10/07 07:04:35 ozaki-r Exp $");
 
 #include 
 #include 
@@ -2677,7 +2677,15 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 			}
 			sc->sc_flowflags = ifr->ifr_media & IFM_ETH_FMASK;
 		}
+		WM_BOTH_UNLOCK(sc);
+#ifdef WM_MPSAFE
+		s = splnet();
+#endif
 		error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
+#ifdef WM_MPSAFE
+		splx(s);
+#endif
+		WM_BOTH_LOCK(sc);
 		break;
 	case SIOCINITIFADDR:
 		if (ifa->ifa_addr->sa_family == AF_LINK) {



CVS commit: src/sys/arch/arm/broadcom

2014-10-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct  7 08:30:05 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_mbox.c bcm2835_mbox.h
bcm2835_mbox_subr.c bcm2835_obio.c

Log Message:
Mailbox improvements from mlelstv@

Serialise access to the mailbox and use interrupts.

XXX if (cold) should go


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/broadcom/bcm2835_mbox.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm2835_mbox.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_mbox_subr.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/broadcom/bcm2835_obio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_mbox.c
diff -u src/sys/arch/arm/broadcom/bcm2835_mbox.c:1.7 src/sys/arch/arm/broadcom/bcm2835_mbox.c:1.8
--- src/sys/arch/arm/broadcom/bcm2835_mbox.c:1.7	Thu Oct  2 11:58:12 2014
+++ src/sys/arch/arm/broadcom/bcm2835_mbox.c	Tue Oct  7 08:30:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_mbox.c,v 1.7 2014/10/02 11:58:12 skrll Exp $	*/
+/*	$NetBSD: bcm2835_mbox.c,v 1.8 2014/10/07 08:30:05 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox.c,v 1.7 2014/10/02 11:58:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox.c,v 1.8 2014/10/07 08:30:05 skrll Exp $");
 
 #include 
 #include 
@@ -52,14 +52,20 @@ struct bcm2835mbox_softc {
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_ioh;
 	bus_dma_tag_t sc_dmat;
+	void *sc_intrh;
 
 	kmutex_t sc_lock;
+	kmutex_t sc_intr_lock;
+	kcondvar_t sc_chan[BCM2835_MBOX_NUMCHANNELS];
+	uint32_t sc_mbox[BCM2835_MBOX_NUMCHANNELS];
 };
 
 static struct bcm2835mbox_softc *bcm2835mbox_sc;
 
 static int bcmmbox_match(device_t, cfdata_t, void *);
 static void bcmmbox_attach(device_t, device_t, void *);
+static int bcmmbox_intr1(struct bcm2835mbox_softc *, int);
+static int bcmmbox_intr(void *);
 
 CFATTACH_DECL_NEW(bcmmbox, sizeof(struct bcm2835mbox_softc),
 bcmmbox_match, bcmmbox_attach, NULL, NULL);
@@ -82,17 +88,18 @@ bcmmbox_attach(device_t parent, device_t
 struct bcm2835mbox_softc *sc = device_private(self);
  	struct amba_attach_args *aaa = aux;
 	struct bcmmbox_attach_args baa;
+	int i;
 
 	aprint_naive("\n");
 	aprint_normal(": VC mailbox\n");
 
-	if (bcm2835mbox_sc == NULL)
-		bcm2835mbox_sc = sc;
-
 	sc->sc_dev = self;
 	sc->sc_iot = aaa->aaa_iot;
 	sc->sc_dmat = aaa->aaa_dmat;
 	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_VM);
+	for (i = 0; i < BCM2835_MBOX_NUMCHANNELS; ++i)
+		cv_init(&sc->sc_chan[i], "bcmmbox");
 
 	if (bus_space_map(aaa->aaa_iot, aaa->aaa_addr, BCM2835_MBOX_SIZE, 0,
 	&sc->sc_ioh)) {
@@ -100,10 +107,74 @@ bcmmbox_attach(device_t parent, device_t
 		return;
 	}
 
+	sc->sc_intrh = bcm2835_intr_establish(aaa->aaa_intr, IPL_VM,
+	bcmmbox_intr, sc);
+	if (sc->sc_intrh == NULL) {
+		aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n");
+		return;
+	}
+
+	/* enable mbox interrupt */
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, BCM2835_MBOX_CFG,
+	BCM2835_MBOX_CFG_DATAIRQEN);
+
+	if (bcm2835mbox_sc == NULL)
+		bcm2835mbox_sc = sc;
+
 	baa.baa_dmat = aaa->aaa_dmat;
 	sc->sc_platdev = config_found_ia(self, "bcmmboxbus", &baa, NULL);
 }
 
+static int
+bcmmbox_intr1(struct bcm2835mbox_softc *sc, int cv)
+{
+	uint32_t mbox, chan, data;
+	int ret = 0;
+
+	KASSERT(mutex_owned(&sc->sc_intr_lock));
+
+	bus_space_barrier(sc->sc_iot, sc->sc_ioh, 0, BCM2835_MBOX_SIZE,
+	BUS_SPACE_BARRIER_READ);
+
+	while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh,
+	BCM2835_MBOX0_STATUS) & BCM2835_MBOX_STATUS_EMPTY) == 0) {
+
+		mbox = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
+		BCM2835_MBOX0_READ);
+
+		chan = BCM2835_MBOX_CHAN(mbox);
+		data = BCM2835_MBOX_DATA(mbox);
+		ret = 1;
+
+		if (BCM2835_MBOX_CHAN(sc->sc_mbox[chan]) != 0) {
+			aprint_error("bcmmbox_intr: chan %d overflow\n",chan);
+			continue;
+		}
+
+		sc->sc_mbox[chan] = data | BCM2835_MBOX_CHANMASK;
+
+		if (cv)
+			cv_broadcast(&sc->sc_chan[chan]);
+	}
+
+	return ret;
+}
+
+static int
+bcmmbox_intr(void *cookie)
+{
+	struct bcm2835mbox_softc *sc = cookie;
+	int ret;
+
+	mutex_enter(&sc->sc_intr_lock);
+
+	ret = bcmmbox_intr1(sc, 1);
+
+	mutex_exit(&sc->sc_intr_lock);
+
+	return ret;
+}
+
 void
 bcmmbox_read(uint8_t chan, uint32_t *data)
 {
@@ -111,7 +182,20 @@ bcmmbox_read(uint8_t chan, uint32_t *dat
 
 	KASSERT(sc != NULL);
 
-	return bcm2835_mbox_read(sc->sc_iot, sc->sc_ioh, chan, data);
+	mutex_enter(&sc->sc_lock);
+
+	mutex_enter(&sc->sc_intr_lock);
+	while (BCM2835_MBOX_CHAN(sc->sc_mbox[chan]) == 0) {
+		if (cold)
+			bcmmbox_intr1(sc, 0);
+		else
+			cv_wait(&sc->sc_chan[chan], &sc->sc_intr_lock);
+	}
+	*data = BCM2835_MBOX_DATA(sc->sc_mbox[chan]);
+	sc->sc_mbox[chan] = 0;
+	mutex_exit(&sc->sc_intr_lock);

CVS commit: src/sys/arch/evbarm/rpi

2014-10-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Oct  7 08:37:18 UTC 2014

Modified Files:
src/sys/arch/evbarm/rpi: rpi_machdep.c

Log Message:
fwrev is a timestamp, print in decimal.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/evbarm/rpi/rpi_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/rpi/rpi_machdep.c
diff -u src/sys/arch/evbarm/rpi/rpi_machdep.c:1.54 src/sys/arch/evbarm/rpi/rpi_machdep.c:1.55
--- src/sys/arch/evbarm/rpi/rpi_machdep.c:1.54	Sat Oct  4 13:05:57 2014
+++ src/sys/arch/evbarm/rpi/rpi_machdep.c	Tue Oct  7 08:37:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpi_machdep.c,v 1.54 2014/10/04 13:05:57 macallan Exp $	*/
+/*	$NetBSD: rpi_machdep.c,v 1.55 2014/10/07 08:37:18 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.54 2014/10/04 13:05:57 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.55 2014/10/07 08:37:18 mlelstv Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_ddb.h"
@@ -1082,7 +1082,7 @@ SYSCTL_SETUP(sysctl_machdep_rpi, "sysctl
 	NULL, 0, NULL, 0, CTL_MACHDEP, CTL_EOL);
 
 	sysctl_createv(clog, 0, NULL, NULL,
-	CTLFLAG_PERMANENT|CTLFLAG_READONLY|CTLFLAG_HEX,
+	CTLFLAG_PERMANENT|CTLFLAG_READONLY,
 	CTLTYPE_INT, "firmware_revision", NULL, NULL, 0,
 	&vb.vbt_fwrev.rev, 0, CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 



CVS commit: src/sys/dev/pci

2014-10-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Oct  7 08:45:02 UTC 2014

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Tidy up locking in wm_ioctl


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.302 src/sys/dev/pci/if_wm.c:1.303
--- src/sys/dev/pci/if_wm.c:1.302	Tue Oct  7 07:04:35 2014
+++ src/sys/dev/pci/if_wm.c	Tue Oct  7 08:45:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.302 2014/10/07 07:04:35 ozaki-r Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.303 2014/10/07 08:45:02 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.302 2014/10/07 07:04:35 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.303 2014/10/07 08:45:02 ozaki-r Exp $");
 
 #include 
 #include 
@@ -2660,11 +2660,10 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 #ifndef WM_MPSAFE
 	s = splnet();
 #endif
-	WM_BOTH_LOCK(sc);
-
 	switch (cmd) {
 	case SIOCSIFMEDIA:
 	case SIOCGIFMEDIA:
+		WM_BOTH_LOCK(sc);
 		/* Flow control requires full-duplex mode. */
 		if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO ||
 		(ifr->ifr_media & IFM_FDX) == 0)
@@ -2685,9 +2684,9 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 #ifdef WM_MPSAFE
 		splx(s);
 #endif
-		WM_BOTH_LOCK(sc);
 		break;
 	case SIOCINITIFADDR:
+		WM_BOTH_LOCK(sc);
 		if (ifa->ifa_addr->sa_family == AF_LINK) {
 			sdl = satosdl(ifp->if_dl->ifa_addr);
 			(void)sockaddr_dl_setaddr(sdl, sdl->sdl_len,
@@ -2695,11 +2694,12 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 			/* unicast address is first multicast entry */
 			wm_set_filter(sc);
 			error = 0;
+			WM_BOTH_UNLOCK(sc);
 			break;
 		}
+		WM_BOTH_UNLOCK(sc);
 		/*FALLTHROUGH*/
 	default:
-		WM_BOTH_UNLOCK(sc);
 #ifdef WM_MPSAFE
 		s = splnet();
 #endif
@@ -2708,17 +2708,13 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 #ifdef WM_MPSAFE
 		splx(s);
 #endif
-		WM_BOTH_LOCK(sc);
-
 		if (error != ENETRESET)
 			break;
 
 		error = 0;
 
 		if (cmd == SIOCSIFCAP) {
-			WM_BOTH_UNLOCK(sc);
 			error = (*ifp->if_init)(ifp);
-			WM_BOTH_LOCK(sc);
 		} else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
 			;
 		else if (ifp->if_flags & IFF_RUNNING) {
@@ -2726,13 +2722,13 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 			 * Multicast list has changed; set the hardware filter
 			 * accordingly.
 			 */
+			WM_BOTH_LOCK(sc);
 			wm_set_filter(sc);
+			WM_BOTH_UNLOCK(sc);
 		}
 		break;
 	}
 
-	WM_BOTH_UNLOCK(sc);
-
 	/* Try to get more packets going. */
 	ifp->if_start(ifp);
 



Re: CVS commit: src/lib/librumpuser

2014-10-07 Thread Marc Balmer

Am 29.09.2014 um 17:54 schrieb Justin Cormack :

> Module Name:  src
> Committed By: justin
> Date: Mon Sep 29 15:54:28 UTC 2014
> 
> Modified Files:
>   src/lib/librumpuser: rumpuser_port.h
> 
> Log Message:
> Minix also has getenv_r support
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.34 -r1.35 src/lib/librumpuser/rumpuser_port.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 
> Modified files:
> 
> Index: src/lib/librumpuser/rumpuser_port.h
> diff -u src/lib/librumpuser/rumpuser_port.h:1.34 
> src/lib/librumpuser/rumpuser_port.h:1.35
> --- src/lib/librumpuser/rumpuser_port.h:1.34  Tue Jul 22 22:41:58 2014
> +++ src/lib/librumpuser/rumpuser_port.h   Mon Sep 29 15:54:28 2014
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: rumpuser_port.h,v 1.34 2014/07/22 22:41:58 justin Exp $
> */
> +/*   $NetBSD: rumpuser_port.h,v 1.35 2014/09/29 15:54:28 justin Exp $
> */
> 
> /*
>  * Portability header for non-NetBSD platforms.
> @@ -112,8 +112,8 @@ clock_gettime(clockid_t clk, struct time
> #include 
> #include 
> 
> -/* NetBSD is the only(?) platform with getenv_r() */
> -#if !defined(__NetBSD__)
> +/* NetBSD is almost the only platform with getenv_r() */
> +#if !(defined(__NetBSD__) || defined(__minix__))

Minix defines __minix, not __minix__, though.

> #include 
> #include 
> #include 
> 


CVS commit: src/sys/arch/arm/imx

2014-10-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Oct  7 09:32:47 UTC 2014

Modified Files:
src/sys/arch/arm/imx: imx6var.h

Log Message:
forgot to commit about changes of ccm


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx6var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx6var.h
diff -u src/sys/arch/arm/imx/imx6var.h:1.1 src/sys/arch/arm/imx/imx6var.h:1.2
--- src/sys/arch/arm/imx/imx6var.h:1.1	Thu Sep 25 05:05:28 2014
+++ src/sys/arch/arm/imx/imx6var.h	Tue Oct  7 09:32:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6var.h,v 1.1 2014/09/25 05:05:28 ryo Exp $	*/
+/*	$NetBSD: imx6var.h,v 1.2 2014/10/07 09:32:47 ryo Exp $	*/
 
 /*
  * Copyright (c) 2014 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #ifndef _ARM_IMX_IMX6VAR_H
-#define	_ARM_IMX_IMX6VAR_H
+#define _ARM_IMX_IMX6VAR_H
 
 #include 
 
@@ -46,15 +46,10 @@ extern struct arm32_bus_dma_tag imx_bus_
 extern bus_space_tag_t imx6_armcore_bst;
 extern bus_space_handle_t imx6_armcore_bsh;
 
-/* gpio utility functions in imxgpio.c */
-void gpio_set_direction(uint32_t, uint32_t);
-void gpio_data_write(uint32_t, uint32_t);
-bool gpio_data_read(uint32_t);
-
 /* iomux utility functions in imx6_iomux.c */
 struct iomux_conf {
 	u_int pin;
-#define	IOMUX_CONF_EOT	((u_int)(-1))
+#define IOMUX_CONF_EOT	((u_int)(-1))
 	u_short mux;
 	u_short pad;
 };
@@ -69,8 +64,18 @@ void iomux_mux_config(const struct iomux
 /* imx6_board.c */
 void imx6_bootstrap(vaddr_t);
 psize_t imx6_memprobe(void);
+uint32_t imx6_armrootclk(void);
 void imx6_reset(void) __dead;
 void imx6_device_register(device_t, void *);
 void imx6_cpu_hatch(struct cpu_info *);
+uint32_t imx6_chip_id(void);
+#define CHIPID_MINOR_MASK		0x00ff
+#define CHIPID_MAJOR_MASK		0x0000
+#define CHIPID_MAJOR_IMX6SL		0x0060
+#define CHIPID_MAJOR_IMX6DL		0x0061
+#define CHIPID_MAJOR_IMX6SOLO		0x0062
+#define CHIPID_MAJOR_IMX6Q		0x0063
+#define IMX6_CHIPID_MAJOR(v)		((v) & CHIPID_MAJOR_MASK)
+#define IMX6_CHIPID_MINOR(v)		((v) & CHIPID_MINOR_MASK)
 
 #endif /* _ARM_IMX_IMX6VAR_H */



CVS commit: src/sys/arch/arm/imx

2014-10-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Oct  7 09:36:09 UTC 2014

Modified Files:
src/sys/arch/arm/imx: files.imx6 imx6_ccm.c imx6_ccmvar.h
Added Files:
src/sys/arch/arm/imx: imx6_i2c.c

Log Message:
add support imx6 I2C Controller


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/files.imx6
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx6_ccm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx6_ccmvar.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/imx6_i2c.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/files.imx6
diff -u src/sys/arch/arm/imx/files.imx6:1.3 src/sys/arch/arm/imx/files.imx6:1.4
--- src/sys/arch/arm/imx/files.imx6:1.3	Mon Oct  6 10:15:40 2014
+++ src/sys/arch/arm/imx/files.imx6	Tue Oct  7 09:36:09 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx6,v 1.3 2014/10/06 10:15:40 ryo Exp $
+#	$NetBSD: files.imx6,v 1.4 2014/10/07 09:36:09 ryo Exp $
 #
 # Configuration info for the Freescale i.MX6
 #
@@ -61,6 +61,12 @@ device	imxiomux
 attach	imxiomux at axi
 file	arch/arm/imx/imx6_iomux.c		imxiomux
 
+# iMX iic Controler
+device	imxi2c: i2cbus
+attach	imxi2c at axi
+file	arch/arm/imx/imxi2c.c			imxi2c
+file	arch/arm/imx/imx6_i2c.c			imxi2c
+
 # iMX UART
 device	imxuart
 attach	imxuart at axi

Index: src/sys/arch/arm/imx/imx6_ccm.c
diff -u src/sys/arch/arm/imx/imx6_ccm.c:1.2 src/sys/arch/arm/imx/imx6_ccm.c:1.3
--- src/sys/arch/arm/imx/imx6_ccm.c:1.2	Mon Oct  6 10:27:13 2014
+++ src/sys/arch/arm/imx/imx6_ccm.c	Tue Oct  7 09:36:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ccm.c,v 1.2 2014/10/06 10:27:13 ryo Exp $	*/
+/*	$NetBSD: imx6_ccm.c,v 1.3 2014/10/07 09:36:09 ryo Exp $	*/
 
 /*
  * Copyright (c) 2010-2012, 2014  Genetec Corporation.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.2 2014/10/06 10:27:13 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.3 2014/10/07 09:36:09 ryo Exp $");
 
 #include "opt_imx.h"
 #include "opt_imx6clk.h"
@@ -167,13 +167,13 @@ imxccm_attach(device_t parent, device_t 
 	imx6_get_clock(IMX6CLK_AXI));
 
 	aprint_verbose_dev(self, "IMX6CLK_USDHC1=%d\n",
-	imx6_get_clock(IMX6CLK_USDHC1_CLK_ROOT));
+	imx6_get_clock(IMX6CLK_USDHC1));
 	aprint_verbose_dev(self, "IMX6CLK_USDHC2=%d\n",
-	imx6_get_clock(IMX6CLK_USDHC2_CLK_ROOT));
+	imx6_get_clock(IMX6CLK_USDHC2));
 	aprint_verbose_dev(self, "IMX6CLK_USDHC3=%d\n",
-	imx6_get_clock(IMX6CLK_USDHC3_CLK_ROOT));
+	imx6_get_clock(IMX6CLK_USDHC3));
 	aprint_verbose_dev(self, "IMX6CLK_USDHC4=%d\n",
-	imx6_get_clock(IMX6CLK_USDHC4_CLK_ROOT));
+	imx6_get_clock(IMX6CLK_USDHC4));
 }
 
 static int
@@ -630,28 +630,28 @@ imx6_get_clock(enum imx6_clock clk)
 		}
 		break;
 
-	case IMX6CLK_USDHC1_CLK_ROOT:
+	case IMX6CLK_USDHC1:
 		v = imx6_ccm_read(CCM_CSCMR1);
 		freq = imx6_get_clock((v & CCM_CSCMR1_USDHC1_CLK_SEL) ?
 		IMX6CLK_PLL2_PFD0 : IMX6CLK_PLL2_PFD2);
 		v = imx6_ccm_read(CCM_CSCDR1);
 		freq = freq / (__SHIFTOUT(v, CCM_CSCDR1_USDHC1_PODF) + 1);
 		break;
-	case IMX6CLK_USDHC2_CLK_ROOT:
+	case IMX6CLK_USDHC2:
 		v = imx6_ccm_read(CCM_CSCMR1);
 		freq = imx6_get_clock((v & CCM_CSCMR1_USDHC2_CLK_SEL) ?
 		IMX6CLK_PLL2_PFD0 : IMX6CLK_PLL2_PFD2);
 		v = imx6_ccm_read(CCM_CSCDR1);
 		freq = freq / (__SHIFTOUT(v, CCM_CSCDR1_USDHC2_PODF) + 1);
 		break;
-	case IMX6CLK_USDHC3_CLK_ROOT:
+	case IMX6CLK_USDHC3:
 		v = imx6_ccm_read(CCM_CSCMR1);
 		freq = imx6_get_clock((v & CCM_CSCMR1_USDHC3_CLK_SEL) ?
 		IMX6CLK_PLL2_PFD0 : IMX6CLK_PLL2_PFD2);
 		v = imx6_ccm_read(CCM_CSCDR1);
 		freq = freq / (__SHIFTOUT(v, CCM_CSCDR1_USDHC3_PODF) + 1);
 		break;
-	case IMX6CLK_USDHC4_CLK_ROOT:
+	case IMX6CLK_USDHC4:
 		v = imx6_ccm_read(CCM_CSCMR1);
 		freq = imx6_get_clock((v & CCM_CSCMR1_USDHC4_CLK_SEL) ?
 		IMX6CLK_PLL2_PFD0 : IMX6CLK_PLL2_PFD2);
@@ -659,6 +659,12 @@ imx6_get_clock(enum imx6_clock clk)
 		freq = freq / (__SHIFTOUT(v, CCM_CSCDR1_USDHC4_PODF) + 1);
 		break;
 
+	case IMX6CLK_PERCLK:
+		freq = imx6_get_clock(IMX6CLK_IPG);
+		v = imx6_ccm_read(CCM_CSCMR1);
+		freq = freq / (__SHIFTOUT(v, CCM_CSCMR1_PERCLK_PODF) + 1);
+		break;
+
 	default:
 		aprint_error_dev(ccm_softc->sc_dev,
 		"clock %d: not supported yet\n", clk);

Index: src/sys/arch/arm/imx/imx6_ccmvar.h
diff -u src/sys/arch/arm/imx/imx6_ccmvar.h:1.1 src/sys/arch/arm/imx/imx6_ccmvar.h:1.2
--- src/sys/arch/arm/imx/imx6_ccmvar.h:1.1	Thu Sep 25 05:05:28 2014
+++ src/sys/arch/arm/imx/imx6_ccmvar.h	Tue Oct  7 09:36:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ccmvar.h,v 1.1 2014/09/25 05:05:28 ryo Exp $	*/
+/*	$NetBSD: imx6_ccmvar.h,v 1.2 2014/10/07 09:36:09 ryo Exp $	*/
 /*
  * Copyright (c) 2012  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -54,10 +54,12 @@ enum imx6_clock {
 	IMX6CLK_MMDC_CH0,
 	IMX6CLK_MMDC_CH1,
 
-	IMX6CLK_USDHC1_CLK_ROOT,
-	IMX6CLK

CVS commit: src/sys/fs/puffs

2014-10-07 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Tue Oct  7 11:37:07 UTC 2014

Modified Files:
src/sys/fs/puffs: puffs_vnops.c

Log Message:
As is evidenced by several of our 32-bit MIPS ports, it's wrong to
print vsize_t with PRIx64 -- instead use our own PRIxVSIZE macro.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/sys/fs/puffs/puffs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.192 src/sys/fs/puffs/puffs_vnops.c:1.193
--- src/sys/fs/puffs/puffs_vnops.c:1.192	Mon Oct  6 14:26:44 2014
+++ src/sys/fs/puffs/puffs_vnops.c	Tue Oct  7 11:37:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.192 2014/10/06 14:26:44 he Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.193 2014/10/07 11:37:06 he Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.192 2014/10/06 14:26:44 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.193 2014/10/07 11:37:06 he Exp $");
 
 #include 
 #include 
@@ -1160,8 +1160,8 @@ zerofill_lastpage(struct vnode *vp, voff
 	error = ubc_uiomove(&vp->v_uobj, &uio, len,
 			UVM_ADV_SEQUENTIAL, UBC_WRITE|UBC_UNMAP_FLAG(vp));
 	if (error) {
-		DPRINTF(("zero-fill 0x%lx@0x%" PRIx64 " failed: error = %d\n",
-			 len, off, error));
+		DPRINTF(("zero-fill 0x%lx@0x%" PRIxVSIZE 
+			 " failed: error = %d\n", len, off, error));
 	}
 
 	return;



CVS commit: src/lib/librumpuser

2014-10-07 Thread Justin Cormack
Module Name:src
Committed By:   justin
Date:   Tue Oct  7 12:48:02 UTC 2014

Modified Files:
src/lib/librumpuser: rumpuser_port.h

Log Message:
Canonical Minix check as pointed out by Marc


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/librumpuser/rumpuser_port.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumpuser/rumpuser_port.h
diff -u src/lib/librumpuser/rumpuser_port.h:1.35 src/lib/librumpuser/rumpuser_port.h:1.36
--- src/lib/librumpuser/rumpuser_port.h:1.35	Mon Sep 29 15:54:28 2014
+++ src/lib/librumpuser/rumpuser_port.h	Tue Oct  7 12:48:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser_port.h,v 1.35 2014/09/29 15:54:28 justin Exp $	*/
+/*	$NetBSD: rumpuser_port.h,v 1.36 2014/10/07 12:48:02 justin Exp $	*/
 
 /*
  * Portability header for non-NetBSD platforms.
@@ -113,7 +113,7 @@ clock_gettime(clockid_t clk, struct time
 #include 
 
 /* NetBSD is almost the only platform with getenv_r() */
-#if !(defined(__NetBSD__) || defined(__minix__))
+#if !(defined(__NetBSD__) || defined(__minix))
 #include 
 #include 
 #include 



CVS commit: src/sys/fs/puffs

2014-10-07 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Tue Oct  7 12:58:10 UTC 2014

Modified Files:
src/sys/fs/puffs: puffs_vnops.c

Log Message:
Do the previous correctly...


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/fs/puffs/puffs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.193 src/sys/fs/puffs/puffs_vnops.c:1.194
--- src/sys/fs/puffs/puffs_vnops.c:1.193	Tue Oct  7 11:37:06 2014
+++ src/sys/fs/puffs/puffs_vnops.c	Tue Oct  7 12:58:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.193 2014/10/07 11:37:06 he Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.194 2014/10/07 12:58:09 he Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.193 2014/10/07 11:37:06 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.194 2014/10/07 12:58:09 he Exp $");
 
 #include 
 #include 
@@ -1160,7 +1160,7 @@ zerofill_lastpage(struct vnode *vp, voff
 	error = ubc_uiomove(&vp->v_uobj, &uio, len,
 			UVM_ADV_SEQUENTIAL, UBC_WRITE|UBC_UNMAP_FLAG(vp));
 	if (error) {
-		DPRINTF(("zero-fill 0x%lx@0x%" PRIxVSIZE 
+		DPRINTF(("zero-fill 0x%" PRIxVSIZE "@0x%" PRIx64 
 			 " failed: error = %d\n", len, off, error));
 	}
 



CVS commit: src/sys/arch

2014-10-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct  7 15:34:06 UTC 2014

Modified Files:
src/sys/arch/amd64/amd64: db_disasm.c
src/sys/arch/i386/i386: db_disasm.c

Log Message:
No functional change.
- 0 -> NULL
- Don't use cast.
- Style fix.
- Fix typos in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amd64/amd64/db_disasm.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/i386/i386/db_disasm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/db_disasm.c
diff -u src/sys/arch/amd64/amd64/db_disasm.c:1.17 src/sys/arch/amd64/amd64/db_disasm.c:1.18
--- src/sys/arch/amd64/amd64/db_disasm.c:1.17	Fri Sep 12 12:30:20 2014
+++ src/sys/arch/amd64/amd64/db_disasm.c	Tue Oct  7 15:34:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.17 2014/09/12 12:30:20 msaitoh Exp $	*/
+/*	$NetBSD: db_disasm.c,v 1.18 2014/10/07 15:34:05 msaitoh Exp $	*/
 
 /* 
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.17 2014/09/12 12:30:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.18 2014/10/07 15:34:05 msaitoh Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -112,7 +112,7 @@ struct inst {
 	short	i_has_modrm;		/* has regmodrm byte */
 	short	i_size;			/* operand size */
 	int	i_mode;			/* addressing modes */
-	const char *i_extra;		/* pointer to extra opcode table */
+	const void *i_extra;		/* pointer to extra opcode table */
 };
 
 #define	op1(x)		(x)
@@ -123,7 +123,7 @@ struct finst {
 	const char *f_name;		/* name for memory instruction */
 	int	f_size;			/* size for memory instruction */
 	int	f_rrmode;		/* mode for rr instruction */
-	const char *f_rrname;		/* name for rr instruction
+	const void *f_rrname;		/* name for rr instruction
 	   (or pointer to table) */
 };
 
@@ -172,8 +172,8 @@ const char * const db_Grp9[] = {
 };
 
 const struct inst db_inst_0f0x[] = {
-/*00*/	{ "",	   true,  NONE,  op1(Ew), (const char *)db_Grp6 },
-/*01*/	{ "",	   true,  NONE,  op1(Ew), (const char *)db_Grp7 },
+/*00*/	{ "",	   true,  NONE,  op1(Ew), db_Grp6 },
+/*01*/	{ "",	   true,  NONE,  op1(Ew), db_Grp7 },
 /*02*/	{ "lar",   true,  LONG,  op2(E,R),0 },
 /*03*/	{ "lsl",   true,  LONG,  op2(E,R),0 },
 /*04*/	{ "",  false, NONE,  0,	  0 },
@@ -191,7 +191,7 @@ const struct inst db_inst_0f0x[] = {
 /*0f*/	{ "",  false, NONE,  0,	  0 },  /* 3DNow */
 };
 
-const struct inst	db_inst_0f2x[] = {
+const struct inst db_inst_0f2x[] = {
 /*20*/	{ "mov",   true,  LONG,  op2(CR,E),   0 }, /* use E for reg */
 /*21*/	{ "mov",   true,  LONG,  op2(DR,E),   0 }, /* since mod == 11 */
 /*22*/	{ "mov",   true,  LONG,  op2(E,CR),   0 },
@@ -211,7 +211,7 @@ const struct inst	db_inst_0f2x[] = {
 /*2f*/	{ "",  false, NONE,  0,	  0 },
 };
 
-const struct inst	db_inst_0f3x[] = {
+const struct inst db_inst_0f3x[] = {
 /*30*/	{ "wrmsr", false, NONE,  0,	  0 },
 /*31*/	{ "rdtsc", false, NONE,  0,	  0 },
 /*32*/	{ "rdmsr", false, NONE,  0,	  0 },
@@ -224,14 +224,14 @@ const struct inst	db_inst_0f3x[] = {
 /*38*/	{ "",	   false, NONE,  0,	  0 },
 /*39*/	{ "",	   false, NONE,  0,	  0 },
 /*3a*/	{ "",	   false, NONE,  0,	  0 },
-/*3v*/	{ "",	   false, NONE,  0,	  0 },
+/*3b*/	{ "",	   false, NONE,  0,	  0 },
 /*3c*/	{ "",	   false, NONE,  0,	  0 },
 /*3d*/	{ "",	   false, NONE,  0,	  0 },
 /*3e*/	{ "",	   false, NONE,  0,	  0 },
 /*3f*/	{ "",	   false, NONE,  0,	  0 },
 };
 
-const struct inst	db_inst_0f4x[] = {
+const struct inst db_inst_0f4x[] = {
 /*40*/	{ "cmovo",  true,  LONG,  op2(E,R),0 },
 /*41*/	{ "cmovno", true,  LONG,  op2(E,R),0 },
 /*42*/	{ "cmovc",  true,  LONG,  op2(E,R),0 },
@@ -250,7 +250,7 @@ const struct inst	db_inst_0f4x[] = {
 /*4f*/	{ "cmovnle",true,  LONG,  op2(E,R),0 },
 };
 
-const struct inst	db_inst_0f8x[] = {
+const struct inst db_inst_0f8x[] = {
 /*80*/	{ "jo",false, NONE,  op1(Dl), 0 },
 /*81*/	{ "jno",   false, NONE,  op1(Dl), 0 },
 /*82*/	{ "jb",false, NONE,  op1(Dl), 0 },
@@ -270,7 +270,7 @@ const struct inst	db_inst_0f8x[] = {
 /*8f*/	{ "jnle",  false, NONE,  op1(Dl), 0 },
 };
 
-const struct inst	db_inst_0f9x[] = {
+const struct inst db_inst_0f9x[] = {
 /*90*/	{ "seto",  true,  NONE,  op1(Eb), 0 },
 /*91*/	{ "setno", true,  NONE,  op1(Eb), 0 },
 /*92*/	{ "setb",  true,  NONE,  op1(Eb), 0 },
@@ -290,7 +290,7 @@ const struct inst	db_inst_0f9x[] = {
 /*9f*/	{ "setnle",true,  NONE,  op1(Eb), 0 },
 };
 
-const struct inst	db_inst_0fax[] = {
+const struct inst db_inst_0fax[] = {
 /*a0*/	{ "push",  false, NONE,  op1(Si), 0 },
 /*a1*/	{ "pop",   false, NONE,  op1(Si), 0 },
 /*a2*/	{ "cpuid", false, NONE,  0,	  0 },
@@ -310,9 +310,9 @@ const struct inst	db_inst_0fax[] = {
 /*af*/	{ "imul",  true,  LONG,  op2(E,R),0 },
 };
 
-const struct inst

CVS commit: src/tests/lib/libm

2014-10-07 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Oct  7 16:53:44 UTC 2014

Modified Files:
src/tests/lib/libm: t_exp.c

Log Message:
In the exp2_values test case, provide separate expected return values
for the float case, reflecting the actual exp2f() argument value after
rounding to float precision.  Fixes PR lib/49256.  Thanks to Makoto
Kamada and Tetsuya Isaki for the analysis.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libm/t_exp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/t_exp.c
diff -u src/tests/lib/libm/t_exp.c:1.7 src/tests/lib/libm/t_exp.c:1.8
--- src/tests/lib/libm/t_exp.c:1.7	Mon Mar 17 11:08:11 2014
+++ src/tests/lib/libm/t_exp.c	Tue Oct  7 16:53:44 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_exp.c,v 1.7 2014/03/17 11:08:11 martin Exp $ */
+/* $NetBSD: t_exp.c,v 1.8 2014/10/07 16:53:44 gson Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -141,42 +141,40 @@ ATF_LIBM_TEST(exp2_values, "Test exp2(x)
 {
 	static const struct {
 		double	x;
-		double	y;
+		double	d_y;
+		float   f_y;
 		double	d_eps;
 		double	f_eps;
 	} v[] = {
 #if __DBL_MAX_EXP__ > 128
 	/* The largest double constant */
-	{ 0x1.fp9,	0x1.ffd3ap1023,
+	{ 0x1.fp9,	0x1.ffd3ap1023,	0.00,
 		0x1p969,	0.0 },
 	/* The largest float constant */
-	{ 0x1.fep6,	0x1.4ep+127,	6e30,	0.0 },
+	{ 0x1.fep6,	0x1.4ep+127,	0x1.4ep+127,	6e30,	0.0 },
 #endif
 #ifdef T_LIBM_PLUS_INF
-	{ T_LIBM_PLUS_INF,	T_LIBM_PLUS_INF,	0.0,	0.0 },
+	{ T_LIBM_PLUS_INF,	T_LIBM_PLUS_INF,	T_LIBM_PLUS_INF,	0.0,	0.0 },
 #endif
 
 	/* The few values from the old tests */
 	/* Results from i386/amd64, d_eps needed on i386 */
-	{  1.1,	0x1.125fbee250664p+1,	0x1p-52,	0x1.8p-22 },
-	{  2.2,	0x1.2611186bae675p+2,	0x1p-51,	0x1.8p-21 },
-	{  3.3,	0x1.3b2c47bff8328p+3,	0x1p-50,	0x1.8p-20 },
-	{  4.4,	0x1.51cb453b9536ep+4,	0x1p-49,	0x1.8p-19 },
-	{  5.5,	0x1.6a09e667f3bcdp+5,	0x1p-48,	0x1.8p-18 },
-	{  6.6,	0x1.8406003b2ae5bp+6,	0x1p-47,	0x1.8p-17 },
-	/*
-	 * These two currently fail for 'float'.
-	 * 8.8 is definitely out by more than it should be.
-	 */
-	{  7.7,	0x1.9fdf8bcce533ep+7,	0x1p-46,	0x1.8p-16 },
-	{  8.8,	0x1.bdb8cdadbe124p+8,	0x1p-45,	0x1.8p-15 },
+	/* f_y values calculated using py-mpmath */
+	{  1.1,	0x1.125fbee250664p+1,	0x1.125fc0p+1,	0x1p-52,	0x1.8p-22 },
+	{  2.2,	0x1.2611186bae675p+2,	0x1.26111ap+2,	0x1p-51,	0x1.8p-21 },
+	{  3.3,	0x1.3b2c47bff8328p+3,	0x1.3b2c48p+3,	0x1p-50,	0x1.8p-20 },
+	{  4.4,	0x1.51cb453b9536ep+4,	0x1.51cb46p+4,	0x1p-49,	0x1.8p-19 },
+	{  5.5,	0x1.6a09e667f3bcdp+5,	0x1.6a09e6p+5,	0x1p-48,	0x1.8p-18 },
+	{  6.6,	0x1.8406003b2ae5bp+6,	0x1.8405fep+6,	0x1p-47,	0x1.8p-17 },
+	{  7.7,	0x1.9fdf8bcce533ep+7,	0x1.9fdf88p+7,	0x1p-46,	0x1.8p-16 },
+	{  8.8,	0x1.bdb8cdadbe124p+8,	0x1.bdb8d2p+8,	0x1p-45,	0x1.8p-15 },
 	};
 	unsigned int i;
 
 	for (i = 0; i < __arraycount(v); i++) {
-		T_LIBM_CHECK(i, exp2, v[i].x, v[i].y, v[i].d_eps);
+		T_LIBM_CHECK(i, exp2, v[i].x, v[i].d_y, v[i].d_eps);
 		if (i > 1)
-			T_LIBM_CHECK(i, exp2f, v[i].x, v[i].y, v[i].f_eps);
+			T_LIBM_CHECK(i, exp2f, v[i].x, v[i].f_y, v[i].f_eps);
 	}
 }
 



CVS commit: src/etc

2014-10-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Oct  7 19:09:45 UTC 2014

Modified Files:
src/etc: rc.subr

Log Message:
sleep for 0.05 seconds instead of 2 seconds when checking if the pids
are still alive for a much faster exit.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/etc/rc.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.95 src/etc/rc.subr:1.96
--- src/etc/rc.subr:1.95	Sun Sep 21 09:47:24 2014
+++ src/etc/rc.subr	Tue Oct  7 19:09:45 2014
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.95 2014/09/21 09:47:24 roy Exp $
+# $NetBSD: rc.subr,v 1.96 2014/10/07 19:09:45 roy Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -322,10 +322,13 @@ wait_for_pids()
 		if [ -z "$_nlist" ]; then
 			break
 		fi
-		_list=$_nlist
-		echo -n ${_prefix:-"Waiting for PIDS: "}$_list
-		_prefix=", "
-		sleep 2
+		if [ "$_list" != "$_nlist" ]; then
+			_list=$_nlist
+			echo -n ${_prefix:-"Waiting for PIDS: "}$_list
+			_prefix=", "
+		fi
+		# We want this to be a tight loop for a fast exit
+		sleep 0.05
 	done
 	if [ -n "$_prefix" ]; then
 		echo "."



CVS commit: src/tests/lib/libutil

2014-10-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Oct  7 19:20:29 UTC 2014

Modified Files:
src/tests/lib/libutil: t_parsedate.c

Log Message:
Add local parsecheck() function and use it for several tests.

Instead of just checking that parsedate(3) does not return an error,
also pass the result through localtime_r(3) or gmtime_r(3) and check the
year/month/day/hour/minute/second fields in the resulting struct tm.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libutil/t_parsedate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.7 src/tests/lib/libutil/t_parsedate.c:1.8
--- src/tests/lib/libutil/t_parsedate.c:1.7	Sat Jan 19 15:21:43 2013
+++ src/tests/lib/libutil/t_parsedate.c	Tue Oct  7 19:20:28 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.7 2013/01/19 15:21:43 apb Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.8 2014/10/07 19:20:28 apb Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.7 2013/01/19 15:21:43 apb Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.8 2014/10/07 19:20:28 apb Exp $");
 
 #include 
 #include 
@@ -37,6 +37,58 @@ __RCSID("$NetBSD: t_parsedate.c,v 1.7 20
 #include 
 #include 
 
+/*
+ * ANY is used as a placeholder for values that do not need to be
+ * checked.  The actual value is arbitrary.  We don't use -1
+ * because some tests might want to use -1 as a literal value.
+ */
+#define ANY -30215
+
+/* parsecheck --
+ * call parsedate(), then call time_to_tm() on the result,
+ * and check that year/month/day/hour/minute/second are as expected.
+ *
+ * time_to_tm should usually be localtime_r or gmtime_r.
+ *
+ * Don't check values specified as ANY.
+ */
+static void
+parsecheck(const char *datestr, const time_t *reftime, const int *zoff,
+	struct tm * time_to_tm(const time_t *, struct tm *),
+	int year, int month, int day, int hour, int minute, int second)
+{
+	time_t t;
+	struct tm tm;
+
+	ATF_CHECK_MSG((t = parsedate(datestr, reftime, zoff)) != -1,
+	"parsedate(\"%s\",,) returned -1\n", datestr);
+	ATF_CHECK(time_to_tm(&t, &tm) != NULL);
+	if (year != ANY)
+		ATF_CHECK_MSG(tm.tm_year + 1900 == year,
+		"parsedate(\"%s\",,) expected year %d got %d (+1900)\n",
+		datestr, year, (int)tm.tm_year);
+	if (month != ANY)
+		ATF_CHECK_MSG(tm.tm_mon + 1 == month,
+		"parsedate(\"%s\",,) expected month %d got %d (+1)\n",
+		datestr, month, (int)tm.tm_mon);
+	if (day != ANY)
+		ATF_CHECK_MSG(tm.tm_mday == day,
+		"parsedate(\"%s\",,) expected day %d got %d\n",
+		datestr, day, (int)tm.tm_mday);
+	if (hour != ANY)
+		ATF_CHECK_MSG(tm.tm_hour == hour,
+		"parsedate(\"%s\",,) expected hour %d got %d\n",
+		datestr, hour, (int)tm.tm_hour);
+	if (minute != ANY)
+		ATF_CHECK_MSG(tm.tm_min == minute,
+		"parsedate(\"%s\",,) expected minute %d got %d\n",
+		datestr, minute, (int)tm.tm_min);
+	if (second != ANY)
+		ATF_CHECK_MSG(tm.tm_sec == second,
+		"parsedate(\"%s\",,) expected second %d got %d\n",
+		datestr, second, (int)tm.tm_sec);
+}
+
 ATF_TC(dates);
 
 ATF_TC_HEAD(dates, tc)
@@ -48,15 +100,24 @@ ATF_TC_HEAD(dates, tc)
 ATF_TC_BODY(dates, tc)
 {
 
-	ATF_CHECK(parsedate("69-09-10", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("2006-11-17", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("10/1/2000", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("20 Jun 1994", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("23jun2001", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("1-sep-06", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("1/11", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("1500-01-02", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("-12-21", NULL, NULL) != -1);
+	parsecheck("69-09-10", NULL, NULL, localtime_r,
+		2069, 9, 10, 0, 0, 0);
+	parsecheck("2006-11-17", NULL, NULL, localtime_r,
+		2006, 11, 17, 0, 0, 0);
+	parsecheck("10/1/2000", NULL, NULL, localtime_r,
+		2000, 10, 1, 0, 0, 0);
+	parsecheck("20 Jun 1994", NULL, NULL, localtime_r,
+		1994, 6, 20, 0, 0, 0);
+	parsecheck("23jun2001", NULL, NULL, localtime_r,
+		2001, 6, 23, 0, 0, 0);
+	parsecheck("1-sep-06", NULL, NULL, localtime_r,
+		2006, 9, 1, 0, 0, 0);
+	parsecheck("1/11", NULL, NULL, localtime_r,
+		ANY, 1, 11, 0, 0, 0);
+	parsecheck("1500-01-02", NULL, NULL, localtime_r,
+		1500, 1, 2, 0, 0, 0);
+	parsecheck("-12-21", NULL, NULL, localtime_r,
+		, 12, 21, 0, 0, 0);
 }
 
 ATF_TC(times);
@@ -70,10 +131,14 @@ ATF_TC_HEAD(times, tc)
 ATF_TC_BODY(times, tc)
 {
 
-	ATF_CHECK(parsedate("10:01", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("10:12pm", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("12:11:01.12", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("12:21-0500", NULL, NULL) != -1);
+	parsecheck("10:01", NULL, NULL, localtime_r,
+		ANY, ANY, ANY, 10, 1, 0);
+	parsecheck("10:12pm", NULL, NU

CVS commit: src/tests/lib/libutil

2014-10-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Oct  7 19:26:31 UTC 2014

Modified Files:
src/tests/lib/libutil: t_parsedate.c

Log Message:
Add comments for some non-obvious cases.
Also add a test with year=70, which is documented to be treated as 1970.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libutil/t_parsedate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.8 src/tests/lib/libutil/t_parsedate.c:1.9
--- src/tests/lib/libutil/t_parsedate.c:1.8	Tue Oct  7 19:20:28 2014
+++ src/tests/lib/libutil/t_parsedate.c	Tue Oct  7 19:26:31 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.8 2014/10/07 19:20:28 apb Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.9 2014/10/07 19:26:31 apb Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.8 2014/10/07 19:20:28 apb Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.9 2014/10/07 19:26:31 apb Exp $");
 
 #include 
 #include 
@@ -101,11 +101,13 @@ ATF_TC_BODY(dates, tc)
 {
 
 	parsecheck("69-09-10", NULL, NULL, localtime_r,
-		2069, 9, 10, 0, 0, 0);
+		2069, 9, 10, 0, 0, 0); /* year < 70: add 2000 */
+	parsecheck("70-09-10", NULL, NULL, localtime_r,
+		1970, 9, 10, 0, 0, 0); /* 70 <= year < 100: add 1900 */
 	parsecheck("2006-11-17", NULL, NULL, localtime_r,
 		2006, 11, 17, 0, 0, 0);
 	parsecheck("10/1/2000", NULL, NULL, localtime_r,
-		2000, 10, 1, 0, 0, 0);
+		2000, 10, 1, 0, 0, 0); /* month/day/year */
 	parsecheck("20 Jun 1994", NULL, NULL, localtime_r,
 		1994, 6, 20, 0, 0, 0);
 	parsecheck("23jun2001", NULL, NULL, localtime_r,
@@ -113,7 +115,7 @@ ATF_TC_BODY(dates, tc)
 	parsecheck("1-sep-06", NULL, NULL, localtime_r,
 		2006, 9, 1, 0, 0, 0);
 	parsecheck("1/11", NULL, NULL, localtime_r,
-		ANY, 1, 11, 0, 0, 0);
+		ANY, 1, 11, 0, 0, 0); /* month/day */
 	parsecheck("1500-01-02", NULL, NULL, localtime_r,
 		1500, 1, 2, 0, 0, 0);
 	parsecheck("-12-21", NULL, NULL, localtime_r,



CVS commit: src/sys/dev/i2c

2014-10-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Oct  7 21:32:10 UTC 2014

Modified Files:
src/sys/dev/i2c: motoi2creg.h

Log Message:
fix some c&p bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/motoi2creg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/motoi2creg.h
diff -u src/sys/dev/i2c/motoi2creg.h:1.2 src/sys/dev/i2c/motoi2creg.h:1.3
--- src/sys/dev/i2c/motoi2creg.h:1.2	Tue Jan  4 02:50:08 2011
+++ src/sys/dev/i2c/motoi2creg.h	Tue Oct  7 21:32:10 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: motoi2creg.h,v 1.2 2011/01/04 02:50:08 nisimura Exp $ */
+/* $NetBSD: motoi2creg.h,v 1.3 2014/10/07 21:32:10 matt Exp $ */
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -79,10 +79,10 @@
 #define FDR_B(n)		(((n) & 0x1c) >> 2)
 
 #define	MOTOI2C_GROUP_A_VALUES	0x8765fca9U
-#define	MOTOI2C_A(a)		((MOTOI2C_GROUP_A_VALUE >> (4*(fdr_a))) & 0xf)
-#define	MOTOI2C_B(b)		(1 + (fdr_b))
+#define	MOTOI2C_A(a)		((MOTOI2C_GROUP_A_VALUE >> (4*(a))) & 0xf)
+#define	MOTOI2C_B(b)		(1 + (b))
 #define	MOTOI2C_DIV(name, fdr)	\
-	((name##_A(FDR_A(hdr)) + named##_C(FDR_B(fdr))) << name##_B(FDR_B(hdr)))
+	((name##_A(FDR_A(fdr)) + named##_C(FDR_B(fdr))) << name##_B(FDR_B(fdr)))
 
 #define	IMX31_A(fdr_a)		MOTOI2C_A(fdr_a)
 #define	IMX31_B(fdr_b)		MOTOI2C_B(fdr_b)



CVS commit: src/include

2014-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  7 21:50:36 UTC 2014

Modified Files:
src/include: time.h

Log Message:
sync function signatures with tzcode


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/include/time.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/time.h
diff -u src/include/time.h:1.43 src/include/time.h:1.44
--- src/include/time.h:1.43	Sun Apr 21 13:54:56 2013
+++ src/include/time.h	Tue Oct  7 17:50:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.h,v 1.43 2013/04/21 17:54:56 joerg Exp $	*/
+/*	$NetBSD: time.h,v 1.44 2014/10/07 21:50:36 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -198,22 +198,25 @@ struct tm *offtime(const time_t *, long)
 void tzsetwall(void) __RENAME(__tzsetwall50);
 
 struct tm *offtime_r(const time_t *, long, struct tm *) __RENAME(__offtime_r50);
-struct tm *localtime_rz(const timezone_t, const time_t * __restrict,
+struct tm *localtime_rz(timezone_t __restrict, const time_t * __restrict,
 struct tm * __restrict) __RENAME(__localtime_rz50);
-char *ctime_rz(const timezone_t, const time_t *, char *) __RENAME(__ctime_rz50);
-time_t mktime_z(const timezone_t, struct tm *) __RENAME(__mktime_z50);
-time_t timelocal_z(const timezone_t, struct tm *) __RENAME(__timelocal_z50);
-time_t time2posix_z(const timezone_t, time_t) __RENAME(__time2posix_z50);
-time_t posix2time_z(const timezone_t, time_t) __RENAME(__posix2time_z50);
+char *ctime_rz(timezone_t __restrict, const time_t *, char *)
+__RENAME(__ctime_rz50);
+time_t mktime_z(timezone_t __restrict, struct tm * __restrict)
+__RENAME(__mktime_z50);
+time_t timelocal_z(timezone_t __restrict, struct tm *)
+__RENAME(__timelocal_z50);
+time_t time2posix_z(timezone_t __restrict, time_t) __RENAME(__time2posix_z50);
+time_t posix2time_z(timezone_t __restrict, time_t) __RENAME(__posix2time_z50);
 timezone_t tzalloc(const char *) __RENAME(__tzalloc50);
-void tzfree(const timezone_t) __RENAME(__tzfree50);
-const char *tzgetname(const timezone_t, int) __RENAME(__tzgetname50);
+void tzfree(timezone_t __restrict) __RENAME(__tzfree50);
+const char *tzgetname(timezone_t __restrict, int) __RENAME(__tzgetname50);
 #endif
 
-size_t strftime_lz(const timezone_t, char * __restrict, size_t,
+size_t strftime_lz(timezone_t __restrict, char * __restrict, size_t,
 const char * __restrict, const struct tm * __restrict, locale_t)
 __attribute__((__format__(__strftime__, 4, 0)));
-size_t strftime_z(const timezone_t, char * __restrict, size_t,
+size_t strftime_z(timezone_t __restrict, char * __restrict, size_t,
 const char * __restrict, const struct tm * __restrict)
 __attribute__((__format__(__strftime__, 4, 0)));
 char *strptime_l(const char * __restrict, const char * __restrict,



CVS commit: src/doc

2014-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  7 21:52:41 UTC 2014

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention new tzcode.


To generate a diff of this commit:
cvs rdiff -u -r1.1155 -r1.1156 src/doc/3RDPARTY
cvs rdiff -u -r1.1989 -r1.1990 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1155 src/doc/3RDPARTY:1.1156
--- src/doc/3RDPARTY:1.1155	Mon Oct  6 14:30:24 2014
+++ src/doc/3RDPARTY	Tue Oct  7 17:52:41 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1155 2014/10/06 18:30:24 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1156 2014/10/07 21:52:41 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1312,7 +1312,7 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2014f / tzdata2014h
+Version:	tzcode2014h / tzdata2014h
 Current Vers:	tzcode2014h / tzdata2014h
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1989 src/doc/CHANGES:1.1990
--- src/doc/CHANGES:1.1989	Mon Oct  6 14:30:24 2014
+++ src/doc/CHANGES	Tue Oct  7 17:52:41 2014
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1989 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1990 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -58,3 +58,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 		[jnemeth 20140927]
 	zoneinfo: Import tzdata2014h. [apb 20141004]
 	dhcpcd(8): Import dhcpcd-6.5.0. [roy 20141006]
+	libc: Update to tzcode2014h. [christos 20141007]
+



CVS commit: src/usr.sbin/zic

2014-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  7 22:14:06 UTC 2014

Modified Files:
src/usr.sbin/zic: Makefile

Log Message:
set some variables we need


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/zic/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/zic/Makefile
diff -u src/usr.sbin/zic/Makefile:1.14 src/usr.sbin/zic/Makefile:1.15
--- src/usr.sbin/zic/Makefile:1.14	Wed Mar  6 13:21:41 2013
+++ src/usr.sbin/zic/Makefile	Tue Oct  7 18:14:05 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2013/03/06 18:21:41 christos Exp $
+#	$NetBSD: Makefile,v 1.15 2014/10/07 22:14:05 christos Exp $
 
 .include "Makefile.inc"
 .include 
@@ -9,7 +9,8 @@ COPTS.scheck.c	+= -Wno-format-nonliteral
 PROG=	zic
 SRCS=	zic.c scheck.c ialloc.c
 MAN=	zic.8
-CPPFLAGS+=-Dunix
+TZVERSION!= ${TOOL_SED} -ne 's/VERSION=[ 	]*//p' ${NETBSDSRCDIR}/lib/libc/time/Makefile
+CPPFLAGS+=-DPKGVERSION='"(tzcode) "' -DTZVERSION='"${TZVERSION}"'
 
 .PATH: ${NETBSDSRCDIR}/lib/libc/time
 



CVS commit: src/lib/libc/time

2014-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  7 22:14:46 UTC 2014

Modified Files:
src/lib/libc/time: zdump.c zic.c

Log Message:
remove version stuff


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/time/zdump.c
cvs rdiff -u -r1.51 -r1.52 src/lib/libc/time/zic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/zdump.c
diff -u src/lib/libc/time/zdump.c:1.36 src/lib/libc/time/zdump.c:1.37
--- src/lib/libc/time/zdump.c:1.36	Tue Oct  7 17:51:03 2014
+++ src/lib/libc/time/zdump.c	Tue Oct  7 18:14:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: zdump.c,v 1.36 2014/10/07 21:51:03 christos Exp $	*/
+/*	$NetBSD: zdump.c,v 1.37 2014/10/07 22:14:46 christos Exp $	*/
 /*
 ** This file is in the public domain, so clarified as of
 ** 2009-05-17 by Arthur David Olson.
@@ -6,10 +6,9 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: zdump.c,v 1.36 2014/10/07 21:51:03 christos Exp $");
+__RCSID("$NetBSD: zdump.c,v 1.37 2014/10/07 22:14:46 christos Exp $");
 #endif /* !defined lint */
 
-#include "version.h"
 /*
 ** This code has been made independent of the rest of the time
 ** conversion package to increase confidence in the verification it provides.

Index: src/lib/libc/time/zic.c
diff -u src/lib/libc/time/zic.c:1.51 src/lib/libc/time/zic.c:1.52
--- src/lib/libc/time/zic.c:1.51	Tue Oct  7 17:51:03 2014
+++ src/lib/libc/time/zic.c	Tue Oct  7 18:14:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: zic.c,v 1.51 2014/10/07 21:51:03 christos Exp $	*/
+/*	$NetBSD: zic.c,v 1.52 2014/10/07 22:14:46 christos Exp $	*/
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -10,10 +10,9 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: zic.c,v 1.51 2014/10/07 21:51:03 christos Exp $");
+__RCSID("$NetBSD: zic.c,v 1.52 2014/10/07 22:14:46 christos Exp $");
 #endif /* !defined lint */
 
-#include "version.h"
 #include "private.h"
 #include "locale.h"
 #include "tzfile.h"



CVS commit: src/usr.sbin/zdump

2014-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  7 22:20:02 UTC 2014

Modified Files:
src/usr.sbin/zdump: Makefile

Log Message:
add defines


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/zdump/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/zdump/Makefile
diff -u src/usr.sbin/zdump/Makefile:1.8 src/usr.sbin/zdump/Makefile:1.9
--- src/usr.sbin/zdump/Makefile:1.8	Sat Mar  2 16:39:14 2013
+++ src/usr.sbin/zdump/Makefile	Tue Oct  7 18:20:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2013/03/02 21:39:14 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2014/10/07 22:20:02 christos Exp $
 
 .include "${.PARSEDIR}/../zic/Makefile.inc"
 .include 
@@ -7,6 +7,9 @@ PROG=	zdump
 SRCS=	zdump.c ialloc.c
 MAN=	zdump.8
 
+TZVERSION!= ${TOOL_SED} -ne 's/VERSION=[ 	]*//p' ${NETBSDSRCDIR}/lib/libc/time/Makefile
+CPPFLAGS+=-DPKGVERSION='"(tzcode) "' -DTZVERSION='"${TZVERSION}"'
+
 COPTS.zdump.c += -Wno-format-nonliteral
 
 .PATH: ${NETBSDSRCDIR}/lib/libc/time



CVS commit: src/lib/libc/time

2014-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  7 22:20:17 UTC 2014

Modified Files:
src/lib/libc/time: Makefile.inc

Log Message:
Fix backslashes


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/time/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/Makefile.inc
diff -u src/lib/libc/time/Makefile.inc:1.19 src/lib/libc/time/Makefile.inc:1.20
--- src/lib/libc/time/Makefile.inc:1.19	Tue Oct  7 17:51:03 2014
+++ src/lib/libc/time/Makefile.inc	Tue Oct  7 18:20:17 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.19 2014/10/07 21:51:03 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.20 2014/10/07 22:20:17 christos Exp $
 
 .PATH: ${.CURDIR}/time
 
@@ -24,7 +24,7 @@ MLINKS+=ctime.3 ctime_r.3	\
 	offtime.3 timegm.3	\
 	offtime.3 timelocal.3	\
 	offtime.3 timeoff.3	\
-	strftime.3 strftime_z.3
+	strftime.3 strftime_z.3 \
 	time2posix.3 posix2time.3 \
 	time2posix.3 posix2time_z.3 \
 	time2posix.3 time2posix_z.3 \
@@ -32,6 +32,6 @@ MLINKS+=ctime.3 ctime_r.3	\
 	tzset.3 daylight.3	\
 	tzset.3 tzalloc.3	\
 	tzset.3 tzfree.3	\
-	tzset.3 tzsetwall.3	\
+	tzset.3 tzsetwall.3	
 
 COPTS.strftime.c = -Wno-format-nonliteral



CVS commit: src/lib/libc/time

2014-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  7 22:20:33 UTC 2014

Modified Files:
src/lib/libc/time: private.h

Log Message:
don't define functions we define in our own headers


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/time/private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/private.h
diff -u src/lib/libc/time/private.h:1.36 src/lib/libc/time/private.h:1.37
--- src/lib/libc/time/private.h:1.36	Tue Oct  7 17:51:03 2014
+++ src/lib/libc/time/private.h	Tue Oct  7 18:20:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: private.h,v 1.36 2014/10/07 21:51:03 christos Exp $	*/
+/*	$NetBSD: private.h,v 1.37 2014/10/07 22:20:33 christos Exp $	*/
 
 #ifndef PRIVATE_H
 #define PRIVATE_H
@@ -422,10 +422,9 @@ time_t posix2time(time_t);
 ** is not done here.  What we call 'struct state' NetBSD calls
 ** 'struct __state', but this is a private name so it doesn't matter.
 */
-#if NETBSD_INSPIRED
 #ifndef __NetBSD__
+#if NETBSD_INSPIRED
 typedef struct state *timezone_t;
-#endif
 struct tm *localtime_rz(timezone_t restrict, time_t const *restrict,
 			struct tm *restrict);
 time_t mktime_z(timezone_t restrict, struct tm *restrict);
@@ -440,6 +439,7 @@ time_t time2posix_z(timezone_t __restric
 #  endif
 # endif
 #endif
+#endif
 
 /*
 ** Private function declarations.



CVS commit: src/lib/libutil

2014-10-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Oct  7 22:27:14 UTC 2014

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
Some years don't need the "maybe add 1900 or 2000" adjustment
that was designed for handling two-digit abbreviated years.
For example, "1/2/70" still refers to the year 1970, as before,
but "70-01-02" now refers to the year 70.

* Add a new yyHaveFullYear member to struct dateinfo, to record whether
  or not the year needs to be adjusted.
* Code that parses years sets yyHaveFullYear=1 if they know that the
  year should not be adjusted (as is the case for ISO 8601 dates), or if
  they perform their own adjustment (as is the case for CVS timestamps).
* Move the year adjustment code into a new function, AdjustYear,
  instead of inline in Convert().
* Make Convert() assume the year doesn't need to be adjusted,
  and make Convert's callers first call AdjustYear() if appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libutil/parsedate.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.16 src/lib/libutil/parsedate.y:1.17
--- src/lib/libutil/parsedate.y:1.16	Wed Jun 12 01:46:07 2013
+++ src/lib/libutil/parsedate.y	Tue Oct  7 22:27:14 2014
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.16 2013/06/12 01:46:07 yamt Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.17 2014/10/07 22:27:14 apb Exp $");
 #endif
 
 #include 
@@ -69,22 +69,24 @@ typedef enum _MERIDIAN {
 
 
 struct dateinfo {
-	DSTMODE	yyDSTmode;
+	DSTMODE	yyDSTmode;	/* DST on/off/maybe */
 	time_t	yyDayOrdinal;
 	time_t	yyDayNumber;
 	int	yyHaveDate;
+	int	yyHaveFullYear;	/* if true, year is not abbreviated. */
+/* if false, need to call AdjustYear(). */
 	int	yyHaveDay;
 	int	yyHaveRel;
 	int	yyHaveTime;
 	int	yyHaveZone;
-	time_t	yyTimezone;
-	time_t	yyDay;
-	time_t	yyHour;
-	time_t	yyMinutes;
-	time_t	yyMonth;
-	time_t	yySeconds;
-	time_t	yyYear;
-	MERIDIAN	yyMeridian;
+	time_t	yyTimezone;	/* Timezone as minutes ahead/east of UTC */
+	time_t	yyDay;		/* Day of month [1-31] */
+	time_t	yyHour;		/* Hour of day [0-24] or [1-12] */
+	time_t	yyMinutes;	/* Minute of hour [0-59] */
+	time_t	yyMonth;	/* Month of year [1-12] */
+	time_t	yySeconds;	/* Second of minute [0-60] */
+	time_t	yyYear;		/* Year, see also yyHaveFullYear */
+	MERIDIAN yyMeridian;	/* Interpret yyHour as AM/PM/24 hour clock */
 	time_t	yyRelMonth;
 	time_t	yyRelSeconds;
 };
@@ -144,6 +146,7 @@ item	: time {
 cvsstamp: tUNUMBER '.' tUNUMBER '.' tUNUMBER '.' tUNUMBER '.' tUNUMBER '.' tUNUMBER {
 	param->yyYear = $1;
 	if (param->yyYear < 100) param->yyYear += 1900;
+	param->yyHaveFullYear = 1;
 	param->yyMonth = $3;
 	param->yyDay = $5;
 	param->yyHour = $7;
@@ -174,6 +177,7 @@ epochdate: AT_SIGN at_number {
 		param->yyMinutes = 0;
 		param->yySeconds = 0;
 	}
+	param->yyHaveFullYear = 1;
 	param->yyDSTmode = DSToff;
 	param->yyTimezone = 0;
 	}
@@ -272,6 +276,7 @@ date	: tUNUMBER '/' tUNUMBER {
 	| tUNUMBER tSNUMBER tSNUMBER {
 	/* ISO 8601 format.  -mm-dd.  */
 	param->yyYear = $1;
+	param->yyHaveFullYear = 1;
 	param->yyMonth = -$2;
 	param->yyDay = -$3;
 	}
@@ -581,15 +586,31 @@ yyerror(struct dateinfo *param, const ch
 }
 
 
-/* Year is either
-   * A negative number, which means to use its absolute value (why?)
-   * A number from 0 to 99, which means a year from 1900 to 1999, or
-   * The actual year (>=100).  */
+/* Adjust year from a value that might be abbreviated, to a full value.
+ * e.g. convert 70 to 1970.
+ * Input Year is either:
+ *  - A negative number, which means to use its absolute value (why?)
+ *  - A number from 0 to 99, which means a year from 1900 to 1999, or
+ *  - The actual year (>=100).
+ * Returns the full year. */
+static time_t
+AdjustYear(time_t Year)
+{
+/* XXX Y2K */
+if (Year < 0)
+	Year = -Year;
+if (Year < 70)
+	Year += 2000;
+else if (Year < 100)
+	Year += 1900;
+return Year;
+}
+
 static time_t
 Convert(
 time_t	Month,		/* month of year [1-12] */
 time_t	Day,		/* day of month [1-31] */
-time_t	Year,		/* year; see above comment */
+time_t	Year,		/* year, not abbreviated in any way */
 time_t	Hours,		/* Hour of day [0-24] */
 time_t	Minutes,	/* Minute of hour [0-59] */
 time_t	Seconds,	/* Second of minute [0-60] */
@@ -601,14 +622,6 @@ Convert(
 struct tm tm = {.tm_sec = 0};
 time_t result;
 
-/* XXX Y2K */
-if (Year < 0)
-	Year = -Year;
-if (Year < 70)
-	Year += 2000;
-else if (Year < 100)
-	Year += 1900;
-
 tm.tm_sec = Seconds;
 tm.tm_min = Minutes;
 tm.tm_hour = Hours + (Meridian == MERpm ? 12 : 0);
@@ -933,6 +946,7 @@ parsedate(const char *p, const time_t *n
 param.yyRelSeconds = 0;
 param.yyRelMonth = 0;
 param.yyHaveDate = 

CVS commit: src/tests/lib/libutil

2014-10-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Oct  7 22:33:52 UTC 2014

Modified Files:
src/tests/lib/libutil: t_parsedate.c

Log Message:
Adapt to a recent change in parsedate().
"9/10/69" still refers to 2069, and "9/10/70" still refers to 1970,
but "69-09-10" and "70-09-10" now refer to the years 69 and 70.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libutil/t_parsedate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.9 src/tests/lib/libutil/t_parsedate.c:1.10
--- src/tests/lib/libutil/t_parsedate.c:1.9	Tue Oct  7 19:26:31 2014
+++ src/tests/lib/libutil/t_parsedate.c	Tue Oct  7 22:33:52 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.9 2014/10/07 19:26:31 apb Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.10 2014/10/07 22:33:52 apb Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.9 2014/10/07 19:26:31 apb Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.10 2014/10/07 22:33:52 apb Exp $");
 
 #include 
 #include 
@@ -100,10 +100,14 @@ ATF_TC_HEAD(dates, tc)
 ATF_TC_BODY(dates, tc)
 {
 
-	parsecheck("69-09-10", NULL, NULL, localtime_r,
+	parsecheck("9/10/69", NULL, NULL, localtime_r,
 		2069, 9, 10, 0, 0, 0); /* year < 70: add 2000 */
-	parsecheck("70-09-10", NULL, NULL, localtime_r,
+	parsecheck("9/10/70", NULL, NULL, localtime_r,
 		1970, 9, 10, 0, 0, 0); /* 70 <= year < 100: add 1900 */
+	parsecheck("69-09-10", NULL, NULL, localtime_r,
+		69, 9, 10, 0, 0, 0); /* ISO8601 year remains unchanged */
+	parsecheck("70-09-10", NULL, NULL, localtime_r,
+		70, 9, 10, 0, 0, 0); /* ISO8601 year remains unchanged */
 	parsecheck("2006-11-17", NULL, NULL, localtime_r,
 		2006, 11, 17, 0, 0, 0);
 	parsecheck("10/1/2000", NULL, NULL, localtime_r,



CVS commit: src/lib/libutil

2014-10-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Oct  7 22:39:32 UTC 2014

Modified Files:
src/lib/libutil: parsedate.3

Log Message:
Document that years in ISO 8601 dates are taken literally.
"69-09-10" is in the year 69, not 2069.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libutil/parsedate.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/parsedate.3
diff -u src/lib/libutil/parsedate.3:1.12 src/lib/libutil/parsedate.3:1.13
--- src/lib/libutil/parsedate.3:1.12	Sat Jan 19 15:28:25 2013
+++ src/lib/libutil/parsedate.3	Tue Oct  7 22:39:32 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: parsedate.3,v 1.12 2013/01/19 15:28:25 apb Exp $
+.\" $NetBSD: parsedate.3,v 1.13 2014/10/07 22:39:32 apb Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 19, 2013
+.Dd October 7, 2014
 .Dt PARSEDATE 3
 .Os
 .Sh NAME
@@ -198,11 +198,14 @@ Timezone names:
 .Pp
 A variety of unambiguous dates are recognized:
 .Bl -tag -compact -width "20 Jun 1994"
-.It 69-09-10
+.It 9/10/69
 For years between 69-99 we assume 1900+ and for years between 0-68
 we assume 2000+.
 .It 2006-11-17
 An ISO-8601 date.
+.It 69-09-10
+The year in an ISO-8601 date is always taken literally,
+so this is the year 69, not 2069.
 .It 10/1/2000
 October 10, 2000; the common US format.
 .It 20 Jun 1994
@@ -210,7 +213,8 @@ October 10, 2000; the common US format.
 .It 1-sep-06
 Other common abbreviations.
 .It 1/11
-the year can be omitted
+The year can be omitted.
+This is the US month/day format.
 .El
 .Pp
 As well as times:



CVS commit: src/sys/dev/pci

2014-10-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct  8 01:45:14 UTC 2014

Modified Files:
src/sys/dev/pci: if_vioif.c

Log Message:
Don't turn promisc off in vioif_deferred_init if already configured as promisc


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_vioif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.8 src/sys/dev/pci/if_vioif.c:1.9
--- src/sys/dev/pci/if_vioif.c:1.8	Wed Aug 13 14:35:46 2014
+++ src/sys/dev/pci/if_vioif.c	Wed Oct  8 01:45:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.8 2014/08/13 14:35:46 pooka Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.9 2014/10/08 01:45:14 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.8 2014/08/13 14:35:46 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.9 2014/10/08 01:45:14 ozaki-r Exp $");
 
 #include 
 #include 
@@ -650,12 +650,13 @@ vioif_deferred_init(device_t self)
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
 	int r;
 
+	if (ifp->if_flags & IFF_PROMISC)
+		return
+
 	r =  vioif_set_promisc(sc, false);
 	if (r != 0)
 		aprint_error_dev(self, "resetting promisc mode failed, "
  "errror code %d\n", r);
-	else
-		ifp->if_flags &= ~IFF_PROMISC;
 }
 
 /*



CVS commit: src/sys/dev/pci

2014-10-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct  8 03:34:44 UTC 2014

Modified Files:
src/sys/dev/pci: if_vioif.c

Log Message:
Add missing semicolon


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_vioif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.9 src/sys/dev/pci/if_vioif.c:1.10
--- src/sys/dev/pci/if_vioif.c:1.9	Wed Oct  8 01:45:14 2014
+++ src/sys/dev/pci/if_vioif.c	Wed Oct  8 03:34:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.9 2014/10/08 01:45:14 ozaki-r Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.10 2014/10/08 03:34:44 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.9 2014/10/08 01:45:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.10 2014/10/08 03:34:44 ozaki-r Exp $");
 
 #include 
 #include 
@@ -651,7 +651,7 @@ vioif_deferred_init(device_t self)
 	int r;
 
 	if (ifp->if_flags & IFF_PROMISC)
-		return
+		return;
 
 	r =  vioif_set_promisc(sc, false);
 	if (r != 0)



CVS commit: src/lib/libc/time

2014-10-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct  8 05:44:03 UTC 2014

Modified Files:
src/lib/libc/time: Makefile.inc

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/time/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/Makefile.inc
diff -u src/lib/libc/time/Makefile.inc:1.20 src/lib/libc/time/Makefile.inc:1.21
--- src/lib/libc/time/Makefile.inc:1.20	Tue Oct  7 22:20:17 2014
+++ src/lib/libc/time/Makefile.inc	Wed Oct  8 05:44:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.20 2014/10/07 22:20:17 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.21 2014/10/08 05:44:03 msaitoh Exp $
 
 .PATH: ${.CURDIR}/time
 
@@ -28,7 +28,7 @@ MLINKS+=ctime.3 ctime_r.3	\
 	time2posix.3 posix2time.3 \
 	time2posix.3 posix2time_z.3 \
 	time2posix.3 time2posix_z.3 \
-	tszet.3 tzgetname.3	\
+	tzset.3 tzgetname.3	\
 	tzset.3 daylight.3	\
 	tzset.3 tzalloc.3	\
 	tzset.3 tzfree.3	\