CVS commit: src/sys/arch

2018-12-21 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Dec 22 07:45:59 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: amd64_mainbus.c
src/sys/arch/amd64/conf: XEN3_DOM0 files.amd64
src/sys/arch/i386/conf: XEN3PAE_DOM0 files.i386
src/sys/arch/i386/i386: i386_mainbus.c
src/sys/arch/x86/include: autoconf.h
src/sys/arch/xen/conf: files.xen
src/sys/arch/xen/x86: autoconf.c xen_mainbus.c
Added Files:
src/sys/arch/x86/x86: mainbus.c

Log Message:
This change modifies the mainbus(4) entry point for all x86 sub-archs
in the following way:

i) It provides a unified entry point in
   x86/x86/mainbus.c:mainbus_attach()
ii) It carves out the preliminary bus attachment sequence that is
   common to all sub-archs into
   x86/x86/mainbus.c: x86_cpubus_attach()
iii) It consolidates the remaining pathways as internal callee
   functions so that these may be called piecemeal if required. A
   special usecase of this is XEN PVHVM which may need to call the
   native configure path, the xen configure path, or both.
iv) It moves the driver private data structures from
   i386/i386_mainbus.c to an x86/ level one. This allows for other
   sub-arch's to do similar, if needed. (They do not at the moment).
v) For dom0 kernels, it enables 'acpi0 at mainbus?' and
   'acpi0 at hypervisorbus'. This serves two purposes:
   a) To demonstrate the possibility of dynamic configuration tree
  traversal ordering changes.
   b) To allow for the common acpi_check(self, "acpibus") call in
   x86/mainbus.c to not barf when it is called from the dom0 attach
   path. We allow for the acpi0 device to be a child of mainbus with
   the changes to amd64/conf/XEN3_DOM0 and i386/conf/XEN3PAE_DOM0
   without actually probing further in the code. This path will later
   be pursued in a PVHVM boot codepath.

There should be no operative changes with this change. If there are,
please complain loudly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amd64/amd64/amd64_mainbus.c
cvs rdiff -u -r1.160 -r1.161 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.398 -r1.399 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/i386/i386_mainbus.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/include/autoconf.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/mainbus.c
cvs rdiff -u -r1.171 -r1.172 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/xen/x86/autoconf.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/x86/xen_mainbus.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/amd64/amd64/amd64_mainbus.c
diff -u src/sys/arch/amd64/amd64/amd64_mainbus.c:1.2 src/sys/arch/amd64/amd64/amd64_mainbus.c:1.3
--- src/sys/arch/amd64/amd64/amd64_mainbus.c:1.2	Sat Dec 22 06:59:27 2018
+++ src/sys/arch/amd64/amd64/amd64_mainbus.c	Sat Dec 22 07:45:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $	*/
+/*	$NetBSD: amd64_mainbus.c,v 1.3 2018/12/22 07:45:58 cherry Exp $	*/
 /*	NetBSD: mainbus.c,v 1.39 2018/12/02 08:19:44 cherry Exp 	*/
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amd64_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_mainbus.c,v 1.3 2018/12/22 07:45:58 cherry Exp $");
 
 #include 
 #include 
