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

2018-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 05:43:42 UTC 2018

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

Log Message:
enable the two errata for AMD Family 16h, tested by mrg@, thanks


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x86/x86/errata.c

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

Modified files:

Index: src/sys/arch/x86/x86/errata.c
diff -u src/sys/arch/x86/x86/errata.c:1.24 src/sys/arch/x86/x86/errata.c:1.25
--- src/sys/arch/x86/x86/errata.c:1.24	Tue Aug  7 10:50:12 2018
+++ src/sys/arch/x86/x86/errata.c	Sun Aug 12 05:43:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: errata.c,v 1.24 2018/08/07 10:50:12 maxv Exp $	*/
+/*	$NetBSD: errata.c,v 1.25 2018/08/12 05:43:42 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.24 2018/08/07 10:50:12 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.25 2018/08/12 05:43:42 maxv Exp $");
 
 #include 
 #include 
@@ -144,11 +144,9 @@ static const uint8_t x86_errata_set11[] 
 	DA_C3, HY_D0, HY_D1, HY_D1_G34R1,  PH_E0, LN_B0, OINK
 };
 
-#ifdef notyet_f16h
 static const uint8_t x86_errata_set12[] = {
 	KB_A1, OINK
 };
-#endif
 
 static const uint8_t x86_errata_set13[] = {
 	ZP_B1, ZP_B2, PiR_B2, OINK
@@ -158,11 +156,9 @@ static const uint8_t x86_errata_set14[] 
 	ZP_B1, OINK
 };
 
-#ifdef notyet_f16h
 static const uint8_t x86_errata_set15[] = {
 	KB_A1, ML_A1, OINK
 };
-#endif
 
 static bool x86_errata_setmsr(struct cpu_info *, errata_t *);
 static bool x86_errata_testmsr(struct cpu_info *, errata_t *);
@@ -307,7 +303,6 @@ static errata_t errata[] = {
 		721, FALSE, MSR_DE_CFG, x86_errata_set11,
 		x86_errata_setmsr, DE_CFG_ERRATA_721
 	},
-#ifdef notyet_f16h	/* TODO: needs to be tested */
 	/*
 	 * 776: Incorrect Processor Branch Prediction for Two Consecutive
 	 * Linear Pages
@@ -324,7 +319,6 @@ static errata_t errata[] = {
 		793, FALSE, MSR_LS_CFG, x86_errata_set15,
 		x86_errata_setmsr, LS_CFG_ERRATA_793
 	},
-#endif
 	/*
 	 * 1021: Load Operation May Receive Stale Data From Older Store
 	 * Operation



CVS commit: src/sys/dev/usb

2018-08-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Aug 12 04:19:31 UTC 2018

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.750 -r1.751 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.h

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

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.750 src/sys/dev/usb/usbdevs.h:1.751
--- src/sys/dev/usb/usbdevs.h:1.750	Tue Jul 31 16:07:46 2018
+++ src/sys/dev/usb/usbdevs.h	Sun Aug 12 04:19:31 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.750 2018/07/31 16:07:46 khorben Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.751 2018/08/12 04:19:31 rin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.756 2018/07/25 05:29:33 msaitoh Exp
+ *	NetBSD: usbdevs,v 1.758 2018/08/12 04:17:54 rin Exp
  */
 
 /*-
@@ -3147,6 +3147,7 @@
 #define	USB_PRODUCT_SMSC_2514HUB	0x2514		/* USB 2.0 4-Port Hub */
 #define	USB_PRODUCT_SMSC_2517HUB	0x2517		/* USB 2.0 7-Port Hub */
 #define	USB_PRODUCT_SMSC_LAN7500	0x7500		/* LAN7500 USB 2.0 gigabit ethernet device */
+#define	USB_PRODUCT_SMSC_LAN7505	0x7505		/* LAN7505 USB 2.0 gigabit ethernet device */
 #define	USB_PRODUCT_SMSC_LAN7800	0x7800		/* LAN7800 USB 3.1 gigabit ethernet device */
 #define	USB_PRODUCT_SMSC_LAN7801	0x7801		/* LAN7801 USB 3.1 gigabit ethernet device */
 #define	USB_PRODUCT_SMSC_LAN7850	0x7850		/* LAN7850 USB 2.0 gigabit ethernet device */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.750 src/sys/dev/usb/usbdevs_data.h:1.751
--- src/sys/dev/usb/usbdevs_data.h:1.750	Tue Jul 31 16:07:46 2018
+++ src/sys/dev/usb/usbdevs_data.h	Sun Aug 12 04:19:31 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.750 2018/07/31 16:07:46 khorben Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.751 2018/08/12 04:19:31 rin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.756 2018/07/25 05:29:33 msaitoh Exp
+ *	NetBSD: usbdevs,v 1.758 2018/08/12 04:17:54 rin Exp
  */
 
 /*-
@@ -4316,108 +4316,110 @@ static const uint16_t usb_products[] = {
 	4871, 5313, 7330, 5809, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN7500, 
 	18331, 4871, 5313, 6652, 5121, 10307, 0,
+	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN7505, 
+	18339, 4871, 5313, 6652, 5121, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN7800, 
-	18339, 4871, 18347, 6652, 5121, 10307, 0,
+	18347, 4871, 18355, 6652, 5121, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN7801, 
-	18351, 4871, 18347, 6652, 5121, 10307, 0,
+	18359, 4871, 18355, 6652, 5121, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN7850, 
-	18359, 4871, 5313, 6652, 5121, 10307, 0,
+	18367, 4871, 5313, 6652, 5121, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9500, 
-	18367, 4901, 10307, 0,
+	18375, 4901, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9505, 
-	18376, 4901, 10307, 0,
+	18384, 4901, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9512, 
-	18385, 4871, 5809, 3102, 4901, 10307, 0,
+	18393, 4871, 5809, 3102, 4901, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9514, 
-	18394, 4871, 5809, 3102, 4901, 10307, 0,
+	18402, 4871, 5809, 3102, 4901, 10307, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN9530, 
-	18403, 4901, 7851, 0,
-	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN9730, 
 	18411, 4901, 7851, 0,
+	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_LAN9730, 
+	18419, 4901, 7851, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9500_SAL10, 
-	18367, 4901, 10307, 18419, 0,
+	18375, 4901, 10307, 18427, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9505_SAL10, 
-	18376, 4901, 10307, 18419, 0,
+	18384, 4901, 10307, 18427, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9500A_SAL10, 
-	18427, 4901, 10307, 18419, 0,
+	18435, 4901, 10307, 18427, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9505A_SAL10, 
-	18437, 4901, 10307, 18419, 0,
+	18445, 4901, 10307, 18427, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9512_14_SAL10, 
-	18447, 5809, 3102, 4901, 7851, 18419, 0,
+	18455, 5809, 3102, 4901, 7851, 18427, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9500A_HAL, 
-	18427, 4901, 7851, 18459, 0,
+	18435, 4901, 7851, 18467, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9505A_HAL, 
-	18437, 4901, 7851, 18459, 0,
+	18445, 4901, 7851, 18467, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9500_ALT, 
-	18367, 4901, 7851, 0,
+	18375, 4901, 7851, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9500A_ALT, 
-	18427, 4901, 7851, 0,
+	18435, 4901, 7851, 0,
 	USB_VENDOR_SMSC, USB_PRODUCT_SMSC_SMSC9512_14_ALT, 
-	18385, 5809, 3102, 4901, 7851, 0,
+	18393, 5809, 3102, 4901, 7851, 0,
 	

CVS commit: src/sys/dev/usb

2018-08-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Aug 12 04:17:54 UTC 2018

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add SMSC LAN7505 USB 2.0 gigabit ethernet device.


To generate a diff of this commit:
cvs rdiff -u -r1.757 -r1.758 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.757 src/sys/dev/usb/usbdevs:1.758
--- src/sys/dev/usb/usbdevs:1.757	Tue Jul 31 16:07:26 2018
+++ src/sys/dev/usb/usbdevs	Sun Aug 12 04:17:54 2018
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.757 2018/07/31 16:07:26 khorben Exp $
+$NetBSD: usbdevs,v 1.758 2018/08/12 04:17:54 rin Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -3140,6 +3140,7 @@ product SMSC 2513HUB		0x2513	USB 2.0 3-P
 product SMSC 2514HUB		0x2514	USB 2.0 4-Port Hub
 product SMSC 2517HUB		0x2517	USB 2.0 7-Port Hub
 product SMSC LAN7500		0x7500	LAN7500 USB 2.0 gigabit ethernet device
+product SMSC LAN7505		0x7505	LAN7505 USB 2.0 gigabit ethernet device
 product SMSC LAN7800		0x7800	LAN7800 USB 3.1 gigabit ethernet device
 product SMSC LAN7801		0x7801	LAN7801 USB 3.1 gigabit ethernet device
 product SMSC LAN7850		0x7850	LAN7850 USB 2.0 gigabit ethernet device



CVS commit: src/sys/ufs/lfs

2018-08-11 Thread Zafer Aydogan
Module Name:src
Committed By:   zafer
Date:   Sat Aug 11 20:16:21 UTC 2018

Modified Files:
src/sys/ufs/lfs: lfs_vnops.c

Log Message:
In lfs_mkdir fix wrong return path in case of EMLINK which causes a panic. 
Also, check earlier before setting up dirop.


To generate a diff of this commit:
cvs rdiff -u -r1.321 -r1.322 src/sys/ufs/lfs/lfs_vnops.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/ufs/lfs/lfs_vnops.c
diff -u src/sys/ufs/lfs/lfs_vnops.c:1.321 src/sys/ufs/lfs/lfs_vnops.c:1.322
--- src/sys/ufs/lfs/lfs_vnops.c:1.321	Sun Aug 20 05:37:03 2017
+++ src/sys/ufs/lfs/lfs_vnops.c	Sat Aug 11 20:16:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vnops.c,v 1.321 2017/08/20 05:37:03 maya Exp $	*/
+/*	$NetBSD: lfs_vnops.c,v 1.322 2018/08/11 20:16:21 zafer Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.321 2017/08/20 05:37:03 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.322 2018/08/11 20:16:21 zafer Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -959,6 +959,11 @@ lfs_mkdir(void *v)
 	if (fs->lfs_ronly) {
 		return EROFS;
 	}
+
+	if ((nlink_t)dp->i_nlink >= LINK_MAX) {
+		return EMLINK;
+	}
+
 	dirblksiz = fs->um_dirblksiz;
 	/* XXX dholland 20150911 I believe this to be true, but... */
 	//KASSERT(dirblksiz == LFS_DIRBLKSIZ);
