CVS commit: [netbsd-7] src/doc

2015-01-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  3 05:53:44 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
376


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.145 -r1.1.2.146 src/doc/CHANGES-7.0

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

Modified files:

Index: src/doc/CHANGES-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.145 src/doc/CHANGES-7.0:1.1.2.146
--- src/doc/CHANGES-7.0:1.1.2.145	Fri Jan  2 20:59:14 2015
+++ src/doc/CHANGES-7.0	Sat Jan  3 05:53:44 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.145 2015/01/02 20:59:14 martin Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.146 2015/01/03 05:53:44 snj Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -6954,3 +6954,8 @@ sys/dev/usb/xhcireg.h1.2
 	logic was wrong.
 	[skrll, ticket #372]
 
+sys/arch/evbarm/awin/awin_machdep.c		1.35, 1.37
+
+	Fix gmac on BananaPI by using pinset-func 3.
+	[martin, ticket #376]
+



CVS commit: [netbsd-7] src/sys/arch/evbarm/awin

2015-01-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  3 05:52:10 UTC 2015

Modified Files:
src/sys/arch/evbarm/awin [netbsd-7]: awin_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #376):
sys/arch/evbarm/awin/awin_machdep.c: revision 1.35, 1.37
Use pinset-func 3 for gmac on BananaPI (value taken from the only working
u-boot driver).
This makes root on NFS and ftp transfers work for me.


To generate a diff of this commit:
cvs rdiff -u -r1.8.2.8 -r1.8.2.9 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c
diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.8.2.8 src/sys/arch/evbarm/awin/awin_machdep.c:1.8.2.9
--- src/sys/arch/evbarm/awin/awin_machdep.c:1.8.2.8	Tue Nov 18 18:19:09 2014
+++ src/sys/arch/evbarm/awin/awin_machdep.c	Sat Jan  3 05:52:09 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_machdep.c,v 1.8.2.8 2014/11/18 18:19:09 snj Exp $ */
+/*	$NetBSD: awin_machdep.c,v 1.8.2.9 2015/01/03 05:52:09 snj Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.8.2.8 2014/11/18 18:19:09 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.8.2.9 2015/01/03 05:52:09 snj Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -748,7 +748,7 @@ awin_device_register(device_t self, void
 #if AWIN_BOARD == AWIN_bpi
 		prop_dictionary_set_cstring(dict, "phy-power", "gmacpwren");
 		prop_dictionary_set_cstring(dict, "phy-type", "rgmii-bpi");
-		prop_dictionary_set_uint8(dict, "pinset-func", 2);
+		prop_dictionary_set_uint8(dict, "pinset-func", 3);
 #endif
 		return;
 	}



CVS commit: src/external/bsd/file/dist/magic/magdir

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 23:38:45 UTC 2015

Modified Files:
src/external/bsd/file/dist/magic/magdir: elf

Log Message:
add a clear that did not merge.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/magic/magdir/elf

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/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.12 src/external/bsd/file/dist/magic/magdir/elf:1.13
--- src/external/bsd/file/dist/magic/magdir/elf:1.12	Mon Oct 20 17:48:57 2014
+++ src/external/bsd/file/dist/magic/magdir/elf	Fri Jan  2 18:38:45 2015
@@ -30,6 +30,7 @@
 #>>>(0x38+0xcc) string	>\0		of '%s'
 #>>>(0x38+0x10) lelong	>0		(signal %d),
 >16	leshort		&0xff00		processor-specific,
+>18	clear		x
 >18	leshort		0		no machine,
 >18	leshort		1		AT&T WE32100,
 >18	leshort		2		SPARC,



CVS commit: src/external/bsd/file/dist/magic/magdir

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 23:27:46 UTC 2015

Modified Files:
src/external/bsd/file/dist/magic/magdir: jpeg

Log Message:
fix recursion


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/bsd/file/dist/magic/magdir/jpeg

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/file/dist/magic/magdir/jpeg
diff -u src/external/bsd/file/dist/magic/magdir/jpeg:1.1.1.6 src/external/bsd/file/dist/magic/magdir/jpeg:1.2
--- src/external/bsd/file/dist/magic/magdir/jpeg:1.1.1.6	Fri Jan  2 15:34:28 2015
+++ src/external/bsd/file/dist/magic/magdir/jpeg	Fri Jan  2 18:27:46 2015
@@ -1,6 +1,6 @@
 
 #--
-# $File: jpeg,v 1.25 2015/01/02 16:56:50 christos Exp $
+# $File: jpeg,v 1.26 2015/01/02 22:40:27 christos Exp $
 # JPEG images
 # SunOS 5.5.1 had
 #
@@ -41,7 +41,8 @@
 # This uses recursion...
 0		name		jpeg_segment
 >0	beshort		0xFFFE
->>(2.S+2)	use			jpeg_segment
+# Recursion handled by FFE0
+#>>(2.S+2)	use			jpeg_segment
 >>2	pstring/HJ	x		\b, comment: "%s"
 
 >0	beshort		0xFFC0
@@ -70,6 +71,7 @@
 >>(2.S+2)	use			jpeg_segment
 
 >0	beshort		0xFFE1		
+# Recursion handled by FFE0
 #>>(2.S+2)	use			jpeg_segment
 >>4	string		Exif		\b, Exif Standard: [
 >>>10	indirect/r	x		
@@ -85,7 +87,8 @@
 # D9: End of image
 # Dn: Restart
 >0	beshort&0xFFD0	=0xFFD0
->>(2.S+2)	use			jpeg_segment
+>>0	beshort&0xFFE0	!0xFFE0
+>>>(2.S+2)	use			jpeg_segment
 
 #>0	beshort		x		unknown 0x%x
 #>>(2.S+2)	use			jpeg_segment



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

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 23:23:17 UTC 2015

Modified Files:
src/sys/arch/arm/rockchip: obio.c

Log Message:
back out r1.8, its fine (and preferred) to write value before direction reg


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/rockchip/obio.c

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

Modified files:

Index: src/sys/arch/arm/rockchip/obio.c
diff -u src/sys/arch/arm/rockchip/obio.c:1.9 src/sys/arch/arm/rockchip/obio.c:1.10
--- src/sys/arch/arm/rockchip/obio.c:1.9	Fri Jan  2 21:59:29 2015
+++ src/sys/arch/arm/rockchip/obio.c	Fri Jan  2 23:23:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio.c,v 1.9 2015/01/02 21:59:29 jmcneill Exp $	*/
+/*	$NetBSD: obio.c,v 1.10 2015/01/02 23:23:17 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include "opt_rockchip.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.9 2015/01/02 21:59:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.10 2015/01/02 23:23:17 jmcneill Exp $");
 
 #include 
 #include 
@@ -237,22 +237,22 @@ void obio_init_gpio(void)
 {
 #if 1
 	/* Radxa Rock */
-	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(3));
 	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DR_OFFSET, __BIT(3));
-	obio_swporta(ROCKCHIP_GPIO2_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(31));
+	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(3));
 	obio_swporta(ROCKCHIP_GPIO2_OFFSET, GPIO_SWPORTA_DR_OFFSET, __BIT(31));
+	obio_swporta(ROCKCHIP_GPIO2_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(31));
 
 	/* IT66121 HDMI */
-	obio_swporta(ROCKCHIP_GPIO3_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(10));
 	obio_swporta(ROCKCHIP_GPIO3_OFFSET, GPIO_SWPORTA_DR_OFFSET, __BIT(10));
+	obio_swporta(ROCKCHIP_GPIO3_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(10));
 #else
 	/* ChipSPARK Rayeager PX2 */
-	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(5));
 	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DR_OFFSET, __BIT(5));
-	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(6));
+	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(5));
 	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DR_OFFSET, __BIT(6));
-	obio_swporta(ROCKCHIP_GPIO1_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(31));
+	obio_swporta(ROCKCHIP_GPIO0_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(6));
 	obio_swporta(ROCKCHIP_GPIO1_OFFSET, GPIO_SWPORTA_DR_OFFSET, __BIT(31));
+	obio_swporta(ROCKCHIP_GPIO1_OFFSET, GPIO_SWPORTA_DD_OFFSET, __BIT(31));
 #endif
 }
 



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

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 23:20:49 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: ROCKCHIP

Log Message:
add rktimer


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/conf/ROCKCHIP

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/conf/ROCKCHIP
diff -u src/sys/arch/evbarm/conf/ROCKCHIP:1.10 src/sys/arch/evbarm/conf/ROCKCHIP:1.11
--- src/sys/arch/evbarm/conf/ROCKCHIP:1.10	Thu Jan  1 17:34:00 2015
+++ src/sys/arch/evbarm/conf/ROCKCHIP	Fri Jan  2 23:20:49 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ROCKCHIP,v 1.10 2015/01/01 17:34:00 jmcneill Exp $
+#	$NetBSD: ROCKCHIP,v 1.11 2015/01/02 23:20:49 jmcneill Exp $
 #
 #	Rockchip RK3066/RK3188 based SBC (Single Board Computer)
 #
@@ -178,6 +178,9 @@ obio0		at mainbus?
 com0		at obio0 addr 0x20064000 size 0x400 intr 68 mult 4 # UART2 (console)
 options 	CONSADDR=0x20064000, CONSPEED=115200
 
+# Timer
+rktimer0	at obio0 addr 0x20038000 size 0x2000
+
 # I2C controllers
 rkiic0		at obio0 addr 0x2002d000 size 0x1000 intr 72 port 0
 iic0		at rkiic0



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

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 23:20:18 UTC 2015

Modified Files:
src/sys/arch/arm/rockchip: files.rockchip
Added Files:
src/sys/arch/arm/rockchip: rockchip_timer.c rockchip_timerreg.h

Log Message:
Add driver for RK3188 64-bit timer.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/rockchip/rockchip_timer.c \
src/sys/arch/arm/rockchip/rockchip_timerreg.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/rockchip/files.rockchip
diff -u src/sys/arch/arm/rockchip/files.rockchip:1.6 src/sys/arch/arm/rockchip/files.rockchip:1.7
--- src/sys/arch/arm/rockchip/files.rockchip:1.6	Fri Jan  2 21:59:29 2015
+++ src/sys/arch/arm/rockchip/files.rockchip	Fri Jan  2 23:20:18 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rockchip,v 1.6 2015/01/02 21:59:29 jmcneill Exp $
+#	$NetBSD: files.rockchip,v 1.7 2015/01/02 23:20:18 jmcneill Exp $
 #
 # Configuration info for Rockchip ARM Peripherals
 #
@@ -32,6 +32,11 @@ device	rkiic: i2cbus, i2cexec
 attach	rkiic at obio
 file	arch/arm/rockchip/rockchip_i2c.c	rkiic
 
+# Timer
+device	rktimer
+attach	rktimer at obio
+file	arch/arm/rockchip/rockchip_timer.c	rktimer
+
 # SD/MMC (Synopsys DesignWare)
 attach	dwcmmc at obio with rkdwcmmc
 file	arch/arm/rockchip/rockchip_dwcmmc.c	rkdwcmmc

Added files:

Index: src/sys/arch/arm/rockchip/rockchip_timer.c
diff -u /dev/null src/sys/arch/arm/rockchip/rockchip_timer.c:1.1
--- /dev/null	Fri Jan  2 23:20:18 2015
+++ src/sys/arch/arm/rockchip/rockchip_timer.c	Fri Jan  2 23:20:18 2015
@@ -0,0 +1,107 @@
+/* $NetBSD: rockchip_timer.c,v 1.1 2015/01/02 23:20:18 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2015 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: rockchip_timer.c,v 1.1 2015/01/02 23:20:18 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+struct rktimer_softc {
+	device_t sc_dev;
+	bus_space_tag_t sc_bst;
+	bus_space_handle_t sc_bsh;
+	struct timecounter sc_tc;
+};
+
+#define TIMER_READ(sc, reg) \
+bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
+#define TIMER_WRITE(sc, reg, val) \
+bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
+
+static int	rktimer_match(device_t, cfdata_t, void *);
+static void	rktimer_attach(device_t, device_t, void *);
+
+static u_int	rktimer_get_timecount(struct timecounter *);
+
+CFATTACH_DECL_NEW(rktimer, sizeof(struct rktimer_softc),
+	rktimer_match, rktimer_attach, NULL, NULL);
+
+static int
+rktimer_match(device_t parent, cfdata_t cf, void *aux)
+{
+	return 1;
+}
+
+static void
+rktimer_attach(device_t parent, device_t self, void *aux)
+{
+	struct rktimer_softc *sc = device_private(self);
+	struct obio_attach_args * const obio = aux;
+
+	sc->sc_dev = self;
+	sc->sc_bst = obio->obio_bst;
+	bus_space_subregion(obio->obio_bst, obio->obio_bsh, obio->obio_offset,
+	obio->obio_size, &sc->sc_bsh);
+
+	aprint_naive("\n");
+	aprint_normal("\n");
+
+	TIMER_WRITE(sc, TIMER0_CONTROL_REG, 0);
+	TIMER_WRITE(sc, TIMER0_LOAD_COUNT0_REG, 0x);
+	TIMER_WRITE(sc, TIMER0_LOAD_COUNT1_REG, 0x);
+	TIMER_WRITE(sc, TIMER0_CONTROL_REG, TIMER_CONTROL_ENABLE);
+
+	sc->sc_tc.tc_get_timecount = rktimer_get_timecount;
+	sc->sc_tc.tc_poll_pps = NULL;
+	sc->sc_tc.tc_counter_mask = ~0;
+	sc->sc_tc.tc_frequency = ROCKCHIP_REF_FREQ;
+	sc->sc_tc.tc_name = "TIMER0";
+	sc->sc_tc.tc_priv = sc;
+	sc->sc_tc.tc_quality = 900;
+
+	tc_init(&sc->sc_tc);
+}
+
+static u_int
+rktimer_get_timecount

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

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 23:19:28 UTC 2015

Modified Files:
src/sys/arch/arm/cortex: a9tmr.c

Log Message:
detach and re-attach timecounter when updating freq, and reinit timer on each 
cpu


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/cortex/a9tmr.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/cortex/a9tmr.c
diff -u src/sys/arch/arm/cortex/a9tmr.c:1.8 src/sys/arch/arm/cortex/a9tmr.c:1.9
--- src/sys/arch/arm/cortex/a9tmr.c:1.8	Fri Jan  2 21:58:03 2015
+++ src/sys/arch/arm/cortex/a9tmr.c	Fri Jan  2 23:19:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9tmr.c,v 1.8 2015/01/02 21:58:03 jmcneill Exp $	*/
+/*	$NetBSD: a9tmr.c,v 1.9 2015/01/02 23:19:28 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.8 2015/01/02 21:58:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.9 2015/01/02 23:19:28 jmcneill Exp $");
 
 #include 
 #include 
@@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -248,17 +249,31 @@ cpu_initclocks(void)
 	tc_init(&a9tmr_timecounter);
 }
 
+static void
+a9tmr_update_freq_cb(void *arg1, void *arg2)
+{
+	a9tmr_init_cpu_clock(curcpu());
+}
+
 void
 a9tmr_update_freq(uint32_t freq)
 {
 	struct a9tmr_softc * const sc = &a9tmr_sc;
+	uint64_t xc;
 
 	KASSERT(sc->sc_dev != NULL);
 	KASSERT(freq != 0);
 
+	tc_detach(&a9tmr_timecounter);
+
 	sc->sc_freq = freq;
 	sc->sc_autoinc = sc->sc_freq / hz;
+
+	xc = xc_broadcast(0, a9tmr_update_freq_cb, NULL, NULL);
+	xc_wait(xc);
+
 	a9tmr_timecounter.tc_frequency = sc->sc_freq;
+	tc_init(&a9tmr_timecounter);
 }
 
 void



CVS commit: [netbsd-7] src/sys/dev/usb

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 22:44:34 UTC 2015

Modified Files:
src/sys/dev/usb [netbsd-7]: xhci.c xhcireg.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #372):
sys/dev/usb/xhcireg.h: revision 1.2
sys/dev/usb/xhci.c: revision 1.28
kern/49391: Fixes to XHCI driver command ring and status TRB
CRCR needs 64byte aligned address
Use usb_allocmem instead of usb_allocmem_flags(..., 0)
Correct status stage TRB in xhci_device_ctrl_start - direction logic was
wrong.
Correct a typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.2 -r1.23.2.3 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.1 -r1.1.10.1 src/sys/dev/usb/xhcireg.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/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.23.2.2 src/sys/dev/usb/xhci.c:1.23.2.3
--- src/sys/dev/usb/xhci.c:1.23.2.2	Wed Aug 13 21:47:18 2014
+++ src/sys/dev/usb/xhci.c	Fri Jan  2 22:44:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.23.2.2 2014/08/13 21:47:18 riz Exp $	*/
+/*	$NetBSD: xhci.c,v 1.23.2.3 2015/01/02 22:44:34 martin Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.23.2.2 2014/08/13 21:47:18 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.23.2.3 2015/01/02 22:44:34 martin Exp $");
 
 #include 
 #include 
@@ -1338,7 +1338,7 @@ xhci_allocm(struct usbd_bus *bus, usb_dm
 
 	DPRINTF(("%s\n", __func__));
 
-	err = usb_allocmem_flags(&sc->sc_bus, size, 0, dma, 0);
+	err = usb_allocmem(&sc->sc_bus, size, 0, dma);
 #if 0
 	if (err == USBD_NOMEM)
 		err = usb_reserve_allocm(&sc->sc_dma_reserve, dma, size);
@@ -2433,7 +2433,7 @@ xhci_root_ctrl_done(usbd_xfer_handle xfe
 	xfer->hcpriv = NULL;
 }
 
-/* root hub intrerrupt */
+/* root hub interrupt */
 
 static usbd_status
 xhci_root_intr_transfer(usbd_xfer_handle xfer)
@@ -2589,9 +2589,9 @@ xhci_device_ctrl_start(usbd_xfer_handle 
 
 no_data:
 	parameter = 0;
-	status = XHCI_TRB_2_IRQ_SET(0) | XHCI_TRB_2_TDSZ_SET(1);
+	status = XHCI_TRB_2_IRQ_SET(0);
 	/* the status stage has inverted direction */
-	control = (isread ? 0 : XHCI_TRB_3_DIR_IN) |
+	control = ((isread && (len > 0)) ? 0 : XHCI_TRB_3_DIR_IN) |
 	XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_STATUS_STAGE) |
 	XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_ENT_BIT;
 	xhci_trb_put(&xx->xx_trb[i++], parameter, status, control);

