CVS commit: src/sys/dev/pci

2014-11-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 16 09:47:35 UTC 2014

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

Log Message:
Add C2000 KX and 2.5G.


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

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.307 src/sys/dev/pci/if_wm.c:1.308
--- src/sys/dev/pci/if_wm.c:1.307	Fri Oct 24 17:58:09 2014
+++ src/sys/dev/pci/if_wm.c	Sun Nov 16 09:47:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.307 2014/10/24 17:58:09 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.308 2014/11/16 09:47:35 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.307 2014/10/24 17:58:09 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.308 2014/11/16 09:47:35 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1159,9 +1159,18 @@ static const struct wm_product {
 	  I350 Gigabit Connection,
 	  WM_T_I350,		WMP_F_COPPER },
 
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_C2000_1000KX,
+	  I354 Gigabit Ethernet (KX),
+	  WM_T_I354,		WMP_F_SERDES },
+
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_C2000_SGMII,
-	  I354 Gigabit Connection,
+	  I354 Gigabit Ethernet (SGMII),
+	  WM_T_I354,		WMP_F_COPPER },
+
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_C2000_25GBE,
+	  I354 Gigabit Ethernet (2.5G),
 	  WM_T_I354,		WMP_F_COPPER },
+
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I210_T1,
 	  I210-T1 Ethernet Server Adapter,
 	  WM_T_I210,		WMP_F_COPPER },



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

2014-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 16 10:20:21 UTC 2014

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

Log Message:
Enable vnd and putter pseudo devices.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/CUBIEBOARD

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/CUBIEBOARD
diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.35 src/sys/arch/evbarm/conf/CUBIEBOARD:1.36
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.35	Sat Nov 15 14:59:25 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Sun Nov 16 10:20:21 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.35 2014/11/15 14:59:25 jmcneill Exp $
+#	$NetBSD: CUBIEBOARD,v 1.36 2014/11/16 10:20:21 martin Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -317,9 +317,10 @@ ukphy*		at mii? phy ?
 
 # disk/mass storage pseudo-devices
 #pseudo-device	md			# memory disk device (ramdisk)
-#pseudo-device	vnd			# disk-like interface to files
+pseudo-device	vnd			# disk-like interface to files
+options 	VND_COMPRESSION		# compressed vnd(4)
 #pseudo-device	fss			# file system snapshot device
-#pseudo-device	putter			# for puffs and pud
+pseudo-device	putter			# for puffs and pud
 pseudo-device	drvctl			# driver control
 
 # network pseudo-devices



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

2014-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 16 10:33:57 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner [netbsd-7]: awin_ir.c awin_reg.h
src/sys/arch/evbarm/conf [netbsd-7]: BPI CUBIEBOARD

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #241):
sys/arch/evbarm/conf/BPI: revision 1.12
sys/arch/arm/allwinner/awin_ir.c: revision 1.2
sys/arch/arm/allwinner/awin_ir.c: revision 1.3
sys/arch/arm/allwinner/awin_ir.c: revision 1.4
sys/arch/evbarm/conf/CUBIEBOARD: revision 1.35
sys/arch/arm/allwinner/awin_reg.h: revision 1.50
sys/arch/arm/allwinner/awin_reg.h: revision 1.51
Fix CIR setup. Works on A31 now.
hide a debug printf
add A20 IR support
enable awinir, cir


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/arm/allwinner/awin_ir.c
cvs rdiff -u -r1.14.2.4 -r1.14.2.5 src/sys/arch/arm/allwinner/awin_reg.h
cvs rdiff -u -r1.2.2.6 -r1.2.2.7 src/sys/arch/evbarm/conf/BPI
cvs rdiff -u -r1.12.2.4 -r1.12.2.5 src/sys/arch/evbarm/conf/CUBIEBOARD

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_ir.c
diff -u src/sys/arch/arm/allwinner/awin_ir.c:1.1.2.2 src/sys/arch/arm/allwinner/awin_ir.c:1.1.2.3
--- src/sys/arch/arm/allwinner/awin_ir.c:1.1.2.2	Sun Nov  9 14:42:33 2014
+++ src/sys/arch/arm/allwinner/awin_ir.c	Sun Nov 16 10:33:57 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_ir.c,v 1.1.2.2 2014/11/09 14:42:33 martin Exp $ */
+/* $NetBSD: awin_ir.c,v 1.1.2.3 2014/11/16 10:33:57 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include opt_ddb.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_ir.c,v 1.1.2.2 2014/11/09 14:42:33 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_ir.c,v 1.1.2.3 2014/11/16 10:33:57 martin Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -60,6 +60,7 @@ struct awin_ir_softc {
 	device_t sc_i2cdev;
 	void *sc_ih;
 	size_t sc_avail;
+	int sc_port;
 };
 
 #define IR_READ(sc, reg) \
@@ -118,6 +119,7 @@ awin_ir_attach(device_t parent, device_t
 
 	sc-sc_dev = self;
 	sc-sc_bst = aio-aio_core_bst;
+	sc-sc_port = loc-loc_port;
 	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_IR);
 	cv_init(sc-sc_cv, awinir);
 	bus_space_subregion(sc-sc_bst, aio-aio_core_bsh,
@@ -175,16 +177,39 @@ awin_ir_init(struct awin_ir_softc *sc, s
 		clk = bus_space_read_4(sc-sc_bst, prcm_bsh,
 		AWIN_A31_PRCM_CIR_CLK_REG);
 		clk = ~AWIN_CLK_SRC_SEL;
-		clk |= 1;	/* HOSC */
+		clk |= __SHIFTIN(AWIN_CLK_SRC_SEL_CIR_HOSC, AWIN_CLK_SRC_SEL);
 		clk = ~AWIN_CLK_DIV_RATIO_M;
-		clk |= 7;	/* (24MHz / 3MHz) - 1 */
+		clk |= __SHIFTIN(7, AWIN_CLK_DIV_RATIO_M);
 		clk = ~AWIN_CLK_DIV_RATIO_N;
-		clk |= 0;	/* 1 - 1 */
+		clk |= __SHIFTIN(0, AWIN_CLK_DIV_RATIO_N);
 		clk |= AWIN_CLK_ENABLE;
 		bus_space_write_4(sc-sc_bst, prcm_bsh,
 		AWIN_A31_PRCM_CIR_CLK_REG, clk);
 
 		bus_space_unmap(sc-sc_bst, prcm_bsh, prcm_size);
+	} else  {
+		const struct awin_gpio_pinset pinset =
+		{ 'B', AWIN_PIO_PB_IR0_FUNC, AWIN_PIO_PB_IR0_PINS };
+		uint32_t clk;
+
+		awin_gpio_pinset_acquire(pinset);
+
+		awin_reg_set_clear(aio-aio_core_bst, aio-aio_ccm_bsh,
+		AWIN_APB0_GATING_REG,
+		AWIN_APB_GATING0_IR0  sc-sc_port,
+		0);
+
+		clk = bus_space_read_4(aio-aio_core_bst, aio-aio_ccm_bsh,
+		AWIN_IR0_CLK_REG + (sc-sc_port * 4));
+		clk = ~AWIN_CLK_SRC_SEL;
+		clk |= __SHIFTIN(AWIN_CLK_SRC_SEL_OSC24M, AWIN_CLK_SRC_SEL);
+		clk = ~AWIN_CLK_DIV_RATIO_M;
+		clk |= __SHIFTIN(7, AWIN_CLK_DIV_RATIO_M);
+		clk = ~AWIN_CLK_DIV_RATIO_N;
+		clk |= __SHIFTIN(0, AWIN_CLK_DIV_RATIO_N);
+		clk |= AWIN_CLK_ENABLE;
+		bus_space_write_4(aio-aio_core_bst, aio-aio_ccm_bsh,
+		AWIN_IR0_CLK_REG + (sc-sc_port * 4), clk);
 	}
 }
 
@@ -196,14 +221,16 @@ awin_ir_intr(void *priv)
 
 	sta = IR_READ(sc, AWIN_IR_RXSTA_REG);
 
+#ifdef AWIN_IR_DEBUG
 	printf(%s: sta = 0x%08x\n, __func__, sta);
+#endif
 
 	if ((sta  AWIN_IR_RXSTA_MASK) == 0)
 		return 0;
 
 	IR_WRITE(sc, AWIN_IR_RXSTA_REG, sta  AWIN_IR_RXSTA_MASK);
 