@@ -967,11 +972,6 @@ lfs_mkdir(void *v)
 	if (error)
 		return error;
 
-	if ((nlink_t)dp->i_nlink >= LINK_MAX) {
-		error = EMLINK;
-		goto out;
-	}
-
 	/*
 	 * Must simulate part of lfs_makeinode here to acquire the inode,
 	 * but not have it entered in the parent directory. The entry is



CVS commit: src/tools

2018-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 11 19:46:03 UTC 2018

Modified Files:
src/tools: Makefile

Log Message:
hook in the tools version of grep


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/tools/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/Makefile
diff -u src/tools/Makefile:1.194 src/tools/Makefile:1.195
--- src/tools/Makefile:1.194	Wed May  9 09:21:27 2018
+++ src/tools/Makefile	Sat Aug 11 15:46:03 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.194 2018/05/09 13:21:27 joerg Exp $
+#	$NetBSD: Makefile,v 1.195 2018/08/11 19:46:03 christos Exp $
 
 .include 
 .include 
@@ -101,6 +101,7 @@ SUBDIR+= cap_mkdb crunchgen ctags gencat
 .endif
 
 SUBDIR+= cat rpcgen join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex
+SUBDIR+= grep
 
 .if ${TOOLS_BUILDRUMP} == "no"
 SUBDIR += .WAIT texinfo \



CVS commit: src/share/mk

2018-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 11 19:45:13 UTC 2018

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

Log Message:
use the tools version of grep


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

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1072 src/share/mk/bsd.own.mk:1.1073
--- src/share/mk/bsd.own.mk:1.1072	Wed Jul 25 19:34:25 2018
+++ src/share/mk/bsd.own.mk	Sat Aug 11 15:45:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1072 2018/07/25 23:34:25 kamil Exp $
+#	$NetBSD: bsd.own.mk,v 1.1073 2018/08/11 19:45:13 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -376,9 +376,7 @@ TOOL_GENASSYM=		${TOOLDIR}/bin/${_TOOL_P
 TOOL_GENCAT=		${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
 TOOL_GMAKE=		${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
 TOOL_GPT=		${TOOLDIR}/bin/${_TOOL_PREFIX}gpt
-# grep exists in src/tools, but is not hooked up into the build.
-#TOOL_GREP=		${TOOLDIR}/bin/${_TOOL_PREFIX}grep
-TOOL_GREP=		grep
+TOOL_GREP=		${TOOLDIR}/bin/${_TOOL_PREFIX}grep
 GROFF_SHARE_PATH=	${TOOLDIR}/share/groff
 TOOL_GROFF_ENV= \
 GROFF_ENCODING= \



CVS commit: src/usr.bin/grep

2018-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 11 19:44:19 UTC 2018

Modified Files:
src/usr.bin/grep: grep.c

Log Message:
use setvbuf if available; it is more portable.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/grep/grep.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/grep/grep.c
diff -u src/usr.bin/grep/grep.c:1.12 src/usr.bin/grep/grep.c:1.13
--- src/usr.bin/grep/grep.c:1.12	Fri Jul 11 12:30:45 2014
+++ src/usr.bin/grep/grep.c	Sat Aug 11 15:44:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.12 2014/07/11 16:30:45 christos Exp $	*/
+/*	$NetBSD: grep.c,v 1.13 2018/08/11 19:44:19 christos Exp $	*/
 /* 	$FreeBSD: head/usr.bin/grep/grep.c 211519 2010-08-19 22:55:17Z delphij $	*/
 /*	$OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $	*/
 
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: grep.c,v 1.12 2014/07/11 16:30:45 christos Exp $");
+__RCSID("$NetBSD: grep.c,v 1.13 2018/08/11 19:44:19 christos Exp $");
 
 #include 
 #include 
@@ -679,8 +679,13 @@ main(int argc, char *argv[])
 		}
 	}
 
-	if (lbflag)
+	if (lbflag) {
+#ifdef _IOLBF
+		setvbuf(stdout, NULL, _IOLBF, 0);
+#else
 		setlinebuf(stdout);
+#endif
+	}
 
 	if ((aargc == 0 || aargc == 1) && !Hflag)
 		hflag = true;



CVS commit: src/usr.bin/grep

2018-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 11 19:43:54 UTC 2018

Modified Files:
src/usr.bin/grep: Makefile