Index: src/sys/dev/usb/xhcireg.h
diff -u src/sys/dev/usb/xhcireg.h:1.1 src/sys/dev/usb/xhcireg.h:1.1.10.1
--- src/sys/dev/usb/xhcireg.h:1.1	Sat Sep 14 00:40:31 2013
+++ src/sys/dev/usb/xhcireg.h	Fri Jan  2 22:44:34 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: xhcireg.h,v 1.1 2013/09/14 00:40:31 jakllsch Exp $ */
+/* $NetBSD: xhcireg.h,v 1.1.10.1 2015/01/02 22:44:34 martin Exp $ */
 /* $FreeBSD$ */
 
 /*-
@@ -212,7 +212,7 @@
 #define XHCI_STREAM_CONTEXT_ALIGN 16
 #define XHCI_STREAM_ARRAY_ALIGN 16
 #define XHCI_TRANSFER_RING_SEGMENTS_ALIGN 16
-#define XHCI_COMMAND_RING_SEGMENTS_ALIGN 16
+#define XHCI_COMMAND_RING_SEGMENTS_ALIGN 64
 #define XHCI_EVENT_RING_SEGMENTS_ALIGN 64
 #define XHCI_EVENT_RING_SEGMENT_TABLE_ALIGN 64
 #define XHCI_SCRATCHPAD_BUFFER_ARRAY_ALIGN 64



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

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 22:00:02 UTC 2015

Modified Files:
src/sys/arch/evbarm/rockchip: rockchip_machdep.c

Log Message:
init cpufreq, remove cpu.frequency boot arg support


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/rockchip/rockchip_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/rockchip/rockchip_machdep.c
diff -u src/sys/arch/evbarm/rockchip/rockchip_machdep.c:1.13 src/sys/arch/evbarm/rockchip/rockchip_machdep.c:1.14
--- src/sys/arch/evbarm/rockchip/rockchip_machdep.c:1.13	Fri Jan  2 00:50:56 2015
+++ src/sys/arch/evbarm/rockchip/rockchip_machdep.c	Fri Jan  2 22:00:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rockchip_machdep.c,v 1.13 2015/01/02 00:50:56 jmcneill Exp $ */
+/*	$NetBSD: rockchip_machdep.c,v 1.14 2015/01/02 22:00:02 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rockchip_machdep.c,v 1.13 2015/01/02 00:50:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rockchip_machdep.c,v 1.14 2015/01/02 22:00:02 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -468,7 +468,6 @@ initarm(void *arg)
 {
 	psize_t ram_size = 0;
 	char *ptr;
-	u_int cpufreq;
 	*(volatile int *)CONSADDR_VA  = 0x40;	/* output '@' */
 #if 1
 	rockchip_putchar('d');
@@ -600,11 +599,6 @@ initarm(void *arg)
 		use_fb_console = true;
 	}
 
-	if (get_bootconf_option(boot_args, "cpu.frequency",
-		BOOTOPT_TYPE_INT, &cpufreq)) {
-		rockchip_apll_set_rate(cpufreq * 100);
-	}
-
 	curcpu()->ci_data.cpu_cc_freq = rockchip_cpu_get_rate();
 
 	return initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, NULL, 0);
@@ -736,6 +730,10 @@ rockchip_device_register(device_t self, 
 		return;
 	}
 
+	if (device_is_a(self, "cpu") && device_unit(self) == 0) {
+		rockchip_cpufreq_init();
+	}
+
 #ifdef CPU_CORTEXA9 
 	/*
 	 * We need to tell the A9 Global/Watchdog Timer



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

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 21:59:29 UTC 2015

Modified Files:
src/sys/arch/arm/rockchip: files.rockchip obio.c rockchip_board.c
rockchip_var.h
Added Files:
src/sys/arch/arm/rockchip: rockchip_cpufreq.c

Log Message:
Add RK3188/RK3188+ CPU frequency setting support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/rockchip/obio.c \
src/sys/arch/arm/rockchip/rockchip_var.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/rockchip/rockchip_board.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/rockchip/rockchip_cpufreq.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/rockchip/files.rockchip
diff -u src/sys/arch/arm/rockchip/files.rockchip:1.5 src/sys/arch/arm/rockchip/files.rockchip:1.6
--- src/sys/arch/arm/rockchip/files.rockchip:1.5	Tue Dec 30 18:57:36 2014
+++ src/sys/arch/arm/rockchip/files.rockchip	Fri Jan  2 21:59:29 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rockchip,v 1.5 2014/12/30 18:57:36 jmcneill Exp $
+#	$NetBSD: files.rockchip,v 1.6 2015/01/02 21:59:29 jmcneill Exp $
 #
 # Configuration info for Rockchip ARM Peripherals
 #
@@ -12,6 +12,7 @@ file	arch/arm/arm32/arm32_reboot.c
 file	arch/arm/arm32/irq_dispatch.S
 
 file	arch/arm/rockchip/rockchip_board.c
+file	arch/arm/rockchip/rockchip_cpufreq.c
 file	arch/arm/rockchip/rockchip_space.c	obio
 #file	arch/arm/rockchip/rockchip_a4x_space.c	obio
 file	arch/arm/rockchip/rockchip_dma.c

Index: src/sys/arch/arm/rockchip/obio.c
diff -u src/sys/arch/arm/rockchip/obio.c:1.8 src/sys/arch/arm/rockchip/obio.c:1.9
--- src/sys/arch/arm/rockchip/obio.c:1.8	Thu Jan  1 18:59:03 2015
+++ src/sys/arch/arm/rockchip/obio.c	Fri Jan  2 21:59:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio.c,v 1.8 2015/01/01 18:59:03 jmcneill Exp $	*/
+/*	$NetBSD: obio.c,v 1.9 2015/01/02 21:59:29 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include "opt_rockchip.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.8 2015/01/01 18:59:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.9 2015/01/02 21:59:29 jmcneill Exp $");
 
 #include 
 #include 
@@ -282,6 +282,7 @@ obio_dump_clocks(void)
 	printf("CPU: %u Hz\n", rockchip_cpu_get_rate());
 	printf("AHB: %u Hz\n", rockchip_ahb_get_rate());
 	printf("APB: %u Hz\n", rockchip_apb_get_rate());
+	printf("PCLK_CPU: %u Hz\n", rockchip_pclk_cpu_get_rate());
 	printf("A9PERIPH: %u Hz\n", rockchip_a9periph_get_rate());
 }
 #endif
Index: src/sys/arch/arm/rockchip/rockchip_var.h
diff -u src/sys/arch/arm/rockchip/rockchip_var.h:1.8 src/sys/arch/arm/rockchip/rockchip_var.h:1.9
--- src/sys/arch/arm/rockchip/rockchip_var.h:1.8	Tue Dec 30 17:15:31 2014
+++ src/sys/arch/arm/rockchip/rockchip_var.h	Fri Jan  2 21:59:29 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: rockchip_var.h,v 1.8 2014/12/30 17:15:31 jmcneill Exp $ */
+/* $NetBSD: rockchip_var.h,v 1.9 2015/01/02 21:59:29 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -59,18 +59,20 @@ extern bus_space_handle_t rockchip_core1
 
 void rockchip_bootstrap(void);
 
+void rockchip_cpufreq_init(void);
+
 bool rockchip_is_chip(const char *);
 #define ROCKCHIP_CHIPVER_RK3066		"300A2011V101"
 #define ROCKCHIP_CHIPVER_RK3188		"310B20121130V100"
 #define ROCKCHIP_CHIPVER_RK3188PLUS	"310B20130131V101"
 
 u_int rockchip_apll_get_rate(void);
-u_int rockchip_apll_set_rate(u_int);
 u_int rockchip_cpll_get_rate(void);
 u_int rockchip_gpll_get_rate(void);
 u_int rockchip_cpu_get_rate(void);
 u_int rockchip_ahb_get_rate(void);
 u_int rockchip_apb_get_rate(void);
+u_int rockchip_pclk_cpu_get_rate(void);
 u_int rockchip_a9periph_get_rate(void);
 u_int rockchip_mmc0_get_rate(void);
 u_int rockchip_mmc0_set_div(u_int);

Index: src/sys/arch/arm/rockchip/rockchip_board.c
diff -u src/sys/arch/arm/rockchip/rockchip_board.c:1.10 src/sys/arch/arm/rockchip/rockchip_board.c:1.11
--- src/sys/arch/arm/rockchip/rockchip_board.c:1.10	Wed Dec 31 18:14:14 2014
+++ src/sys/arch/arm/rockchip/rockchip_board.c	Fri Jan  2 21:59:29 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: rockchip_board.c,v 1.10 2014/12/31 18:14:14 jmcneill Exp $ */
+/* $NetBSD: rockchip_board.c,v 1.11 2015/01/02 21:59:29 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_rockchip.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rockchip_board.c,v 1.10 2014/12/31 18:14:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rockchip_board.c,v 1.11 2015/01/02 21:59:29 jmcneill Exp $");
 
 #include 
 #include 
@@ -83,13 +83,6 @@ rockchip_get_cru_bsh(bus_space_handle_t 
 	ROCKCHIP_CRU_OFFSET, ROCKCHIP_CRU_SIZE, pbsh);
 }
 
-static void
-rockchip_get_grf_bsh(bus_space_handle_t *pbsh)
-{
-	bus_space_subregion(&rockchip_bs_tag, rockchip_core1_bsh,
-	ROCKCHIP_GRF_OFFSET, ROCKCHIP_GRF_SIZE, pbsh);
-}
-
 static

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

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 21:58:03 UTC 2015

Modified Files:
src/sys/arch/arm/cortex: a9tmr.c a9tmr_var.h

Log Message:
add a helper to update a9tmr frequency


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/cortex/a9tmr.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/cortex/a9tmr_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/cortex/a9tmr.c
diff -u src/sys/arch/arm/cortex/a9tmr.c:1.7 src/sys/arch/arm/cortex/a9tmr.c:1.8
--- src/sys/arch/arm/cortex/a9tmr.c:1.7	Fri Mar 28 21:57:22 2014
+++ src/sys/arch/arm/cortex/a9tmr.c	Fri Jan  2 21:58:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9tmr.c,v 1.7 2014/03/28 21:57:22 matt Exp $	*/
+/*	$NetBSD: a9tmr.c,v 1.8 2015/01/02 21:58:03 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.7 2014/03/28 21:57:22 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.8 2015/01/02 21:58:03 jmcneill Exp $");
 
 #include 
 #include 
@@ -249,6 +249,19 @@ cpu_initclocks(void)
 }
 
 void
+a9tmr_update_freq(uint32_t freq)
+{
+	struct a9tmr_softc * const sc = &a9tmr_sc;
+
+	KASSERT(sc->sc_dev != NULL);
+	KASSERT(freq != 0);
+
+	sc->sc_freq = freq;
+	sc->sc_autoinc = sc->sc_freq / hz;
+	a9tmr_timecounter.tc_frequency = sc->sc_freq;
+}
+
+void
 a9tmr_delay(unsigned int n)
 {
 	struct a9tmr_softc * const sc = &a9tmr_sc;

Index: src/sys/arch/arm/cortex/a9tmr_var.h
diff -u src/sys/arch/arm/cortex/a9tmr_var.h:1.3 src/sys/arch/arm/cortex/a9tmr_var.h:1.4
--- src/sys/arch/arm/cortex/a9tmr_var.h:1.3	Thu Jun 20 05:30:21 2013
+++ src/sys/arch/arm/cortex/a9tmr_var.h	Fri Jan  2 21:58:03 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: a9tmr_var.h,v 1.3 2013/06/20 05:30:21 matt Exp $ */
+/* $NetBSD: a9tmr_var.h,v 1.4 2015/01/02 21:58:03 jmcneill Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -47,6 +47,7 @@ struct a9tmr_softc {
 #ifdef _KERNEL
 struct cpu_info;
 void	a9tmr_init_cpu_clock(struct cpu_info *);
+void	a9tmr_update_freq(uint32_t);
 void	a9tmr_delay(unsigned int n);
 #endif
 



CVS commit: src/sys/dev/i2c

2015-01-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  2 21:55:31 UTC 2015

Modified Files:
src/sys/dev/i2c: act8846.c

Log Message:
disable ACT_DEBUG, but still print current state at attach


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/act8846.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/i2c/act8846.c
diff -u src/sys/dev/i2c/act8846.c:1.2 src/sys/dev/i2c/act8846.c:1.3
--- src/sys/dev/i2c/act8846.c:1.2	Thu Jan  1 17:59:18 2015
+++ src/sys/dev/i2c/act8846.c	Fri Jan  2 21:55:31 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: act8846.c,v 1.2 2015/01/01 17:59:18 jmcneill Exp $ */
+/* $NetBSD: act8846.c,v 1.3 2015/01/02 21:55:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -26,10 +26,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define ACT_DEBUG
+//#define ACT_DEBUG
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: act8846.c,v 1.2 2015/01/01 17:59:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: act8846.c,v 1.3 2015/01/02 21:55:31 jmcneill Exp $");
 
 #include 
 #include 
@@ -172,11 +172,9 @@ act8846_attach(device_t parent, device_t
 		sc->sc_ctrl[n].c_dev = self;
 	}
 
-#ifdef ACT_DEBUG
 	for (n = 0; n < sc->sc_nctrl; n++) {
 		act8846_print(&sc->sc_ctrl[n]);
 	}
-#endif
 }
 
 static int



CVS commit: src/sys/dev

2015-01-02 Thread John Klos
Module Name:src
Committed By:   jklos
Date:   Fri Jan  2 21:32:26 UTC 2015

Modified Files:
src/sys/dev/dec: dzkbd.c lk201_ws.c lk201var.h
src/sys/dev/tc: zskbd.c

Log Message:
Patches from Björ Johannesson to fix DEC LK201 keyboards, this time
applied to correct tree.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/dec/dzkbd.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/dec/lk201_ws.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/dec/lk201var.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/tc/zskbd.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/dec/dzkbd.c
diff -u src/sys/dev/dec/dzkbd.c:1.26 src/sys/dev/dec/dzkbd.c:1.27
--- src/sys/dev/dec/dzkbd.c:1.26	Sat Oct 27 17:18:15 2012
+++ src/sys/dev/dec/dzkbd.c	Fri Jan  2 21:32:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dzkbd.c,v 1.26 2012/10/27 17:18:15 chs Exp $	*/
+/*	$NetBSD: dzkbd.c,v 1.27 2015/01/02 21:32:26 jklos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.26 2012/10/27 17:18:15 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.27 2015/01/02 21:32:26 jklos Exp $");
 
 #include 
 #include 
@@ -237,7 +237,7 @@ dzkbd_cngetc(void *v, u_int *type, int *
 
 	do {
 		c = dzgetc(dzi->dzi_ls);
-	} while (!lk201_decode(&dzi->dzi_ks, c, type, data));
+	} while (!lk201_decode(&dzi->dzi_ks, 0, c, type, data) == LKD_NODATA);
 }
 
 static void
@@ -294,12 +294,15 @@ dzkbd_input(void *v, int data)
 	struct dzkbd_softc *sc = (struct dzkbd_softc *)v;
 	u_int type;
 	int val;
+	int decode;
 
-	if (sc->sc_enabled == 0)
-		return(0);
+	do {
+		decode = lk201_decode(&sc->sc_itl->dzi_ks, 1,
+		data, &type, &val);
+		if (decode != LKD_NODATA)
+			wskbd_input(sc->sc_wskbddev, type, val);
+	} while (decode == LKD_MORE);
 
-	if (lk201_decode(&sc->sc_itl->dzi_ks, data, &type, &val))
-		wskbd_input(sc->sc_wskbddev, type, val);
 	return(1);
 }
 

Index: src/sys/dev/dec/lk201_ws.c
diff -u src/sys/dev/dec/lk201_ws.c:1.8 src/sys/dev/dec/lk201_ws.c:1.9
--- src/sys/dev/dec/lk201_ws.c:1.8	Sat Mar 14 15:36:17 2009
+++ src/sys/dev/dec/lk201_ws.c	Fri Jan  2 21:32:26 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201_ws.c,v 1.8 2009/03/14 15:36:17 dsl Exp $ */
+/* $NetBSD: lk201_ws.c,v 1.9 2015/01/02 21:32:26 jklos Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,10 +27,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.8 2009/03/14 15:36:17 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.9 2015/01/02 21:32:26 jklos Exp $");
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -40,11 +41,23 @@ __KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v
 
 #define send(lks, c) ((*((lks)->attmt.sendchar))((lks)->attmt.cookie, c))
 
+void lk201_identify(void *);
+
+static callout_t lkkbd_id;
+
+static const char *lkkbd_descr[] = {
+	"no keyboard",
+	"LK-201 keyboard",
+	"LK-401 keyboard",
+};
+
 int
 lk201_init(struct lk201_state *lks)
 {
 	int i;
 
+	lks->waitack = 0;
+
 	send(lks, LK_LED_ENABLE);
 	send(lks, LK_LED_ALL);
 
@@ -69,20 +82,78 @@ lk201_init(struct lk201_state *lks)
 	send(lks, LK_LED_ALL);
 	lks->leds_state = 0;
 
+	callout_init(&lkkbd_id, 0);
+	callout_setfunc(&lkkbd_id, lk201_identify, lks);
+	callout_schedule(&lkkbd_id, 0);
+
 	return (0);
 }
 
+void
+lk201_identify(void *v)
+{
+	struct lk201_state *lks = v;
+	int i;
+
+	callout_destroy(&lkkbd_id);
+	/*
+	 * Swallow all the keyboard acknowledges from lk201_init().
+	 * There should be 14 of them - one per LK_CMD_MODE command.
+	 */
+	for(;;) {
+		lks->waitack = 1;
+		for (i = 100; i != 0; i--) {
+			DELAY(1000);
+			if (lks->waitack == 0)
+break;
+		}
+		if (i == 0)
+			break;
+	}
+
+	/*
+	 * Try to set the keyboard in LK-401 mode.
+	 * If we receive an error, this is an LK-201 keyboard.
+	 */
+	lks->waitack = 1;
+	send(lks, LK_ENABLE_401);
+	for (i = 100; i != 0; i--) {
+		DELAY(1000);
+		if (lks->waitack == 0)
+			break;
+	}
+	if (lks->waitack != 0)
+		lks->kbdtype = KBD_NONE;
+	else {
+		if (lks->ackdata == LK_INPUT_ERROR)
+			lks->kbdtype = KBD_LK201;
+		else
+			lks->kbdtype = KBD_LK401;
+	}
+	lks->waitack = 0;
+
+	printf("lkkbd0: %s\n", lkkbd_descr[lks->kbdtype]);
+}
+
 int