@@ -83,15 +83,11 @@ __KERNEL_RCSID(0, "$NetBSD: amd64_mainbu
  * XXXfvdl ACPI
  */
 
-int	mainbus_match(device_t, cfdata_t, void *);
-void	mainbus_attach(device_t, device_t, void *);
+int	amd64_mainbus_match(device_t, cfdata_t, void *);
+void	amd64_mainbus_attach(device_t, device_t, void *);
+int	amd64_mainbus_print(void *, const char *);
 
-CFATTACH_DECL_NEW(mainbus, 0,
-mainbus_match, mainbus_attach, NULL, NULL);
-
-int	mainbus_print(void *, const char *);
-
-union mainbus_attach_args {
+union amd64_mainbus_attach_args {
 	const char *mba_busname;		/* first elem of all */
 	struct pcibus_attach_args mba_pba;
 	struct isabus_attach_args mba_iba;
@@ -128,8 +124,8 @@ int mp_nintr;
 int mp_isa_bus = -1;
 int mp_eisa_bus = -1;
 
-bool acpi_present;
-bool mpacpi_active;
+extern bool acpi_present;
+extern bool mpacpi_active;
 
 # ifdef MPVERBOSE
 #  if MPVERBOSE > 0
@@ -147,7 +143,7 @@ int mp_verbose = 0;
  * Probe for the mainbus; always succeeds.
  */
 int
-mainbus_match(device_t parent, cfdata_t match, void *aux)
+amd64_mainbus_match(device_t parent, cfdata_t match, void *aux)
 {
 
 	return 1;
@@ -157,82 +153,10 @@ mainbus_match(device_t parent, cfdata_t 
  * Attach the mainbus.
  */
 void
-mainbus_attach(device_t parent, device_t self, void *aux)
+amd64_mainbus_attach(device_t parent, device_t self, void *aux)
 {
 #if NPCI > 0 || NACPICA > 0 || 

CVS commit: src/sys/arch

2018-12-21 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Dec 22 06:59:27 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: amd64_mainbus.c
src/sys/arch/i386/i386: i386_mainbus.c
src/sys/arch/xen/x86: xen_mainbus.c

Log Message:
Don't forget pedigree. Re-introduce old RCS Id tags from the originals


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amd64/amd64/amd64_mainbus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/i386/i386_mainbus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/x86/xen_mainbus.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/amd64/amd64/amd64_mainbus.c
diff -u src/sys/arch/amd64/amd64/amd64_mainbus.c:1.1 src/sys/arch/amd64/amd64/amd64_mainbus.c:1.2
--- src/sys/arch/amd64/amd64/amd64_mainbus.c:1.1	Sat Dec 22 06:33:36 2018
+++ src/sys/arch/amd64/amd64/amd64_mainbus.c	Sat Dec 22 06:59:27 2018
@@ -1,5 +1,5 @@
-/*	$NetBSD: amd64_mainbus.c,v 1.1 2018/12/22 06:33:36 cherry Exp $	*/
-
+/*	$NetBSD: amd64_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $	*/
+/*	NetBSD: mainbus.c,v 1.39 2018/12/02 08:19:44 cherry Exp 	*/
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
  *
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amd64_mainbus.c,v 1.1 2018/12/22 06:33:36 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $");
 
 #include 
 #include 

Index: src/sys/arch/i386/i386/i386_mainbus.c
diff -u src/sys/arch/i386/i386/i386_mainbus.c:1.1 src/sys/arch/i386/i386/i386_mainbus.c:1.2
--- src/sys/arch/i386/i386/i386_mainbus.c:1.1	Sat Dec 22 06:33:36 2018
+++ src/sys/arch/i386/i386/i386_mainbus.c	Sat Dec 22 06:59:27 2018
@@ -1,4 +1,5 @@
-/*	$NetBSD: i386_mainbus.c,v 1.1 2018/12/22 06:33:36 cherry Exp $	*/
+/*	$NetBSD: i386_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $	*/
+/*	NetBSD: mainbus.c,v 1.104 2018/12/02 08:19:44 cherry Exp 	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i386_mainbus.c,v 1.1 2018/12/22 06:33:36 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $");
 
 #include 
 #include 

Index: src/sys/arch/xen/x86/xen_mainbus.c
diff -u src/sys/arch/xen/x86/xen_mainbus.c:1.1 src/sys/arch/xen/x86/xen_mainbus.c:1.2
--- src/sys/arch/xen/x86/xen_mainbus.c:1.1	Sat Dec 22 06:33:37 2018
+++ src/sys/arch/xen/x86/xen_mainbus.c	Sat Dec 22 06:59:27 2018
@@ -1,4 +1,5 @@
-/*	$NetBSD: xen_mainbus.c,v 1.1 2018/12/22 06:33:37 cherry Exp $	*/
+/*	$NetBSD: xen_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $	*/
+/*	NetBSD: mainbus.c,v 1.19 2017/05/23 08:54:39 nonaka Exp 	*/
 /*	NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp 	*/
 
 /*
@@ -32,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_mainbus.c,v 1.1 2018/12/22 06:33:37 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_mainbus.c,v 1.2 2018/12/22 06:59:27 cherry Exp $");
 
 #include 
 #include 



CVS commit: src/sys/arch

2018-12-21 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Dec 22 06:33:37 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/xen/conf: files.xen
Added Files:
src/sys/arch/amd64/amd64: amd64_mainbus.c
src/sys/arch/i386/i386: i386_mainbus.c
src/sys/arch/xen/x86: xen_mainbus.c
Removed Files:
src/sys/arch/amd64/amd64: mainbus.c
src/sys/arch/i386/i386: mainbus.c
src/sys/arch/xen/x86: mainbus.c

Log Message:
Move mainbus(4) driver files in various x86 sub-archs to name prefixed
versions. This allows us to further modularise them by unifying common
bus probe code in x86/x86/mainbus.c to  be introduced next.

This commit has no functional changes. It is done for ease of
visibility of newer diffs in the queue.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/amd64/amd64/amd64_mainbus.c
cvs rdiff -u -r1.39 -r0 src/sys/arch/amd64/amd64/mainbus.c
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.397 -r1.398 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/i386/i386_mainbus.c
cvs rdiff -u -r1.104 -r0 src/sys/arch/i386/i386/mainbus.c
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.19 -r0 src/sys/arch/xen/x86/mainbus.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/xen/x86/xen_mainbus.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/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.108 src/sys/arch/amd64/conf/files.amd64:1.109
--- src/sys/arch/amd64/conf/files.amd64:1.108	Mon Dec  3 00:12:22 2018
+++ src/sys/arch/amd64/conf/files.amd64	Sat Dec 22 06:33:36 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.108 2018/12/03 00:12:22 christos Exp $
+#	$NetBSD: files.amd64,v 1.109 2018/12/22 06:33:36 cherry Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -94,7 +94,7 @@ include	"dev/i2o/files.i2o"
 # XXX BIOS32 only if something that uses it is configured!
 device	mainbus: isabus, pcibus, bios32, acpibus, cpubus, ioapicbus, ipmibus
 attach	mainbus at root
-file	arch/amd64/amd64/mainbus.c		mainbus
+file	arch/amd64/amd64/amd64_mainbus.c	mainbus
 
 #
 # PCI-only drivers

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.397 src/sys/arch/i386/conf/files.i386:1.398
--- src/sys/arch/i386/conf/files.i386:1.397	Mon Dec  3 00:11:39 2018
+++ src/sys/arch/i386/conf/files.i386	Sat Dec 22 06:33:36 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.397 2018/12/03 00:11:39 christos Exp $
+#	$NetBSD: files.i386,v 1.398 2018/12/22 06:33:36 cherry Exp $
 #
 # new style config file for i386 architecture
 #
@@ -129,7 +129,7 @@ device	mainbus: isabus, eisabus, mcabus,
 	cpubus, ioapicbus, apmbus, pnpbiosbus, ipmibus,
 	bioscall
 attach	mainbus at root
-file	arch/i386/i386/mainbus.c	mainbus
+file	arch/i386/i386/i386_mainbus.c	mainbus
 
 #
 # PCI-only drivers

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.170 src/sys/arch/xen/conf/files.xen:1.171
--- src/sys/arch/xen/conf/files.xen:1.170	Thu Jul 26 15:38:26 2018
+++ src/sys/arch/xen/conf/files.xen	Sat Dec 22 06:33:37 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.170 2018/07/26 15:38:26 maxv Exp $
+#	$NetBSD: files.xen,v 1.171 2018/12/22 06:33:37 cherry Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -173,7 +173,7 @@ define ipmibus {}
 
 device mainbus: cpubus, ioapicbus, hypervisorbus, bios32, ipmibus
 attach	mainbus at root
-file	arch/xen/x86/mainbus.c		mainbus
+file	arch/xen/x86/xen_mainbus.c		mainbus
 
 # Xen hypervisor
 device	hypervisor { [apid = -1]}: isabus, pcibus, sysmon_power, xendevbus, acpibus

Added files:

Index: src/sys/arch/amd64/amd64/amd64_mainbus.c
diff -u /dev/null src/sys/arch/amd64/amd64/amd64_mainbus.c:1.1
--- /dev/null	Sat Dec 22 06:33:37 2018
+++ src/sys/arch/amd64/amd64/amd64_mainbus.c	Sat Dec 22 06:33:36 2018
@@ -0,0 +1,326 @@
+/*	$NetBSD: amd64_mainbus.c,v 1.1 2018/12/22 06:33:36 cherry Exp $	*/
+
+/*
+ * Copyright (c) 1996 Christopher G. Demetriou.  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.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *  This product includes software developed 

CVS commit: src/sys/net

2018-12-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Dec 22 04:28:30 UTC 2018

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

Log Message:
Take the interface out of promiscuous mode in bridge_delete_member()
instead of bridge_ioctl_del(). Otherwise, the member interfaces are
left in promiscuous mode when the bridge is destroyed.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.163 src/sys/net/if_bridge.c:1.164
--- src/sys/net/if_bridge.c:1.163	Sat Dec 15 07:38:58 2018
+++ src/sys/net/if_bridge.c	Sat Dec 22 04:28:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.163 2018/12/15 07:38:58 rin Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.164 2018/12/22 04:28:30 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.163 2018/12/15 07:38:58 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.164 2018/12/22 04:28:30 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -743,6 +743,25 @@ bridge_delete_member(struct bridge_softc
 	BRIDGE_PSZ_PERFORM(sc);
 	BRIDGE_UNLOCK(sc);
 
+	switch (ifs->if_type) {
+	case IFT_ETHER:
+	case IFT_L2TP:
+		/*
+		 * Take the interface out of promiscuous mode.
+		 * Don't call it with holding a spin lock.
+		 */
+		(void) ifpromisc(ifs, 0);
+		IFNET_LOCK(ifs);
+		(void) ether_disable_vlan_mtu(ifs);
+		IFNET_UNLOCK(ifs);
+		break;
+	default:
+#ifdef DIAGNOSTIC
+		panic("%s: impossible", __func__);
+#endif
+		break;
+	}
+
 	psref_target_destroy(>bif_psref, bridge_psref_class);
 
 	PSLIST_ENTRY_DESTROY(bif, bif_next);
@@ -897,25 +916,6 @@ bridge_ioctl_del(struct bridge_softc *sc
 
 	BRIDGE_UNLOCK(sc);
 
-	switch (ifs->if_type) {
-	case IFT_ETHER:
-	case IFT_L2TP:
-		/*
-		 * Take the interface out of promiscuous mode.
-		 * Don't call it with holding a spin lock.
-		 */
-		(void) ifpromisc(ifs, 0);
-		IFNET_LOCK(ifs);
-		(void) ether_disable_vlan_mtu(ifs);
-		IFNET_UNLOCK(ifs);
-		break;
-	default:
-#ifdef DIAGNOSTIC
-		panic("bridge_delete_member: impossible");
-#endif
-		break;
-	}
-
 	bridge_rtdelete(sc, ifs);
 	bridge_calc_csum_flags(sc);
 



CVS commit: src/external/public-domain/sqlite/dist

2018-12-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 22 03:22:19 UTC 2018

Modified Files:
src/external/public-domain/sqlite/dist: sqlite3.c

Log Message:
remove stray line


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/public-domain/sqlite/dist/sqlite3.c

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

Modified files:

Index: src/external/public-domain/sqlite/dist/sqlite3.c
diff -u src/external/public-domain/sqlite/dist/sqlite3.c:1.17 src/external/public-domain/sqlite/dist/sqlite3.c:1.18
--- src/external/public-domain/sqlite/dist/sqlite3.c:1.17	Wed Dec 19 17:21:13 2018
+++ src/external/public-domain/sqlite/dist/sqlite3.c	Fri Dec 21 22:22:19 2018
@@ -30570,7 +30570,6 @@ do_atof_calc:
   LONGDOUBLE_TYPE scale = 1;
   /* 1.0e+22 is the largest power of 10 than can be 
   ** represented exactly. */
- LONGDOUBLE_TYPE scale = sqlite3Pow10(e-308);
   while( e%22 ) { scale *= 1.0e+1; e -= 1; }
   while( e>0 ) { scale *= 1.0e+22; e -= 22; }
   if( esign<0 ){
@@ -185410,7 +185409,7 @@ SQLITE_API int sqlite3_rtree_init(
 **May you share freely, never taking more than you give.
 **
 *
-** $Id: sqlite3.c,v 1.17 2018/12/19 22:21:13 christos Exp $
+** $Id: sqlite3.c,v 1.18 2018/12/22 03:22:19 christos Exp $
 **
 ** This file implements an integration between the ICU library 
 ** ("International Components for Unicode", an open-source library 



CVS commit: src/usr.bin/make

2018-12-21 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Dec 22 00:36:32 UTC 2018

Modified Files:
src/usr.bin/make: parse.c

Log Message:
ParseVErrorInternal: use .PARSEDIR and
apply realpath(3) if not absolute,
and use .PARSEFILE for consitent results.

Reviewed by: christos


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.230 src/usr.bin/make/parse.c:1.231
--- src/usr.bin/make/parse.c:1.230	Mon Dec 17 02:06:00 2018
+++ src/usr.bin/make/parse.c	Sat Dec 22 00:36:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $	*/
+/*	$NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -676,21 +676,32 @@ ParseVErrorInternal(FILE *f, const char 
 	if (cfname != NULL) {
 		(void)fprintf(f, "\"");
 		if (*cfname != '/' && strcmp(cfname, "(stdin)") != 0) {
-			char *cp;
-			const char *dir;
+			char *cp, *cp2;
+			const char *dir, *fname;
 
 			/*
 			 * Nothing is more annoying than not knowing
 			 * which Makefile is the culprit; we try ${.PARSEDIR}
-			 * first and if that's not absolute, we try ${.CURDIR}
+			 * and apply realpath(3) if not absolute.
 			 */
 			dir = Var_Value(".PARSEDIR", VAR_GLOBAL, );
-			if (dir == NULL || *dir == '\0' || *dir != '/')
-dir = Var_Value(".CURDIR", VAR_GLOBAL, );
 			if (dir == NULL)
 dir = ".";
-
-			(void)fprintf(f, "%s/%s", dir, cfname);
+			if (*dir != '/') {
+dir = cp2 = realpath(dir, NULL);
+free(cp);
+cp = cp2; /* cp2 set to NULL by Var_Value */
+			}
+			fname = Var_Value(".PARSEFILE", VAR_GLOBAL, );
+			if (fname == NULL) {
+if ((fname = strrchr(cfname, '/')))
+	fname++;
+else
+	fname = cfname;
+			}
+			(void)fprintf(f, "%s/%s", dir, fname);
+			free(cp2);
+			free(cp);
 		} else
 			(void)fprintf(f, "%s", cfname);
 



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

2018-12-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Dec 21 14:52:12 UTC 2018

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

Log Message:
Add com at acpi


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/evbarm/conf/GENERIC64

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/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.69 src/sys/arch/evbarm/conf/GENERIC64:1.70
--- src/sys/arch/evbarm/conf/GENERIC64:1.69	Fri Nov 30 16:28:43 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Fri Dec 21 14:52:12 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.69 2018/11/30 16:28:43 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.70 2018/12/21 14:52:12 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -264,6 +264,7 @@ ukphy*		at mii? phy ?		# generic unknown
 
 # UART
 com*		at fdt?	pass 4			# UART
+com*		at acpi?
 plcom*		at fdt?	pass 4			# ARM PL011 UART
 plcom*		at acpi?
 puc*		at pci? dev ? function ?	# PCI "universal" comm. cards



CVS commit: src/sys/dev/acpi

2018-12-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Dec 21 14:51:47 UTC 2018

Modified Files:
src/sys/dev/acpi: com_acpi.c

Log Message:
Support Designware APB UART


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/acpi/com_acpi.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/acpi/com_acpi.c
diff -u src/sys/dev/acpi/com_acpi.c:1.36 src/sys/dev/acpi/com_acpi.c:1.37
--- src/sys/dev/acpi/com_acpi.c:1.36	Sat Dec  8 17:46:13 2018
+++ src/sys/dev/acpi/com_acpi.c	Fri Dec 21 14:51:47 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: com_acpi.c,v 1.36 2018/12/08 17:46:13 thorpej Exp $ */
+/* $NetBSD: com_acpi.c,v 1.37 2018/12/21 14:51:47 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2002 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.36 2018/12/08 17:46:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.37 2018/12/21 14:51:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -34,11 +34,10 @@ __KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v
 #include 
 
 #include 
+#include 
 
 #include 
 
-#include 
-
 static int	com_acpi_match(device_t, cfdata_t , void *);
 static void	com_acpi_attach(device_t, device_t, void *);
 
@@ -63,6 +62,17 @@ static const char * const com_acpi_ids[]
 	"SMCF010",	/* SMC SuperIO IRDA device */
 	"NSC6001",	/* NSC IRDA device */
 	"FUJ02E6",	/* Fujitsu Serial Pen Tablet */
+	"HISI0031",	/* Hisilicon UART */
+	"8250dw",	/* Designware APB UART */
+	NULL
+};
+
+/*
+ * Subset of supported device IDs of type COM_TYPE_DW_APB
+ */
+static const char * const com_acpi_dw_ids[] = {
+	"HISI0031",	/* Hisilicon UART */
+	"8250dw",	/* Designware APB UART */
 	NULL
 };
 
@@ -98,6 +108,7 @@ com_acpi_attach(device_t parent, device_
 	bus_addr_t base;
 	bus_size_t size;
 	ACPI_STATUS rv;
+	ACPI_INTEGER clock_freq;
 
 	sc->sc_dev = self;
 
@@ -142,18 +153,27 @@ com_acpi_attach(device_t parent, device_
 
 	aprint_normal("%s", device_xname(self));
 
-	if (com_probe_subr(>sc_regs) == 0) {
-		aprint_error(": com probe failed\n");
-		goto out;
+	if (acpi_match_hid(aa->aa_node->ad_devinfo, com_acpi_dw_ids) != 0) {
+		sc->sc_type = COM_TYPE_DW_APB;
+		SET(sc->sc_hwflags, COM_HW_POLL);	/* XXX */
+	} else {
+		if (com_probe_subr(>sc_regs) == 0) {
+			aprint_error(": com probe failed\n");
+			goto out;
+		}
 	}
 
-	sc->sc_frequency = 115200 * 16;
+	rv = acpi_dsd_integer(aa->aa_node->ad_handle, "clock-frequency", _freq);
+	if (ACPI_SUCCESS(rv))
+		sc->sc_frequency = clock_freq;
+	else
+		sc->sc_frequency = 115200 * 16;
 
 	com_attach_subr(sc);
 
-	asc->sc_ih = isa_intr_establish_xname(aa->aa_ic, irq->ar_irq,
-	(irq->ar_type == ACPI_EDGE_SENSITIVE) ? IST_EDGE : IST_LEVEL,
-	IPL_SERIAL, comintr, sc, device_xname(sc->sc_dev));
+	if (!ISSET(sc->sc_hwflags, COM_HW_POLL))
+		asc->sc_ih = acpi_intr_establish(self, (uint64_t)aa->aa_node->ad_handle,
+		IPL_SERIAL, true, comintr, sc, device_xname(self));
 
 	if (!pmf_device_register(self, NULL, com_resume))
 		aprint_error_dev(self, "couldn't establish a power handler\n");



CVS commit: src/sys/dev/acpi

2018-12-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Dec 21 14:51:12 UTC 2018

Modified Files:
src/sys/dev/acpi: acpi_util.c acpi_util.h

Log Message:
Add acpi_dsd_integer, which reads an integer value from an ACPI 5.0 _DSD
key/value package list.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/acpi/acpi_util.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpi_util.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/acpi/acpi_util.c
diff -u src/sys/dev/acpi/acpi_util.c:1.14 src/sys/dev/acpi/acpi_util.c:1.15
--- src/sys/dev/acpi/acpi_util.c:1.14	Fri Nov 16 23:05:50 2018
+++ src/sys/dev/acpi/acpi_util.c	Fri Dec 21 14:51:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_util.c,v 1.14 2018/11/16 23:05:50 jmcneill Exp $ */
+/*	$NetBSD: acpi_util.c,v 1.15 2018/12/21 14:51:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.14 2018/11/16 23:05:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.15 2018/12/21 14:51:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -607,3 +607,67 @@ acpi_intr_string(void *c, char *buf, siz
 
 	return intr_string(ih, buf, size);
 }
+
+/*
+ * USB Device-Specific Data (_DSD) support
+ */
+
+static UINT8 acpi_dsd_uuid[ACPI_UUID_LENGTH] = {
+	0x14, 0xd8, 0xff, 0xda, 0xba, 0x6e, 0x8c, 0x4d,
+	0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01
+};
+
+ACPI_STATUS
+acpi_dsd_integer(ACPI_HANDLE handle, const char *prop, ACPI_INTEGER *val)
+{
+	ACPI_OBJECT *obj, *uuid, *props, *pobj, *propkey, *propval;
+	ACPI_STATUS rv;
+	ACPI_BUFFER buf;
+	int n;
+
+	buf.Pointer = NULL;
+	buf.Length = ACPI_ALLOCATE_BUFFER;
+
+	rv = AcpiEvaluateObjectTyped(handle, "_DSD", NULL, , ACPI_TYPE_PACKAGE);
+	if (ACPI_FAILURE(rv))
+		return rv;
+
+	props = NULL;
+	obj = (ACPI_OBJECT *)buf.Pointer;
+	for (n = 0; (n + 1) < obj->Package.Count; n += 2) {
+		uuid = >Package.Elements[n];
+		if (uuid->Buffer.Length == ACPI_UUID_LENGTH &&
+		memcmp(uuid->Buffer.Pointer, acpi_dsd_uuid, ACPI_UUID_LENGTH) == 0) {
+			props = >Package.Elements[n + 1];
+			break;
+		}
+	}
+	if (props == NULL) {
+		rv = AE_NOT_FOUND;
+		goto done;
+	}
+
+	for (n = 0; n < props->Package.Count; n++) {
+		pobj = >Package.Elements[n];
+		if (pobj->Type != ACPI_TYPE_PACKAGE || pobj->Package.Count != 2)
+			continue;
+		propkey = (ACPI_OBJECT *)>Package.Elements[0];
+		propval = (ACPI_OBJECT *)>Package.Elements[1];
+		if (propkey->Type != ACPI_TYPE_STRING)
+			continue;
+		if (strcmp(propkey->String.Pointer, prop) != 0)
+			continue;
+
+		if (propval->Type != ACPI_TYPE_INTEGER) {
+			rv = AE_TYPE;
+		} else {
+			*val = propval->Integer.Value;
+			rv = AE_OK;
+		}
+		break;
+	}
+
+done:
+	ACPI_FREE(buf.Pointer);
+	return rv;
+}

Index: src/sys/dev/acpi/acpi_util.h
diff -u src/sys/dev/acpi/acpi_util.h:1.6 src/sys/dev/acpi/acpi_util.h:1.7
--- src/sys/dev/acpi/acpi_util.h:1.6	Fri Oct 12 23:25:29 2018
+++ src/sys/dev/acpi/acpi_util.h	Fri Dec 21 14:51:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_util.h,v 1.6 2018/10/12 23:25:29 jmcneill Exp $ */
+/*	$NetBSD: acpi_util.h,v 1.7 2018/12/21 14:51:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -88,4 +88,6 @@ int		 acpi_match_class(ACPI_HANDLE, uint
 ACPI_HANDLE	 acpi_match_cpu_info(struct cpu_info *);
 struct cpu_info *acpi_match_cpu_handle(ACPI_HANDLE);
 
+ACPI_STATUS	 acpi_dsd_integer(ACPI_HANDLE, const char *, ACPI_INTEGER *);
+
 #endif	/* !_SYS_DEV_ACPI_ACPI_UTIL_H */



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

2018-12-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Dec 21 14:50:18 UTC 2018

Modified Files:
src/sys/arch/arm/acpi: acpi_platform.c

Log Message:
Use SPCR to force console selection for com@acpi. This is needed because
we may use a non-standard bus_space tag (a4x) to attach the console early,
which breaks com_is_console.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/acpi/acpi_platform.c

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

Modified files:

Index: src/sys/arch/arm/acpi/acpi_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.10 src/sys/arch/arm/acpi/acpi_platform.c:1.11
--- src/sys/arch/arm/acpi/acpi_platform.c:1.10	Wed Nov 28 22:29:36 2018
+++ src/sys/arch/arm/acpi/acpi_platform.c	Fri Dec 21 14:50:18 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.10 2018/11/28 22:29:36 jmcneill Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.11 2018/12/21 14:50:18 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "opt_efi.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.10 2018/11/28 22:29:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.11 2018/12/21 14:50:18 jmcneill Exp $");
 
 #include 
 #include 
@@ -232,16 +232,12 @@ acpi_platform_device_register(device_t s
 #if NCOM > 0
 	prop_dictionary_t prop = device_properties(self);
 
-	if (device_is_a(self, "com") && device_is_a(device_parent(self), "puc")) {
-		const struct puc_attach_args * const paa = aux;
+	if (device_is_a(self, "com")) {
 		ACPI_TABLE_SPCR *spcr;
-		int b, d, f;
-
-		const int s = pci_get_segment(paa->pc);
-		pci_decompose_tag(paa->pc, paa->tag, , , );
 
 		if (ACPI_FAILURE(acpi_table_find(ACPI_SIG_SPCR, (void **
 			return;
+
 		if (spcr->SerialPort.SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY)
 			goto spcr_unmap;
 		if (spcr->SerialPort.Address == 0)
@@ -250,9 +246,37 @@ acpi_platform_device_register(device_t s
 		spcr->InterfaceType != ACPI_DBG2_16550_SUBSET)
 			goto spcr_unmap;
 
-		if (spcr->PciSegment == s && spcr->PciBus == b &&
-		spcr->PciDevice == d && spcr->PciFunction == f)
-			prop_dictionary_set_bool(prop, "force_console", true);
+		if (device_is_a(device_parent(self), "puc")) {
+			const struct puc_attach_args * const paa = aux;
+			int b, d, f;
+
+			const int s = pci_get_segment(paa->pc);
+			pci_decompose_tag(paa->pc, paa->tag, , , );
+
+			if (spcr->PciSegment == s && spcr->PciBus == b &&
+			spcr->PciDevice == d && spcr->PciFunction == f)
+prop_dictionary_set_bool(prop, "force_console", true);
+		}
+
+		if (device_is_a(device_parent(self), "acpi")) {
+			struct acpi_attach_args * const aa = aux;
+			struct acpi_resources res;
+			struct acpi_mem *mem;
+
+			if (ACPI_FAILURE(acpi_resource_parse(self, aa->aa_node->ad_handle, "_CRS",
+			, _resource_parse_ops_quiet)))
+goto spcr_unmap;
+
+			mem = acpi_res_mem(, 0);
+			if (mem == NULL)
+goto crs_cleanup;
+
+			if (mem->ar_base == spcr->SerialPort.Address)
+prop_dictionary_set_bool(prop, "force_console", true);
+
+crs_cleanup:
+			acpi_resource_cleanup();
+		}
 
 spcr_unmap:
 		acpi_table_unmap((ACPI_TABLE_HEADER *)spcr);



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-12-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec 21 11:11:40 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c aarch64-nbsd-tdep.h
src/external/gpl3/gdb/dist/gdb/config/aarch64: nbsd.mh

Log Message:
s/Free/Net/; s/amd64/aarch64/.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.4
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.3	Wed Jul 11 13:52:35 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Fri Dec 21 11:11:40 2018
@@ -1,4 +1,4 @@
-/* Target-dependent code for FreeBSD/aarch64.
+/* Target-dependent code for NetBSD/aarch64.
 
Copyright (C) 2017-2018 Free Software Foundation, Inc.
 

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.3
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.2	Fri Jun 22 19:41:40 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h	Fri Dec 21 11:11:40 2018
@@ -1,4 +1,4 @@
-/* FreeBSD/aarch64 target support, prototypes.
+/* NetBSD/aarch64 target support, prototypes.
 
Copyright (C) 2017-2018 Free Software Foundation, Inc.
 

Index: src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh:1.1 src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh:1.2
--- src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh:1.1	Mon May 21 02:10:47 2018
+++ src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh	Fri Dec 21 11:11:40 2018
@@ -1,4 +1,4 @@
-# Host: NetBSD/amd64
+# Host: NetBSD/arm64
 NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o aarch64-nbsd-nat.o \
 	bsd-kvm.o
 



CVS commit: src/doc

2018-12-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 21 09:04:44 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
 Add SIOCSETHERCAP ioctl.


To generate a diff of this commit:
cvs rdiff -u -r1.2468 -r1.2469 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.2468 src/doc/CHANGES:1.2469
--- src/doc/CHANGES:1.2468	Wed Dec 19 22:22:16 2018
+++ src/doc/CHANGES	Fri Dec 21 09:04:44 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2468 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2469 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -267,3 +267,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	arm: Add support for NVIDIA Tegra X1 SoC SATA. [skrll 20181214]
 	kernel: Remove COMPAT_SVR4 and COMPAT_SVR4_32. [maxv 20181219]
 	sqlite3: Import 3.26.0. [christos 20181219]
+	network: Add SIOCSETHERCAP ioctl. [msaitoh 20181221]



CVS commit: src/sys/sys

2018-12-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 21 09:00:32 UTC 2018

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

Log Message:
 Welcome to 8.99.28 (SIOCSETHERCAP addition).


To generate a diff of this commit:
cvs rdiff -u -r1.572 -r1.573 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.572 src/sys/sys/param.h:1.573
--- src/sys/sys/param.h:1.572	Wed Dec  5 18:16:51 2018
+++ src/sys/sys/param.h	Fri Dec 21 09:00:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.572 2018/12/05 18:16:51 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.573 2018/12/21 09:00:32 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899002700	/* NetBSD 8.99.27 */
+#define	__NetBSD_Version__	899002800	/* NetBSD 8.99.28 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src

2018-12-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 21 08:58:08 UTC 2018

Modified Files:
src/sbin/ifconfig: ether.c extern.h ifconfig.c
src/sys/net: if.c if_ethersubr.c
src/sys/sys: sockio.h

Log Message:
 Add SIOCSETHERCAP. It's used to change ec_capenable.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/ifconfig/ether.c
cvs rdiff -u -r1.14 -r1.15 src/sbin/ifconfig/extern.h
cvs rdiff -u -r1.237 -r1.238 src/sbin/ifconfig/ifconfig.c
cvs rdiff -u -r1.442 -r1.443 src/sys/net/if.c
cvs rdiff -u -r1.271 -r1.272 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/sockio.h

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

Modified files:

Index: src/sbin/ifconfig/ether.c
diff -u src/sbin/ifconfig/ether.c:1.2 src/sbin/ifconfig/ether.c:1.3
--- src/sbin/ifconfig/ether.c:1.2	Thu Nov  1 13:43:23 2012
+++ src/sbin/ifconfig/ether.c	Fri Dec 21 08:58:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ether.c,v 1.2 2012/11/01 13:43:23 pgoyette Exp $	*/
+/*	$NetBSD: ether.c,v 1.3 2018/12/21 08:58:08 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ether.c,v 1.2 2012/11/01 13:43:23 pgoyette Exp $");
+__RCSID("$NetBSD: ether.c,v 1.3 2018/12/21 08:58:08 msaitoh Exp $");
 #endif /* not lint */
 
 #include  
@@ -40,6 +40,7 @@ __RCSID("$NetBSD: ether.c,v 1.2 2012/11/
 #include  
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -55,11 +56,99 @@ __RCSID("$NetBSD: ether.c,v 1.2 2012/11/
 
 static void ether_status(prop_dictionary_t, prop_dictionary_t);
 static void ether_constructor(void) __attribute__((constructor));
+static int  setethercaps(prop_dictionary_t, prop_dictionary_t);
 
 static status_func_t status;
+static cmdloop_branch_t branch;
 
 #define MAX_PRINT_LEN 55
 
+static const struct kwinst ethercapskw[] = {
+#if 0 /* notyet */
+	  IFKW("vlan-hwfilter",	ETHERCAP_VLAN_HWFILTER)
+#endif
+	  IFKW("eee",		ETHERCAP_EEE)
+};
+
+struct pkw ethercaps = PKW_INITIALIZER(, "ethercaps", setethercaps,
+"ethercap", ethercapskw, __arraycount(ethercapskw),
+_root.pb_parser);
+
+void
+do_setethercaps(prop_dictionary_t env)
+{
+	struct eccapreq eccr;
+	prop_data_t d;
+
+	d = (prop_data_t )prop_dictionary_get(env, "ethercaps");
+	if (d == NULL)
+		return;
+
+	assert(sizeof(eccr) == prop_data_size(d));
+
+	memcpy(, prop_data_data_nocopy(d), sizeof(eccr));
+	if (direct_ioctl(env, SIOCSETHERCAP, ) == -1)
+		err(EXIT_FAILURE, "SIOCSETHERCAP");
+}
+
+static int
+getethercaps(prop_dictionary_t env, prop_dictionary_t oenv,
+struct eccapreq *oeccr)
+{
+	bool rc;
+	struct eccapreq eccr;
+	const struct eccapreq *tmpeccr;
+	prop_data_t capdata;
+
+	capdata = (prop_data_t)prop_dictionary_get(env, "ethercaps");
+
+	if (capdata != NULL) {
+		tmpeccr = prop_data_data_nocopy(capdata);
+		*oeccr = *tmpeccr;
+		return 0;
+	}
+
+	(void)direct_ioctl(env, SIOCGETHERCAP, );
+	*oeccr = eccr;
+
+	capdata = prop_data_create_data(, sizeof(eccr));
+
+	rc = prop_dictionary_set(oenv, "ethercaps", capdata);
+
+	prop_object_release((prop_object_t)capdata);
+
+	return rc ? 0 : -1;
+}
+
+static int
+setethercaps(prop_dictionary_t env, prop_dictionary_t oenv)
+{
+	int64_t ethercap;
+	bool rc;
+	prop_data_t capdata;
+	struct eccapreq eccr;
+
+	rc = prop_dictionary_get_int64(env, "ethercap", );
+	assert(rc);
+
+	if (getethercaps(env, oenv, ) == -1)
+		return -1;
+
+	if (ethercap < 0) {
+		ethercap = -ethercap;
+		eccr.eccr_capenable &= ~ethercap;
+	} else
+		eccr.eccr_capenable |= ethercap;
+
+	if ((capdata = prop_data_create_data(, sizeof(eccr))) == NULL)
+		return -1;
+
+	rc = prop_dictionary_set(oenv, "ethercaps", capdata);
+	prop_object_release((prop_object_t)capdata);
+
+	return rc ? 0 : -1;
+}
+
 void
 ether_status(prop_dictionary_t env, prop_dictionary_t oenv)
 {
@@ -94,6 +183,8 @@ static void
 ether_constructor(void)
 {
 
+	cmdloop_branch_init(, _parser);
+	register_cmdloop_branch();
 	status_func_init(, ether_status);
 	register_status();
 }

Index: src/sbin/ifconfig/extern.h
diff -u src/sbin/ifconfig/extern.h:1.14 src/sbin/ifconfig/extern.h:1.15
--- src/sbin/ifconfig/extern.h:1.14	Fri Aug  7 18:53:37 2009
+++ src/sbin/ifconfig/extern.h	Fri Dec 21 08:58:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.14 2009/08/07 18:53:37 dyoung Exp $	*/
+/*	$NetBSD: extern.h,v 1.15 2018/12/21 08:58:08 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -87,6 +87,7 @@ int register_status(status_func_t *);
 int register_usage(usage_func_t *);
 int register_flag(int);
 bool get_flag(int);
+void do_setethercaps(prop_dictionary_t);
 
 extern bool lflag, Nflag, vflag, zflag;
 

Index: src/sbin/ifconfig/ifconfig.c
diff -u src/sbin/ifconfig/ifconfig.c:1.237 src/sbin/ifconfig/ifconfig.c:1.238
--- src/sbin/ifconfig/ifconfig.c:1.237	Thu Nov 15 04:36:46 2018
+++ src/sbin/ifconfig/ifconfig.c	Fri Dec 21 08:58:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifconfig.c,v 1.237 2018/11/15 

CVS commit: src/sys/dev/pci

2018-12-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 21 08:29:22 UTC 2018

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

Log Message:
 Fix WoL detection once again.


To generate a diff of this commit:
cvs rdiff -u -r1.610 -r1.611 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.610 src/sys/dev/pci/if_wm.c:1.611
--- src/sys/dev/pci/if_wm.c:1.610	Thu Dec 20 09:32:13 2018
+++ src/sys/dev/pci/if_wm.c	Fri Dec 21 08:29:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.610 2018/12/20 09:32:13 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.611 2018/12/21 08:29:22 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.610 2018/12/20 09:32:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.611 2018/12/21 08:29:22 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2396,12 +2396,12 @@ alloc_retry:
 	case WM_T_PCH_CNP:
 		apme_mask = WUC_APME;
 		eeprom_data = CSR_READ(sc, WMREG_WUC);
+		if ((eeprom_data & apme_mask) != 0)
+			sc->sc_flags |= WM_F_WOL;
 		break;
 	default:
 		break;
 	}
-	if ((eeprom_data & apme_mask) != 0)
-		sc->sc_flags |= WM_F_WOL;
 
 	/* Reset the chip to a known state. */
 	wm_reset(sc);



CVS commit: src/sys/arch/aarch64

2018-12-21 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Dec 21 08:01:01 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c cpufunc.c cpufunc_asm_armv8.S
pmap.c
src/sys/arch/aarch64/include: cpu.h cpufunc.h

Log Message:
- add workaround for Cavium ThunderX errata 27456.
- add cpufuncs table in cpu_info. each cpu clusters may have different erratum. 
(e.g. big.LITTLE)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/include/cpufunc.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/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.14 src/sys/arch/aarch64/aarch64/cpu.c:1.15
--- src/sys/arch/aarch64/aarch64/cpu.c:1.14	Wed Nov 28 09:16:19 2018
+++ src/sys/arch/aarch64/aarch64/cpu.c	Fri Dec 21 08:01:01 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $ */
+/* $NetBSD: cpu.c,v 1.15 2018/12/21 08:01:01 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.15 2018/12/21 08:01:01 ryo Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -163,6 +163,7 @@ cpu_attach(device_t dv, cpuid_t id)
 	}
 #endif /* MULTIPROCESSOR */
 
+	set_cpufuncs();
 	fpu_attach(ci);
 
 	cpu_identify1(dv, ci);
@@ -522,6 +523,7 @@ cpu_hatch(struct cpu_info *ci)
 
 	mutex_enter(_hatch_lock);
 
+	set_cpufuncs();
 	fpu_attach(ci);
 
 	cpu_identify1(ci->ci_dev, ci);

Index: src/sys/arch/aarch64/aarch64/cpufunc.c
diff -u src/sys/arch/aarch64/aarch64/cpufunc.c:1.4 src/sys/arch/aarch64/aarch64/cpufunc.c:1.5
--- src/sys/arch/aarch64/aarch64/cpufunc.c:1.4	Wed Aug 29 06:16:40 2018
+++ src/sys/arch/aarch64/aarch64/cpufunc.c	Fri Dec 21 08:01:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.4 2018/08/29 06:16:40 ryo Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.5 2018/12/21 08:01:01 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.4 2018/08/29 06:16:40 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.5 2018/12/21 08:01:01 ryo Exp $");
 
 #include 
 #include 
@@ -404,3 +404,27 @@ aarch64_dcache_wb_all(void)
 	}
 	__asm __volatile ("dsb ish");
 }
+
+int
+set_cpufuncs(void)
+{
+	struct cpu_info * const ci = curcpu();
+	const uint32_t midr __unused = reg_midr_el1_read();
+
+	/* install default functions */
+	ci->ci_cpufuncs.cf_set_ttbr0 = aarch64_set_ttbr0;
+
+
+	/* install core/cluster specific functions */
+#ifdef CPU_THUNDERX
+	/* Cavium erratum 27456 */
+	if ((midr == CPU_ID_THUNDERXP1d0) ||
+	(midr == CPU_ID_THUNDERXP1d1) ||
+	(midr == CPU_ID_THUNDERXP2d1) ||
+	(midr == CPU_ID_THUNDERX81XXRX)) {
+		ci->ci_cpufuncs.cf_set_ttbr0 = aarch64_set_ttbr0_thunderx;
+	}
+#endif
+
+	return 0;
+}

Index: src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S
diff -u src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S:1.2 src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S:1.3
--- src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S:1.2	Mon Jul 23 22:51:39 2018
+++ src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S	Fri Dec 21 08:01:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc_asm_armv8.S,v 1.2 2018/07/23 22:51:39 ryo Exp $	*/
+/*	$NetBSD: cpufunc_asm_armv8.S,v 1.3 2018/12/21 08:01:01 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014 Robin Randhawa
@@ -32,6 +32,7 @@
  * $FreeBSD: head/sys/arm64/arm64/cpufunc_asm.S 313347 2017-02-06 17:50:09Z andrew $
  */
 
+#include "opt_cputypes.h"
 #include "opt_multiprocessor.h"
 #include 
 
@@ -163,6 +164,22 @@ ENTRY(aarch64_set_ttbr0)
 	ret
 END(aarch64_set_ttbr0)
 
+#ifdef CPU_THUNDERX
+/*
+ * Cavium erratum 27456
+ * void aarch64_set_ttbr0_thunderx(uint64_t ttbr0)
+ */
+ENTRY(aarch64_set_ttbr0_thunderx)
+	dsb	ish
+	msr	ttbr0_el1, x0
+	isb
+	ic	iallu
+	dsb	nsh
+	isb
+	ret
+END(aarch64_set_ttbr0_thunderx)
+#endif /* CPU_THUNDERX */
+
 /* void aarch64_tlbi_all(void) */
 ENTRY(aarch64_tlbi_all)
 	dsb	ishst

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.33 src/sys/arch/aarch64/aarch64/pmap.c:1.34
--- src/sys/arch/aarch64/aarch64/pmap.c:1.33	Thu Nov  1 20:34:49 2018
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Dec 21 08:01:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.33 2018/11/01 20:34:49 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.34 2018/12/21 08:01:01 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.33 2018/11/01 20:34:49 maxv Exp $");