Log Message:
don't build NLS if we don't need to


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/grep/Makefile

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/grep/Makefile
diff -u src/usr.bin/grep/Makefile:1.5 src/usr.bin/grep/Makefile:1.6
--- src/usr.bin/grep/Makefile:1.5	Wed Aug 17 11:32:20 2011
+++ src/usr.bin/grep/Makefile	Sat Aug 11 15:43:54 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2011/08/17 15:32:20 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2018/08/11 19:43:54 christos Exp $
 #	$FreeBSD: head/usr.bin/grep/Makefile 210389 2010-07-22 19:11:57Z gabor $
 #	$OpenBSD: Makefile,v 1.6 2003/06/25 15:00:04 millert Exp $
 
@@ -20,6 +20,7 @@ MLINKS=	grep.1 egrep.1	\
 LDADD=	-lz -lbz2
 DPADD=	${LIBZ} ${LIBBZ2}
 
+.if empty(HOST_CPPFLAGS:M*-DWITHOUT_NLS*)
 .PATH: ${.CURDIR}/nls
 
 NLS=	C.msg \
@@ -33,6 +34,7 @@ NLS=	C.msg \
 	ru_RU.KOI8-R.msg \
 	uk_UA.UTF-8.msg \
 	zh_CN.UTF-8.msg
+.endif
 
 COPTS.grep.c += -Wno-format-nonliteral
 COPTS.util.c += -Wno-format-nonliteral



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

2018-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 11 16:25:32 UTC 2018

Modified Files:
src/common/lib/libc/string: strcasecmp.c

Log Message:
Add nbotool stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/string/strcasecmp.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/string/strcasecmp.c
diff -u src/common/lib/libc/string/strcasecmp.c:1.2 src/common/lib/libc/string/strcasecmp.c:1.3
--- src/common/lib/libc/string/strcasecmp.c:1.2	Mon Jun  4 14:19:27 2007
+++ src/common/lib/libc/string/strcasecmp.c	Sat Aug 11 12:25:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: strcasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $	*/
+/*	$NetBSD: strcasecmp.c,v 1.3 2018/08/11 16:25:32 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -29,12 +29,16 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
 #if 0
 static char sccsid[] = "@(#)strcasecmp.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: strcasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
+__RCSID("$NetBSD: strcasecmp.c,v 1.3 2018/08/11 16:25:32 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 



CVS commit: src/tools/compat

2018-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 11 16:24:59 UTC 2018

Modified Files:
src/tools/compat: Makefile compat_defs.h configure configure.ac
nbtool_config.h.in

Log Message:
Add strcasecmp


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/tools/compat/Makefile
cvs rdiff -u -r1.112 -r1.113 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.90 -r1.91 src/tools/compat/configure
cvs rdiff -u -r1.91 -r1.92 src/tools/compat/configure.ac
cvs rdiff -u -r1.44 -r1.45 src/tools/compat/nbtool_config.h.in

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

Modified files:

Index: src/tools/compat/Makefile
diff -u src/tools/compat/Makefile:1.83 src/tools/compat/Makefile:1.84
--- src/tools/compat/Makefile:1.83	Tue May  1 15:59:46 2018
+++ src/tools/compat/Makefile	Sat Aug 11 12:24:59 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.83 2018/05/01 19:59:46 christos Exp $
+#	$NetBSD: Makefile,v 1.84 2018/08/11 16:24:59 christos Exp $
 
 HOSTLIB=	nbcompat
 
@@ -19,7 +19,7 @@ SRCS=		atoll.c basename.c cdbr.c cdbw.c 
 		setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
 		sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
 		stat_flags.c strlcat.c strlcpy.c strmode.c \
-		strndup.c strnlen.c \
+		strcasecmp.c strndup.c strnlen.c \
 		strsep.c strsuftoll.c strtoll.c \
 		strtoi.c strtou.c \
 		unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.112 src/tools/compat/compat_defs.h:1.113
--- src/tools/compat/compat_defs.h:1.112	Wed Jun 13 00:17:43 2018
+++ src/tools/compat/compat_defs.h	Sat Aug 11 12:24:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.112 2018/06/13 04:17:43 maya Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.113 2018/08/11 16:24:59 christos Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -494,6 +494,9 @@ char		*strndup(const char *, size_t);
 #if !HAVE_DECL_STRNLEN
 size_t		strnlen(const char *, size_t);
 #endif
+#if !HAVE_DECL_STRCASECMP
+int		strcasecmp(const char *, const char *);
+#endif
 #if !HAVE_DECL_LCHFLAGS
 int		lchflags(const char *, unsigned long);
 #endif

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.90 src/tools/compat/configure:1.91
--- src/tools/compat/configure:1.90	Wed Jun 13 00:17:43 2018
+++ src/tools/compat/configure	Sat Aug 11 12:24:59 2018
@@ -5160,7 +5160,7 @@ for ac_func in atoll asprintf asnprintf 
 	pwrite raise_default_signal random reallocarr setenv \
 	setgroupent setprogname setpassent \
 	snprintb_m snprintf strlcat strlcpy strmode \
-	strndup strnlen strsep strsuftoll strtoi strtoll strtou \
+	strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \
 	user_from_uid uid_from_user vasprintf vasnprintf vsnprintf
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -5254,6 +5254,19 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_PWCACHE_GROUPDB $ac_have_decl
 _ACEOF
 
+ac_fn_c_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" "
+#include 
+
+"
+if test "x$ac_cv_have_decl_strcasecmp" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRCASECMP $ac_have_decl
+_ACEOF
 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "
 #include 
 

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.91 src/tools/compat/configure.ac:1.92
--- src/tools/compat/configure.ac:1.91	Wed Jun 13 00:17:43 2018
+++ src/tools/compat/configure.ac	Sat Aug 11 12:24:59 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.91 2018/06/13 04:17:43 maya Exp $
+#	$NetBSD: configure.ac,v 1.92 2018/08/11 16:24:59 christos Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -192,7 +192,7 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf 
 	pwrite raise_default_signal random reallocarr setenv \
 	setgroupent setprogname setpassent \
 	snprintb_m snprintf strlcat strlcpy strmode \
-	strndup strnlen strsep strsuftoll strtoi strtoll strtou \
+	strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \
 	user_from_uid uid_from_user vasprintf vasnprintf vsnprintf)
 
 AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[
@@ -201,7 +201,7 @@ AC_CHECK_DECLS([user_from_uid, uid_from_
 AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[
 #include 
 ])
-AC_CHECK_DECLS([strlcpy, strlcat, strndup, strnlen, strsep],,,[
+AC_CHECK_DECLS([strcasecmp, strlcpy, strlcat, strndup, strnlen, strsep],,,[
 #include 
 ])
 AC_CHECK_DECLS([strsuftoll, mi_vector_hash],,,[#include ])

Index: src/tools/compat/nbtool_config.h.in
diff -u src/tools/compat/nbtool_config.h.in:1.44 src/tools/compat/nbtool_config.h.in:1.45
--- src/tools/compat/nbtool_config.h.in:1.44	Wed Jun 13 00:17:43 2018
+++ src/tools/compat/nbtool_config.h.in	Sat Aug 11 12:24:59 2018
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac 

CVS commit: src/usr.bin/grep

2018-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 11 16:03:37 UTC 2018

Modified Files:
src/usr.bin/grep: file.c

Log Message:
remove dup includes (already in grep.h)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/grep/file.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/grep/file.c
diff -u src/usr.bin/grep/file.c:1.7 src/usr.bin/grep/file.c:1.8
--- src/usr.bin/grep/file.c:1.7	Mon Apr 18 18:46:48 2011
+++ src/usr.bin/grep/file.c	Sat Aug 11 12:03:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.7 2011/04/18 22:46:48 joerg Exp $	*/
+/*	$NetBSD: file.c,v 1.8 2018/08/11 16:03:37 christos Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/file.c 211496 2010-08-19 09:28:59Z des $	*/
 /*	$OpenBSD: file.c,v 1.11 2010/07/02 20:48:48 nicm Exp $	*/
 