-lk201_decode(struct lk201_state *lks, int datain, u_int *type, int *dataout)
+lk201_decode(struct lk201_state *lks, int wantmulti, int datain, u_int *type, int *dataout)
 {
 	int i, freeslot;
 
+	if (lks->waitack != 0) {
+		lks->ackdata = datain;
+		lks->waitack = 0;
+		return LKD_NODATA;
+	}
+
 	switch (datain) {
+#if 0
 	case LK_KEY_UP:
 		for (i = 0; i < LK_KLL; i++)
 			lks->down_keys_list[i] = -1;
 		*type = WSCONS_EVENT_ALL_KEYS_UP;
 		return (1);
+#endif
 	case LK_POWER_UP:
 		printf("lk201_decode: powerup detected\n");
 		lk201_init(lks);
@@ -98,7 +169,25 @@ lk201_decode(struct lk201_state *lks, in
 		return (0);
 	}
 
-	if (datain < MIN_LK201_KEY || datain > MAX_LK201_KEY) {
+
+	if (datain == LK_KEY_UP) {
+		if (wantmulti) {
+		

CVS commit: src/distrib/sets/lists

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 21:18:51 UTC 2015

Modified Files:
src/distrib/sets/lists/base: ad.aarch64 ad.arm ad.mips ad.powerpc
ad.riscv md.amd64 md.sparc64 shl.mi
src/distrib/sets/lists/debug: ad.aarch64 ad.arm ad.mips ad.powerpc
ad.riscv md.amd64 md.sparc64 shl.mi

Log Message:
bump libmagic


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/base/ad.aarch64
cvs rdiff -u -r1.64 -r1.65 src/distrib/sets/lists/base/ad.arm
cvs rdiff -u -r1.59 -r1.60 src/distrib/sets/lists/base/ad.mips
cvs rdiff -u -r1.28 -r1.29 src/distrib/sets/lists/base/ad.powerpc
cvs rdiff -u -r1.10 -r1.11 src/distrib/sets/lists/base/ad.riscv
cvs rdiff -u -r1.255 -r1.256 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.243 -r1.244 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.727 -r1.728 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.13 -r1.14 src/distrib/sets/lists/debug/ad.aarch64
cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/debug/ad.arm
cvs rdiff -u -r1.49 -r1.50 src/distrib/sets/lists/debug/ad.mips
cvs rdiff -u -r1.29 -r1.30 src/distrib/sets/lists/debug/ad.powerpc
cvs rdiff -u -r1.10 -r1.11 src/distrib/sets/lists/debug/ad.riscv
cvs rdiff -u -r1.75 -r1.76 src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.72 -r1.73 src/distrib/sets/lists/debug/md.sparc64
cvs rdiff -u -r1.88 -r1.89 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/ad.aarch64
diff -u src/distrib/sets/lists/base/ad.aarch64:1.14 src/distrib/sets/lists/base/ad.aarch64:1.15
--- src/distrib/sets/lists/base/ad.aarch64:1.14	Tue Dec  9 23:42:24 2014
+++ src/distrib/sets/lists/base/ad.aarch64	Fri Jan  2 16:18:51 2015
@@ -1,4 +1,4 @@
-# $NetBSD: ad.aarch64,v 1.14 2014/12/10 04:42:24 christos Exp $
+# $NetBSD: ad.aarch64,v 1.15 2015/01/02 21:18:51 christos Exp $
 ./lib/eabi	base-compat-shlib	compat
 ./lib/eabi/npf	base-npf-shlib		compat
 ./lib/eabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -216,7 +216,7 @@
 ./usr/lib/eabi/libm.so.0base-compat-shlib	compat,pic
 ./usr/lib/eabi/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libmagic.so.5			base-compat-shlib	compat,pic
-./usr/lib/eabi/libmagic.so.5.0			base-compat-shlib	compat,pic
+./usr/lib/eabi/libmagic.so.5.1			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libmenu.so.6			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libmenu.so.6.0			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libmj.so.1base-compat-shlib	compat,pic,crypto
@@ -532,7 +532,7 @@
 ./usr/lib/eabihf/libm.so.0base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libmagic.so.5			base-compat-shlib	compat,pic
-./usr/lib/eabihf/libmagic.so.5.0			base-compat-shlib	compat,pic
+./usr/lib/eabihf/libmagic.so.5.1			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libmenu.so.6			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libmenu.so.6.0			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libmj.so.1base-compat-shlib	compat,pic,crypto
@@ -846,7 +846,7 @@
 ./usr/lib/oabi/libm.so.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmagic.so.5			base-compat-shlib	compat,pic
-./usr/lib/oabi/libmagic.so.5.0			base-compat-shlib	compat,pic
+./usr/lib/oabi/libmagic.so.5.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmenu.so.6			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmenu.so.6.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmj.so.1			base-compat-shlib	compat,pic,crypto

Index: src/distrib/sets/lists/base/ad.arm
diff -u src/distrib/sets/lists/base/ad.arm:1.64 src/distrib/sets/lists/base/ad.arm:1.65
--- src/distrib/sets/lists/base/ad.arm:1.64	Wed Dec 10 08:34:41 2014
+++ src/distrib/sets/lists/base/ad.arm	Fri Jan  2 16:18:51 2015
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.64 2014/12/10 13:34:41 christos Exp $
+# $NetBSD: ad.arm,v 1.65 2015/01/02 21:18:51 christos Exp $
 ./lib/oabi	base-compat-shlib	compat
 ./lib/oabi/npf	base-npf-shlib		compat
 ./lib/oabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -210,7 +210,7 @@
 ./usr/lib/oabi/libm.so.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmagic.so.5			base-compat-shlib	compat,pic
-./usr/lib/oabi/libmagic.so.5.0			base-compat-shlib	compat,pic
+./usr/lib/oabi/libmagic.so.5.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmenu.so.6			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmenu.so.6.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmj.so.1			base-compat-shlib	compat,pic,crypto

Index: src/distrib/sets/lists/base/ad.mips
diff -u src/distrib/sets/lists/base/ad.mips:1.59 src/distrib/sets/lists/base/ad.mips:1.60
--- src/distrib/sets/lists/base/ad.mips:1.59	Wed Dec 10 08:34:41 2014
+++ src/distrib/sets/lists/base/a

CVS commit: src/doc

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 21:16:42 UTC 2015

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new file


To generate a diff of this commit:
cvs rdiff -u -r1.1187 -r1.1188 src/doc/3RDPARTY
cvs rdiff -u -r1.2030 -r1.2031 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.1187 src/doc/3RDPARTY:1.1188
--- src/doc/3RDPARTY:1.1187	Thu Dec 25 12:24:25 2014
+++ src/doc/3RDPARTY	Fri Jan  2 16:16:41 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1187 2014/12/25 17:24:25 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1188 2015/01/02 21:16:41 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -369,8 +369,8 @@ Notes:
 Please use "expat" as the vendor tag for CVS imports.
 
 Package:	file
-Version:	5.20
-Current Vers:	5.20
+Version:	5.22
+Current Vers:	5.22
 Maintainer:	Christos Zoulas 
 Archive Site:	ftp://ftp.astron.com/pub/file/
 Home Page:	http://www.darwinsys.com/file/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2030 src/doc/CHANGES:1.2031
--- src/doc/CHANGES:1.2030	Tue Dec 30 02:18:42 2014
+++ src/doc/CHANGES	Fri Jan  2 16:16:41 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2030 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2031 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -116,3 +116,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dhcpcd(8): Import dhcpcd-6.6.7. [roy 20141219]
 	ntp: Import ntp 4.2.8. [christos 20141219]
 	midirecord(1): Add program to record MIDI files.  [mrg 20141229]
+	file: update to 5.22 security limits [christos 20150102]



CVS commit: src/external/bsd/file

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 21:15:32 UTC 2015

Modified Files:
src/external/bsd/file/dist: ChangeLog Makefile.in configure
configure.ac
src/external/bsd/file/dist/doc: file.1 libmagic.3 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: filesystems pgp
src/external/bsd/file/dist/src: Makefile.in apprentice.c cdf.c
cdf_time.c compress.c encoding.c file.c file.h fsmagic.c funcs.c
magic.c print.c readcdf.c readelf.c softmagic.c
src/external/bsd/file/include: config.h
src/external/bsd/file/lib: shlib_version

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/Makefile.in
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/doc/libmagic.3 \
src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/magic/magdir/pgp
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/Makefile.in \
src/external/bsd/file/dist/src/readcdf.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/cdf.c \
src/external/bsd/file/dist/src/fsmagic.c \
src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/cdf_time.c \
src/external/bsd/file/dist/src/file.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/compress.c \
src/external/bsd/file/dist/src/funcs.c \
src/external/bsd/file/dist/src/magic.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/encoding.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/include/config.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/lib/shlib_version

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/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.2 src/external/bsd/file/dist/ChangeLog:1.3
--- src/external/bsd/file/dist/ChangeLog:1.2	Mon Oct 20 17:48:57 2014
+++ src/external/bsd/file/dist/ChangeLog	Fri Jan  2 16:15:32 2015
@@ -1,3 +1,72 @@
+2015-01-02  15:15  Christos Zoulas 
+
+	* release 5.22
+
+2015-01-01  12:01  Christos Zoulas 
+
+	* add indirect relative for TIFF/Exif
+
+2014-12-16  18:10  Christos Zoulas 
+	
+	* restructure elf note printing to avoid repeated messages
+	* add note limit, suggested by Alexander Cherepanov
+
+2014-12-16  16:53  Christos Zoulas 
+	
+	* Bail out on partial pread()'s (Alexander Cherepanov)
+	* Fix incorrect bounds check in file_printable (Alexander Cherepanov)
+
+2014-12-11  20:01  Christos Zoulas 
+
+	* PR/405: ignore SIGPIPE from uncompress programs
+	* change printable -> file_printable and use it in
+	  more places for safety
+	* in ELF, instead of "(uses dynamic libraries)" when PT_INTERP
+	  is present print the interpreter name.
+	
+2014-12-10  20:01  Christos Zoulas 
+
+	* release 5.21
+
+2014-11-27  18:40  Christos Zoulas 
+
+	* Allow setting more parameters from the command line.
+	* Split name/use and indirect magic recursion limits.
+
+2014-11-27  11:12  Christos Zoulas 
+
+	* Adjust ELF parameters and the default recursion
+	  level.
+	* Allow setting the recursion level dynamically.
+
+2014-11-24   8:55  Christos Zoulas 
+
+	* The following fixes resulted from Thomas Jarosch's fuzzing
+	  tests that revealed severe performance issues on pathological
+	  input:
+	- limit number of elf program and sections processing
+	- abort elf note processing quickly
+	- reduce the number of recursion levels from 20 to 10
+	- preserve error messages in indirect magic handling
+
+	This is tracked as CVE-2014-8116 and CVE-2014-8117
+
+2014-11-12  10:30  Christos Zoulas 
+
+	* fix bogus free in the user buffer case.
+
+2014-11-11  12:35  Christos Zoulas 
+
+	* fix out of bounds read for pascal strings
+	* fix memory leak (not freeing the head of each mlist)
+
+2014-11-07  10:25  Christos Zoulas 
+
+	* When printing strings from a file, convert them to printable
+	  on a byte by byte basis, so that we don't get issues with
+	  locale's trying to interpret random byte streams as UTF-8 and
+	  having printf error out with EILSEQ.
+	  
 2014-10-17  11

CVS commit: src/sbin/newfs_udf

2015-01-02 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Jan  2 21:01:12 UTC 2015

Modified Files:
src/sbin/newfs_udf: udf_write.c

Log Message:
Fix volumesetname to comply to UDF 2.01 [2.2.2.5]


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/newfs_udf/udf_write.c

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

Modified files:

Index: src/sbin/newfs_udf/udf_write.c
diff -u src/sbin/newfs_udf/udf_write.c:1.8 src/sbin/newfs_udf/udf_write.c:1.9
--- src/sbin/newfs_udf/udf_write.c:1.8	Sun Aug 25 14:13:47 2013
+++ src/sbin/newfs_udf/udf_write.c	Fri Jan  2 21:01:12 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_write.c,v 1.8 2013/08/25 14:13:47 reinoud Exp $ */
+/* $NetBSD: udf_write.c,v 1.9 2015/01/02 21:01:12 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: udf_write.c,v 1.8 2013/08/25 14:13:47 reinoud Exp $");
+__RCSID("$NetBSD: udf_write.c,v 1.9 2015/01/02 21:01:12 reinoud Exp $");
 
 #include 
 #include 
@@ -317,6 +317,7 @@ udf_derive_format(int req_enable, int re
 int
 udf_proces_names(void)
 {
+	struct timeval time_of_day;
 	uint32_t primary_nr;
 	uint64_t volset_nr;
 
@@ -335,8 +336,9 @@ udf_proces_names(void)
 		if (mmc_discinfo.disc_flags & MMC_DFLAGS_BARCODEVALID) {
 			volset_nr = mmc_discinfo.disc_barcode;
 		} else {
-			volset_nr  =  (uint32_t) random();
-			volset_nr |= ((uint64_t) random()) << 32;
+			(void)gettimeofday(&time_of_day, NULL);
+			volset_nr  =  (uint64_t) random();
+			volset_nr |= ((uint64_t) time_of_day.tv_sec) << 32;
 		}
 		context.volset_name = calloc(128,1);
 		sprintf(context.volset_name, "%016"PRIx64, volset_nr);



CVS commit: [netbsd-7] src/doc

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 20:59:14 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Tickets #365, #366, #367, #368, #370, #371, #372


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.144 -r1.1.2.145 src/doc/CHANGES-7.0

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

Modified files:

Index: src/doc/CHANGES-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.144 src/doc/CHANGES-7.0:1.1.2.145
--- src/doc/CHANGES-7.0:1.1.2.144	Wed Dec 31 06:53:11 2014
+++ src/doc/CHANGES-7.0	Fri Jan  2 20:59:14 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.144 2014/12/31 06:53:11 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.145 2015/01/02 20:59:14 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -6912,3 +6912,45 @@ sys/arch/powerpc/powerpc/sig_machdep.c		
 	the TLS register is now handled entirely in userland.
 	[chs, ticket #364]
 
+sys/arch/arm/s3c2xx0/s3c2440_sdi.c		1.3
+sys/dev/ic/dm9000.c1.5
+
+	Avoid gcc 4.8 warnings.
+	[skrll, ticket #365]
+
+sys/arch/evbarm/stand/boot2440/main.c		1.5
+
+	Make this work with earm kernels.
+	[skrll, ticket #366]
+
+sys/arch/arm/allwinner/awin_reg.h		1.74
+
+	Fix RCSIDs.
+	[skrll, ticket #367]
+
+external/mit/xorg/server/xorg-server/Makefile.serverlib 1.5
+
+	Enable __GLX_ALIGN64 on sparc*.
+	Fixes crashes seen when using newer Mesa libGL.so.
+	[mrg, ticket #368]
+
+external/mit/xorg/lib/libGLU/Makefile		1.16
+
+	Switch over to the separate glu sources.
+	[mrg, ticket #370]
+
+share/mk/bsd.own.mk1.839
+
+	Switch PPC to GCC 4.8.
+	[mrg, ticket #371]
+
+sys/dev/usb/xhci.c1.28
+sys/dev/usb/xhcireg.h1.2
+
+	kern/49391: Fixes to XHCI driver command ring and status TRB.
+	CRCR needs 64byte aligned address.
+	Use usb_allocmem instead of usb_allocmem_flags(..., 0).
+	Correct status stage TRB in xhci_device_ctrl_start - direction
+	logic was wrong.
+	[skrll, ticket #372]
+



CVS import: src/external/bsd/file/dist

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 20:56:01 UTC 2015

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv3360

Log Message:
Import file 5.22

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_22

C src/external/bsd/file/dist/Makefile.in
U src/external/bsd/file/dist/Makefile.am
U src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/acinclude.m4
U src/external/bsd/file/dist/configure.ac
U src/external/bsd/file/dist/aclocal.m4
U src/external/bsd/file/dist/config.h.in
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
U src/external/bsd/file/dist/ChangeLog
U src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/README
U src/external/bsd/file/dist/TODO
U src/external/bsd/file/dist/compile
U src/external/bsd/file/dist/config.guess
U src/external/bsd/file/dist/config.sub
U src/external/bsd/file/dist/depcomp
U src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/ltmain.sh
U src/external/bsd/file/dist/MAINT
U src/external/bsd/file/dist/m4/lt~obsolete.m4
U src/external/bsd/file/dist/m4/libtool.m4
U src/external/bsd/file/dist/m4/ltoptions.m4
U src/external/bsd/file/dist/m4/ltsugar.m4
U src/external/bsd/file/dist/m4/ltversion.m4
U src/external/bsd/file/dist/src/getopt_long.c
U src/external/bsd/file/dist/src/Makefile.in
U src/external/bsd/file/dist/src/Makefile.am
U src/external/bsd/file/dist/src/ctime_r.c
U src/external/bsd/file/dist/src/vasprintf.c
U src/external/bsd/file/dist/src/asctime_r.c
U src/external/bsd/file/dist/src/asprintf.c
U src/external/bsd/file/dist/src/strcasestr.c
U src/external/bsd/file/dist/src/pread.c
U src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/strlcat.c
U src/external/bsd/file/dist/src/fmtcheck.c
U src/external/bsd/file/dist/src/apprentice.c
U src/external/bsd/file/dist/src/magic.h
U src/external/bsd/file/dist/src/magic.c
U src/external/bsd/file/dist/src/mygetopt.h
U src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
U src/external/bsd/file/dist/src/encoding.c
U src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
U src/external/bsd/file/dist/src/readelf.c
U src/external/bsd/file/dist/src/print.c
U src/external/bsd/file/dist/src/fsmagic.c
U src/external/bsd/file/dist/src/funcs.c
U src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/readelf.h
U src/external/bsd/file/dist/src/tar.h
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
U src/external/bsd/file/dist/src/cdf.c
U src/external/bsd/file/dist/src/cdf_time.c
U src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
U src/external/bsd/file/dist/src/file.c
U src/external/bsd/file/dist/src/magic.h.in
U src/external/bsd/file/dist/magic/Makefile.in
U src/external/bsd/file/dist/magic/Makefile.am
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
U src/external/bsd/file/dist/magic/magdir/android
U src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/aout
U src/external/bsd/file/dist/magic/magdir/apl
U src/external/bsd/file/dist/magic/magdir/assembler
U src/external/bsd/file/dist/magic/magdir/applix
U src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/blackberry
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/communications
U src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
U src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/efi
U src/external/bsd/file/dist/magic/magdir/c-lang
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/cad
U src/external/bsd/file/dist/magic/magdir/cafebabe
U src/external/bsd/file/dist/magic/magdir/cddb
U src/external/bsd/file/dist/magic/magdir/chord
U src/external/bsd/file/dist/magic/magdir/cisco
U src/exter

CVS commit: [netbsd-7] src/share/mk

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 20:47:51 UTC 2015

Modified Files:
src/share/mk [netbsd-7]: bsd.own.mk

Log Message:
Pull up following revision(s) (requested by mrg in ticket #371):
share/mk/bsd.own.mk: revision 1.839
switch PPC to GCC 4.8.


To generate a diff of this commit:
cvs rdiff -u -r1.829.2.1 -r1.829.2.2 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.829.2.1 src/share/mk/bsd.own.mk:1.829.2.2
--- src/share/mk/bsd.own.mk:1.829.2.1	Tue Dec 23 02:58:33 2014
+++ src/share/mk/bsd.own.mk	Fri Jan  2 20:47:51 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.829.2.1 2014/12/23 02:58:33 snj Exp $
+#	$NetBSD: bsd.own.mk,v 1.829.2.2 2015/01/02 20:47:51 martin Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -64,7 +64,6 @@ MKGCC?=		no
 # Platforms still using GCC 4.5
 .if \
   ${MACHINE_CPU} == "m68k" || \
-  ${MACHINE_ARCH} == "powerpc" || \
   ${MACHINE_ARCH} == "powerpc64"
 HAVE_GCC?=45
 



CVS commit: src/sys/dev/usb

2015-01-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan  2 20:42:44 UTC 2015

Modified Files:
src/sys/dev/usb: umidi.c

Log Message:
actually fix one of the previous:  don't test for NULL after deref.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/usb/umidi.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/umidi.c
diff -u src/sys/dev/usb/umidi.c:1.67 src/sys/dev/usb/umidi.c:1.68
--- src/sys/dev/usb/umidi.c:1.67	Fri Jan  2 16:38:45 2015
+++ src/sys/dev/usb/umidi.c	Fri Jan  2 20:42:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: umidi.c,v 1.67 2015/01/02 16:38:45 christos Exp $	*/
+/*	$NetBSD: umidi.c,v 1.68 2015/01/02 20:42:44 mrg Exp $	*/
 
 /*
  * Copyright (c) 2001, 2012, 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.67 2015/01/02 16:38:45 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.68 2015/01/02 20:42:44 mrg Exp $");
 
 #include 
 #include 
@@ -493,8 +493,6 @@ umidi_open(void *addr,
 	KASSERT(mutex_owned(&sc->sc_lock));
 	DPRINTF(("umidi_open: sc=%p\n", sc));
 
-	if (!sc)
-		return ENXIO;
 	if (mididev->opened)
 		return EBUSY;
 	if (sc->sc_dying)



CVS commit: [netbsd-7] src/external/mit/xorg/lib/libGLU

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 20:41:51 UTC 2015

Modified Files:
src/external/mit/xorg/lib/libGLU [netbsd-7]: Makefile

Log Message:
Pull up following revision(s) (requested by mrg in ticket #370):
external/mit/xorg/lib/libGLU/Makefile: revision 1.16
switch over to the separate glu sources.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.2.1 src/external/mit/xorg/lib/libGLU/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/mit/xorg/lib/libGLU/Makefile
diff -u src/external/mit/xorg/lib/libGLU/Makefile:1.15 src/external/mit/xorg/lib/libGLU/Makefile:1.15.2.1
--- src/external/mit/xorg/lib/libGLU/Makefile:1.15	Mon Jul 14 00:22:46 2014
+++ src/external/mit/xorg/lib/libGLU/Makefile	Fri Jan  2 20:41:51 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2014/07/14 00:22:46 riz Exp $
+#	$NetBSD: Makefile,v 1.15.2.1 2015/01/02 20:41:51 martin Exp $
 
 NOLINT=		1	# XTODO: tess.ln SIGSEGVs lint :(
 
@@ -7,67 +7,127 @@ NOLINT=		1	# XTODO: tess.ln SIGSEGVs lin
 LIB=		GLU
 LIBISCXX=	yes
 
-GLUDIR=		${X11SRCDIR.MesaLib}/src/glu/sgi
+GLUDIR=		${X11SRCDIR.glu}/src
 
-SRCS.libutil=	error.c glue.c mipmap.c project.c quad.c registry.c
+SRCS.libutil=	\
+	error.c \
+	glue.c \
+	mipmap.c \
+	project.c \
+	quad.c \
+	registry.c
 .PATH:		${GLUDIR}/libutil
 
-SRCS.libtess=	dict.c geom.c memalloc.c mesh.c normal.c priorityq.c \
-		render.c sweep.c tess.c tessmono.c
+SRCS.libtess=	\
+	dict.c \
+	geom.c \
+	memalloc.c \
+	mesh.c \
+	normal.c \
+	priorityq.c \
+	render.c \
+	sweep.c \
+	tess.c \
+	tessmono.c 
 .PATH:		${GLUDIR}/libtess
 
-SRCS.interface=	bezierEval.cc bezierPatch.cc bezierPatchMesh.cc \
-		glcurveval.cc glinterface.cc glrenderer.cc \
-		glsurfeval.cc incurveeval.cc insurfeval.cc
+SRCS.interface=	\
+	bezierEval.cc \
+	bezierPatch.cc \
+	bezierPatchMesh.cc \
+	glcurveval.cc \
+	glinterface.cc \
+	glrenderer.cc \
+	glsurfeval.cc \
+	incurveeval.cc \
+	insurfeval.cc
 .PATH:		${GLUDIR}/libnurbs/interface
-.for fn in ${SRCS.interface}
-CPPFLAGS.${fn}+=-I${GLUDIR}/libnurbs/internals \
-		-I${GLUDIR}/libnurbs/nurbtess \
-		-DLIBRARYBUILD
-.endfor
 
-SRCS.internals=	arc.cc arcsorter.cc arctess.cc backend.cc \
-		basiccrveval.cc basicsurfeval.cc bin.cc bufpool.cc \
-		cachingeval.cc ccw.cc coveandtiler.cc curve.cc \
-		curvelist.cc curvesub.cc dataTransform.cc displaylist.cc \
-		flist.cc flistsorter.cc hull.cc intersect.cc \
-		knotvector.cc mapdesc.cc mapdescv.cc maplist.cc \
-		mesher.cc monoTriangulationBackend.cc monotonizer.cc \
-		mycode.cc nurbsinterfac.cc nurbstess.cc patch.cc \
-		patchlist.cc quilt.cc reader.cc renderhints.cc \
-		slicer.cc sorter.cc splitarcs.cc subdivider.cc \
-		tobezier.cc trimline.cc trimregion.cc trimvertpool.cc \
-		uarray.cc varray.cc
+SRCS.internals=	\
+	arc.cc \
+	arcsorter.cc \
+	arctess.cc \
+	backend.cc \
+	basiccrveval.cc \
+	basicsurfeval.cc \
+	bin.cc \
+	bufpool.cc \
+	cachingeval.cc \
+	ccw.cc \
+	coveandtiler.cc \
+	curve.cc \
+	curvelist.cc \
+	curvesub.cc \
+	dataTransform.cc \
+	displaylist.cc \
+	flist.cc \
+	flistsorter.cc \
+	hull.cc \
+	intersect.cc \
+	knotvector.cc \
+	mapdesc.cc \
+	mapdescv.cc \
+	maplist.cc \
+	mesher.cc \
+	monoTriangulationBackend.cc \
+	monotonizer.cc \
+	mycode.cc \
+	nurbsinterfac.cc \
+	nurbstess.cc \
+	patch.cc \
+	patchlist.cc \
+	quilt.cc \
+	reader.cc \
+	renderhints.cc \
+	slicer.cc \
+	sorter.cc \
+	splitarcs.cc \
+	subdivider.cc \
+	tobezier.cc \
+	trimline.cc \
+	trimregion.cc \
+	trimvertpool.cc \
+	uarray.cc \
+	varray.cc
 .PATH:		${GLUDIR}/libnurbs/internals
 .for fn in ${SRCS.internals}
-CPPFLAGS.${fn}+=-I${GLUDIR}/libnurbs/internals \
-		-I${GLUDIR}/libnurbs/nurbtess \
-		-I${GLUDIR}/libutil \
-		-DLIBRARYBUILD -D_EXTENSIONS_
+CPPFLAGS.${fn}+= -D_EXTENSIONS_
 .endfor
 
-SRCS.nurbtess=	directedLine.cc gridWrap.cc monoChain.cc monoPolyPart.cc \
-		monoTriangulation.cc partitionX.cc partitionY.cc \
-		polyDBG.cc polyUtil.cc primitiveStream.cc quicksort.cc \
-		rectBlock.cc sampleComp.cc sampleCompBot.cc \
-		sampleCompRight.cc sampleCompTop.cc sampleMonoPoly.cc \
-		sampledLine.cc searchTree.cc
+SRCS.nurbtess=	\
+	directedLine.cc \
+	gridWrap.cc \
+	monoChain.cc \
+	monoPolyPart.cc \
+	monoTriangulation.cc \
+	partitionX.cc \
+	partitionY.cc \
+	polyDBG.cc \
+	polyUtil.cc \
+	primitiveStream.cc \
+	quicksort.cc \
+	rectBlock.cc \
+	sampleComp.cc \
+	sampleCompBot.cc \
+	sampleCompRight.cc \
+	sampleCompTop.cc \
+	sampleMonoPoly.cc \
+	sampledLine.cc \
+	searchTree.cc
 .PATH:		${GLUDIR}/libnurbs/nurbtess
-.for fn in ${SRCS.nurbtess}
-CPPFLAGS.${fn}+=-I${GLUDIR}/libnurbs/internals \
-		-I${GLUDIR}/libnurbs/nurbtess \
-		-DLIBRARYBUILD
-.endfor
 
-CPPFLAGS+=	-I${GLUDIR}/include
 CPPFLAGS+=	-DPTHREADS -DUSE_XSHM -DHZ=100 -DNDEBUG -DLIBRARYBUILD
+CPPFLAGS+=	-I${GLUDIR}/include \
+		-I${GLUDIR}/libnurbs/internals \
+		-I${GLUDIR}/libnurbs/interface \
+		-I${GLUDIR}/libnu

CVS commit: [netbsd-7] src/external/mit/xorg/server/xorg-server

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 20:38:36 UTC 2015

Modified Files:
src/external/mit/xorg/server/xorg-server [netbsd-7]: Makefile.serverlib

Log Message:
Pull up following revision(s) (requested by mrg in ticket #368):
external/mit/xorg/server/xorg-server/Makefile.serverlib: revision 1.5
enable __GLX_ALIGN64 on sparc*.  probably more need it.
fixes crashes seen when using newer Mesa libGL.so.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.42.1 \
src/external/mit/xorg/server/xorg-server/Makefile.serverlib

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

Modified files:

Index: src/external/mit/xorg/server/xorg-server/Makefile.serverlib
diff -u src/external/mit/xorg/server/xorg-server/Makefile.serverlib:1.4 src/external/mit/xorg/server/xorg-server/Makefile.serverlib:1.4.42.1
--- src/external/mit/xorg/server/xorg-server/Makefile.serverlib:1.4	Sun Aug 24 13:43:57 2008
+++ src/external/mit/xorg/server/xorg-server/Makefile.serverlib	Fri Jan  2 20:38:36 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.serverlib,v 1.4 2008/08/24 13:43:57 rtr Exp $
+#	$NetBSD: Makefile.serverlib,v 1.4.42.1 2015/01/02 20:38:36 martin Exp $
 
 NOLINT= 1
 NOPROFILE=  1
@@ -17,3 +17,6 @@ X_BYTE_ORDER=0
 CPPFLAGS+=	${X11FLAGS.SERVER}
 CPPFLAGS+=	-DXORG_VERSION_CURRENT=${XORG_VERSION_CURRENT}
 
+.if (${MACHINE_ARCH} == "sparc") || (${MACHINE_ARCH} == "sparc64")
+CPPFLAGS+=	-D__GLX_ALIGN64
+.endif



CVS import: src/external/bsd/file/dist

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 20:34:30 UTC 2015

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv10669

Log Message:
Import file-5.22

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_22

U src/external/bsd/file/dist/Makefile.in
U src/external/bsd/file/dist/Makefile.am
C src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/acinclude.m4
C src/external/bsd/file/dist/configure.ac
U src/external/bsd/file/dist/aclocal.m4
C src/external/bsd/file/dist/config.h.in
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
C src/external/bsd/file/dist/ChangeLog
U src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/README
U src/external/bsd/file/dist/TODO
U src/external/bsd/file/dist/compile
U src/external/bsd/file/dist/config.guess
U src/external/bsd/file/dist/config.sub
U src/external/bsd/file/dist/depcomp
U src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/ltmain.sh
U src/external/bsd/file/dist/MAINT
U src/external/bsd/file/dist/m4/lt~obsolete.m4
U src/external/bsd/file/dist/m4/libtool.m4
U src/external/bsd/file/dist/m4/ltoptions.m4
U src/external/bsd/file/dist/m4/ltsugar.m4
U src/external/bsd/file/dist/m4/ltversion.m4
U src/external/bsd/file/dist/src/getopt_long.c
C src/external/bsd/file/dist/src/Makefile.in
U src/external/bsd/file/dist/src/Makefile.am
U src/external/bsd/file/dist/src/ctime_r.c
U src/external/bsd/file/dist/src/vasprintf.c
U src/external/bsd/file/dist/src/asctime_r.c
U src/external/bsd/file/dist/src/asprintf.c
U src/external/bsd/file/dist/src/strcasestr.c
U src/external/bsd/file/dist/src/pread.c
U src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/strlcat.c
U src/external/bsd/file/dist/src/fmtcheck.c
C src/external/bsd/file/dist/src/apprentice.c
C src/external/bsd/file/dist/src/magic.h
C src/external/bsd/file/dist/src/magic.c
U src/external/bsd/file/dist/src/mygetopt.h
C src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
C src/external/bsd/file/dist/src/encoding.c
C src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
C src/external/bsd/file/dist/src/readelf.c
C src/external/bsd/file/dist/src/print.c
C src/external/bsd/file/dist/src/fsmagic.c
C src/external/bsd/file/dist/src/funcs.c
C src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/readelf.h
U src/external/bsd/file/dist/src/tar.h
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
C src/external/bsd/file/dist/src/cdf.c
C src/external/bsd/file/dist/src/cdf_time.c
C src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
C src/external/bsd/file/dist/src/file.c
U src/external/bsd/file/dist/src/magic.h.in
C src/external/bsd/file/dist/magic/Makefile.in
C src/external/bsd/file/dist/magic/Makefile.am
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
U src/external/bsd/file/dist/magic/magdir/android
U src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/aout
U src/external/bsd/file/dist/magic/magdir/apl
U src/external/bsd/file/dist/magic/magdir/assembler
U src/external/bsd/file/dist/magic/magdir/applix
U src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/blackberry
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/communications
U src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
U src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/efi
U src/external/bsd/file/dist/magic/magdir/c-lang
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/cad
U src/external/bsd/file/dist/magic/magdir/cafebabe
U src/external/bsd/file/dist/magic/magdir/cddb
U src/external/bsd/file/dist/magic/magdir/chord
U src/external/bsd/file/dist/magic/magdir/cisco
U src/exte

CVS commit: [netbsd-7] src/sys/arch/arm/allwinner

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 20:32:02 UTC 2015

Modified Files:
src/sys/arch/arm/allwinner [netbsd-7]: awin_reg.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #367):
sys/arch/arm/allwinner/awin_reg.h: revision 1.74
RCSID police


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.10 -r1.14.2.11 src/sys/arch/arm/allwinner/awin_reg.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/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.14.2.10 src/sys/arch/arm/allwinner/awin_reg.h:1.14.2.11
--- src/sys/arch/arm/allwinner/awin_reg.h:1.14.2.10	Tue Dec  9 19:21:09 2014
+++ src/sys/arch/arm/allwinner/awin_reg.h	Fri Jan  2 20:32:02 2015
@@ -1,4 +1,5 @@
-/* $NetBSD */
+/* $NetBSD: awin_reg.h,v 1.14.2.11 2015/01/02 20:32:02 martin Exp $ */
+
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.



CVS commit: [netbsd-7] src/sys/arch/evbarm/stand/boot2440

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 20:29:08 UTC 2015

Modified Files:
src/sys/arch/evbarm/stand/boot2440 [netbsd-7]: main.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #366):
sys/arch/evbarm/stand/boot2440/main.c: revision 1.5
Make this work with earm kernels. Not sure the test is realy worth it.
Partially from Greg Willatt


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/arch/evbarm/stand/boot2440/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/arch/evbarm/stand/boot2440/main.c
diff -u src/sys/arch/evbarm/stand/boot2440/main.c:1.4 src/sys/arch/evbarm/stand/boot2440/main.c:1.4.4.1
--- src/sys/arch/evbarm/stand/boot2440/main.c:1.4	Sun Dec  1 02:52:53 2013
+++ src/sys/arch/evbarm/stand/boot2440/main.c	Fri Jan  2 20:29:08 2015
@@ -112,7 +112,7 @@ main(int argc, char *argv[])
 	int fclk, hclk;
 	int fd;
 	unsigned long marks[MARK_MAX];
-	unsigned char hdr[0x26];
+	unsigned char hdr[0x28];
 	void (*entry)(void*);
 	unsigned elfpriv;
 	char *bootfile;
@@ -236,16 +236,17 @@ main(int argc, char *argv[])
 #endif
 	/*
 	 * ARM ELF header has a distinctive value in "private flags"
-	 * field of offset [0x24:25];
-	 * - NetBSD 02 06
+	 * field of offset [0x24-x027];
+	 * - NetBSD 02 06 (oarm)
 	 * - Linux  02 00 (2.4) or 02 02 (2.6)
+	 * - NetBSD 02 00 00 05 (earm)
 	 */
 	lseek(fd, (off_t)0, SEEK_SET);
 	read(fd, &hdr, sizeof(hdr));
 	memcpy(&elfpriv, &hdr[0x24], sizeof(elfpriv));
 
 	entry = (void *)marks[MARK_ENTRY];
-	if (elfpriv == 0x0602) {
+	if (elfpriv == 0x0602 || elfpriv == 0x502) {
 		struct btinfo_symtab bi_syms;
 
 		bi_syms.nsym = marks[MARK_NSYM];



CVS commit: [netbsd-7] src/sys

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 20:24:14 UTC 2015

Modified Files:
src/sys/arch/arm/s3c2xx0 [netbsd-7]: s3c2440_sdi.c
src/sys/dev/ic [netbsd-7]: dm9000.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #365):
sys/dev/ic/dm9000.c: revision 1.5
sys/arch/arm/s3c2xx0/s3c2440_sdi.c: revision 1.3
Appease gcc 4.8 - from Greg Willatt in private email.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.12.1 src/sys/arch/arm/s3c2xx0/s3c2440_sdi.c
cvs rdiff -u -r1.4 -r1.4.22.1 src/sys/dev/ic/dm9000.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/s3c2xx0/s3c2440_sdi.c
diff -u src/sys/arch/arm/s3c2xx0/s3c2440_sdi.c:1.2 src/sys/arch/arm/s3c2xx0/s3c2440_sdi.c:1.2.12.1
--- src/sys/arch/arm/s3c2xx0/s3c2440_sdi.c:1.2	Sat Oct 27 17:17:40 2012
+++ src/sys/arch/arm/s3c2xx0/s3c2440_sdi.c	Fri Jan  2 20:24:14 2015
@@ -384,7 +384,9 @@ sssdi_exec_command(sdmmc_chipset_handle_
 	struct sssdi_softc *sc = (struct sssdi_softc*)sch;
 	uint32_t cmd_control;
 	int status = 0;
+#ifdef SSSDI_DEBUG
 	uint32_t data_status;
+#endif
 	int transfer = SSSDI_TRANSFER_NONE;
 	dmac_xfer_t xfer;
 
@@ -566,8 +568,8 @@ sssdi_exec_command(sdmmc_chipset_handle_
 	DPRINTF(("Remaining Block Number  : %d\n",
 		 SDIDATCNT_BLK_NUM_CNT(status)));
 
-	data_status = bus_space_read_4(sc->iot, sc->ioh, SDI_DAT_STA);
 #ifdef SSSDI_DEBUG
+	data_status = bus_space_read_4(sc->iot, sc->ioh, SDI_DAT_STA);
 	printf("SDI Data Status Register Before xfer: 0x%X\n", data_status);
 #endif
 	if (transfer == SSSDI_TRANSFER_READ) {
@@ -646,7 +648,6 @@ sssdi_exec_command(sdmmc_chipset_handle_
 
 void sssdi_perform_pio_read(struct sssdi_softc *sc, struct sdmmc_command *cmd)
 {
-	uint32_t status;
 	uint32_t fifo_status;
 	int count;
 	uint32_t written;
@@ -657,7 +658,7 @@ void sssdi_perform_pio_read(struct sssdi
 	while (written < cmd->c_datalen ) {
 		/* Wait until the FIFO is full or has the final data.
 		   In the latter case it might not get filled. */
-		status = sssdi_wait_intr(sc, SDI_FIFO_RX_FULL | SDI_FIFO_RX_LAST, 1000);
+		sssdi_wait_intr(sc, SDI_FIFO_RX_FULL | SDI_FIFO_RX_LAST, 1000);
 
 		fifo_status = bus_space_read_4(sc->iot, sc->ioh, SDI_DAT_FSTA);
 		count = SDIDATFSTA_FFCNT(fifo_status);

Index: src/sys/dev/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.4 src/sys/dev/ic/dm9000.c:1.4.22.1
--- src/sys/dev/ic/dm9000.c:1.4	Sat Jan 28 08:29:55 2012
+++ src/sys/dev/ic/dm9000.c	Fri Jan  2 20:24:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.4 2012/01/28 08:29:55 nisimura Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.4.22.1 2015/01/02 20:24:14 martin Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -762,7 +762,6 @@ dme_mediastatus(struct ifnet *ifp, struc
 void
 dme_transmit(struct dme_softc *sc)
 {
-	uint8_t status;
 
 	TX_DPRINTF(("dme_transmit: PRE: txready: %d, txbusy: %d\n",
 		sc->txready, sc->txbusy));
@@ -771,7 +770,7 @@ dme_transmit(struct dme_softc *sc)
 	dme_write(sc, DM9000_TXPLH, (sc->txready_length >> 8) & 0xff );
 
 	/* Request to send the packet */
-	status = dme_read(sc, DM9000_ISR);
+	dme_read(sc, DM9000_ISR);
 
 	dme_write(sc, DM9000_TCR, DM9000_TCR_TXREQ);
 



CVS commit: src/bin/sh

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 19:56:20 UTC 2015

Modified Files:
src/bin/sh: eval.c options.h

Log Message:
Define an undocumented -F option to only use fork instead of vfork for
debugging purposes.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/bin/sh/eval.c
cvs rdiff -u -r1.20 -r1.21 src/bin/sh/options.h

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.109 src/bin/sh/eval.c:1.110
--- src/bin/sh/eval.c:1.109	Sat May 31 10:42:18 2014
+++ src/bin/sh/eval.c	Fri Jan  2 14:56:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.109 2014/05/31 14:42:18 christos Exp $	*/
+/*	$NetBSD: eval.c,v 1.110 2015/01/02 19:56:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.109 2014/05/31 14:42:18 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.110 2015/01/02 19:56:20 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -860,7 +860,7 @@ evalcommand(union node *cmd, int flgs, s
 		 * child's address space is actually shared with the parent as
 		 * we rely on this.
 		 */
-		if (cmdentry.cmdtype == CMDNORMAL) {
+		if (usefork == 0 && cmdentry.cmdtype == CMDNORMAL) {
 			pid_t	pid;
 			int serrno;
 

Index: src/bin/sh/options.h
diff -u src/bin/sh/options.h:1.20 src/bin/sh/options.h:1.21
--- src/bin/sh/options.h:1.20	Sat Jun 18 17:18:46 2011
+++ src/bin/sh/options.h	Fri Jan  2 14:56:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.h,v 1.20 2011/06/18 21:18:46 christos Exp $	*/
+/*	$NetBSD: options.h,v 1.21 2015/01/02 19:56:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -99,9 +99,11 @@ DEF_OPT( "cdprint",	0 )	/* always print 
 #define	cdprint optlist[17].val
 DEF_OPT( "tabcomplete",	0 )	/*  causes filename expansion */
 #define	tabcomplete optlist[18].val
+DEF_OPT( "fork",	'F' )	/* use fork(2) instead of vfork(2) */
+#define	usefork optlist[19].val
 #ifdef DEBUG
 DEF_OPT( "debug",	0 )	/* enable debug prints */
-#define	debug optlist[19].val
+#define	debug optlist[20].val
 #endif
 
 #ifdef DEFINE_OPTIONS



CVS commit: src/external/gpl3/binutils/dist/bfd

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 19:50:03 UTC 2015

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf64-ppc.c

Log Message:
Bring in 2 patches from binutils:

>From Alan Modra: Wed, 3 Jul 2013 11:51:56 +0930: powerpc64 call stubs:
This brings powerpc64 ld in line with gold regarding calls allowed to
go via a plt call stub or toc-adjusting stub without a following nop.
A long time ago ld allowed tail calls, but this is wrong because we'll
return to the caller's caller with the wrong toc pointer.  I fixed
that for shared libraries but allowed tail calls in an executable for
some reason.  Probably just muddy thinking on my part, because there's
no difference between an executable and a shared library regarding the
need to restore the toc pointer.  Perhaps it was because some testcase
failed, most likely due to the g++ issue I comment on in the patch.

>From Alan Modra: 29 Aug 2014 01:22:29 +: PowerPC64 call lacks nop error:
Enough people accidentally or otherwise use -mcmodel=small then wonder
why a call that is local is behaving as if it is going via the PLT.

* elf64-ppc.c (ppc64_elf_relocate_section): Report a different
error for calls via a toc adjusting stub without a nop.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/elf64-ppc.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/gpl3/binutils/dist/bfd/elf64-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.5 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.6
--- src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.5	Thu Mar  6 04:33:14 2014
+++ src/external/gpl3/binutils/dist/bfd/elf64-ppc.c	Fri Jan  2 14:50:02 2015
@@ -3618,9 +3618,6 @@ struct ppc_stub_hash_entry {
   struct ppc_link_hash_entry *h;
   struct plt_entry *plt_ent;
 
-  /* And the reloc addend that this was derived from.  */
-  bfd_vma addend;
-
   /* Where this stub is being called from, or, in the case of combined
  stub sections, the first input section in the group.  */
   asection *id_sec;
@@ -11669,7 +11666,6 @@ ppc64_elf_size_stubs (struct bfd_link_in
 		}
 		  stub_entry->h = hash;
 		  stub_entry->plt_ent = plt_ent;
-		  stub_entry->addend = irela->r_addend;
 
 		  if (stub_entry->h != NULL)
 		htab->stub_globals += 1;
@@ -12910,60 +12906,96 @@ ppc64_elf_relocate_section (bfd *output_
 	{
 	  bfd_boolean can_plt_call = FALSE;
 
+	  /* All of these stubs will modify r2, so there must be a
+		 branch and link followed by a nop.  The nop is
+		 replaced by an insn to restore r2.  */
 	  if (rel->r_offset + 8 <= input_section->size)
 		{
-		  unsigned long nop;
-		  nop = bfd_get_32 (input_bfd, contents + rel->r_offset + 4);
-		  if (nop == NOP
-		  || nop == CROR_151515 || nop == CROR_313131)
-		{
-		  if (h != NULL
-			  && (h == htab->tls_get_addr_fd
-			  || h == htab->tls_get_addr)
-			  && !htab->no_tls_get_addr_opt)
+		  unsigned long br;
+
+		  br = bfd_get_32 (input_bfd,
+   contents + rel->r_offset);
+		  if ((br & 1) != 0)
+		{
+		  unsigned long nop;
+
+		  nop = bfd_get_32 (input_bfd,
+	contents + rel->r_offset + 4);
+		  if (nop == NOP
+			  || nop == CROR_151515 || nop == CROR_313131)
 			{
-			  /* Special stub used, leave nop alone.  */
+			  if (h != NULL
+			  && (h == htab->tls_get_addr_fd
+  || h == htab->tls_get_addr)
+			  && !htab->no_tls_get_addr_opt)
+			{
+			  /* Special stub used, leave nop alone.  */
+			}
+			  else
+			bfd_put_32 (input_bfd, LD_R2_40R1,
+	contents + rel->r_offset + 4);
+			  can_plt_call = TRUE;
 			}
-		  else
-			bfd_put_32 (input_bfd, LD_R2_40R1,
-contents + rel->r_offset + 4);
-		  can_plt_call = TRUE;
 		}
 		}
 
-	  if (!can_plt_call)
+	  if (!can_plt_call && h != NULL)
 		{
-		  if (stub_entry->stub_type == ppc_stub_plt_call
-		  || stub_entry->stub_type == ppc_stub_plt_call_r2save)
-		{
-		  /* If this is a plain branch rather than a branch
-			 and link, don't require a nop.  However, don't
-			 allow tail calls in a shared library as they
-			 will result in r2 being corrupted.  */
-		  unsigned long br;
-		  br = bfd_get_32 (input_bfd, contents + rel->r_offset);
-		  if (info->executable && (br & 1) == 0)
-			can_plt_call = TRUE;
-		  else
-			stub_entry = NULL;
-		}
-		  else if (h != NULL
-			   && strcmp (h->elf.root.root.string,
-  ".__libc_start_main") == 0)
+		  const char *name = h->elf.root.root.string;
+
+		  if (*name == '.')
+		++name;
+
+		  if (strncmp (name, "__libc_start_main", 17) == 0
+		  && (name[17] == 0 || name[17] == '@'))
 		{
-		  /* Allow crt1 branch to go via a toc adjusting stub.  */
+		  /* Allow crt1 branch to go via a toc adjusting
+			

CVS commit: src

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 19:46:02 UTC 2015

Modified Files:
src/sbin/disklabel: main.c
src/usr.sbin/bad144: bad144.c
src/usr.sbin/diskpart: diskpart.c

Log Message:
Fix the 3 programs that use DTYPE_ (disklabel disk types) constants from the
kernel. Two of them are inside ifdefs.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/disklabel/main.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/bad144/bad144.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/diskpart/diskpart.c

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

Modified files:

Index: src/sbin/disklabel/main.c
diff -u src/sbin/disklabel/main.c:1.42 src/sbin/disklabel/main.c:1.43
--- src/sbin/disklabel/main.c:1.42	Fri Sep 19 13:45:03 2014
+++ src/sbin/disklabel/main.c	Fri Jan  2 14:46:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.42 2014/09/19 17:45:03 matt Exp $	*/
+/*	$NetBSD: main.c,v 1.43 2015/01/02 19:46:02 christos Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 static char sccsid[] = "@(#)disklabel.c	8.4 (Berkeley) 5/4/95";
 /* from static char sccsid[] = "@(#)disklabel.c	1.2 (Symmetric) 11/28/85"; */
 #else
-__RCSID("$NetBSD: main.c,v 1.42 2014/09/19 17:45:03 matt Exp $");
+__RCSID("$NetBSD: main.c,v 1.43 2015/01/02 19:46:02 christos Exp $");
 #endif
 #endif	/* not lint */
 
@@ -793,7 +793,7 @@ write_label(int f)
 	}
 
 #ifdef VAX_ALTLABELS
-	if (lab.d_type == DTYPE_SMD && lab.d_flags & D_BADSECT &&
+	if (lab.d_type == DKTYPE_SMD && lab.d_flags & D_BADSECT &&
 	lab.d_secsize == 512) {
 		/* Write the label to the odd sectors of the last track! */
 		daddr_t	alt;

Index: src/usr.sbin/bad144/bad144.c
diff -u src/usr.sbin/bad144/bad144.c:1.30 src/usr.sbin/bad144/bad144.c:1.31
--- src/usr.sbin/bad144/bad144.c:1.30	Sat Nov  2 20:48:52 2013
+++ src/usr.sbin/bad144/bad144.c	Fri Jan  2 14:46:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bad144.c,v 1.30 2013/11/03 00:48:52 christos Exp $	*/
+/*	$NetBSD: bad144.c,v 1.31 2015/01/02 19:46:02 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)bad144.c	8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: bad144.c,v 1.30 2013/11/03 00:48:52 christos Exp $");
+__RCSID("$NetBSD: bad144.c,v 1.31 2015/01/02 19:46:02 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -168,7 +168,7 @@ main(int argc, char *argv[])
 		errx(7, "Disk sector size too large/small (%d)",
 		dp->d_secsize);
 #ifdef __i386__
-	if (dp->d_type == DTYPE_SCSI)
+	if (dp->d_type == DKTYPE_SCSI)
 		errx(1, "SCSI disks don't use bad144!");
 	/* are we inside a DOS partition? */
 	if (dp->d_partitions[0].p_offset) {

Index: src/usr.sbin/diskpart/diskpart.c
diff -u src/usr.sbin/diskpart/diskpart.c:1.19 src/usr.sbin/diskpart/diskpart.c:1.20
--- src/usr.sbin/diskpart/diskpart.c:1.19	Tue Aug 30 06:12:06 2011
+++ src/usr.sbin/diskpart/diskpart.c	Fri Jan  2 14:46:02 2015
@@ -37,7 +37,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "from: @(#)diskpart.c	8.3 (Berkeley) 11/30/94";
 #else
-__RCSID("$NetBSD: diskpart.c,v 1.19 2011/08/30 10:12:06 joerg Exp $");
+__RCSID("$NetBSD: diskpart.c,v 1.20 2015/01/02 19:46:02 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -181,7 +181,7 @@ main(int argc, char *argv[])
 	 * bad sectors are mapped.
 	 * If disk size was specified explicitly, use specified size.
 	 */
-	if (dp->d_type == DTYPE_SMD && dp->d_flags & D_BADSECT &&
+	if (dp->d_type == DKTYPE_SMD && dp->d_flags & D_BADSECT &&
 	totsize == 0) {
 		badsecttable = dp->d_nsectors +
 		roundup(badsecttable, dp->d_nsectors);
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
 printf("\t0,\t0,\n");
 continue;
 			}
-			if (dp->d_type != DTYPE_MSCP) {
+			if (dp->d_type != DKTYPE_MSCP) {
 			   printf("\t%d,\t%d,\t\t/* %c=cyl %d thru %d */\n",
 	defpart[def][part], startcyl[part],
 	'A' + part, startcyl[part],
@@ -304,7 +304,7 @@ main(int argc, char *argv[])
 			dp->d_nsectors, dp->d_ntracks, dp->d_ncylinders);
 		if (dp->d_secpercyl != dp->d_nsectors * dp->d_ntracks)
 			printf("sc#%d:", dp->d_secpercyl);
-		if (dp->d_type == DTYPE_SMD && dp->d_flags & D_BADSECT)
+		if (dp->d_type == DKTYPE_SMD && dp->d_flags & D_BADSECT)
 			printf("sf:");
 		printf("\\\n\t:dt=%s:", dktypenames[dp->d_type]);
 		for (part = NDDATA - 1; part >= 0; part--)
@@ -434,7 +434,7 @@ gettype:
 		goto gettype;
 	}
 	fprintf(stderr, "(type  to get default value, if only one)\n");
-	if (dp->d_type == DTYPE_SMD) {
+	if (dp->d_type == DKTYPE_SMD) {
 		fprintf(stderr,
 		"Do '%s' disks support bad144 bad block forwarding (yes)? ",
 		dp->d_typename);



CVS commit: src/usr.sbin/sysinst

2015-01-02 Thread David Brownlee
Module Name:src
Committed By:   abs
Date:   Fri Jan  2 19:43:14 UTC 2015

Modified Files:
src/usr.sbin/sysinst: defs.h disks.c install.c partman.c upgrade.c
src/usr.sbin/sysinst/arch/arc: md.c
src/usr.sbin/sysinst/arch/cobalt: md.c
src/usr.sbin/sysinst/arch/evbsh3: md.c
src/usr.sbin/sysinst/arch/hp300: md.c
src/usr.sbin/sysinst/arch/hpcsh: md.c
src/usr.sbin/sysinst/arch/i386: md.c
src/usr.sbin/sysinst/arch/luna68k: md.c
src/usr.sbin/sysinst/arch/mvme68k: md.c
src/usr.sbin/sysinst/arch/news68k: md.c
src/usr.sbin/sysinst/arch/sgimips: md.c
src/usr.sbin/sysinst/arch/vax: md.c
src/usr.sbin/sysinst/arch/x68k: md.c

Log Message:
Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/install.c \
src/usr.sbin/sysinst/upgrade.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/evbsh3/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/hp300/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/hpcsh/md.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/luna68k/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/mvme68k/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/news68k/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/sgimips/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/vax/md.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/x68k/md.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/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.5 src/usr.sbin/sysinst/defs.h:1.6
--- src/usr.sbin/sysinst/defs.h:1.5	Tue Oct 14 16:35:20 2014
+++ src/usr.sbin/sysinst/defs.h	Fri Jan  2 19:43:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.5 2014/10/14 16:35:20 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.6 2015/01/02 19:43:13 abs Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -451,6 +451,7 @@ int	write_disklabel(void);
 int	make_filesystems(void);
 int	make_fstab(void);
 int	mount_disks(void);
+int	set_swap_if_low_ram(const char *, partinfo *);
 int	set_swap(const char *, partinfo *);
 int	check_swap(const char *, int);
 char *bootxx_name(void);

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.6 src/usr.sbin/sysinst/disks.c:1.7
--- src/usr.sbin/sysinst/disks.c:1.6	Sun Dec 28 12:05:27 2014
+++ src/usr.sbin/sysinst/disks.c	Fri Jan  2 19:43:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.6 2014/12/28 12:05:27 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.7 2015/01/02 19:43:13 abs Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1213,6 +1213,13 @@ mount_disks(void)
 }
 
 int
+set_swap_if_low_ram(const char *disk, partinfo *pp) {
+if (get_ramsize() <= 32) 
+return set_swap(disk, pp);
+return 0;
+}
+
+int
 set_swap(const char *disk, partinfo *pp)
 {
 	int i;

Index: src/usr.sbin/sysinst/install.c
diff -u src/usr.sbin/sysinst/install.c:1.2 src/usr.sbin/sysinst/install.c:1.3
--- src/usr.sbin/sysinst/install.c:1.2	Sun Aug  3 16:09:38 2014
+++ src/usr.sbin/sysinst/install.c	Fri Jan  2 19:43:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: install.c,v 1.2 2014/08/03 16:09:38 martin Exp $	*/
+/*	$NetBSD: install.c,v 1.3 2015/01/02 19:43:13 abs Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -101,6 +101,7 @@ do_install(void)
 
 		if (md_pre_disklabel() != 0 ||
 			write_disklabel() != 0 ||
+set_swap_if_low_ram(pm->diskdev, pm->bsdlabel) != 0 || 
 			md_post_disklabel() != 0 ||
 			make_filesystems() ||
 			make_fstab() != 0 ||
Index: src/usr.sbin/sysinst/upgrade.c
diff -u src/usr.sbin/sysinst/upgrade.c:1.2 src/usr.sbin/sysinst/upgrade.c:1.3
--- src/usr.sbin/sysinst/upgrade.c:1.2	Sun Aug  3 16:09:38 2014
+++ src/usr.sbin/sysinst/upgrade.c	Fri Jan  2 19:43:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: upgrade.c,v 1.2 2014/08/03 16:09:38 martin Exp $	*/
+/*	$NetBSD: upgrade.c,v 1.3 2015/01/02 19:43:13 abs Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -67,6 +67,9 @@ do_upgrade(void)
 	if (find_disks(msg_string(MSG_upgrade)) < 0)
 		return;
 
+if (set_swap_if_low_ram(pm->diskdev, NULL) < 0)
+		return;
+
 	if (md_pre_update() < 0)
 		return;
 

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sys

CVS commit: src/sys

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 19:42:07 UTC 2015

Modified Files:
src/sys/arch/acorn32/mainbus: fd.c
src/sys/arch/amiga/dev: fd.c
src/sys/arch/arc/jazz: fd.c
src/sys/arch/atari/dev: fd.c hdfd.c
src/sys/arch/bebox/stand/boot: sd.c wd.c
src/sys/arch/cobalt/stand/boot: wd.c
src/sys/arch/dreamcast/dev/maple: mmemcard.c
src/sys/arch/emips/ebus: ace_ebus.c flash_ebus.c
src/sys/arch/evbarm/stand/boot2440: dev_sdmmc.c
src/sys/arch/hp300/dev: rd.c
src/sys/arch/luna68k/luna68k: disksubr.c
src/sys/arch/luna68k/stand/boot: disklabel.c
src/sys/arch/mac68k/obio: iwm_fd.c
src/sys/arch/mmeye/stand/boot: wd.c
src/sys/arch/next68k/next68k: disksubr.c
src/sys/arch/prep/stand/boot: sd.c
src/sys/arch/sparc/dev: fd.c
src/sys/arch/sparc64/dev: fdc.c
src/sys/arch/sun3/dev: fd.c
src/sys/arch/vax/vsa: hdc9224.c
src/sys/arch/x68k/dev: bmd.c fd.c
src/sys/arch/xen/xen: xbd_xenbus.c
src/sys/arch/zaurus/stand/zboot: diskprobe.c
src/sys/dev: ccd.c cgd.c ld.c md.c vnd.c
src/sys/dev/ata: ata_wdc.c wd.c
src/sys/dev/gpib: rd.c
src/sys/dev/ic: mvsata.c
src/sys/dev/isa: fd.c
src/sys/dev/mca: ed_mca.c
src/sys/dev/mscp: mscp_disk.c
src/sys/dev/qbus: rf.c rl.c
src/sys/dev/raidframe: rf_netbsdkintf.c
src/sys/dev/scsipi: cd.c sd.c
src/sys/fs/adosfs: advfsops.c
src/sys/rump/librump/rumpvfs: rumpblk.c
src/sys/sys: disklabel.h

Log Message:
We have three sets of DTYPE_ constants in the kernel:
altqDropType
disklabel   DiskType
fileDescriptor  Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/acorn32/mainbus/fd.c
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/amiga/dev/fd.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arc/jazz/fd.c
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/atari/dev/fd.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/atari/dev/hdfd.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/bebox/stand/boot/sd.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/bebox/stand/boot/wd.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/cobalt/stand/boot/wd.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/dreamcast/dev/maple/mmemcard.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/emips/ebus/ace_ebus.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/emips/ebus/flash_ebus.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/stand/boot2440/dev_sdmmc.c
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/luna68k/luna68k/disksubr.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/disklabel.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mac68k/obio/iwm_fd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mmeye/stand/boot/wd.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/next68k/next68k/disksubr.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/prep/stand/boot/sd.c
cvs rdiff -u -r1.155 -r1.156 src/sys/arch/sparc/dev/fd.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sparc64/dev/fdc.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/sun3/dev/fd.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/vax/vsa/hdc9224.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x68k/dev/bmd.c
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/x68k/dev/fd.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/stand/zboot/diskprobe.c
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/ccd.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/cgd.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/ld.c
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/md.c
cvs rdiff -u -r1.238 -r1.239 src/sys/dev/vnd.c
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.417 -r1.418 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/gpib/rd.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/isa/fd.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/mca/ed_mca.c
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/mscp/mscp_disk.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/qbus/rf.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/qbus/rl.c
cvs rdiff -u -r1.320 -r1.321 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.327 -r1.328 src/sys/dev/scsipi/cd.c
cvs rdiff -u -r1.313 -r1.314 src/sys/dev/scsipi/sd.c
cvs rdiff -u -r1.71 -r1.72 src/sys/fs/adosfs/advfsops.c
cvs rdiff -u -r1.58 -r1.59 src/sys/rump/librump/rumpvfs/rumpblk.c
cvs rdiff -u -r1.117 -r1.118 src/sys/sys/disklabel.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/a

CVS commit: [netbsd-7] src/sys/dev

2015-01-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jan  2 19:00:17 UTC 2015

Modified Files:
src/sys/dev/dec [netbsd-7]: dzkbd.c lk201_ws.c lk201var.h
src/sys/dev/tc [netbsd-7]: zskbd.c

Log Message:
Revert changes that were presumably intended for HEAD. Hi jklos!


To generate a diff of this commit:
cvs rdiff -u -r1.26.12.1 -r1.26.12.2 src/sys/dev/dec/dzkbd.c
cvs rdiff -u -r1.8.38.1 -r1.8.38.2 src/sys/dev/dec/lk201_ws.c
cvs rdiff -u -r1.6.138.1 -r1.6.138.2 src/sys/dev/dec/lk201var.h
cvs rdiff -u -r1.17.38.1 -r1.17.38.2 src/sys/dev/tc/zskbd.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/dec/dzkbd.c
diff -u src/sys/dev/dec/dzkbd.c:1.26.12.1 src/sys/dev/dec/dzkbd.c:1.26.12.2
--- src/sys/dev/dec/dzkbd.c:1.26.12.1	Fri Jan  2 08:09:51 2015
+++ src/sys/dev/dec/dzkbd.c	Fri Jan  2 19:00:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dzkbd.c,v 1.26.12.1 2015/01/02 08:09:51 jklos Exp $	*/
+/*	$NetBSD: dzkbd.c,v 1.26.12.2 2015/01/02 19:00:17 snj Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.26.12.1 2015/01/02 08:09:51 jklos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.26.12.2 2015/01/02 19:00:17 snj Exp $");
 
 #include 
 #include 
@@ -237,7 +237,7 @@ dzkbd_cngetc(void *v, u_int *type, int *
 
 	do {
 		c = dzgetc(dzi->dzi_ls);
-	} while (!lk201_decode(&dzi->dzi_ks, 0, c, type, data) == LKD_NODATA);
+	} while (!lk201_decode(&dzi->dzi_ks, c, type, data));
 }
 
 static void
@@ -294,15 +294,12 @@ dzkbd_input(void *v, int data)
 	struct dzkbd_softc *sc = (struct dzkbd_softc *)v;
 	u_int type;
 	int val;
-	int decode;
 
-	do {
-		decode = lk201_decode(&sc->sc_itl->dzi_ks, 1,
-		data, &type, &val);
-		if (decode != LKD_NODATA)
-			wskbd_input(sc->sc_wskbddev, type, val);
-	} while (decode == LKD_MORE);
+	if (sc->sc_enabled == 0)
+		return(0);
 
+	if (lk201_decode(&sc->sc_itl->dzi_ks, data, &type, &val))
+		wskbd_input(sc->sc_wskbddev, type, val);
 	return(1);
 }
 

Index: src/sys/dev/dec/lk201_ws.c
diff -u src/sys/dev/dec/lk201_ws.c:1.8.38.1 src/sys/dev/dec/lk201_ws.c:1.8.38.2
--- src/sys/dev/dec/lk201_ws.c:1.8.38.1	Fri Jan  2 08:09:51 2015
+++ src/sys/dev/dec/lk201_ws.c	Fri Jan  2 19:00:17 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201_ws.c,v 1.8.38.1 2015/01/02 08:09:51 jklos Exp $ */
+/* $NetBSD: lk201_ws.c,v 1.8.38.2 2015/01/02 19:00:17 snj Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,11 +27,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.8.38.1 2015/01/02 08:09:51 jklos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.8.38.2 2015/01/02 19:00:17 snj Exp $");
 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -41,23 +40,11 @@ __KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v
 
 #define send(lks, c) ((*((lks)->attmt.sendchar))((lks)->attmt.cookie, c))
 
-void lk201_identify(void *);
-
-static callout_t lkkbd_id;
-
-static const char *lkkbd_descr[] = {
-	"no keyboard",
-	"LK-201 keyboard",
-	"LK-401 keyboard",
-};
-
 int
 lk201_init(struct lk201_state *lks)
 {
 	int i;
 
-	lks->waitack = 0;
-
 	send(lks, LK_LED_ENABLE);
 	send(lks, LK_LED_ALL);
 
@@ -82,78 +69,20 @@ lk201_init(struct lk201_state *lks)
 	send(lks, LK_LED_ALL);
 	lks->leds_state = 0;
 
-	callout_init(&lkkbd_id, 0);
-	callout_setfunc(&lkkbd_id, lk201_identify, lks);
-	callout_schedule(&lkkbd_id, 0);
-
 	return (0);
 }
 
-void
-lk201_identify(void *v)
-{
-	struct lk201_state *lks = v;
-	int i;
-
-	callout_destroy(&lkkbd_id);
-	/*
-	 * Swallow all the keyboard acknowledges from lk201_init().
-	 * There should be 14 of them - one per LK_CMD_MODE command.
-	 */
-	for(;;) {
-		lks->waitack = 1;
-		for (i = 100; i != 0; i--) {
-			DELAY(1000);
-			if (lks->waitack == 0)
-break;
-		}
-		if (i == 0)
-			break;
-	}
-
-	/*
-	 * Try to set the keyboard in LK-401 mode.
-	 * If we receive an error, this is an LK-201 keyboard.
-	 */
-	lks->waitack = 1;
-	send(lks, LK_ENABLE_401);
-	for (i = 100; i != 0; i--) {
-		DELAY(1000);
-		if (lks->waitack == 0)
-			break;
-	}
-	if (lks->waitack != 0)
-		lks->kbdtype = KBD_NONE;
-	else {
-		if (lks->ackdata == LK_INPUT_ERROR)
-			lks->kbdtype = KBD_LK201;
-		else
-			lks->kbdtype = KBD_LK401;
-	}
-	lks->waitack = 0;
-
-	printf("lkkbd0: %s\n", lkkbd_descr[lks->kbdtype]);
-}
-
 int
-lk201_decode(struct lk201_state *lks, int wantmulti, int datain, u_int *type, int *dataout)
+lk201_decode(struct lk201_state *lks, int datain, u_int *type, int *dataout)
 {
 	int i, freeslot;
 
-	if (lks->waitack != 0) {
-		lks->ackdata = datain;
-		lks->waitack = 0;
-		return LKD_NODATA;
-	}
-
 	switch (datain) {
-#if 0
 	case LK_KEY_UP:
 		for (i = 0; i < LK_KLL; i++)
 			lks->down_keys_list[i] = -1;
 		*type = WSCONS_EVENT_ALL_KEYS_UP;
 		return (1);
-#endif
 	case LK_POWER_UP:
 		printf("lk201_decode: powerup detected\n");
 		lk201_init(lks);
@@ -169,25 +98,7 @@ lk201_decode(struct lk201_state *lks, in
 		return (0);
 	}
 
-
-	if (

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

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 18:49:02 UTC 2015

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

Log Message:
- print a warning about powerdown not supported like other ports do
- merge duplicated code
- if halt is requested and there is no console, keep looping instead of
  rebooting.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/arm32/arm32_reboot.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/arm32_reboot.c
diff -u src/sys/arch/arm/arm32/arm32_reboot.c:1.6 src/sys/arch/arm/arm32/arm32_reboot.c:1.7
--- src/sys/arch/arm/arm32/arm32_reboot.c:1.6	Sun Aug 18 02:28:18 2013
+++ src/sys/arch/arm/arm32/arm32_reboot.c	Fri Jan  2 13:49:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_reboot.c,v 1.6 2013/08/18 06:28:18 matt Exp $	*/
+/*	$NetBSD: arm32_reboot.c,v 1.7 2015/01/02 18:49:02 christos Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.6 2013/08/18 06:28:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.7 2015/01/02 18:49:02 christos Exp $");
 
 #include 
 #include 
@@ -136,6 +136,29 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_reboot
 #include 
 #include 
 
+static int
+docpureset(int howto)
+{
+	if (howto & RB_POWERDOWN)
+		printf("WARNING: powerdown not supported\r\n");
+
+	if (howto & RB_HALT) {
+		printf("The operating system has halted.\r\n");
+		printf("Please press any key to reboot.\r\n");
+		cnpollc(true);	/* for proper keyboard command handling */
+		/* If there is no keyboard, cngetc() returns 0, so loop */
+		while (cngetc() == 0)
+			delay(10);
+		cnpollc(false);		
+	}
+
+	printf("rebooting...\r\n");
+	if (cpu_reset_address)
+		(*cpu_reset_address)();
+	cpu_reset();
+	/*NOTREACHED*/
+}
+
 void
 cpu_reboot(int howto, char *bootstr)
 {
@@ -146,15 +169,7 @@ cpu_reboot(int howto, char *bootstr)
 	 */
 	if (cold) {
 		doshutdownhooks();
-		printf("The operating system has halted.\r\n");
-		printf("Please press any key to reboot.\r\n");
-		cnpollc(true);	/* for proper keyboard command handling */
-		cngetc();
-		cnpollc(false);		
-		printf("rebooting...\r\n");
-		if (cpu_reset_address)
-			(*cpu_reset_address)();
-		cpu_reset();
+		docpureset(RB_HALT | howto);
 	}
 
 	/*
@@ -187,17 +202,5 @@ cpu_reboot(int howto, char *bootstr)
 	/* Make sure IRQ's are disabled */
 	IRQdisable;
 
-	if (howto & RB_HALT) {
-		printf("The operating system has halted.\r\n");
-		printf("Please press any key to reboot.\r\n");
-		cnpollc(true);	/* for proper keyboard command handling */
-		cngetc();
-		cnpollc(false);		
-	}
-
-	printf("rebooting...\r\n");
-	if (cpu_reset_address)
-		(*cpu_reset_address)();
-	cpu_reset();
-	/*NOTREACHED*/
+	docpureset(howto);
 }



CVS commit: src/sys/fs/sysvbfs

2015-01-02 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Jan  2 16:51:02 UTC 2015

Modified Files:
src/sys/fs/sysvbfs: sysvbfs_vfsops.c

Log Message:
Add forgotten memset() to clear sysvbfs nodes before setting them up.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/fs/sysvbfs/sysvbfs_vfsops.c

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

Modified files:

Index: src/sys/fs/sysvbfs/sysvbfs_vfsops.c
diff -u src/sys/fs/sysvbfs/sysvbfs_vfsops.c:1.45 src/sys/fs/sysvbfs/sysvbfs_vfsops.c:1.46
--- src/sys/fs/sysvbfs/sysvbfs_vfsops.c:1.45	Fri Dec 26 15:23:21 2014
+++ src/sys/fs/sysvbfs/sysvbfs_vfsops.c	Fri Jan  2 16:51:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysvbfs_vfsops.c,v 1.45 2014/12/26 15:23:21 hannken Exp $	*/
+/*	$NetBSD: sysvbfs_vfsops.c,v 1.46 2015/01/02 16:51:02 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vfsops.c,v 1.45 2014/12/26 15:23:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vfsops.c,v 1.46 2015/01/02 16:51:02 hannken Exp $");
 
 #include 
 #include 
@@ -336,6 +336,7 @@ sysvbfs_loadvnode(struct mount *mp, stru
 	}
 
 	bnode = pool_get(&sysvbfs_node_pool, PR_WAITOK);
+	memset(bnode, 0, sizeof(*bnode));
 
 	vp->v_tag = VT_SYSVBFS;
 	vp->v_op = sysvbfs_vnodeop_p;



CVS commit: src/sys/dev/usb

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 16:38:45 UTC 2015

Modified Files:
src/sys/dev/usb: umidi.c

Log Message:
CID/1261465: Dereference after NULL check.
CID/1261467: Unreachable code


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/umidi.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/umidi.c
diff -u src/sys/dev/usb/umidi.c:1.66 src/sys/dev/usb/umidi.c:1.67
--- src/sys/dev/usb/umidi.c:1.66	Sun Dec 21 18:00:35 2014
+++ src/sys/dev/usb/umidi.c	Fri Jan  2 11:38:45 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: umidi.c,v 1.66 2014/12/21 23:00:35 mrg Exp $	*/
+/*	$NetBSD: umidi.c,v 1.67 2015/01/02 16:38:45 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2012, 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.66 2014/12/21 23:00:35 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.67 2015/01/02 16:38:45 christos Exp $");
 
 #include 
 #include 
@@ -386,9 +386,9 @@ umidi_attach(device_t parent, device_t s
 	}
 	err = attach_all_mididevs(sc);
 	if (err != USBD_NORMAL_COMPLETION) {
-		goto out_free_jacks;
 		aprint_error_dev(self,
 		"attach_all_mididevs failed. (err=%d)\n", err);
+		goto out_free_jacks;
 	}
 
 #ifdef UMIDI_DEBUG
@@ -512,7 +512,8 @@ umidi_open(void *addr,
 		KASSERT(mididev->opened);
 		if (err != USBD_NORMAL_COMPLETION &&
 		err != USBD_IN_PROGRESS) {
-			close_out_jack(mididev->out_jack);
+			if (mididev->out_jack)
+close_out_jack(mididev->out_jack);
 			goto bad;
 		}
 	}



CVS commit: src/sys/arch/x68k/dev

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 15:53:26 UTC 2015

Modified Files:
src/sys/arch/x68k/dev: fd.c

Log Message:
restore part decl.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/x68k/dev/fd.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/x68k/dev/fd.c
diff -u src/sys/arch/x68k/dev/fd.c:1.113 src/sys/arch/x68k/dev/fd.c:1.114
--- src/sys/arch/x68k/dev/fd.c:1.113	Thu Jan  1 12:48:56 2015
+++ src/sys/arch/x68k/dev/fd.c	Fri Jan  2 10:53:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.113 2015/01/01 17:48:56 christos Exp $	*/
+/*	$NetBSD: fd.c,v 1.114 2015/01/02 15:53:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.113 2015/01/01 17:48:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.114 2015/01/02 15:53:25 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_m68k_arch.h"
@@ -1608,11 +1608,12 @@ fdioctl(dev_t dev, u_long cmd, void *add
 	struct fdformat_parms *form_parms;
 	struct fdformat_cmd *form_cmd;
 	struct ne7_fd_formb *fd_formb;
+	int part = DISKPART(dev);
 	struct disklabel buffer;
 	int error;
 	unsigned int scratch;
 	int il[FD_MAX_NSEC + 1];
-	int i, j, error;
+	int i, j;
 
 	error = disk_ioctl(&fd->sc_dk, dev, cmd, addr, flag, l);
 	if (error != EPASSTHROUGH)



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

2015-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  2 15:52:33 UTC 2015

Modified Files:
src/sys/arch/arm/arm: disassem.c

Log Message:
Do revision 1.20: Decode movw/movt properly.

Hi Matt.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/arm/disassem.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/arm/disassem.c
diff -u src/sys/arch/arm/arm/disassem.c:1.27 src/sys/arch/arm/arm/disassem.c:1.28
--- src/sys/arch/arm/arm/disassem.c:1.27	Fri Jan  2 10:04:35 2015
+++ src/sys/arch/arm/arm/disassem.c	Fri Jan  2 15:52:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: disassem.c,v 1.27 2015/01/02 10:04:35 skrll Exp $	*/
+/*	$NetBSD: disassem.c,v 1.28 2015/01/02 15:52:33 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.27 2015/01/02 10:04:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.28 2015/01/02 15:52:33 skrll Exp $");
 
 #include 
 
@@ -174,24 +174,24 @@ static const struct arm32_insn arm32_i[]
 { 0x0fff0ff0, 0x016f0f10, "clz",	"dm" },
 { 0x0ff0, 0x012fff30, "blx",	"m" },
 { 0xfff000f0, 0xe1200070, "bkpt",	"k" },
-{ 0x0fe0, 0x0200, "and",	"Sdn2" },
-{ 0x0fe0, 0x0220, "eor",	"Sdn2" },
-{ 0x0fe0, 0x0240, "sub",	"Sdn2" },
-{ 0x0fe0, 0x0260, "rsb",	"Sdn2" },
-{ 0x0fe0, 0x0280, "add",	"Sdn2" },
-{ 0x0fe0, 0x02a0, "adc",	"Sdn2" },
-{ 0x0fe0, 0x02c0, "sbc",	"Sdn2" },
-{ 0x0fe0, 0x02e0, "rsc",	"Sdn2" },
 { 0x0ff0, 0x0300, "movw", 	"dZ" },
-{ 0x0ff0, 0x0310, "tst",	"Dn2" },
-{ 0x0ff0, 0x0330, "teq",	"Dn2" },
 { 0x0ff0, 0x0340, "movt", 	"dZ" },
-{ 0x0ff0, 0x0350, "cmp",	"Dn2" },
-{ 0x0ff0, 0x0370, "cmn",	"Dn2" },
-{ 0x0fe0, 0x0380, "orr",	"Sdn2" },
+{ 0x0de0, 0x, "and",	"Sdn2" },
+{ 0x0de0, 0x0020, "eor",	"Sdn2" },
+{ 0x0de0, 0x0040, "sub",	"Sdn2" },
+{ 0x0de0, 0x0060, "rsb",	"Sdn2" },
+{ 0x0de0, 0x0080, "add",	"Sdn2" },
+{ 0x0de0, 0x00a0, "adc",	"Sdn2" },
+{ 0x0de0, 0x00c0, "sbc",	"Sdn2" },
+{ 0x0de0, 0x00e0, "rsc",	"Sdn2" },
+{ 0x0df0, 0x0110, "tst",	"Dn2" },
+{ 0x0df0, 0x0130, "teq",	"Dn2" },
+{ 0x0df0, 0x0150, "cmp",	"Dn2" },
+{ 0x0df0, 0x0170, "cmn",	"Dn2" },
+{ 0x0de0, 0x0180, "orr",	"Sdn2" },
 { 0x0de0, 0x01a0, "mov",	"Sd2" },
-{ 0x0fe0, 0x03c0, "bic",	"Sdn2" },
-{ 0x0fe0, 0x03e0, "mvn",	"Sd2" },
+{ 0x0de0, 0x01c0, "bic",	"Sdn2" },
+{ 0x0de0, 0x01e0, "mvn",	"Sd2" },
 { 0x0ff08f10, 0x0e000100, "adf",	"PRfgh" },
 { 0x0ff08f10, 0x0e100100, "muf",	"PRfgh" },
 { 0x0ff08f10, 0x0e200100, "suf",	"PRfgh" },



CVS commit: src/sys/arch/mac68k/obio

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 15:50:28 UTC 2015

Modified Files:
src/sys/arch/mac68k/obio: iwm.s

Log Message:
avoid trigraph


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mac68k/obio/iwm.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/mac68k/obio/iwm.s
diff -u src/sys/arch/mac68k/obio/iwm.s:1.6 src/sys/arch/mac68k/obio/iwm.s:1.7
--- src/sys/arch/mac68k/obio/iwm.s:1.6	Tue Nov 30 11:05:55 2010
+++ src/sys/arch/mac68k/obio/iwm.s	Fri Jan  2 10:50:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm.s,v 1.6 2010/11/30 16:05:55 hauke Exp $	*/
+/*	$NetBSD: iwm.s,v 1.7 2015/01/02 15:50:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1996-99 Hauke Fath.  All rights reserved.
@@ -1130,7 +1130,7 @@ wsRDY01:	
 	moveb	%a4@(0,%d3),%a0@	| Translate nibble and write
 	subqw	#3,%d4			| Update counter
 	moveb	%d7,%d3
-	addb	%d7,%d3			| Set X flag (??)
+	addb	%d7,%d3			| Set X flag (Why?)
 	rolb	#1,%d7
 	andib	#0x3F,%d0
 wsRDY02:



CVS commit: src/sys/arch/mac68k/obio

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 15:49:52 UTC 2015

Modified Files:
src/sys/arch/mac68k/obio: iwm_fd.c

Log Message:
name the flag ioctl argument "flag" like most other drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mac68k/obio/iwm_fd.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/mac68k/obio/iwm_fd.c
diff -u src/sys/arch/mac68k/obio/iwm_fd.c:1.52 src/sys/arch/mac68k/obio/iwm_fd.c:1.53
--- src/sys/arch/mac68k/obio/iwm_fd.c:1.52	Thu Jan  1 12:47:21 2015
+++ src/sys/arch/mac68k/obio/iwm_fd.c	Fri Jan  2 10:49:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm_fd.c,v 1.52 2015/01/01 17:47:21 christos Exp $	*/
+/*	$NetBSD: iwm_fd.c,v 1.53 2015/01/02 15:49:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 Hauke Fath.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.52 2015/01/01 17:47:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.53 2015/01/02 15:49:51 christos Exp $");
 
 #include "locators.h"
 
@@ -698,7 +698,7 @@ fdclose(dev_t dev, int flags, int devTyp
  * we do not support them.
  */
 int
-fdioctl(dev_t dev, u_long cmd, void *data, int flags, struct lwp *l)
+fdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
 {
 	int result, fdUnit, fdType;
 	fd_softc_t *fd;
@@ -729,7 +729,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 	case DIOCSDINFO:
 		if (TRACE_IOCTL)
 			printf(" DIOCSDINFO: Set in-core disklabel.\n");
-		result = ((flags & FWRITE) == 0) ? EBADF : 0;
+		result = ((flag & FWRITE) == 0) ? EBADF : 0;
 		if (result == 0)
 			result = setdisklabel(fd->diskInfo.dk_label,
 			(struct disklabel *)data, 0,
@@ -740,7 +740,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 		if (TRACE_IOCTL)
 			printf(" DIOCWDINFO: Set in-core disklabel "
 			"& update disk.\n");
-		result = ((flags & FWRITE) == 0) ? EBADF : 0;
+		result = ((flag & FWRITE) == 0) ? EBADF : 0;
 
 		if (result == 0)
 			result = setdisklabel(fd->diskInfo.dk_label,
@@ -779,7 +779,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 	case DIOCWLABEL:
 		if (TRACE_IOCTL)
 			printf(" DIOCWLABEL: Set write access to disklabel.\n");
-		result = ((flags & FWRITE) == 0) ? EBADF : 0;
+		result = ((flag & FWRITE) == 0) ? EBADF : 0;
 
 		if (result == 0)
 			fd->writeLabel = *(int *)data;



CVS commit: [netbsd-6] src/doc

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 13:39:24 UTC 2015

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Ticket #1225


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.180 -r1.1.2.181 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.180 src/doc/CHANGES-6.2:1.1.2.181
--- src/doc/CHANGES-6.2:1.1.2.180	Mon Dec 29 15:47:02 2014
+++ src/doc/CHANGES-6.2	Fri Jan  2 13:39:24 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.180 2014/12/29 15:47:02 martin Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.181 2015/01/02 13:39:24 martin Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -8916,3 +8916,8 @@ sys/netinet6/mld6.c1.61
 	callout_halt.
 	[ozaki-r, ticket #1224]
 
+sys/arch/arm/arm/disassem.c			1.26
+
+	The mode synonyms are different for stm and ldm - handle this.
+	[skrll, ticket #1225]
+



CVS commit: [netbsd-6] src/sys/arch/arm/arm

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 13:37:35 UTC 2015

Modified Files:
src/sys/arch/arm/arm [netbsd-6]: disassem.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1225):
sys/arch/arm/arm/disassem.c: revision 1.26
The mode synonyms are different for stm and ldm - handle this.
PR/49520: arm/disassem.c doesn't use proper address mode name for loads


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.40.1 src/sys/arch/arm/arm/disassem.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/arm/disassem.c
diff -u src/sys/arch/arm/arm/disassem.c:1.18 src/sys/arch/arm/arm/disassem.c:1.18.40.1
--- src/sys/arch/arm/arm/disassem.c:1.18	Sun Apr 27 18:58:43 2008
+++ src/sys/arch/arm/arm/disassem.c	Fri Jan  2 13:37:35 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: disassem.c,v 1.18 2008/04/27 18:58:43 matt Exp $	*/
+/*	$NetBSD: disassem.c,v 1.18.40.1 2015/01/02 13:37:35 martin Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.18 2008/04/27 18:58:43 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.18.40.1 2015/01/02 13:37:35 martin Exp $");
 
 #include 
 #include 
@@ -233,7 +233,8 @@ static char const insn_block_transfers[]
 };
 
 static char const insn_stack_block_transfers[][4] = {
-	"ed", "ea", "fd", "fa"
+	"ed", "ea", "fd", "fa",	/* stm */
+	"fa", "fd", "ea", "ed",	/* ldm */
 };
 
 static char const op_shifts[][4] = {
@@ -255,7 +256,7 @@ static char const insn_fpaconstants[][8]
 
 #define insn_condition(x)	arm32_insn_conditions[(x >> 28) & 0x0f]
 #define insn_blktrans(x)	insn_block_transfers[(x >> 23) & 3]
-#define insn_stkblktrans(x)	insn_stack_block_transfers[(x >> 23) & 3]
+#define insn_stkblktrans(x)	insn_stack_block_transfers[((x >> (20 - 2)) & 4)|((x >> 23) & 3)]
 #define op2_shift(x)		op_shifts[(x >> 5) & 3]
 #define insn_fparnd(x)		insn_fpa_rounding[(x >> 5) & 0x03]
 #define insn_fpaprec(x)		insn_fpa_precision[(((x >> 18) & 2)|(x >> 7)) & 1]



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

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 11:46:53 UTC 2015

Modified Files:
src/sys/arch/evbarm/awin: awin_machdep.c

Log Message:
Use pinset-func 3 for gmac on BananaPI (value taken from the only working
u-boot driver).
This makes root on NFS and ftp transfers work for me.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c
diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.36 src/sys/arch/evbarm/awin/awin_machdep.c:1.37
--- src/sys/arch/evbarm/awin/awin_machdep.c:1.36	Thu Dec 11 23:35:11 2014
+++ src/sys/arch/evbarm/awin/awin_machdep.c	Fri Jan  2 11:46:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_machdep.c,v 1.36 2014/12/11 23:35:11 jmcneill Exp $ */
+/*	$NetBSD: awin_machdep.c,v 1.37 2015/01/02 11:46:53 martin Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.36 2014/12/11 23:35:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.37 2015/01/02 11:46:53 martin Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -817,7 +817,7 @@ awin_device_register(device_t self, void
 #if AWIN_BOARD == AWIN_bpi
 		prop_dictionary_set_cstring(dict, "phy-power", "gmacpwren");
 		prop_dictionary_set_cstring(dict, "phy-type", "rgmii-bpi");
-		prop_dictionary_set_uint8(dict, "pinset-func", 5);
+		prop_dictionary_set_uint8(dict, "pinset-func", 3);
 #endif
 		return;
 	}



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

2015-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  2 10:04:35 UTC 2015

Modified Files:
src/sys/arch/arm/arm: disassem.c

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/arm/disassem.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/arm/disassem.c
diff -u src/sys/arch/arm/arm/disassem.c:1.26 src/sys/arch/arm/arm/disassem.c:1.27
--- src/sys/arch/arm/arm/disassem.c:1.26	Fri Jan  2 10:03:42 2015
+++ src/sys/arch/arm/arm/disassem.c	Fri Jan  2 10:04:35 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: disassem.c,v 1.26 2015/01/02 10:03:42 skrll Exp $	*/
+/*	$NetBSD: disassem.c,v 1.27 2015/01/02 10:04:35 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.26 2015/01/02 10:03:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.27 2015/01/02 10:04:35 skrll Exp $");
 
 #include 
 
@@ -146,9 +146,9 @@ static const struct arm32_insn arm32_i[]
 { 0x0fff, 0x092d, "push",	"l" },	/* separate out r13 base */
 { 0x0fff, 0x08bd, "pop",	"l" },	/* separate out r13 base */
 { 0x0e1f, 0x080d, "stm",	"YnWl" },/* separate out r13 base */
-{ 0x0e1f, 0x081d, "ldm",	"YnWl" },/* separate out r13 base */
+{ 0x0e1f, 0x081d, "ldm",	"YnWl" },/* separate out r13 base */
 { 0x0e10, 0x0800, "stm",	"XnWl" },
-{ 0x0e10, 0x0810, "ldm",	"XnWl" },
+{ 0x0e10, 0x0810, "ldm",	"XnWl" },
 { 0x0ff00fff, 0x01900f9f, "ldrex",	"da" },
 { 0x0ff00fff, 0x01b00f9f, "ldrexd",	"da" },
 { 0x0ff00fff, 0x01d00f9f, "ldrexb",	"da" },
@@ -384,7 +384,7 @@ disasm(const disasm_interface_t *di, vad
 di->di_printf("#0x%08x",
 	  (insn & 0xff) << (32 - rotate) |
 	  (insn & 0xff) >> rotate);
-			} else {  
+			} else {
 disasm_register_shift(di, insn);
 			}
 			break;



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

2015-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  2 10:03:42 UTC 2015

Modified Files:
src/sys/arch/arm/arm: disassem.c

Log Message:
The mode synonyms are different for stm and ldm - handle this.

PR/49520: arm/disassem.c doesn't use proper address mode name for loads


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/arm/disassem.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/arm/disassem.c
diff -u src/sys/arch/arm/arm/disassem.c:1.25 src/sys/arch/arm/arm/disassem.c:1.26
--- src/sys/arch/arm/arm/disassem.c:1.25	Fri Nov 21 23:36:20 2014
+++ src/sys/arch/arm/arm/disassem.c	Fri Jan  2 10:03:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: disassem.c,v 1.25 2014/11/21 23:36:20 joerg Exp $	*/
+/*	$NetBSD: disassem.c,v 1.26 2015/01/02 10:03:42 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.25 2014/11/21 23:36:20 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.26 2015/01/02 10:03:42 skrll Exp $");
 
 #include 
 
@@ -276,7 +276,8 @@ static char const insn_block_transfers[]
 };
 
 static char const insn_stack_block_transfers[][4] = {
-	"ed", "ea", "fd", "fa"
+	"ed", "ea", "fd", "fa",	/* stm */
+	"fa", "fd", "ea", "ed",	/* ldm */
 };
 
 static char const op_shifts[][4] = {
@@ -298,7 +299,7 @@ static char const insn_fpaconstants[][8]
 
 #define insn_condition(x)	arm32_insn_conditions[(x >> 28) & 0x0f]
 #define insn_blktrans(x)	insn_block_transfers[(x >> 23) & 3]
-#define insn_stkblktrans(x)	insn_stack_block_transfers[(x >> 23) & 3]
+#define insn_stkblktrans(x)	insn_stack_block_transfers[((x >> (20 - 2)) & 4)|((x >> 23) & 3)]
 #define op2_shift(x)		op_shifts[(x >> 5) & 3]
 #define insn_fparnd(x)		insn_fpa_rounding[(x >> 5) & 0x03]
 #define insn_fpaprec(x)		insn_fpa_precision[(((x >> 18) & 2)|(x >> 7)) & 1]



CVS commit: src/sys/fs/smbfs

2015-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan  2 09:48:01 UTC 2015

Modified Files:
src/sys/fs/smbfs: smbfs_node.h

Log Message:
Replace old style open array with C99 variant - cosmetic only, but should
help coverity.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/fs/smbfs/smbfs_node.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/fs/smbfs/smbfs_node.h
diff -u src/sys/fs/smbfs/smbfs_node.h:1.14 src/sys/fs/smbfs/smbfs_node.h:1.15
--- src/sys/fs/smbfs/smbfs_node.h:1.14	Sun Dec 21 10:48:53 2014
+++ src/sys/fs/smbfs/smbfs_node.h	Fri Jan  2 09:48:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_node.h,v 1.14 2014/12/21 10:48:53 hannken Exp $	*/
+/*	$NetBSD: smbfs_node.h,v 1.15 2015/01/02 09:48:01 martin Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -58,7 +58,7 @@ struct smbfs_fctx;
 struct smbkey {
 	struct vnode *		k_parent;	/* Parent vnode. */
 	u_char			k_nmlen;	/* Name length. */
-	u_char			k_name[0];	/* Name (variable length). */
+	u_char			k_name[];	/* Name (variable length). */
 } __packed;
 
 struct smbnode {



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

2015-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  2 08:52:14 UTC 2015

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

Log Message:
KNF - whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.27 -r1.234.2.28 src/sys/dev/usb/ehci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.27 src/sys/dev/usb/ehci.c:1.234.2.28
--- src/sys/dev/usb/ehci.c:1.234.2.27	Fri Jan  2 08:45:05 2015
+++ src/sys/dev/usb/ehci.c	Fri Jan  2 08:52:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.27 2015/01/02 08:45:05 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.28 2015/01/02 08:52:14 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.27 2015/01/02 08:45:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.28 2015/01/02 08:52:14 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2664,7 +2664,7 @@ ehci_alloc_sqh(ehci_softc_t *sc)
 #endif
 		if (err)
 			return NULL;
-		for(i = 0; i < EHCI_SQH_CHUNK; i++) {
+		for (i = 0; i < EHCI_SQH_CHUNK; i++) {
 			offs = i * EHCI_SQH_SIZE;
 			sqh = KERNADDR(&dma, offs);
 			sqh->physaddr = DMAADDR(&dma, offs);
@@ -2710,7 +2710,7 @@ ehci_alloc_sqtd(ehci_softc_t *sc)
 		if (err)
 			goto done;
 
-		for(i = 0; i < EHCI_SQTD_CHUNK; i++) {
+		for (i = 0; i < EHCI_SQTD_CHUNK; i++) {
 			offs = i * EHCI_SQTD_SIZE;
 			sqtd = KERNADDR(&dma, offs);
 			sqtd->physaddr = DMAADDR(&dma, offs);



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

2015-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  2 08:45:06 UTC 2015

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

Log Message:
KNF. Comments.


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.26 -r1.234.2.27 src/sys/dev/usb/ehci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.26 src/sys/dev/usb/ehci.c:1.234.2.27
--- src/sys/dev/usb/ehci.c:1.234.2.26	Fri Jan  2 08:43:06 2015
+++ src/sys/dev/usb/ehci.c	Fri Jan  2 08:45:05 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.26 2015/01/02 08:43:06 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.27 2015/01/02 08:45:05 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.26 2015/01/02 08:43:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.27 2015/01/02 08:45:05 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -1056,7 +1056,8 @@ ehci_idone(struct ehci_xfer *ex)
 			BUS_DMASYNC_POSTREAD);
 
 			for (i = 0; i < EHCI_ITD_NUFRAMES; i += uframes) {
-/* XXX - driver didn't fill in the frame full
+/*
+ * XXX - driver didn't fill in the frame full
  *   of uframes. This leads to scheduling
  *   inefficiencies, but working around
  *   this doubles complexity of tracking
@@ -1096,7 +1097,8 @@ ehci_idone(struct ehci_xfer *ex)
 			sizeof(sitd->sitd.sitd_buffer), BUS_DMASYNC_POSTWRITE |
 			BUS_DMASYNC_POSTREAD);
 
-			/* XXX - driver didn't fill in the frame full
+			/*
+			 * XXX - driver didn't fill in the frame full
 			 *   of uframes. This leads to scheduling
 			 *   inefficiencies, but working around
 			 *   this doubles complexity of tracking
@@ -1218,9 +1220,11 @@ ehci_idone(struct ehci_xfer *ex)
 	}
 
 end:
-	/* XXX transfer_complete memcpys out transfer data (for in endpoints)
+	/*
+	 * XXX transfer_complete memcpys out transfer data (for in endpoints)
 	 * during this call, before methods->done is called: dma sync required
-	 * beforehand? */
+	 * beforehand?
+	 */
 	usb_transfer_complete(xfer);
 	USBHIST_LOG(ehcidebug, "ex=%p done", ex, 0, 0, 0);
 }
@@ -2905,10 +2909,12 @@ ehci_alloc_itd(ehci_softc_t *sc)
 
 	mutex_enter(&sc->sc_lock);
 
-	/* Find an itd that wasn't freed this frame or last frame. This can
+	/*
+	 * Find an itd that wasn't freed this frame or last frame. This can
 	 * discard itds that were freed before frindex wrapped around
 	 * XXX - can this lead to thrashing? Could fix by enabling wrap-around
-	 *   interrupt and fiddling with list when that happens */
+	 *   interrupt and fiddling with list when that happens
+	 */
 	frindex = (EOREAD4(sc, EHCI_FRINDEX) + 1) >> 3;
 	previndex = (frindex != 0) ? frindex - 1 : sc->sc_flsize;
 
@@ -2974,10 +2980,12 @@ ehci_alloc_sitd(ehci_softc_t *sc)
 
 	mutex_enter(&sc->sc_lock);
 
-	/* Find an sitd that wasn't freed this frame or last frame. This can
+	/*
+	 * Find an sitd that wasn't freed this frame or last frame. This can
 	 * discard sitds that were freed before frindex wrapped around
 	 * XXX - can this lead to thrashing? Could fix by enabling wrap-around
-	 *   interrupt and fiddling with list when that happens */
+	 *   interrupt and fiddling with list when that happens
+	 */
 	frindex = (EOREAD4(sc, EHCI_FRINDEX) + 1) >> 3;
 	previndex = (frindex != 0) ? frindex - 1 : sc->sc_flsize;
 
@@ -4484,7 +4492,8 @@ ehci_device_isoc_start(usbd_xfer_handle 
 			addr = EHCI_PAGE(addr);
 			addr /= EHCI_PAGE_SIZE;
 
-			/* This gets the initial offset into the first page,
+			/*
+			 * This gets the initial offset into the first page,
 			 * looks how far further along the current uframe
 			 * offset is. Works out how many pages that is.
 			 */
@@ -4504,7 +4513,8 @@ ehci_device_isoc_start(usbd_xfer_handle 
 			}
 		}
 
-		/* Step 1.75, set buffer pointers. To simplify matters, all
+		/*
+		 * Step 1.75, set buffer pointers. To simplify matters, all
 		 * pointers are filled out for the next 7 hardware pages in
 		 * the dma block, so no need to worry what pages to cover
 		 * and what to not.



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

2015-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  2 08:43:06 UTC 2015

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

Log Message:
Oops, missed a semicolon in previous


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.25 -r1.234.2.26 src/sys/dev/usb/ehci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.25 src/sys/dev/usb/ehci.c:1.234.2.26
--- src/sys/dev/usb/ehci.c:1.234.2.25	Fri Jan  2 07:59:27 2015
+++ src/sys/dev/usb/ehci.c	Fri Jan  2 08:43:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.25 2015/01/02 07:59:27 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.26 2015/01/02 08:43:06 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.25 2015/01/02 07:59:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.26 2015/01/02 08:43:06 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3876,7 +3876,7 @@ ehci_device_intr_start(usbd_xfer_handle 
 	if (sc->sc_dying)
 		return USBD_IOERROR;
 
-	KASSERT(!(xfer->ux_rqflags & URQ_REQUEST))
+	KASSERT(!(xfer->ux_rqflags & URQ_REQUEST));
 
 	mutex_enter(&sc->sc_lock);
 



CVS commit: [netbsd-7] src/sys/dev

2015-01-02 Thread John Klos
Module Name:src
Committed By:   jklos
Date:   Fri Jan  2 08:09:51 UTC 2015

Modified Files:
src/sys/dev/dec [netbsd-7]: dzkbd.c lk201_ws.c lk201var.h
src/sys/dev/tc [netbsd-7]: zskbd.c

Log Message:
Patches from Björn Johannessonto fix DEC LK201 keyboards.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.12.1 src/sys/dev/dec/dzkbd.c
cvs rdiff -u -r1.8 -r1.8.38.1 src/sys/dev/dec/lk201_ws.c
cvs rdiff -u -r1.6 -r1.6.138.1 src/sys/dev/dec/lk201var.h
cvs rdiff -u -r1.17 -r1.17.38.1 src/sys/dev/tc/zskbd.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/dec/dzkbd.c
diff -u src/sys/dev/dec/dzkbd.c:1.26 src/sys/dev/dec/dzkbd.c:1.26.12.1
--- src/sys/dev/dec/dzkbd.c:1.26	Sat Oct 27 17:18:15 2012
+++ src/sys/dev/dec/dzkbd.c	Fri Jan  2 08:09:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dzkbd.c,v 1.26 2012/10/27 17:18:15 chs Exp $	*/
+/*	$NetBSD: dzkbd.c,v 1.26.12.1 2015/01/02 08:09:51 jklos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.26 2012/10/27 17:18:15 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.26.12.1 2015/01/02 08:09:51 jklos Exp $");
 
 #include 
 #include 
@@ -237,7 +237,7 @@ dzkbd_cngetc(void *v, u_int *type, int *
 
 	do {
 		c = dzgetc(dzi->dzi_ls);
-	} while (!lk201_decode(&dzi->dzi_ks, c, type, data));
+	} while (!lk201_decode(&dzi->dzi_ks, 0, c, type, data) == LKD_NODATA);
 }
 
 static void
@@ -294,12 +294,15 @@ dzkbd_input(void *v, int data)
 	struct dzkbd_softc *sc = (struct dzkbd_softc *)v;
 	u_int type;
 	int val;
+	int decode;
 
-	if (sc->sc_enabled == 0)
-		return(0);
+	do {
+		decode = lk201_decode(&sc->sc_itl->dzi_ks, 1,
+		data, &type, &val);
+		if (decode != LKD_NODATA)
+			wskbd_input(sc->sc_wskbddev, type, val);
+	} while (decode == LKD_MORE);
 
-	if (lk201_decode(&sc->sc_itl->dzi_ks, data, &type, &val))
-		wskbd_input(sc->sc_wskbddev, type, val);
 	return(1);
 }
 

Index: src/sys/dev/dec/lk201_ws.c
diff -u src/sys/dev/dec/lk201_ws.c:1.8 src/sys/dev/dec/lk201_ws.c:1.8.38.1
--- src/sys/dev/dec/lk201_ws.c:1.8	Sat Mar 14 15:36:17 2009
+++ src/sys/dev/dec/lk201_ws.c	Fri Jan  2 08:09:51 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201_ws.c,v 1.8 2009/03/14 15:36:17 dsl Exp $ */
+/* $NetBSD: lk201_ws.c,v 1.8.38.1 2015/01/02 08:09:51 jklos Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,10 +27,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.8 2009/03/14 15:36:17 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.8.38.1 2015/01/02 08:09:51 jklos Exp $");
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -40,11 +41,23 @@ __KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v
 
 #define send(lks, c) ((*((lks)->attmt.sendchar))((lks)->attmt.cookie, c))
 
+void lk201_identify(void *);
+
+static callout_t lkkbd_id;
+
+static const char *lkkbd_descr[] = {
+	"no keyboard",
+	"LK-201 keyboard",
+	"LK-401 keyboard",
+};
+
 int
 lk201_init(struct lk201_state *lks)
 {
 	int i;
 
+	lks->waitack = 0;
+
 	send(lks, LK_LED_ENABLE);
 	send(lks, LK_LED_ALL);
 
@@ -69,20 +82,78 @@ lk201_init(struct lk201_state *lks)
 	send(lks, LK_LED_ALL);
 	lks->leds_state = 0;
 
+	callout_init(&lkkbd_id, 0);
+	callout_setfunc(&lkkbd_id, lk201_identify, lks);
+	callout_schedule(&lkkbd_id, 0);
+
 	return (0);
 }
 
+void
+lk201_identify(void *v)
+{
+	struct lk201_state *lks = v;
+	int i;
+
+	callout_destroy(&lkkbd_id);
+	/*
+	 * Swallow all the keyboard acknowledges from lk201_init().
+	 * There should be 14 of them - one per LK_CMD_MODE command.
+	 */
+	for(;;) {
+		lks->waitack = 1;
+		for (i = 100; i != 0; i--) {
+			DELAY(1000);
+			if (lks->waitack == 0)
+break;
+		}
+		if (i == 0)
+			break;
+	}
+
+	/*
+	 * Try to set the keyboard in LK-401 mode.
+	 * If we receive an error, this is an LK-201 keyboard.
+	 */
+	lks->waitack = 1;
+	send(lks, LK_ENABLE_401);
+	for (i = 100; i != 0; i--) {
+		DELAY(1000);
+		if (lks->waitack == 0)
+			break;
+	}
+	if (lks->waitack != 0)
+		lks->kbdtype = KBD_NONE;
+	else {
+		if (lks->ackdata == LK_INPUT_ERROR)
+			lks->kbdtype = KBD_LK201;
+		else
+			lks->kbdtype = KBD_LK401;
+	}
+	lks->waitack = 0;
+
+	printf("lkkbd0: %s\n", lkkbd_descr[lks->kbdtype]);
+}
+
 int
-lk201_decode(struct lk201_state *lks, int datain, u_int *type, int *dataout)
+lk201_decode(struct lk201_state *lks, int wantmulti, int datain, u_int *type, int *dataout)
 {
 	int i, freeslot;
 
+	if (lks->waitack != 0) {
+		lks->ackdata = datain;
+		lks->waitack = 0;
+		return LKD_NODATA;
+	}
+
 	switch (datain) {
+#if 0
 	case LK_KEY_UP:
 		for (i = 0; i < LK_KLL; i++)
 			lks->down_keys_list[i] = -1;
 		*type = WSCONS_EVENT_ALL_KEYS_UP;
 		return (1);
+#endif
 	case LK_POWER_UP:
 		printf("lk201_decode: powerup detected\n");
 		lk201_init(lks);
@@ -98,7 +169,25 @@ lk201_decode(struct lk201_state *lks, in
 		return (0);
 	}
 
-	if (datain < MIN_LK201_KEY || datain > MAX_LK201_KEY) {
+
+	if (datain =

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

2015-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  2 07:59:27 UTC 2015

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

Log Message:
Convert some #ifdef DIAGNOSTIC / #endifs to KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.24 -r1.234.2.25 src/sys/dev/usb/ehci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.24 src/sys/dev/usb/ehci.c:1.234.2.25
--- src/sys/dev/usb/ehci.c:1.234.2.24	Fri Jan  2 07:57:18 2015
+++ src/sys/dev/usb/ehci.c	Fri Jan  2 07:59:27 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.24 2015/01/02 07:57:18 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.25 2015/01/02 07:59:27 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.24 2015/01/02 07:57:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.25 2015/01/02 07:59:27 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3401,13 +3401,7 @@ ehci_device_ctrl_start(usbd_xfer_handle 
 	if (sc->sc_dying)
 		return USBD_IOERROR;
 
-#ifdef DIAGNOSTIC
-	if (!(xfer->ux_rqflags & URQ_REQUEST)) {
-		/* XXX panic */
-		printf("ehci_device_ctrl_transfer: not a request\n");
-		return USBD_INVAL;
-	}
-#endif
+	KASSERT(xfer->ux_rqflags & URQ_REQUEST);
 
 	err = ehci_device_request(xfer);
 	if (err) {
@@ -3435,12 +3429,7 @@ ehci_device_ctrl_done(usbd_xfer_handle x
 	USBHIST_LOG(ehcidebug, "xfer=%p", xfer, 0, 0, 0);
 
 	KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
-
-#ifdef DIAGNOSTIC
-	if (!(xfer->ux_rqflags & URQ_REQUEST)) {
-		panic("ehci_ctrl_done: not a request");
-	}
-#endif
+	KASSERT(xfer->ux_rqflags & URQ_REQUEST);
 
 	if (xfer->ux_status != USBD_NOMEM && ehci_active_intr_list(ex)) {
 		ehci_del_intr_list(sc, ex);	/* remove from active list */
@@ -3700,10 +3689,7 @@ ehci_device_bulk_start(usbd_xfer_handle 
 	if (sc->sc_dying)
 		return USBD_IOERROR;
 
-#ifdef DIAGNOSTIC
-	if (xfer->ux_rqflags & URQ_REQUEST)
-		panic("ehci_device_bulk_start: a request");
-#endif
+	KASSERT(!(xfer->ux_rqflags & URQ_REQUEST));
 
 	mutex_enter(&sc->sc_lock);
 
@@ -3890,10 +3876,7 @@ ehci_device_intr_start(usbd_xfer_handle 
 	if (sc->sc_dying)
 		return USBD_IOERROR;
 
-#ifdef DIAGNOSTIC
-	if (xfer->ux_rqflags & URQ_REQUEST)
-		panic("ehci_device_intr_start: a request");
-#endif
+	KASSERT(!(xfer->ux_rqflags & URQ_REQUEST))
 
 	mutex_enter(&sc->sc_lock);
 
@@ -4121,10 +4104,9 @@ ehci_device_fs_isoc_start(usbd_xfer_hand
 		return USBD_INVAL;
 	}
 
-#ifdef DIAGNOSTIC
-	if (xfer->ux_rqflags & URQ_REQUEST)
-		panic("ehci_device_fs_isoc_start: request\n");
+	KASSERT(!(xfer->ux_rqflags & URQ_REQUEST));
 
+#ifdef DIAGNOSTIC
 	if (!exfer->ex_isdone)
 		printf("ehci_device_fs_isoc_start: not done, ex = %p\n", exfer);
 	exfer->ex_isdone = 0;
@@ -4439,10 +4421,9 @@ ehci_device_isoc_start(usbd_xfer_handle 
 		return USBD_INVAL;
 	}
 
-#ifdef DIAGNOSTIC
-	if (xfer->ux_rqflags & URQ_REQUEST)
-		panic("ehci_device_isoc_start: request\n");
+	KASSERT(!(xfer->ux_rqflags & URQ_REQUEST));
 
+#ifdef DIAGNOSTIC
 	if (!exfer->ex_isdone) {
 		USBHIST_LOG(ehcidebug, "marked not done, ex = %p", exfer,
 			0, 0, 0);