CVS commit: src/usr.bin/indent

2014-09-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Sep  4 04:06:07 UTC 2014

Modified Files:
src/usr.bin/indent: args.c indent.1 indent.c indent_globs.h io.c

Log Message:
port the -ut / -nut options from freebsd.  -ut (default) enables tabs
in output, the -nut uses spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/indent/args.c
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/indent/indent.1
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/indent/indent_globs.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/indent/io.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/indent/args.c
diff -u src/usr.bin/indent/args.c:1.10 src/usr.bin/indent/args.c:1.11
--- src/usr.bin/indent/args.c:1.10	Sun Apr 12 11:09:49 2009
+++ src/usr.bin/indent/args.c	Thu Sep  4 04:06:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: args.c,v 1.10 2009/04/12 11:09:49 lukem Exp $	*/
+/*	$NetBSD: args.c,v 1.11 2014/09/04 04:06:07 mrg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -68,7 +68,7 @@
 #if 0
 static char sccsid[] = "@(#)args.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: args.c,v 1.10 2009/04/12 11:09:49 lukem Exp $");
+__RCSID("$NetBSD: args.c,v 1.11 2014/09/04 04:06:07 mrg Exp $");
 #endif
 #endif/* not lint */
 
@@ -274,6 +274,9 @@ struct pro {
 		"nsc", PRO_BOOL, true, OFF, &star_comment_cont
 	},
 	{
+		"nut", PRO_BOOL, true, OFF, &use_tabs
+	},
+	{
 		"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines
 	},
 	{
@@ -301,6 +304,9 @@ struct pro {
 		"troff", PRO_BOOL, false, ON, &troff
 	},
 	{
+		"ut", PRO_BOOL, true, ON, &use_tabs
+	},
+	{
 		"v", PRO_BOOL, false, ON, &verbose
 	},
 	/* whew! */

Index: src/usr.bin/indent/indent.1
diff -u src/usr.bin/indent/indent.1:1.22 src/usr.bin/indent/indent.1:1.23
--- src/usr.bin/indent/indent.1:1.22	Sat Oct 13 14:18:17 2012
+++ src/usr.bin/indent/indent.1	Thu Sep  4 04:06:07 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: indent.1,v 1.22 2012/10/13 14:18:17 njoly Exp $
+.\"	$NetBSD: indent.1,v 1.23 2014/09/04 04:06:07 mrg Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -61,7 +61,7 @@
 .\"
 .\"	from: @(#)indent.1	8.1 (Berkeley) 7/1/93
 .\"
-.Dd July 1, 1993
+.Dd September 2, 2014
 .Dt INDENT 1
 .Os
 .Sh NAME
@@ -98,6 +98,7 @@
 .Op Fl sob | Fl nsob
 .Op Fl \&st
 .Op Fl troff
+.Op Fl ut | Fl nut
 .Op Fl v | Fl \&nv
 .Sh DESCRIPTION
 .Nm
@@ -135,6 +136,11 @@ is specified,
 checks to make sure it is different from
 .Ar input-file  .
 .Pp
+If no
+.Ar input-file
+is specified
+input is read from stdin and the formatted file is written to stdout. 
+.Pp
 The options listed below control the formatting style imposed by
 .Nm  .
 .Bl -tag -width Op
@@ -417,6 +423,11 @@ listing in much the same spirit as
 .Xr vgrind 1 .
 If the output file is not specified, the default is standard output,
 rather than formatting in place.
+.It Fl ut , nut
+Enables (disables) the use of tab characters in the output.
+Tabs are assumed to be aligned on columns divisible by 8.
+The default is
+.Fl ut .
 .It Fl v , \&nv
 .Fl v
 turns on `verbose' mode;

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.18 src/usr.bin/indent/indent.c:1.19
--- src/usr.bin/indent/indent.c:1.18	Sun Apr 12 11:09:49 2009
+++ src/usr.bin/indent/indent.c	Thu Sep  4 04:06:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.18 2009/04/12 11:09:49 lukem Exp $	*/
+/*	$NetBSD: indent.c,v 1.19 2014/09/04 04:06:07 mrg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -75,7 +75,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985 Sun
 #if 0
 static char sccsid[] = "@(#)indent.c	5.17 (Berkeley) 6/7/93";
 #else
-__RCSID("$NetBSD: indent.c,v 1.18 2009/04/12 11:09:49 lukem Exp $");
+__RCSID("$NetBSD: indent.c,v 1.19 2014/09/04 04:06:07 mrg Exp $");
 #endif
 #endif/* not lint */
 
@@ -123,6 +123,7 @@ main(int argc, char **argv)
  * without the matching : in a ?:
  * construct */
 	const char *t_ptr;	/* used for copying tokens */
+	int	tabs_to_var = 0; /* true if using tabs to indent to var name */
 	int type_code;	/* the type of token, returned by lexi */
 
 	int last_else = 0;	/* true iff last keyword was an else */
@@ -998,6 +999,7 @@ check_type:
 		 * : i);
 		 */
 			dec_ind = ps.decl_indent > 0 ? ps.decl_indent : i;
+			tabs_to_var = (use_tabs ? ps.decl_indent > 0 : 0);
 			goto copy_id;
 
 		case ident:	/* got an identifier or constant */
@@ -1012,11 +1014,44 @@ check_type:
 			sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7);
 			ps.dumped_decl_indent = 1;
 			e_code += strlen(e_code);
-		} else
-			while ((e_code - s_code) < dec_ind) {
+			CHECK_SIZE_CODE;
+		} else {
+			int cur_dec_ind;
+			int pos, startpos;
+
+			/*
+			 * in order to get the tab math right for
+			 * indentations that are not multiples of 8 we
+			

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

2014-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep  4 02:39:41 UTC 2014

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

Log Message:
add (commented out) awinac driver


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/arch/evbarm/conf/CUBIEBOARD:1.18
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.17	Sun Aug 31 19:13:01 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Thu Sep  4 02:39:41 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.17 2014/08/31 19:13:01 matt Exp $
+#	$NetBSD: CUBIEBOARD,v 1.18 2014/09/04 02:39:41 jmcneill Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -230,6 +230,10 @@ awinwdt*	at awinio?
 # onboard DMA
 #awindma0	at obio0 addr 0x48056000 size 0x1000
 
+# onboard audio codec
+#awinac0	at awinio0
+#audio0 	at awinac0
+
 # onboard video
 #awinfb* 	at obio0 addr 0x4805 size 0x1
 #wsdisplay*	at wsemuldisplaydev? console ?



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

2014-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep  4 02:38:18 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_io.c files.awin
Added Files:
src/sys/arch/arm/allwinner: awin_ac.c

Log Message:
Driver for "Audio Codec" block of A10/A13/A20, not tested.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/allwinner/awin_ac.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/allwinner/awin_io.c \
src/sys/arch/arm/allwinner/files.awin

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_io.c
diff -u src/sys/arch/arm/allwinner/awin_io.c:1.8 src/sys/arch/arm/allwinner/awin_io.c:1.9
--- src/sys/arch/arm/allwinner/awin_io.c:1.8	Wed Feb 26 00:19:01 2014
+++ src/sys/arch/arm/allwinner/awin_io.c	Thu Sep  4 02:38:18 2014
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.8 2014/02/26 00:19:01 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.9 2014/09/04 02:38:18 jmcneill Exp $");
 
 #include 
 #include 
@@ -123,6 +123,7 @@ static const struct awin_locators awin_l
 	{ "awe", OFFANDSIZE(EMAC), NOPORT, AWIN_IRQ_EMAC, AANY },
 	{ "awge", AWIN_GMAC_OFFSET, AWIN_GMAC_SIZE, NOPORT, AWIN_IRQ_GMAC, A20 },
 	{ "awincrypto", OFFANDSIZE(SS), NOPORT, AWIN_IRQ_SS, AANY },
+	{ "awinac", OFFANDSIZE(AC), NOPORT, AWIN_IRQ_AC, AANY },
 };
 
 static int
Index: src/sys/arch/arm/allwinner/files.awin
diff -u src/sys/arch/arm/allwinner/files.awin:1.8 src/sys/arch/arm/allwinner/files.awin:1.9
--- src/sys/arch/arm/allwinner/files.awin:1.8	Tue Feb 25 02:51:52 2014
+++ src/sys/arch/arm/allwinner/files.awin	Thu Sep  4 02:38:18 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.awin,v 1.8 2014/02/25 02:51:52 matt Exp $
+#	$NetBSD: files.awin,v 1.9 2014/09/04 02:38:18 jmcneill Exp $
 #
 # Configuration info for Allwinner ARM Peripherals
 #
@@ -101,3 +101,8 @@ file	arch/arm/allwinner/awin_wdc.c		awin
 # A20 AHCI Controller (SATA)
 attach	ahcisata at awinio with awin_ahcisata
 file	arch/arm/allwinner/awin_ahcisata.c	awin_ahcisata
+
+# A10/A20 Audio Codec (AC)
+device	awinac: audiobus, auconv, mulaw, aurateconv
+attach	awinac at awinio with awin_ac
+file	arch/arm/allwinner/awin_ac.c		awin_ac

Added files:

Index: src/sys/arch/arm/allwinner/awin_ac.c
diff -u /dev/null src/sys/arch/arm/allwinner/awin_ac.c:1.1
--- /dev/null	Thu Sep  4 02:38:18 2014
+++ src/sys/arch/arm/allwinner/awin_ac.c	Thu Sep  4 02:38:18 2014
@@ -0,0 +1,690 @@
+/* $NetBSD: awin_ac.c,v 1.1 2014/09/04 02:38:18 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2014 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "locators.h"
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.1 2014/09/04 02:38:18 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define AWINAC_TX_TRIG_LEVEL	64
+#define AWINAC_TX_MAX_LEVEL	128
+#define AWINAC_INIT_VOL		0x3b
+
+#define AC_DAC_DPC		0x00
+#define  DAC_DPC_EN_DA		__BIT(31)
+#define  DAC_DPC_MODQU		__BITS(28,25)
+#define  DAC_DPC_DWA		__BIT(24)
+#define  DAC_DPC_HPF_EN		__BIT(18)
+#define  DAC_DPC_DVOL		__BITS(17,12)
+#define AC_DAC_FIFOC		0x04
+#define  DAC_FIFOC_FS		__BITS(31,29)
+#define   DAC_FS_48KHZ		0
+#define   DAC_FS_32KHZ		1
+#define   DAC_FS_24KHZ		2
+#define   DAC_FS_16KHZ		3
+#define   DAC_FS_12KHZ		4
+#define   DAC_FS_8KHZ		5
+#define   DAC_FS_192KHZ		6
+#define   DAC_FS_96KHZ		7
+#define  DAC_FIFOC_FIR_VER	__BIT(28)
+#define  DAC_FIFOC_SEND_LASAT	__BIT(26)
+#define  DAC_FIFOC_FIFO_MODE	__BITS(25,24)
+#define   FIFO_MODE_24_31_8	0
+#define   FIFO_MODE_16_31_16	0
+#define   FIFO_MODE_16_15_0	1
+#define  D

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

2014-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep  4 02:36:08 UTC 2014

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

Log Message:
pll2 enable support


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/allwinner/awin_board.c
cvs rdiff -u -r1.10 -r1.11 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_board.c
diff -u src/sys/arch/arm/allwinner/awin_board.c:1.15 src/sys/arch/arm/allwinner/awin_board.c:1.16
--- src/sys/arch/arm/allwinner/awin_board.c:1.15	Sun Aug 24 12:42:03 2014
+++ src/sys/arch/arm/allwinner/awin_board.c	Thu Sep  4 02:36:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.15 2014/08/24 12:42:03 jmcneill Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.16 2014/09/04 02:36:08 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.15 2014/08/24 12:42:03 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.16 2014/09/04 02:36:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -275,3 +275,27 @@ awin_pll6_enable(void)
 	__SHIFTOUT(ncfg, AWIN_PLL_CFG_FACTOR_M));
 #endif
 }
+
+void
+awin_pll2_enable(void)
+{
+	bus_space_tag_t bst = &awin_bs_tag;
+	bus_space_handle_t bsh = awin_core_bsh;
+
+	/*
+  	 * AC (at 48kHz) needs PLL2 to be 24576000 Hz
+  	 */
+	const uint32_t ocfg = bus_space_read_4(bst, bsh,
+	AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG);
+
+	uint32_t ncfg = ocfg;
+	ncfg &= ~(AWIN_PLL2_CFG_PREVDIV|AWIN_PLL2_CFG_FACTOR_N|AWIN_PLL2_CFG_POSTDIV);
+	ncfg |= __SHIFTIN(21, AWIN_PLL2_CFG_PREVDIV);
+	ncfg |= __SHIFTIN(86, AWIN_PLL2_CFG_FACTOR_N);
+	ncfg |= __SHIFTIN(4, AWIN_PLL2_CFG_POSTDIV);
+	ncfg |= AWIN_PLL_CFG_ENABLE;
+	if (ncfg != ocfg) {
+		bus_space_write_4(bst, bsh,
+		AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG, ncfg);
+	}
+}

Index: src/sys/arch/arm/allwinner/awin_var.h
diff -u src/sys/arch/arm/allwinner/awin_var.h:1.10 src/sys/arch/arm/allwinner/awin_var.h:1.11
--- src/sys/arch/arm/allwinner/awin_var.h:1.10	Thu Jun  5 03:48:32 2014
+++ src/sys/arch/arm/allwinner/awin_var.h	Thu Sep  4 02:36:08 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.10 2014/06/05 03:48:32 matt Exp $ */
+/* $NetBSD: awin_var.h,v 1.11 2014/09/04 02:36:08 jmcneill Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -81,6 +81,7 @@ extern struct arm32_bus_dma_tag awin_coh
 psize_t awin_memprobe(void);
 void	awin_bootstrap(vaddr_t, vaddr_t); 
 void	awin_dma_bootstrap(psize_t);
+void	awin_pll2_enable(void);
 void	awin_pll6_enable(void);
 void	awin_cpu_hatch(struct cpu_info *);
 



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

2014-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep  4 02:35:26 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_reg.h

Log Message:
add some PLL2 and APB0_GATING bits


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/allwinner/awin_reg.h

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.16 src/sys/arch/arm/allwinner/awin_reg.h:1.17
--- src/sys/arch/arm/allwinner/awin_reg.h:1.16	Wed Sep  3 21:42:46 2014
+++ src/sys/arch/arm/allwinner/awin_reg.h	Thu Sep  4 02:35:26 2014
@@ -730,6 +730,12 @@
 #define AWIN_PLL1_SIG_DELT_PAT_IN	__BIT(3)
 #define AWIN_PLL1_SIG_DELT_PAT_EN	__BIT(2)
 
+#define AWIN_PLL2_CFG_PREVDIV		__BITS(4,0)
+#define AWIN_PLL2_CFG_FACTOR_N		__BITS(14,8)
+#define AWIN_PLL2_CFG_PLLBIAS		__BITS(20,16)
+#define AWIN_PLL2_CFG_VCOBIAS		__BITS(25,21)
+#define AWIN_PLL2_CFG_POSTDIV		__BITS(29,26)
+
 #define AWIN_PLL5_CFG_DDR_CLK_EN	__BIT(29)
 #define AWIN_PLL5_CFG_LDO_EN		__BIT(7)
 #define AWIN_PLL5_CFG_FACTOR_M1		__BITS(3,2)
@@ -817,6 +823,8 @@
 #define AWIN_APB_GATING1_TWI1		__BIT(1)
 #define AWIN_APB_GATING1_TWI0		__BIT(0)
 
+#define AWIN_APB0_GATING_ADDA		__BIT(0)
+
 #define AWIN_CLK_ENABLE			__BIT(31)
 #define AWIN_CLK_SRC_SEL		__BITS(25,24)
 #define AWIN_CLK_SRC_SEL_OSC24M		0



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

2014-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep  4 02:34:30 UTC 2014

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

Log Message:
audio gpio setup


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.1 src/sys/arch/evbarm/awin/awin_machdep.c:1.2
--- src/sys/arch/evbarm/awin/awin_machdep.c:1.1	Sun Aug 31 19:13:01 2014
+++ src/sys/arch/evbarm/awin/awin_machdep.c	Thu Sep  4 02:34:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_machdep.c,v 1.1 2014/08/31 19:13:01 matt Exp $ */
+/*	$NetBSD: awin_machdep.c,v 1.2 2014/09/04 02:34:30 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.1 2014/08/31 19:13:01 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.2 2014/09/04 02:34:30 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -622,6 +622,7 @@ awin_device_register(device_t self, void
 			prop_dictionary_set_cstring(dict, "emacpwren", ">PH19");
 		}
 		prop_dictionary_set_cstring(dict, "mmc0detect", "PH15");
 
 		/*
 		 * These pins have no connections.
@@ -660,6 +661,11 @@ awin_device_register(device_t self, void
 		return;
 	}
 
+	if (device_is_a(self, "awinac")) {
+		prop_dictionary_set_cstring(dict, "pactrl-gpio", "audiopactrl");
+		return;
+	}
+
 	if (device_is_a(self, "com")) {
 #if NAWIN_FB > 0
 		if (use_fb_console)



CVS commit: src/sys/dev/pci

2014-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep  4 02:34:32 UTC 2014

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

Log Message:
Remove one obsolete TODO entry.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 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.295 src/sys/dev/pci/if_wm.c:1.296
--- src/sys/dev/pci/if_wm.c:1.295	Wed Sep  3 14:30:04 2014
+++ src/sys/dev/pci/if_wm.c	Thu Sep  4 02:34:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.295 2014/09/03 14:30:04 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.296 2014/09/04 02:34:32 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -73,7 +73,6 @@
  * TODO (in order of importance):
  *
  *	- Check XXX'ed comments
- *	- Read SFP ROM and set media type correctly on 82575 and newer devices
  *	- EEE (Energy Efficiency Ethernet)
  *	- MSI/MSI-X
  *	- Virtual Function
@@ -82,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.295 2014/09/03 14:30:04 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.296 2014/09/04 02:34:32 msaitoh Exp $");
 
 #include 
 #include 



CVS commit: src/sys/miscfs/fdesc

2014-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  4 00:30:25 UTC 2014

Modified Files:
src/sys/miscfs/fdesc: fdesc_vfsops.c

Log Message:
Fix type of /dev/tty


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/miscfs/fdesc/fdesc_vfsops.c

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

Modified files:

Index: src/sys/miscfs/fdesc/fdesc_vfsops.c
diff -u src/sys/miscfs/fdesc/fdesc_vfsops.c:1.89 src/sys/miscfs/fdesc/fdesc_vfsops.c:1.90
--- src/sys/miscfs/fdesc/fdesc_vfsops.c:1.89	Sun Jul 13 07:23:01 2014
+++ src/sys/miscfs/fdesc/fdesc_vfsops.c	Wed Sep  3 20:30:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdesc_vfsops.c,v 1.89 2014/07/13 11:23:01 hannken Exp $	*/
+/*	$NetBSD: fdesc_vfsops.c,v 1.90 2014/09/04 00:30:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1995
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.89 2014/07/13 11:23:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.90 2014/09/04 00:30:25 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -202,7 +202,7 @@ fdesc_loadvnode(struct mount *mp, struct
 		break;
 	case FD_CTTY:
 		fd->fd_type = Fctty;
-		vp->v_type = VNON;
+		vp->v_type = VCHR;
 		break;
 	case FD_STDIN:
 		fd->fd_type = Flink;



CVS commit: src/lib/libperfuse

2014-09-03 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Sep  3 23:59:58 UTC 2014

Modified Files:
src/lib/libperfuse: ops.c perfuse_priv.h

Log Message:
Fix build failure on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.34 -r1.35 src/lib/libperfuse/perfuse_priv.h

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.71 src/lib/libperfuse/ops.c:1.72
--- src/lib/libperfuse/ops.c:1.71	Wed Sep  3 16:01:45 2014
+++ src/lib/libperfuse/ops.c	Wed Sep  3 23:59:58 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.71 2014/09/03 16:01:45 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.72 2014/09/03 23:59:58 enami Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2888,7 +2888,7 @@ perfuse_node_print(struct puffs_usermoun
 
 int
 perfuse_node_pathconf(struct puffs_usermount *pu, puffs_cookie_t opc,
-	int name, int *retval)
+	int name, register_t *retval)
 {
 	perfuse_msg_t *pm;
 	struct perfuse_state *ps;

Index: src/lib/libperfuse/perfuse_priv.h
diff -u src/lib/libperfuse/perfuse_priv.h:1.34 src/lib/libperfuse/perfuse_priv.h:1.35
--- src/lib/libperfuse/perfuse_priv.h:1.34	Sat Aug 16 16:31:15 2014
+++ src/lib/libperfuse/perfuse_priv.h	Wed Sep  3 23:59:58 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_priv.h,v 1.34 2014/08/16 16:31:15 manu Exp $ */
+/*  $NetBSD: perfuse_priv.h,v 1.35 2014/09/03 23:59:58 enami Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -249,7 +249,7 @@ int perfuse_node_reclaim(struct puffs_us
 int perfuse_node_inactive(struct puffs_usermount *, puffs_cookie_t);
 int perfuse_node_print(struct puffs_usermount *, puffs_cookie_t);
 int perfuse_node_pathconf(struct puffs_usermount *,
-puffs_cookie_t, int, int *);
+puffs_cookie_t, int, register_t *);
 int perfuse_node_advlock(struct puffs_usermount *,
 puffs_cookie_t, void *, int, struct flock *, int);
 int perfuse_node_read(struct puffs_usermount *, puffs_cookie_t,



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

2014-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Sep  3 21:42:46 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_intr.h awin_reg.h

Log Message:
AWIN_CORE_PBASE+22c00h and irq 62 are for audio codec; rename defines to match 
(AC)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/allwinner/awin_intr.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/allwinner/awin_reg.h

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_intr.h
diff -u src/sys/arch/arm/allwinner/awin_intr.h:1.3 src/sys/arch/arm/allwinner/awin_intr.h:1.4
--- src/sys/arch/arm/allwinner/awin_intr.h:1.3	Sat Sep  7 00:35:52 2013
+++ src/sys/arch/arm/allwinner/awin_intr.h	Wed Sep  3 21:42:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_intr.h,v 1.3 2013/09/07 00:35:52 matt Exp $ */
+/* $NetBSD: awin_intr.h,v 1.4 2014/09/03 21:42:46 jmcneill Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -72,7 +72,7 @@
 #define AWIN_IRQ_DMA		59
 #define AWIN_IRQ_PIO		60
 #define AWIN_IRQ_TP		61
-#define AWIN_IRQ_ADDC		62
+#define AWIN_IRQ_AC		62
 #define AWIN_IRQ_LRADC		63
 #define AWIN_IRQ_SDMMC0		64
 #define AWIN_IRQ_SDMMC1		65

Index: src/sys/arch/arm/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.15 src/sys/arch/arm/allwinner/awin_reg.h:1.16
--- src/sys/arch/arm/allwinner/awin_reg.h:1.15	Sun Aug 24 21:42:06 2014
+++ src/sys/arch/arm/allwinner/awin_reg.h	Wed Sep  3 21:42:46 2014
@@ -96,7 +96,7 @@
 #define AWIN_IIS0_OFFSET		0x00022000
 #define AWIN_IIS1_OFFSET		0x00022400
 #define AWIN_LRADC_OFFSET		0x00022800
-#define AWIN_ADDA_OFFSET		0x00022C00
+#define AWIN_AC_OFFSET			0x00022C00
 #define AWIN_KEYPAD_OFFSET		0x00023000
 #define AWIN_TZPC_OFFSET		0x00023400	/* A10 */
 #define AWIN_SID_OFFSET			0x00023800



CVS commit: src/common/lib/libc/atomic

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:30:47 UTC 2014

Modified Files:
src/common/lib/libc/atomic: atomic_cas_by_cas32.c

Log Message:
Add __sync_val_compare_and_swap_{1,2} aliases for _atomic_cas_{8,16}


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/atomic/atomic_cas_by_cas32.c

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

Modified files:

Index: src/common/lib/libc/atomic/atomic_cas_by_cas32.c
diff -u src/common/lib/libc/atomic/atomic_cas_by_cas32.c:1.3 src/common/lib/libc/atomic/atomic_cas_by_cas32.c:1.4
--- src/common/lib/libc/atomic/atomic_cas_by_cas32.c:1.3	Sun Mar  9 16:19:14 2014
+++ src/common/lib/libc/atomic/atomic_cas_by_cas32.c	Wed Sep  3 19:30:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_cas_by_cas32.c,v 1.3 2014/03/09 16:19:14 riastradh Exp $	*/
+/*	$NetBSD: atomic_cas_by_cas32.c,v 1.4 2014/09/03 19:30:47 matt Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,6 +32,8 @@
 #include 
 #include 
 
+#include "atomic_op_namespace.h"
+
 uint32_t _atomic_cas_32(volatile uint32_t *addr, uint32_t old, uint32_t new);
 uint16_t _atomic_cas_16(volatile uint16_t *addr, uint16_t old, uint16_t new);
 uint8_t _atomic_cas_8(volatile uint8_t *addr, uint8_t old, uint8_t new);
@@ -62,6 +64,8 @@ _atomic_cas_16(volatile uint16_t *addr, 
 	return old;
 }
 
+crt_alias(__sync_val_compare_and_swap_2,_atomic_cas_16)
+
 uint8_t
 _atomic_cas_8(volatile uint8_t *addr, uint8_t old, uint8_t new)
 {
@@ -83,3 +87,5 @@ _atomic_cas_8(volatile uint8_t *addr, ui
 
 	return old;
 }
+
+crt_alias(__sync_val_compare_and_swap_1,_atomic_cas_8)



CVS commit: src/libexec/ld.elf_so

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:31:32 UTC 2014

Modified Files:
src/libexec/ld.elf_so: Makefile

Log Message:
OR1K support


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/libexec/ld.elf_so/Makefile

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

Modified files:

Index: src/libexec/ld.elf_so/Makefile
diff -u src/libexec/ld.elf_so/Makefile:1.127 src/libexec/ld.elf_so/Makefile:1.128
--- src/libexec/ld.elf_so/Makefile:1.127	Sun Aug 10 05:57:31 2014
+++ src/libexec/ld.elf_so/Makefile	Wed Sep  3 19:31:32 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.127 2014/08/10 05:57:31 matt Exp $
+#	$NetBSD: Makefile,v 1.128 2014/09/03 19:31:32 matt Exp $
 #
 # NOTE: when changing ld.so, ensure that ldd still compiles.
 #
@@ -34,6 +34,7 @@ M=		${.CURDIR}/arch/${ARCHSUBDIR}
  (${LDELFSO_MACHINE_ARCH} == "i386") ||\
  (${LDELFSO_MACHINE_ARCH} == "m68k") ||\
  (${MACHINE_CPU} == "mips") ||	\
+ (${MACHINE_CPU} == "or1k") ||	\
  (${MACHINE_CPU} == "powerpc") ||	\
  (${MACHINE_CPU} == "sh3") ||	\
  (${LDELFSO_MACHINE_ARCH} == "sparc") ||\



CVS commit: src

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:32:18 UTC 2014

Modified Files:
src: build.sh

Log Message:
Add or1k MACHINE/MACHINE_ARCH.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.295 src/build.sh:1.296
--- src/build.sh:1.295	Fri Aug 15 18:34:19 2014
+++ src/build.sh	Wed Sep  3 19:32:18 2014
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.295 2014/08/15 18:34:19 apb Exp $
+#	$NetBSD: build.sh,v 1.296 2014/09/03 19:32:18 matt Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -691,6 +691,7 @@ MACHINE=newsmips	MACHINE_ARCH=mipseb
 MACHINE=next68k		MACHINE_ARCH=m68k
 MACHINE=ofppc		MACHINE_ARCH=powerpc	DEFAULT
 MACHINE=ofppc		MACHINE_ARCH=powerpc64	ALIAS=ofppc64
+MACHINE=or1k		MACHINE_ARCH=or1k
 MACHINE=playstation2	MACHINE_ARCH=mipsel
 MACHINE=pmax		MACHINE_ARCH=mips64el	ALIAS=pmax64
 MACHINE=pmax		MACHINE_ARCH=mipsel	DEFAULT
@@ -1867,7 +1868,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src/doc

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:35:47 UTC 2014

Modified Files:
src/doc: CHANGES

Log Message:
Note or1k port


To generate a diff of this commit:
cvs rdiff -u -r1.1974 -r1.1975 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1974 src/doc/CHANGES:1.1975
--- src/doc/CHANGES:1.1974	Wed Sep  3 14:40:36 2014
+++ src/doc/CHANGES	Wed Sep  3 19:35:46 2014
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1974 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1975 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -38,3 +38,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 
 	wm(4): Add internal SERDES support for 82575 and newer controllers.
 		[msaitoh 20140903]
+	or1k: Add new port.  [matt 20140903]



CVS commit: src/lib/libc/stdlib

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:29:40 UTC 2014

Modified Files:
src/lib/libc/stdlib: jemalloc.c

Log Message:
OR1K support


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/stdlib/jemalloc.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/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.34 src/lib/libc/stdlib/jemalloc.c:1.35
--- src/lib/libc/stdlib/jemalloc.c:1.34	Sun Aug 10 05:57:31 2014
+++ src/lib/libc/stdlib/jemalloc.c	Wed Sep  3 19:29:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: jemalloc.c,v 1.34 2014/08/10 05:57:31 matt Exp $	*/
+/*	$NetBSD: jemalloc.c,v 1.35 2014/09/03 19:29:40 matt Exp $	*/
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans .
@@ -118,7 +118,7 @@
 
 #include 
 /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ 
-__RCSID("$NetBSD: jemalloc.c,v 1.34 2014/08/10 05:57:31 matt Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.35 2014/09/03 19:29:40 matt Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -275,6 +275,11 @@ __strerror_r(int e, char *s, size_t l)
 #  define SIZEOF_PTR_2POW	2
 #  define USE_BRK
 #endif
+#ifdef __or1k__
+#  define QUANTUM_2POW_MIN	4
+#  define SIZEOF_PTR_2POW	2
+#  define USE_BRK
+#endif
 #ifdef __vax__
 #  define QUANTUM_2POW_MIN	4
 #  define SIZEOF_PTR_2POW	2



CVS commit: src/lib/libc/compiler_rt

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:29:14 UTC 2014

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

Log Message:
Changes for OR1K


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/compiler_rt/Makefile.inc

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

Modified files:

Index: src/lib/libc/compiler_rt/Makefile.inc
diff -u src/lib/libc/compiler_rt/Makefile.inc:1.26 src/lib/libc/compiler_rt/Makefile.inc:1.27
--- src/lib/libc/compiler_rt/Makefile.inc:1.26	Sun Aug 17 16:14:59 2014
+++ src/lib/libc/compiler_rt/Makefile.inc	Wed Sep  3 19:29:14 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.26 2014/08/17 16:14:59 matt Exp $
+# $NetBSD: Makefile.inc,v 1.27 2014/09/03 19:29:14 matt Exp $
 
 COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -135,17 +135,24 @@ GENERIC_SRCS+= \
 .endif
 
 # These have h/w instructions which are always used.
-.if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc" \
-&& ${LIBC_MACHINE_CPU} != "aarch64"
+.if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "aarch64" \
+&& ${LIBC_MACHINE_CPU} != "powerpc" && ${LIBC_MACHINE_CPU} != "or1k"
 GENERIC_SRCS+= \
 	clzsi2.c
 .endif
 
 # These have h/w instructions which are always used.
+.if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_ARCH} != "vax" \
+&& ${LIBC_MACHINE_CPU} != "aarch64" && ${LIBC_MACHINE_CPU} != "powerpc" \
+&& ${LIBC_MACHINE_CPU} != "or1k"
+GENERIC_SRCS+= \
+	ctzsi2.c
+.endif
+
+# These have h/w instructions which are always used.
 .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc" \
 && ${LIBC_MACHINE_CPU} != "aarch64" && ${LIBC_MACHINE_ARCH} != "vax"
 GENERIC_SRCS+= \
-	ctzsi2.c \
 	divmodsi4.c \
 	divsi3.c \
 	modsi3.c \
@@ -174,7 +181,7 @@ GENERIC_SRCS+= \
 
 # These have h/w instructions which are always used.
 .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc64" \
-&& ${LIBC_MACHINE_ARCH} != "aarch64"
+&& ${LIBC_MACHINE_ARCH} != "aarch64" && ${LIBC_MACHINE_CPU} != "or1k"
 GENERIC_SRCS+= \
 	clzdi2.c \
 	ctzdi2.c \



CVS commit: src/include

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:28:20 UTC 2014

Modified Files:
src/include: fenv.h

Log Message:
or1k support 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/include/fenv.h

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

Modified files:

Index: src/include/fenv.h
diff -u src/include/fenv.h:1.10 src/include/fenv.h:1.11
--- src/include/fenv.h:1.10	Sun Aug 10 05:57:30 2014
+++ src/include/fenv.h	Wed Sep  3 19:28:20 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.10 2014/08/10 05:57:30 matt Exp $	*/
+/*	$NetBSD: fenv.h,v 1.11 2014/09/03 19:28:20 matt Exp $	*/
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #if !defined(__aarch64__) && !defined(__arm__) && !defined(__i386__) \
-&& !defined(__sparc__) && !defined(__x86_64__)
+&& !defined(__or1k__) && !defined(__sparc__) && !defined(__x86_64__)
 #error	"fenv.h is currently not supported for this architecture"
 #endif
 



CVS commit: src/sys/arch

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:27:53 UTC 2014

Modified Files:
src/sys/arch: Makefile

Log Message:
Fix SUBDIR commit


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/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/Makefile
diff -u src/sys/arch/Makefile:1.44 src/sys/arch/Makefile:1.45
--- src/sys/arch/Makefile:1.44	Sun Aug 10 05:57:31 2014
+++ src/sys/arch/Makefile	Wed Sep  3 19:27:53 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.44 2014/08/10 05:57:31 matt Exp $
+#	$NetBSD: Makefile,v 1.45 2014/09/03 19:27:53 matt Exp $
 
 # For now, we install the machine and arch includes, and symlink 'machine'
 # to the location of the machine includes (usually).
@@ -45,7 +45,7 @@ SUBDIR+= sun68k
 SUBDIR+= xen
 .endif
 
-#SUBDIR=acorn26 acorn32 algor alpha amiga amigappc arm arc atari \
+#SUBDIR=aarch64 acorn26 acorn32 algor alpha amiga amigappc arm arc atari \
 #	bebox \
 #	cats cesfic cobalt \
 #	dreamcast \
@@ -55,7 +55,7 @@ SUBDIR+= xen
 #	luna68k \
 #	m68k mac68k macppc mips mipsco mmeye mvme68k \
 #	netwinder news68k newsmips next68k \
-#	ofppc \
+#	ofppc or1k \
 #	playstation2 pmax powerpc prep \
 #	sandpoint sbmips sgimips sh3 shark sparc sparc64 sun2 sun3 sun68k \
 #	rs6000 \



CVS commit: src/tools/gcc

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:25:29 UTC 2014

Modified Files:
src/tools/gcc: Makefile

Log Message:
or1k does not support --with-float


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tools/gcc/Makefile

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

Modified files:

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.70 src/tools/gcc/Makefile:1.71
--- src/tools/gcc/Makefile:1.70	Sat Jun 14 20:49:37 2014
+++ src/tools/gcc/Makefile	Wed Sep  3 19:25:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.70 2014/06/14 20:49:37 mrg Exp $
+#	$NetBSD: Makefile,v 1.71 2014/09/03 19:25:29 matt Exp $
 
 .include 
 
@@ -27,7 +27,8 @@ MULTILIB_ARGS= --enable-multilib
 MULTILIB_ARGS= --disable-multilib
 .endif
 
-.if ${MKSOFTFLOAT} != "no" && ${MACHINE_CPU} != "m68k"
+.if ${MKSOFTFLOAT} != "no" && ${MACHINE_CPU} != "m68k" \
+&& ${MACHINE_CPU} != "or1k"
 SOFTFLOAT_ARGS=	-with-float=soft
 .endif
 



CVS commit: src/sys/sys

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:26:31 UTC 2014

Modified Files:
src/sys/sys: aout_mids.h

Log Message:
Add MIDs for OR1K and RISCV


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/aout_mids.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/sys/aout_mids.h
diff -u src/sys/sys/aout_mids.h:1.3 src/sys/sys/aout_mids.h:1.4
--- src/sys/sys/aout_mids.h:1.3	Sun Aug 10 05:57:31 2014
+++ src/sys/sys/aout_mids.h	Wed Sep  3 19:26:31 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: aout_mids.h,v 1.3 2014/08/10 05:57:31 matt Exp $ */
+/* $NetBSD: aout_mids.h,v 1.4 2014/09/03 19:26:31 matt Exp $ */
 
 /*
  * Copyright (c) 2009, The NetBSD Foundation, Inc.
@@ -61,7 +61,9 @@
 #define	MID_X86_64	157	/* AMD x86-64 */
 #define	MID_SH5_32	158	/* ILP32 SH5 */
 #define	MID_IA64	159	/* Itanium */
-#define MID_AARCH64	183	/* ARM AARCH64 */
+#define	MID_AARCH64	183	/* ARM AARCH64 */
+#define	MID_OR1K	184	/* OpenRISC 1000 */
+#define	MID_RISCV	185	/* Risc-V */
 #define	MID_HP200	200	/* hp200 (68010) BSD binary */
 #define	MID_HP300	300	/* hp300 (68020+68881) BSD binary */
 #define	MID_HPUX	0x20C	/* hp200/300 HP-UX binary */



CVS commit: src/sys/lib/libunwind

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:27:22 UTC 2014

Modified Files:
src/sys/lib/libunwind: Registers.hpp unwind_registers.S

Log Message:
Add OR1K support


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/lib/libunwind/Registers.hpp
cvs rdiff -u -r1.15 -r1.16 src/sys/lib/libunwind/unwind_registers.S

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

Modified files:

Index: src/sys/lib/libunwind/Registers.hpp
diff -u src/sys/lib/libunwind/Registers.hpp:1.17 src/sys/lib/libunwind/Registers.hpp:1.18
--- src/sys/lib/libunwind/Registers.hpp:1.17	Sun Aug 10 05:57:31 2014
+++ src/sys/lib/libunwind/Registers.hpp	Wed Sep  3 19:27:21 2014
@@ -1024,6 +1024,73 @@ private:
   uint64_t fpreg[32];
 };
 
+enum {
+  DWARF_OR1K_R0 = 0,
+  DWARF_OR1K_SP = 1,
+  DWARF_OR1K_LR = 9,
+  DWARF_OR1K_R31 = 31,
+  DWARF_OR1K_FPCSR = 32,
+
+  REGNO_OR1K_R0 = 0,
+  REGNO_OR1K_SP = 1,
+  REGNO_OR1K_LR = 9,
+  REGNO_OR1K_R31 = 31,
+  REGNO_OR1K_FPCSR = 32,
+};
+
+class Registers_or1k {
+public:
+  enum {
+LAST_REGISTER = REGNO_OR1K_FPCSR,
+LAST_RESTORE_REG = REGNO_OR1K_FPCSR,
+RETURN_OFFSET = 0,
+  };
+
+  __dso_hidden Registers_or1k();
+
+  static int dwarf2regno(int num) {
+if (num >= DWARF_OR1K_R0 && num <= DWARF_OR1K_R31)
+  return REGNO_OR1K_R0 + (num - DWARF_OR1K_R0);
+if (num == DWARF_OR1K_FPCSR)
+  return REGNO_OR1K_FPCSR;
+return LAST_REGISTER + 1;
+  }
+
+  bool validRegister(int num) const {
+return num >= 0 && num <= LAST_RESTORE_REG;
+  }
+
+  uint64_t getRegister(int num) const {
+assert(validRegister(num));
+return reg[num];
+  }
+
+  void setRegister(int num, uint64_t value) {
+assert(validRegister(num));
+reg[num] = value;
+  }
+
+  uint64_t getIP() const { return reg[REGNO_OR1K_LR]; }
+
+  void setIP(uint64_t value) { reg[REGNO_OR1K_LR] = value; }
+
+  uint64_t getSP() const { return reg[REGNO_OR1K_SP]; }
+
+  void setSP(uint64_t value) { reg[REGNO_OR1K_SP] = value; }
+
+  bool validFloatVectorRegister(int num) const {
+return false;
+  }
+
+  void copyFloatVectorRegister(int num, uint64_t addr_) {
+  }
+
+  __dso_hidden void jumpto() const __dead;
+
+private:
+  uint32_t reg[REGNO_OR1K_FPCSR + 1];
+};
+
 #if __i386__
 typedef Registers_x86 NativeUnwindRegisters;
 #elif __x86_64__
@@ -1052,6 +1119,8 @@ typedef Registers_SPARC NativeUnwindRegi
 typedef Registers_Alpha NativeUnwindRegisters;
 #elif __hppa__
 typedef Registers_HPPA NativeUnwindRegisters;
+#elif __or1k__
+typedef Registers_or1k NativeUnwindRegisters;
 #endif
 } // namespace _Unwind
 

Index: src/sys/lib/libunwind/unwind_registers.S
diff -u src/sys/lib/libunwind/unwind_registers.S:1.15 src/sys/lib/libunwind/unwind_registers.S:1.16
--- src/sys/lib/libunwind/unwind_registers.S:1.15	Sun Aug 10 05:57:31 2014
+++ src/sys/lib/libunwind/unwind_registers.S	Wed Sep  3 19:27:21 2014
@@ -1253,3 +1253,84 @@ LEAF_ENTRY_NOPROFILE(_ZNK7_Unwind14Regis
 	bv,n %r0(%r2)
 EXIT(_ZNK7_Unwind14Registers_HPPA6jumptoEv)
 #endif
+
+#ifdef __or1k__
+ENTRY_NP(_ZN7_Unwind14Registers_or1kC1Ev)
+	l.sw	(0*3)(r3), r0
+	l.sw	(1*3)(r3), r1
+	l.sw	(2*3)(r3), r2
+	l.sw	(3*3)(r3), r3
+	l.sw	(4*3)(r3), r4
+	l.sw	(5*3)(r3), r5
+	l.sw	(6*3)(r3), r6
+	l.sw	(7*3)(r3), r7
+	l.sw	(8*3)(r3), r8
+	l.sw	(9*3)(r3), r9
+	l.sw	(10*3)(r3), r10
+	l.sw	(11*3)(r3), r11
+	l.sw	(12*3)(r3), r12
+	l.sw	(13*3)(r3), r13
+	l.sw	(14*3)(r3), r14
+	l.sw	(15*3)(r3), r15
+	l.sw	(16*3)(r3), r16
+	l.sw	(17*3)(r3), r17
+	l.sw	(18*3)(r3), r18
+	l.sw	(19*3)(r3), r19
+	l.sw	(20*3)(r3), r20
+	l.sw	(21*3)(r3), r21
+	l.sw	(22*3)(r3), r22
+	l.sw	(23*3)(r3), r23
+	l.sw	(24*3)(r3), r24
+	l.sw	(25*3)(r3), r25
+	l.sw	(26*3)(r3), r26
+	l.sw	(27*3)(r3), r27
+	l.sw	(28*3)(r3), r28
+	l.sw	(29*3)(r3), r29
+	l.sw	(30*3)(r3), r30
+	l.sw	(31*3)(r3), r31
+	l.mfspr	r4, r0, 20
+	l.sw	(32*4)(r3), r4
+	l.jr	lr
+	l.nop
+END(_ZN7_Unwind14Registers_or1kC1Ev)
+
+ENTRY_NP(_ZNK7_Unwind14Registers_or1k6jumptoEv)
+	l.lwz	r6, (32*4)(r3)
+	l.mtspr	r0, r6, 20
+	l.lwz	r0, (0*4)(r3)
+	l.lwz	r1, (1*4)(r3)
+	l.lwz	r2, (2*4)(r3)
+	l.lwz	r4, (4*4)(r3)
+	l.lwz	r5, (5*4)(r3)
+	l.lwz	r6, (6*4)(r3)
+	l.lwz	r7, (7*4)(r3)
+	l.lwz	r8, (8*4)(r3)
+	l.lwz	r9, (9*4)(r3)
+	l.lwz	r10, (10*4)(r3)
+	l.lwz	r11, (11*4)(r3)
+	l.lwz	r12, (12*4)(r3)
+	l.lwz	r13, (13*4)(r3)
+	l.lwz	r14, (14*4)(r3)
+	l.lwz	r15, (15*4)(r3)
+	l.lwz	r16, (16*4)(r3)
+	l.lwz	r17, (17*4)(r3)
+	l.lwz	r18, (18*4)(r3)
+	l.lwz	r19, (19*4)(r3)
+	l.lwz	r20, (20*4)(r3)
+	l.lwz	r21, (21*4)(r3)
+	l.lwz	r22, (22*4)(r3)
+	l.lwz	r23, (23*4)(r3)
+	l.lwz	r24, (24*4)(r3)
+	l.lwz	r25, (25*4)(r3)
+	l.lwz	r26, (26*4)(r3)
+	l.lwz	r27, (27*4)(r3)
+	l.lwz	r28, (28*4)(r3)
+	l.lwz	r29, (29*4)(r3)
+	l.lwz	r30, (30*4)(r3)
+	l.lwz	r31, (31*4)(r3)
+
+	l.lwz	r3, (3*4)(r3)		/* return r3 */
+	l.jr	lr
+END(_ZNK7_Unwind14Registers_or1k6jumptoEv)
+
+#endif



CVS commit: src/tests/lib/libc/sys

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:24:12 UTC 2014

Modified Files:
src/tests/lib/libc/sys: t_getrusage.c

Log Message:
The nop instruction on or1k is l.nop


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_getrusage.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_getrusage.c
diff -u src/tests/lib/libc/sys/t_getrusage.c:1.2 src/tests/lib/libc/sys/t_getrusage.c:1.3
--- src/tests/lib/libc/sys/t_getrusage.c:1.2	Mon Aug 22 00:33:16 2011
+++ src/tests/lib/libc/sys/t_getrusage.c	Wed Sep  3 19:24:12 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_getrusage.c,v 1.2 2011/08/22 00:33:16 dholland Exp $ */
+/* $NetBSD: t_getrusage.c,v 1.3 2014/09/03 19:24:12 matt Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_getrusage.c,v 1.2 2011/08/22 00:33:16 dholland Exp $");
+__RCSID("$NetBSD: t_getrusage.c,v 1.3 2014/09/03 19:24:12 matt Exp $");
 
 #include 
 #include 
@@ -58,7 +58,11 @@ work(void)
 	size_t n = UINT16_MAX * 10;
 
 	while (n > 0) {
+#ifdef __or1k__
+		 asm volatile("l.nop");	/* Do something. */
+#else
 		 asm volatile("nop");	/* Do something. */
+#endif
 		 n--;
 	}
 }



CVS commit: src/tools

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:24:52 UTC 2014

Modified Files:
src/tools: headerlist

Log Message:
Add or1k


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tools/headerlist

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

Modified files:

Index: src/tools/headerlist
diff -u src/tools/headerlist:1.11 src/tools/headerlist:1.12
--- src/tools/headerlist:1.11	Sun Aug 10 05:57:31 2014
+++ src/tools/headerlist	Wed Sep  3 19:24:52 2014
@@ -1,4 +1,4 @@
-# $NetBSD: headerlist,v 1.11 2014/08/10 05:57:31 matt Exp $
+# $NetBSD: headerlist,v 1.12 2014/09/03 19:24:52 matt Exp $
 #
 # do not edit; this file was automatically generated by:
 #	NetBSD: mkheaderlist.sh,v 1.1 2007/08/07 12:38:23 yamt Exp 
@@ -107,6 +107,8 @@
 ./next68k/include/elf_machdep.h
 ./ofppc/include/disklabel.h
 ./ofppc/include/elf_machdep.h
+./or1k/include/disklabel.h
+./or1k/include/elf_machdep.h
 ./playstation2/include/disklabel.h
 ./playstation2/include/elf_machdep.h
 ./pmax/include/disklabel.h



CVS commit: src/share/mk

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:22:53 UTC 2014

Modified Files:
src/share/mk: bsd.endian.mk bsd.own.mk bsd.sys.mk

Log Message:
Change to support OR1K


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/mk/bsd.endian.mk
cvs rdiff -u -r1.833 -r1.834 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.244 -r1.245 src/share/mk/bsd.sys.mk

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

Modified files:

Index: src/share/mk/bsd.endian.mk
diff -u src/share/mk/bsd.endian.mk:1.20 src/share/mk/bsd.endian.mk:1.21
--- src/share/mk/bsd.endian.mk:1.20	Sun Aug 10 05:57:31 2014
+++ src/share/mk/bsd.endian.mk	Wed Sep  3 19:22:53 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.endian.mk,v 1.20 2014/08/10 05:57:31 matt Exp $
+#	$NetBSD: bsd.endian.mk,v 1.21 2014/09/03 19:22:53 matt Exp $
 
 .if !defined(_BSD_ENDIAN_MK_)
 _BSD_ENDIAN_MK_=1
@@ -19,6 +19,7 @@ TARGET_ENDIANNESS=	1234
   ${MACHINE_ARCH} == "hppa" || \
   ${MACHINE_ARCH} == "m68000" || \
   ${MACHINE_ARCH} == "m68k" || \
+  ${MACHINE_ARCH} == "or1k" || \
   ${MACHINE_ARCH} == "powerpc" || \
   ${MACHINE_ARCH} == "powerpc64" || \
   ${MACHINE_ARCH} == "sparc" || \

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.833 src/share/mk/bsd.own.mk:1.834
--- src/share/mk/bsd.own.mk:1.833	Sat Aug 23 02:26:36 2014
+++ src/share/mk/bsd.own.mk	Wed Sep  3 19:22:53 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.833 2014/08/23 02:26:36 matt Exp $
+#	$NetBSD: bsd.own.mk,v 1.834 2014/09/03 19:22:53 matt Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -14,7 +14,7 @@ MAKECONF?=	/etc/mk.conf
 #
 # CPU model, derived from MACHINE_ARCH
 #
-MACHINE_CPU=	${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/}
+MACHINE_CPU=	${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/}
 
 #
 # Subdirectory used below ${RELEASEDIR} when building a release
@@ -711,6 +711,13 @@ MKGCC:= no
 
 # No GDB support for aarch64
 MKGDB.aarch64=	no
+MKGDB.or1k=	no
+
+# No kernel modules for or1k (yet)
+MKKMOD.or1k=	no
+
+# No profiling for or1k (yet)
+MKPROFILE.or1k=	no
 
 #
 # The m68000 port is incomplete.
@@ -901,10 +908,11 @@ MKCOMPATMODULES:=	no
 # arm is always softfloat unless it isn't
 # emips is always softfloat.
 # coldfire is always softfloat
+# or1k is always softfloat
 #
 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" || \
 (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \
-${MACHINE_ARCH} == "coldfire" || \
+${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \
 ${MACHINE} == "emips"
 MKSOFTFLOAT?=	yes
 .endif

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.244 src/share/mk/bsd.sys.mk:1.245
--- src/share/mk/bsd.sys.mk:1.244	Thu Aug 14 18:39:38 2014
+++ src/share/mk/bsd.sys.mk	Wed Sep  3 19:22:53 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.244 2014/08/14 18:39:38 joerg Exp $
+#	$NetBSD: bsd.sys.mk,v 1.245 2014/09/03 19:22:53 matt Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -116,7 +116,8 @@ COPTS+=	-fstack-protector -Wstack-protec
 .if "${ACTIVE_CC}" == "gcc" && "${HAVE_GCC}" == "48" && \
 	( ${MACHINE_CPU} == "sh3" || \
 	  ${MACHINE_ARCH} == "vax" || \
-	  ${MACHINE_CPU} == "m68k" )
+	  ${MACHINE_CPU} == "m68k" || \
+	  ${MACHINE_CPU} == "or1k" )
 COPTS+=	-Wno-error=stack-protector 
 .endif
 



CVS commit: src/external/lgpl3/gmp/lib/libgmp/arch/or1k

2014-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  3 19:11:24 UTC 2014

Added Files:
src/external/lgpl3/gmp/lib/libgmp/arch/or1k: Makefile.inc config.h
config.m4 gmp-mparam.h gmp.h

Log Message:
OR1K configury for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/lgpl3/gmp/lib/libgmp/arch/or1k/Makefile.inc \
src/external/lgpl3/gmp/lib/libgmp/arch/or1k/config.h \
src/external/lgpl3/gmp/lib/libgmp/arch/or1k/config.m4 \
src/external/lgpl3/gmp/lib/libgmp/arch/or1k/gmp-mparam.h \
src/external/lgpl3/gmp/lib/libgmp/arch/or1k/gmp.h

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

Added files:

Index: src/external/lgpl3/gmp/lib/libgmp/arch/or1k/Makefile.inc
diff -u /dev/null src/external/lgpl3/gmp/lib/libgmp/arch/or1k/Makefile.inc:1.1
--- /dev/null	Wed Sep  3 19:11:24 2014
+++ src/external/lgpl3/gmp/lib/libgmp/arch/or1k/Makefile.inc	Wed Sep  3 19:11:24 2014
@@ -0,0 +1,184 @@
+#	$NetBSD: Makefile.inc,v 1.1 2014/09/03 19:11:24 matt Exp $
+
+SRCS+= \
+	random.c \
+	toom_interpolate_7pts.c \
+	divrem_2.c \
+	sbpi1_divappr_q.c \
+	random2.c \
+	mu_bdiv_q.c \
+	mulmid_basecase.c \
+	jacobi_2.c \
+	toom32_mul.c \
+	toom2_sqr.c \
+	toom44_mul.c \
+	toom8h_mul.c \
+	zero.c \
+	mod_1_4.c \
+	gcdext.c \
+	add_err3_n.c \
+	binvert.c \
+	mu_div_q.c \
+	invertappr.c \
+	add_n_sub_n.c \
+	dump.c \
+	mu_divappr_q.c \
+	dcpi1_div_qr.c \
+	hgcd_reduce.c \
+	matrix22_mul1_inverse_vector.c \
+	tabselect.c \
+	toom6_sqr.c \
+	divrem_1.c \
+	hgcd_step.c \
+	sub_err3_n.c \
+	mod_1.c \
+	toom42_mulmid.c \
+	divexact.c \
+	jacobi.c \
+	powlo.c \
+	mul.c \
+	set_str.c \
+	toom42_mul.c \
+	toom_interpolate_6pts.c \
+	toom54_mul.c \
+	dcpi1_divappr_q.c \
+	copyd.c \
+	toom_eval_dgr3_pm2.c \
+	mod_1_3.c \
+	com.c \
+	copyi.c \
+	toom_couple_handling.c \
+	lshift.c \
+	add.c \
+	div_qr_2.c \
+	toom_interpolate_12pts.c \
+	perfsqr.c \
+	toom53_mul.c \
+	toom_eval_pm2exp.c \
+	mu_div_qr.c \
+	toom_interpolate_16pts.c \
+	mod_34lsub1.c \
+	bdiv_q.c \
+	toom22_mul.c \
+	bsqrtinv.c \
+	toom4_sqr.c \
+	rshift.c \
+	div_q.c \
+	jacbase.c \
+	addcnd_n.c \
+	hgcd_matrix.c \
+	toom_eval_dgr3_pm1.c \
+	mullo_n.c \
+	toom33_mul.c \
+	mod_1_2.c \
+	sub_1.c \
+	add_err2_n.c \
+	trialdiv.c \
+	add_1.c \
+	sqr_basecase.c \
+	toom_interpolate_5pts.c \
+	sbpi1_bdiv_q.c \
+	pre_mod_1.c \
+	hgcd.c \
+	bdiv_dbm1c.c \
+	sqrtrem.c \
+	bdiv_q_1.c \
+	gcdext_1.c \
+	toom63_mul.c \
+	div_qr_2u_pi1.c \
+	toom8_sqr.c \
+	mul_basecase.c \
+	addmul_1.c \
+	neg.c \
+	gcdext_lehmer.c \
+	divis.c \
+	dcpi1_div_q.c \
+	mul_1.c \
+	sub_n.c \
+	toom_eval_pm2.c \
+	add_n.c \
+	subcnd_n.c \
+	hgcd2.c \
+	toom62_mul.c \
+	comb_tables.c \
+	sbpi1_bdiv_qr.c \
+	sub_err2_n.c \
+	scan1.c \
+	brootinv.c \
+	pre_divrem_1.c \
+	perfpow.c \
+	get_str.c \
+	mulmod_bnm1.c \
+	mullo_basecase.c \
+	tdiv_qr.c \
+	div_qr_2n_pi1.c \
+	toom43_mul.c \
+	mod_1_1.c \
+	matrix22_mul.c \
+	powm_sec.c \
+	divrem.c \
+	bsqrt.c \
+	gcd_1.c \
+	dcpi1_bdiv_qr.c \
+	mul_n.c \
+	redc_2.c \
+	submul_1.c \
+	toom6h_mul.c \
+	sqrmod_bnm1.c \
+	mul_fft.c \
+	mulmid.c \
+	powm.c \
+	rootrem.c \
+	mode1o.c \
+	toom_interpolate_8pts.c \
+	remove.c \
+	lshiftc.c \
+	dive_1.c \
+	cmp.c \
+	toom_eval_pm1.c \
+	hgcd_appr.c \
+	scan0.c \
+	gcd_subdiv_step.c \
+	sbpi1_div_qr.c \
+	invert.c \
+	sub.c \
+	toom_eval_pm2rexp.c \
+	broot.c \
+	dcpi1_bdiv_q.c \
+	hgcd2_jacobi.c \
+	add_err1_n.c \
+	mulmid_n.c \
+	redc_1.c \
+	sqr.c \
+	nussbaumer_mul.c \
+	mu_bdiv_qr.c \
+	pow_1.c \
+	get_d.c \
+	toom52_mul.c \
+	sbpi1_div_q.c \
+	diveby3.c \
+	fib2_ui.c \
+	bdiv_qr.c \
+	hgcd_jacobi.c \
+	toom3_sqr.c \
+	gcd.c \
+	redc_n.c \
+	sub_err1_n.c \
+
+C_SRCS_LIST= \
+	xor_n.c			mpn/generic/logops_n.c \
+	sb_div_r_sec.c		mpn/generic/sb_div_sec.c \
+	nand_n.c		mpn/generic/logops_n.c \
+	nior_n.c		mpn/generic/logops_n.c \
+	hamdist.c		mpn/generic/popham.c \
+	popcount.c		mpn/generic/popham.c \
+	sbpi1_div_qr_sec.c	mpn/generic/sbpi1_div_sec.c \
+	and_n.c			mpn/generic/logops_n.c \
+	ior_n.c			mpn/generic/logops_n.c \
+	sb_div_qr_sec.c		mpn/generic/sb_div_sec.c \
+	xnor_n.c		mpn/generic/logops_n.c \
+	iorn_n.c		mpn/generic/logops_n.c \
+	sbpi1_div_r_sec.c	mpn/generic/sbpi1_div_sec.c \
+	andn_n.c		mpn/generic/logops_n.c \
+
+GMP_LIMB_BITS=32
Index: src/external/lgpl3/gmp/lib/libgmp/arch/or1k/config.h
diff -u /dev/null src/external/lgpl3/gmp/lib/libgmp/arch/or1k/config.h:1.1
--- /dev/null	Wed Sep  3 19:11:24 2014
+++ src/external/lgpl3/gmp/lib/libgmp/arch/or1k/config.h	Wed Sep  3 19:11:24 2014
@@ -0,0 +1,630 @@
+/* config.h.  Generated from config.in by configure.  */
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/*
+
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it an

CVS commit: src/tests/lib/libpthread

2014-09-03 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Sep  3 16:23:25 UTC 2014

Modified Files:
src/tests/lib/libpthread: t_cond.c

Log Message:
The cond_timedwait_race test case is no longer expected to fail; it
has been consistently passing since CVS date 2014.01.31.19.22.00.
See also PR lib/44756.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libpthread/t_cond.c

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

Modified files:

Index: src/tests/lib/libpthread/t_cond.c
diff -u src/tests/lib/libpthread/t_cond.c:1.5 src/tests/lib/libpthread/t_cond.c:1.6
--- src/tests/lib/libpthread/t_cond.c:1.5	Sat Oct 19 17:45:01 2013
+++ src/tests/lib/libpthread/t_cond.c	Wed Sep  3 16:23:24 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cond.c,v 1.5 2013/10/19 17:45:01 christos Exp $ */
+/* $NetBSD: t_cond.c,v 1.6 2014/09/03 16:23:24 gson Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_cond.c,v 1.5 2013/10/19 17:45:01 christos Exp $");
+__RCSID("$NetBSD: t_cond.c,v 1.6 2014/09/03 16:23:24 gson Exp $");
 
 #include 
 
@@ -343,25 +343,17 @@ ATF_TC_HEAD(cond_timedwait_race, tc)
 ATF_TC_BODY(cond_timedwait_race, tc)
 {
 	pthread_t tid[64];
-	size_t i, j;
+	size_t i;
 
-	atf_tc_expect_fail("PR lib/44756");
-	/* This outer loop is to ensure that a false positive of this race
-	 * test does not report the test as broken (due to the test not
-	 * triggering the expected failure).  However, we want to make this
-	 * fail consistently when the race is resolved, and this approach
-	 * will have the desired effect. */
-	for (j = 0; j < 10; j++ ) {
-		for (i = 0; i < __arraycount(tid); i++) {
-
-			PTHREAD_REQUIRE(pthread_create(&tid[i], NULL,
-			pthread_cond_timedwait_func, NULL));
-		}
+	for (i = 0; i < __arraycount(tid); i++) {
 
-		for (i = 0; i < __arraycount(tid); i++) {
+		PTHREAD_REQUIRE(pthread_create(&tid[i], NULL,
+		pthread_cond_timedwait_func, NULL));
+	}
+
+	for (i = 0; i < __arraycount(tid); i++) {
 
-			PTHREAD_REQUIRE(pthread_join(tid[i], NULL));
-		}
+		PTHREAD_REQUIRE(pthread_join(tid[i], NULL));
 	}
 }
 



CVS commit: src/lib/libperfuse

2014-09-03 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed Sep  3 16:01:45 UTC 2014

Modified Files:
src/lib/libperfuse: ops.c perfuse.c

Log Message:
Improve POSIX compliance of FUSE filesystems through PERUSE
- access denied is EPERM and not EACCES
- access to file owned by someone else in a sticy-bit directory should
  be allowed for the sticy-bit directory owner
- setting sticky-bit on a non directory should produce EFTYPE
- implement PATHCONF method as much as we can.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.33 -r1.34 src/lib/libperfuse/perfuse.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.70 src/lib/libperfuse/ops.c:1.71
--- src/lib/libperfuse/ops.c:1.70	Fri Aug 29 04:58:40 2014
+++ src/lib/libperfuse/ops.c	Wed Sep  3 16:01:45 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.70 2014/08/29 04:58:40 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.71 2014/09/03 16:01:45 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -269,7 +269,7 @@ sticky_access(puffs_cookie_t opc, struct
 	  const struct puffs_cred *pcr)
 {
 	uid_t uid;
-	int sticky, owner;
+	int sticky, owner, parent_owner;
 
 	/*
 	 * This covers the case where the kernel requests a DELETE
@@ -288,9 +288,10 @@ sticky_access(puffs_cookie_t opc, struct
 
 	sticky = puffs_pn_getvap(opc)->va_mode & S_ISTXT;
 	owner = puffs_pn_getvap(targ)->va_uid == uid;
+	parent_owner = puffs_pn_getvap(opc)->va_uid == uid;
 
-	if (sticky && !owner)
-		return EACCES;
+	if (sticky && !owner && !parent_owner)
+		return EPERM;
 
 	return 0;
 }
@@ -1305,7 +1306,7 @@ perfuse_node_mknod(struct puffs_usermoun
 		break;
 	default:	/* VNON, VBLK, VCHR, VBAD */
 		if (!puffs_cred_isjuggernaut(pcn->pcn_cred)) {
-			error = EACCES;
+			error = EPERM;
 			goto out;
 		}
 		break;
@@ -1696,7 +1697,7 @@ perfuse_node_setattr_ttl(struct puffs_us
 	 (vap->va_mtime.tv_sec != (time_t)PUFFS_VNOVAL)) &&
 	(puffs_access_times(old_va->va_uid, old_va->va_gid,
 old_va->va_mode, 0, pcr) != 0))
-		return EACCES;
+		return EPERM;
 
 	/*
 	 * Check for permission to change owner and group
@@ -1705,7 +1706,15 @@ perfuse_node_setattr_ttl(struct puffs_us
 	 (vap->va_gid != (gid_t)PUFFS_VNOVAL)) &&
 	(puffs_access_chown(old_va->va_uid, old_va->va_gid,
 vap->va_uid, vap->va_gid, pcr)) != 0)
-		return EACCES;
+		return EPERM;
+
+	/*
+	 * Check for sticky bit on non-directory by non root user
+	 */
+	if ((vap->va_mode != (mode_t)PUFFS_VNOVAL) &&
+	(vap->va_mode & S_ISTXT) && (old_va->va_type != VDIR) &&
+	!puffs_cred_isjuggernaut(pcr))
+		return EFTYPE;
 
 	/*
 	 * Check for permission to change permissions
@@ -1713,7 +1722,7 @@ perfuse_node_setattr_ttl(struct puffs_us
 	if ((vap->va_mode != (mode_t)PUFFS_VNOVAL) &&
 	(puffs_access_chmod(old_va->va_uid, old_va->va_gid,
 old_va->va_type, vap->va_mode, pcr)) != 0)
-		return EACCES;
+		return EPERM;
 	
 	node_ref(opc);
 	
@@ -2877,13 +2886,68 @@ perfuse_node_print(struct puffs_usermoun
 	return 0;
 }
 
-/* ARGSUSED0 */
 int
 perfuse_node_pathconf(struct puffs_usermount *pu, puffs_cookie_t opc,
 	int name, int *retval)
 {
-	DERRX(EX_SOFTWARE, "%s: UNIMPLEMENTED (FATAL)", __func__);
-	return 0;
+	perfuse_msg_t *pm;
+	struct perfuse_state *ps;
+	struct fuse_statfs_out *fso;
+	int error = 0;
+
+	/*
+	 * Static values copied from UFS 
+	 * in src/sys/ufs/ufs/ufs_vnops.c
+	 */
+	switch (name) {
+	case _PC_LINK_MAX:
+		*retval = LINK_MAX;
+		break;
+	case _PC_PATH_MAX:
+		*retval = PATH_MAX;
+		break;
+	case _PC_PIPE_BUF:
+		*retval = PIPE_BUF;
+		break;
+	case _PC_CHOWN_RESTRICTED:
+		*retval = 1;
+		break;
+	case _PC_NO_TRUNC:
+		*retval = 1;
+		break;
+	case _PC_SYNC_IO:
+		*retval = 1;
+		break;
+	case _PC_FILESIZEBITS:
+		*retval = 42;
+		break;
+	case _PC_SYMLINK_MAX:
+		*retval = MAXPATHLEN;
+		break;
+	case _PC_2_SYMLINKS:
+		*retval = 1;
+		break;
+	case _PC_NAME_MAX:
+		ps = puffs_getspecific(pu);
+		pm = ps->ps_new_msg(pu, opc, FUSE_STATFS, 0, NULL);
+
+		error = xchg_msg(pu, opc, pm, sizeof(*fso), wait_reply);
+		if (error != 0)
+			return error;
+
+		fso = GET_OUTPAYLOAD(ps, pm, fuse_statfs_out);
+		*retval = fso->st.namelen;
+
+		ps->ps_destroy_msg(pm);
+	
+		break;
+	default:
+		DWARN("Unimplemented pathconf for name = %d", name);
+		error = ENOSYS;
+		break;
+	}
+
+	return error;
 }
 
 int

Index: src/lib/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.33 src/lib/libperfuse/perfuse.c:1.34
--- src/lib/libperfuse/perfuse.c:1.33	Sat Aug 16 16:31:15 2014
+++ src/lib/libperfuse/perfuse.c	Wed Sep  3 16:01:45 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse.c,v 1.33 2014/08/16 16:31:15 manu Exp $ */
+/*  $NetBSD: perfuse.c,v 1.34 2014/09/03 16:01:45 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -483,6 +483,7 

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

2014-09-03 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Sep  3 15:24:53 UTC 2014

Modified Files:
src/sys/arch/evbarm/odroid: odroid_machdep.c

Log Message:
Add i2c bits for gpio to the connected GPIO pins for Exynos5


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/odroid/odroid_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/odroid/odroid_machdep.c
diff -u src/sys/arch/evbarm/odroid/odroid_machdep.c:1.31 src/sys/arch/evbarm/odroid/odroid_machdep.c:1.32
--- src/sys/arch/evbarm/odroid/odroid_machdep.c:1.31	Thu Aug 28 18:02:37 2014
+++ src/sys/arch/evbarm/odroid/odroid_machdep.c	Wed Sep  3 15:24:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: odroid_machdep.c,v 1.31 2014/08/28 18:02:37 reinoud Exp $ */
+/*	$NetBSD: odroid_machdep.c,v 1.32 2014/09/03 15:24:52 reinoud Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.31 2014/08/28 18:02:37 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.32 2014/09/03 15:24:52 reinoud Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_exynos.h"
@@ -597,15 +597,18 @@ odroid_exynos5_gpio_ncs(device_t self, p
 	 * generated by the gpio bootstrap and the values substracted are
 	 * explicitly allowed
 	 */
-	prop_dictionary_set_uint32(dict, "nc-GPA0", 0xff - 0b);
+	/* i2c2 at pin 6,7 */
+	prop_dictionary_set_uint32(dict, "nc-GPA0", 0xff - 0b1100);
 	prop_dictionary_set_uint32(dict, "nc-GPA1", 0x3f - 0b);
-	prop_dictionary_set_uint32(dict, "nc-GPA2", 0xff - 0b);
+	/* i2c4 at pin 0,1 */
+	prop_dictionary_set_uint32(dict, "nc-GPA2", 0xff - 0b0011);
 	prop_dictionary_set_uint32(dict, "nc-GPB0", 0x1f - 0b);
 	prop_dictionary_set_uint32(dict, "nc-GPB1", 0x1f - 0b);
 	/* green led at bit 1 : eMMC activity */
 	/* red   led at bit 2 : heartbeat */
 	prop_dictionary_set_uint32(dict, "nc-GPB2", 0x0f - 0b0110);
-	prop_dictionary_set_uint32(dict, "nc-GPB3", 0x0f - 0b);
+	/* i2c1 at pin 2,3 */
+	prop_dictionary_set_uint32(dict, "nc-GPB3", 0x0f - 0b1100);
 	prop_dictionary_set_uint32(dict, "nc-GPC0", 0x7f - 0b);
 	prop_dictionary_set_uint32(dict, "nc-GPC1", 0x0f - 0b);
 	prop_dictionary_set_uint32(dict, "nc-GPC2", 0x7f - 0b);



CVS commit: src/doc

2014-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  3 14:40:36 UTC 2014

Modified Files:
src/doc: CHANGES

Log Message:
wm(4): Add internal SERDES support for 82575 and newer controllers.


To generate a diff of this commit:
cvs rdiff -u -r1.1973 -r1.1974 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1973 src/doc/CHANGES:1.1974
--- src/doc/CHANGES:1.1973	Sun Aug 31 06:59:52 2014
+++ src/doc/CHANGES	Wed Sep  3 14:40:36 2014
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1973 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1974 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -32,6 +32,9 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 		whether module autoloading is on by default.
 		[jnemeth 20140824]
 	kernel: Option SYMTAB_SPACE has been replaced with COPY_SYMTAB.
-		The related changes to src/sys/conf require a rebuild of config(1).
-		[joerg 20140824]
+		The related changes to src/sys/conf require a rebuild of
+		config(1). [joerg 20140824]
 	zoneinfo: Import tzdata2014g. [apb 20140831]
+
+	wm(4): Add internal SERDES support for 82575 and newer controllers.
+		[msaitoh 20140903]



CVS commit: src/share/man/man4

2014-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  3 14:36:45 UTC 2014

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

Log Message:
Now all of the internal SERDES systems are supported, so update BUGS section.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man4/wm.4

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

Modified files:

Index: src/share/man/man4/wm.4
diff -u src/share/man/man4/wm.4:1.30 src/share/man/man4/wm.4:1.31
--- src/share/man/man4/wm.4:1.30	Fri Aug  1 04:57:25 2014
+++ src/share/man/man4/wm.4	Wed Sep  3 14:36:45 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wm.4,v 1.30 2014/08/01 04:57:25 msaitoh Exp $
+.\"	$NetBSD: wm.4,v 1.31 2014/09/03 14:36:45 msaitoh Exp $
 .\"
 .\" Copyright 2002, 2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 1, 2014
+.Dd September 3, 2014
 .Dt WM 4
 .Os
 .Sh NAME
@@ -185,5 +185,4 @@ The
 driver was written by
 .An Jason R. Thorpe Aq Mt thor...@wasabisystems.com .
 .Sh BUGS
-Some 82575 and newer controllers with internal SERDES are
-not currently supported.
+EEE (Energy Efficiency Ethernet) is not currently supported.



CVS commit: src/sys/dev/pci

2014-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  3 14:30:04 UTC 2014

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

Log Message:
Read SFF SFP ROM and configure driver from the value.


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/if_wmreg.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/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.294 src/sys/dev/pci/if_wm.c:1.295
--- src/sys/dev/pci/if_wm.c:1.294	Mon Sep  1 16:42:27 2014
+++ src/sys/dev/pci/if_wm.c	Wed Sep  3 14:30:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.294 2014/09/01 16:42:27 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.295 2014/09/03 14:30:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.294 2014/09/01 16:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.295 2014/09/03 14:30:04 msaitoh Exp $");
 
 #include 
 #include 
@@ -624,7 +624,8 @@ static int	wm_tbi_mediachange(struct ifn
 static void	wm_tbi_set_linkled(struct wm_softc *);
 static void	wm_tbi_check_link(struct wm_softc *);
 /* SFP related */
-static uint32_t	wm_get_sfp_media_type(struct wm_softc *);
+static int	wm_sfp_read_data_byte(struct wm_softc *, uint16_t, uint8_t *);
+static uint32_t	wm_sfp_get_media_type(struct wm_softc *);
 
 /*
  * NVM related.
@@ -2075,7 +2076,7 @@ wm_attach(device_t parent, device_t self
 aprint_verbose_dev(sc->sc_dev, "SGMII(I2C)\n");
 /*FALLTHROUGH*/
 			case CTRL_EXT_LINK_MODE_PCIE_SERDES:
-sc->sc_mediatype = wm_get_sfp_media_type(sc);
+sc->sc_mediatype = wm_sfp_get_media_type(sc);
 if (sc->sc_mediatype == WMP_F_UNKNOWN) {
 	if (link_mode
 	== CTRL_EXT_LINK_MODE_SGMII) {
@@ -2110,6 +2111,7 @@ wm_attach(device_t parent, device_t self
 break;
 			case CTRL_EXT_LINK_MODE_GMII:
 			default:
+aprint_verbose_dev(sc->sc_dev, "Copper\n");
 sc->sc_mediatype = WMP_F_COPPER;
 break;
 			}
@@ -7578,12 +7580,91 @@ wm_tbi_check_link(struct wm_softc *sc)
 }
 
 /* SFP related */
+
+static int
+wm_sfp_read_data_byte(struct wm_softc *sc, uint16_t offset, uint8_t *data)
+{
+	uint32_t i2ccmd;
+	int i;
+
+	i2ccmd = (offset << I2CCMD_REG_ADDR_SHIFT) | I2CCMD_OPCODE_READ;
+	CSR_WRITE(sc, WMREG_I2CCMD, i2ccmd);
+
+	/* Poll the ready bit */
+	for (i = 0; i < I2CCMD_PHY_TIMEOUT; i++) {
+		delay(50);
+		i2ccmd = CSR_READ(sc, WMREG_I2CCMD);
+		if (i2ccmd & I2CCMD_READY)
+			break;
+	}
+	if ((i2ccmd & I2CCMD_READY) == 0)
+		return -1;
+	if ((i2ccmd & I2CCMD_ERROR) != 0)
+		return -1;
+
+	*data = i2ccmd & 0x00ff;
+
+	return 0;
+}
+
 static uint32_t
-wm_get_sfp_media_type(struct wm_softc *sc)
+wm_sfp_get_media_type(struct wm_softc *sc)
 {
+	uint32_t ctrl_ext;
+	uint8_t val = 0;
+	int timeout = 3;
+	uint32_t mediatype = WMP_F_UNKNOWN;
+	int rv = -1;
 
-	/* XXX */
-	return WMP_F_SERDES;
+	ctrl_ext = CSR_READ(sc, WMREG_CTRL_EXT);
+	ctrl_ext &= ~CTRL_EXT_SWDPIN(3);
+	CSR_WRITE(sc, WMREG_CTRL_EXT, ctrl_ext | CTRL_EXT_I2C_ENA);
+	CSR_WRITE_FLUSH(sc);
+
+	/* Read SFP module data */
+	while (timeout) {
+		rv = wm_sfp_read_data_byte(sc, SFF_SFP_ID_OFF, &val);
+		if (rv == 0)
+			break;
+		delay(100*1000); /* XXX too big */
+		timeout--;
+	}
+	if (rv != 0)
+		goto out;
+	switch (val) {
+	case SFF_SFP_ID_SFF:
+		aprint_normal_dev(sc->sc_dev,
+		"Module/Connector soldered to board\n");
+		break;
+	case SFF_SFP_ID_SFP:
+		aprint_normal_dev(sc->sc_dev, "SFP\n");
+		break;
+	case SFF_SFP_ID_UNKNOWN:
+		goto out;
+	default:
+		break;
+	}
+
+	rv = wm_sfp_read_data_byte(sc, SFF_SFP_ETH_FLAGS_OFF, &val);
+	if (rv != 0) {
+		goto out;
+	}
+
+	if ((val & (SFF_SFP_ETH_FLAGS_1000SX | SFF_SFP_ETH_FLAGS_1000LX)) != 0)
+		mediatype = WMP_F_SERDES;
+	else if ((val & SFF_SFP_ETH_FLAGS_1000T) != 0){
+		sc->sc_flags |= WM_F_SGMII;
+		mediatype = WMP_F_COPPER;
+	} else if ((val & SFF_SFP_ETH_FLAGS_100FX) != 0){
+		sc->sc_flags |= WM_F_SGMII;
+		mediatype = WMP_F_SERDES;
+	}
+
+out:
+	/* Restore I2C interface setting */
+	CSR_WRITE(sc, WMREG_CTRL_EXT, ctrl_ext);
+
+	return mediatype;
 }
 /*
  * NVM related.

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.62 src/sys/dev/pci/if_wmreg.h:1.63
--- src/sys/dev/pci/if_wmreg.h:1.62	Mon Sep  1 16:42:27 2014
+++ src/sys/dev/pci/if_wmreg.h	Wed Sep  3 14:30:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.62 2014/09/01 16:42:27 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.63 2014/09/03 14:30:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1035,6 +1035,20 @@ struct livengood_tcpip_ctxdesc {
 /* for PCI express Capability registers */
 #define	WM_PCIE_DCSR2_16MS	0x0005
 
+/* SFF SFP ROM data */
+#define SFF_SFP_ID_OFF		0x00
+#define SFF_SFP_ID_UNKNOWN	0x00	/* Unknown */
+#define SFF_SFP_ID_SFF		0x02	/* Module soldered to motherboar

CVS commit: src/sys/external/bsd/dwc2/dist

2014-09-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep  3 10:00:08 UTC 2014

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcd.c dwc2_hcd.h dwc2_hcdintr.c
dwc2_hcdqueue.c

Log Message:
Adapt the NAK holdoff scheme for FS/LS devices from the Raspberry Pi
Foundation driver.

Should fix PR/49019 - RPI: interrupt storm when url0 is up


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/dwc2/dist/dwc2_hcd.h
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c

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

Modified files:

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.13 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.14
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.13	Thu Jul  3 07:18:42 2014
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcd.c	Wed Sep  3 10:00:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcd.c,v 1.13 2014/07/03 07:18:42 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcd.c,v 1.14 2014/09/03 10:00:08 skrll Exp $	*/
 
 /*
  * hcd.c - DesignWare HS OTG Controller host-mode routines
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.13 2014/07/03 07:18:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.14 2014/09/03 10:00:08 skrll Exp $");
 
 #include 
 #include 
@@ -887,6 +887,23 @@ enum dwc2_transaction_type dwc2_hcd_sele
 		if (list_empty(&hsotg->free_hc_list))
 			break;
 		qh = list_entry(qh_ptr, struct dwc2_qh, qh_list_entry);
+
+		/*
+		 * Check to see if this is a NAK'd retransmit, in which case
+		 * ignore for retransmission. We hold off on bulk/control
+		 * retransmissions to reduce NAK interrupt overhead for
+		 * cheeky devices that just hold off using NAKs.
+		 */
+		if (qh->do_split &&
+		qh->nak_frame != 0x &&
+		dwc2_full_frame_num(qh->nak_frame) ==
+		dwc2_full_frame_num(dwc2_hcd_get_frame_number(hsotg))) {
+			qh_ptr = qh_ptr->next;
+			continue;
+		} else {
+			qh->nak_frame = 0x;
+		}
+
 		if (hsotg->core_params->uframe_sched > 0) {
 			if (hsotg->available_host_channels < 1)
 break;

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcd.h
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.8 src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.9
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.8	Thu Apr  3 06:34:58 2014
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcd.h	Wed Sep  3 10:00:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcd.h,v 1.8 2014/04/03 06:34:58 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcd.h,v 1.9 2014/09/03 10:00:08 skrll Exp $	*/
 
 /*
  * hcd.h - DesignWare HS OTG Controller host-mode declarations
@@ -243,6 +243,7 @@ enum dwc2_transaction_type {
  * @interval:   Interval between transfers in (micro)frames
  * @sched_frame:(Micro)frame to initialize a periodic transfer.
  *  The transfer executes in the following (micro)frame.
+ * @nak_frame:  Internal variable used by the NAK holdoff code
  * @frame_usecs:Internal variable used by the microframe scheduler
  * @start_split_frame:  (Micro)frame at which last start split was initialized
  * @ntd:Actual number of transfer descriptors in a list
@@ -277,6 +278,7 @@ struct dwc2_qh {
 	u16 usecs;
 	u16 interval;
 	u16 sched_frame;
+	u16 nak_frame;
 	u16 frame_usecs[8];
 	u16 start_split_frame;
 	u16 ntd;

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c:1.9 src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c:1.10
--- src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c:1.9	Sat Jul 26 09:18:53 2014
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c	Wed Sep  3 10:00:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcdintr.c,v 1.9 2014/07/26 09:18:53 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcdintr.c,v 1.10 2014/09/03 10:00:08 skrll Exp $	*/
 
 /*
  * hcd_intr.c - DesignWare HS OTG Controller host-mode interrupt handling
@@ -40,7 +40,7 @@
  * This file contains the interrupt handlers for Host mode
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdintr.c,v 1.9 2014/07/26 09:18:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdintr.c,v 1.10 2014/09/03 10:00:08 skrll Exp $");
 
 #include 
 #include 
@@ -1211,6 +1211,17 @@ static void dwc2_hc_nak_intr(struct dwc2
 			 chnum);
 
 	/*
+	 * When we get control/bulk NAKs then remember this so we holdoff on
+	 * this qh until the beginning of the next frame
+	 */
+	switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
+	case USB_ENDPOINT_XFER_CONTROL:
+	case USB_ENDPOINT_XFER_BULK:
+		chan->qh->nak_frame = dwc2_hcd_get_frame_number(hsotg);
+		break;
+	}
+
+	/*
 	 * Handle NAK for IN/OUT SSPLIT/CSPLIT transfers, bulk, control, and
 	 * interrupt. Re-start the SSPLIT transfer.
 	 */

Index: src/sys/external/bsd/dwc2/dist/d