@@ -35,13 +35,12 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: file.c,v 1.7 2011/04/18 22:46:48 joerg Exp $");
+__RCSID("$NetBSD: file.c,v 1.8 2018/08/11 16:03:37 christos Exp $");
 
 #include 
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -51,7 +50,6 @@ __RCSID("$NetBSD: file.c,v 1.7 2011/04/1
 #include 
 #include 
 #include 
-#include 
 
 #include "grep.h"
 



CVS commit: [netbsd-8] src/doc

2018-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 11 14:56:05 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Ticket #970


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/doc/CHANGES-8.1

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-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.9 src/doc/CHANGES-8.1:1.1.2.10
--- src/doc/CHANGES-8.1:1.1.2.9	Thu Aug  9 13:25:35 2018
+++ src/doc/CHANGES-8.1	Sat Aug 11 14:56:05 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.9 2018/08/09 13:25:35 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.10 2018/08/11 14:56:05 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -396,3 +396,84 @@ sys/fs/tmpfs/tmpfs_vfsops.c			1.73
 	Set the MP-safe flag for tmpfs early enough for the root vnode.
 	[christos, ticket #968]
 
+sys/dev/pci/if_wm.c1.584
+sys/dev/pci/if_wmvar.h1.39
+
+	- Print MDIC_WA and CLSEMWA workaround flags when boot.
+	- Fix a bug that the link can't detect in link interrupt function for 
+	  non-SERDES fiber.
+	- Fix a bug that 82542 misunderstand fiber's signal detection.	
+	[msaitoh, ticket #969]
+
+external/mit/lua/dist/README.import up to 1.2
+external/mit/lua/dist/READMEup to 1.8
+external/mit/lua/dist/doc/contents.html up to 1.7
+external/mit/lua/dist/doc/lua.css   up to 1.7
+external/mit/lua/dist/doc/manual.html   up to 1.8
+external/mit/lua/dist/doc/readme.html   up to 1.7
+external/mit/lua/dist/src/Makefile  up to 1.5
+external/mit/lua/dist/src/lapi.cup to 1.11
+external/mit/lua/dist/src/lapi.hup to 1.9
+external/mit/lua/dist/src/lauxlib.c up to 1.11
+external/mit/lua/dist/src/lauxlib.h up to 1.8
+external/mit/lua/dist/src/lbaselib.cup to 1.10
+external/mit/lua/dist/src/lbitlib.c up to 1.7
+external/mit/lua/dist/src/lcode.c   up to 1.11
+external/mit/lua/dist/src/lcode.h   up to 1.8
+external/mit/lua/dist/src/lcorolib.cup to 1.7
+external/mit/lua/dist/src/lctype.c  up to 1.7
+external/mit/lua/dist/src/lctype.h  up to 1.7
+external/mit/lua/dist/src/ldblib.c  up to 1.11
+external/mit/lua/dist/src/ldebug.c  up to 1.11
+external/mit/lua/dist/src/ldebug.h  up to 1.9
+external/mit/lua/dist/src/ldo.c up to 1.9
+external/mit/lua/dist/src/ldo.h up to 1.9
+external/mit/lua/dist/src/ldump.c   up to 1.9
+external/mit/lua/dist/src/lfunc.c   up to 1.8
+external/mit/lua/dist/src/lfunc.h   up to 1.8
+external/mit/lua/dist/src/lgc.c up to 1.10
+external/mit/lua/dist/src/lgc.h up to 1.8
+external/mit/lua/dist/src/linit.c   up to 1.9
+external/mit/lua/dist/src/liolib.c  up to 1.9
+external/mit/lua/dist/src/llex.cup to 1.12
+external/mit/lua/dist/src/llex.hup to 1.8
+external/mit/lua/dist/src/llimits.h up to 1.10
+external/mit/lua/dist/src/lmathlib.cup to 1.9
+external/mit/lua/dist/src/lmem.cup to 1.9
+external/mit/lua/dist/src/lmem.hup to 1.8
+external/mit/lua/dist/src/loadlib.c up to 1.9
+external/mit/lua/dist/src/lobject.c up to 1.12
+external/mit/lua/dist/src/lobject.h up to 1.10
+external/mit/lua/dist/src/lopcodes.cup to 1.8
+external/mit/lua/dist/src/lopcodes.hup to 1.8
+external/mit/lua/dist/src/loslib.c  up to 1.11
+external/mit/lua/dist/src/lparser.c up to 1.11
+external/mit/lua/dist/src/lparser.h up to 1.8
+external/mit/lua/dist/src/lprefix.h up to 1.7
+external/mit/lua/dist/src/lstate.c  up to 1.9
+external/mit/lua/dist/src/lstate.h  up to 1.9
+external/mit/lua/dist/src/lstring.c up to 1.9
+external/mit/lua/dist/src/lstring.h up to 1.9
+external/mit/lua/dist/src/lstrlib.c up to 1.18
+external/mit/lua/dist/src/ltable.c  up to 1.11
+external/mit/lua/dist/src/ltable.h  up to 1.8
+external/mit/lua/dist/src/ltablib.c up to 1.9
+external/mit/lua/dist/src/ltm.c up to 1.9
+external/mit/lua/dist/src/ltm.h up to 1.8
+external/mit/lua/dist/src/lua.c up to 1.9
+external/mit/lua/dist/src/lua.h up to 1.11
+external/mit/lua/dist/src/luac.cup to 1.10
+external/mit/lua/dist/src/luaconf.h up to 1.23
+external/mit/lua/dist/src/lualib.h  up to 1.7
+external/mit/lua/dist/src/lundump.c up to 1.8
+external/mit/lua/dist/src/lundump.h up to 1.7

CVS commit: [netbsd-8] src

2018-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 11 14:54:50 UTC 2018

Modified Files:
src/doc [netbsd-8]: 3RDPARTY
src/external/mit/lua/dist [netbsd-8]: README
src/external/mit/lua/dist/doc [netbsd-8]: contents.html lua.css
manual.html readme.html
src/external/mit/lua/dist/src [netbsd-8]: Makefile lapi.c lapi.h
lauxlib.c lauxlib.h lbaselib.c lbitlib.c lcode.c lcode.h lcorolib.c
lctype.c lctype.h ldblib.c ldebug.c ldebug.h ldo.c ldo.h ldump.c
lfunc.c lfunc.h lgc.c lgc.h linit.c liolib.c llex.c llex.h
llimits.h lmathlib.c lmem.c lmem.h loadlib.c lobject.c lobject.h
lopcodes.c lopcodes.h loslib.c lparser.c lparser.h lprefix.h
lstate.c lstate.h lstring.c lstring.h lstrlib.c ltable.c ltable.h
ltablib.c ltm.c ltm.h lua.c lua.h luac.c luaconf.h lualib.h
lundump.c lundump.h lutf8lib.c lvm.c lvm.h lzio.c lzio.h
Added Files:
src/external/mit/lua/dist [netbsd-8]: README.import

Log Message:
Pullup the following, requested by alnsn in ticket #970:

external/mit/lua/dist/README.import up to 1.2
external/mit/lua/dist/READMEup to 1.8
external/mit/lua/dist/doc/contents.html up to 1.7
external/mit/lua/dist/doc/lua.css   up to 1.7
external/mit/lua/dist/doc/manual.html   up to 1.8
external/mit/lua/dist/doc/readme.html   up to 1.7
external/mit/lua/dist/src/Makefile  up to 1.5
external/mit/lua/dist/src/lapi.cup to 1.11
external/mit/lua/dist/src/lapi.hup to 1.9
external/mit/lua/dist/src/lauxlib.c up to 1.11
external/mit/lua/dist/src/lauxlib.h up to 1.8
external/mit/lua/dist/src/lbaselib.cup to 1.10
external/mit/lua/dist/src/lbitlib.c up to 1.7
external/mit/lua/dist/src/lcode.c   up to 1.11
external/mit/lua/dist/src/lcode.h   up to 1.8
external/mit/lua/dist/src/lcorolib.cup to 1.7
external/mit/lua/dist/src/lctype.c  up to 1.7
external/mit/lua/dist/src/lctype.h  up to 1.7
external/mit/lua/dist/src/ldblib.c  up to 1.11
external/mit/lua/dist/src/ldebug.c  up to 1.11
external/mit/lua/dist/src/ldebug.h  up to 1.9
external/mit/lua/dist/src/ldo.c up to 1.9
external/mit/lua/dist/src/ldo.h up to 1.9
external/mit/lua/dist/src/ldump.c   up to 1.9
external/mit/lua/dist/src/lfunc.c   up to 1.8
external/mit/lua/dist/src/lfunc.h   up to 1.8
external/mit/lua/dist/src/lgc.c up to 1.10
external/mit/lua/dist/src/lgc.h up to 1.8
external/mit/lua/dist/src/linit.c   up to 1.9
external/mit/lua/dist/src/liolib.c  up to 1.9
external/mit/lua/dist/src/llex.cup to 1.12
external/mit/lua/dist/src/llex.hup to 1.8
external/mit/lua/dist/src/llimits.h up to 1.10
external/mit/lua/dist/src/lmathlib.cup to 1.9
external/mit/lua/dist/src/lmem.cup to 1.9
external/mit/lua/dist/src/lmem.hup to 1.8
external/mit/lua/dist/src/loadlib.c up to 1.9
external/mit/lua/dist/src/lobject.c up to 1.12
external/mit/lua/dist/src/lobject.h up to 1.10
external/mit/lua/dist/src/lopcodes.cup to 1.8
external/mit/lua/dist/src/lopcodes.hup to 1.8
external/mit/lua/dist/src/loslib.c  up to 1.11
external/mit/lua/dist/src/lparser.c up to 1.11
external/mit/lua/dist/src/lparser.h up to 1.8
external/mit/lua/dist/src/lprefix.h up to 1.7
external/mit/lua/dist/src/lstate.c  up to 1.9
external/mit/lua/dist/src/lstate.h  up to 1.9
external/mit/lua/dist/src/lstring.c up to 1.9
external/mit/lua/dist/src/lstring.h up to 1.9
external/mit/lua/dist/src/lstrlib.c up to 1.18
external/mit/lua/dist/src/ltable.c  up to 1.11
external/mit/lua/dist/src/ltable.h  up to 1.8
external/mit/lua/dist/src/ltablib.c up to 1.9
external/mit/lua/dist/src/ltm.c up to 1.9
external/mit/lua/dist/src/ltm.h up to 1.8
external/mit/lua/dist/src/lua.c up to 1.9
external/mit/lua/dist/src/lua.h up to 1.11
external/mit/lua/dist/src/luac.cup to 1.10

CVS commit: [netbsd-8] src/sys/dev/pci

2018-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 11 14:47:32 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmvar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #969):

sys/dev/pci/if_wm.c: revision 1.584
sys/dev/pci/if_wmvar.h: revision 1.39

Add MDIC_WA and CLSEMWA to snprintb() string for WM_F_* flags.

Fix two bugs for non-SERDES fiber. Tested on 82544EI(0x1009), 82545GM(0x1027),
82546GB(0x107a), 82571GB(0x105f), 82572EI(0x107e). Tested on SERDES
82580(0x150e (Winyao SERDES SFP)) and 82580(0x150e) as regression test:

- Fix a bug that the link can't detect in link interrupt function for
   non-SERDES fiber. When the signal is detected & STATUS_LU == 0 & RXCW == 0,
   it's required to set CTRL_SLU and CTRL_FD bit. wm_check_for_link() is the
   function to do it. If a link status change interrupt occurred, call
   wm_check_for_link() before checking current link status.

- Fix a bug that 82542 misunderstand fiber's signal detection. CTRL_SWDPIN(1)
   is used for fiber's signal and it's value is reversed only on 82543 and
   82544. Simplify the code and move it into a new function wm_tbi_havesignal()
   and use it.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.21 -r1.508.4.22 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.33.6.2 -r1.33.6.3 src/sys/dev/pci/if_wmvar.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.508.4.21 src/sys/dev/pci/if_wm.c:1.508.4.22
--- src/sys/dev/pci/if_wm.c:1.508.4.21	Thu Jul 26 20:40:39 2018
+++ src/sys/dev/pci/if_wm.c	Sat Aug 11 14:47:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.21 2018/07/26 20:40:39 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.22 2018/08/11 14:47:31 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.21 2018/07/26 20:40:39 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.22 2018/08/11 14:47:31 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -842,6 +842,7 @@ static bool	wm_sgmii_uses_mdio(struct wm
 static int	wm_sgmii_readreg(device_t, int, int);
 static void	wm_sgmii_writereg(device_t, int, int, int);
 /* TBI related */
+static bool	wm_tbi_havesignal(struct wm_softc *, uint32_t);
 static void	wm_tbi_mediainit(struct wm_softc *);
 static int	wm_tbi_mediachange(struct ifnet *);
 static void	wm_tbi_mediastatus(struct ifnet *, struct ifmediareq *);
@@ -8755,6 +8756,7 @@ wm_linkintr_tbi(struct wm_softc *sc, uin
 
 	status = CSR_READ(sc, WMREG_STATUS);
 	if (icr & ICR_LSC) {
+		wm_check_for_link(sc);
 		if (status & STATUS_LU) {
 			DPRINTF(WM_DEBUG_LINK, ("%s: LINK: LSC -> up %s\n",
 device_xname(sc->sc_dev),
@@ -10962,6 +10964,23 @@ wm_sgmii_writereg(device_t dev, int phy,
 
 /* TBI related */
 
+static bool
+wm_tbi_havesignal(struct wm_softc *sc, uint32_t ctrl)
+{
+	bool sig;
+
+	sig = ctrl & CTRL_SWDPIN(1);
+
+	/*
+	 * On 82543 and 82544, the CTRL_SWDPIN(1) bit will be 0 if the optics
+	 * detect a signal, 1 if they don't.
+	 */
+	if ((sc->sc_type == WM_T_82543) || (sc->sc_type == WM_T_82544))
+		sig = !sig;
+
+	return sig;
+}
+
 /*
  * wm_tbi_mediainit:
  *
@@ -11053,9 +11072,11 @@ wm_tbi_mediachange(struct ifnet *ifp)
 {
 	struct wm_softc *sc = ifp->if_softc;
 	struct ifmedia_entry *ife = sc->sc_mii.mii_media.ifm_cur;
-	uint32_t status;
+	uint32_t status, ctrl;
+	bool signal;
 	int i;
 
+	KASSERT(sc->sc_mediatype != WM_MEDIATYPE_COPPER);
 	if (sc->sc_mediatype == WM_MEDIATYPE_SERDES) {
 		/* XXX need some work for >= 82571 and < 82575 */
 		if (sc->sc_type < WM_T_82575)
@@ -11085,14 +11106,13 @@ wm_tbi_mediachange(struct ifnet *ifp)
 	CSR_WRITE_FLUSH(sc);
 	delay(1000);
 
-	i = CSR_READ(sc, WMREG_CTRL) & CTRL_SWDPIN(1);
-	DPRINTF(WM_DEBUG_LINK,("%s: i = 0x%x\n", device_xname(sc->sc_dev),i));
+	ctrl =  CSR_READ(sc, WMREG_CTRL);
+	signal = wm_tbi_havesignal(sc, ctrl);
 
-	/*
-	 * On 82544 chips and later, the CTRL_SWDPIN(1) bit will be set if the
-	 * optics detect a signal, 0 if they don't.
-	 */
-	if (((i != 0) && (sc->sc_type > WM_T_82544)) || (i == 0)) {
+	DPRINTF(WM_DEBUG_LINK, ("%s: signal = %d\n", device_xname(sc->sc_dev),
+		signal));
+
+	if (signal) {
 		/* Have signal; wait for the link to come up. */
 		for (i = 0; i < WM_LINKUP_TIMEOUT; i++) {
 			delay(1);
@@ -11198,7 +11218,10 @@ wm_check_for_link(struct wm_softc *sc)
 	uint32_t rxcw;
 	uint32_t ctrl;
 	uint32_t status;
-	uint32_t sig;
+	bool signal;
+
+	DPRINTF(WM_DEBUG_LINK, ("%s: %s called\n",
+		device_xname(sc->sc_dev), __func__));
 
 	if (sc->sc_mediatype == WM_MEDIATYPE_SERDES) {
 		/* XXX need some work for >= 82571 */
@@ -11211,13 +11234,11 @@ wm_check_for_link(struct wm_softc *sc)
 	rxcw = CSR_READ(sc, WMREG_RXCW);
 	ctrl = CSR_READ(sc, WMREG_CTRL);
 	status = CSR_READ(sc, 

CVS commit: [netbsd-7] src/doc

2018-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 11 13:36:49 UTC 2018

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

Log Message:
Ticket #1628


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.102 -r1.1.2.103 src/doc/CHANGES-7.2

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

Modified files:

Index: src/doc/CHANGES-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.102 src/doc/CHANGES-7.2:1.1.2.103
--- src/doc/CHANGES-7.2:1.1.2.102	Thu Aug  9 14:39:22 2018
+++ src/doc/CHANGES-7.2	Sat Aug 11 13:36:49 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.102 2018/08/09 14:39:22 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.103 2018/08/11 13:36:49 martin Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5844,3 +5844,115 @@ lib/libcurses/addbytes.c			1.48
 	to the last column.
 	[simonb, ticket #1627]
 
+share/man/man4/wm.41.40 via patch
+sys/dev/mii/ihphyreg.h1.2
+sys/dev/mii/inbmphyreg.h			1.10
+sys/dev/pci/if_wm.c1.504, 1.506, 1.510-1.535, 1.539-1.540, 1.546, 1.548, 1.551-1.552, 1.558, 1.565-1.573, 1.575, 1.579, 1.582, 1.584 via patch
+sys/dev/pci/if_wmreg.h1.99-1.103, 1.106-1.107 via patch
+sys/dev/pci/if_wmvar.h1.34-1.39 via patch
+sys/dev/pci/pcidevs1.1327 via patch
+sys/dev/pci/pcidevs.hregen
+sys/dev/pci/pcidevs_data.h			regen
+sys/dev/pci/pcireg.hpatch
+
+	Sync wm(4) up to 2018/08/08 except MSI/MSI-X and NET_MPSAFE:
+	- remove extra "+"
+	- Fix a bug that non-GMII devices don't send a routing message when
+	  the link status is changed.
+	- Set WMREG_KABGTXD not in wm_init_locked() but in wm_reset(). Same as
+	  other OSes.
+	- If a interrupt is a spurious interrupt, don't print debug message.
+	- Don't print the Image Unique ID if an NVM is iNVM (i210 and I211).
+	- Print sc_flags with snprintb().
+	- Fix a bug that a RAL was written at incorrect address when the index
+	  number is more than 16 on 82544 and newer.
+	- The layout of RAL on PCH* are different from others. Fix it.
+	- Flush every MTA write. Same as Linux.
+	- Move the location of calling wm_set_filter. Same as some other OSes.
+	- Add CSR_WRITE_FLUSH() after writing WMREG_CTRL in
+	  wm_gmii_mediachange().
+	- Add missing "else" in wm_nvm_release().
+	- Make new wm_phy_post_reset() and use this function at all location
+	  after resetting phy.
+	- Move the location of calling wm_get_hw_control. Same as Linux.
+	- Add I219 specific wokaround for legacy interrupt. From OpenBSD.
+	- Move the location of calling wm_lplu_d0_disable().
+	- Fix latency calculation in wm_platform_pm_pch_lpt().
+	- Set OBFF water mark and enable OBFF on PCH_LPT and newer.
+	- Disable D0 LPLU on 8257[12356], 82580, I350 and I21[01], too.	Before
+	  this commit, above devices and non-PCIe devices accessed wrong
+	  register.
+	- Use device_printf() instead of aprint_error_dev() for PHY read/write
+	  functions because those are used not only in device attach.
+	- Fix a bug that wm_gmii_i82544_{read,write}reg() didn't take care of
+	  page select. PHY access from igphy() automatically did it, but
+	  accessing from wm(4) for wrokaround didn't work correctly. This
+	  change affects 8254[17], 8257[12] ICH8, ICH9 and ICH10.
+	- Call wm_kmrn_lock_loss_workaround_ich8lan() before any PHY access in
+	  wm_linkintr_gmii().
+	- Register access in wm_kmrn_lock_loss_workaround_ich8lan() now works
+	  correctly. Enable this function.
+	- Configure the LCD with the extended configuration region in NVM if
+	  it's required.
+	- If TX is not required to flush, RX is also not required to flush
+	  in wm_flush_desc_rings(). Same as other OSes.
+	- Remove wrong semaphore access in wm_nvm_{read,write}_{ich8,spt} to
+	  prevent hangup. A semaphore is get/put in wm_nvm_{read,write}.
+	- Move some initialization stuff in wm_attach() before wm_reset(). Some
+	  flags and callback function are required to set correctly before
+	  wm_reset() because wm_reset() and some helper functions refer them.
+	- Add wm_write_smbus_addr() to set SMBus address by software.
+	- Modify wm_gmii_hv_{read,write}reg_locked() to make them access
+	  HV_SMB_ADDR correctly.
+	- Use new nvm.{acquire,release}() for semaphore.
+	- Our MII readreg/writereg API has not way to detect an error.
+	  kmrn_{read,write}reg() are not used for MII API, so it's not required
+	  for these functions to use the same API. So,
+	  - Change return value as error code.
+	  - Change register value from int to uint16_t.
+	  - read: pass pointer for uint16_t as an argument.
+	  - Check return value on caller side.
+	- Check whether it's required to use MDIC workaround for 80003 or not
+	  in wm_reset(). If the workaround isn't required, don't use the
+	  workaround code in wm_gmii_i80003_{read,write}reg.
+	- Add WM_F_WA_I210_CLSEM flag for a workaround. FreeBSD/Linux drivers
+	  say "In rare circumstances, the SW semaphore may already be held
+	  unintentionally on 

CVS commit: src/sys/arch/aarch64/aarch64

2018-08-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 11 12:16:34 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
change to minimum invalidation of TLB.
specifying not only va but also asid, and not invalidate L0-L2 entry using 
tlbi_*_ll() if needed.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/aarch64/pmap.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.18 src/sys/arch/aarch64/aarch64/pmap.c:1.19
--- src/sys/arch/aarch64/aarch64/pmap.c:1.18	Fri Aug 10 21:06:42 2018
+++ src/sys/arch/aarch64/aarch64/pmap.c	Sat Aug 11 12:16:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.18 2018/08/10 21:06:42 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.19 2018/08/11 12:16:34 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.18 2018/08/10 21:06:42 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.19 2018/08/11 12:16:34 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -154,6 +154,41 @@ PMAP_COUNTER(unwire_failure, "pmap_unwir
 #define LX_BLKPAG_ATTR_DEVICE_MEM	__SHIFTIN(3, LX_BLKPAG_ATTR_INDX)
 #define LX_BLKPAG_ATTR_MASK		LX_BLKPAG_ATTR_INDX
 
+/*
+ * invalidate TLB entry for ASID and VA.
+ * `ll' invalidates only the Last Level (usually L3) of TLB entry
+ */
+#define AARCH64_TLBI_BY_ASID_VA(asid, va, ll)\
+	do {\
+		if ((ll)) {		\
+			if ((asid) == 0)\
+aarch64_tlbi_by_va_ll((va));		\
+			else		\
+aarch64_tlbi_by_asid_va_ll((asid), (va)); \
+		} else {		\
+			if ((asid) == 0)\
+aarch64_tlbi_by_va((va));		\
+			else		\
+aarch64_tlbi_by_asid_va((asid), (va));	\
+		}			\
+	} while (0/*CONSTCOND*/)
+
+/*
+ * aarch64 require write permission in pte to invalidate instruction cache.
+ * changing pte to writable temporarly before cpu_icache_sync_range().
+ * this macro modifies PTE (*ptep). need to update PTE after this.
+ */
+#define PTE_ICACHE_SYNC_PAGE(pte, ptep, pm, va, ll)			\
+	do {\
+		pt_entry_t tpte;	\
+		tpte = (pte) & ~(LX_BLKPAG_AF|LX_BLKPAG_AP);		\
+		tpte |= (LX_BLKPAG_AF|LX_BLKPAG_AP_RW);			\
+		tpte |= (LX_BLKPAG_UXN|LX_BLKPAG_PXN);			\
+		atomic_swap_64((ptep), tpte);\
+		AARCH64_TLBI_BY_ASID_VA((pm)->pm_asid, (va), (ll));	\
+		cpu_icache_sync_range((va), PAGE_SIZE);			\
+	} while (0/*CONSTCOND*/)
+
 struct pv_entry {
 	TAILQ_ENTRY(pv_entry) pv_link;
 	struct pmap *pv_pmap;
@@ -267,12 +302,19 @@ _pmap_map_chunk(pd_entry_t *l2, vaddr_t 
 
 		pte = pa | attr;
 
+		if (prot & VM_PROT_EXECUTE) {
+			pt_entry_t tpte;
+			/* need write permission to invalidate icache */
+			tpte = pte & ~(LX_BLKPAG_AF|LX_BLKPAG_AP);
+			tpte |= (LX_BLKPAG_AF|LX_BLKPAG_AP_RW);
+			tpte |= (LX_BLKPAG_UXN|LX_BLKPAG_PXN);
+			atomic_swap_64([l2pde_index(va)], tpte);
+			aarch64_tlbi_by_va(va);
+			cpu_icache_sync_range(va, L2_SIZE);
+		}
 		atomic_swap_64([l2pde_index(va)], pte);
 		aarch64_tlbi_by_va(va);
 
-		if (prot & VM_PROT_EXECUTE)
-			cpu_icache_sync_range(va, L2_SIZE);
-
 		va += L2_SIZE;
 		pa += L2_SIZE;
 		resid -= L2_SIZE;
@@ -1088,12 +1130,7 @@ _pmap_protect_pv(struct vm_page *pg, str
 	/* new prot = prot & pteprot & mdattr */
 	pte = _pmap_pte_adjust_prot(pte, prot & pteprot, mdattr, user);
 	atomic_swap_64(ptep, pte);
-
-#if 0
-	aarch64_tlbi_by_asid_va(pv->pv_pmap->pm_asid, pv->pv_va);
-#else
-	aarch64_tlbi_by_va(pv->pv_va);
-#endif
+	AARCH64_TLBI_BY_ASID_VA(pv->pv_pmap->pm_asid, pv->pv_va, true);
 
 	pm_unlock(pv->pv_pmap);
 }
@@ -1178,31 +1215,17 @@ pmap_protect(struct pmap *pm, vaddr_t sv
 			"pm=%p, va=%016lx, pte: %016lx -> %016lx",
 			pm, va, opte, pte);
 			if (!l3pte_writable(pte)) {
-/*
- * require write permission for cleaning dcache
- * (cpu_icache_sync_range)
- */
-pt_entry_t tpte;
-
-tpte = pte & ~(LX_BLKPAG_AF|LX_BLKPAG_AP);
-tpte |= (LX_BLKPAG_AF|LX_BLKPAG_AP_RW);
-tpte |= (LX_BLKPAG_UXN|LX_BLKPAG_PXN);
-atomic_swap_64(ptep, tpte);
-aarch64_tlbi_by_va(va);
-
-cpu_icache_sync_range(va, PAGE_SIZE);
-
+PTE_ICACHE_SYNC_PAGE(pte, ptep, pm, va, true);
 atomic_swap_64(ptep, pte);
-aarch64_tlbi_by_va(va);
+AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true);
 			} else {
 atomic_swap_64(ptep, pte);
-aarch64_tlbi_by_va(va);
-
+AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true);
 cpu_icache_sync_range(va, PAGE_SIZE);
 			}
 		} else {
 			atomic_swap_64(ptep, pte);
-			aarch64_tlbi_by_va(va);
+			AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true);
 		}
 	}
 
@@ -1332,6 +1355,7 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 	int error = 0;
 	const bool user = (pm != pmap_kernel());
 	bool executable;
+	bool l3only = true;
 
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLED(pmaphist);
@@ -1395,6 +1419,7 @@ _pmap_enter(struct pmap *pm, 

CVS commit: src/sys/sys

2018-08-11 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 11 11:33:10 UTC 2018

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

Log Message:
Remove unused symbols from 

Drop: P_PAXMPROTECT and P_PAXNOMPROTECT.

These values are unused and the proper way to check PaX MPROTECT is to use
CTL_PROC.pid().PROC_PID_PAXFLAGS and check CTL_PROC_PAXFLAGS_MPROTECT.

Proposed on current-users@.
OK from 


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/sys/sys/sysctl.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/sysctl.h
diff -u src/sys/sys/sysctl.h:1.226 src/sys/sys/sysctl.h:1.227
--- src/sys/sys/sysctl.h:1.226	Wed May 16 20:21:39 2018
+++ src/sys/sys/sysctl.h	Sat Aug 11 11:33:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.h,v 1.226 2018/05/16 20:21:39 joerg Exp $	*/
+/*	$NetBSD: sysctl.h,v 1.227 2018/08/11 11:33:10 kamil Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -632,8 +632,6 @@ struct kinfo_proc2 {
 #define	P_STOPEXEC		0x0100
 #define	P_STOPEXIT		0x0200
 #define	P_SYSCALL		0x0400
-#define	P_PAXMPROTECT		0x0800
-#define	P_PAXNOMPROTECT		0x1000
 
 /*
  * LWP compat flags.



CVS commit: src/sys/arch/xen/xen

2018-08-11 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Aug 11 10:34:25 UTC 2018

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
disestablish interrupt handler regardless of the state whenever it was
setup, i.e. also when the instance is DISCONNECTING already

fixes PR port-xen/53487 by Bert Kiers; fix found and reported by
Dennis Lindroos

XXX pullup netbsd-8


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.67 src/sys/arch/xen/xen/xennetback_xenbus.c:1.68
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.67	Thu Aug  9 17:32:44 2018
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Aug 11 10:34:25 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.67 2018/08/09 17:32:44 maxv Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.68 2018/08/11 10:34:25 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.67 2018/08/09 17:32:44 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.68 2018/08/11 10:34:25 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -383,8 +383,7 @@ xennetback_xenbus_destroy(void *arg)
 
 	aprint_verbose_ifnet(>xni_if, "disconnecting\n");
 
-	if (xneti->xni_status == CONNECTED) {
-		KASSERT(xneti->xni_ih);
+	if (xneti->xni_ih != NULL) {
 		hypervisor_mask_event(xneti->xni_evtchn);
 		intr_disestablish(xneti->xni_ih);
 		xneti->xni_ih = NULL;



CVS commit: src/sys/arch

2018-08-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Aug 11 10:20:44 UTC 2018

Modified Files:
src/sys/arch/arm/vexpress: files.vexpress
src/sys/arch/evbarm/conf: files.vexpress

Log Message:
Fix VEXPRESS_A15 build


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/vexpress/files.vexpress
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/files.vexpress

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/vexpress/files.vexpress
diff -u src/sys/arch/arm/vexpress/files.vexpress:1.5 src/sys/arch/arm/vexpress/files.vexpress:1.6
--- src/sys/arch/arm/vexpress/files.vexpress:1.5	Sat Mar 17 18:34:09 2018
+++ src/sys/arch/arm/vexpress/files.vexpress	Sat Aug 11 10:20:44 2018
@@ -1,20 +1,9 @@
-#	$NetBSD: files.vexpress,v 1.5 2018/03/17 18:34:09 ryo Exp $
+#	$NetBSD: files.vexpress,v 1.6 2018/08/11 10:20:44 jmcneill Exp $
 #
 # Configuration info for ARM Ltd. Versatile Express peripherals
 #
 #
 
-include	"arch/arm/pic/files.pic"
-include	"arch/arm/cortex/files.cortex"
-
-file	arch/arm/arm32/arm32_boot.c
-file	arch/arm/arm32/arm32_kvminit.c
-file	arch/arm/arm32/arm32_reboot.c
-file	arch/arm/arm32/irq_dispatch.S
-file	arch/arm/arm32/armv7_generic_space.c
-file	arch/arm/arm/arm_generic_dma.c
-file	arch/arm/arm/bus_space_a4x.S
-
 file	arch/arm/vexpress/vexpress_platform.c
 
 device	vxsysreg

Index: src/sys/arch/evbarm/conf/files.vexpress
diff -u src/sys/arch/evbarm/conf/files.vexpress:1.3 src/sys/arch/evbarm/conf/files.vexpress:1.4
--- src/sys/arch/evbarm/conf/files.vexpress:1.3	Fri Jun  2 15:22:47 2017
+++ src/sys/arch/evbarm/conf/files.vexpress	Sat Aug 11 10:20:44 2018
@@ -1,8 +1,19 @@
-#	$NetBSD: files.vexpress,v 1.3 2017/06/02 15:22:47 jmcneill Exp $
+#	$NetBSD: files.vexpress,v 1.4 2018/08/11 10:20:44 jmcneill Exp $
 #
 # Versatile Express board configuration info
 #
 
+include "arch/arm/pic/files.pic"
+include "arch/arm/cortex/files.cortex"
+
+file	arch/arm/arm32/arm32_boot.c
+file	arch/arm/arm32/arm32_kvminit.c
+file	arch/arm/arm32/arm32_reboot.c
+file	arch/arm/arm32/irq_dispatch.S
+file	arch/arm/arm32/armv7_generic_space.c
+file	arch/arm/arm/arm_generic_dma.c
+file	arch/arm/arm/bus_space_a4x.S
+
 include "arch/evbarm/conf/files.fdt"
 
 include "arch/arm/vexpress/files.vexpress"



CVS commit: src/lib/libc/arch/aarch64/softfloat

2018-08-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 11 10:06:41 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/softfloat: qp.c

Log Message:
fix multiple definition of __{ge,lt,gt,le,eq,ne,unordt}tf2 in libc and libgcc.
this fixes the ATF call_once_static, call_once2_static, cxxruntime_static, 
static_destructor_static.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/softfloat/qp.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/arch/aarch64/softfloat/qp.c
diff -u src/lib/libc/arch/aarch64/softfloat/qp.c:1.1 src/lib/libc/arch/aarch64/softfloat/qp.c:1.2
--- src/lib/libc/arch/aarch64/softfloat/qp.c:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/softfloat/qp.c	Sat Aug 11 10:06:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: qp.c,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: qp.c,v 1.2 2018/08/11 10:06:40 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -47,13 +47,13 @@ long double __multf3(long double, long d
 long double __negtf2(long double);
 long double __subtf3(long double, long double);
 
-int __getf2(long double, long double);
-int __lttf2(long double, long double);
-int __gttf2(long double, long double);
-int __letf2(long double, long double);
-int __eqtf2(long double, long double);
-int __netf2(long double, long double);
-int __unordtf2(long double, long double);
+int __libc_getf2(long double, long double);
+int __libc_lttf2(long double, long double);
+int __libc_gttf2(long double, long double);
+int __libc_letf2(long double, long double);
+int __libc_eqtf2(long double, long double);
+int __libc_netf2(long double, long double);
+int __libc_unordtf2(long double, long double);
 
 double __trunctfdf2(long double);
 float __trunctfsf2(long double);
@@ -182,8 +182,18 @@ _Qp_cmpe(float128 *a, float128 *b)
 }
 #endif
 
+#ifdef __weak_alias
+__weak_alias(__eqtf2, __libc_eqtf2)
+__weak_alias(__getf2, __libc_getf2)
+__weak_alias(__gttf2, __libc_gttf2)
+__weak_alias(__letf2, __libc_letf2)
+__weak_alias(__lttf2, __libc_lttf2)
+__weak_alias(__netf2, __libc_netf2)
+__weak_alias(__unordtf2, __libc_unordtf2)
+#endif
+
 int
-__eqtf2(long double ld_a, long double ld_b)
+__libc_eqtf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -192,7 +202,7 @@ __eqtf2(long double ld_a, long double ld
 }
 
 int
-__getf2(long double ld_a, long double ld_b)
+__libc_getf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -201,7 +211,7 @@ __getf2(long double ld_a, long double ld
 }
 
 int
-__gttf2(long double ld_a, long double ld_b)
+__libc_gttf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -210,7 +220,7 @@ __gttf2(long double ld_a, long double ld
 }
 
 int
-__letf2(long double ld_a, long double ld_b)
+__libc_letf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -219,7 +229,7 @@ __letf2(long double ld_a, long double ld
 }
 
 int
-__lttf2(long double ld_a, long double ld_b)
+__libc_lttf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -228,7 +238,7 @@ __lttf2(long double ld_a, long double ld
 }
 
 int
-__netf2(long double ld_a, long double ld_b)
+__libc_netf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -363,7 +373,7 @@ __floatditf(int64_t a)
 }
 
 int
-__unordtf2(long double ld_a, long double ld_b)
+__libc_unordtf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };