CVS commit: src/sys/dev/pci

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 14:56:56 UTC 2015

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

Log Message:
use copyout instead of suword.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/if_ipw.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_ipw.c
diff -u src/sys/dev/pci/if_ipw.c:1.58 src/sys/dev/pci/if_ipw.c:1.59
--- src/sys/dev/pci/if_ipw.c:1.58	Wed Jan  7 02:05:48 2015
+++ src/sys/dev/pci/if_ipw.c	Fri Nov 20 09:56:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipw.c,v 1.58 2015/01/07 07:05:48 ozaki-r Exp $	*/
+/*	$NetBSD: if_ipw.c,v 1.59 2015/11/20 14:56:56 christos Exp $	*/
 /*	FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp 	*/
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.58 2015/01/07 07:05:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.59 2015/11/20 14:56:56 christos Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -1541,7 +1541,8 @@ ipw_watchdog(struct ifnet *ifp)
 static int
 ipw_get_table1(struct ipw_softc *sc, uint32_t *tbl)
 {
-	uint32_t addr, size, i;
+	uint32_t addr, size, data, i;
+	int error;
 
 	if (!(sc->flags & IPW_FLAG_FW_INITED))
 		return ENOTTY;
@@ -1549,13 +1550,14 @@ ipw_get_table1(struct ipw_softc *sc, uin
 	CSR_WRITE_4(sc, IPW_CSR_AUTOINC_ADDR, sc->table1_base);
 
 	size = CSR_READ_4(sc, IPW_CSR_AUTOINC_DATA);
-	if (suword(tbl, size) != 0)
-		return EFAULT;
+	if ((error = copyout(, tbl, sizeof(size))) != 0)
+		return error;
 
 	for (i = 1, ++tbl; i < size; i++, tbl++) {
 		addr = CSR_READ_4(sc, IPW_CSR_AUTOINC_DATA);
-		if (suword(tbl, MEM_READ_4(sc, addr)) != 0)
-			return EFAULT;
+		data = MEM_READ_4(sc, addr);
+		if ((error = copyout(, tbl, sizeof(data))) != 0)
+			return error;
 	}
 	return 0;
 }
@@ -1563,23 +1565,20 @@ ipw_get_table1(struct ipw_softc *sc, uin
 static int
 ipw_get_radio(struct ipw_softc *sc, int *ret)
 {
-	uint32_t addr;
+	uint32_t addr, data;
 
 	if (!(sc->flags & IPW_FLAG_FW_INITED))
 		return ENOTTY;
 
 	addr = ipw_read_table1(sc, IPW_INFO_EEPROM_ADDRESS);
-	if ((MEM_READ_4(sc, addr + 32) >> 24) & 1) {
-		suword(ret, -1);
-		return 0;
-	}
-
-	if (CSR_READ_4(sc, IPW_CSR_IO) & IPW_IO_RADIO_DISABLED)
-		suword(ret, 0);
+	if ((MEM_READ_4(sc, addr + 32) >> 24) & 1)
+		data = -1;
+	else if (CSR_READ_4(sc, IPW_CSR_IO) & IPW_IO_RADIO_DISABLED)
+		data = 0;
 	else
-		suword(ret, 1);
+		data = 1;
 
-	return 0;
+	return copyout(, ret, sizeof(data));
 }
 
 static int



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

2015-11-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 20 12:49:59 UTC 2015

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

Log Message:
Rename interrupt list macros s/intr_info/intr_list/

No functional change


To generate a diff of this commit:
cvs rdiff -u -r1.264.4.55 -r1.264.4.56 src/sys/dev/usb/uhci.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/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.264.4.55 src/sys/dev/usb/uhci.c:1.264.4.56
--- src/sys/dev/usb/uhci.c:1.264.4.55	Tue Nov 10 08:44:09 2015
+++ src/sys/dev/usb/uhci.c	Fri Nov 20 12:49:59 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.264.4.55 2015/11/10 08:44:09 skrll Exp $	*/
+/*	$NetBSD: uhci.c,v 1.264.4.56 2015/11/20 12:49:59 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.55 2015/11/10 08:44:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.56 2015/11/20 12:49:59 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -385,14 +385,14 @@ const struct usbd_pipe_methods uhci_devi
 	.upm_done =	uhci_device_isoc_done,
 };
 
-#define uhci_add_intr_info(sc, ux) \
+#define uhci_add_intr_list(sc, ux) \
 	TAILQ_INSERT_TAIL(&(sc)->sc_intrhead, (ux), ux_list)
-#define uhci_del_intr_info(sc, ux) \
+#define uhci_del_intr_list(sc, ux) \
 	do { \
 		TAILQ_REMOVE(&(sc)->sc_intrhead, (ux), ux_list); \
 		(ux)->ux_list.tqe_prev = NULL; \
 	} while (0)
-#define uhci_active_intr_info(ux) ((ux)->ux_list.tqe_prev != NULL)
+#define uhci_active_intr_list(ux) ((ux)->ux_list.tqe_prev != NULL)
 
 static inline uhci_soft_qh_t *
 uhci_find_prev_qh(uhci_soft_qh_t *pqh, uhci_soft_qh_t *sqh)
@@ -2352,7 +2352,7 @@ uhci_device_bulk_start(struct usbd_xfer 
 	/* uhci_add_bulk() will do usb_syncmem(sqh) */
 
 	uhci_add_bulk(sc, sqh);
-	uhci_add_intr_info(sc, ux);
+	uhci_add_intr_list(sc, ux);
 
 	if (xfer->ux_timeout && !sc->sc_bus.ub_usepolling) {
 		callout_reset(>ux_callout, mstohz(xfer->ux_timeout),
@@ -2709,7 +2709,7 @@ uhci_device_ctrl_start(struct usbd_xfer 
 		uhci_add_ls_ctrl(sc, sqh);
 	else
 		uhci_add_hs_ctrl(sc, sqh);
-	uhci_add_intr_info(sc, uxfer);
+	uhci_add_intr_list(sc, uxfer);
 #ifdef UHCI_DEBUG
 	if (uhcidebug >= 12) {
 		uhci_soft_td_t *std;
@@ -2875,7 +2875,7 @@ uhci_device_intr_start(struct usbd_xfer 
 		sizeof(sqh->qh.qh_elink),
 		BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 	}
-	uhci_add_intr_info(sc, ux);
+	uhci_add_intr_list(sc, ux);
 	xfer->ux_status = USBD_IN_PROGRESS;
 	mutex_exit(>sc_lock);
 
@@ -3126,7 +3126,7 @@ uhci_device_isoc_start(struct usbd_xfer 
 #ifdef DIAGNOSTIC
 	ux->ux_isdone = false;
 #endif
-	uhci_add_intr_info(sc, ux);
+	uhci_add_intr_list(sc, ux);
 
 	mutex_exit(>sc_lock);
 
@@ -3339,7 +3339,7 @@ uhci_device_isoc_done(struct usbd_xfer *
 	DPRINTFN(4, "length=%d, ux_state=0x%08x",
 	xfer->ux_actlen, xfer->ux_state, 0, 0);
 
-	if (!uhci_active_intr_info(ux))
+	if (!uhci_active_intr_list(ux))
 		return;
 
 #ifdef DIAGNOSTIC
@@ -3365,7 +3365,7 @@ uhci_device_isoc_done(struct usbd_xfer *
 	sizeof(ux->ux_stdend->td.td_status),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
-	uhci_del_intr_info(sc, ux);	/* remove from active list */
+	uhci_del_intr_list(sc, ux);	/* remove from active list */
 
 	offs = 0;
 	for (i = 0; i < xfer->ux_nframes; i++) {
@@ -3443,8 +3443,8 @@ uhci_device_intr_done(struct usbd_xfer *
 		/* The ux is already on the examined list, just leave it. */
 	} else {
 		DPRINTFN(5, "removing", 0, 0, 0, 0);
-		if (uhci_active_intr_info(ux))
-			uhci_del_intr_info(sc, ux);
+		if (uhci_active_intr_list(ux))
+			uhci_del_intr_list(sc, ux);
 	}
 }
 
@@ -3464,10 +3464,10 @@ uhci_device_ctrl_done(struct usbd_xfer *
 
 	KASSERT(xfer->ux_rqflags & URQ_REQUEST);
 
-	if (!uhci_active_intr_info(ux))
+	if (!uhci_active_intr_list(ux))
 		return;
 
-	uhci_del_intr_info(sc, ux);	/* remove from active list */
+	uhci_del_intr_list(sc, ux);	/* remove from active list */
 
 	if (upipe->pipe.up_dev->ud_speed == USB_SPEED_LOW)
 		uhci_remove_ls_ctrl(sc, upipe->ctrl.sqh);
@@ -3501,10 +3501,10 @@ uhci_device_bulk_done(struct usbd_xfer *
 
 	KASSERT(mutex_owned(>sc_lock));
 
-	if (!uhci_active_intr_info(ux))
+	if (!uhci_active_intr_list(ux))
 		return;
 
-	uhci_del_intr_info(sc, ux);	/* remove from active list */
+	uhci_del_intr_list(sc, ux);	/* remove from active list */
 
 	uhci_remove_bulk(sc, upipe->bulk.sqh);
 



CVS commit: src/sys/arch/amd64/amd64

2015-11-20 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Nov 20 11:58:00 UTC 2015

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf locore.S

Log Message:
A few changes:
 - remove cpu_id and cpu_brand_id (unused)
 - copy a comment from i386 about fillkpt
 - define PDE_SIZE (i386)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/amd64/amd64/locore.S

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/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.59 src/sys/arch/amd64/amd64/genassym.cf:1.60
--- src/sys/arch/amd64/amd64/genassym.cf:1.59	Wed Aug 26 03:00:53 2015
+++ src/sys/arch/amd64/amd64/genassym.cf	Fri Nov 20 11:58:00 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.59 2015/08/26 03:00:53 uebayasi Exp $
+#	$NetBSD: genassym.cf,v 1.60 2015/11/20 11:58:00 maxv Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -145,6 +145,8 @@ define	L1_SLOT_KERNBASE	pl1_pi(KERNBASE)
 
 define	PDIR_SLOT_PTE		PDIR_SLOT_PTE
 
+define	PDE_SIZE		sizeof(pd_entry_t)
+
 define	VM_MAXUSER_ADDRESS	(unsigned long long)VM_MAXUSER_ADDRESS
 
 define	L_PCB			offsetof(struct lwp, l_addr)

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.79 src/sys/arch/amd64/amd64/locore.S:1.80
--- src/sys/arch/amd64/amd64/locore.S:1.79	Sat Nov 14 14:01:23 2015
+++ src/sys/arch/amd64/amd64/locore.S	Fri Nov 20 11:58:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.79 2015/11/14 14:01:23 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.80 2015/11/20 11:58:00 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -247,9 +247,7 @@ _C_LABEL(lapic_isr):
 END(lapic_isr)
 #endif
 
-	.globl	_C_LABEL(cpu_id)
 	.globl	_C_LABEL(cpu_vendorname)
-	.globl	_C_LABEL(cpu_brand_id)
 	.globl	_C_LABEL(cpuid_level)
 	.globl	_C_LABEL(esym)
 	.globl	_C_LABEL(eblob)
@@ -265,9 +263,6 @@ END(lapic_isr)
 	.type	_C_LABEL(cputype), @object
 LABEL(cputype)		.long	0	# are we 80486, Pentium, or..
 END(cputype)
-	.type	_C_LABEL(cpu_id), @object
-LABEL(cpu_id)		.long	0	# saved from `cpuid' instruction
-END(cpu_id)
 	.type	_C_LABEL(cpuid_level), @object
 LABEL(cpuid_level)	.long	-1	# max. level accepted by 'cpuid'
 	#   instruction
@@ -276,9 +271,6 @@ END(cpuid_level)
 LABEL(cpu_vendorname)	.space	16	# vendor string returned by `cpuid'
 	#   instruction
 END(cpu_vendorname)
-	.type	_C_LABEL(cpu_brand_id), @object
-LABEL(cpu_brand_id)	.long	0	# brand ID from 'cpuid' instruction
-END(cpu_brand_id)
 	.type	_C_LABEL(esym), @object
 LABEL(esym)		.quad	0	# ptr to end of syms
 END(esym)
@@ -460,14 +452,6 @@ ENTRY(start)
 	movl	%ecx,8(%ebp)
 	movl	$0, 12(%ebp)
 
-	movl	$1,%eax
-	cpuid
-	movl	%eax,RELOC(cpu_id)
-
-	/* Brand ID is bits 0-7 of %ebx */
-	andl	$255,%ebx
-	movl	%ebx,RELOC(cpu_brand_id)
-
 	/*
 	 * Finished with old stack; load new %esp now instead of later so we
 	 * can trace this code without having to worry about the trace trap
@@ -511,10 +495,19 @@ ENTRY(start)
   ((NKL4_KIMG_ENTRIES + TABLE_L3_ENTRIES + TABLE_L2_ENTRIES + 1 + UPAGES) \
 * PAGE_SIZE)
 
+/*
+ * fillkpt - Fill in a kernel page table
+ *	eax = pte (page frame | control | status)
+ *	ebx = page table address
+ *	ecx = number of pages to map
+ *
+ * Each entry is 8 (PDE_SIZE) bytes long: we must set the 4 upper bytes to 0.
+ */
+
 #define fillkpt	\
 1:	movl	%eax,(%ebx)		; 	/* store phys addr */	\
-	movl	$0,4(%ebx)		; 	/* upper 32 bits 0 */	\
-	addl	$8,%ebx			; 	/* next pte/pde */	\
+	movl	$0,(PDE_SIZE-4)(%ebx)	; 	/* upper 32 bits 0 */	\
+	addl	$PDE_SIZE,%ebx		; 	/* next pte/pde */	\
 	addl	$PAGE_SIZE,%eax		; 	/* next phys page */	\
 	loop	1b			;
 
@@ -567,7 +560,7 @@ ENTRY(start)
 	 */
 	movl	$(KERNTEXTOFF_LO - KERNBASE_LO),%eax
 	movl	%eax,%ecx
-	shrl	$(PGSHIFT-3),%ecx	/* ((n >> PGSHIFT) << 3) for # pdes */
+	shrl	$(PGSHIFT-3),%ecx	/* ((n >> PGSHIFT) << 3) for # PDEs */
 	addl	%ecx,%ebx
 
 	/* Map the kernel text read-only. */
@@ -580,14 +573,14 @@ ENTRY(start)
 	/* Map the data, BSS, and bootstrap tables read-write. */
 	leal	(PG_V|PG_KW)(%edx),%eax
 	movl	$TABLESIZE,%ecx
-	addl	%esi,%ecx# end of tables
-	subl	%edx,%ecx# subtract end of text
+	addl	%esi,%ecx		/* end of tables */
+	subl	%edx,%ecx		/* subtract end of text */
 	shrl	$PGSHIFT,%ecx
 	fillkpt
 
 	/* Map ISA I/O mem (later atdevbase) */
-	movl	$(IOM_BEGIN|PG_V|PG_KW/*|PG_N*/),%eax	# having these bits set
-	movl	$(IOM_SIZE>>PGSHIFT),%ecx		# for this many pte s,
+	movl	$(IOM_BEGIN|PG_V|PG_KW/*|PG_N*/),%eax
+	movl	$(IOM_SIZE>>PGSHIFT),%ecx
 	fillkpt
 
 /*



CVS commit: src/share/man/man4

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 17:02:59 UTC 2015

Modified Files:
src/share/man/man4: vlan.4 xennet.4

Log Message:
cross reference bridge; mention VLAN tagging.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/vlan.4
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/xennet.4

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/man4/vlan.4
diff -u src/share/man/man4/vlan.4:1.33 src/share/man/man4/vlan.4:1.34
--- src/share/man/man4/vlan.4:1.33	Tue Oct 27 04:46:13 2015
+++ src/share/man/man4/vlan.4	Fri Nov 20 12:02:58 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vlan.4,v 1.33 2015/10/27 08:46:13 wiz Exp $
+.\"	$NetBSD: vlan.4,v 1.34 2015/11/20 17:02:58 christos Exp $
 .\"
 .\" Copyright (c) 2000, 2015 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 October 26, 2015
+.Dd November 20, 2015
 .Dt VLAN 4
 .Os
 .Sh NAME
@@ -226,6 +226,7 @@ create
 vlan 6 vlanif tlp0
 .Ed
 .Sh SEE ALSO
+.Xr bridge 4 ,
 .Xr ifconfig 8
 .Sh HISTORY
 The

Index: src/share/man/man4/xennet.4
diff -u src/share/man/man4/xennet.4:1.3 src/share/man/man4/xennet.4:1.4
--- src/share/man/man4/xennet.4:1.3	Tue Mar 18 14:20:39 2014
+++ src/share/man/man4/xennet.4	Fri Nov 20 12:02:58 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: xennet.4,v 1.3 2014/03/18 18:20:39 riastradh Exp $
+.\"	$NetBSD: xennet.4,v 1.4 2015/11/20 17:02:58 christos Exp $
 .\"
 .\" Copyright (c) 2011 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 8, 2011
+.Dd November 20, 2015
 .Dt XENNET 4 xen
 .Os
 .Sh NAME
@@ -61,6 +61,9 @@ entries.
 .Pp
 Conceptually, frontends and backends drivers are
 similar to two Ethernet cards connected via a crossover cable.
+.Pp
+.Nm xennet
+interfaces can pass VLAN tagged packets.
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "xennet%d: can't read mac address, err %d"
@@ -86,6 +89,7 @@ and its associated endpoint use flip mod
 are passed by remapping memory pages between domains.
 .El
 .Sh SEE ALSO
+.Xr bridge 4 ,
 .Xr ifmedia 4 ,
 .Xr xenbus 4 ,
 .Xr xvif 4 ,



CVS commit: src/share/man/man4

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 17:00:48 UTC 2015

Modified Files:
src/share/man/man4: bridge.4

Log Message:
mention VLAN change.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/bridge.4

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/man4/bridge.4
diff -u src/share/man/man4/bridge.4:1.9 src/share/man/man4/bridge.4:1.10
--- src/share/man/man4/bridge.4:1.9	Sat Jan  9 04:44:29 2010
+++ src/share/man/man4/bridge.4	Fri Nov 20 12:00:48 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bridge.4,v 1.9 2010/01/09 09:44:29 mbalmer Exp $
+.\"	$NetBSD: bridge.4,v 1.10 2015/11/20 17:00:48 christos Exp $
 .\"
 .\" Copyright 2001 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 9, 2010
+.Dd November 20, 2015
 .Dt BRIDGE 4
 .Os
 .Sh NAME
@@ -93,9 +93,17 @@ enabled.
 Note that packets to and from the bridging host will be seen by the
 filter on the interface with the appropriate address configured as well
 as on the interface on which the packet arrives or departs.
+.Pp
+The
+.Nm
+will enable passing of VLAN tagged packets automatically if the underlying
+interfaces support it.
+This is to facilitate XEN network configurations with
+.Xr xennet 4 .
 .Sh SEE ALSO
 .Xr etherip 4 ,
 .Xr options 4 ,
+.Xr xennet 4 ,
 .Xr brconfig 8 ,
 .Xr ipf 8
 .Sh HISTORY



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

2015-11-20 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Nov 20 16:44:23 UTC 2015

Modified Files:
src/sys/arch/evbarm/tegra: tegra_machdep.c

Log Message:
Fix up tegrausbphy attach args and stuff from previous.

>From jmcneill.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/tegra/tegra_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/tegra/tegra_machdep.c
diff -u src/sys/arch/evbarm/tegra/tegra_machdep.c:1.31 src/sys/arch/evbarm/tegra/tegra_machdep.c:1.32
--- src/sys/arch/evbarm/tegra/tegra_machdep.c:1.31	Thu Nov 19 22:09:16 2015
+++ src/sys/arch/evbarm/tegra/tegra_machdep.c	Fri Nov 20 16:44:23 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_machdep.c,v 1.31 2015/11/19 22:09:16 jmcneill Exp $ */
+/* $NetBSD: tegra_machdep.c,v 1.32 2015/11/20 16:44:23 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.31 2015/11/19 22:09:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.32 2015/11/20 16:44:23 jakllsch Exp $");
 
 #include "opt_tegra.h"
 #include "opt_machdep.h"
@@ -475,12 +475,11 @@ tegra_device_register(device_t self, voi
 	}
 
 	if (device_is_a(self, "tegrausbphy")) {
-		struct tegraio_attach_args * const tio = aux;
-		const struct tegra_locators * const loc = >tio_loc;
+		struct tegrausbphy_attach_args * const tup = aux;
 
-		if (loc->loc_port == 0) {
+		if (tup->tup_port == 0) {
 			prop_dictionary_set_cstring(dict, "vbus-gpio", "N4");
-		} else if (loc->loc_port == 2) {
+		} else if (tup->tup_port == 2) {
 			prop_dictionary_set_cstring(dict, "vbus-gpio", "N5");
 		}
 	}
@@ -506,12 +505,11 @@ tegra_device_register(device_t self, voi
 	}
 
 	if (device_is_a(self, "tegrausbphy")) {
-		struct tegraio_attach_args * const tio = aux;
-		const struct tegra_locators * const loc = >tio_loc;
+		struct tegrausbphy_attach_args * const tup = aux;
 
-		if (loc->loc_port == 0) {
+		if (tup->tup_port == 0) {
 			prop_dictionary_set_cstring(dict, "vbus-gpio", "N4");
-		} else if (loc->loc_port == 2) {
+		} else if (tup->tup_port == 2) {
 			prop_dictionary_set_cstring(dict, "vbus-gpio", "N5");
 		}
 	}



CVS commit: src/sys/kern

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 18:34:17 UTC 2015

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

Log Message:
get rid of the suword {m,j}umbo and check return of copyout.


To generate a diff of this commit:
cvs rdiff -u -r1.473 -r1.474 src/sys/kern/init_main.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/init_main.c
diff -u src/sys/kern/init_main.c:1.473 src/sys/kern/init_main.c:1.474
--- src/sys/kern/init_main.c:1.473	Thu Nov  5 21:26:42 2015
+++ src/sys/kern/init_main.c	Fri Nov 20 13:34:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.473 2015/11/06 02:26:42 pgoyette Exp $	*/
+/*	$NetBSD: init_main.c,v 1.474 2015/11/20 18:34:17 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.473 2015/11/06 02:26:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.474 2015/11/20 18:34:17 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -909,7 +909,7 @@ start_init(void *arg)
 	register_t retval[2];
 	char flags[4], *flagsp;
 	const char *path, *slash;
-	char *ucp, **uap, *arg0, *arg1 = NULL;
+	char *ucp, **uap, *arg0, *arg1, *argv[3];
 	char ipath[129];
 	int ipx, len;
 
@@ -1015,8 +1015,10 @@ start_init(void *arg)
 #endif
 			arg1 = STACK_ALLOC(ucp, i);
 			ucp = STACK_MAX(arg1, i);
-			(void)copyout((void *)flags, arg1, i);
-		}
+			if ((error = copyout((void *)flags, arg1, i)) != 0)
+goto copyerr;
+		} else
+			arg1 = NULL;
 
 		/*
 		 * Move out the file name (also arg 0).
@@ -1030,7 +1032,8 @@ start_init(void *arg)
 #endif
 		arg0 = STACK_ALLOC(ucp, i);
 		ucp = STACK_MAX(arg0, i);
-		(void)copyout(path, arg0, i);
+		if ((error = copyout(path, arg0, i)) != 0)
+			goto copyerr;
 
 		/*
 		 * Move out the arg pointers.
@@ -1041,14 +1044,12 @@ start_init(void *arg)
 		SCARG(, argp) = uap;
 		SCARG(, envp) = NULL;
 		slash = strrchr(path, '/');
-		if (slash)
-			(void)suword((void *)uap++,
-			(long)arg0 + (slash + 1 - path));
-		else
-			(void)suword((void *)uap++, (long)arg0);
-		if (options != 0)
-			(void)suword((void *)uap++, (long)arg1);
-		(void)suword((void *)uap++, 0);	/* terminator */
+
+		argv[0] = slash ? arg0 + (slash + 1 - path) : arg0;
+		argv[1] = arg1;
+		argv[2] = NULL;
+		if ((error = copyout(argv, uap, sizeof(args))) != 0)
+			goto copyerr;
 
 		/*
 		 * Now try to exec the program.  If can't for any reason
@@ -1063,6 +1064,8 @@ start_init(void *arg)
 	}
 	printf("init: not found\n");
 	panic("no init");
+copyerr:
+	panic("copyout %d", error);
 }
 
 /*



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

2015-11-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Nov 20 18:32:13 UTC 2015

Modified Files:
src/sys/arch/arm/allwinner: awin_tcon.c

Log Message:
Turn off more bits when turning off the display. Saves about 50ma on the
5V supply.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/allwinner/awin_tcon.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/allwinner/awin_tcon.c
diff -u src/sys/arch/arm/allwinner/awin_tcon.c:1.10 src/sys/arch/arm/allwinner/awin_tcon.c:1.11
--- src/sys/arch/arm/allwinner/awin_tcon.c:1.10	Thu Nov 19 18:48:22 2015
+++ src/sys/arch/arm/allwinner/awin_tcon.c	Fri Nov 20 18:32:13 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_tcon.c,v 1.10 2015/11/19 18:48:22 bouyer Exp $ */
+/* $NetBSD: awin_tcon.c,v 1.11 2015/11/20 18:32:13 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_allwinner.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awin_tcon.c,v 1.10 2015/11/19 18:48:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_tcon.c,v 1.11 2015/11/20 18:32:13 bouyer Exp $");
 
 #include 
 #include 
@@ -555,13 +555,29 @@ awin_tcon0_enable(struct awin_tcon_softc
 
 	awin_debe_enable(device_unit(sc->sc_dev), enable);
 	delay(2);
-	val = TCON_READ(sc, AWIN_TCON_GCTL_REG);
 	if (enable) {
+		val = TCON_READ(sc, AWIN_TCON_GCTL_REG);
 		val |= AWIN_TCON_GCTL_EN;
+		TCON_WRITE(sc, AWIN_TCON_GCTL_REG, val);
+		val = TCON_READ(sc, AWIN_TCON0_CTL_REG);
+		val |= AWIN_TCONx_CTL_EN;
+		TCON_WRITE(sc, AWIN_TCON0_CTL_REG, val);
+		val = TCON_READ(sc, AWIN_TCON0_LVDS_IF_REG);
+		val |= AWIN_TCON0_LVDS_IF_EN;
+		TCON_WRITE(sc, AWIN_TCON0_LVDS_IF_REG, val);
+		TCON_WRITE(sc, AWIN_TCON0_IO_TRI_REG, 0);
 	} else {
+		TCON_WRITE(sc, AWIN_TCON0_IO_TRI_REG, 0x);
+		val = TCON_READ(sc, AWIN_TCON0_LVDS_IF_REG);
+		val &= ~AWIN_TCON0_LVDS_IF_EN;
+		TCON_WRITE(sc, AWIN_TCON0_LVDS_IF_REG, val);
+		val = TCON_READ(sc, AWIN_TCON0_CTL_REG);
+		val &= ~AWIN_TCONx_CTL_EN;
+		TCON_WRITE(sc, AWIN_TCON0_CTL_REG, val);
+		val = TCON_READ(sc, AWIN_TCON_GCTL_REG);
 		val &= ~AWIN_TCON_GCTL_EN;
+		TCON_WRITE(sc, AWIN_TCON_GCTL_REG, val);
 	}
-	TCON_WRITE(sc, AWIN_TCON_GCTL_REG, val);
 }
 
 void
@@ -581,15 +597,23 @@ awin_tcon1_enable(int unit, bool enable)
 
 	awin_debe_enable(device_unit(sc->sc_dev), enable);
 	delay(2);
-	val = TCON_READ(sc, AWIN_TCON_GCTL_REG);
 	if (enable) {
+		val = TCON_READ(sc, AWIN_TCON_GCTL_REG);
 		val |= AWIN_TCON_GCTL_EN;
+		TCON_WRITE(sc, AWIN_TCON_GCTL_REG, val);
+		val = TCON_READ(sc, AWIN_TCON1_CTL_REG);
+		val |= AWIN_TCONx_CTL_EN;
+		TCON_WRITE(sc, AWIN_TCON1_CTL_REG, val);
+		TCON_WRITE(sc, AWIN_TCON1_IO_TRI_REG, 0);
 	} else {
+		TCON_WRITE(sc, AWIN_TCON1_IO_TRI_REG, 0x);
+		val = TCON_READ(sc, AWIN_TCON1_CTL_REG);
+		val &= ~AWIN_TCONx_CTL_EN;
+		TCON_WRITE(sc, AWIN_TCON1_CTL_REG, val);
+		val = TCON_READ(sc, AWIN_TCON_GCTL_REG);
 		val &= ~AWIN_TCON_GCTL_EN;
+		TCON_WRITE(sc, AWIN_TCON_GCTL_REG, val);
 	}
-	TCON_WRITE(sc, AWIN_TCON_GCTL_REG, val);
-
-	TCON_WRITE(sc, AWIN_TCON1_IO_TRI_REG, 0);
 
 	KASSERT(tcon_mux_inited);
 	val = bus_space_read_4(sc->sc_bst, tcon_mux_bsh, 0);



CVS commit: src/share/man/man3

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 20:41:58 UTC 2015

Modified Files:
src/share/man/man3: bitstring.3

Log Message:
reflect reality.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man3/bitstring.3

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/man3/bitstring.3
diff -u src/share/man/man3/bitstring.3:1.15 src/share/man/man3/bitstring.3:1.16
--- src/share/man/man3/bitstring.3:1.15	Tue Dec  4 13:02:48 2012
+++ src/share/man/man3/bitstring.3	Fri Nov 20 15:41:58 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bitstring.3,v 1.15 2012/12/04 18:02:48 christos Exp $
+.\"	$NetBSD: bitstring.3,v 1.16 2015/11/20 20:41:58 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -31,7 +31,7 @@
 .\"
 .\" @(#)bitstring.3	8.1 (Berkeley) 7/19/93
 .\"
-.Dd December 4, 2012
+.Dd November 20, 2015
 .Dt BITSTRING 3
 .Os
 .Sh NAME
@@ -49,23 +49,24 @@
 .Sh SYNOPSIS
 .In bitstring.h
 .Ft bitstr_t *
-.Fn bit_alloc "int nbits"
-.Fn bit_clear "bit_str name" "int bit"
-.Fn bit_decl "bit_str name" "int nbits"
-.Fn bit_ffc "bit_str name" "int nbits" "int *value"
-.Fn bit_ffs "bit_str name" "int nbits" "int *value"
-.Fn bit_nclear "bit_str name" "int start" "int stop"
-.Fn bit_nset "bit_str name" "int start" "int stop"
-.Fn bit_set "bit_str name" "int bit"
-.Fn bitstr_size "int nbits"
-.Fn bit_test "bit_str name" "int bit"
+.Fn bit_decl "bitstr_t *name" "size_t nbits"
+.Ft bitstr_t *
+.Fn bit_alloc "size_t nbits"
+.Fn bit_clear "bitstr_t *name" "size_t bit"
+.Fn bit_ffc "const bitstr_t *name" "size_t nbits" "int *value"
+.Fn bit_ffs "const bitstr_t *name" "size_t nbits" "int *value"
+.Fn bit_nclear "bitstr_t *name" "size_t start" "size_t stop"
+.Fn bit_nset "bitstr_t *name" "size_t start" "size_t stop"
+.Fn bit_set "bitstr_t *name" "size_t bit"
+.Fn bitstr_size "size_t nbits"
+.Fn bit_test "const bitstr_t *name" "size_t bit"
 .Sh DESCRIPTION
 These macros operate on strings of bits.
 .Pp
 The macro
 .Fn bit_alloc
 returns a pointer of type
-.Dq Fa "bitstr_t *"
+.Dq Fa "bitstr_t"
 to sufficient space to store
 .Fa nbits
 bits, or
@@ -157,7 +158,8 @@ have side effects.
 #define	LPR_AVAILABLE_BIT	9
 #define	LPR_MAX_BITS		10
 
-make_lpr_available()
+void
+make_lpr_available(void)
 {
 	bitstr_t bit_decl(bitlist, LPR_MAX_BITS);
 	...
@@ -172,7 +174,7 @@ make_lpr_available()
 .Ed
 .Sh SEE ALSO
 .Xr bitmap 3 ,
-.Xr malloc 3 ,
+.Xr calloc 3 ,
 .Xr setbit 9
 .Sh HISTORY
 The



CVS commit: src/sys/dev/sbus

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 19:09:23 UTC 2015

Modified Files:
src/sys/dev/sbus: zx.c

Log Message:
kill subyte.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/sbus/zx.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/sbus/zx.c
diff -u src/sys/dev/sbus/zx.c:1.39 src/sys/dev/sbus/zx.c:1.40
--- src/sys/dev/sbus/zx.c:1.39	Wed Jan 11 11:08:57 2012
+++ src/sys/dev/sbus/zx.c	Fri Nov 20 14:09:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: zx.c,v 1.39 2012/01/11 16:08:57 macallan Exp $	*/
+/*	$NetBSD: zx.c,v 1.40 2015/11/20 19:09:23 christos Exp $	*/
 
 /*
  *  Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.39 2012/01/11 16:08:57 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.40 2015/11/20 19:09:23 christos Exp $");
 
 #include 
 #include 
@@ -388,7 +388,7 @@ zxioctl(dev_t dev, u_long cmd, void *dat
 	struct fbcmap *cm;
 	struct fbcursor *cu;
 	uint32_t curbits[2][32];
-	int rv, v, count, i;
+	int rv, v, count, i, error;
 
 	sc = device_lookup_private(_cd, minor(dev));
 
@@ -537,20 +537,23 @@ zxioctl(dev_t dev, u_long cmd, void *dat
 return (rv);
 		}
 		if (cu->cmap.red != NULL) {
-			if (cu->cmap.index > 2 ||
-			cu->cmap.count > 2 - cu->cmap.index)
-return (EINVAL);
-			for (i = 0; i < cu->cmap.count; i++) {
-v = sc->sc_curcmap[i + cu->cmap.index + 0];
-if (subyte(>cmap.red[i], v))
-	return (EFAULT);
-v = sc->sc_curcmap[i + cu->cmap.index + 2];
-if (subyte(>cmap.green[i], v))
-	return (EFAULT);
-v = sc->sc_curcmap[i + cu->cmap.index + 4];
-if (subyte(>cmap.blue[i], v))
-	return (EFAULT);
+			uint8_t red[2], green[2], blue[2];
+			const uint8_t *ccm = sc->sc_curcmap;
+			cm = >cmap;
+
+			if (cm->index > 2 || cm->count > 2 - cm->index)
+return EINVAL;
+
+			for (i = 0; i < cm->count; i++) {
+red[i] = ccm[i + cm->index + 0];
+green[i] = ccm[i + cm->index + 2];
+blue[i] = ccm[i + cm->index + 4];
 			}
+
+			if ((error = copyout(red, cm->red, cm->count)) ||
+			(error = copyout(green, cm->green, cm->count)) ||
+			(error = copyout(blue, cm->blue, cm->count)))
+return error;
 		} else {
 			cu->cmap.index = 0;
 			cu->cmap.count = 2;



CVS commit: src/include

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 20:27:20 UTC 2015

Modified Files:
src/include: bitstring.h

Log Message:
keep value as an int.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/include/bitstring.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/bitstring.h
diff -u src/include/bitstring.h:1.10 src/include/bitstring.h:1.11
--- src/include/bitstring.h:1.10	Fri Nov 20 15:24:49 2015
+++ src/include/bitstring.h	Fri Nov 20 15:27:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bitstring.h,v 1.10 2015/11/20 20:24:49 christos Exp $	*/
+/*	$NetBSD: bitstring.h,v 1.11 2015/11/20 20:27:20 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -110,7 +110,8 @@ typedef	unsigned char bitstr_t;
 /* find first bit clear in name */
 #define	bit_ffc(name, nbits, value) do { \
 	bitstr_t *_name = name; \
-	size_t _bit, _nbits = nbits, _value = -1; \
+	size_t _bit, _nbits = nbits; \
+	int _value = -1; \
 	for (_bit = 0; _bit < _nbits; ++_bit) \
 		if (!bit_test(_name, _bit)) { \
 			_value = _bit; \
@@ -122,7 +123,8 @@ typedef	unsigned char bitstr_t;
 /* find first bit set in name */
 #define	bit_ffs(name, nbits, value) do { \
 	bitstr_t *_name = name; \
-	size_t _bit, _nbits = nbits, _value = -1; \
+	size_t _bit, _nbits = nbits; \
+	int _value = -1; \
 	for (_bit = 0; _bit < _nbits; ++_bit) \
 		if (bit_test(_name, _bit)) { \
 			_value = _bit; \



CVS commit: src/include

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 20:24:50 UTC 2015

Modified Files:
src/include: bitstring.h

Log Message:
update to size_t


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/include/bitstring.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/bitstring.h
diff -u src/include/bitstring.h:1.9 src/include/bitstring.h:1.10
--- src/include/bitstring.h:1.9	Thu May  6 14:54:22 2010
+++ src/include/bitstring.h	Fri Nov 20 15:24:49 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bitstring.h,v 1.9 2010/05/06 18:54:22 christos Exp $	*/
+/*	$NetBSD: bitstring.h,v 1.10 2015/11/20 20:24:49 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -90,7 +90,7 @@ typedef	unsigned char bitstr_t;
 /* clear bits start ... stop in bitstring */
 #define	bit_nclear(name, start, stop) do { \
 	bitstr_t *_name = name; \
-	int _start = start, _stop = stop; \
+	size_t _start = start, _stop = stop; \
 	while (_start <= _stop) { \
 		bit_clear(_name, _start); \
 		_start++; \
@@ -100,7 +100,7 @@ typedef	unsigned char bitstr_t;
 /* set bits start ... stop in bitstring */
 #define	bit_nset(name, start, stop) do { \
 	bitstr_t *_name = name; \
-	int _start = start, _stop = stop; \
+	size_t _start = start, _stop = stop; \
 	while (_start <= _stop) { \
 		bit_set(_name, _start); \
 		_start++; \
@@ -110,7 +110,7 @@ typedef	unsigned char bitstr_t;
 /* find first bit clear in name */
 #define	bit_ffc(name, nbits, value) do { \
 	bitstr_t *_name = name; \
-	int _bit, _nbits = nbits, _value = -1; \
+	size_t _bit, _nbits = nbits, _value = -1; \
 	for (_bit = 0; _bit < _nbits; ++_bit) \
 		if (!bit_test(_name, _bit)) { \
 			_value = _bit; \
@@ -122,7 +122,7 @@ typedef	unsigned char bitstr_t;
 /* find first bit set in name */
 #define	bit_ffs(name, nbits, value) do { \
 	bitstr_t *_name = name; \
-	int _bit, _nbits = nbits, _value = -1; \
+	size_t _bit, _nbits = nbits, _value = -1; \
 	for (_bit = 0; _bit < _nbits; ++_bit) \
 		if (bit_test(_name, _bit)) { \
 			_value = _bit; \



CVS commit: src/include

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 20:37:08 UTC 2015

Modified Files:
src/include: bitstring.h

Log Message:
add some const


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/include/bitstring.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/bitstring.h
diff -u src/include/bitstring.h:1.11 src/include/bitstring.h:1.12
--- src/include/bitstring.h:1.11	Fri Nov 20 15:27:20 2015
+++ src/include/bitstring.h	Fri Nov 20 15:37:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bitstring.h,v 1.11 2015/11/20 20:27:20 christos Exp $	*/
+/*	$NetBSD: bitstring.h,v 1.12 2015/11/20 20:37:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -109,7 +109,7 @@ typedef	unsigned char bitstr_t;
 
 /* find first bit clear in name */
 #define	bit_ffc(name, nbits, value) do { \
-	bitstr_t *_name = name; \
+	const bitstr_t *_name = name; \
 	size_t _bit, _nbits = nbits; \
 	int _value = -1; \
 	for (_bit = 0; _bit < _nbits; ++_bit) \
@@ -122,7 +122,7 @@ typedef	unsigned char bitstr_t;
 
 /* find first bit set in name */
 #define	bit_ffs(name, nbits, value) do { \
-	bitstr_t *_name = name; \
+	const bitstr_t *_name = name; \
 	size_t _bit, _nbits = nbits; \
 	int _value = -1; \
 	for (_bit = 0; _bit < _nbits; ++_bit) \



CVS commit: src/share/man/man4

2015-11-20 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Nov 21 00:35:59 UTC 2015

Modified Files:
src/share/man/man4: filemon.4

Log Message:
Fix sample code fragment


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/filemon.4

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/man4/filemon.4
diff -u src/share/man/man4/filemon.4:1.10 src/share/man/man4/filemon.4:1.11
--- src/share/man/man4/filemon.4:1.10	Fri Nov 20 03:13:35 2015
+++ src/share/man/man4/filemon.4	Sat Nov 21 00:35:59 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: filemon.4,v 1.10 2015/11/20 03:13:35 pgoyette Exp $
+.\"	$NetBSD: filemon.4,v 1.11 2015/11/21 00:35:59 pgoyette Exp $
 .\"
 .\" Copyright (c) 2011, Juniper Networks, Inc.
 .\"
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 .\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 20, 2015
+.Dd November 21, 2015
 .Dt FILEMON 4
 .Os
 .Sh NAME
@@ -161,7 +161,7 @@ The following example demonstrates the b
 #include 
 
 pid_d pid;
-int fd, tfd;
+int filemon_fd, temp_fd;
 int status;
 
 filemon_fd = open("/dev/filemon", O_RDWR);



CVS commit: src/share/man/man4

2015-11-20 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Nov 21 00:50:15 UTC 2015

Modified Files:
src/share/man/man4: filemon.4

Log Message:
Fix typo in sample program


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man4/filemon.4

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/man4/filemon.4
diff -u src/share/man/man4/filemon.4:1.11 src/share/man/man4/filemon.4:1.12
--- src/share/man/man4/filemon.4:1.11	Sat Nov 21 00:35:59 2015
+++ src/share/man/man4/filemon.4	Sat Nov 21 00:50:15 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: filemon.4,v 1.11 2015/11/21 00:35:59 pgoyette Exp $
+.\"	$NetBSD: filemon.4,v 1.12 2015/11/21 00:50:15 pgoyette Exp $
 .\"
 .\" Copyright (c) 2011, Juniper Networks, Inc.
 .\"
@@ -160,7 +160,7 @@ The following example demonstrates the b
 .Bd -literal -offset indent
 #include 
 
-pid_d pid;
+pid_t pid;
 int filemon_fd, temp_fd;
 int status;
 



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

2015-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov 21 00:54:57 UTC 2015

Modified Files:
src/sys/arch/arm/amlogic: amlogic_board.c amlogic_io.c amlogic_var.h

Log Message:
Add watchdog timer support.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/amlogic/amlogic_board.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/amlogic/amlogic_io.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/amlogic/amlogic_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/arch/arm/amlogic/amlogic_board.c
diff -u src/sys/arch/arm/amlogic/amlogic_board.c:1.14 src/sys/arch/arm/amlogic/amlogic_board.c:1.15
--- src/sys/arch/arm/amlogic/amlogic_board.c:1.14	Sat Aug  8 10:51:40 2015
+++ src/sys/arch/arm/amlogic/amlogic_board.c	Sat Nov 21 00:54:57 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_board.c,v 1.14 2015/08/08 10:51:40 jmcneill Exp $ */
+/* $NetBSD: amlogic_board.c,v 1.15 2015/11/21 00:54:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,13 +29,16 @@
 #include "opt_amlogic.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amlogic_board.c,v 1.14 2015/08/08 10:51:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_board.c,v 1.15 2015/11/21 00:54:57 jmcneill Exp $");
 
 #define	_ARM32_BUS_DMA_PRIVATE
 #include 
 #include 
 #include 
 #include 
+#include 
+
+#include 
 
 #include 
 
@@ -46,8 +49,22 @@ __KERNEL_RCSID(0, "$NetBSD: amlogic_boar
 #include 
 #include 
 
+#define AMLOGIC_EE_WDOG_PERIOD_DEFAULT	8
+#define AMLOGIC_EE_WDOG_PERIOD_MAX	8
+#define AMLOGIC_EE_WDOG_TICKS_PER_SEC	7812
+
 bus_space_handle_t amlogic_core_bsh;
 
+static int	amlogic_ee_wdog_setmode(struct sysmon_wdog *);
+static int	amlogic_ee_wdog_tickle(struct sysmon_wdog *);
+
+static struct sysmon_wdog amlogic_ee_wdog = {
+	.smw_name = "EE-watchdog",
+	.smw_setmode = amlogic_ee_wdog_setmode,
+	.smw_tickle = amlogic_ee_wdog_tickle,
+	.smw_period = AMLOGIC_EE_WDOG_PERIOD_DEFAULT
+};
+
 struct arm32_bus_dma_tag amlogic_dma_tag = {
 	_BUS_DMAMAP_FUNCS,
 	_BUS_DMAMEM_FUNCS,
@@ -223,6 +240,44 @@ amlogic_rng_init(void)
 }
 
 void
+amlogic_wdog_init(void)
+{
+	sysmon_wdog_register(_ee_wdog);
+}
+
+static int
+amlogic_ee_wdog_setmode(struct sysmon_wdog *smw)
+{
+	if ((smw->smw_mode & WDOG_MODE_MASK) == WDOG_MODE_DISARMED) {
+		CBUS_WRITE(WATCHDOG_RESET_REG, 0);
+		CBUS_SET_CLEAR(WATCHDOG_TC_REG, 0, WATCHDOG_TC_ENABLE);
+		return 0;
+	}
+
+	if (smw->smw_period == WDOG_PERIOD_DEFAULT) {
+		amlogic_ee_wdog.smw_period = AMLOGIC_EE_WDOG_PERIOD_DEFAULT;
+	} else if (smw->smw_period == 0 ||
+		   smw->smw_period > AMLOGIC_EE_WDOG_PERIOD_MAX) {
+		return EINVAL;
+	} else {
+		amlogic_ee_wdog.smw_period = smw->smw_period;
+	}
+	u_int tcnt = amlogic_ee_wdog.smw_period * AMLOGIC_EE_WDOG_TICKS_PER_SEC;
+	CBUS_WRITE(WATCHDOG_RESET_REG, 0);
+	CBUS_WRITE(WATCHDOG_TC_REG, WATCHDOG_TC_CPUS | WATCHDOG_TC_ENABLE |
+	__SHIFTIN(tcnt, WATCHDOG_TC_TCNT));
+
+	return 0;
+}
+
+static int
+amlogic_ee_wdog_tickle(struct sysmon_wdog *smw)
+{
+	CBUS_WRITE(WATCHDOG_RESET_REG, 0);
+	return 0;
+}
+
+void
 amlogic_sdhc_init(void)
 {
 	/* enable SDHC clk */

Index: src/sys/arch/arm/amlogic/amlogic_io.c
diff -u src/sys/arch/arm/amlogic/amlogic_io.c:1.12 src/sys/arch/arm/amlogic/amlogic_io.c:1.13
--- src/sys/arch/arm/amlogic/amlogic_io.c:1.12	Sat Aug  8 14:01:44 2015
+++ src/sys/arch/arm/amlogic/amlogic_io.c	Sat Nov 21 00:54:57 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_io.c,v 1.12 2015/08/08 14:01:44 jmcneill Exp $ */
+/* $NetBSD: amlogic_io.c,v 1.13 2015/11/21 00:54:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_amlogic.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amlogic_io.c,v 1.12 2015/08/08 14:01:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_io.c,v 1.13 2015/11/21 00:54:57 jmcneill Exp $");
 
 #include 
 #include 
@@ -99,6 +99,7 @@ amlogicio_attach(device_t parent, device
 	aprint_naive("\n");
 	aprint_normal("\n");
 
+	amlogic_wdog_init();
 	amlogic_usbphy_init(0);
 	amlogic_usbphy_init(1);
 

Index: src/sys/arch/arm/amlogic/amlogic_var.h
diff -u src/sys/arch/arm/amlogic/amlogic_var.h:1.11 src/sys/arch/arm/amlogic/amlogic_var.h:1.12
--- src/sys/arch/arm/amlogic/amlogic_var.h:1.11	Tue Aug  4 01:23:07 2015
+++ src/sys/arch/arm/amlogic/amlogic_var.h	Sat Nov 21 00:54:57 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_var.h,v 1.11 2015/08/04 01:23:07 jmcneill Exp $ */
+/* $NetBSD: amlogic_var.h,v 1.12 2015/11/21 00:54:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -59,6 +59,7 @@ void	amlogic_bootstrap(void);
 void	amlogic_cpufreq_bootstrap(void);
 void	amlogic_cpufreq_init(void);
 
+void	amlogic_wdog_init(void);
 void	amlogic_usbphy_init(int);
 void	amlogic_eth_init(void);
 void	amlogic_rng_init(void);



CVS commit: othersrc/external/bsd/sid

2015-11-20 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Nov 20 22:26:16 UTC 2015

Modified Files:
othersrc/external/bsd/sid/bin: 1.expected
othersrc/external/bsd/sid/dist: sid.c sid.h

Log Message:
Update sid to version 20151120

+ Use the generic "array grow" function in multiple places

+ Bump version to 20151120


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/sid/bin/1.expected
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/sid/dist/sid.c \
othersrc/external/bsd/sid/dist/sid.h

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

Modified files:

Index: othersrc/external/bsd/sid/bin/1.expected
diff -u othersrc/external/bsd/sid/bin/1.expected:1.3 othersrc/external/bsd/sid/bin/1.expected:1.4
--- othersrc/external/bsd/sid/bin/1.expected:1.3	Thu Nov 12 21:01:29 2015
+++ othersrc/external/bsd/sid/bin/1.expected	Fri Nov 20 22:26:16 2015
@@ -64,7 +64,7 @@
 {"name":"/bin/tar","perms":0555,"ftype":"file","ino":1764557,"nlink":3,"uid":0,"gid":0,"size":154160,"blocks":304,"mtime":122927,"ctime":1444521101,"flags":0,"sha256":"bdabb62c796542329d64c6173dbfdc63fe308b3f096ef640f71d430f97d6abbf","crc32c":"70bea5b0"},
 {"name":"/bin/tcsh","perms":0755,"ftype":"file","ino":1764259,"nlink":1,"uid":0,"gid":0,"size":1087288,"blocks":2176,"mtime":1400308596,"ctime":1400308597,"flags":0,"sha256":"809c7e46ad45359fd3d79041655131ffd251b4c183d2e3c1578f5d7794f116a3","crc32c":"48b37771"},
 {"name":"/bin/test","perms":0555,"ftype":"file","ino":1770961,"nlink":2,"uid":0,"gid":0,"size":15361,"blocks":32,"mtime":122928,"ctime":1444521101,"flags":0,"sha256":"e1fcd944f699f893184cf6bfc227e642d77081590eb81fdd6232f70cbf9a0ec1","crc32c":"5bbd70b0"},
-{"name":"/etc","perms":0755,"ftype":"dir","ino":1053952,"nlink":28,"uid":0,"gid":0,"size":2048,"blocks":4,"mtime":1444589979,"ctime":1444589979,"flags":0},
+{"name":"/etc","perms":0755,"ftype":"dir","ino":1053952,"nlink":28,"uid":0,"gid":0,"size":2048,"blocks":4,"mtime":1447959152,"ctime":1447959152,"flags":0},
 {"name":"/etc/X11","perms":0755,"ftype":"dir","ino":1053957,"nlink":12,"uid":0,"gid":0,"size":512,"blocks":4,"mtime":1441668277,"ctime":1444521112,"flags":0},
 {"name":"/etc/X11/ctwm","perms":0755,"ftype":"dir","ino":1054927,"nlink":2,"uid":0,"gid":0,"size":512,"blocks":4,"mtime":1444521172,"ctime":1444521172,"flags":0},
 {"name":"/etc/X11/ctwm/system.ctwmrc","perms":0444,"ftype":"file","ino":1054390,"nlink":1,"uid":0,"gid":0,"size":4823,"blocks":12,"mtime":1442705969,"ctime":1444521172,"flags":0,"sha256":"d0b131ec8c9d068958988f39af1d9f15fbc370514660efc5cd325780ae030327","crc32c":"1510361"},
@@ -206,7 +206,7 @@
 {"name":"/etc/mailer.conf","perms":0644,"ftype":"file","ino":1054015,"nlink":1,"uid":0,"gid":0,"size":921,"blocks":4,"mtime":1385781121,"ctime":1385797726,"flags":0,"sha256":"2aab917aa543f00a223c092f18101cf4a63bc4ad88de1b32148411a3dfd1a2d5","crc32c":"6cf2fee0"},
 {"name":"/etc/man.conf","perms":0644,"ftype":"file","ino":1054016,"nlink":1,"uid":0,"gid":0,"size":2159,"blocks":8,"mtime":1387675108,"ctime":1400349239,"flags":0,"sha256":"69f5dbf7a497c53dbba5a1bda599153e05144a035fa54f7e2db173315e7fda28","crc32c":"e4b91860"},
 {"name":"/etc/master

CVS commit: src/external/bsd/cron/dist

2015-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 20 23:43:52 UTC 2015

Modified Files:
src/external/bsd/cron/dist: entry.c

Log Message:
fix type


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/cron/dist/entry.c

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

Modified files:

Index: src/external/bsd/cron/dist/entry.c
diff -u src/external/bsd/cron/dist/entry.c:1.6 src/external/bsd/cron/dist/entry.c:1.7
--- src/external/bsd/cron/dist/entry.c:1.6	Fri Sep  5 17:32:37 2014
+++ src/external/bsd/cron/dist/entry.c	Fri Nov 20 18:43:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: entry.c,v 1.6 2014/09/05 21:32:37 christos Exp $	*/
+/*	$NetBSD: entry.c,v 1.7 2015/11/20 23:43:52 christos Exp $	*/
 
 /*
  * Copyright 1988,1990,1993,1994 by Paul Vixie
@@ -26,7 +26,7 @@
 #if 0
 static char rcsid[] = "Id: entry.c,v 1.17 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: entry.c,v 1.6 2014/09/05 21:32:37 christos Exp $");
+__RCSID("$NetBSD: entry.c,v 1.7 2015/11/20 23:43:52 christos Exp $");
 #endif
 #endif
 
@@ -420,7 +420,7 @@ get_list(bitstr_t *bits, int low, int hi
 	
 	/* clear the bit string, since the default is 'off'.
 	 */
-	bit_nclear(bits, 0, (high-low+1));
+	bit_nclear(bits, 0, (size_t)(high-low+1));
 
 	/* process all ranges
 	 */



CVS commit: src/sys/net

2015-11-20 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Nov 20 08:10:36 UTC 2015

Modified Files:
src/sys/net: if.c

Log Message:
Remove an ifnet object from the global list before destructing it


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 src/sys/net/if.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/net/if.c
diff -u src/sys/net/if.c:1.318 src/sys/net/if.c:1.319
--- src/sys/net/if.c:1.318	Mon Aug 31 08:02:44 2015
+++ src/sys/net/if.c	Fri Nov 20 08:10:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.318 2015/08/31 08:02:44 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.319 2015/11/20 08:10:36 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.318 2015/08/31 08:02:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.319 2015/11/20 08:10:36 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -756,6 +756,9 @@ if_detach(struct ifnet *ifp)
 
 	s = splnet();
 
+	ifindex2ifnet[ifp->if_index] = NULL;
+	TAILQ_REMOVE(_list, ifp, if_list);
+
 	if (ifp->if_slowtimo != NULL) {
 		ifp->if_slowtimo = NULL;
 		callout_halt(ifp->if_slowtimo_ch, NULL);
@@ -890,10 +893,6 @@ again:
 	/* Announce that the interface is gone. */
 	rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
 
-	ifindex2ifnet[ifp->if_index] = NULL;
-
-	TAILQ_REMOVE(_list, ifp, if_list);
-
 	ifioctl_detach(ifp);
 
 	/*



CVS commit: src/doc/roadmaps

2015-11-20 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Nov 20 08:13:41 UTC 2015

Modified Files:
src/doc/roadmaps: storage

Log Message:
Add two more items: tls-maxphys and nvme support.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/doc/roadmaps/storage

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

Modified files:

Index: src/doc/roadmaps/storage
diff -u src/doc/roadmaps/storage:1.10 src/doc/roadmaps/storage:1.11
--- src/doc/roadmaps/storage:1.10	Fri Nov 20 07:20:21 2015
+++ src/doc/roadmaps/storage	Fri Nov 20 08:13:41 2015
@@ -1,4 +1,4 @@
-$NetBSD: storage,v 1.10 2015/11/20 07:20:21 dholland Exp $
+$NetBSD: storage,v 1.11 2015/11/20 08:13:41 dholland Exp $
 
 NetBSD Storage Roadmap
 ==
@@ -16,25 +16,27 @@ priorities for the project:
  3. A better journaling file system solution
  4. Getting zfs working for real
  5. Seamless full-disk encryption
+ 6. Finish tls-maxphys
 
 The following elements, projects, and goals are not strategic
 priorities but are still important undertakings worth doing:
 
- 6. lfs64
- 7. Per-process namespaces
- 8. lvm tidyup
- 9. Flash translation layer
- 10. Shingled disk support
- 11. ext3/ext4 support
- 12. Port hammer from Dragonfly
- 13. afs maintenance
- 14. execute-in-place
+ 7. nvme support
+ 8. lfs64
+ 9. Per-process namespaces
+ 10. lvm tidyup
+ 11. Flash translation layer
+ 12. Shingled disk support
+ 13. ext3/ext4 support
+ 14. Port hammer from Dragonfly
+ 15. afs maintenance
+ 16. execute-in-place
 
 The following elements, projects, and goals are perhaps less pressing;
 this doesn't mean one shouldn't work on them but the expected payoff
 is perhaps less than for other things:
 
- 15. coda maintenance
+ 17. coda maintenance
 
 
 Explanations
@@ -183,7 +185,45 @@ on laptops in many circumstances.
  - Contact dholland for further information.
 
 
-6. lfs64
+6. Finish tls-maxphys
+-
+
+The tls-maxphys branch changes MAXPHYS (the maximum size of a single
+I/O request) from a global fixed constant to a value that's probed
+separately for each particular I/O channel based on its
+capabilities. Large values are highly desirable for e.g. feeding large
+disk arrays but do not work with all hardware.
+
+The code is nearly done and just needs more testing and support in
+more drivers.
+
+ - As of November 2015 nobody is known to be working on this.
+ - There is no clear timeframe or release target.
+ - Contact tls for further information.
+
+
+7. nvme suppport
+
+
+nvme ("NVM Express") is a hardware interface standard for PCI-attached
+SSDs. NetBSD currently has no driver for these; unfortunately, while
+both FreeBSD and OpenBSD do neither of their drivers is likely
+directly suitable: the FreeBSD driver is severely overcomplicated and
+the OpenBSD driver won't be MPSAFE. (And there isn't much point in a
+non-MPSAFE nvme driver.)
+
+Relatedly, the I/O path needs to be restructured to avoid software
+bottlenecks on the way to an nvme device: they are fast enough that
+things like disksort() do not make sense.
+
+Semi-relatedly, it is also time for scsipi to become MPSAFE.
+
+ - As of November 2015 nobody is known to be working on this.
+ - There is no clear timeframe or release target.
+ - Contact msaitoh or agc for further information.
+
+
+8. lfs64
 
 
 LFS currently only supports volumes up to 2 TB. As LFS is of interest
@@ -197,7 +237,7 @@ version of LFS for large volumes is in t
  - Responsible: dholland
 
 
-7. Per-process namespaces
+9. Per-process namespaces
 -
 
 Support for per-process variation of the file system namespace enables
@@ -210,8 +250,8 @@ somewhat hackish but low-footprint way t
  - Responsible: dholland
 
 
-8. lvm tidyup
--
+10. lvm tidyup
+--
 
 [agc says someone should look at our lvm stuff; XXX fill this in]
 
@@ -220,8 +260,8 @@ somewhat hackish but low-footprint way t
  - Contact agc for further information.
 
 
-9. Flash translation layer
---
+11. Flash translation layer
+---
 
 SSDs ship with firmware called a "flash translation layer" that
 arbitrates between the block device software expects to see and the
@@ -241,7 +281,7 @@ implementations that we might be able to
  - Contact dholland for further information.
 
 
-10. Shingled disk support
+12. Shingled disk support
 -
 
 Shingled disks (or more technically, disks with "shingled magnetic
@@ -256,7 +296,7 @@ point we will want to support these thin
  - Contact dholland for further information.
 
 
-11. ext3/ext4 support
+13. ext3/ext4 support
 -
 
 We would like to be able to read and write Linux ext3fs and ext4fs
@@ -278,7 +318,7 @@ people; this is a harder project than it
  - Contact ?? for further information.
 
 
-12. Port hammer from Dragonfly
+14. Port hammer from Dragonfly
 

CVS commit: src/sys/dev/filemon

2015-11-20 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Nov 21 03:34:28 UTC 2015

Modified Files:
src/sys/dev/filemon: filemon.c

Log Message:
The correct default return value from a module's xxx_modcmd() routine
is ENOTTY, not EOPNOTSUPP!  The former will allow the module to be
auto-unloaded, while the latter will prevent it.

Note that manual unloading of the filemon module is unaffected, as
that is controlled by actual usage of the module.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/filemon/filemon.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/filemon/filemon.c
diff -u src/sys/dev/filemon/filemon.c:1.15 src/sys/dev/filemon/filemon.c:1.16
--- src/sys/dev/filemon/filemon.c:1.15	Fri Nov 20 02:58:19 2015
+++ src/sys/dev/filemon/filemon.c	Sat Nov 21 03:34:28 2015
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.15 2015/11/20 02:58:19 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.16 2015/11/21 03:34:28 pgoyette Exp $");
 
 #include 
 #include 
@@ -426,7 +426,7 @@ filemon_modcmd(modcmd_t cmd, void *data)
 		break;
 
 	default:
-		error = EOPNOTSUPP;
+		error = ENOTTY;
 		break;
 
 	}



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

2015-11-20 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 21 07:41:29 UTC 2015

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_obio.c bcm2835reg.h files.bcm2835
Added Files:
src/sys/arch/arm/broadcom: bcm2835_cm.c bcm2835_cm.h bcm2835_pwm.c
bcm2835_pwm.h

Log Message:
Add drivers to access the clock manager and pulse width modulator.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_cm.c \
src/sys/arch/arm/broadcom/bcm2835_cm.h \
src/sys/arch/arm/broadcom/bcm2835_pwm.c \
src/sys/arch/arm/broadcom/bcm2835_pwm.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/broadcom/bcm2835_obio.c \
src/sys/arch/arm/broadcom/files.bcm2835
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/broadcom/bcm2835reg.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/broadcom/bcm2835_obio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.25 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.26
--- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.25	Sun Apr 12 17:32:39 2015
+++ src/sys/arch/arm/broadcom/bcm2835_obio.c	Sat Nov 21 07:41:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_obio.c,v 1.25 2015/04/12 17:32:39 skrll Exp $	*/
+/*	$NetBSD: bcm2835_obio.c,v 1.26 2015/11/21 07:41:29 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_obio.c,v 1.25 2015/04/12 17:32:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_obio.c,v 1.26 2015/11/21 07:41:29 mlelstv Exp $");
 
 #include "locators.h"
 #include "obio.h"
@@ -194,6 +194,20 @@ static const struct ambadev_locators bcm
 		.ad_intr = -1,
 	},
 	{
+		/* Clock Manager */
+		.ad_name = "bcmcm",
+		.ad_addr = BCM2835_CM_BASE,
+		.ad_size = BCM2835_CM_SIZE,
+		.ad_intr = -1,
+	},
+	{
+		/* PWM Controller */
+		.ad_name = "bcmpwm",
+		.ad_addr = BCM2835_PWM_BASE,
+		.ad_size = BCM2835_PWM_SIZE,
+		.ad_intr = -1,
+	},
+	{
 		/* Terminator */
 		.ad_name = NULL,
 	}
Index: src/sys/arch/arm/broadcom/files.bcm2835
diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.25 src/sys/arch/arm/broadcom/files.bcm2835:1.26
--- src/sys/arch/arm/broadcom/files.bcm2835:1.25	Fri Mar 13 22:48:41 2015
+++ src/sys/arch/arm/broadcom/files.bcm2835	Sat Nov 21 07:41:29 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm2835,v 1.25 2015/03/13 22:48:41 jmcneill Exp $
+#	$NetBSD: files.bcm2835,v 1.26 2015/11/21 07:41:29 mlelstv Exp $
 #
 # Configuration info for Broadcom BCM2835 ARM Peripherals
 #
@@ -100,3 +100,14 @@ file	arch/arm/broadcom/bcm2835_vcaudio.c
 device	bcmgpio: gpiobus
 attach	bcmgpio at obio
 file	arch/arm/broadcom/bcm2835_gpio.c
+
+# Clock Manager (BCM2835_CM_BASE)
+device	bcmcm
+attach	bcmcm at obio with bcmcm_amba
+file	arch/arm/broadcom/bcm2835_cm.c		bcmcm		needs-flag
+
+# PWM Controller (BCM2835_PWM_BASE)
+device	bcmpwm
+attach	bcmpwm at obio with bcmpwm_amba
+file	arch/arm/broadcom/bcm2835_pwm.c		bcmpwm		needs-flag
+

Index: src/sys/arch/arm/broadcom/bcm2835reg.h
diff -u src/sys/arch/arm/broadcom/bcm2835reg.h:1.15 src/sys/arch/arm/broadcom/bcm2835reg.h:1.16
--- src/sys/arch/arm/broadcom/bcm2835reg.h:1.15	Sun Apr 12 17:32:39 2015
+++ src/sys/arch/arm/broadcom/bcm2835reg.h	Sat Nov 21 07:41:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835reg.h,v 1.15 2015/04/12 17:32:39 skrll Exp $	*/
+/*	$NetBSD: bcm2835reg.h,v 1.16 2015/11/21 07:41:29 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -54,12 +54,14 @@
 #define	BCM2835_DMA0_BASE	(BCM2835_PERIPHERALS_BASE + 0x7000)
 #define	BCM2835_ARM_BASE	(BCM2835_PERIPHERALS_BASE + 0xB000)
 #define	BCM2835_PM_BASE		(BCM2835_PERIPHERALS_BASE + 0x0010)
+#define	BCM2835_CM_BASE  	(BCM2835_PERIPHERALS_BASE + 0x00101000)
 #define	BCM2835_RNG_BASE	(BCM2835_PERIPHERALS_BASE + 0x00104000)
 #define	BCM2835_GPIO_BASE	(BCM2835_PERIPHERALS_BASE + 0x0020)
 #define	BCM2835_UART0_BASE	(BCM2835_PERIPHERALS_BASE + 0x00201000)
 #define	BCM2835_PCM_BASE	(BCM2835_PERIPHERALS_BASE + 0x00203000)
 #define	BCM2835_SPI0_BASE	(BCM2835_PERIPHERALS_BASE + 0x00204000)
 #define	BCM2835_BSC0_BASE	(BCM2835_PERIPHERALS_BASE + 0x00205000)
+#define	BCM2835_PWM_BASE	(BCM2835_PERIPHERALS_BASE + 0x0020C000)
 #define	BCM2835_BSCSPISLV_BASE	(BCM2835_PERIPHERALS_BASE + 0x00214000)
 #define	BCM2835_AUX_BASE	(BCM2835_PERIPHERALS_BASE + 0x00215000)
 #define	BCM2835_EMMC_BASE	(BCM2835_PERIPHERALS_BASE + 0x0030)
@@ -72,12 +74,14 @@
 #define	BCM2835_DMA0_SIZE	0x1000
 #define	BCM2835_ARM_SIZE	0x1000
 #define	BCM2835_PM_SIZE		0x1000
+#define	BCM2835_CM_SIZE		0xa8
 #define	BCM2835_RNG_SIZE	0x1000
 #define	BCM2835_GPIO_SIZE	0x1000
 #define	BCM2835_UART0_SIZE	0x90
 #define	BCM2835_PCM_SIZE	0x1000
 #define	BCM2835_SPI0_SIZE	0x1000
 #define	BCM2835_BSC_SIZE	0x1000
+#define	BCM2835_PWM_SIZE	0x28
 #define	BCM2835_AUX_SIZE	0x1000
 #define	BCM2835_EMMC_SIZE	0x1000
 #define	BCM2835_USB_SIZE	0x2

Added 

CVS commit: src/sys/dev/filemon

2015-11-20 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Nov 21 07:45:30 UTC 2015

Modified Files:
src/sys/dev/filemon: filemon.c

Log Message:
If a second call to the SET_FD ioctl occurs, release the reference we
hold on the earlier outout file.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/filemon/filemon.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/filemon/filemon.c
diff -u src/sys/dev/filemon/filemon.c:1.16 src/sys/dev/filemon/filemon.c:1.17
--- src/sys/dev/filemon/filemon.c:1.16	Sat Nov 21 03:34:28 2015
+++ src/sys/dev/filemon/filemon.c	Sat Nov 21 07:45:30 2015
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.16 2015/11/21 03:34:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.17 2015/11/21 07:45:30 pgoyette Exp $");
 
 #include 
 #include 
@@ -294,6 +294,12 @@ filemon_ioctl(struct file * fp, u_long c
 	switch (cmd) {
 	case FILEMON_SET_FD:
 		/* Set the output file descriptor. */
+
+		/* First, release any current output file descriptor */
+		if (filemon->fm_fp)
+			fd_putfile(filemon->fm_fd);
+
+		/* Now set up the new one */
 		filemon->fm_fd = *((int *) data);
 		if ((filemon->fm_fp = fd_getfile(filemon->fm_fd)) == NULL) {
 			rw_exit(>fm_mtx);