-	if (sta  AWIN_IR_RXSTA_RA) {
+	if (sta  AWIN_IR_RXSTA_RPE) {
 		mutex_enter(sc-sc_lock);
 		sc-sc_avail = __SHIFTOUT(sta, AWIN_IR_RXSTA_RAC);
 		cv_broadcast(sc-sc_cv);
@@ -217,17 +244,27 @@ static int
 awin_ir_open(void *priv, int flag, int mode, struct proc *p)
 {
 	struct awin_ir_softc *sc = priv;
-	uint32_t ctl, rxint;
+	uint32_t ctl, rxint, cir;
 
 	ctl = __SHIFTIN(AWIN_IR_CTL_MD_CIR, AWIN_IR_CTL_MD);
 	IR_WRITE(sc, AWIN_IR_CTL_REG, ctl);
 
+	cir = __SHIFTIN(3, AWIN_IR_CIR_SCS);
+	cir |= __SHIFTIN(0, AWIN_IR_CIR_SCS2);
+	cir |= __SHIFTIN(8, AWIN_IR_CIR_NTHR);
+	cir |= __SHIFTIN(2, AWIN_IR_CIR_ITHR);
+	if (awin_chip_id() == AWIN_CHIP_ID_A31) {
+		cir |= __SHIFTIN(99, AWIN_IR_CIR_ATHR);
+		cir |= __SHIFTIN(0, AWIN_IR_CIR_ATHC);
+	}
+	IR_WRITE(sc, AWIN_IR_CIR_REG, cir);
+
 	IR_WRITE(sc, AWIN_IR_RXCTL_REG, 

CVS commit: [netbsd-7] src/distrib/utils/libhack

2014-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 16 10:39:55 UTC 2014

Modified Files:
src/distrib/utils/libhack [netbsd-7]: multibyte.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #242):
distrib/utils/libhack/multibyte.c: revision 1.6
handle the special wc NULL case.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.8.1 src/distrib/utils/libhack/multibyte.c

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

Modified files:

Index: src/distrib/utils/libhack/multibyte.c
diff -u src/distrib/utils/libhack/multibyte.c:1.5 src/distrib/utils/libhack/multibyte.c:1.5.8.1
--- src/distrib/utils/libhack/multibyte.c:1.5	Fri Apr 19 18:45:03 2013
+++ src/distrib/utils/libhack/multibyte.c	Sun Nov 16 10:39:54 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: multibyte.c,v 1.5 2013/04/19 18:45:03 joerg Exp $  */
+/*  $NetBSD: multibyte.c,v 1.5.8.1 2014/11/16 10:39:54 martin Exp $  */
 
 /*
  * Ignore all multibyte sequences, removes all the citrus code.
@@ -12,7 +12,15 @@
 size_t
 mbrtowc(wchar_t *wc, const char *str, size_t max_sz, mbstate_t *ps)
 {
-	return str == NULL || (*wc = (unsigned char)*str) == 0 ? 0 : 1;
+	wchar_t c;
+
+	if (str == NULL)
+		return 0;
+
+	if (wc != NULL)
+		*wc = (unsigned char)*str;
+
+	return *str == '\0' ? 0 : 1;
 }
 
 size_t



CVS commit: [netbsd-7] src/doc

2014-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 16 10:43:02 UTC 2014

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

Log Message:
Ticket #241 and #242


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.103 -r1.1.2.104 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.103 src/doc/CHANGES-7.0:1.1.2.104
--- src/doc/CHANGES-7.0:1.1.2.103	Sat Nov 15 11:35:57 2014
+++ src/doc/CHANGES-7.0	Sun Nov 16 10:43:02 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.103 2014/11/15 11:35:57 martin Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.104 2014/11/16 10:43:02 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -2669,3 +2669,17 @@ sys/arch/arm/include/locore.h			1.18
 	including this file in rump builds.
 	[skrll, ticket #240]
 
+sys/arch/arm/allwinner/awin_ir.c		1.2-1.4
+sys/arch/arm/allwinner/awin_reg.h		1.50-1.51
+sys/arch/evbarm/conf/BPI			1.12
+sys/arch/evbarm/conf/CUBIEBOARD			1.35
+
+	Fix CIR setup, enable awinir and cir.
+	[jmcneill, ticket #241]
+
+distrib/utils/libhack/multibyte.c		1.6
+
+	Handle the special wc NULL case.
+	[christos, ticket #242]
+
+



CVS commit: [netbsd-7] src/distrib/utils/libhack

2014-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 16 11:18:05 UTC 2014

Modified Files:
src/distrib/utils/libhack [netbsd-7]: multibyte.c

Log Message:
Additionally pull up revision 1.7 of src/distrib/utils/libhack/multibyte.c,
requested by tsutsui in #242


To generate a diff of this commit:
cvs rdiff -u -r1.5.8.1 -r1.5.8.2 src/distrib/utils/libhack/multibyte.c

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

Modified files:

Index: src/distrib/utils/libhack/multibyte.c
diff -u src/distrib/utils/libhack/multibyte.c:1.5.8.1 src/distrib/utils/libhack/multibyte.c:1.5.8.2
--- src/distrib/utils/libhack/multibyte.c:1.5.8.1	Sun Nov 16 10:39:54 2014
+++ src/distrib/utils/libhack/multibyte.c	Sun Nov 16 11:18:05 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: multibyte.c,v 1.5.8.1 2014/11/16 10:39:54 martin Exp $  */
+/*  $NetBSD: multibyte.c,v 1.5.8.2 2014/11/16 11:18:05 martin Exp $  */
 
 /*
  * Ignore all multibyte sequences, removes all the citrus code.
@@ -12,8 +12,6 @@
 size_t
 mbrtowc(wchar_t *wc, const char *str, size_t max_sz, mbstate_t *ps)
 {
-	wchar_t c;
-
 	if (str == NULL)
 		return 0;
 



CVS commit: [netbsd-7] src/doc

2014-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 16 11:18:54 UTC 2014

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

Log Message:
Update entry for #242


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.104 -r1.1.2.105 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.104 src/doc/CHANGES-7.0:1.1.2.105
--- src/doc/CHANGES-7.0:1.1.2.104	Sun Nov 16 10:43:02 2014
+++ src/doc/CHANGES-7.0	Sun Nov 16 11:18:54 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.104 2014/11/16 10:43:02 martin Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.105 2014/11/16 11:18:54 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -2677,9 +2677,8 @@ sys/arch/evbarm/conf/CUBIEBOARD			1.35
 	Fix CIR setup, enable awinir and cir.
 	[jmcneill, ticket #241]
 
-distrib/utils/libhack/multibyte.c		1.6
+distrib/utils/libhack/multibyte.c		1.6-1.7
 
 	Handle the special wc NULL case.
 	[christos, ticket #242]
 
-



CVS commit: src/distrib/atari/floppies/common

2014-11-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 16 11:54:29 UTC 2014

Modified Files:
src/distrib/atari/floppies/common: Makefile.images

Log Message:
Use -Os -m68020-60 for DBG. It seems to generate smaller objects than -Os.

gcc48 with -Os:
-rwxr-xr-x  1 tsutsui  wheel  1319596 Nov 16 20:50 obj.atari/instbin

gcc48 with -Os -m68020-60
-rwxr-xr-x  1 tsutsui  wheel  1314516 Nov 16 20:49 obj.atari/instbin

This allows ever growing sysinst.fs still fit into 1440KB even with gcc48.
Acually we need a real solution (ustarfs based floppies etc.) soon
but we can work around at least for NetBSD 7.0.

Should be pulled up to netbsd-7 (if NetBSD/m68k 7.0 will switch to gcc48).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/atari/floppies/common/Makefile.images

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

Modified files:

Index: src/distrib/atari/floppies/common/Makefile.images
diff -u src/distrib/atari/floppies/common/Makefile.images:1.8 src/distrib/atari/floppies/common/Makefile.images:1.9
--- src/distrib/atari/floppies/common/Makefile.images:1.8	Sun Feb 21 20:06:19 2010
+++ src/distrib/atari/floppies/common/Makefile.images	Sun Nov 16 11:54:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.images,v 1.8 2010/02/21 20:06:19 tsutsui Exp $
+#	$NetBSD: Makefile.images,v 1.9 2014/11/16 11:54:29 tsutsui Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -6,7 +6,7 @@
 .include bsd.kernobj.mk
 
 WARNS=		1
-DBG=		-Os
+DBG=		-Os -m68020-60	# -m68020-60 seems to generate smaller binaries
 
 CRUNCHBIN=	instbin
 LISTS=		${.CURDIR}/list ${.CURDIR}/../common/list.images



CVS commit: src/sys/arch

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Nov 16 12:02:55 UTC 2014

Modified Files:
src/sys/arch/cats/conf: Makefile.cats.inc
src/sys/arch/shark/conf: Makefile.shark.inc

Log Message:
Set dependency via KERNLDSCRIPT.  Don't touch SYSTEM_DEP from outside.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/cats/conf/Makefile.cats.inc
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/shark/conf/Makefile.shark.inc

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/cats/conf/Makefile.cats.inc
diff -u src/sys/arch/cats/conf/Makefile.cats.inc:1.29 src/sys/arch/cats/conf/Makefile.cats.inc:1.30
--- src/sys/arch/cats/conf/Makefile.cats.inc:1.29	Sat Nov 15 14:02:19 2014
+++ src/sys/arch/cats/conf/Makefile.cats.inc	Sun Nov 16 12:02:55 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.cats.inc,v 1.29 2014/11/15 14:02:19 uebayasi Exp $
+#	$NetBSD: Makefile.cats.inc,v 1.30 2014/11/16 12:02:55 uebayasi Exp $
 
 MACHINE_ARCH?=	arm
 CPPFLAGS+=	-D${MACHINE}
@@ -20,7 +20,7 @@ SYSTEM_LD_HEAD_EXTRA+=; \
 	  OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
 		${SYSTEM_OBJ} ; \
 	  cat ${ARM}/conf/kern.ldscript.tail )  ldscript
-SYSTEM_DEP+=	${ARM}/conf/kern.ldscript.head \
+KERNLDSCRIPT=	${ARM}/conf/kern.ldscript.head \
 		$S/conf/mkldscript.sh \
 		${ARM}/conf/kern.ldscript.tail
 

Index: src/sys/arch/shark/conf/Makefile.shark.inc
diff -u src/sys/arch/shark/conf/Makefile.shark.inc:1.21 src/sys/arch/shark/conf/Makefile.shark.inc:1.22
--- src/sys/arch/shark/conf/Makefile.shark.inc:1.21	Sat Nov 15 13:41:16 2014
+++ src/sys/arch/shark/conf/Makefile.shark.inc	Sun Nov 16 12:02:55 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.shark.inc,v 1.21 2014/11/15 13:41:16 uebayasi Exp $
+#	$NetBSD: Makefile.shark.inc,v 1.22 2014/11/16 12:02:55 uebayasi Exp $
 
 CPPFLAGS+=		-D${MACHINE}
 COPTS+=			-fno-unwind-tables
@@ -14,7 +14,7 @@ SYSTEM_LD_HEAD_EXTRA+=; \
 	  OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
 		${SYSTEM_OBJ} ; \
 	  cat ${ARM}/conf/kern.ldscript.tail )  ldscript
-SYSTEM_DEP+=	${ARM}/conf/kern.ldscript.head \
+KERNLDSCRIPT=	${ARM}/conf/kern.ldscript.head \
 		$S/conf/mkldscript.sh \
 		${ARM}/conf/kern.ldscript.tail
 



CVS commit: src/sys/arch/atari/stand/installboot

2014-11-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 16 13:38:39 UTC 2014

Modified Files:
src/sys/arch/atari/stand/installboot: installboot.c

Log Message:
Revert revs 1.29 and 1.30, to make it easier to pullup an alternative fix.

Ok'ed by christos@
http://mail-index.netbsd.org/source-changes-d/2014/11/15/msg007338.html


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/atari/stand/installboot/installboot.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/atari/stand/installboot/installboot.c
diff -u src/sys/arch/atari/stand/installboot/installboot.c:1.30 src/sys/arch/atari/stand/installboot/installboot.c:1.31
--- src/sys/arch/atari/stand/installboot/installboot.c:1.30	Thu Nov 13 17:46:49 2014
+++ src/sys/arch/atari/stand/installboot/installboot.c	Sun Nov 16 13:38:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.c,v 1.30 2014/11/13 17:46:49 christos Exp $	*/
+/*	$NetBSD: installboot.c,v 1.31 2014/11/16 13:38:39 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Waldi Ravens
@@ -467,7 +467,6 @@ mkbootblock(struct bootblock *bb, char *
 struct disklabel *label, u_int magic)
 {
 	int		 fd;
-	uint16_t	 sum;
 
 	memset(bb, 0, sizeof(*bb));
 
@@ -499,10 +498,8 @@ mkbootblock(struct bootblock *bb, char *
 	setIDEpar(bb-bb_xxboot, sizeof(bb-bb_xxboot));
 
 	/* set AHDI checksum */
-	sum = 0;
-	memcpy(bb-bb_xxboot + 255 * sizeof(sum), sum, sizeof(sum));
-	sum = 0x1234 - abcksum(bb-bb_xxboot);
-	memcpy(bb-bb_xxboot + 255 * sizeof(sum), sum, sizeof(sum));
+	*((u_int16_t *)bb-bb_xxboot + 255) = 0;
+	*((u_int16_t *)bb-bb_xxboot + 255) = 0x1234 - abcksum(bb-bb_xxboot);
 
 	if (verbose) {
 		printf(Primary   boot loader: %s\n, xxb);



CVS commit: src/sys/arch/atari/stand/installboot

2014-11-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 16 13:47:52 UTC 2014

Modified Files:
src/sys/arch/atari/stand/installboot: installboot.c

Log Message:
Appease gcc48 -Werror=strict-aliasing warning by filling cksum via union.

Discussed in source-changes-d@ thread and tested on TT030.
Should be pulled up to netbsd-7 (if NetBSD/m68k 7.0 will switch to gcc48).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/atari/stand/installboot/installboot.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/atari/stand/installboot/installboot.c
diff -u src/sys/arch/atari/stand/installboot/installboot.c:1.31 src/sys/arch/atari/stand/installboot/installboot.c:1.32
--- src/sys/arch/atari/stand/installboot/installboot.c:1.31	Sun Nov 16 13:38:39 2014
+++ src/sys/arch/atari/stand/installboot/installboot.c	Sun Nov 16 13:47:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.c,v 1.31 2014/11/16 13:38:39 tsutsui Exp $	*/
+/*	$NetBSD: installboot.c,v 1.32 2014/11/16 13:47:52 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Waldi Ravens
@@ -467,6 +467,10 @@ mkbootblock(struct bootblock *bb, char *
 struct disklabel *label, u_int magic)
 {
 	int		 fd;
+	union {
+		struct bootblock *bbp;
+		uint16_t *word;		/* to fill cksum word */
+	} bbsec;
 
 	memset(bb, 0, sizeof(*bb));
 
@@ -498,8 +502,9 @@ mkbootblock(struct bootblock *bb, char *
 	setIDEpar(bb-bb_xxboot, sizeof(bb-bb_xxboot));
 
 	/* set AHDI checksum */
-	*((u_int16_t *)bb-bb_xxboot + 255) = 0;
-	*((u_int16_t *)bb-bb_xxboot + 255) = 0x1234 - abcksum(bb-bb_xxboot);
+	bbsec.bbp = bb;
+	bbsec.word[255] = 0;
+	bbsec.word[255] = 0x1234 - abcksum(bb-bb_xxboot);
 
 	if (verbose) {
 		printf(Primary   boot loader: %s\n, xxb);



CVS commit: src/usr.bin/config

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Nov 16 14:26:14 UTC 2014

Modified Files:
src/usr.bin/config: mkmakefile.c

Log Message:
Consistently wrap long lines in ioconf.c.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/config/mkmakefile.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.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.28 src/usr.bin/config/mkmakefile.c:1.29
--- src/usr.bin/config/mkmakefile.c:1.28	Sat Nov 15 12:18:55 2014
+++ src/usr.bin/config/mkmakefile.c	Sun Nov 16 14:26:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.28 2014/11/15 12:18:55 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.29 2014/11/16 14:26:14 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: mkmakefile.c,v 1.28 2014/11/15 12:18:55 uebayasi Exp $);
+__RCSID($NetBSD: mkmakefile.c,v 1.29 2014/11/16 14:26:14 uebayasi Exp $);
 
 #include sys/param.h
 #include ctype.h
@@ -292,20 +292,18 @@ static void
 emitdefs(FILE *fp)
 {
 	struct nvlist *nv;
-	const char *sp;
 
 	fprintf(fp, KERNEL_BUILD=%s\n, conffile);
-	fputs(IDENT=, fp);
-	sp = ;
+	fputs(IDENT= \\\n, fp);
 	for (nv = options; nv != NULL; nv = nv-nv_next) {
 
 		/* Skip any options output to a header file */
 		if (DEFINED_OPTION(nv-nv_name))
 			continue;
-		fprintf(fp, %s-D%s, sp, nv-nv_name);
-		if (nv-nv_str)
-			fprintf(fp, =\%s\, nv-nv_str);
-		sp =  ;
+		fprintf(fp, \t-D%s%s%s%s \\\n, nv-nv_name,
+		(nv-nv_str != NULL) ? =\ : ,
+		(nv-nv_str != NULL) ? nv-nv_str : ,
+		(nv-nv_str != NULL) ? \ : );
 	}
 	putc('\n', fp);
 	fprintf(fp, PARAM=-DMAXUSERS=%d\n, maxusers);
@@ -380,9 +378,9 @@ emitallkobjs(FILE *fp)
 	ht_enumerate(attrtab, emitallkobjscb, NULL);
 	qsort(attrbuf, (size_t)attridx, sizeof(struct attr *), attrcmp);
 
-	fputs(OBJS=, fp);
+	fputs(OBJS= \\\n, fp);
 	for (i = 0; i  attridx; i++)
-		fprintf(fp,  %s.ko, attrbuf[i]-a_name);
+		fprintf(fp, \t%s.ko \\\n, attrbuf[i]-a_name);
 	putc('\n', fp);
 
 	free(attrbuf);
@@ -455,9 +453,9 @@ emitattrkobjscb(const char *name, void *
 		return 0;
 	fputc('\n', fp);
 	fprintf(fp, # %s (%d)\n, name, a-a_weight);
-	fprintf(fp, OBJS.%s=, name);
+	fprintf(fp, OBJS.%s= \\\n, name);
 	TAILQ_FOREACH(fi, a-a_files, fi_anext) {
-		fprintf(fp,  %s.o, fi-fi_base);
+		fprintf(fp, \t%s.o \\\n, fi-fi_base);
 	}
 	fputc('\n', fp);
 	fprintf(fp, %s.ko: ${OBJS.%s}\n, name, name);



CVS commit: src/usr.bin/config

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Nov 16 14:49:12 UTC 2014

Modified Files:
src/usr.bin/config: mkmakefile.c

Log Message:
Refactor.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/config/mkmakefile.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.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.29 src/usr.bin/config/mkmakefile.c:1.30
--- src/usr.bin/config/mkmakefile.c:1.29	Sun Nov 16 14:26:14 2014
+++ src/usr.bin/config/mkmakefile.c	Sun Nov 16 14:49:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.29 2014/11/16 14:26:14 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.30 2014/11/16 14:49:12 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: mkmakefile.c,v 1.29 2014/11/16 14:26:14 uebayasi Exp $);
+__RCSID($NetBSD: mkmakefile.c,v 1.30 2014/11/16 14:49:12 uebayasi Exp $);
 
 #include sys/param.h
 #include ctype.h
@@ -334,21 +334,22 @@ emitobjs(FILE *fp)
 		fprintf(fp, \t%s.o \\\n, fi-fi_base);
 	}
 	TAILQ_FOREACH(oi, allobjects, oi_next) {
+		const char *prologue, *prefix, *sep;
+
 		if ((oi-oi_flags  OI_SEL) == 0)
 			continue;
-		if (*oi-oi_path == '/') {
-			fprintf(fp, \t%s \\\n, oi-oi_path);
-		} else {
+		prologue = prefix = sep = ;
+		if (*oi-oi_path != '/') {
 			if (oi-oi_prefix != NULL) {
-fprintf(fp, \t%s%s/%s \\\n,
-prefix_prologue(oi-oi_path),
-oi-oi_prefix, oi-oi_path);
+prologue = prefix_prologue(oi-oi_path);
+prefix = oi-oi_prefix;
+sep = /;
 			} else {
-fprintf(fp, \t%s%s \\\n,
-filetype_prologue(oi-oi_fit),
-oi-oi_path);
+prologue = filetype_prologue(oi-oi_fit);
 			}
 		}
+		fprintf(fp, \t%s%s%s%s \\\n, prologue, prefix, sep,
+		oi-oi_path);
 	}
 	putc('\n', fp);
 }
@@ -488,25 +489,27 @@ emitfiles(FILE *fp, int suffix, int uppe
 
 	fprintf(fp, %cFILES= \\\n, toupper(suffix));
 	TAILQ_FOREACH(fi, allfiles, fi_next) {
+		const char *prologue, *prefix, *sep;
+
 		if ((fi-fi_flags  FI_SEL) == 0)
 			continue;
 		fpath = srcpath(fi);
 		len = strlen(fpath);
 		if (fpath[len - 1] != suffix  fpath[len - 1] != upper_suffix)
 			continue;
-		if (*fi-fi_path == '/') {
-			fprintf(fp, \t%s \\\n, fpath);
+		prologue = prefix = sep = ;
+		if (*fi-fi_path != '/') {
 		} else {
 			if (fi-fi_prefix != NULL) {
-fprintf(fp, \t%s%s/%s \\\n,
-prefix_prologue(fi-fi_prefix),
-fi-fi_prefix, fpath);
+prologue = prefix_prologue(fi-fi_prefix);
+prefix = fi-fi_prefix;
+sep = /;
 			} else {
-fprintf(fp, \t%s%s \\\n,
-filetype_prologue(fi-fi_fit),
-fpath);
+prologue = filetype_prologue(fi-fi_fit);
 			}
 		}
+		fprintf(fp, \t%s%s%s%s \\\n,
+		prologue, prefix, sep, fpath);
 	}
  	/*
  	 * The allfiles list does not include the configuration-specific
@@ -534,23 +537,23 @@ emitrules(FILE *fp)
 	int ch;
 
 	TAILQ_FOREACH(fi, allfiles, fi_next) {
+		const char *prologue, *prefix, *sep;
+
 		if ((fi-fi_flags  FI_SEL) == 0)
 			continue;
 		fpath = srcpath(fi);
-		if (*fpath == '/') {
-			fprintf(fp, %s.o: %s\n, fi-fi_base, fpath);
-		} else {
+		prologue = prefix = sep = ;
+		if (*fpath != '/') {
 			if (fi-fi_prefix != NULL) {
-fprintf(fp, %s.o: %s%s/%s\n, fi-fi_base,
-prefix_prologue(fi-fi_prefix),
-fi-fi_prefix, fpath);
+prologue = prefix_prologue(fi-fi_prefix);
+prefix = fi-fi_prefix;
+sep = /;
 			} else {
-fprintf(fp, %s.o: %s%s\n,
-fi-fi_base,
-filetype_prologue(fi-fi_fit),
-fpath);
+prologue = filetype_prologue(fi-fi_fit);
  			}
 		}
+		fprintf(fp, %s.o: %s%s%s%s\n, fi-fi_base,
+		prologue, prefix, sep, fpath);
 		if (fi-fi_mkrule != NULL) {
 			fprintf(fp, \t%s\n\n, fi-fi_mkrule);
 		} else {



CVS commit: src/usr.bin/config

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Nov 16 14:57:59 UTC 2014

Modified Files:
src/usr.bin/config: mkmakefile.c

Log Message:
Simpfily code by assuming suffix is a single character.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/config/mkmakefile.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.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.30 src/usr.bin/config/mkmakefile.c:1.31
--- src/usr.bin/config/mkmakefile.c:1.30	Sun Nov 16 14:49:12 2014
+++ src/usr.bin/config/mkmakefile.c	Sun Nov 16 14:57:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.30 2014/11/16 14:49:12 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.31 2014/11/16 14:57:59 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: mkmakefile.c,v 1.30 2014/11/16 14:49:12 uebayasi Exp $);
+__RCSID($NetBSD: mkmakefile.c,v 1.31 2014/11/16 14:57:59 uebayasi Exp $);
 
 #include sys/param.h
 #include ctype.h
@@ -533,8 +533,9 @@ static void
 emitrules(FILE *fp)
 {
 	struct files *fi;
-	const char *cp, *fpath;
-	int ch;
+	size_t len;
+	const char *fpath;
+	int suffix;
 
 	TAILQ_FOREACH(fi, allfiles, fi_next) {
 		const char *prologue, *prefix, *sep;
@@ -542,6 +543,8 @@ emitrules(FILE *fp)
 		if ((fi-fi_flags  FI_SEL) == 0)
 			continue;
 		fpath = srcpath(fi);
+		len = strlen(fpath);
+		suffix = fpath[len - 1];
 		prologue = prefix = sep = ;
 		if (*fpath != '/') {
 			if (fi-fi_prefix != NULL) {
@@ -557,13 +560,7 @@ emitrules(FILE *fp)
 		if (fi-fi_mkrule != NULL) {
 			fprintf(fp, \t%s\n\n, fi-fi_mkrule);
 		} else {
-			fputs(\t${NORMAL_, fp);
-			cp = strrchr(fpath, '.');
-			cp = cp == NULL ? fpath : cp + 1;
-			while ((ch = *cp++) != '\0') {
-fputc(toupper(ch), fp);
-			}
-			fputs(}\n\n, fp);
+			fprintf(fp, \t${NORMAL_%c}\n\n, toupper(suffix));
 		}
 	}
 }



CVS commit: src/usr.bin/config

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Nov 16 15:10:54 UTC 2014

Modified Files:
src/usr.bin/config: mkmakefile.c

Log Message:
Fix oops in r1.30.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/config/mkmakefile.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.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.31 src/usr.bin/config/mkmakefile.c:1.32
--- src/usr.bin/config/mkmakefile.c:1.31	Sun Nov 16 14:57:59 2014
+++ src/usr.bin/config/mkmakefile.c	Sun Nov 16 15:10:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.31 2014/11/16 14:57:59 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.32 2014/11/16 15:10:54 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: mkmakefile.c,v 1.31 2014/11/16 14:57:59 uebayasi Exp $);
+__RCSID($NetBSD: mkmakefile.c,v 1.32 2014/11/16 15:10:54 uebayasi Exp $);
 
 #include sys/param.h
 #include ctype.h
@@ -499,7 +499,6 @@ emitfiles(FILE *fp, int suffix, int uppe
 			continue;
 		prologue = prefix = sep = ;
 		if (*fi-fi_path != '/') {
-		} else {
 			if (fi-fi_prefix != NULL) {
 prologue = prefix_prologue(fi-fi_prefix);
 prefix = fi-fi_prefix;



CVS commit: src/sys/rump/dev/lib/libnetsmb

2014-11-16 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sun Nov 16 15:31:12 UTC 2014

Modified Files:
src/sys/rump/dev/lib/libnetsmb: netsmb_user.c

Log Message:
Wrap iconv.h also with #ifdef __NetBSD__.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libnetsmb/netsmb_user.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/rump/dev/lib/libnetsmb/netsmb_user.c
diff -u src/sys/rump/dev/lib/libnetsmb/netsmb_user.c:1.2 src/sys/rump/dev/lib/libnetsmb/netsmb_user.c:1.3
--- src/sys/rump/dev/lib/libnetsmb/netsmb_user.c:1.2	Sun Nov 16 04:26:46 2014
+++ src/sys/rump/dev/lib/libnetsmb/netsmb_user.c	Sun Nov 16 15:31:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netsmb_user.c,v 1.2 2014/11/16 04:26:46 nakayama Exp $	*/
+/*	$NetBSD: netsmb_user.c,v 1.3 2014/11/16 15:31:12 nakayama Exp $	*/
 
 /*
  * Copyright (c) 2014 Takeshi Nakayama.
@@ -26,8 +26,10 @@
  */
 #ifndef _KERNEL
 #include stddef.h
-#include iconv.h
 #include errno.h
+#ifdef __NetBSD__
+#include iconv.h
+#endif
 
 #include rump/rumpuser_component.h
 



CVS commit: src/sys

2014-11-16 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Sun Nov 16 16:01:43 UTC 2014

Modified Files:
src/sys/arch/acorn26/conf: GENERIC
src/sys/arch/acorn32/conf: GENERIC
src/sys/arch/alpha/conf: GENERIC
src/sys/arch/amd64/conf: ALL GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/amiga/conf: GENERIC GENERIC.in
src/sys/arch/amigappc/conf: GENERIC
src/sys/arch/arc/conf: GENERIC
src/sys/arch/bebox/conf: GENERIC
src/sys/arch/cats/conf: GENERIC
src/sys/arch/cesfic/conf: GENERIC
src/sys/arch/cobalt/conf: GENERIC
src/sys/arch/dreamcast/conf: GENERIC
src/sys/arch/emips/conf: GENERIC
src/sys/arch/epoc32/conf: GENERIC
src/sys/arch/ews4800mips/conf: GENERIC
src/sys/arch/hp300/conf: GENERIC
src/sys/arch/hpcmips/conf: GENERIC
src/sys/arch/hpcsh/conf: GENERIC
src/sys/arch/hppa/conf: GENERIC
src/sys/arch/i386/conf: ALL GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/ibmnws/conf: GENERIC
src/sys/arch/iyonix/conf: GENERIC
src/sys/arch/landisk/conf: GENERIC
src/sys/arch/luna68k/conf: GENERIC
src/sys/arch/mac68k/conf: GENERIC
src/sys/arch/macppc/conf: GENERIC MAMBO POWERMAC_G5
src/sys/arch/mipsco/conf: GENERIC
src/sys/arch/mmeye/conf: GENERIC
src/sys/arch/mvme68k/conf: GENERIC
src/sys/arch/mvmeppc/conf: GENERIC
src/sys/arch/netwinder/conf: GENERIC
src/sys/arch/news68k/conf: GENERIC
src/sys/arch/newsmips/conf: GENERIC
src/sys/arch/next68k/conf: GENERIC
src/sys/arch/ofppc/conf: GENERIC
src/sys/arch/pmax/conf: GENERIC GENERIC64
src/sys/arch/prep/conf: GENERIC
src/sys/arch/rs6000/conf: GENERIC
src/sys/arch/sandpoint/conf: GENERIC
src/sys/arch/sbmips/conf: GENERIC
src/sys/arch/sgimips/conf: GENERIC32_IP12 GENERIC32_IP2x GENERIC32_IP3x
src/sys/arch/shark/conf: GENERIC
src/sys/arch/sparc/conf: GENERIC TADPOLE3GX
src/sys/arch/sparc64/conf: GENERIC NONPLUS64
src/sys/arch/sun2/conf: GENERIC
src/sys/arch/sun3/conf: GENERIC
src/sys/arch/vax/conf: GENERIC VAX780
src/sys/arch/x68k/conf: GENERIC
src/sys/arch/zaurus/conf: GENERIC
src/sys/ufs: files.ufs

Log Message:
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/acorn26/conf/GENERIC
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/acorn32/conf/GENERIC
cvs rdiff -u -r1.361 -r1.362 src/sys/arch/alpha/conf/GENERIC
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.403 -r1.404 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.310 -r1.311 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/amiga/conf/GENERIC.in
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amigappc/conf/GENERIC
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/arc/conf/GENERIC
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/bebox/conf/GENERIC
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/cesfic/conf/GENERIC
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/cobalt/conf/GENERIC
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/dreamcast/conf/GENERIC
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/emips/conf/GENERIC
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/epoc32/conf/GENERIC
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/ews4800mips/conf/GENERIC
cvs rdiff -u -r1.189 -r1.190 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.228 -r1.229 src/sys/arch/hpcmips/conf/GENERIC
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/hpcsh/conf/GENERIC
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/conf/GENERIC
cvs rdiff -u -r1.388 -r1.389 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1117 -r1.1118 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/i386/conf/XEN3_DOMU
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/ibmnws/conf/GENERIC
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/iyonix/conf/GENERIC
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/landisk/conf/GENERIC
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/luna68k/conf/GENERIC
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/mac68k/conf/GENERIC
cvs rdiff -u -r1.319 -r1.320 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/macppc/conf/MAMBO
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/macppc/conf/POWERMAC_G5
cvs rdiff -u -r1.87 -r1.88 

CVS commit: src/lib/libm/arch/m68k

2014-11-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Nov 16 16:11:33 UTC 2014

Modified Files:
src/lib/libm/arch/m68k: s_copysign.S

Log Message:
Deal with the potential pressence of long double support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/arch/m68k/s_copysign.S

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

Modified files:

Index: src/lib/libm/arch/m68k/s_copysign.S
diff -u src/lib/libm/arch/m68k/s_copysign.S:1.9 src/lib/libm/arch/m68k/s_copysign.S:1.10
--- src/lib/libm/arch/m68k/s_copysign.S:1.9	Sat Nov 15 21:07:01 2014
+++ src/lib/libm/arch/m68k/s_copysign.S	Sun Nov 16 16:11:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_copysign.S,v 1.9 2014/11/15 21:07:01 joerg Exp $	*/
+/*	$NetBSD: s_copysign.S,v 1.10 2014/11/16 16:11:33 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -34,14 +34,17 @@
  */
 
 #include machine/asm.h
+#include machine/math.h
 
 ;_sccsid:
 ;.asciz	from: @(#)support.s	5.2 (Berkeley) 5/17/90
 
-RCSID($NetBSD: s_copysign.S,v 1.9 2014/11/15 21:07:01 joerg Exp $)
+RCSID($NetBSD: s_copysign.S,v 1.10 2014/11/16 16:11:33 joerg Exp $)
 
+#if !defined(__HAVE_LONG_DOUBLE)
 STRONG_ALIAS(_copysignl, copysign)
 WEAK_ALIAS(copysignl, _copysignl)
+#endif
 
 | copysign(x,y)
 | returns x with the sign of y.



CVS commit: src/sys

2014-11-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sun Nov 16 16:20:01 UTC 2014

Modified Files:
src/sys/arch/x86/pci: fwhrng.c
src/sys/arch/x86/x86: via_padlock.c
src/sys/dev/bluetooth: bcsp.c btkbd.c
src/sys/dev/ic: nslm7x.c
src/sys/dev/ir: irframe_tty.c
src/sys/dev/isa: aps.c
src/sys/dev/pci: pccbb.c
src/sys/dev/pcmcia: btbc.c
src/sys/dev/sdmmc: sdmmc.c
src/sys/dev/wscons: wskbd.c
src/sys/net: if_ecosubr.c

Log Message:
Replace callout_stop with callout_halt

In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.

Discussed with martin@ and riastradh@.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/pci/fwhrng.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/x86/via_padlock.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/bluetooth/bcsp.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/bluetooth/btkbd.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/ic/nslm7x.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/ir/irframe_tty.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/isa/aps.c
cvs rdiff -u -r1.206 -r1.207 src/sys/dev/pci/pccbb.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pcmcia/btbc.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/sdmmc/sdmmc.c
cvs rdiff -u -r1.134 -r1.135 src/sys/dev/wscons/wskbd.c
cvs rdiff -u -r1.40 -r1.41 src/sys/net/if_ecosubr.c

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

Modified files:

Index: src/sys/arch/x86/pci/fwhrng.c
diff -u src/sys/arch/x86/pci/fwhrng.c:1.7 src/sys/arch/x86/pci/fwhrng.c:1.8
--- src/sys/arch/x86/pci/fwhrng.c:1.7	Sun Aug 10 16:44:34 2014
+++ src/sys/arch/x86/pci/fwhrng.c	Sun Nov 16 16:20:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwhrng.c,v 1.7 2014/08/10 16:44:34 tls Exp $	*/
+/*	$NetBSD: fwhrng.c,v 1.8 2014/11/16 16:20:00 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2000 Michael Shalayeff
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwhrng.c,v 1.7 2014/08/10 16:44:34 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwhrng.c,v 1.8 2014/11/16 16:20:00 ozaki-r Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -211,7 +211,7 @@ fwhrng_detach(device_t self, int flags)
 
 	rnd_detach_source(sc-sc_rnd_source);
 
-	callout_stop(sc-sc_rnd_ch);
+	callout_halt(sc-sc_rnd_ch, NULL);
 	callout_destroy(sc-sc_rnd_ch);
 
 	/* Disable the RNG. */

Index: src/sys/arch/x86/x86/via_padlock.c
diff -u src/sys/arch/x86/x86/via_padlock.c:1.22 src/sys/arch/x86/x86/via_padlock.c:1.23
--- src/sys/arch/x86/x86/via_padlock.c:1.22	Sun Aug 10 16:44:34 2014
+++ src/sys/arch/x86/x86/via_padlock.c	Sun Nov 16 16:20:00 2014
@@ -1,5 +1,5 @@
 /*	$OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $	*/
-/*	$NetBSD: via_padlock.c,v 1.22 2014/08/10 16:44:34 tls Exp $ */
+/*	$NetBSD: via_padlock.c,v 1.23 2014/11/16 16:20:00 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2003 Jason Wright
@@ -20,7 +20,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: via_padlock.c,v 1.22 2014/08/10 16:44:34 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: via_padlock.c,v 1.23 2014/11/16 16:20:00 ozaki-r Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -626,7 +626,7 @@ via_padlock_detach(device_t self, int fl
 	struct via_padlock_softc *sc = device_private(self);
 
 	if (sc-sc_rnd_attached) {
-		callout_stop(sc-sc_rnd_co);
+		callout_halt(sc-sc_rnd_co, NULL);
 		callout_destroy(sc-sc_rnd_co);
 		rnd_detach_source(sc-sc_rnd_source);
 		sc-sc_rnd_attached = false;

Index: src/sys/dev/bluetooth/bcsp.c
diff -u src/sys/dev/bluetooth/bcsp.c:1.24 src/sys/dev/bluetooth/bcsp.c:1.25
--- src/sys/dev/bluetooth/bcsp.c:1.24	Tue May 20 18:25:54 2014
+++ src/sys/dev/bluetooth/bcsp.c	Sun Nov 16 16:20:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcsp.c,v 1.24 2014/05/20 18:25:54 rmind Exp $	*/
+/*	$NetBSD: bcsp.c,v 1.25 2014/11/16 16:20:00 ozaki-r Exp $	*/
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcsp.c,v 1.24 2014/05/20 18:25:54 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcsp.c,v 1.25 2014/11/16 16:20:00 ozaki-r Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -349,10 +349,10 @@ bcsp_detach(device_t self, int flags __u
 		sc-sc_unit = NULL;
 	}
 
-	callout_stop(sc-sc_seq_timer);
+	callout_halt(sc-sc_seq_timer, NULL);
 	callout_destroy(sc-sc_seq_timer);
 
-	callout_stop(sc-sc_le_timer);
+	callout_halt(sc-sc_le_timer, NULL);
 	callout_destroy(sc-sc_le_timer);
 
 	return 0;

Index: src/sys/dev/bluetooth/btkbd.c
diff -u src/sys/dev/bluetooth/btkbd.c:1.16 src/sys/dev/bluetooth/btkbd.c:1.17
--- src/sys/dev/bluetooth/btkbd.c:1.16	Thu Sep 12 12:20:01 2013
+++ src/sys/dev/bluetooth/btkbd.c	Sun Nov 16 16:20:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: btkbd.c,v 1.16 2013/09/12 12:20:01 martin Exp $	*/
+/*	$NetBSD: btkbd.c,v 1.17 2014/11/16 16:20:00 ozaki-r Exp 

CVS commit: src/distrib/sets/lists/modules

2014-11-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov 16 18:33:19 UTC 2014

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386

Log Message:
Tag the Xen iSCSI modules with `iscsi' in the md.x86 lists.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.51 -r1.52 src/distrib/sets/lists/modules/md.i386

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/modules/md.amd64
diff -u src/distrib/sets/lists/modules/md.amd64:1.48 src/distrib/sets/lists/modules/md.amd64:1.49
--- src/distrib/sets/lists/modules/md.amd64:1.48	Wed Nov 12 03:48:30 2014
+++ src/distrib/sets/lists/modules/md.amd64	Sun Nov 16 18:33:19 2014
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.48 2014/11/12 03:48:30 enami Exp $
+# $NetBSD: md.amd64,v 1.49 2014/11/16 18:33:19 riastradh Exp $
 #
 # NOTE that there are two sets of files here:
 # @MODULEDIR@ and amd64-xen
@@ -350,8 +350,8 @@
 ./stand/amd64-xen/@OSRELEASE@/modules/if_smsc/if_smsc.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
-./stand/amd64-xen/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules
-./stand/amd64-xen/@OSRELEASE@/modules/iscsi/iscsi.kmod			base-kernel-modules	kmod,compatmodules
+./stand/amd64-xen/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules,iscsi
+./stand/amd64-xen/@OSRELEASE@/modules/iscsi/iscsi.kmod			base-kernel-modules	kmod,compatmodules,iscsi
 ./stand/amd64-xen/@OSRELEASE@/modules/itesiobase-kernel-modules	kmod,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/itesio/itesio.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/kernfsbase-kernel-modules	kmod,compatmodules

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.51 src/distrib/sets/lists/modules/md.i386:1.52
--- src/distrib/sets/lists/modules/md.i386:1.51	Wed Nov 12 03:48:30 2014
+++ src/distrib/sets/lists/modules/md.i386	Sun Nov 16 18:33:19 2014
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.51 2014/11/12 03:48:30 enami Exp $
+# $NetBSD: md.i386,v 1.52 2014/11/16 18:33:19 riastradh Exp $
 #
 # NOTE that there are three sets of files here:
 # @MODULEDIR@, i386-xen, and i386pae-xen
@@ -368,8 +368,8 @@
 ./stand/i386-xen/@OSRELEASE@/modules/if_smsc/if_smsc.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
-./stand/i386-xen/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules
-./stand/i386-xen/@OSRELEASE@/modules/iscsi/iscsi.kmod			base-kernel-modules	kmod,compatmodules
+./stand/i386-xen/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules,iscsi
+./stand/i386-xen/@OSRELEASE@/modules/iscsi/iscsi.kmod			base-kernel-modules	kmod,compatmodules,iscsi
 ./stand/i386-xen/@OSRELEASE@/modules/itesiobase-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/itesio/itesio.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/kernfsbase-kernel-modules	kmod,compatmodules
@@ -757,8 +757,8 @@
 ./stand/i386pae-xen/@OSRELEASE@/modules/if_smsc/if_smsc.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/i386pae-xen/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/i386pae-xen/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
-./stand/i386pae-xen/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules
-./stand/i386pae-xen/@OSRELEASE@/modules/iscsi/iscsi.kmod		base-kernel-modules	kmod,compatmodules
+./stand/i386pae-xen/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules,iscsi
+./stand/i386pae-xen/@OSRELEASE@/modules/iscsi/iscsi.kmod		base-kernel-modules	kmod,compatmodules,iscsi
 ./stand/i386pae-xen/@OSRELEASE@/modules/itesiobase-kernel-modules	kmod,compatmodules
 ./stand/i386pae-xen/@OSRELEASE@/modules/itesio/itesio.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/i386pae-xen/@OSRELEASE@/modules/kernfsbase-kernel-modules	kmod,compatmodules



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

2014-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 16 18:54:52 UTC 2014

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

Log Message:
Enable puffs


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/CUBIEBOARD

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/CUBIEBOARD
diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.36 src/sys/arch/evbarm/conf/CUBIEBOARD:1.37
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.36	Sun Nov 16 10:20:21 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Sun Nov 16 18:54:52 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.36 2014/11/16 10:20:21 martin Exp $
+#	$NetBSD: CUBIEBOARD,v 1.37 2014/11/16 18:54:52 martin Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -43,7 +43,7 @@ file-system	MSDOSFS		# MS-DOS file syste
 file-system	KERNFS		# /kern
 #file-system	NULLFS		# loopback file system
 file-system	PROCFS		# /proc
-#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g  sshfs)
+file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g  sshfs)
 #file-system	UMAPFS		# NULLFS + uid and gid remapping
 #file-system	UNION		# union file system
 file-system	TMPFS		# memory file system



CVS commit: src/lib/libc/stdio

2014-11-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 16 20:32:52 UTC 2014

Modified Files:
src/lib/libc/stdio: fseek.c

Log Message:
Don't try to extend the offset range on 32 bit machines by treating negative
offsets as positive. It is just confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/stdio/fseek.c

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

Modified files:

Index: src/lib/libc/stdio/fseek.c
diff -u src/lib/libc/stdio/fseek.c:1.23 src/lib/libc/stdio/fseek.c:1.24
--- src/lib/libc/stdio/fseek.c:1.23	Tue Apr 29 02:53:01 2008
+++ src/lib/libc/stdio/fseek.c	Sun Nov 16 15:32:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fseek.c,v 1.23 2008/04/29 06:53:01 martin Exp $	*/
+/*	$NetBSD: fseek.c,v 1.24 2014/11/16 20:32:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fseek.c,v 1.23 2008/04/29 06:53:01 martin Exp $);
+__RCSID($NetBSD: fseek.c,v 1.24 2014/11/16 20:32:52 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include sys/types.h
@@ -55,9 +55,12 @@ fseek(FILE *fp, long l_offset, int whenc
 {
 	off_t offset;
 
+#if 0
+	/* This is a bad idea because makes fseek(fp, -6, SEEK_SET) work... */
 	if (whence == SEEK_SET)
 		offset = (unsigned long)l_offset;
 	else
+#endif
 		offset = l_offset;
 	return fseeko(fp, offset, whence);
 }



CVS commit: src/lib/libc/gen

2014-11-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov 16 20:33:04 UTC 2014

Modified Files:
src/lib/libc/gen: arc4random.3 arc4random.c

Log Message:
Rewrite arc4random(3) with ChaCha20-based PRNG and per-thread state.

Explain the security model in the man page.

No more RC4!

XXX pullup to netbsd-6, netbsd-5


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/gen/arc4random.3
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/gen/arc4random.c

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

Modified files:

Index: src/lib/libc/gen/arc4random.3
diff -u src/lib/libc/gen/arc4random.3:1.9 src/lib/libc/gen/arc4random.3:1.10
--- src/lib/libc/gen/arc4random.3:1.9	Sat Feb  5 00:24:08 2011
+++ src/lib/libc/gen/arc4random.3	Sun Nov 16 20:33:04 2014
@@ -1,9 +1,11 @@
-.\	$NetBSD: arc4random.3,v 1.9 2011/02/05 00:24:08 wiz Exp $
-.\ $OpenBSD: arc4random.3,v 1.17 2000/12/21 14:07:41 aaron Exp $
+.\	$NetBSD: arc4random.3,v 1.10 2014/11/16 20:33:04 riastradh Exp $
 .\
-.\ Copyright 1997 Niels Provos pro...@physnet.uni-hamburg.de
+.\ Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\ All rights reserved.
 .\
+.\ This code is derived from software contributed to The NetBSD Foundation
+.\ by Taylor R. Campbell.
+.\
 .\ Redistribution and use in source and binary forms, with or without
 .\ modification, are permitted provided that the following conditions
 .\ are met:
@@ -12,122 +14,243 @@
 .\ 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.
-.\ 3. All advertising materials mentioning features or use of this software
-.\must display the following acknowledgement:
-.\  This product includes software developed by Niels Provos.
-.\ 4. The name of the author may not be used to endorse or promote products
-.\derived from this software without specific prior written permission.
-.\
-.\ 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.
 .\
-.\ Manual page, using -mandoc macros
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``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 FOUNDATION OR CONTRIBUTORS
+.\ 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.
 .\
-.Dd February 4, 2011
+.Dd November 16, 2014
 .Dt ARC4RANDOM 3
 .Os
 .Sh NAME
 .Nm arc4random ,
-.Nm arc4random_buf ,
 .Nm arc4random_uniform ,
+.Nm arc4random_buf ,
 .Nm arc4random_stir ,
 .Nm arc4random_addrandom
-.Nd arc4 random number generator
+.Nd random number generator
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
 .In stdlib.h
 .Ft uint32_t
 .Fn arc4random void
-.Ft void
-.Fn arc4random_buf void *buffer size_t length
 .Ft uint32_t
-.Fn arc4random_uniform uint32_t upper_bound
+.Fn arc4random_uniform uint32_t bound
+.Ft void
+.Fn arc4random_buf void *buf size_t len
 .Ft void
 .Fn arc4random_stir void
 .Ft void
-.Fn arc4random_addrandom u_char *dat int datlen
+.Fn arc4random_addrandom unsigned char *buf int len
 .Sh DESCRIPTION
 The
-.Fn arc4random
-function provides a high quality 32-bit pseudo-random
-number very quickly.
-.Fn arc4random
-seeds itself on a regular basis from the kernel strong random number
-subsystem described in
-.Xr rnd 4 .
-On each call, an ARC4 generator is used to generate a new result.
-The
-.Fn arc4random
-function uses the ARC4 cipher key stream generator,
-which uses 8*8 8 bit S-Boxes.
-The S-Boxes can be in about (2**1700) states.
+.Nm
+family of functions provides a cryptographic pseudorandom number
+generator automatically seeded from the system entropy pool and safe to
+use from 

CVS commit: src/lib/libc/gen

2014-11-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov 16 20:37:35 UTC 2014

Modified Files:
src/lib/libc/gen: arc4random.3

Log Message:
Grammar.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/gen/arc4random.3

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

Modified files:

Index: src/lib/libc/gen/arc4random.3
diff -u src/lib/libc/gen/arc4random.3:1.10 src/lib/libc/gen/arc4random.3:1.11
--- src/lib/libc/gen/arc4random.3:1.10	Sun Nov 16 20:33:04 2014
+++ src/lib/libc/gen/arc4random.3	Sun Nov 16 20:37:35 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: arc4random.3,v 1.10 2014/11/16 20:33:04 riastradh Exp $
+.\	$NetBSD: arc4random.3,v 1.11 2014/11/16 20:37:35 wiz Exp $
 .\
 .\ Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -104,7 +104,7 @@ entropy pool.
 .Sh SECURITY MODEL
 The
 .Nm
-functions provides the following security properties against three
+functions provide the following security properties against three
 different classes of attackers, assuming that the state of the
 operating system's entropy pool is unknown to the attacker:
 .Bl -bullet -offset abcd -compact



CVS commit: src/sys/netbt

2014-11-16 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sun Nov 16 21:34:27 UTC 2014

Modified Files:
src/sys/netbt: rfcomm_upper.c

Log Message:
since rfcomm_attach_pcb may be called from (soft) interrupt context
(for incoming connections), use kmem_intr_()


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/netbt/rfcomm_upper.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/netbt/rfcomm_upper.c
diff -u src/sys/netbt/rfcomm_upper.c:1.21 src/sys/netbt/rfcomm_upper.c:1.22
--- src/sys/netbt/rfcomm_upper.c:1.21	Fri Aug  8 03:05:45 2014
+++ src/sys/netbt/rfcomm_upper.c	Sun Nov 16 21:34:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rfcomm_upper.c,v 1.21 2014/08/08 03:05:45 rtr Exp $	*/
+/*	$NetBSD: rfcomm_upper.c,v 1.22 2014/11/16 21:34:27 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rfcomm_upper.c,v 1.21 2014/08/08 03:05:45 rtr Exp $);
+__KERNEL_RCSID(0, $NetBSD: rfcomm_upper.c,v 1.22 2014/11/16 21:34:27 plunky Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -70,7 +70,9 @@ rfcomm_attach_pcb(struct rfcomm_dlc **ha
 	KASSERT(proto != NULL);
 	KASSERT(upper != NULL);
 
-	dlc = kmem_zalloc(sizeof(struct rfcomm_dlc), KM_SLEEP);
+	dlc = kmem_intr_zalloc(sizeof(struct rfcomm_dlc), KM_NOSLEEP);
+	if (dlc == NULL)
+		return ENOMEM;
 
 	dlc-rd_state = RFCOMM_DLC_CLOSED;
 	dlc-rd_mtu = rfcomm_mtu_default;
@@ -296,7 +298,7 @@ rfcomm_detach_pcb(struct rfcomm_dlc **ha
 		dlc-rd_flags |= RFCOMM_DLC_DETACH;
 	else {
 		callout_destroy(dlc-rd_timeout);
-		kmem_free(dlc, sizeof(*dlc));
+		kmem_intr_free(dlc, sizeof(*dlc));
 	}
 }
 



CVS commit: src/sys/dev/videomode

2014-11-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 17 00:46:04 UTC 2014

Modified Files:
src/sys/dev/videomode: edid.c edidreg.h edidvar.h

Log Message:
Parse the extension block count field, and make it available in struct edid_info


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/videomode/edid.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/videomode/edidreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/videomode/edidvar.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/videomode/edid.c
diff -u src/sys/dev/videomode/edid.c:1.12 src/sys/dev/videomode/edid.c:1.13
--- src/sys/dev/videomode/edid.c:1.12	Fri Feb  8 16:35:10 2013
+++ src/sys/dev/videomode/edid.c	Mon Nov 17 00:46:04 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: edid.c,v 1.12 2013/02/08 16:35:10 skrll Exp $ */
+/* $NetBSD: edid.c,v 1.13 2014/11/17 00:46:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */ 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: edid.c,v 1.12 2013/02/08 16:35:10 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: edid.c,v 1.13 2014/11/17 00:46:04 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -286,6 +286,8 @@ edid_print(struct edid_info *edid)
 		DIVIDE(DIVIDE(edid-edid_preferred_mode-dot_clock * 1000,
 		edid-edid_preferred_mode-htotal),
 		edid-edid_preferred_mode-vtotal));
+
+	printf(Number of extension blocks: %d\n, edid-edid_ext_block_count);
 }
 
 static const struct videomode *
@@ -569,6 +571,8 @@ edid_parse(uint8_t *data, struct edid_in
 	edid-edid_chroma.ec_whitex = EDID_CHROMA_WHITEX(data);
 	edid-edid_chroma.ec_whitey = EDID_CHROMA_WHITEY(data);
 
+	edid-edid_ext_block_count = EDID_EXT_BLOCK_COUNT(data);
+
 	/* lookup established modes */
 	edid-edid_nmodes = 0;
 	edid-edid_preferred_mode = NULL;

Index: src/sys/dev/videomode/edidreg.h
diff -u src/sys/dev/videomode/edidreg.h:1.3 src/sys/dev/videomode/edidreg.h:1.4
--- src/sys/dev/videomode/edidreg.h:1.3	Wed Mar 30 18:49:56 2011
+++ src/sys/dev/videomode/edidreg.h	Mon Nov 17 00:46:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: edidreg.h,v 1.3 2011/03/30 18:49:56 jdc Exp $	*/
+/*	$NetBSD: edidreg.h,v 1.4 2014/11/17 00:46:04 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -250,4 +250,6 @@
 #define	EDID_DESC_STD_TIMING_START		5
 #define	EDID_DESC_STD_TIMING_COUNT		6
 
+#define	EDID_EXT_BLOCK_COUNT(ptr)		((ptr)[126])
+
 #endif /* _DEV_VIDEOMODE_EDIDREG_H */

Index: src/sys/dev/videomode/edidvar.h
diff -u src/sys/dev/videomode/edidvar.h:1.2 src/sys/dev/videomode/edidvar.h:1.3
--- src/sys/dev/videomode/edidvar.h:1.2	Thu May 11 19:05:41 2006
+++ src/sys/dev/videomode/edidvar.h	Mon Nov 17 00:46:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: edidvar.h,v 1.2 2006/05/11 19:05:41 gdamore Exp $	*/
+/*	$NetBSD: edidvar.h,v 1.3 2014/11/17 00:46:04 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -75,6 +75,7 @@ struct edid_info {
 	uint8_t		edid_max_vsize;		/* in cm */
 	uint8_t		edid_gamma;
 	uint8_t		edid_features;
+	uint8_t		edid_ext_block_count;
 
 	int			edid_have_range;
 	struct edid_range	edid_range;



CVS commit: src/sys/dev/i2c

2014-11-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 17 00:46:44 UTC 2014

Modified Files:
src/sys/dev/i2c: ddc.c ddcvar.h

Log Message:
add ddc_read_edid_block, which is the same as ddc_read_edid but takes an 
additional block number argument


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/ddc.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/ddcvar.h

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

Modified files:

Index: src/sys/dev/i2c/ddc.c
diff -u src/sys/dev/i2c/ddc.c:1.3 src/sys/dev/i2c/ddc.c:1.4
--- src/sys/dev/i2c/ddc.c:1.3	Sun May  4 15:26:29 2008
+++ src/sys/dev/i2c/ddc.c	Mon Nov 17 00:46:44 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ddc.c,v 1.3 2008/05/04 15:26:29 xtraeme Exp $ */
+/* $NetBSD: ddc.c,v 1.4 2014/11/17 00:46:44 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */ 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ddc.c,v 1.3 2008/05/04 15:26:29 xtraeme Exp $);
+__KERNEL_RCSID(0, $NetBSD: ddc.c,v 1.4 2014/11/17 00:46:44 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -91,12 +91,18 @@ ddc_attach(device_t parent, device_t sel
 int
 ddc_read_edid(i2c_tag_t tag, uint8_t *dest, size_t len)
 {
+	return ddc_read_edid_block(tag, dest, len, DDC_EDID_START);
+}
+
+int
+ddc_read_edid_block(i2c_tag_t tag, uint8_t *dest, size_t len, uint8_t block)
+{
 	uint8_t		wbuf[2];
 
 	if (iic_acquire_bus(tag, I2C_F_POLL) != 0)
 		return -1;
 
-	wbuf[0] = DDC_EDID_START;	/* start address */
+	wbuf[0] = block;	/* start address */
 
 	if (iic_exec(tag, I2C_OP_READ_WITH_STOP, DDC_ADDR, wbuf, 1, dest,
 		len, I2C_F_POLL)) {

Index: src/sys/dev/i2c/ddcvar.h
diff -u src/sys/dev/i2c/ddcvar.h:1.1 src/sys/dev/i2c/ddcvar.h:1.2
--- src/sys/dev/i2c/ddcvar.h:1.1	Tue Apr 25 21:18:16 2006
+++ src/sys/dev/i2c/ddcvar.h	Mon Nov 17 00:46:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ddcvar.h,v 1.1 2006/04/25 21:18:16 gdamore Exp $	*/
+/*	$NetBSD: ddcvar.h,v 1.2 2014/11/17 00:46:44 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -40,5 +40,6 @@
  * autoconfiguration framework.
  */
 int ddc_read_edid(i2c_tag_t, u_int8_t *, size_t);
+int ddc_read_edid_block(i2c_tag_t, u_int8_t *, size_t, uint8_t);
 
 #endif /* _DEV_I2C_DDCVAR_H_ */



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

2014-11-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 17 00:49:33 UTC 2014

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

Log Message:
Add support for DVI displays. Detect HDMI vs DVI mode by looking for a
CEA-861-D extension block in the EDID, and then searching this block for
an HDMI vendor-specific data block (HDMI VSDB).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/allwinner/awin_hdmi.c

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_hdmi.c
diff -u src/sys/arch/arm/allwinner/awin_hdmi.c:1.12 src/sys/arch/arm/allwinner/awin_hdmi.c:1.13
--- src/sys/arch/arm/allwinner/awin_hdmi.c:1.12	Fri Nov 14 01:05:57 2014
+++ src/sys/arch/arm/allwinner/awin_hdmi.c	Mon Nov 17 00:49:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_hdmi.c,v 1.12 2014/11/14 01:05:57 jmcneill Exp $ */
+/* $NetBSD: awin_hdmi.c,v 1.13 2014/11/17 00:49:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -32,7 +32,7 @@
 #define AWIN_HDMI_PLL	3	/* PLL7 or PLL3 */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_hdmi.c,v 1.12 2014/11/14 01:05:57 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_hdmi.c,v 1.13 2014/11/17 00:49:32 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -65,6 +65,11 @@ struct awin_hdmi_softc {
 
 	bool sc_connected;
 
+	u_int sc_display_mode;
+#define DISPLAY_MODE_AUTO	0
+#define DISPLAY_MODE_HDMI	1
+#define DISPLAY_MODE_DVI	2
+
 	uint32_t sc_ver;
 	unsigned int sc_i2c_blklen;
 };
@@ -85,17 +90,19 @@ static int	awin_hdmi_i2c_acquire_bus(voi
 static void	awin_hdmi_i2c_release_bus(void *, int);
 static int	awin_hdmi_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *,
    size_t, void *, size_t, int);
-static int	awin_hdmi_i2c_xfer(void *, i2c_addr_t, uint8_t,
+static int	awin_hdmi_i2c_xfer(void *, i2c_addr_t, uint8_t, uint8_t,
    size_t, int, int);
 static int	awin_hdmi_i2c_reset(struct awin_hdmi_softc *, int);
 
 static void	awin_hdmi_enable(struct awin_hdmi_softc *);
 static void	awin_hdmi_read_edid(struct awin_hdmi_softc *);
+static u_int	awin_hdmi_get_display_mode(struct awin_hdmi_softc *,
+	   const struct edid_info *);
 static void	awin_hdmi_video_enable(struct awin_hdmi_softc *, bool);
 static void	awin_hdmi_set_videomode(struct awin_hdmi_softc *,
-	const struct videomode *);
+	const struct videomode *, u_int);
 static void	awin_hdmi_set_audiomode(struct awin_hdmi_softc *,
-	const struct videomode *);
+	const struct videomode *, u_int);
 static void	awin_hdmi_hpd(struct awin_hdmi_softc *);
 static void	awin_hdmi_thread(void *);
 #if 0
@@ -127,6 +134,7 @@ awin_hdmi_attach(device_t parent, device
 	struct awin_hdmi_softc *sc = device_private(self);
 	struct awinio_attach_args * const aio = aux;
 	const struct awin_locators * const loc = aio-aio_loc;
+	prop_dictionary_t cfg = device_properties(self);
 	uint32_t ver, clk;
 
 	sc-sc_dev = self;
@@ -172,6 +180,15 @@ awin_hdmi_attach(device_t parent, device
 	sc-sc_ver = ver;
 	sc-sc_i2c_blklen = 16;
 
+	const char *display_mode = NULL;
+	prop_dictionary_get_cstring_nocopy(cfg, display-mode, display_mode);
+	if (display_mode) {
+		if (strcasecmp(display_mode, hdmi) == 0)
+			sc-sc_display_mode = DISPLAY_MODE_HDMI;
+		else if (strcasecmp(display_mode, dvi) == 0)
+			sc-sc_display_mode = DISPLAY_MODE_DVI;
+	}
+
 #if 0
 	sc-sc_ih = intr_establish(loc-loc_intr, IPL_SCHED, IST_LEVEL,
 	awin_hdmi_intr, sc);
@@ -237,6 +254,7 @@ awin_hdmi_i2c_exec(void *priv, i2c_op_t 
 {
 	struct awin_hdmi_softc *sc = priv;
 	uint8_t *pbuf;
+	uint8_t block;
 	int resid;
 	off_t off;
 	int err;
@@ -251,14 +269,15 @@ awin_hdmi_i2c_exec(void *priv, i2c_op_t 
 	if (err)
 		goto done;
 
-	off = *(const uint8_t *)cmdbuf;
+	block = *(const uint8_t *)cmdbuf;
+	off = (block  1) ? 128 : 0;
 
 	pbuf = buf;
 	resid = len;
 	while (resid  0) {
 		size_t blklen = min(resid, sc-sc_i2c_blklen);
 
-		err = awin_hdmi_i2c_xfer(sc, addr, off, blklen,
+		err = awin_hdmi_i2c_xfer(sc, addr, block  1, off, blklen,
 		  AWIN_HDMI_DDC_COMMAND_ACCESS_CMD_EOREAD, flags);
 		if (err)
 			goto done;
@@ -288,7 +307,7 @@ done:
 }
 
 static int
-awin_hdmi_i2c_xfer_1_3(void *priv, i2c_addr_t addr, uint8_t reg,
+awin_hdmi_i2c_xfer_1_3(void *priv, i2c_addr_t addr, uint8_t block, uint8_t reg,
 size_t len, int type, int flags)
 {
 	struct awin_hdmi_softc *sc = priv;
@@ -299,7 +318,8 @@ awin_hdmi_i2c_xfer_1_3(void *priv, i2c_a
 	val = ~AWIN_HDMI_DDC_CTRL_FIFO_DIR;
 	HDMI_WRITE(sc, AWIN_HDMI_DDC_CTRL_REG, val);
 
-	val = __SHIFTIN(0x60, AWIN_HDMI_DDC_SLAVE_ADDR_1);
+	val |= __SHIFTIN(block, AWIN_HDMI_DDC_SLAVE_ADDR_0);
+	val |= __SHIFTIN(0x60, AWIN_HDMI_DDC_SLAVE_ADDR_1);
 	val |= __SHIFTIN(reg, AWIN_HDMI_DDC_SLAVE_ADDR_2);
 	val |= __SHIFTIN(addr, AWIN_HDMI_DDC_SLAVE_ADDR_3);
 	HDMI_WRITE(sc, AWIN_HDMI_DDC_SLAVE_ADDR_REG, val);
@@ -336,7 +356,7 @@ 

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

2014-11-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 17 00:50:40 UTC 2014

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

Log Message:
Allow for overriding DVI/HDMI detection with a kernel boot arg. Set
hdmi.forcemode=dvi or hdmi.forcemode=hdmi to disable auto-detection.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.28 src/sys/arch/evbarm/awin/awin_machdep.c:1.29
--- src/sys/arch/evbarm/awin/awin_machdep.c:1.28	Fri Nov 14 19:47:36 2014
+++ src/sys/arch/evbarm/awin/awin_machdep.c	Mon Nov 17 00:50:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_machdep.c,v 1.28 2014/11/14 19:47:36 jmcneill Exp $ */
+/*	$NetBSD: awin_machdep.c,v 1.29 2014/11/17 00:50:40 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.28 2014/11/14 19:47:36 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.29 2014/11/17 00:50:40 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -769,6 +769,20 @@ awin_device_register(device_t self, void
 		}
 	}
 
+	if (device_is_a(self, awinhdmi)) {
+		char *display_mode;
+		if (get_bootconf_option(boot_args, hdmi.forcemode,
+		BOOTOPT_TYPE_STRING, display_mode)) {
+			if (strcasecmp(display_mode, hdmi) == 0) {
+prop_dictionary_set_cstring(dict,
+display-mode, hdmi);
+			} else if (strcasecmp(display_mode, dvi) == 0) {
+prop_dictionary_set_cstring(dict,
+display-mode, dvi);
+			}
+		}
+	}
+
 #if NGENFB  0
 	if (device_is_a(self, genfb)) {
 #ifdef DDB



CVS commit: src/usr.bin/config

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Mon Nov 17 00:53:15 UTC 2014

Modified Files:
src/usr.bin/config: defs.h files.c mkmakefile.c

Log Message:
Pre-calc file path len/suffix.  Misc. clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/config/defs.h
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/config/files.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/config/mkmakefile.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.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.63 src/usr.bin/config/defs.h:1.64
--- src/usr.bin/config/defs.h:1.63	Sat Nov 15 08:21:38 2014
+++ src/usr.bin/config/defs.h	Mon Nov 17 00:53:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.63 2014/11/15 08:21:38 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.64 2014/11/17 00:53:15 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -340,6 +340,8 @@ struct filetype
 	char	fit_lastc;	/* last char from path */
 	const char *fit_path;	/* full file path */
 	const char *fit_prefix;	/* any file prefix */
+	size_t fit_len;		/* path string length */
+	int fit_suffix;		/* single char suffix */
 	struct attr *fit_attr;	/* owner attr */
 	TAILQ_ENTRY(files) fit_anext;	/* next file in attr */
 };
@@ -371,6 +373,8 @@ struct files {
 #define fi_lastc   fi_fit.fit_lastc
 #define fi_pathfi_fit.fit_path
 #define fi_prefix  fi_fit.fit_prefix
+#define fi_suffix  fi_fit.fit_suffix
+#define fi_len fi_fit.fit_len
 #define fi_attrfi_fit.fit_attr
 #define fi_anext   fi_fit.fit_anext
 

Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.17 src/usr.bin/config/files.c:1.18
--- src/usr.bin/config/files.c:1.17	Wed Oct 29 17:14:50 2014
+++ src/usr.bin/config/files.c	Mon Nov 17 00:53:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.17 2014/10/29 17:14:50 christos Exp $	*/
+/*	$NetBSD: files.c,v 1.18 2014/11/17 00:53:15 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: files.c,v 1.17 2014/10/29 17:14:50 christos Exp $);
+__RCSID($NetBSD: files.c,v 1.18 2014/11/17 00:53:15 uebayasi Exp $);
 
 #include sys/param.h
 #include errno.h
@@ -158,6 +158,8 @@ addfile(const char *path, struct condexp
 	fi-fi_base = intern(base);
 	fi-fi_prefix = SLIST_EMPTY(prefixes) ? NULL :
 			SLIST_FIRST(prefixes)-pf_prefix;
+	fi-fi_len = strlen(path);
+	fi-fi_suffix = path[fi-fi_len - 1];
 	fi-fi_optx = optx;
 	fi-fi_optf = NULL;
 	fi-fi_mkrule = rule;

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.32 src/usr.bin/config/mkmakefile.c:1.33
--- src/usr.bin/config/mkmakefile.c:1.32	Sun Nov 16 15:10:54 2014
+++ src/usr.bin/config/mkmakefile.c	Mon Nov 17 00:53:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.32 2014/11/16 15:10:54 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.33 2014/11/17 00:53:15 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: mkmakefile.c,v 1.32 2014/11/16 15:10:54 uebayasi Exp $);
+__RCSID($NetBSD: mkmakefile.c,v 1.33 2014/11/17 00:53:15 uebayasi Exp $);
 
 #include sys/param.h
 #include ctype.h
@@ -273,19 +273,15 @@ srcpath(struct files *fi)
 static const char *
 filetype_prologue(struct filetype *fit)
 {
-	if (*fit-fit_path == '/')
-		return ();
-	else
-		return ($S/);
+
+	return (*fit-fit_path == '/') ?  : $S/;
 }
 
 static const char *
 prefix_prologue(const char *path)
 {
-	if (*path == '/')
-		return ();
-	else
-		return ($S/);
+
+	return (*path == '/') ?  : $S/;
 }
 
 static void
@@ -300,23 +296,25 @@ emitdefs(FILE *fp)
 		/* Skip any options output to a header file */
 		if (DEFINED_OPTION(nv-nv_name))
 			continue;
+		const char *s = nv-nv_str;
 		fprintf(fp, \t-D%s%s%s%s \\\n, nv-nv_name,
-		(nv-nv_str != NULL) ? =\ : ,
-		(nv-nv_str != NULL) ? nv-nv_str : ,
-		(nv-nv_str != NULL) ? \ : );
+		s ? =\ : ,
+		s ? s : ,
+		s ? \ : );
 	}
 	putc('\n', fp);
 	fprintf(fp, PARAM=-DMAXUSERS=%d\n, maxusers);
 	fprintf(fp, MACHINE=%s\n, machine);
-	if (*srcdir == '/' || *srcdir == '.') {
-		fprintf(fp, S=\t%s\n, srcdir);
-	} else {
+
+	const char *subdir = ;
+	if (*srcdir != '/'  *srcdir != '.') {
 		/*
 		 * libkern and libcompat Makefile.incs want relative S
 		 * specification to begin with '.'.
 		 */
-		fprintf(fp, S=\t./%s\n, srcdir);
+		subdir = ./;
 	}
+	fprintf(fp, S=\t%s%s\n, subdir, srcdir);
 	for (nv = mkoptions; nv != NULL; nv = nv-nv_next)
 		fprintf(fp, %s=%s\n, nv-nv_name, nv-nv_str);
 }
@@ -482,7 +480,6 @@ static void
 emitfiles(FILE *fp, int suffix, int upper_suffix)
 {
 	struct files *fi;
-	size_t len;
 	const char *fpath;
  	struct config *cf;
  	char swapname[100];
@@ -494,8 +491,7 @@ emitfiles(FILE *fp, int suffix, int uppe
 		if ((fi-fi_flags  FI_SEL) == 0)
 			continue;
 		fpath = srcpath(fi);
-		len = strlen(fpath);
-		if (fpath[len - 1] != suffix  fpath[len - 1] != 

CVS commit: src/sys/compat

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Mon Nov 17 01:01:58 UTC 2014

Modified Files:
src/sys/compat/aoutm68k: files.aoutm68k
src/sys/compat/freebsd: files.freebsd
src/sys/compat/ibcs2: files.ibcs2
src/sys/compat/linux: files.linux
src/sys/compat/linux32: files.linux32
src/sys/compat/m68k4k: files.m68k4k
src/sys/compat/ndis: files.ndis
src/sys/compat/netbsd32: files.netbsd32
src/sys/compat/osf1: files.osf1
src/sys/compat/ossaudio: files.ossaudio
src/sys/compat/sunos: files.sunos
src/sys/compat/sunos32: files.sunos32
src/sys/compat/svr4: files.svr4
src/sys/compat/svr4_32: files.svr4_32
src/sys/compat/ultrix: files.ultrix
src/sys/compat/vax1k: files.vax1k

Log Message:
Define compat modules (but without dependencies yet).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/aoutm68k/files.aoutm68k
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/freebsd/files.freebsd
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/ibcs2/files.ibcs2
cvs rdiff -u -r1.20 -r1.21 src/sys/compat/linux/files.linux
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux32/files.linux32
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/m68k4k/files.m68k4k
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/ndis/files.ndis
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/osf1/files.osf1
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/ossaudio/files.ossaudio
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/sunos/files.sunos
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sunos32/files.sunos32
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/svr4/files.svr4
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/svr4_32/files.svr4_32
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/ultrix/files.ultrix
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/vax1k/files.vax1k

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

Modified files:

Index: src/sys/compat/aoutm68k/files.aoutm68k
diff -u src/sys/compat/aoutm68k/files.aoutm68k:1.6 src/sys/compat/aoutm68k/files.aoutm68k:1.7
--- src/sys/compat/aoutm68k/files.aoutm68k:1.6	Wed Nov 19 18:36:02 2008
+++ src/sys/compat/aoutm68k/files.aoutm68k	Mon Nov 17 01:01:57 2014
@@ -1,10 +1,11 @@
-#	$NetBSD: files.aoutm68k,v 1.6 2008/11/19 18:36:02 ad Exp $
+#	$NetBSD: files.aoutm68k,v 1.7 2014/11/17 01:01:57 uebayasi Exp $
 #
 # Config file description for m68k a.out compat code.
 
 # ports should define any machine-specific files they need in their
 # own file lists.
 
+define	compat_aout_m68k
 file	compat/aoutm68k/aoutm68k_exec.c		compat_aout_m68k
 file	compat/aoutm68k/aoutm68k_stat.c		compat_aout_m68k
 file	compat/aoutm68k/aoutm68k_sysent.c	compat_aout_m68k

Index: src/sys/compat/freebsd/files.freebsd
diff -u src/sys/compat/freebsd/files.freebsd:1.12 src/sys/compat/freebsd/files.freebsd:1.13
--- src/sys/compat/freebsd/files.freebsd:1.12	Wed Nov 19 18:36:02 2008
+++ src/sys/compat/freebsd/files.freebsd	Mon Nov 17 01:01:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.freebsd,v 1.12 2008/11/19 18:36:02 ad Exp $
+#	$NetBSD: files.freebsd,v 1.13 2014/11/17 01:01:57 uebayasi Exp $
 #
 # Config file description for machine-independent FreeBSD compat code.
 # Included by ports that need it.
@@ -6,6 +6,7 @@
 # ports should define any machine-specific files they need in their
 # own file lists.
 
+define	compat_freebsd
 file	compat/freebsd/freebsd_exec.c		compat_freebsd
 file	compat/freebsd/freebsd_exec_elf32.c	compat_freebsd  exec_elf32
 file	compat/freebsd/freebsd_exec_aout.c	compat_freebsd  exec_aout

Index: src/sys/compat/ibcs2/files.ibcs2
diff -u src/sys/compat/ibcs2/files.ibcs2:1.9 src/sys/compat/ibcs2/files.ibcs2:1.10
--- src/sys/compat/ibcs2/files.ibcs2:1.9	Wed Nov 19 18:36:02 2008
+++ src/sys/compat/ibcs2/files.ibcs2	Mon Nov 17 01:01:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ibcs2,v 1.9 2008/11/19 18:36:02 ad Exp $
+#	$NetBSD: files.ibcs2,v 1.10 2014/11/17 01:01:57 uebayasi Exp $
 #
 # Config file description for machine-independent IBCS-2 compat code.
 # Included by ports that need it.
@@ -6,6 +6,7 @@
 # ports should define any machine-specific files they need in their
 # own file lists.
 
+define	compat_ibcs2
 file	compat/ibcs2/ibcs2_errno.c	compat_ibcs2
 file	compat/ibcs2/ibcs2_exec.c	compat_ibcs2
 file	compat/ibcs2/ibcs2_exec_coff.c	compat_ibcs2

Index: src/sys/compat/linux/files.linux
diff -u src/sys/compat/linux/files.linux:1.20 src/sys/compat/linux/files.linux:1.21
--- src/sys/compat/linux/files.linux:1.20	Wed Nov 19 18:36:03 2008
+++ src/sys/compat/linux/files.linux	Mon Nov 17 01:01:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.linux,v 1.20 2008/11/19 18:36:03 ad Exp $
+#	$NetBSD: files.linux,v 1.21 2014/11/17 01:01:57 uebayasi Exp $
 #
 # Config file description for machine-independent Linux compat code.
 # Included by ports that need it.
@@ -6,6 +6,7 @@
 # ports should define any machine-specific files they need in their
 # 

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

2014-11-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 17 01:38:00 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_hdmi.c awin_hdmiaudio.c awin_var.h

Log Message:
report hotplug status for AUDIO_GETDEV fields, only allow playback if a capable 
display is connected


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/allwinner/awin_hdmi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/allwinner/awin_hdmiaudio.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/allwinner/awin_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/allwinner/awin_hdmi.c
diff -u src/sys/arch/arm/allwinner/awin_hdmi.c:1.13 src/sys/arch/arm/allwinner/awin_hdmi.c:1.14
--- src/sys/arch/arm/allwinner/awin_hdmi.c:1.13	Mon Nov 17 00:49:32 2014
+++ src/sys/arch/arm/allwinner/awin_hdmi.c	Mon Nov 17 01:38:00 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_hdmi.c,v 1.13 2014/11/17 00:49:32 jmcneill Exp $ */
+/* $NetBSD: awin_hdmi.c,v 1.14 2014/11/17 01:38:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -32,7 +32,7 @@
 #define AWIN_HDMI_PLL	3	/* PLL7 or PLL3 */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_hdmi.c,v 1.13 2014/11/17 00:49:32 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_hdmi.c,v 1.14 2014/11/17 01:38:00 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -64,8 +64,11 @@ struct awin_hdmi_softc {
 	kmutex_t sc_ic_lock;
 
 	bool sc_connected;
+	char sc_display_vendor[16];
+	char sc_display_product[16];
 
 	u_int sc_display_mode;
+	u_int sc_current_display_mode;
 #define DISPLAY_MODE_AUTO	0
 #define DISPLAY_MODE_HDMI	1
 #define DISPLAY_MODE_DVI	2
@@ -522,6 +525,12 @@ awin_hdmi_read_edid(struct awin_hdmi_sof
 	device_printf(sc-sc_dev, %s mode (%s)\n,
 	display_mode == DISPLAY_MODE_HDMI ? HDMI : DVI, forced);
 
+	strlcpy(sc-sc_display_vendor, ei.edid_vendorname,
+	sizeof(sc-sc_display_vendor));
+	strlcpy(sc-sc_display_product, ei.edid_productname,
+	sizeof(sc-sc_display_product));
+	sc-sc_current_display_mode = display_mode;
+
 	mode = ei.edid_preferred_mode;
 	if (mode == NULL)
 		mode = pick_mode_by_ref(640, 480, 60);
@@ -868,7 +877,6 @@ awin_hdmi_hpd(struct awin_hdmi_softc *sc
 	if (sc-sc_connected == con)
 		return;
 
-	sc-sc_connected = con;
 	if (con) {
 		device_printf(sc-sc_dev, display connected\n);
 		awin_hdmi_read_edid(sc);
@@ -876,6 +884,8 @@ awin_hdmi_hpd(struct awin_hdmi_softc *sc
 		device_printf(sc-sc_dev, display disconnected\n);
 		awin_tcon_set_videomode(NULL);
 	}
+
+	sc-sc_connected = con;
 }
 
 static void
@@ -908,6 +918,32 @@ awin_hdmi_intr(void *priv)
 }
 #endif
 
+void
+awin_hdmi_get_info(struct awin_hdmi_info *info)
+{
+	struct awin_hdmi_softc *sc;
+	device_t dev;
+
+	memset(info, 0, sizeof(*info));
+
+	dev = device_find_by_driver_unit(awinhdmi, 0);
+	if (dev == NULL) {
+		info-display_connected = false;
+		return;
+	}
+	sc = device_private(dev);
+
+	info-display_connected = sc-sc_connected;
+	if (info-display_connected) {
+		strlcpy(info-display_vendor, sc-sc_display_vendor,
+		sizeof(info-display_vendor));
+		strlcpy(info-display_product, sc-sc_display_product,
+		sizeof(info-display_product));
+		info-display_hdmimode =
+		sc-sc_current_display_mode == DISPLAY_MODE_HDMI;
+	}
+}
+
 #if defined(DDB)
 void
 awin_hdmi_dump_regs(void)

Index: src/sys/arch/arm/allwinner/awin_hdmiaudio.c
diff -u src/sys/arch/arm/allwinner/awin_hdmiaudio.c:1.3 src/sys/arch/arm/allwinner/awin_hdmiaudio.c:1.4
--- src/sys/arch/arm/allwinner/awin_hdmiaudio.c:1.3	Wed Nov 12 17:38:14 2014
+++ src/sys/arch/arm/allwinner/awin_hdmiaudio.c	Mon Nov 17 01:38:00 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_hdmiaudio.c,v 1.3 2014/11/12 17:38:14 jmcneill Exp $ */
+/* $NetBSD: awin_hdmiaudio.c,v 1.4 2014/11/17 01:38:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_hdmiaudio.c,v 1.3 2014/11/12 17:38:14 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_hdmiaudio.c,v 1.4 2014/11/17 01:38:00 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -538,14 +538,35 @@ static int
 awin_hdmiaudio_getdev(void *priv, struct audio_device *audiodev)
 {
 	struct awin_hdmiaudio_softc *sc = priv;
+	struct awin_hdmi_info info;
+	const char *vendor = NULL, *product = NULL;
 
 	const int vmaj = __SHIFTOUT(sc-sc_ver, AWIN_HDMI_VERSION_ID_H);
 	const int vmin = __SHIFTOUT(sc-sc_ver, AWIN_HDMI_VERSION_ID_L);
 
-	snprintf(audiodev-name, sizeof(audiodev-name), Allwinner);
-	snprintf(audiodev-version, sizeof(audiodev-version),
+	awin_hdmi_get_info(info);
+
+	if (info.display_connected  info.display_hdmimode) {
+		if (strlen(info.display_vendor)  0 
+		strlen(info.display_product)  0) {
+			vendor = info.display_vendor;
+			product = info.display_product;
+		} else {
+			vendor = HDMI;
+			product = ;
+	

CVS commit: src/sys

2014-11-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 17 02:15:49 UTC 2014

Modified Files:
src/sys/arch/atari/dev: clockreg.h
src/sys/arch/dreamcast/dev/g2: g2rtc.c
src/sys/arch/hp300/stand/common: clock.c
src/sys/arch/hpcmips/vr: rtc.c rtcreg.h
src/sys/arch/mvme68k/stand/libsa: chiptotime.c clock.c
src/sys/arch/mvmeppc/stand/libsa: clock.c
src/sys/arch/vax/include: clock.h
src/sys/arch/vax/vax: clock.c
src/sys/arch/x68k/stand/libsa: clock.c
src/sys/dev: clock_subr.c clock_subr.h
src/sys/dev/dec: mcclock.c
src/sys/fs/smbfs: smbfs_subr.c
src/sys/kern: kern_todr.c
src/sys/sys: Makefile

Log Message:
PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/dev/clockreg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/dreamcast/dev/g2/g2rtc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/common/clock.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hpcmips/vr/rtc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hpcmips/vr/rtcreg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mvme68k/stand/libsa/chiptotime.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mvme68k/stand/libsa/clock.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mvmeppc/stand/libsa/clock.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/include/clock.h
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/vax/vax/clock.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/libsa/clock.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/clock_subr.c src/sys/dev/clock_subr.h
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/dec/mcclock.c
cvs rdiff -u -r1.17 -r1.18 src/sys/fs/smbfs/smbfs_subr.c
cvs rdiff -u -r1.36 -r1.37 src/sys/kern/kern_todr.c
cvs rdiff -u -r1.151 -r1.152 src/sys/sys/Makefile

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/atari/dev/clockreg.h
diff -u src/sys/arch/atari/dev/clockreg.h:1.6 src/sys/arch/atari/dev/clockreg.h:1.7
--- src/sys/arch/atari/dev/clockreg.h:1.6	Tue Oct 20 15:10:10 2009
+++ src/sys/arch/atari/dev/clockreg.h	Sun Nov 16 21:15:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: clockreg.h,v 1.6 2009/10/20 19:10:10 snj Exp $	*/
+/*	$NetBSD: clockreg.h,v 1.7 2014/11/17 02:15:48 christos Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -56,10 +56,6 @@ struct rtc {
 /*
  * Some useful constants/macros
  */
-#define	is_leap(x)		(!(x % 4)  ((x % 100) || !(x % 1000)))
 #define	range_test(n, l, h)	((n)  (l) || (n)  (h))
-#define	SECS_DAY		86400L
-#define	SECS_HOUR		3600L
 #define	GEMSTARTOFTIME		((machineid  ATARI_CLKBROKEN) ? 1970 : 1968)
-#define	BSDSTARTOFTIME		1970
 #endif /* _CLOCKREG_H */

Index: src/sys/arch/dreamcast/dev/g2/g2rtc.c
diff -u src/sys/arch/dreamcast/dev/g2/g2rtc.c:1.6 src/sys/arch/dreamcast/dev/g2/g2rtc.c:1.7
--- src/sys/arch/dreamcast/dev/g2/g2rtc.c:1.6	Tue Jul 19 11:52:29 2011
+++ src/sys/arch/dreamcast/dev/g2/g2rtc.c	Sun Nov 16 21:15:48 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: g2rtc.c,v 1.6 2011/07/19 15:52:29 dyoung Exp $ */
+/* $NetBSD: g2rtc.c,v 1.7 2014/11/17 02:15:48 christos Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: g2rtc.c,v 1.6 2011/07/19 15:52:29 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: g2rtc.c,v 1.7 2014/11/17 02:15:48 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -43,7 +43,7 @@ __KERNEL_RCSID(0, $NetBSD: g2rtc.c,v 1.
 #define G2RTC_REG_SIZE	12
 
 /* Offset by 20 years, 5 of them are leap */
-#define G2RTC_OFFSET	(20 * SECYR + 5 * SECDAY)
+#define G2RTC_OFFSET	(20 * SECS_PER_COMMON_YEAR + 5 * SECS_PER_DAY)
 
 struct g2rtc_softc {
 	device_t sc_dev;

Index: src/sys/arch/hp300/stand/common/clock.c
diff -u src/sys/arch/hp300/stand/common/clock.c:1.12 src/sys/arch/hp300/stand/common/clock.c:1.13
--- src/sys/arch/hp300/stand/common/clock.c:1.12	Sat Apr 19 02:04:58 2014
+++ src/sys/arch/hp300/stand/common/clock.c	Sun Nov 16 21:15:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.12 2014/04/19 06:04:58 tsutsui Exp $	*/
+/*	$NetBSD: clock.c,v 1.13 2014/11/17 02:15:48 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -49,31 +49,22 @@
 #include hp300/dev/frodoreg.h		/* for APCI offsets */
 #include hp300/dev/intioreg.h		/* for frodo offsets */
 #include dev/ic/mc146818reg.h
+#include dev/clock_subr.h
 
 #include lib/libsa/stand.h
 #include lib/libsa/net.h
 #include hp300/stand/common/samachdep.h
 
 #define FEBRUARY2
-#define STARTOFTIME 1970
-#define SECDAY  (60L * 60L * 24L)
-#define SECYR   (SECDAY * 365)
 
 #define BBC_SET_REG 0xe0
 #define BBC_WRITE_REG   0xc2
 #define BBC_READ_REG0xc3
 #define NUM_BBC_REGS12
 
-#define 

CVS commit: src/distrib/sets/lists/comp

2014-11-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 17 02:16:51 UTC 2014

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
add sys/clock.h


To generate a diff of this commit:
cvs rdiff -u -r1.1919 -r1.1920 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1919 src/distrib/sets/lists/comp/mi:1.1920
--- src/distrib/sets/lists/comp/mi:1.1919	Thu Oct 23 22:39:34 2014
+++ src/distrib/sets/lists/comp/mi	Sun Nov 16 21:16:51 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1919 2014/10/24 02:39:34 christos Exp $
+#	$NetBSD: mi,v 1.1920 2014/11/17 02:16:51 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3130,6 +3130,7 @@
 ./usr/include/sys/cdio.h			comp-c-include
 ./usr/include/sys/chio.h			comp-c-include
 ./usr/include/sys/clist.h			comp-obsolete		obsolete
+./usr/include/sys/clock.h			comp-c-include
 ./usr/include/sys/clockctl.h			comp-c-include
 ./usr/include/sys/common_ansi.h			comp-c-include
 ./usr/include/sys/common_int_const.h		comp-c-include



CVS commit: src/sys

2014-11-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 17 02:23:33 UTC 2014

Modified Files:
src/sys/dev: clock_subr.c
src/sys/fs/smbfs: smbfs_subr.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/clock_subr.c
cvs rdiff -u -r1.18 -r1.19 src/sys/fs/smbfs/smbfs_subr.c

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

Modified files:

Index: src/sys/dev/clock_subr.c
diff -u src/sys/dev/clock_subr.c:1.23 src/sys/dev/clock_subr.c:1.24
--- src/sys/dev/clock_subr.c:1.23	Sun Nov 16 21:15:49 2014
+++ src/sys/dev/clock_subr.c	Sun Nov 16 21:23:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_subr.c,v 1.23 2014/11/17 02:15:49 christos Exp $	*/
+/*	$NetBSD: clock_subr.c,v 1.24 2014/11/17 02:23:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -50,7 +50,7 @@
 
 #ifdef _KERNEL
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: clock_subr.c,v 1.23 2014/11/17 02:15:49 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock_subr.c,v 1.24 2014/11/17 02:23:33 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -63,7 +63,6 @@ __KERNEL_RCSID(0, $NetBSD: clock_subr.c
 
 #include dev/clock_subr.h
 
-static inline int leapyear(uint64_t year);
 #define FEBRUARY	2
 
 /* for easier alignment:
@@ -118,7 +117,7 @@ clock_ymdhms_to_secs(struct clock_ymdhms
 		year -= i * 4;
 
 		for (i = dt-dt_year-year; i  dt-dt_year; i++)
-			days += days_in_year(i);
+			days += days_per_year(i);
 	}
 
 

Index: src/sys/fs/smbfs/smbfs_subr.c
diff -u src/sys/fs/smbfs/smbfs_subr.c:1.18 src/sys/fs/smbfs/smbfs_subr.c:1.19
--- src/sys/fs/smbfs/smbfs_subr.c:1.18	Sun Nov 16 21:15:49 2014
+++ src/sys/fs/smbfs/smbfs_subr.c	Sun Nov 16 21:23:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_subr.c,v 1.18 2014/11/17 02:15:49 christos Exp $	*/
+/*	$NetBSD: smbfs_subr.c,v 1.19 2014/11/17 02:23:33 christos Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbfs_subr.c,v 1.18 2014/11/17 02:15:49 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbfs_subr.c,v 1.19 2014/11/17 02:23:33 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -45,6 +45,7 @@ __KERNEL_RCSID(0, $NetBSD: smbfs_subr.c
 #include sys/time.h
 #include sys/vnode.h
 #include sys/sysctl.h
+#include sys/clock.h
 #include netsmb/iconv.h
 
 #include netsmb/smb.h



CVS commit: src/sys/sys

2014-11-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 17 02:27:26 UTC 2014

Added Files:
src/sys/sys: clock.h

Log Message:
PR/49207: Kamil Rytarowski: Centralize and rename a bunch of clock constants
and inline functions.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/sys/clock.h

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

Added files:

Index: src/sys/sys/clock.h
diff -u /dev/null src/sys/sys/clock.h:1.1
--- /dev/null	Sun Nov 16 21:27:26 2014
+++ src/sys/sys/clock.h	Sun Nov 16 21:27:26 2014
@@ -0,0 +1,91 @@
+/*	$NetBSD: clock.h,v 1.1 2014/11/17 02:27:26 christos Exp $	*/
+
+/*-
+ * Copyright (c) 1996 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Gordon W. Ross
+ *
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ */
+
+#ifndef _SYS_CLOCK_H_
+#define _SYS_CLOCK_H_
+
+/* Some handy constants. */
+#define SECS_PER_MINUTE		60
+#define SECS_PER_HOUR		3600
+#define SECS_PER_DAY		86400
+#define DAYS_PER_COMMON_YEAR365
+#define DAYS_PER_LEAP_YEAR  366
+#define SECS_PER_COMMON_YEAR	(SECS_PER_DAY * DAYS_PER_COMMON_YEAR)
+#define SECS_PER_LEAP_YEAR	(SECS_PER_DAY * DAYS_PER_LEAP_YEAR)
+
+/* Traditional POSIX base year */
+#define	POSIX_BASE_YEAR	1970
+
+/* Some handy functions */
+static inline int
+days_in_month(int m)
+{
+	static const int month_days[12] = {
+	31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+	};
+
+	if (__predict_false(m  1 || m  12))
+		return EINVAL;
+
+	return month_days[m - 1];
+}
+
+/*
+ * This inline avoids some unnecessary modulo operations
+ * as compared with the usual macro:
+ *   ( ((year % 4) == 0 
+ *  (year % 100) != 0) ||
+ * ((year % 400) == 0) )
+ * It is otherwise equivalent.
+ */
+static inline int
+is_leap_year(uint64_t year)
+{
+	int rv = 0;
+
+	if ((year  3) == 0) {
+		rv = 1;
+		if (__predict_false((year % 100) == 0)) {
+			rv = 0;
+			if (__predict_false((year % 400) == 0))
+rv = 1;
+		}
+	}
+	return rv;
+}
+
+static inline int
+days_per_year(uint64_t year)
+{
+	return is_leap_year(year) ? DAYS_PER_LEAP_YEAR : DAYS_PER_COMMON_YEAR;
+}
+
+#endif /* _SYS_CLOCK_H_ */



CVS commit: src/sys/altq

2014-11-16 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Mon Nov 17 06:04:01 UTC 2014

Modified Files:
src/sys/altq: files.altq

Log Message:
Build altq module.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/altq/files.altq

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

Modified files:

Index: src/sys/altq/files.altq
diff -u src/sys/altq/files.altq:1.7 src/sys/altq/files.altq:1.8
--- src/sys/altq/files.altq:1.7	Sun Dec  6 14:03:23 2009
+++ src/sys/altq/files.altq	Mon Nov 17 06:04:01 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.altq,v 1.7 2009/12/06 14:03:23 dsl Exp $
+#	$NetBSD: files.altq,v 1.8 2014/11/17 06:04:01 uebayasi Exp $
 
 defflag	opt_altq_enabled.h	ALTQ
 defflag opt_altq.h		ALTQ_AFMAP ALTQ_BLUE ALTQ_CBQ ALTQ_CDNR
@@ -13,6 +13,7 @@ defflag opt_altq.h		ALTQ_AFMAP ALTQ_BLUE
 # Always enabled if ALTQ_BLUE defined
 # defflag opt_altq.h		BLUE_STATS
 
+define	altq
 file	altq/altq_conf.c	altq
 file	altq/altq_afmap.c	altq
 file	altq/altq_blue.c	altq



CVS commit: src/lib/libc/gen

2014-11-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Nov 17 06:37:23 UTC 2014

Modified Files:
src/lib/libc/gen: arc4random.3

Log Message:
Note relation of arc4random(3) to rand(3)/random(3).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/gen/arc4random.3

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

Modified files:

Index: src/lib/libc/gen/arc4random.3
diff -u src/lib/libc/gen/arc4random.3:1.11 src/lib/libc/gen/arc4random.3:1.12
--- src/lib/libc/gen/arc4random.3:1.11	Sun Nov 16 20:37:35 2014
+++ src/lib/libc/gen/arc4random.3	Mon Nov 17 06:37:23 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: arc4random.3,v 1.11 2014/11/16 20:37:35 wiz Exp $
+.\	$NetBSD: arc4random.3,v 1.12 2014/11/17 06:37:23 riastradh Exp $
 .\
 .\ Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -58,7 +58,12 @@ family of functions provides a cryptogra
 generator automatically seeded from the system entropy pool and safe to
 use from multiple threads.
 .Nm
-is faster and more convenient than reading from
+is designed to prevent an adversary from guessing outputs,
+unlike
+.Xr rand 3
+and
+.Xr random 3 ,
+and is faster and more convenient than reading from
 .Pa /dev/urandom
 directly.
 .Pp



CVS commit: src/lib/libc/gen

2014-11-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Nov 17 07:11:00 UTC 2014

Modified Files:
src/lib/libc/gen: arc4random.3

Log Message:
Ruminate on security model choices and API design in arc4random(3).


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

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

Modified files:

Index: src/lib/libc/gen/arc4random.3
diff -u src/lib/libc/gen/arc4random.3:1.12 src/lib/libc/gen/arc4random.3:1.13
--- src/lib/libc/gen/arc4random.3:1.12	Mon Nov 17 06:37:23 2014
+++ src/lib/libc/gen/arc4random.3	Mon Nov 17 07:11:00 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: arc4random.3,v 1.12 2014/11/17 06:37:23 riastradh Exp $
+.\	$NetBSD: arc4random.3,v 1.13 2014/11/17 07:11:00 riastradh Exp $
 .\
 .\ Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -259,3 +259,39 @@ But it's too late to change that now.
 .Fn arc4random_uniform
 does not help to choose integers in [0, n) uniformly at random when n 
 2^32.
+.Pp
+The security model of
+.Nm
+is stronger than many applications need, and stronger than other
+operating systems provide.
+For example, applications encrypting messages with random, but not
+secret, initialization vectors need only prevent an adversary from
+guessing future outputs, since past outputs will have been published
+already.
+.Pp
+On the one hand,
+.Nm
+could be marginally faster if it were not necessary to prevent an
+adversary who sees the state from predicting past outputs.
+On the other hand, there are applications in the wild that use
+.Nm
+to generate key material, such as OpenSSH, so for the sake of
+.Nx
+users it would be imprudent to weaken the security model.
+On the third hand, relying on the security model of
+.Nm
+in
+.Nx
+may lead you to an unpleasant surprise on another operating system
+whose implementation of
+.Nm
+has a weaker security model.
+.Pp
+One may be tempted to create new APIs to accommodate different
+security models and performance constraints without unpleasant
+surprises on different operating systems.
+This should not be done lightly, though, because there are already too
+many different choices, and too many opportunities for programmers to
+reach for one and pick the wrong one, leading to money being stolen
+and people being killed if they err on the side of faster code with a
+weaker security model.



CVS commit: src/sbin/gpt

2014-11-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Nov 17 07:13:42 UTC 2014

Modified Files:
src/sbin/gpt: gpt.c

Log Message:
handle constness


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sbin/gpt/gpt.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/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.37 src/sbin/gpt/gpt.c:1.38
--- src/sbin/gpt/gpt.c:1.37	Mon Nov 17 07:11:18 2014
+++ src/sbin/gpt/gpt.c	Mon Nov 17 07:13:42 2014
@@ -35,7 +35,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: gpt.c,v 1.37 2014/11/17 07:11:18 mlelstv Exp $);
+__RCSID($NetBSD: gpt.c,v 1.38 2014/11/17 07:13:42 mlelstv Exp $);
 #endif
 
 #include sys/param.h
@@ -563,7 +563,8 @@ gpt_open(const char *dev)
 
 	mode = readonly ? O_RDONLY : O_RDWR|O_EXCL;
 
-	device_arg = device_name = dev;
+	device_arg = dev;
+	device_name = __UNCONST(device_arg);
 	fd = opendisk(dev, mode, device_path, sizeof(device_path), 0);
 	if (fd == -1)
 		return -1;



CVS commit: src/sbin/gpt

2014-11-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Nov 17 07:15:28 UTC 2014

Modified Files:
src/sbin/gpt: gpt.c gpt.h

Log Message:
handle constness better


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sbin/gpt/gpt.c
cvs rdiff -u -r1.16 -r1.17 src/sbin/gpt/gpt.h

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

Modified files:

Index: src/sbin/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.38 src/sbin/gpt/gpt.c:1.39
--- src/sbin/gpt/gpt.c:1.38	Mon Nov 17 07:13:42 2014
+++ src/sbin/gpt/gpt.c	Mon Nov 17 07:15:28 2014
@@ -35,7 +35,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: gpt.c,v 1.38 2014/11/17 07:13:42 mlelstv Exp $);
+__RCSID($NetBSD: gpt.c,v 1.39 2014/11/17 07:15:28 mlelstv Exp $);
 #endif
 
 #include sys/param.h
@@ -65,7 +65,7 @@ __RCSID($NetBSD: gpt.c,v 1.38 2014/11/1
 
 char	device_path[MAXPATHLEN];
 const char *device_arg;
-char	*device_name;
+const char *device_name;
 
 off_t	mediasz;
 
@@ -563,8 +563,7 @@ gpt_open(const char *dev)
 
 	mode = readonly ? O_RDONLY : O_RDWR|O_EXCL;
 
-	device_arg = dev;
-	device_name = __UNCONST(device_arg);
+	device_arg = device_name = dev;
 	fd = opendisk(dev, mode, device_path, sizeof(device_path), 0);
 	if (fd == -1)
 		return -1;

Index: src/sbin/gpt/gpt.h
diff -u src/sbin/gpt/gpt.h:1.16 src/sbin/gpt/gpt.h:1.17
--- src/sbin/gpt/gpt.h:1.16	Tue Sep 30 17:59:59 2014
+++ src/sbin/gpt/gpt.h	Mon Nov 17 07:15:28 2014
@@ -61,7 +61,7 @@ struct mbr {
 };
 
 extern const char *device_arg;
-extern char *device_name;
+extern const char *device_name;
 extern off_t mediasz;
 extern u_int parts;
 extern u_int secsz;



CVS commit: src/sbin/gpt

2014-11-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Nov 17 07:11:18 UTC 2014

Modified Files:
src/sbin/gpt: gpt.c

Log Message:
Report the argument instead of (null) when opendisk fails.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sbin/gpt/gpt.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/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.36 src/sbin/gpt/gpt.c:1.37
--- src/sbin/gpt/gpt.c:1.36	Sat Oct  4 01:00:42 2014
+++ src/sbin/gpt/gpt.c	Mon Nov 17 07:11:18 2014
@@ -35,7 +35,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: gpt.c,v 1.36 2014/10/04 01:00:42 christos Exp $);
+__RCSID($NetBSD: gpt.c,v 1.37 2014/11/17 07:11:18 mlelstv Exp $);
 #endif
 
 #include sys/param.h
@@ -563,7 +563,7 @@ gpt_open(const char *dev)
 
 	mode = readonly ? O_RDONLY : O_RDWR|O_EXCL;
 
-	device_arg = dev;
+	device_arg = device_name = dev;
 	fd = opendisk(dev, mode, device_path, sizeof(device_path), 0);
 	if (fd == -1)
 		return -1;