CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 07:58:56 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: usb_subr.c

Log Message:
Oops.  Fix previous.


To generate a diff of this commit:
cvs rdiff -u -r1.198.2.11 -r1.198.2.12 src/sys/dev/usb/usb_subr.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/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.198.2.11 src/sys/dev/usb/usb_subr.c:1.198.2.12
--- src/sys/dev/usb/usb_subr.c:1.198.2.11	Tue Apr  7 07:16:47 2015
+++ src/sys/dev/usb/usb_subr.c	Tue Apr  7 07:58:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.198.2.11 2015/04/07 07:16:47 skrll Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.198.2.12 2015/04/07 07:58:56 skrll Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb_subr.c,v 1.198.2.11 2015/04/07 07:16:47 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb_subr.c,v 1.198.2.12 2015/04/07 07:58:56 skrll Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_compat_netbsd.h
@@ -1432,7 +1432,7 @@ usbd_fill_deviceinfo(struct usbd_device 
  * if SS, otherwise it means UPS_LOW_SPEED.
  */
 else if (dev-ud_speed == USB_SPEED_SUPER  
-(s  UPS_PORT_POWER_SS) 
+(s  UPS_PORT_POWER_SS))
 	err = USB_PORT_POWERED;
 else if (s  UPS_PORT_POWER)
 	err = USB_PORT_POWERED;



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 07:58:56 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: usb_subr.c

Log Message:
Oops.  Fix previous.


To generate a diff of this commit:
cvs rdiff -u -r1.198.2.11 -r1.198.2.12 src/sys/dev/usb/usb_subr.c

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



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

2015-04-07 Thread Ryota Ozaki
On Tue, Apr 7, 2015 at 5:13 PM, Nick Hudson sk...@netbsd.org wrote:
 On 04/07/15 04:19, Ryota Ozaki wrote:

 Module Name:src
 Committed By:   ozaki-r
 Date:   Tue Apr  7 03:19:25 UTC 2015

 Modified Files:
 src/sys/arch/arm/ep93xx: ep93xx_intr.c
 src/sys/arch/arm/ixp12x0: ixp12x0_intr.c

 Log Message:
 Add missing #include arm/cpu.h

 sys/lwp.h is preferred, I think

I see. It works for me too. I'll change so.

Just curious, why is sys/lwp.h better?
Because it is MI while arm/cpu.h is MD?

Thanks,
  ozaki-r


CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:23:11 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: uhub.c

Log Message:
Another DPRINTF.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.10 -r1.126.2.11 src/sys/dev/usb/uhub.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/usb/uhub.c
diff -u src/sys/dev/usb/uhub.c:1.126.2.10 src/sys/dev/usb/uhub.c:1.126.2.11
--- src/sys/dev/usb/uhub.c:1.126.2.10	Tue Apr  7 06:09:55 2015
+++ src/sys/dev/usb/uhub.c	Tue Apr  7 06:23:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhub.c,v 1.126.2.10 2015/04/07 06:09:55 skrll Exp $	*/
+/*	$NetBSD: uhub.c,v 1.126.2.11 2015/04/07 06:23:10 skrll Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $	*/
 
 /*
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uhub.c,v 1.126.2.10 2015/04/07 06:09:55 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: uhub.c,v 1.126.2.11 2015/04/07 06:23:10 skrll Exp $);
 
 #include sys/param.h
 
@@ -571,6 +571,9 @@ uhub_explore(struct usbd_device *dev)
 		}
 		status = UGETW(up-up_status.wPortStatus);
 		change = UGETW(up-up_status.wPortChange);
+		DPRINTF(hub %d port %d after reset: s/c=%x/%x,
+		device_unit(sc-sc_dev), port, status, change);
+
 		if (!(status  UPS_CURRENT_CONNECT_STATUS)) {
 			/* Nothing connected, just ignore it. */
 #ifdef DIAGNOSTIC



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:23:11 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: uhub.c

Log Message:
Another DPRINTF.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.10 -r1.126.2.11 src/sys/dev/usb/uhub.c

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



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 07:11:58 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhcivar.h

Log Message:
Some quirk flags.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.4.12.3 -r1.4.12.4 src/sys/dev/usb/xhcivar.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/usb/xhcivar.h
diff -u src/sys/dev/usb/xhcivar.h:1.4.12.3 src/sys/dev/usb/xhcivar.h:1.4.12.4
--- src/sys/dev/usb/xhcivar.h:1.4.12.3	Thu Mar 19 17:26:43 2015
+++ src/sys/dev/usb/xhcivar.h	Tue Apr  7 07:11:58 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhcivar.h,v 1.4.12.3 2015/03/19 17:26:43 skrll Exp $	*/
+/*	$NetBSD: xhcivar.h,v 1.4.12.4 2015/04/07 07:11:58 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -109,6 +109,10 @@ struct xhci_softc {
 
 	bool sc_ac64;
 	bool sc_dying;
+
+	int sc_quirks;
+#define XHCI_QUIRK_FORCE_INTR	__BIT(0) /* force interrupt reading */
+#define XHCI_QUIRK_INTEL	__BIT(1) /* Intel xhci chip */
 };
 
 int	xhci_init(struct xhci_softc *);



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 07:11:58 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhcivar.h

Log Message:
Some quirk flags.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.4.12.3 -r1.4.12.4 src/sys/dev/usb/xhcivar.h

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



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:52:03 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c

Log Message:
Comments.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.19 -r1.28.2.20 src/sys/dev/usb/xhci.c

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



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:52:03 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c

Log Message:
Comments.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.19 -r1.28.2.20 src/sys/dev/usb/xhci.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/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.28.2.19 src/sys/dev/usb/xhci.c:1.28.2.20
--- src/sys/dev/usb/xhci.c:1.28.2.19	Tue Apr  7 06:49:10 2015
+++ src/sys/dev/usb/xhci.c	Tue Apr  7 06:52:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.28.2.19 2015/04/07 06:49:10 skrll Exp $	*/
+/*	$NetBSD: xhci.c,v 1.28.2.20 2015/04/07 06:52:03 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.19 2015/04/07 06:49:10 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.20 2015/04/07 06:52:03 skrll Exp $);
 
 #include opt_usb.h
 
@@ -1123,6 +1123,12 @@ xhci_setup_sctx(struct usbd_device *dev,
 	cp[3] |= htole32(0);
 }
 
+/*
+ * called
+ *  from xhci_open
+ *  from usbd_setup_pipe_flags
+ *  from usbd_open_pipe_ival
+ */
 static usbd_status
 xhci_configure_endpoint(struct usbd_pipe *pipe)
 {
@@ -1309,6 +1315,7 @@ xhci_unconfigure_endpoint(struct usbd_pi
 }
 #endif
 
+/* 4.6.8, 6.4.3.7 */
 static usbd_status
 xhci_reset_endpoint(struct usbd_pipe *pipe)
 {
@@ -1334,6 +1341,11 @@ xhci_reset_endpoint(struct usbd_pipe *pi
 	return err;
 }
 
+/*
+ * 4.6.9, 6.4.3.8
+ * Stop execution of TDs on xfer ring.
+ * Should be called with sc_lock held.
+ */
 static usbd_status
 xhci_stop_endpoint(struct usbd_pipe *pipe)
 {
@@ -1359,6 +1371,12 @@ xhci_stop_endpoint(struct usbd_pipe *pip
 	return err;
 }
 
+/*
+ * Set TR Dequeue Pointer.
+ * xCHI 1.1  4.6.10  6.4.3.9
+ * Purge all of transfer requests in ring.
+ * EPSTATE of endpoint must be ERROR or STOPPED, or CONTEXT_STATE error.
+ */
 static usbd_status
 xhci_set_dequeue(struct usbd_pipe *pipe)
 {
@@ -1379,6 +1397,7 @@ xhci_set_dequeue(struct usbd_pipe *pipe)
 	xr-xr_ep = 0;
 	xr-xr_cs = 1;
 
+	/* set DCS */
 	trb.trb_0 = xhci_ring_trbp(xr, 0) | 1; /* XXX */
 	trb.trb_2 = 0;
 	trb.trb_3 = XHCI_TRB_3_SLOT_SET(xs-xs_idx) |
@@ -1390,6 +1409,11 @@ xhci_set_dequeue(struct usbd_pipe *pipe)
 	return err;
 }
 
+/*
+ * Open new pipe: called from usbd_setup_pipe_flags.
+ * Fills methods of pipe.
+ * If pipe is not for ep0, calls configure_endpoint.
+ */
 static usbd_status
 xhci_open(struct usbd_pipe *pipe)
 {
@@ -1449,6 +1473,11 @@ xhci_open(struct usbd_pipe *pipe)
 	return USBD_NORMAL_COMPLETION;
 }
 
+/*
+ * Closes pipe, called from usbd_kill_pipe via close methods.
+ * If the endpoint to be closed is ep0, disable_slot.
+ * Should be called with sc_lock held.
+ */
 static usbd_status
 xhci_close_pipe(struct usbd_pipe *pipe)
 {
@@ -1482,6 +1511,10 @@ xhci_close_pipe(struct usbd_pipe *pipe)
 		return xhci_disable_slot(sc, xs-xs_idx);
 	}
 
+	/*
+	 * This may fail in the case that xhci_close_pipe is called after
+	 * xhci_abort_xfer e.g. usbd_kill_pipe.
+	 */
 	(void)xhci_stop_endpoint(pipe);
 
 	/*
@@ -1511,6 +1544,11 @@ xhci_close_pipe(struct usbd_pipe *pipe)
 	return err;
 }
 
+/*
+ * Abort transfer.
+ * Called with sc_lock held.
+ * May be called from softintr context.
+ */
 static void
 xhci_abort_xfer(struct usbd_xfer *xfer, usbd_status status)
 {
@@ -1540,6 +1578,7 @@ xhci_abort_xfer(struct usbd_xfer *xfer, 
 }
 
 #if 1 /* XXX experimental */
+/* issue reset_ep and set_dequeue in thread context */
 static void
 xhci_clear_endpoint_stall_async_task(void *cookie)
 {
@@ -1574,6 +1613,7 @@ xhci_clear_endpoint_stall_async(struct u
 		return USBD_IOERROR;
 	}
 
+	/* XXX never use up_async_task for incompatible type of function */
 	usb_init_task(xfer-ux_pipe-up_async_task,
 	xhci_clear_endpoint_stall_async_task, xfer, USB_TASKQ_MPSAFE);
 	usb_add_task(xfer-ux_pipe-up_dev, xfer-ux_pipe-up_async_task,
@@ -1584,6 +1624,10 @@ xhci_clear_endpoint_stall_async(struct u
 }
 
 #endif /* XXX experimental */
+
+/*
+ * Notify roothub port status/change to uhub_intr.
+ */
 static void
 xhci_rhpsc(struct xhci_softc * const sc, u_int port)
 {
@@ -1604,6 +1648,12 @@ xhci_rhpsc(struct xhci_softc * const sc,
 	usb_transfer_complete(xfer);
 }
 
+/*
+ * Process events:
+ * + Transfer comeplete
+ * + Command complete
+ * + Roothub Port status/change
+ */
 static void
 xhci_handle_event(struct xhci_softc * const sc,
 const struct xhci_trb * const trb)
@@ -1849,6 +1899,16 @@ xhci_get_lock(struct usbd_bus *bus, kmut
 
 extern uint32_t usb_cookie_no;
 
+/*
+ * Called if uhub_explore find new device (via usbd_new_device).
+ * Allocate and construct dev structure of default endpoint (ep0).
+ *   Determine initial MaxPacketSize (mps) by speed.
+ *   Determine route string and roothub port for slot of dev.
+ * Allocate pipe of ep0.
+ * Enable and initialize slot and Set 

CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:09:56 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: uhub.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.9 -r1.126.2.10 src/sys/dev/usb/uhub.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/usb/uhub.c
diff -u src/sys/dev/usb/uhub.c:1.126.2.9 src/sys/dev/usb/uhub.c:1.126.2.10
--- src/sys/dev/usb/uhub.c:1.126.2.9	Mon Apr  6 15:18:13 2015
+++ src/sys/dev/usb/uhub.c	Tue Apr  7 06:09:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhub.c,v 1.126.2.9 2015/04/06 15:18:13 skrll Exp $	*/
+/*	$NetBSD: uhub.c,v 1.126.2.10 2015/04/07 06:09:55 skrll Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $	*/
 
 /*
@@ -36,19 +36,18 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uhub.c,v 1.126.2.9 2015/04/06 15:18:13 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: uhub.c,v 1.126.2.10 2015/04/07 06:09:55 skrll Exp $);
 
 #include sys/param.h
 
-#include sys/systm.h
+#include sys/bus.h
 #include sys/device.h
 #include sys/kernel.h
 #include sys/kmem.h
-#include sys/device.h
 #include sys/proc.h
 #include sys/sysctl.h
+#include sys/systm.h
 
-#include sys/bus.h
 
 #include dev/usb/usb.h
 #include dev/usb/usbdi.h



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:09:56 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: uhub.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.9 -r1.126.2.10 src/sys/dev/usb/uhub.c

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



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:49:10 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c

Log Message:
USB 3.0 snapshot from Takahiro HAYASHI


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.18 -r1.28.2.19 src/sys/dev/usb/xhci.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/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.28.2.18 src/sys/dev/usb/xhci.c:1.28.2.19
--- src/sys/dev/usb/xhci.c:1.28.2.18	Mon Apr  6 19:28:40 2015
+++ src/sys/dev/usb/xhci.c	Tue Apr  7 06:49:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.28.2.18 2015/04/06 19:28:40 skrll Exp $	*/
+/*	$NetBSD: xhci.c,v 1.28.2.19 2015/04/07 06:49:10 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.18 2015/04/06 19:28:40 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.19 2015/04/07 06:49:10 skrll Exp $);
 
 #include opt_usb.h
 
@@ -50,6 +50,7 @@ __KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.2
 #include dev/usb/usb.h
 #include dev/usb/usbdi.h
 #include dev/usb/usbdivar.h
+#include dev/usb/usbdi_util.h
 #include dev/usb/usbhist.h
 #include dev/usb/usb_mem.h
 #include dev/usb/usb_quirks.h
@@ -126,18 +127,22 @@ static int xhci_roothub_ctrl(struct usbd
 void *, int);
 
 static usbd_status xhci_configure_endpoint(struct usbd_pipe *);
-static usbd_status xhci_unconfigure_endpoint(struct usbd_pipe *);
+//static usbd_status xhci_unconfigure_endpoint(struct usbd_pipe *);
 static usbd_status xhci_reset_endpoint(struct usbd_pipe *);
-//static usbd_status xhci_stop_endpoint(struct usbd_pipe *);
+static usbd_status xhci_stop_endpoint(struct usbd_pipe *);
 
 static usbd_status xhci_set_dequeue(struct usbd_pipe *);
 
 static usbd_status xhci_do_command(struct xhci_softc * const,
 struct xhci_trb * const, int);
-static usbd_status xhci_init_slot(struct xhci_softc * const, uint32_t,
-int, int, int, int);
+static usbd_status xhci_do_command1(struct xhci_softc * const,
+struct xhci_trb * const, int, int);
+static usbd_status xhci_do_command_locked(struct xhci_softc * const,
+struct xhci_trb * const, int);
+static usbd_status xhci_init_slot(struct usbd_device *, uint32_t, int, int);
 static usbd_status xhci_enable_slot(struct xhci_softc * const,
 uint8_t * const);
+static usbd_status xhci_disable_slot(struct xhci_softc * const, uint8_t);
 static usbd_status xhci_address_device(struct xhci_softc * const,
 uint64_t, uint8_t, bool);
 static usbd_status xhci_update_ep0_mps(struct xhci_softc * const,
@@ -228,11 +233,24 @@ static const struct usbd_pipe_methods xh
 };
 
 static inline uint32_t
+xhci_read_1(const struct xhci_softc * const sc, bus_size_t offset)
+{
+	return bus_space_read_1(sc-sc_iot, sc-sc_ioh, offset);
+}
+
+static inline uint32_t
 xhci_read_4(const struct xhci_softc * const sc, bus_size_t offset)
 {
 	return bus_space_read_4(sc-sc_iot, sc-sc_ioh, offset);
 }
 
+static inline void
+xhci_write_1(const struct xhci_softc * const sc, bus_size_t offset,
+uint32_t value)
+{
+	bus_space_write_1(sc-sc_iot, sc-sc_ioh, offset, value);
+}
+
 #if 0 /* unused */
 static inline void
 xhci_write_4(const struct xhci_softc * const sc, bus_size_t offset,
@@ -374,7 +392,7 @@ xhci_db_write_4(const struct xhci_softc 
 static inline uint8_t
 xhci_ep_get_type(usb_endpoint_descriptor_t * const ed)
 {
-	u_int eptype;
+	u_int eptype = 0;
 
 	switch (UE_GET_XFERTYPE(ed-bmAttributes)) {
 	case UE_CONTROL:
@@ -517,6 +535,7 @@ xhci_detach(struct xhci_softc *sc, int f
 
 	mutex_destroy(sc-sc_lock);
 	mutex_destroy(sc-sc_intr_lock);
+	cv_destroy(sc-sc_softwake_cv);
 
 	pool_cache_destroy(sc-sc_xferpool);
 
@@ -658,6 +677,28 @@ xhci_init(struct xhci_softc *sc)
 			}
 			break;
 		}
+		case XHCI_ID_USB_LEGACY: {
+			uint8_t bios_sem;
+
+			/* Take host controller from BIOS */
+			bios_sem = xhci_read_1(sc, ecp + XHCI_XECP_BIOS_SEM);
+			if (bios_sem) {
+/* sets xHCI to be owned by OS */
+xhci_write_1(sc, ecp + XHCI_XECP_OS_SEM, 1);
+aprint_debug(
+waiting for BIOS to give up control\n);
+for (i = 0; i  5000; i++) {
+	bios_sem = xhci_read_1(sc, ecp +
+	XHCI_XECP_BIOS_SEM);
+	if (bios_sem == 0)
+		break;
+	DELAY(1000);
+}
+if (bios_sem)
+	printf(timed out waiting for BIOS\n);
+			}
+			break;
+		}
 		default:
 			break;
 		}
@@ -732,6 +773,7 @@ xhci_init(struct xhci_softc *sc)
 	aprint_debug_dev(sc-sc_dev, sc_pgsz 0x%08x\n, (uint32_t)sc-sc_pgsz);
 	aprint_debug_dev(sc-sc_dev, sc_maxslots 0x%08x\n,
 	(uint32_t)sc-sc_maxslots);
+	aprint_debug_dev(sc-sc_dev, sc_maxports %d\n, sc-sc_maxports);
 
 	usbd_status err;
 
@@ -825,6 +867,16 @@ xhci_init(struct xhci_softc *sc)
 	KM_SLEEP);
 
 	cv_init(sc-sc_command_cv, xhcicmd);
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);

CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 06:49:10 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c

Log Message:
USB 3.0 snapshot from Takahiro HAYASHI


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.18 -r1.28.2.19 src/sys/dev/usb/xhci.c

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



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 07:16:47 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: usb_subr.c

Log Message:
Deal with super speed port powered reporting.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.198.2.10 -r1.198.2.11 src/sys/dev/usb/usb_subr.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/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.198.2.10 src/sys/dev/usb/usb_subr.c:1.198.2.11
--- src/sys/dev/usb/usb_subr.c:1.198.2.10	Mon Apr  6 15:18:13 2015
+++ src/sys/dev/usb/usb_subr.c	Tue Apr  7 07:16:47 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.198.2.10 2015/04/06 15:18:13 skrll Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.198.2.11 2015/04/07 07:16:47 skrll Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb_subr.c,v 1.198.2.10 2015/04/06 15:18:13 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb_subr.c,v 1.198.2.11 2015/04/07 07:16:47 skrll Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_compat_netbsd.h
@@ -1427,6 +1427,13 @@ usbd_fill_deviceinfo(struct usbd_device 
 	err = USB_PORT_ENABLED;
 else if (s  UPS_SUSPEND)
 	err = USB_PORT_SUSPENDED;
+/*
+ * UPS_PORT_POWER_SS is available only
+ * if SS, otherwise it means UPS_LOW_SPEED.
+ */
+else if (dev-ud_speed == USB_SPEED_SUPER  
+(s  UPS_PORT_POWER_SS) 
+	err = USB_PORT_POWERED;
 else if (s  UPS_PORT_POWER)
 	err = USB_PORT_POWERED;
 else



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  7 07:16:47 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: usb_subr.c

Log Message:
Deal with super speed port powered reporting.  From Takahiro HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.198.2.10 -r1.198.2.11 src/sys/dev/usb/usb_subr.c

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



CVS commit: src/usr.bin/man

2015-04-07 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Apr  7 10:17:21 UTC 2015

Modified Files:
src/usr.bin/man: man.conf.5

Log Message:
change _whatdb = _mandb as that is the correct keyword here,
and move it to the correct position in the list.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/man/man.conf.5

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



CVS commit: src/usr.bin/man

2015-04-07 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Apr  7 10:17:21 UTC 2015

Modified Files:
src/usr.bin/man: man.conf.5

Log Message:
change _whatdb = _mandb as that is the correct keyword here,
and move it to the correct position in the list.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/man/man.conf.5

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

Modified files:

Index: src/usr.bin/man/man.conf.5
diff -u src/usr.bin/man/man.conf.5:1.25 src/usr.bin/man/man.conf.5:1.26
--- src/usr.bin/man/man.conf.5:1.25	Tue Mar  3 17:59:32 2015
+++ src/usr.bin/man/man.conf.5	Tue Apr  7 10:17:21 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: man.conf.5,v 1.25 2015/03/03 17:59:32 christos Exp $
+.\	$NetBSD: man.conf.5,v 1.26 2015/04/07 10:17:21 plunky Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -116,6 +116,20 @@ in the shell command line, and it will
 be replaced by the name of the output file.
 .It _default
 Contains the system-wide default man path used to search for man pages.
+.It _mandb
+Defines the full pathname (not just a directory path) for a database to
+be used
+by the
+.Xr apropos 1
+and
+.Xr whatis 1
+commands.
+The pathname may contain the normal shell globbing characters,
+including curly braces
+.Pq Dq {} ;
+to escape a shell globbing character,
+precede it with a backslash
+.Pq Dq \e .
 .It _subdir
 Contains the list (in search order) of section subdirectories which will
 be searched in any man path directory named with a trailing slash
@@ -142,20 +156,6 @@ including curly braces
 .Pq Dq {} ) .
 .It _version
 Contains the version of the configuration file.
-.It _whatdb
-Defines the full pathname (not just a directory path) for a database to
-be used
-by the
-.Xr apropos 1
-and
-.Xr whatis 1
-commands.
-The pathname may contain the normal shell globbing characters,
-including curly braces
-.Pq Dq {} ;
-to escape a shell globbing character,
-precede it with a backslash
-.Pq Dq \e .
 .It _ Ns Aq machine
 Defines additional paths to be searched for the particular
 .Dv machine



Re: CVS commit: src/sys/dev/pci

2015-04-07 Thread Masanobu SAITOH

Hi, Martin.

On 2015/04/06 16:38, Martin Husemann wrote:

Module Name:src
Committed By:   martin
Date:   Mon Apr  6 07:38:17 UTC 2015

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

Log Message:
Make sure to halt (not just stop) the bge_tick callout during detach.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/dev/pci/if_bge.c

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


What does this change fix? To prevent panic on shutdown?

Almost all drviers have the same code. Should we fix all of them
like this?

--
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


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

2015-04-07 Thread Matt Thomas

 On Apr 7, 2015, at 1:27 AM, Ryota Ozaki ozak...@netbsd.org wrote:
 
 On Tue, Apr 7, 2015 at 5:13 PM, Nick Hudson sk...@netbsd.org wrote:
 On 04/07/15 04:19, Ryota Ozaki wrote:
 
 Module Name:src
 Committed By:   ozaki-r
 Date:   Tue Apr  7 03:19:25 UTC 2015
 
 Modified Files:
   src/sys/arch/arm/ep93xx: ep93xx_intr.c
   src/sys/arch/arm/ixp12x0: ixp12x0_intr.c
 
 Log Message:
 Add missing #include arm/cpu.h
 
 sys/lwp.h is preferred, I think
 
 I see. It works for me too. I'll change so.
 
 Just curious, why is sys/lwp.h better?
 Because it is MI while arm/cpu.h is MD?

arm/cpu.h has a dependency on sys/lwp.h


CVS commit: src/usr.sbin/makemandb

2015-04-07 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Apr  7 17:47:10 UTC 2015

Modified Files:
src/usr.sbin/makemandb: makemandb.c

Log Message:
largely apply patch from PR bin/47392 by Abhinav Upadhyay

change some comments to reflect reality, a variable name to enhance
readability, and adds an assert for safety.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/makemandb/makemandb.c

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



CVS commit: src/external/zlib/pigz/bin/pigz

2015-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  7 17:48:13 UTC 2015

Modified Files:
src/external/zlib/pigz/bin/pigz: Makefile

Log Message:
From: Joachim Henke

In -current, build.sh fails due to missing zless/zless.1. The attached
patch brings external/zlib/pigz/bin/pigz/Makefile in sync with
usr.bin/gzip/Makefile, which fixes the build.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/zlib/pigz/bin/pigz/Makefile

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



CVS commit: src/doc

2015-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  7 17:41:42 UTC 2015

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new ntp


To generate a diff of this commit:
cvs rdiff -u -r1.1217 -r1.1218 src/doc/3RDPARTY
cvs rdiff -u -r1.2065 -r1.2066 src/doc/CHANGES

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



CVS commit: src/external/bsd/ntp

2015-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  7 17:34:21 UTC 2015

Modified Files:
src/external/bsd/ntp: importdate ntp2netbsd
src/external/bsd/ntp/dist/include: audio.h binio.h icom.h mbg_gps166.h
ntp.h ntp_calendar.h ntp_config.h ntp_filegen.h ntp_fp.h ntp_md5.h
ntp_stdlib.h ntpd.h parse.h parse_conf.h timepps-Solaris.h
src/external/bsd/ntp/dist/kernel/sys: parsestreams.h
src/external/bsd/ntp/dist/lib/isc: backtrace.c event.c inet_ntop.c
log.c netaddr.c result.c sockaddr.c
src/external/bsd/ntp/dist/lib/isc/include/isc: backtrace.h socket.h
src/external/bsd/ntp/dist/lib/isc/unix: file.c ifiter_getifaddrs.c
ifiter_ioctl.c net.c
src/external/bsd/ntp/dist/libjsmn: jsmn.c
src/external/bsd/ntp/dist/libntp: atoint.c atolfp.c atouint.c audio.c
authkeys.c authreadkeys.c emalloc.c hextoint.c hextolfp.c
humandate.c icom.c modetoa.c mstolfp.c ntp_calendar.c
ntp_crypto_rnd.c ntp_intres.c ntp_lineedit.c octtoint.c
prettydate.c ssl_init.c timetoa.c work_fork.c
src/external/bsd/ntp/dist/libparse: clk_computime.c clk_dcf7000.c
clk_hopf6021.c clk_meinberg.c clk_rawdcf.c clk_rcc8000.c
clk_schmid.c clk_sel240x.c clk_trimtaip.c clk_trimtsip.c
clk_varitext.c clk_wharton.c data_mbg.c gpstolfp.c info_trimble.c
parse.c parse_conf.c parsesolaris.c parsestreams.c trim_info.c
src/external/bsd/ntp/dist/ntpd: cmd_args.c keyword-gen.c ntp_config.c
ntp_control.c ntp_crypto.c ntp_filegen.c ntp_io.c ntp_keyword.h
ntp_leapsec.c ntp_loopfilter.c ntp_parser.y ntp_peer.c ntp_proto.c
ntp_request.c ntp_restrict.c ntp_scanner.c ntp_util.c ntpd-opts.c
ntpd-opts.h ntpd.c refclock_acts.c refclock_arc.c refclock_chu.c
refclock_gpsdjson.c refclock_heath.c refclock_irig.c refclock_jjy.c
refclock_jupiter.c refclock_neoclock4x.c refclock_nmea.c
refclock_oncore.c refclock_palisade.c refclock_palisade.h
refclock_parse.c refclock_pcf.c refclock_shm.c refclock_true.c
refclock_wwv.c
src/external/bsd/ntp/dist/ntpdate: ntpdate.c
src/external/bsd/ntp/dist/ntpdc: ntpdc-opts.c ntpdc-opts.h ntpdc.c
ntpdc.h ntpdc_ops.c
src/external/bsd/ntp/dist/ntpq: ntpq-opts.c ntpq-opts.h ntpq-subs.c
ntpq.c ntpq.h
src/external/bsd/ntp/dist/ntpsnmpd: netsnmp_daemonize.c ntp_snmp.h
ntpsnmpd-opts.c ntpsnmpd-opts.h
src/external/bsd/ntp/dist/parseutil: dcfd.c testdcf.c
src/external/bsd/ntp/dist/sntp: crypto.c main.c networking.c
sntp-opts.c sntp-opts.h
src/external/bsd/ntp/dist/sntp/libevent: buffer.c bufferevent.c
bufferevent_async.c bufferevent_filter.c bufferevent_openssl.c
bufferevent_pair.c evbuffer-internal.h evdns.c event.c
event_tagging.c evrpc-internal.h evthread-internal.h evthread.c
evutil.c evutil_time.c ht-internal.h http-internal.h http.c
kqueue.c listener.c time-internal.h util-internal.h
src/external/bsd/ntp/dist/sntp/libevent/WIN32-Code: tree.h
src/external/bsd/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2:
event-config.h
src/external/bsd/ntp/dist/sntp/libevent/include/event2: buffer.h
bufferevent.h dns.h event.h http.h listener.h util.h
src/external/bsd/ntp/dist/sntp/libevent/sample: http-server.c
https-client.c
src/external/bsd/ntp/dist/sntp/libevent/test: regress.c regress.h
regress_buffer.c regress_bufferevent.c regress_dns.c
regress_finalize.c regress_http.c regress_main.c regress_minheap.c
regress_ssl.c regress_thread.c regress_util.c regress_zlib.c
test-fdleak.c test-ratelim.c test-time.c tinytest.c tinytest.h
tinytest_macros.h
src/external/bsd/ntp/dist/sntp/libopts: autoopts.h configfile.c enum.c
file.c find.c init.c load.c makeshell.c nested.c numeric.c
parse-duration.c pgusage.c reset.c save.c tokenize.c usage.c
src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h
src/external/bsd/ntp/dist/util: jitter.c ntp-keygen-opts.c
ntp-keygen-opts.h ntp-keygen.c ntptime.c
src/external/bsd/ntp/include: config.h
src/external/bsd/ntp/scripts: mkver
Removed Files:
src/external/bsd/ntp/dist/sntp/libevent: README
src/external/bsd/ntp/dist/sntp/libevent/m4: openldap-thread-check.m4
openldap.m4
src/external/bsd/ntp/dist/util: jitter.h

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/importdate \
src/external/bsd/ntp/ntp2netbsd
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/include/audio.h \
src/external/bsd/ntp/dist/include/icom.h
cvs 

CVS commit: src/doc

2015-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  7 17:41:42 UTC 2015

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new ntp


To generate a diff of this commit:
cvs rdiff -u -r1.1217 -r1.1218 src/doc/3RDPARTY
cvs rdiff -u -r1.2065 -r1.2066 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.1217 src/doc/3RDPARTY:1.1218
--- src/doc/3RDPARTY:1.1217	Fri Apr  3 20:03:12 2015
+++ src/doc/3RDPARTY	Tue Apr  7 13:41:42 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1217 2015/04/04 00:03:12 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1218 2015/04/07 17:41:42 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -922,8 +922,8 @@ and ndbootd-raw.c.  Restore saved config
 HAVE_STRICT_ALIGNMENT.  Fix RCS IDs, import.
 
 Package:	ntp
-Version:	4.2.8
-Current Vers:	4.2.8
+Version:	4.2.8p2
+Current Vers:	4.2.8p2
 Maintainer:	David L. Mills mi...@udel.edu
 Archive Site:	http://www.ntp.org/
 Home Page:	http://www.ntp.org/, http://support.ntp.org/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2065 src/doc/CHANGES:1.2066
--- src/doc/CHANGES:1.2065	Mon Apr  6 13:59:10 2015
+++ src/doc/CHANGES	Tue Apr  7 13:41:42 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2065 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2066 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -150,3 +150,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	wpa: Import wpa_supplicant and hostapd 2.4. [christos 20150401]
 	OpenSSH: Imported 6.8. [christos 20150403]
 	btmagic(4): add Magic Trackpad support [bouyer 20150406]
+	ntp: Import ntp 4.2.8p2. [christos 20150407]



CVS commit: src/usr.sbin/makemandb

2015-04-07 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Apr  7 17:47:10 UTC 2015

Modified Files:
src/usr.sbin/makemandb: makemandb.c

Log Message:
largely apply patch from PR bin/47392 by Abhinav Upadhyay

change some comments to reflect reality, a variable name to enhance
readability, and adds an assert for safety.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/makemandb/makemandb.c

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/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.28 src/usr.sbin/makemandb/makemandb.c:1.29
--- src/usr.sbin/makemandb/makemandb.c:1.28	Thu Mar 12 14:57:18 2015
+++ src/usr.sbin/makemandb/makemandb.c	Tue Apr  7 17:47:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.28 2015/03/12 14:57:18 joerg Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.29 2015/04/07 17:47:10 plunky Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
  * Copyright (c) 2011 Kristaps Dzonsons krist...@bsd.lv
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: makemandb.c,v 1.28 2015/03/12 14:57:18 joerg Exp $);
+__RCSID($NetBSD: makemandb.c,v 1.29 2015/04/07 17:47:10 plunky Exp $);
 
 #include sys/stat.h
 #include sys/types.h
@@ -75,7 +75,7 @@ typedef struct mandb_rec {
 	secbuff errors; // ERRORS
 	char section[2];
 
-	int xr_found;
+	int xr_found; // To track whether a .Xr was seen when parsing a section
 
 	/* Fields for mandb_meta table */
 	char *md5_hash;
@@ -973,12 +973,8 @@ pmdoc_Nm(const struct mdoc_node *n, mand
 static void
 pmdoc_Nd(const struct mdoc_node *n, mandb_rec *rec)
 {
-	/*
-	 * A static variable for keeping track of whether a Xr macro was seen
-	 * previously.
-	 */
 	char *buf = NULL;
-	char *temp;
+	char *name;
 	char *nd_text;
 
 	if (n == NULL || (n-type != MDOC_TEXT  n-tok == MDOC_MAX))
@@ -988,11 +984,12 @@ pmdoc_Nd(const struct mdoc_node *n, mand
 		if (rec-xr_found  n-next) {
 			/*
 			 * An Xr macro was seen previously, so parse this
-			 * and the next node.
+			 * and the next node, as Name(Section).
 			 */
-			temp = n-string;
+			name = n-string;
 			n = n-next;
-			easprintf(buf, %s(%s), temp, n-string);
+			assert(n-type == MDOC_TEXT);
+			easprintf(buf, %s(%s), name, n-string);
 			concat(rec-name_desc, buf);
 			free(buf);
 		} else {



CVS commit: src/etc/rc.d

2015-04-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr  7 18:02:11 UTC 2015

Modified Files:
src/etc/rc.d: resize_root

Log Message:
fix typo in previous; pass -y unconditionally to resize_ffs, not -p


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/etc/rc.d/resize_root

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.d/resize_root
diff -u src/etc/rc.d/resize_root:1.2 src/etc/rc.d/resize_root:1.3
--- src/etc/rc.d/resize_root:1.2	Mon Apr  6 22:40:09 2015
+++ src/etc/rc.d/resize_root	Tue Apr  7 18:02:11 2015
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: resize_root,v 1.2 2015/04/06 22:40:09 jmcneill Exp $
+# $NetBSD: resize_root,v 1.3 2015/04/07 18:02:11 jmcneill Exp $
 #
 
 # PROVIDE: resize_root
@@ -82,7 +82,7 @@ resize_root_start()
 
 	if resize_ffs -c $rootdev; then
 		echo Resizing $rootmp
-		if ! resize_ffs -p $resize_root_flags $rootdev; then
+		if ! resize_ffs -y $resize_root_flags $rootdev; then
 		echo Error resizing root.
 		stop_boot
 		fi



CVS commit: src/etc/rc.d

2015-04-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr  7 18:02:11 UTC 2015

Modified Files:
src/etc/rc.d: resize_root

Log Message:
fix typo in previous; pass -y unconditionally to resize_ffs, not -p


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/etc/rc.d/resize_root

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



CVS commit: src/usr.bin/awk

2015-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  7 17:49:40 UTC 2015

Removed Files:
src/usr.bin/awk: Makefile TODO awk.1

Log Message:
remove ancient dup.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r0 src/usr.bin/awk/Makefile
cvs rdiff -u -r1.3 -r0 src/usr.bin/awk/TODO
cvs rdiff -u -r1.19 -r0 src/usr.bin/awk/awk.1

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



CVS commit: src/external/zlib/pigz/bin/pigz

2015-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  7 17:48:13 UTC 2015

Modified Files:
src/external/zlib/pigz/bin/pigz: Makefile

Log Message:
From: Joachim Henke

In -current, build.sh fails due to missing zless/zless.1. The attached
patch brings external/zlib/pigz/bin/pigz/Makefile in sync with
usr.bin/gzip/Makefile, which fixes the build.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/zlib/pigz/bin/pigz/Makefile

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

Modified files:

Index: src/external/zlib/pigz/bin/pigz/Makefile
diff -u src/external/zlib/pigz/bin/pigz/Makefile:1.8 src/external/zlib/pigz/bin/pigz/Makefile:1.9
--- src/external/zlib/pigz/bin/pigz/Makefile:1.8	Sun Jun 15 13:54:55 2014
+++ src/external/zlib/pigz/bin/pigz/Makefile	Tue Apr  7 13:48:13 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2014/06/15 17:54:55 tls Exp $
+#	$NetBSD: Makefile,v 1.9 2015/04/07 17:48:13 christos Exp $
 
 .include bsd.own.mk
 
@@ -33,7 +33,8 @@ MLINKS+=	pigz.1 gzip.1 \
 		pigz.1 zcat.1 \
 		zdiff.1 zcmp.1 \
 		zgrep.1 zegrep.1 \
-		zgrep.1 zfgrep.1
+		zgrep.1 zfgrep.1 \
+		zmore.1 zless.1
 
 LINKS+=		${BINDIR}/pigz ${BINDIR}/gzip \
 		${BINDIR}/pigz ${BINDIR}/gunzip \
@@ -41,7 +42,8 @@ LINKS+=		${BINDIR}/pigz ${BINDIR}/gzip \
 		${BINDIR}/pigz ${BINDIR}/zcat \
 		${BINDIR}/zdiff ${BINDIR}/zcmp \
 		${BINDIR}/zgrep ${BINDIR}/zegrep \
-		${BINDIR}/zgrep ${BINDIR}/zfgrep
+		${BINDIR}/zgrep ${BINDIR}/zfgrep \
+		${BINDIR}/zmore ${BINDIR}/zless
 .endif
 
 .include bsd.prog.mk



CVS commit: src/usr.bin/awk

2015-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  7 17:49:40 UTC 2015

Removed Files:
src/usr.bin/awk: Makefile TODO awk.1

Log Message:
remove ancient dup.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r0 src/usr.bin/awk/Makefile
cvs rdiff -u -r1.3 -r0 src/usr.bin/awk/TODO
cvs rdiff -u -r1.19 -r0 src/usr.bin/awk/awk.1

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



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

2015-04-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr  7 20:36:22 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Fix two bugs.  pmap_is_cached fix for MULTIPROCESSOR (not just ASID on
local cpu - any valid ASID on any cpu).
pmap_deactivate: update curcpu()-ci_pmap_cur_asid to KERNEL_PID too.


To generate a diff of this commit:
cvs rdiff -u -r1.317 -r1.318 src/sys/arch/arm/arm32/pmap.c

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



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

2015-04-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr  7 20:38:20 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: genassym.cf

Log Message:
__HAVE_UNNESTED_INTRS is never used.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/arm/arm32/genassym.cf

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/arm32/genassym.cf
diff -u src/sys/arch/arm/arm32/genassym.cf:1.70 src/sys/arch/arm/arm32/genassym.cf:1.71
--- src/sys/arch/arm/arm32/genassym.cf:1.70	Mon Mar 23 17:28:14 2015
+++ src/sys/arch/arm/arm32/genassym.cf	Tue Apr  7 20:38:20 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.70 2015/03/23 17:28:14 matt Exp $
+#	$NetBSD: genassym.cf,v 1.71 2015/04/07 20:38:20 matt Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -78,10 +78,6 @@ ifdef __HAVE_PIC_FAST_SOFTINTS
 define	__HAVE_PIC_FAST_SOFTINTS	1
 endif
 
-ifdef __HAVE_UNNESTED_INTRS
-define	__HAVE_UNNESTED_INTRS	1
-endif
-
 ifdef ARM_MMU_EXTENDED
 define  ARM_MMU_EXTENDED	1
 endif



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

2015-04-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr  7 20:36:22 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Fix two bugs.  pmap_is_cached fix for MULTIPROCESSOR (not just ASID on
local cpu - any valid ASID on any cpu).
pmap_deactivate: update curcpu()-ci_pmap_cur_asid to KERNEL_PID too.


To generate a diff of this commit:
cvs rdiff -u -r1.317 -r1.318 src/sys/arch/arm/arm32/pmap.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/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.317 src/sys/arch/arm/arm32/pmap.c:1.318
--- src/sys/arch/arm/arm32/pmap.c:1.317	Wed Feb 25 13:52:42 2015
+++ src/sys/arch/arm/arm32/pmap.c	Tue Apr  7 20:36:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.317 2015/02/25 13:52:42 joerg Exp $	*/
+/*	$NetBSD: pmap.c,v 1.318 2015/04/07 20:36:21 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -215,7 +215,7 @@
 
 #include arm/locore.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.317 2015/02/25 13:52:42 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.318 2015/04/07 20:36:21 matt Exp $);
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -924,9 +924,18 @@ static inline bool
 pmap_is_cached(pmap_t pm)
 {
 #ifdef ARM_MMU_EXTENDED
+	if (pm == pmap_kernel())
+		return true;
+#ifdef MULTIPROCESSOR
+	// Is this pmap active on any CPU?
+	if (!kcpuset_iszero(pm-pm_active))
+		return true;
+#else
 	struct pmap_tlb_info * const ti = cpu_tlb_info(curcpu());
-	if (pm == pmap_kernel() || PMAP_PAI_ASIDVALID_P(PMAP_PAI(pm, ti), ti))
+	// Is this pmap active?
+	if (PMAP_PAI_ASIDVALID_P(PMAP_PAI(pm, ti), ti))
 		return true;
+#endif
 #else
 	struct cpu_info * const ci = curcpu();
 	if (pm == pmap_kernel() || ci-ci_pmap_lastuser == NULL
@@ -4937,6 +4946,7 @@ pmap_deactivate(struct lwp *l)
 	pmap_tlb_asid_deactivate(pm);
 	cpu_setttb(pmap_kernel()-pm_l1_pa, KERNEL_PID);
 	ci-ci_pmap_cur = pmap_kernel();
+	ci-ci_pmap_asid_cur = KERNEL_PID;
 	kpreempt_enable();
 #else
 	/*



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

2015-04-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr  7 20:38:20 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: genassym.cf

Log Message:
__HAVE_UNNESTED_INTRS is never used.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/arm/arm32/genassym.cf

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



CVS commit: src/sys

2015-04-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr  7 23:30:36 UTC 2015

Modified Files:
src/sys/net: if.c if.h
src/sys/netinet6: in6.c in6_var.h

Log Message:
Move in6if_do_dad() to if_do_dad() as the routine is not INET6 specific
and could equally be used by INET.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/net/if.c
cvs rdiff -u -r1.186 -r1.187 src/sys/net/if.h
cvs rdiff -u -r1.185 -r1.186 src/sys/netinet6/in6.c
cvs rdiff -u -r1.72 -r1.73 src/sys/netinet6/in6_var.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/net/if.c
diff -u src/sys/net/if.c:1.308 src/sys/net/if.c:1.309
--- src/sys/net/if.c:1.308	Fri Jan 16 10:36:14 2015
+++ src/sys/net/if.c	Tue Apr  7 23:30:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.308 2015/01/16 10:36:14 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.309 2015/04/07 23:30:36 roy Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if.c,v 1.308 2015/01/16 10:36:14 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: if.c,v 1.309 2015/04/07 23:30:36 roy Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_inet.h
@@ -2317,6 +2317,39 @@ if_addr_init(ifnet_t *ifp, struct ifaddr
 }
 
 int
+if_do_dad(struct ifnet *ifp)
+{
+	if ((ifp-if_flags  IFF_LOOPBACK) != 0)
+		return 0;
+
+	switch (ifp-if_type) {
+	case IFT_FAITH:
+		/*
+		 * These interfaces do not have the IFF_LOOPBACK flag,
+		 * but loop packets back.  We do not have to do DAD on such
+		 * interfaces.  We should even omit it, because loop-backed
+		 * responses would confuse the DAD procedure.
+		 */
+		return 0;
+	default:
+		/*
+		 * Our DAD routine requires the interface up and running.
+		 * However, some interfaces can be up before the RUNNING
+		 * status.  Additionaly, users may try to assign addresses
+		 * before the interface becomes up (or running).
+		 * We simply skip DAD in such a case as a work around.
+		 * XXX: we should rather mark tentative on such addresses,
+		 * and do DAD after the interface becomes ready.
+		 */
+		if ((ifp-if_flags  (IFF_UP|IFF_RUNNING)) !=
+		(IFF_UP|IFF_RUNNING))
+			return 0;
+
+		return 1;
+	}
+}
+
+int
 if_flags_set(ifnet_t *ifp, const short flags)
 {
 	int rc;

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.186 src/sys/net/if.h:1.187
--- src/sys/net/if.h:1.186	Fri Apr  3 08:20:55 2015
+++ src/sys/net/if.h	Tue Apr  7 23:30:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.186 2015/04/03 08:20:55 msaitoh Exp $	*/
+/*	$NetBSD: if.h,v 1.187 2015/04/07 23:30:36 roy Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -879,6 +879,7 @@ int	ifioctl_common(struct ifnet *, u_lon
 int	ifpromisc(struct ifnet *, int);
 struct	ifnet *ifunit(const char *);
 int	if_addr_init(ifnet_t *, struct ifaddr *, bool);
+int	if_do_dad(struct ifnet *);
 int	if_mcast_op(ifnet_t *, const unsigned long, const struct sockaddr *);
 int	if_flags_set(struct ifnet *, const short);
 

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.185 src/sys/netinet6/in6.c:1.186
--- src/sys/netinet6/in6.c:1.185	Thu Feb 26 12:58:36 2015
+++ src/sys/netinet6/in6.c	Tue Apr  7 23:30:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.185 2015/02/26 12:58:36 roy Exp $	*/
+/*	$NetBSD: in6.c,v 1.186 2015/04/07 23:30:36 roy Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in6.c,v 1.185 2015/02/26 12:58:36 roy Exp $);
+__KERNEL_RCSID(0, $NetBSD: in6.c,v 1.186 2015/04/07 23:30:36 roy Exp $);
 
 #include opt_inet.h
 #include opt_compat_netbsd.h
@@ -979,7 +979,7 @@ in6_update_ifa1(struct ifnet *ifp, struc
 	if (ifp-if_link_state == LINK_STATE_DOWN) {
 		ia-ia6_flags |= IN6_IFF_DETACHED;
 		ia-ia6_flags = ~IN6_IFF_TENTATIVE;
-	} else if ((hostIsNew || was_tentative)  in6if_do_dad(ifp))
+	} else if ((hostIsNew || was_tentative)  if_do_dad(ifp))
 		ia-ia6_flags |= IN6_IFF_TENTATIVE;
 
 	/*
@@ -1205,7 +1205,7 @@ in6_update_ifa1(struct ifnet *ifp, struc
 	 * XXX It may be of use, if we can administratively
 	 * disable DAD.
 	 */
-	if (hostIsNew  in6if_do_dad(ifp) 
+	if (hostIsNew  if_do_dad(ifp) 
 	((ifra-ifra_flags  IN6_IFF_NODAD) == 0) 
 	(ia-ia6_flags  IN6_IFF_TENTATIVE))
 	{
@@ -2005,7 +2005,7 @@ in6_if_link_up(struct ifnet *ifp)
 		/* If detached then mark as tentative */
 		if (ia-ia6_flags  IN6_IFF_DETACHED) {
 			ia-ia6_flags = ~IN6_IFF_DETACHED;
-			if (in6if_do_dad(ifp)) {
+			if (if_do_dad(ifp)) {
 ia-ia6_flags |= IN6_IFF_TENTATIVE;
 nd6log((LOG_ERR, in6_if_up: 
 %s marked tentative\n,
@@ -2097,39 +2097,6 @@ in6_if_down(struct ifnet *ifp)
 	in6_if_link_down(ifp);
 }
 
-int
-in6if_do_dad(struct ifnet *ifp)
-{
-	if ((ifp-if_flags  IFF_LOOPBACK) != 0)
-		return 0;
-
-	switch (ifp-if_type) {
-	case IFT_FAITH:
-		/*
-		 * These 

CVS commit: src/sys

2015-04-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr  7 23:30:36 UTC 2015

Modified Files:
src/sys/net: if.c if.h
src/sys/netinet6: in6.c in6_var.h

Log Message:
Move in6if_do_dad() to if_do_dad() as the routine is not INET6 specific
and could equally be used by INET.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/net/if.c
cvs rdiff -u -r1.186 -r1.187 src/sys/net/if.h
cvs rdiff -u -r1.185 -r1.186 src/sys/netinet6/in6.c
cvs rdiff -u -r1.72 -r1.73 src/sys/netinet6/in6_var.h

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



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 01:42:40 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_legacy_crtc.c

Log Message:
Don't reserve if atomic -- caller must have pre-pinned the buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.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/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c:1.1.1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c:1.1.1.1	Wed Jul 16 19:35:28 2014
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c	Wed Apr  8 01:42:40 2015
@@ -422,6 +422,16 @@ int radeon_crtc_do_set_base(struct drm_c
 	/* Pin framebuffer  get tilling informations */
 	obj = radeon_fb-obj;
 	rbo = gem_to_radeon_bo(obj);
+	if (atomic) {
+		/*
+		 * If you want to do this in atomic, better have it
+		 * pinned ahead of time.
+		 */
+		BUG_ON(rbo-pin_count == 0);
+		base = radeon_bo_gpu_offset(rbo);
+		tiling_flags = 0;
+		goto pinned;
+	}
 retry:
 	r = radeon_bo_reserve(rbo, false);
 	if (unlikely(r != 0))
@@ -444,7 +454,7 @@ retry:
 		 * We don't shutdown the display controller because new buffer
 		 * will end up in same spot.
 		 */
-		if (!atomic  fb  fb != crtc-primary-fb) {
+		if (fb  fb != crtc-primary-fb) {
 			struct radeon_bo *old_rbo;
 			unsigned long nsize, osize;
 
@@ -462,6 +472,7 @@ retry:
 	}
 	radeon_bo_get_tiling_flags(rbo, tiling_flags, NULL);
 	radeon_bo_unreserve(rbo);
+pinned:
 	if (tiling_flags  RADEON_TILING_MICRO)
 		DRM_ERROR(trying to scanout microtiled buffer\n);
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 01:42:40 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_legacy_crtc.c

Log Message:
Don't reserve if atomic -- caller must have pre-pinned the buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c

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



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 01:47:20 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: atombios_crtc.c

Log Message:
Don't reserve if atomic -- caller must have pre-pinned the buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c

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



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 01:47:20 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: atombios_crtc.c

Log Message:
Don't reserve if atomic -- caller must have pre-pinned the buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.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/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c:1.2 src/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c:1.2	Wed Jul 16 20:59:57 2014
+++ src/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c	Wed Apr  8 01:47:20 2015
@@ -1124,23 +1124,24 @@ static int dce4_crtc_do_set_base(struct 
 	 */
 	obj = radeon_fb-obj;
 	rbo = gem_to_radeon_bo(obj);
-	r = radeon_bo_reserve(rbo, false);
-	if (unlikely(r != 0))
-		return r;
 
-	if (atomic)
+	if (atomic) {
+		BUG_ON(rbo-pin_count == 0);
 		fb_location = radeon_bo_gpu_offset(rbo);
-	else {
+		tiling_flags = 0;
+	} else {
+		r = radeon_bo_reserve(rbo, false);
+		if (unlikely(r != 0))
+			return r;
 		r = radeon_bo_pin(rbo, RADEON_GEM_DOMAIN_VRAM, fb_location);
 		if (unlikely(r != 0)) {
 			radeon_bo_unreserve(rbo);
 			return -EINVAL;
 		}
+		radeon_bo_get_tiling_flags(rbo, tiling_flags, NULL);
+		radeon_bo_unreserve(rbo);
 	}
 
-	radeon_bo_get_tiling_flags(rbo, tiling_flags, NULL);
-	radeon_bo_unreserve(rbo);
-
 	switch (target_fb-bits_per_pixel) {
 	case 8:
 		fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_8BPP) |



CVS commit: src/share/man/man5

2015-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  8 05:47:00 UTC 2015

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
Update some defaults, from Joachim Henke on netbsd-docs.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/share/man/man5/mk.conf.5

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

Modified files:

Index: src/share/man/man5/mk.conf.5
diff -u src/share/man/man5/mk.conf.5:1.69 src/share/man/man5/mk.conf.5:1.70
--- src/share/man/man5/mk.conf.5:1.69	Tue Mar 25 10:23:26 2014
+++ src/share/man/man5/mk.conf.5	Wed Apr  8 05:47:00 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: mk.conf.5,v 1.69 2014/03/25 10:23:26 wiz Exp $
+.\	$NetBSD: mk.conf.5,v 1.70 2015/04/08 05:47:00 wiz Exp $
 .\
 .\  Copyright (c) 1999-2003 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 March 25, 2014
+.Dd April 7, 2015
 .Dt MK.CONF 5
 .Os
 .\ turn off hyphenation
@@ -262,7 +262,7 @@ based frontends are used.
 .YorN
 Indicates whether preformatted plaintext manual pages will be created
 and installed.
-.DFLTy
+.DFLTn
 .
 .It Sy MKCLEANSRC
 .YorN
@@ -1053,11 +1053,10 @@ or
 .Dq XFree86 .
 Only relevant if
 .Sy MKX11!=no .
-.Pp
-.Em Default :
-.Dq Xorg
-on alpha, i386, macppc, shark and sparc64 platforms.
+.DFLT
 .Dq XFree86
+on acorn32, alpha, amiga, mac68k, pmax, and sun3 platforms,
+.Dq Xorg
 on everything else.
 .
 .El



CVS commit: src/share/man/man5

2015-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  8 05:47:00 UTC 2015

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
Update some defaults, from Joachim Henke on netbsd-docs.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/share/man/man5/mk.conf.5

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



CVS commit: src/doc

2015-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  8 05:47:43 UTC 2015

Modified Files:
src/doc: BUILDING.mdoc

Log Message:
Update Xorg defaults description. From Joachim Henke on netbsd-docs.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/doc/BUILDING.mdoc

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

Modified files:

Index: src/doc/BUILDING.mdoc
diff -u src/doc/BUILDING.mdoc:1.111 src/doc/BUILDING.mdoc:1.112
--- src/doc/BUILDING.mdoc:1.111	Thu Jan  8 23:59:26 2015
+++ src/doc/BUILDING.mdoc	Wed Apr  8 05:47:43 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: BUILDING.mdoc,v 1.111 2015/01/08 23:59:26 riastradh Exp $
+.\	$NetBSD: BUILDING.mdoc,v 1.112 2015/04/08 05:47:43 wiz Exp $
 .\
 .\ Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -33,7 +33,7 @@
 .\ Toolchain prefix for commands
 .ds toolprefix nb
 .
-.Dd August 7, 2014
+.Dd April 7, 2015
 .Dt BUILDING 8
 .Os NetBSD
 .
@@ -783,9 +783,9 @@ The style of X11 cross-built, set to eit
 or
 .Dq XFree86 .
 .DFLT
-.Dq Xorg
-on amd64, i386, macppc, shark and sparc64 platforms,
 .Dq XFree86
+on acorn32, alpha, amiga, mac68k, pmax, and sun3 platforms,
+.Dq Xorg
 on everything else.
 .
 .El



CVS commit: src/doc

2015-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  8 05:47:43 UTC 2015

Modified Files:
src/doc: BUILDING.mdoc

Log Message:
Update Xorg defaults description. From Joachim Henke on netbsd-docs.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/doc/BUILDING.mdoc

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



CVS commit: src

2015-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  8 05:48:24 UTC 2015

Modified Files:
src: BUILDING

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/BUILDING

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

Modified files:

Index: src/BUILDING
diff -u src/BUILDING:1.118 src/BUILDING:1.119
--- src/BUILDING:1.118	Sun Nov 30 15:54:34 2014
+++ src/BUILDING	Wed Apr  8 05:48:24 2015
@@ -452,8 +452,8 @@ CONFIGURATION
  X11FLAVOUR  The style of X11 cross-built, set to either ``Xorg'' or
  ``XFree86''.
 
- Default: ``Xorg'' on amd64, i386, macppc, shark and sparc64
- platforms, ``XFree86'' on everything else.
+ Default: ``XFree86'' on acorn32, alpha, amiga, mac68k, pmax,
+ and sun3 platforms, ``Xorg'' on everything else.
 
make variables for full builds
  These variables only affect the top level ``Makefile'' and do not affect
@@ -1108,4 +1108,4 @@ CAVEATS
  files in object directories.  Instead, one may have to manually remove
  the files.  Consult the UPDATING file for notices concerning this.
 
-NetBSD  August 7, 2014  NetBSD
+NetBSD   April 7, 2015  NetBSD



CVS commit: src

2015-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  8 05:48:24 UTC 2015

Modified Files:
src: BUILDING

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/BUILDING

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



CVS commit: src/sys/arch/x86/x86

2015-04-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Apr  8 05:52:41 UTC 2015

Modified Files:
src/sys/arch/x86/x86: intr.c

Log Message:
add prototype declarations


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/x86/intr.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/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.77 src/sys/arch/x86/x86/intr.c:1.78
--- src/sys/arch/x86/x86/intr.c:1.77	Tue May 20 03:24:19 2014
+++ src/sys/arch/x86/x86/intr.c	Wed Apr  8 05:52:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.77 2014/05/20 03:24:19 ozaki-r Exp $	*/
+/*	$NetBSD: intr.c,v 1.78 2015/04/08 05:52:41 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.77 2014/05/20 03:24:19 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.78 2015/04/08 05:52:41 knakahara Exp $);
 
 #include opt_intrdebug.h
 #include opt_multiprocessor.h
@@ -188,6 +188,8 @@ struct pic softintr_pic = {
 	.pic_lock = __SIMPLELOCK_UNLOCKED,
 };
 
+static void intr_calculatemasks(struct cpu_info *);
+
 #if NIOAPIC  0 || NACPICA  0
 static int intr_scan_bus(int, int, int *);
 #if NPCI  0
@@ -195,6 +197,23 @@ static int intr_find_pcibridge(int, pcit
 #endif
 #endif
 
+static int intr_allocate_slot_cpu(struct cpu_info *, struct pic *, int, int *);
+static int __noinline intr_allocate_slot(struct pic *, int, int,
+	 struct cpu_info **, int *, int *);
+
+static void intr_source_free(struct cpu_info *, int, struct pic *, int);
+
+static void intr_establish_xcall(void *, void *);
+static void intr_disestablish_xcall(void *, void *);
+
+static inline bool redzone_const_or_false(bool);
+static inline int redzone_const_or_zero(int);
+
+static void intr_redistribute_xc_t(void *, void *);
+static void intr_redistribute_xc_s1(void *, void *);
+static void intr_redistribute_xc_s2(void *, void *);
+static bool intr_redistribute(struct cpu_info *);
+
 /*
  * Fill in default interrupt table (in case of spurious interrupt
  * during configuration of kernel), setup interrupt control unit



CVS commit: src/sys/arch/x86/x86

2015-04-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Apr  8 05:52:41 UTC 2015

Modified Files:
src/sys/arch/x86/x86: intr.c

Log Message:
add prototype declarations


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/x86/intr.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:32:26 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Reduce #ifdef RND_VERBOSE clutter.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.30 src/sys/kern/kern_rndq.c:1.31
--- src/sys/kern/kern_rndq.c:1.30	Wed Apr  8 02:25:06 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 02:32:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.30 2015/04/08 02:25:06 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.31 2015/04/08 02:32:26 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.30 2015/04/08 02:25:06 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.31 2015/04/08 02:32:26 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -83,6 +83,12 @@ int	rnd_debug = 0;
 #endif
 
 #ifdef RND_VERBOSE
+#define	rnd_printf_verbose(fmt, ...)	rnd_printf(fmt, ##__VA_ARGS__)
+#else
+#define	rnd_printf_verbose(fmt, ...)	((void)0)
+#endif
+
+#ifdef RND_VERBOSE
 static unsigned int deltacnt;
 #endif
 
@@ -167,7 +173,6 @@ static inline uint32_t	rnd_counter(void)
 staticvoid	rnd_intr(void *);
 static	  void	rnd_wake(void *);
 static	  void	rnd_process_events(void);
-static	  u_int32_t	rnd_extract_data_locked(void *, u_int32_t, u_int32_t);
 static	  void	rnd_add_data_ts(krndsource_t *, const void *const,
 	uint32_t, uint32_t, uint32_t);
 static inline void	rnd_schedule_process(void);
@@ -274,7 +279,7 @@ rnd_schedule_wakeup(void)
 void
 rnd_getmore(size_t byteswanted)
 {
-	krndsource_t *rs; 
+	krndsource_t *rs;
 
 	KASSERT(mutex_owned(rndpool_mtx));
 
@@ -283,14 +288,13 @@ rnd_getmore(size_t byteswanted)
 			KASSERT(rs-get != NULL);
 			KASSERT(rs-getarg != NULL);
 			rs-get(byteswanted, rs-getarg);
-#ifdef RND_VERBOSE
-			rnd_printf(rnd: entropy estimate %zu bits\n,
-   rndpool_get_entropy_count(rnd_pool));
-			rnd_printf(rnd: asking source %s for %zu bytes\n,
-			   rs-name, byteswanted);
-#endif
-		}
-	}
+			rnd_printf_verbose(rnd: entropy estimate %zu bits\n,
+			rndpool_get_entropy_count(rnd_pool));
+			rnd_printf_verbose(rnd: asking source %s
+			 for %zu bytes\n,
+			rs-name, byteswanted);
+		}
+	}
 }
 
 /*
@@ -314,7 +318,7 @@ rnd_wakeup_readers(void)
 	} else {
 #ifdef RND_VERBOSE
 		if (__predict_false(!rnd_initial_entropy))
-			rnd_printf(rnd: have initial entropy (%zu)\n,
+			rnd_printf_verbose(rnd: have initial entropy (%zu)\n,
 			entropy_count);
 #endif
 		rnd_empty = 0;
@@ -389,7 +393,7 @@ rnd_dt_estimate(krndsource_t *rs, uint32
 	KASSERT(d-dx == delta);
 #ifdef RND_VERBOSE
 	if (deltacnt++ % 1151 == 0) {
-		rnd_printf(rnd_dt_estimate: %s x = %lld, dx = %lld, 
+		rnd_printf_verbose(rnd_dt_estimate: %s x = %lld, dx = %lld, 
 		   d2x = %lld\n, rs-name,
 		   (int)d-x, (int)d-dx, (int)d-d2x);
 	}
@@ -418,7 +422,7 @@ rnd_dv_estimate(krndsource_t *rs, uint32
 	KASSERT(d-dx == delta);
 #ifdef RND_VERBOSE
 	if (deltacnt++ % 1151 == 0) {
-		rnd_printf(rnd_dv_estimate: %s x = %lld, dx = %lld, 
+		rnd_printf_verbose(rnd_dv_estimate: %s x = %lld, dx = %lld, 
 		d2x = %lld\n, rs-name,
 		   (long long int)d-x,
 		   (long long int)d-dx,
@@ -575,10 +579,8 @@ rnd_init(void)
 	rnd_skew(NULL);
 #endif
 
-#ifdef RND_VERBOSE
-	rnd_printf(rnd: initialised (%u)%s, RND_POOLBITS,
-	   c ?  with counter\n : \n);
-#endif
+	rnd_printf_verbose(rnd: initialised (%u)%s, RND_POOLBITS,
+	c ?  with counter\n : \n);
 	if (boot_rsp != NULL) {
 		mutex_spin_enter(rndpool_mtx);
 			rndpool_add_data(rnd_pool, boot_rsp-data,
@@ -590,10 +592,8 @@ rnd_init(void)
 	rnd_initial_entropy = 1;
 		}
 mutex_spin_exit(rndpool_mtx);
-#ifdef RND_VERBOSE
 		rnd_printf(rnd: seeded with %d bits\n,
-		   MIN(boot_rsp-entropy, RND_POOLBITS / 2));
-#endif
+		MIN(boot_rsp-entropy, RND_POOLBITS / 2));
 		memset(boot_rsp, 0, sizeof(*boot_rsp));
 	}
 	rnd_attach_source(rnd_source_anonymous, Anonymous,
@@ -701,15 +701,16 @@ rnd_attach_source(krndsource_t *rs, cons
 	LIST_INSERT_HEAD(rnd_sources, rs, list);
 
 #ifdef RND_VERBOSE
-	rnd_printf(rnd: %s attached as an entropy source (, rs-name);
+	rnd_printf_verbose(rnd: %s attached as an entropy source (,
+	rs-name);
 	if (!(flags  RND_FLAG_NO_COLLECT)) {
-		rnd_printf(collecting);
+		rnd_printf_verbose(collecting);
 		if (flags  RND_FLAG_NO_ESTIMATE)
-			rnd_printf( without estimation);
+			rnd_printf_verbose( without estimation);
 	}
 	else
-		rnd_printf(off);
-	rnd_printf()\n);
+		rnd_printf_verbose(off);
+	rnd_printf_verbose()\n);
 #endif
 
 	/*
@@ -759,9 +760,8 @@ rnd_detach_source(krndsource_t *source)
 		}
 	}
 

CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:35:33 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Reduce some indentation.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.31 src/sys/kern/kern_rndq.c:1.32
--- src/sys/kern/kern_rndq.c:1.31	Wed Apr  8 02:32:26 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 02:35:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.31 2015/04/08 02:32:26 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.32 2015/04/08 02:35:33 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.31 2015/04/08 02:32:26 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.32 2015/04/08 02:35:33 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -284,16 +284,15 @@ rnd_getmore(size_t byteswanted)
 	KASSERT(mutex_owned(rndpool_mtx));
 
 	LIST_FOREACH(rs, rnd_sources, list) {
-		if (rs-flags  RND_FLAG_HASCB) {
-			KASSERT(rs-get != NULL);
-			KASSERT(rs-getarg != NULL);
-			rs-get(byteswanted, rs-getarg);
-			rnd_printf_verbose(rnd: entropy estimate %zu bits\n,
-			rndpool_get_entropy_count(rnd_pool));
-			rnd_printf_verbose(rnd: asking source %s
-			 for %zu bytes\n,
-			rs-name, byteswanted);
-		}
+		if (!ISSET(rs-flags, RND_FLAG_HASCB))
+			continue;
+		KASSERT(rs-get != NULL);
+		KASSERT(rs-getarg != NULL);
+		rs-get(byteswanted, rs-getarg);
+		rnd_printf_verbose(rnd: entropy estimate %zu bits\n,
+		rndpool_get_entropy_count(rnd_pool));
+		rnd_printf_verbose(rnd: asking source %s for %zu bytes\n,
+		rs-name, byteswanted);
 	}
 }
 



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:44:07 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Let's use the same lock for insertion and deletion, shall we?


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.32 src/sys/kern/kern_rndq.c:1.33
--- src/sys/kern/kern_rndq.c:1.32	Wed Apr  8 02:35:33 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 02:44:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.32 2015/04/08 02:35:33 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.33 2015/04/08 02:44:07 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.32 2015/04/08 02:35:33 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.33 2015/04/08 02:44:07 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -730,14 +730,15 @@ rnd_detach_source(krndsource_t *source)
 {
 	rnd_sample_t *sample;
 
-	mutex_spin_enter(rnd_mtx);
-
+	mutex_spin_enter(rndpool_mtx);
 	LIST_REMOVE(source, list);
+	mutex_spin_exit(rndpool_mtx);
 
 	/*
 	 * If there are samples queued up remove them from the sample queue
 	 * by setting the source to the no-collect pseudosource.
 	 */
+	mutex_spin_enter(rnd_mtx);
 	sample = SIMPLEQ_FIRST(rnd_samples);
 	while (sample != NULL) {
 		if (sample-source == source)
@@ -745,7 +746,6 @@ rnd_detach_source(krndsource_t *source)
 
 		sample = SIMPLEQ_NEXT(sample, next);
 	}
-
 	mutex_spin_exit(rnd_mtx);
 
 	if (!cpu_softintr_p()) {	/* XXX XXX very temporary fix */



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:49:03 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Gather sample queue and lock into a static cacheline-aligned struct.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.33 src/sys/kern/kern_rndq.c:1.34
--- src/sys/kern/kern_rndq.c:1.33	Wed Apr  8 02:44:07 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 02:49:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.33 2015/04/08 02:44:07 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.34 2015/04/08 02:49:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.33 2015/04/08 02:44:07 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.34 2015/04/08 02:49:03 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -109,11 +109,13 @@ typedef struct _rnd_sample_t {
 } rnd_sample_t;
 
 /*
- * The event queue.  Fields are altered at an interrupt level.
- * All accesses must be protected with the mutex.
+ * The sample queue.  Samples are put into the queue and processed in a
+ * softint in order to limit the latency of adding a sample.
  */
-SIMPLEQ_HEAD(, _rnd_sample_t)	rnd_samples;
-kmutex_t			rnd_mtx;
+static struct {
+	kmutex_t			lock;
+	SIMPLEQ_HEAD(, _rnd_sample_t)	q;
+} rnd_samples __cacheline_aligned;
 
 /*
  * Memory pool for sample buffers
@@ -522,7 +524,7 @@ rnd_init(void)
 	if (rnd_ready)
 		return;
 
-	mutex_init(rnd_mtx, MUTEX_DEFAULT, IPL_VM);
+	mutex_init(rnd_samples.lock, MUTEX_DEFAULT, IPL_VM);
 	rndsinks_init();
 
 	/*
@@ -532,7 +534,7 @@ rnd_init(void)
 	c = rnd_counter();
 
 	LIST_INIT(rnd_sources);
-	SIMPLEQ_INIT(rnd_samples);
+	SIMPLEQ_INIT(rnd_samples.q);
 
 	rndpool_init(rnd_pool);
 	mutex_init(rndpool_mtx, MUTEX_DEFAULT, IPL_VM);
@@ -738,15 +740,15 @@ rnd_detach_source(krndsource_t *source)
 	 * If there are samples queued up remove them from the sample queue
 	 * by setting the source to the no-collect pseudosource.
 	 */
-	mutex_spin_enter(rnd_mtx);
-	sample = SIMPLEQ_FIRST(rnd_samples);
+	mutex_spin_enter(rnd_samples.lock);
+	sample = SIMPLEQ_FIRST(rnd_samples.q);
 	while (sample != NULL) {
 		if (sample-source == source)
 			sample-source = rnd_source_no_collect;
 
 		sample = SIMPLEQ_NEXT(sample, next);
 	}
-	mutex_spin_exit(rnd_mtx);
+	mutex_spin_exit(rnd_samples.lock);
 
 	if (!cpu_softintr_p()) {	/* XXX XXX very temporary fix */
 		if (source-state) {
@@ -955,12 +957,12 @@ rnd_add_data_ts(krndsource_t *rs, const 
 		return;
 	}
 
-	mutex_spin_enter(rnd_mtx);
+	mutex_spin_enter(rnd_samples.lock);
 	while ((state = SIMPLEQ_FIRST(tmp_samples))) {
 		SIMPLEQ_REMOVE_HEAD(tmp_samples, next);
-		SIMPLEQ_INSERT_HEAD(rnd_samples, state, next);
+		SIMPLEQ_INSERT_HEAD(rnd_samples.q, state, next);
 	}
-	mutex_spin_exit(rnd_mtx);
+	mutex_spin_exit(rnd_samples.lock);
 
 	/* Cause processing of queued samples */
 	rnd_schedule_process();
@@ -1040,14 +1042,12 @@ rnd_process_events(void)
 			SIMPLEQ_HEAD_INITIALIZER(df_samples);
 
 	/*
-	 * Sample queue is protected by rnd_mtx, drain to onstack queue
-	 * and drop lock.
+	 * Drain to the on-stack queue and drop the lock.
 	 */
-
-	mutex_spin_enter(rnd_mtx);
-	while ((sample = SIMPLEQ_FIRST(rnd_samples))) {
+	mutex_spin_enter(rnd_samples.lock);
+	while ((sample = SIMPLEQ_FIRST(rnd_samples.q))) {
 		found++;
-		SIMPLEQ_REMOVE_HEAD(rnd_samples, next);
+		SIMPLEQ_REMOVE_HEAD(rnd_samples.q, next);
 		/*
 		 * We repeat this check here, since it is possible
 		 * the source was disabled before we were called, but
@@ -1061,7 +1061,7 @@ rnd_process_events(void)
 			SIMPLEQ_INSERT_TAIL(dq_samples, sample, next);
 		}
 	}
-	mutex_spin_exit(rnd_mtx);
+	mutex_spin_exit(rnd_samples.lock);
 
 	/* Don't thrash the rndpool mtx either.  Hold, add all samples. */
 	mutex_spin_enter(rndpool_mtx);



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:52:25 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Name the simpleq of rnd_sample_t structure.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.34 src/sys/kern/kern_rndq.c:1.35
--- src/sys/kern/kern_rndq.c:1.34	Wed Apr  8 02:49:03 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 02:52:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.34 2015/04/08 02:49:03 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.35 2015/04/08 02:52:25 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.34 2015/04/08 02:49:03 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.35 2015/04/08 02:52:25 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -108,13 +108,15 @@ typedef struct _rnd_sample_t {
 	u_int32_t	values[RND_SAMPLE_COUNT];
 } rnd_sample_t;
 
+SIMPLEQ_HEAD(rnd_sampleq, _rnd_sample_t);
+
 /*
  * The sample queue.  Samples are put into the queue and processed in a
  * softint in order to limit the latency of adding a sample.
  */
 static struct {
-	kmutex_t			lock;
-	SIMPLEQ_HEAD(, _rnd_sample_t)	q;
+	kmutex_t		lock;
+	struct rnd_sampleq	q;
 } rnd_samples __cacheline_aligned;
 
 /*
@@ -865,8 +867,7 @@ rnd_add_data_ts(krndsource_t *rs, const 
 	uint32_t dint;
 	int todo, done, filled = 0;
 	int sample_count;
-	SIMPLEQ_HEAD(, _rnd_sample_t) tmp_samples =
-			SIMPLEQ_HEAD_INITIALIZER(tmp_samples);
+	struct rnd_sampleq tmp_samples = SIMPLEQ_HEAD_INITIALIZER(tmp_samples);
 
 	if (rs  (rs-flags  RND_FLAG_NO_COLLECT ||
 	__predict_false(!(rs-flags  
@@ -1036,10 +1037,8 @@ rnd_process_events(void)
 	u_int32_t entropy;
 	size_t pool_entropy;
 	int found = 0, wake = 0;
-	SIMPLEQ_HEAD(, _rnd_sample_t) dq_samples =
-			SIMPLEQ_HEAD_INITIALIZER(dq_samples);
-	SIMPLEQ_HEAD(, _rnd_sample_t) df_samples =
-			SIMPLEQ_HEAD_INITIALIZER(df_samples);
+	struct rnd_sampleq dq_samples = SIMPLEQ_HEAD_INITIALIZER(dq_samples);
+	struct rnd_sampleq df_samples = SIMPLEQ_HEAD_INITIALIZER(df_samples);
 
 	/*
 	 * Drain to the on-stack queue and drop the lock.



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 03:00:31 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Simplify logic to disable HWRNGs that fail rngtest.

- Mark them RND_FLAG_NO_COLLECT.
- Skip samples from sources marked RND_FLAG_NO_COLLECT.
- Don't ever call rnd_detach_source in softint context.
- Remove bogus use of cpu_softintr_p.

The call to rnd_detach_source in softint can't possibly have ever
worked: if the owner of the source ever tried to detach it by calling
rnd_detach_source again, it would LIST_REMOVE a removed element,
which is broken.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.35 src/sys/kern/kern_rndq.c:1.36
--- src/sys/kern/kern_rndq.c:1.35	Wed Apr  8 02:52:25 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 03:00:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.35 2015/04/08 02:52:25 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.36 2015/04/08 03:00:31 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.35 2015/04/08 02:52:25 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.36 2015/04/08 03:00:31 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -55,7 +55,6 @@ __KERNEL_RCSID(0, $NetBSD: kern_rndq.c,
 #include sys/kauth.h
 #include sys/once.h
 #include sys/rngtest.h
-#include sys/cpu.h	/* XXX temporary, see rnd_detach_source */
 
 #include dev/rnd_private.h
 
@@ -752,15 +751,13 @@ rnd_detach_source(krndsource_t *source)
 	}
 	mutex_spin_exit(rnd_samples.lock);
 
-	if (!cpu_softintr_p()) {	/* XXX XXX very temporary fix */
-		if (source-state) {
-			rnd_sample_free(source-state);
-			source-state = NULL;
-		}
+	if (source-state) {
+		rnd_sample_free(source-state);
+		source-state = NULL;
+	}
 
-		if (source-test) {
-			kmem_free(source-test, sizeof(rngtest_t));
-		}
+	if (source-test) {
+		kmem_free(source-test, sizeof(rngtest_t));
 	}
 
 	rnd_printf_verbose(rnd: %s detached as an entropy source\n,
@@ -1087,19 +1084,25 @@ rnd_process_events(void)
 		last_source = source;
 
 		/*
+		 * If the source has been disabled, ignore samples from
+		 * it.
+		 */
+		if (source-flags  RND_FLAG_NO_COLLECT)
+			goto skip;
+
+		/*
 		 * Hardware generators are great but sometimes they
 		 * have...hardware issues.  Don't use any data from
 		 * them unless it passes some tests.
 		 */
 		if (source-type == RND_TYPE_RNG) {
 			if (__predict_false(rnd_hwrng_test(sample))) {
-/*
- * Detach the bad source.  See below.
- */
-badsource = source;
-rnd_printf(rnd: detaching source \%s\.,
-   badsource-name);
-break;
+mutex_spin_enter(rndpool_mtx);
+source-flags |= RND_FLAG_NO_COLLECT;
+mutex_spin_exit(rndpool_mtx);
+rnd_printf(rnd: disabling source \%s\.,
+badsource-name);
+goto skip;
 			}
 		}
 
@@ -1118,7 +1121,7 @@ rnd_process_events(void)
 
 		pool_entropy += entropy;
 		source-total += sample-entropy;
-		SIMPLEQ_INSERT_TAIL(df_samples, sample, next);
+skip:		SIMPLEQ_INSERT_TAIL(df_samples, sample, next);
 	}
 	rndpool_set_entropy_count(rnd_pool, pool_entropy);
 	if (pool_entropy  RND_ENTROPY_THRESHOLD * 8) {
@@ -1132,19 +1135,6 @@ rnd_process_events(void)
 	mutex_spin_exit(rndpool_mtx);
 
 	/* Now we hold no locks: clean up. */
-	if (__predict_false(badsource)) {
-		/*
-		 * The detach routine frees any samples we have not
-		 * dequeued ourselves.  For sanity's sake, we simply
-		 * free (without using) all dequeued samples from the
-		 * point at which we detected a problem onwards.
-		 */
-		rnd_detach_source(badsource);
-		while ((sample = SIMPLEQ_FIRST(dq_samples))) {
-			SIMPLEQ_REMOVE_HEAD(dq_samples, next);
-			rnd_sample_free(sample);
-		}
-	}
 	while ((sample = SIMPLEQ_FIRST(df_samples))) {
 		SIMPLEQ_REMOVE_HEAD(df_samples, next);
 		rnd_sample_free(sample);



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 03:14:29 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Oops -- we already hold rndpool_mtx here.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.36 src/sys/kern/kern_rndq.c:1.37
--- src/sys/kern/kern_rndq.c:1.36	Wed Apr  8 03:00:31 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 03:14:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.36 2015/04/08 03:00:31 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.37 2015/04/08 03:14:29 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.36 2015/04/08 03:00:31 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.37 2015/04/08 03:14:29 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -1097,9 +1097,7 @@ rnd_process_events(void)
 		 */
 		if (source-type == RND_TYPE_RNG) {
 			if (__predict_false(rnd_hwrng_test(sample))) {
-mutex_spin_enter(rndpool_mtx);
 source-flags |= RND_FLAG_NO_COLLECT;
-mutex_spin_exit(rndpool_mtx);
 rnd_printf(rnd: disabling source \%s\.,
 badsource-name);
 goto skip;



Re: CVS commit: src

2015-04-07 Thread Masao Uebayashi
On Mon, Apr 6, 2015 at 7:02 PM, Martin Husemann mar...@duskware.de wrote:
 On Sun, Apr 05, 2015 at 09:40:22AM -0400, Christos Zoulas wrote:
 Hmm, it is building things twice... I am trying to figure out why but I can't
 reproduce it.

Not surprising at all if multiple output hack (*.y) is involved.

 Not sure, but it basically fails for me on all build machines if using low
 values for -j. I can get past it by doing a cleandir and dependall without
 -j.

 Also below is a log of a non-cleandir'd build failing, but that looks mostly
 the same now.

If I were you, I'd look at make -dm output.

(Remember that make(1) has no idea that foo.c and ./foo.c are
identical; they are just strings for make(1).)


CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:32:26 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Reduce #ifdef RND_VERBOSE clutter.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:35:33 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Reduce some indentation.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:44:07 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Let's use the same lock for insertion and deletion, shall we?


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:49:03 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Gather sample queue and lock into a static cacheline-aligned struct.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:52:25 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Name the simpleq of rnd_sample_t structure.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 03:00:31 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Simplify logic to disable HWRNGs that fail rngtest.

- Mark them RND_FLAG_NO_COLLECT.
- Skip samples from sources marked RND_FLAG_NO_COLLECT.
- Don't ever call rnd_detach_source in softint context.
- Remove bogus use of cpu_softintr_p.

The call to rnd_detach_source in softint can't possibly have ever
worked: if the owner of the source ever tried to detach it by calling
rnd_detach_source again, it would LIST_REMOVE a removed element,
which is broken.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 03:14:29 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Oops -- we already hold rndpool_mtx here.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:25:06 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Make rnd_extract_data_locked static.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/kern/kern_rndq.c

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



CVS commit: src/sys/kern

2015-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  8 02:25:06 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Make rnd_extract_data_locked static.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.29 src/sys/kern/kern_rndq.c:1.30
--- src/sys/kern/kern_rndq.c:1.29	Thu Jan  8 16:13:07 2015
+++ src/sys/kern/kern_rndq.c	Wed Apr  8 02:25:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.29 2015/01/08 16:13:07 christos Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.30 2015/04/08 02:25:06 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.29 2015/01/08 16:13:07 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.30 2015/04/08 02:25:06 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -167,7 +167,7 @@ static inline uint32_t	rnd_counter(void)
 staticvoid	rnd_intr(void *);
 static	  void	rnd_wake(void *);
 static	  void	rnd_process_events(void);
-u_int32_t rnd_extract_data_locked(void *, u_int32_t, u_int32_t); /* XXX */
+static	  u_int32_t	rnd_extract_data_locked(void *, u_int32_t, u_int32_t);
 static	  void	rnd_add_data_ts(krndsource_t *, const void *const,
 	uint32_t, uint32_t, uint32_t);
 static inline void	rnd_schedule_process(void);
@@ -1175,7 +1175,7 @@ rnd_wake(void *arg)
 	rnd_wakeup_readers();
 }
 
-u_int32_t
+static u_int32_t
 rnd_extract_data_locked(void *p, u_int32_t len, u_int32_t flags)
 {
 	static int timed_in;