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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:32:07 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: std.generic64

Log Message:
Use ACPI_REDUCED_HARDWARE on arm64 to shrink the kernel


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/std.generic64

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



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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:32:07 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: std.generic64

Log Message:
Use ACPI_REDUCED_HARDWARE on arm64 to shrink the kernel


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/std.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/std.generic64
diff -u src/sys/arch/evbarm/conf/std.generic64:1.5 src/sys/arch/evbarm/conf/std.generic64:1.6
--- src/sys/arch/evbarm/conf/std.generic64:1.5	Mon Oct 15 05:14:07 2018
+++ src/sys/arch/evbarm/conf/std.generic64	Tue Oct 16 00:32:07 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: std.generic64,v 1.5 2018/10/15 05:14:07 skrll Exp $
+#	$NetBSD: std.generic64,v 1.6 2018/10/16 00:32:07 jmcneill Exp $
 #
 #	generic NetBSD/evbarm64 with FDT support
 
@@ -9,6 +9,7 @@ include		"arch/aarch64/conf/std.aarch64"
 # Architecture options
 options 	AARCH64
 
+options 	ACPI_REDUCED_HARDWARE
 options 	ARM_GENERIC_TODR
 options 	ARM_INTR_IMPL=""
 options 	DRAM_BLOCKS=256



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:30:08 UTC 2018

Modified Files:
src/sys/dev/acpi: acpi.c acpi_timer.c files.acpi

Log Message:
Add ACPI_REDUCED_HARDWARE defflag (used by ACPICA) and fix acpi build with this 
option set.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpi_timer.c
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/acpi/files.acpi

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.c
diff -u src/sys/dev/acpi/acpi.c:1.274 src/sys/dev/acpi/acpi.c:1.275
--- src/sys/dev/acpi/acpi.c:1.274	Fri Oct 12 21:35:54 2018
+++ src/sys/dev/acpi/acpi.c	Tue Oct 16 00:30:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.274 2018/10/12 21:35:54 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.275 2018/10/16 00:30:08 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.274 2018/10/12 21:35:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.275 2018/10/16 00:30:08 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -525,8 +525,9 @@ acpi_attach(device_t parent, device_t se
 	acpi_active = 1;
 
 	/* Show SCI interrupt. */
-	aprint_verbose_dev(self, "SCI interrupting at int %u\n",
-	AcpiGbl_FADT.SciInterrupt);
+	if (AcpiGbl_FADT.SciInterrupt != 0)
+		aprint_verbose_dev(self, "SCI interrupting at int %u\n",
+		AcpiGbl_FADT.SciInterrupt);
 
 	/*
 	 * Install fixed-event handlers.
@@ -1409,7 +1410,9 @@ acpi_enter_sleep_state(int state)
 			AcpiClearEvent(ACPI_EVENT_POWER_BUTTON);
 			AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON);
 			AcpiClearEvent(ACPI_EVENT_RTC);
+#if !defined(ACPI_REDUCED_HARDWARE)
 			AcpiHwDisableAllGpes();
+#endif
 
 			acpi_md_OsEnableInterrupt();
 			rv = AcpiLeaveSleepState(state);

Index: src/sys/dev/acpi/acpi_timer.c
diff -u src/sys/dev/acpi/acpi_timer.c:1.23 src/sys/dev/acpi/acpi_timer.c:1.24
--- src/sys/dev/acpi/acpi_timer.c:1.23	Mon Oct 15 11:33:09 2018
+++ src/sys/dev/acpi/acpi_timer.c	Tue Oct 16 00:30:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_timer.c,v 1.23 2018/10/15 11:33:09 jmcneill Exp $ */
+/* $NetBSD: acpi_timer.c,v 1.24 2018/10/16 00:30:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2006 Matthias Drochner 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.23 2018/10/15 11:33:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.24 2018/10/16 00:30:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -39,6 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_timer.c
 
 #include 
 
+#if !defined(ACPI_REDUCED_HARDWARE)
 static int	acpitimer_test(void);
 
 static struct timecounter acpi_timecounter = {
@@ -57,10 +58,12 @@ acpitimer_supported(void)
 {
 	return AcpiGbl_FADT.PmTimerLength != 0;
 }
+#endif
 
 int
 acpitimer_init(struct acpi_softc *sc)
 {
+#if !defined(ACPI_REDUCED_HARDWARE)
 	ACPI_STATUS rv;
 	uint32_t bits;
 	int i, j;
@@ -91,18 +94,25 @@ acpitimer_init(struct acpi_softc *sc)
 	acpi_timecounter.tc_name, bits);
 
 	return 0;
+#else
+	return -1;
+#endif
 }
 
 int
 acpitimer_detach(void)
 {
-
+#if !defined(ACPI_REDUCED_HARDWARE)
 	if (!acpitimer_supported())
 		return -1;
 
 	return tc_detach(_timecounter);
+#else
+	return -1;
+#endif
 }
 
+#if !defined(ACPI_REDUCED_HARDWARE)
 u_int
 acpitimer_read_fast(struct timecounter *tc)
 {
@@ -190,3 +200,4 @@ acpitimer_test(void)
 
 	return n;
 }
+#endif

Index: src/sys/dev/acpi/files.acpi
diff -u src/sys/dev/acpi/files.acpi:1.104 src/sys/dev/acpi/files.acpi:1.105
--- src/sys/dev/acpi/files.acpi:1.104	Mon Oct 15 23:59:16 2018
+++ src/sys/dev/acpi/files.acpi	Tue Oct 16 00:30:08 2018
@@ -1,10 +1,10 @@
-#	$NetBSD: files.acpi,v 1.104 2018/10/15 23:59:16 jmcneill Exp $
+#	$NetBSD: files.acpi,v 1.105 2018/10/16 00:30:08 jmcneill Exp $
 
 include "dev/acpi/acpica/files.acpica"
 
 defflag	opt_acpi.h	ACPIVERBOSE ACPI_DEBUG ACPI_ACTIVATE_DEV
 			ACPI_DSDT_OVERRIDE ACPI_SCANPCI ACPI_BREAKPOINT
-			ACPI__DIS_IS_BROKEN
+			ACPI_REDUCED_HARDWARE ACPI__DIS_IS_BROKEN
 defparam opt_acpi.h	ACPI_DSDT_FILE := "\"/dev/null\""
 defparam opt_acpi.h	ACPI_BLACKLIST_YEAR = 2000
 



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:30:08 UTC 2018

Modified Files:
src/sys/dev/acpi: acpi.c acpi_timer.c files.acpi

Log Message:
Add ACPI_REDUCED_HARDWARE defflag (used by ACPICA) and fix acpi build with this 
option set.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpi_timer.c
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/acpi/files.acpi

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



CVS commit: src/sys/dev/pci

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:08:52 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1339 -r1.1340 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1338 -r1.1339 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:08:52 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1339 -r1.1340 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1338 -r1.1339 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/pci

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:10:58 UTC 2018

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

Log Message:
Set PCI_QUIRK_HASEXTCNF flag for AMD Seattle PCI host bridges


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/pci_quirks.c

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



CVS commit: src/sys/dev/pci

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:07:08 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add AMD Seattle Host Bridge and PCIE root port devices


To generate a diff of this commit:
cvs rdiff -u -r1.1348 -r1.1349 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1348 src/sys/dev/pci/pcidevs:1.1349
--- src/sys/dev/pci/pcidevs:1.1348	Mon Oct 15 09:01:56 2018
+++ src/sys/dev/pci/pcidevs	Tue Oct 16 00:07:08 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1348 2018/10/15 09:01:56 uwe Exp $
+$NetBSD: pcidevs,v 1.1349 2018/10/16 00:07:08 jmcneill Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1042,6 +1042,9 @@ product AMD F12_GPP0	0x1709	Family12h GP
 product AMD F14_MISC	0x1716	Family12h/14h Misc. Configuration
 product AMD F14_HB18	0x1718	Family12h/14h Host Bridge
 product AMD F14_HB19	0x1719	Family12h/14h Host Bridge
+product AMD SEATTLE_PCHB_1	0x1a00	Seattle Host Bridge
+product AMD SEATTLE_PCHB_2	0x1a01	Seattle Host Bridge
+product AMD SEATTLE_PCIE	0x1a02	Seattle PCIE Root Port
 product AMD PCNET_PCI	0x2000	PCnet-PCI Ethernet
 product AMD PCNET_HOME	0x2001	PCnet-Home HomePNA Ethernet
 product AMD AM_1771_MBW	0x2003	Alchemy AM 1771 MBW



CVS commit: src/sys/dev/pci

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:10:58 UTC 2018

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

Log Message:
Set PCI_QUIRK_HASEXTCNF flag for AMD Seattle PCI host bridges


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/pci_quirks.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/pci_quirks.c
diff -u src/sys/dev/pci/pci_quirks.c:1.10 src/sys/dev/pci/pci_quirks.c:1.11
--- src/sys/dev/pci/pci_quirks.c:1.10	Wed Feb 28 05:50:06 2018
+++ src/sys/dev/pci/pci_quirks.c	Tue Oct 16 00:10:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_quirks.c,v 1.10 2018/02/28 05:50:06 msaitoh Exp $	*/
+/*	$NetBSD: pci_quirks.c,v 1.11 2018/10/16 00:10:58 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_quirks.c,v 1.10 2018/02/28 05:50:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_quirks.c,v 1.11 2018/10/16 00:10:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -53,6 +53,10 @@ static const struct pci_quirkdata pci_qu
 	PCI_QUIRK_HASEXTCNF },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_COREI76K_IMC_0,
 	PCI_QUIRK_HASEXTCNF },
+	{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_SEATTLE_PCHB_1,
+	PCI_QUIRK_HASEXTCNF },
+	{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_SEATTLE_PCHB_2,
+	PCI_QUIRK_HASEXTCNF },
 };
 
 const struct pci_quirkdata *



CVS commit: src/sys/dev/pci

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 00:07:08 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add AMD Seattle Host Bridge and PCIE root port devices


To generate a diff of this commit:
cvs rdiff -u -r1.1348 -r1.1349 src/sys/dev/pci/pcidevs

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



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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:59:36 UTC 2018

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

Log Message:
Add plgpio at acpi


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 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.48 src/sys/arch/evbarm/conf/GENERIC64:1.49
--- src/sys/arch/evbarm/conf/GENERIC64:1.48	Mon Oct 15 23:50:48 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Mon Oct 15 23:59:36 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.48 2018/10/15 23:50:48 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.49 2018/10/15 23:59:36 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -183,6 +183,7 @@ tegra210car*	at fdt? pass 3		# NVIDIA Te
 # GPIO controller
 bcmgpio*	at fdt?			# Broadcom BCM283x GPIO
 plgpio*		at fdt?			# ARM PrimeCell PL061 GPIO
+plgpio*		at acpi?
 sunxigpio*	at fdt? pass 3		# Allwinner GPIO
 tegragpio*	at fdt? pass 2		# NVIDIA Tegra GPIO
 rkgpio*		at rkiomux?		# Rockchip GPIO



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:59:16 UTC 2018

Modified Files:
src/sys/dev/acpi: files.acpi
Added Files:
src/sys/dev/acpi: plgpio_acpi.c

Log Message:
Add ACPI glue for PL061 GPIO


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/acpi/files.acpi
cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/plgpio_acpi.c

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



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:59:16 UTC 2018

Modified Files:
src/sys/dev/acpi: files.acpi
Added Files:
src/sys/dev/acpi: plgpio_acpi.c

Log Message:
Add ACPI glue for PL061 GPIO


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/acpi/files.acpi
cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/plgpio_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/files.acpi
diff -u src/sys/dev/acpi/files.acpi:1.103 src/sys/dev/acpi/files.acpi:1.104
--- src/sys/dev/acpi/files.acpi:1.103	Fri Oct 12 23:26:18 2018
+++ src/sys/dev/acpi/files.acpi	Mon Oct 15 23:59:16 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.103 2018/10/12 23:26:18 jmcneill Exp $
+#	$NetBSD: files.acpi,v 1.104 2018/10/15 23:59:16 jmcneill Exp $
 
 include "dev/acpi/acpica/files.acpica"
 
@@ -233,4 +233,8 @@ file	dev/acpi/qemufwcfg_acpi.c	qemufwcfg
 attach	ahcisata at acpinodebus with ahcisata_acpi
 file	dev/acpi/ahcisata_acpi.c	ahcisata_acpi
 
+# ARM PrimeCell PL061 GPIO controller
+attach	plgpio at acpinodebus with plgpio_acpi
+file	dev/acpi/plgpio_acpi.c		plgpio_acpi
+
 include	"dev/acpi/wmi/files.wmi"

Added files:

Index: src/sys/dev/acpi/plgpio_acpi.c
diff -u /dev/null src/sys/dev/acpi/plgpio_acpi.c:1.1
--- /dev/null	Mon Oct 15 23:59:16 2018
+++ src/sys/dev/acpi/plgpio_acpi.c	Mon Oct 15 23:59:16 2018
@@ -0,0 +1,103 @@
+/* $NetBSD: plgpio_acpi.c,v 1.1 2018/10/15 23:59:16 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jared McNeill .
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: plgpio_acpi.c,v 1.1 2018/10/15 23:59:16 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+static int	plgpio_acpi_match(device_t, cfdata_t, void *);
+static void	plgpio_acpi_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(plgpio_acpi, sizeof(struct plgpio_softc), plgpio_acpi_match, plgpio_acpi_attach, NULL, NULL);
+
+static const char * const compatible[] = {
+	"ARMH0061",
+	NULL
+};
+
+static int
+plgpio_acpi_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct acpi_attach_args *aa = aux;
+
+	if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
+		return 0;
+
+	return acpi_match_hid(aa->aa_node->ad_devinfo, compatible);
+}
+
+static void
+plgpio_acpi_attach(device_t parent, device_t self, void *aux)
+{
+	struct plgpio_softc * const sc = device_private(self);
+	struct acpi_attach_args *aa = aux;
+	struct acpi_resources res;
+	struct acpi_mem *mem;
+	ACPI_STATUS rv;
+	int error;
+
+	sc->sc_dev = self;
+
+	rv = acpi_resource_parse(sc->sc_dev, aa->aa_node->ad_handle, "_CRS",
+	, _resource_parse_ops_default);
+	if (ACPI_FAILURE(rv))
+		return;
+
+	mem = acpi_res_mem(, 0);
+	if (mem == NULL) {
+		aprint_error_dev(self, "couldn't find mem resource\n");
+		goto done;
+	}
+
+	sc->sc_dev = self;
+	sc->sc_bst = aa->aa_memt;
+	error = bus_space_map(sc->sc_bst, mem->ar_base, mem->ar_length, 0, >sc_bsh);
+	if (error) {
+		aprint_error_dev(self, "couldn't map registers\n");
+		return;
+	}
+
+	plgpio_attach(sc);
+
+done:
+	acpi_resource_cleanup();
+}



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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:59:36 UTC 2018

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

Log Message:
Add plgpio at acpi


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 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.



CVS commit: src/sys/dev/fdt

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:53:47 UTC 2018

Modified Files:
src/sys/dev/fdt: pl061gpio_fdt.c

Log Message:
Don't use a4x bus tag


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/pl061gpio_fdt.c

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



CVS commit: src/sys/dev/fdt

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:53:47 UTC 2018

Modified Files:
src/sys/dev/fdt: pl061gpio_fdt.c

Log Message:
Don't use a4x bus tag


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/pl061gpio_fdt.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/fdt/pl061gpio_fdt.c
diff -u src/sys/dev/fdt/pl061gpio_fdt.c:1.3 src/sys/dev/fdt/pl061gpio_fdt.c:1.4
--- src/sys/dev/fdt/pl061gpio_fdt.c:1.3	Mon Oct 15 23:50:48 2018
+++ src/sys/dev/fdt/pl061gpio_fdt.c	Mon Oct 15 23:53:47 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pl061gpio_fdt.c,v 1.3 2018/10/15 23:50:48 jmcneill Exp $ */
+/* $NetBSD: pl061gpio_fdt.c,v 1.4 2018/10/15 23:53:47 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.3 2018/10/15 23:50:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.4 2018/10/15 23:53:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ plgpio_fdt_attach(device_t parent, devic
 	}
 
 	sc->sc_dev = self;
-	sc->sc_bst = faa->faa_a4x_bst;
+	sc->sc_bst = faa->faa_bst;
 	error = bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh);
 	if (error) {
 		aprint_error(": couldn't map %#"PRIx64": %d", (uint64_t)addr, error);



CVS commit: src/sys

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:50:49 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64 VIRT
src/sys/conf: files
src/sys/dev/fdt: files.fdt pl061gpio_fdt.c
Added Files:
src/sys/dev/ic: pl061.c pl061var.h

Log Message:
Rename pl061gpio to plgpio and split the device logic from the FDT glue.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/VIRT
cvs rdiff -u -r1.1213 -r1.1214 src/sys/conf/files
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/pl061gpio_fdt.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/ic/pl061.c src/sys/dev/ic/pl061var.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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.47 src/sys/arch/evbarm/conf/GENERIC64:1.48
--- src/sys/arch/evbarm/conf/GENERIC64:1.47	Mon Oct 15 11:35:42 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Mon Oct 15 23:50:48 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.47 2018/10/15 11:35:42 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.48 2018/10/15 23:50:48 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -182,7 +182,7 @@ tegra210car*	at fdt? pass 3		# NVIDIA Te
 
 # GPIO controller
 bcmgpio*	at fdt?			# Broadcom BCM283x GPIO
-pl061gpio*	at fdt?			# ARM PrimeCell PL061 GPIO
+plgpio*		at fdt?			# ARM PrimeCell PL061 GPIO
 sunxigpio*	at fdt? pass 3		# Allwinner GPIO
 tegragpio*	at fdt? pass 2		# NVIDIA Tegra GPIO
 rkgpio*		at rkiomux?		# Rockchip GPIO

Index: src/sys/arch/evbarm/conf/VIRT
diff -u src/sys/arch/evbarm/conf/VIRT:1.7 src/sys/arch/evbarm/conf/VIRT:1.8
--- src/sys/arch/evbarm/conf/VIRT:1.7	Sat Jul 14 15:09:41 2018
+++ src/sys/arch/evbarm/conf/VIRT	Mon Oct 15 23:50:48 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VIRT,v 1.7 2018/07/14 15:09:41 maxv Exp $
+#	$NetBSD: VIRT,v 1.8 2018/10/15 23:50:48 jmcneill Exp $
 #
 #	QEMU ARM 'virt' virtual machine
 #
@@ -58,7 +58,7 @@ plcom*		at fdt?			# ARM PL011 UART
 plrtc*		at fdt?			# ARM PrimeCell RTC
 
 # GPIO
-pl061gpio*	at fdt?			# ARM PrimeCell GPIO
+plgpio*		at fdt?			# ARM PrimeCell GPIO
 
 # Virtio devices
 virtio*	at fdt?# Virtio MMIO device

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1213 src/sys/conf/files:1.1214
--- src/sys/conf/files:1.1213	Sun Sep 23 09:21:03 2018
+++ src/sys/conf/files	Mon Oct 15 23:50:48 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1213 2018/09/23 09:21:03 maxv Exp $
+#	$NetBSD: files,v 1.1214 2018/10/15 23:50:48 jmcneill Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -1319,6 +1319,10 @@ file	dev/ic/pl041.c			aaci
 device	plkmi: pckbport
 file	dev/ic/pl050.c			plkmi
 
+# ARM PrimeCell PL061 (GPIO) general purpose input/output
+device	plgpio: gpiobus
+file	dev/ic/pl061.c			plgpio
+
 # ARM PrimeCell PL181 (MMCI) host controller
 device	plmmc: sdmmcbus
 file	dev/ic/pl181.c			plmmc

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.39 src/sys/dev/fdt/files.fdt:1.40
--- src/sys/dev/fdt/files.fdt:1.39	Sat Oct  6 16:28:21 2018
+++ src/sys/dev/fdt/files.fdt	Mon Oct 15 23:50:48 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.39 2018/10/06 16:28:21 skrll Exp $
+# $NetBSD: files.fdt,v 1.40 2018/10/15 23:50:48 jmcneill Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -123,10 +123,9 @@ file	dev/fdt/virtio_mmio_fdt.c		virtio_m
 attach 	qemufwcfg at fdt with qemufwcfg_fdt
 file	dev/fdt/qemufwcfg_fdt.c			qemufwcfg_fdt
 
-# ARM PrimeCell  General Purpose Input/Output (PL061)
-device	pl061gpio: gpiobus
-attach 	pl061gpio at fdt with pl061gpio_fdt
-file	dev/fdt/pl061gpio_fdt.c			pl061gpio_fdt
+# ARM PrimeCell General Purpose Input/Output (PL061)
+attach 	plgpio at fdt with plgpio_fdt
+file	dev/fdt/pl061gpio_fdt.c			plgpio_fdt
 
 # AHCI SATA controller
 attach	ahcisata at fdt with ahcisata_fdt

Index: src/sys/dev/fdt/pl061gpio_fdt.c
diff -u src/sys/dev/fdt/pl061gpio_fdt.c:1.2 src/sys/dev/fdt/pl061gpio_fdt.c:1.3
--- src/sys/dev/fdt/pl061gpio_fdt.c:1.2	Mon Sep  3 23:19:01 2018
+++ src/sys/dev/fdt/pl061gpio_fdt.c	Mon Oct 15 23:50:48 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pl061gpio_fdt.c,v 1.2 2018/09/03 23:19:01 jmcneill Exp $ */
+/* $NetBSD: pl061gpio_fdt.c,v 1.3 2018/10/15 23:50:48 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.2 2018/09/03 23:19:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.3 2018/10/15 23:50:48 jmcneill Exp $");
 
 #include 
 #include 
@@ -39,58 +39,40 @@ __KERNEL_RCSID(0, "$NetBSD: pl061gpio_fd
 #include 
 
 #include 
-#include "gpio.h"
 
 #include 
+#include 
 
 #include 
 
-static int	pl061_gpio_match(device_t, cfdata_t, void *);
-static void	pl061_gpio_attach(device_t, device_t, void *);
+static int	

CVS commit: src/sys

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 23:50:49 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64 VIRT
src/sys/conf: files
src/sys/dev/fdt: files.fdt pl061gpio_fdt.c
Added Files:
src/sys/dev/ic: pl061.c pl061var.h

Log Message:
Rename pl061gpio to plgpio and split the device logic from the FDT glue.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/VIRT
cvs rdiff -u -r1.1213 -r1.1214 src/sys/conf/files
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/pl061gpio_fdt.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/ic/pl061.c src/sys/dev/ic/pl061var.h

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



CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 22:06:16 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_sysv_50_mod.c
compat_sysv_mod.h
src/sys/kern [pgoyette-compat]: compat_stub.c sysv_ipc.c
src/sys/sys [pgoyette-compat]: compat_stub.h

Log Message:
Convert the final non-MP-safe "vectored" compat routine to use the
MP-safe mechanism.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/compat/common/compat_sysv_50_mod.c \
src/sys/compat/common/compat_sysv_mod.h
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.32.16.5 -r1.32.16.6 src/sys/kern/sysv_ipc.c
cvs rdiff -u -r1.1.2.43 -r1.1.2.44 src/sys/sys/compat_stub.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/compat/common/compat_sysv_50_mod.c
diff -u src/sys/compat/common/compat_sysv_50_mod.c:1.1.2.1 src/sys/compat/common/compat_sysv_50_mod.c:1.1.2.2
--- src/sys/compat/common/compat_sysv_50_mod.c:1.1.2.1	Tue Apr 17 23:06:11 2018
+++ src/sys/compat/common/compat_sysv_50_mod.c	Mon Oct 15 22:06:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sysv_50_mod.c,v 1.1.2.1 2018/04/17 23:06:11 pgoyette Exp $	*/
+/*	$NetBSD: compat_sysv_50_mod.c,v 1.1.2.2 2018/10/15 22:06:16 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.1.2.1 2018/04/17 23:06:11 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.1.2.2 2018/10/15 22:06:16 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: compat_sysv_
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -63,11 +64,12 @@ static const struct syscall_package comp
 	{ 0, 0, NULL }
 };
 
+MODULE_SET_HOOK(sysvipc50_sysctl_hook, "sysv50", sysctl_kern_sysvipc50);
+MODULE_UNSET_HOOK(sysvipc50_sysctl_hook);
+
 static int
 compat_sysv_50_modcmd(modcmd_t cmd, void *arg)
 {
-	static int (*orig_sysvipc50_sysctl)(SYSCTLFN_PROTO);
-
 	int error = 0;
 
 	switch (cmd) {
@@ -76,16 +78,15 @@ compat_sysv_50_modcmd(modcmd_t cmd, void
 		if (error != 0) {
 			break;
 		}
-		orig_sysvipc50_sysctl = vec_sysvipc50_sysctl;
-		vec_sysvipc50_sysctl = sysctl_kern_sysvipc50;
+		sysvipc50_sysctl_hook_set();
 		break;
 
 	case MODULE_CMD_FINI:
-		vec_sysvipc50_sysctl = orig_sysvipc50_sysctl;
 		error = syscall_disestablish(NULL, compat_sysv_50_syscalls);
 		if (error != 0) {
 			break;
 		}
+		sysvipc50_sysctl_hook_unset();
 		break;
 
 	default:
Index: src/sys/compat/common/compat_sysv_mod.h
diff -u src/sys/compat/common/compat_sysv_mod.h:1.1.2.1 src/sys/compat/common/compat_sysv_mod.h:1.1.2.2
--- src/sys/compat/common/compat_sysv_mod.h:1.1.2.1	Tue Apr 17 21:59:27 2018
+++ src/sys/compat/common/compat_sysv_mod.h	Mon Oct 15 22:06:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sysv_mod.h,v 1.1.2.1 2018/04/17 21:59:27 pgoyette Exp $	*/
+/*	$NetBSD: compat_sysv_mod.h,v 1.1.2.2 2018/10/15 22:06:16 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,8 +34,6 @@
 
 #include 
 
-extern int (*vec_sysvipc50_sysctl)(SYSCTLFN_PROTO);
-
 int sysctl_kern_sysvipc50(SYSCTLFN_PROTO);
 
 #endif /* _COMPAT_COMMON_SYSV_IPC_MOD_H_ */

Index: src/sys/kern/compat_stub.c
diff -u src/sys/kern/compat_stub.c:1.1.2.31 src/sys/kern/compat_stub.c:1.1.2.32
--- src/sys/kern/compat_stub.c:1.1.2.31	Mon Oct 15 11:57:05 2018
+++ src/sys/kern/compat_stub.c	Mon Oct 15 22:06:16 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.1.2.31 2018/10/15 11:57:05 pgoyette Exp $	*/
+/* $NetBSD: compat_stub.c,v 1.1.2.32 2018/10/15 22:06:16 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -203,3 +203,8 @@ struct compat_10_openat_hook_t compat_10
  */
 struct compat_70_unp_hook_t compat_70_unp_hook;
 
+/*
+ * Hook for sysvipc50_sysctl
+ */
+struct sysvipc50_sysctl_hook_t sysvipc50_sysctl_hook;
+

Index: src/sys/kern/sysv_ipc.c
diff -u src/sys/kern/sysv_ipc.c:1.32.16.5 src/sys/kern/sysv_ipc.c:1.32.16.6
--- src/sys/kern/sysv_ipc.c:1.32.16.5	Thu Sep  6 06:56:42 2018
+++ src/sys/kern/sysv_ipc.c	Mon Oct 15 22:06:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysv_ipc.c,v 1.32.16.5 2018/09/06 06:56:42 pgoyette Exp $	*/
+/*	$NetBSD: sysv_ipc.c,v 1.32.16.6 2018/10/15 22:06:16 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysv_ipc.c,v 1.32.16.5 2018/09/06 06:56:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysv_ipc.c,v 1.32.16.6 2018/10/15 22:06:16 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sysv.h"
@@ -61,11 +61,10 @@ __KERNEL_RCSID(0, "$NetBSD: sysv_ipc.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 	/* for sysctl routine vector */
 
-int (*vec_sysvipc50_sysctl)(SYSCTLFN_PROTO);
-
 /*
  * Values in 

CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 22:06:16 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_sysv_50_mod.c
compat_sysv_mod.h
src/sys/kern [pgoyette-compat]: compat_stub.c sysv_ipc.c
src/sys/sys [pgoyette-compat]: compat_stub.h

Log Message:
Convert the final non-MP-safe "vectored" compat routine to use the
MP-safe mechanism.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/compat/common/compat_sysv_50_mod.c \
src/sys/compat/common/compat_sysv_mod.h
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.32.16.5 -r1.32.16.6 src/sys/kern/sysv_ipc.c
cvs rdiff -u -r1.1.2.43 -r1.1.2.44 src/sys/sys/compat_stub.h

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



CVS commit: [jdolecek-ncqfixes] src/sys/dev

2018-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Oct 15 21:18:53 UTC 2018

Modified Files:
src/sys/dev/ata [jdolecek-ncqfixes]: TODO.ncq ata.c ata_recovery.c
ata_wdc.c atavar.h
src/sys/dev/ic [jdolecek-ncqfixes]: ahcisata_core.c mvsata.c siisata.c
src/sys/dev/usb [jdolecek-ncqfixes]: umass_isdata.c

Log Message:
change the SATA/NCQ recovery to run in the atabus thread


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.14 -r1.4.2.15 src/sys/dev/ata/TODO.ncq
cvs rdiff -u -r1.141.6.17 -r1.141.6.18 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/dev/ata/ata_recovery.c
cvs rdiff -u -r1.110.4.3 -r1.110.4.4 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.99.2.11 -r1.99.2.12 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.62.2.9 -r1.62.2.10 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.41.2.10 -r1.41.2.11 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.35.6.9 -r1.35.6.10 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.36.6.1 -r1.36.6.2 src/sys/dev/usb/umass_isdata.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/ata/TODO.ncq
diff -u src/sys/dev/ata/TODO.ncq:1.4.2.14 src/sys/dev/ata/TODO.ncq:1.4.2.15
--- src/sys/dev/ata/TODO.ncq:1.4.2.14	Sun Oct 14 14:50:54 2018
+++ src/sys/dev/ata/TODO.ncq	Mon Oct 15 21:18:53 2018
@@ -1,9 +1,6 @@
 jdolecek-ncqfixes goals:
 - re-check READ LOG EXT handling under native and Parallels to make sure
   the NOERROR under Parallels is their bug and not ours
-- run recovery via atathread, move to new function and share ahci/siisata/mvsata
-- maybe do device error handling in not-interrupt-context (maybe this should be
-  done on a mpata branch?)
 
 Bugs
 

Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.141.6.17 src/sys/dev/ata/ata.c:1.141.6.18
--- src/sys/dev/ata/ata.c:1.141.6.17	Sun Oct 14 16:13:51 2018
+++ src/sys/dev/ata/ata.c	Mon Oct 15 21:18:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.141.6.17 2018/10/14 16:13:51 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.141.6.18 2018/10/15 21:18:53 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.17 2018/10/14 16:13:51 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.18 2018/10/15 21:18:53 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -129,7 +129,6 @@ static bool atabus_suspend(device_t, con
 static void atabusconfig_thread(void *);
 
 static void ata_channel_idle(struct ata_channel *);
-static void ata_channel_thaw_locked(struct ata_channel *);
 static void ata_activate_xfer_locked(struct ata_channel *, struct ata_xfer *);
 static void ata_channel_freeze_locked(struct ata_channel *);
 static void ata_thread_wake_locked(struct ata_channel *);
@@ -463,7 +462,7 @@ atabus_thread(void *arg)
 	ata_channel_lock(chp);
 	for (;;) {
 		if ((chp->ch_flags & (ATACH_TH_RESET | ATACH_TH_DRIVE_RESET
-		| ATACH_SHUTDOWN)) == 0 &&
+		| ATACH_TH_RECOVERY | ATACH_SHUTDOWN)) == 0 &&
 		(chq->queue_active == 0 || chq->queue_freeze == 0)) {
 			chp->ch_flags &= ~ATACH_TH_RUN;
 			cv_wait(>ch_thr_idle, >ch_lock);
@@ -483,6 +482,7 @@ atabus_thread(void *arg)
 			ata_thread_run(chp, AT_WAIT,
 			ATACH_TH_RESET, ATACH_NODRIVE);
 		} else if (chp->ch_flags & ATACH_TH_DRIVE_RESET) {
+			/* this will unfreeze the channel */
 			for (i = 0; i < chp->ch_ndrives; i++) {
 struct ata_drive_datas *drvp;
 
@@ -494,6 +494,16 @@ atabus_thread(void *arg)
 }
 			}
 			chp->ch_flags &= ~ATACH_TH_DRIVE_RESET;
+		} else if (chp->ch_flags & ATACH_TH_RECOVERY) {
+			/*
+			 * This will unfreeze the channel; drops locks during
+			 * run, so must wrap in splbio()/splx() to avoid
+			 * spurious interrupts. XXX MPSAFE
+			 */
+			int s = splbio();
+			ata_thread_run(chp, AT_WAIT, ATACH_TH_RECOVERY,
+			chp->recovery_tfd);
+			splx(s);
 		} else if (chq->queue_active > 0 && chq->queue_freeze == 1) {
 			/*
 			 * Caller has bumped queue_freeze, decrease it. This
@@ -522,10 +532,12 @@ atabus_thread(void *arg)
 		} else if (chq->queue_freeze > 1)
 			panic("%s: queue_freeze", __func__);
 
-		/* Try to run down the queue once after each event is handled */
-		ata_channel_unlock(chp);
-		atastart(chp);
-		ata_channel_lock(chp);
+		/* Try to run down the queue once channel is unfrozen */
+		if (chq->queue_freeze == 0) {
+			ata_channel_unlock(chp);
+			atastart(chp);
+			ata_channel_lock(chp);
+		}
 	}
 	chp->ch_thread = NULL;
 	cv_signal(>ch_thr_idle);
@@ -1499,7 +1511,7 @@ ata_channel_freeze(struct ata_channel *c
 	ata_channel_unlock(chp);
 }
 
-static void
+void
 ata_channel_thaw_locked(struct ata_channel *chp)
 {
 	KASSERT(mutex_owned(>ch_lock));
@@ -1511,21 +1523,13 @@ ata_channel_thaw_locked(struct ata_chann
 	chp->ch_queue->queue_freeze), DEBUG_FUNCS | DEBUG_XFERS);
 }
 
-void
-ata_channel_thaw(struct ata_channel *chp)
-{
-	ata_channel_lock(chp);
-	

CVS commit: [jdolecek-ncqfixes] src/sys/dev

2018-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Oct 15 21:18:53 UTC 2018

Modified Files:
src/sys/dev/ata [jdolecek-ncqfixes]: TODO.ncq ata.c ata_recovery.c
ata_wdc.c atavar.h
src/sys/dev/ic [jdolecek-ncqfixes]: ahcisata_core.c mvsata.c siisata.c
src/sys/dev/usb [jdolecek-ncqfixes]: umass_isdata.c

Log Message:
change the SATA/NCQ recovery to run in the atabus thread


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.14 -r1.4.2.15 src/sys/dev/ata/TODO.ncq
cvs rdiff -u -r1.141.6.17 -r1.141.6.18 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/dev/ata/ata_recovery.c
cvs rdiff -u -r1.110.4.3 -r1.110.4.4 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.99.2.11 -r1.99.2.12 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.62.2.9 -r1.62.2.10 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.41.2.10 -r1.41.2.11 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.35.6.9 -r1.35.6.10 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.36.6.1 -r1.36.6.2 src/sys/dev/usb/umass_isdata.c

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



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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 20:09:06 UTC 2018

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

Log Message:
Handle more plcom-style console types


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.



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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 20:09:06 UTC 2018

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

Log Message:
Handle more plcom-style console types


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/sys/arch/arm/acpi/acpi_platform.c:1.3
--- src/sys/arch/arm/acpi/acpi_platform.c:1.2	Sat Oct 13 00:08:29 2018
+++ src/sys/arch/arm/acpi/acpi_platform.c	Mon Oct 15 20:09:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.2 2018/10/13 00:08:29 jmcneill Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.3 2018/10/15 20:09:06 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.2 2018/10/13 00:08:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.3 2018/10/15 20:09:06 jmcneill Exp $");
 
 #include 
 #include 
@@ -63,7 +63,16 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_platfor
 #include 
 #include 
 
-#define	SPCR_INTERFACE_TYPE_PL011	0x0003
+#define	SPCR_INTERFACE_TYPE_PL011		0x0003
+#define	SPCR_INTERFACE_TYPE_SBSA_32BIT		0x000d
+#define	SPCR_INTERFACE_TYPE_SBSA_GENERIC	0x000e
+#define	SPCR_INTERFACE_TYPE_BCM2835		0x0010
+
+#define	SPCR_BAUD_UNKNOWN			0
+#define	SPCR_BAUD_96003
+#define	SPCR_BAUD_192004
+#define	SPCR_BAUD_576006
+#define	SPCR_BAUD_115200			7
 
 extern struct bus_space arm_generic_bs_tag;
 
@@ -90,22 +99,49 @@ acpi_platform_startup(void)
 	ACPI_TABLE_SPCR *spcr;
 	ACPI_TABLE_FADT *fadt;
 	ACPI_TABLE_MADT *madt;
+	int baud_rate;
 
 	/*
 	 * Setup serial console device
 	 */
 	if (ACPI_SUCCESS(acpi_table_find(ACPI_SIG_SPCR, (void ** {
-		if (spcr->InterfaceType == SPCR_INTERFACE_TYPE_PL011 &&
-		spcr->SerialPort.SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY &&
+		if (spcr->SerialPort.SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY &&
 		spcr->SerialPort.Address != 0) {
+			switch (spcr->InterfaceType) {
+			case SPCR_INTERFACE_TYPE_PL011:
+			case SPCR_INTERFACE_TYPE_SBSA_32BIT:
+			case SPCR_INTERFACE_TYPE_SBSA_GENERIC:
+			case SPCR_INTERFACE_TYPE_BCM2835:
+plcom_console.pi_type = PLCOM_TYPE_PL011;
+plcom_console.pi_iot = _generic_bs_tag;
+plcom_console.pi_iobase = spcr->SerialPort.Address;
+plcom_console.pi_size = PL011COM_UART_SIZE;
+if (spcr->InterfaceType == SPCR_INTERFACE_TYPE_SBSA_32BIT) {
+	plcom_console.pi_flags = PLC_FLAG_32BIT_ACCESS;
+} else {
+	plcom_console.pi_flags = ACPI_ACCESS_BIT_WIDTH(spcr->SerialPort.AccessWidth) == 8 ?
+	0 : PLC_FLAG_32BIT_ACCESS;
+}
+switch (spcr->BaudRate) {
+case SPCR_BAUD_9600:
+	baud_rate = 9600;
+	break;
+case SPCR_BAUD_19200:
+	baud_rate = 19200;
+	break;
+case SPCR_BAUD_57600:
+	baud_rate = 57600;
+	break;
+case SPCR_BAUD_115200:
+case SPCR_BAUD_UNKNOWN:
+default:
+	baud_rate = 115200;
+	break;
+}
 
-			plcom_console.pi_type = PLCOM_TYPE_PL011;
-			plcom_console.pi_flags = PLC_FLAG_32BIT_ACCESS;
-			plcom_console.pi_iot = _generic_bs_tag;
-			plcom_console.pi_iobase = spcr->SerialPort.Address;
-			plcom_console.pi_size = PL011COM_UART_SIZE;
-
-			plcomcnattach(_console, 115200 /* XXX */, 0, TTYDEF_CFLAG, -1);
+plcomcnattach(_console, baud_rate, 0, TTYDEF_CFLAG, -1);
+break;
+			}
 		}
 		acpi_table_unmap((ACPI_TABLE_HEADER *)spcr);
 	}



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

2018-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 15 19:32:48 UTC 2018

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

Log Message:
use postincrement, like the patch
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/string/memmem.c

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



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

2018-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 15 19:32:48 UTC 2018

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

Log Message:
use postincrement, like the patch
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/string/memmem.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/memmem.c
diff -u src/common/lib/libc/string/memmem.c:1.2 src/common/lib/libc/string/memmem.c:1.3
--- src/common/lib/libc/string/memmem.c:1.2	Mon Oct 15 14:37:19 2018
+++ src/common/lib/libc/string/memmem.c	Mon Oct 15 15:32:48 2018
@@ -25,7 +25,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/lib/libc/string/memmem.c 315468 2017-03-18 00:53:24Z emaste $");
 #else
-__RCSID("$NetBSD: memmem.c,v 1.2 2018/10/15 18:37:19 christos Exp $");
+__RCSID("$NetBSD: memmem.c,v 1.3 2018/10/15 19:32:48 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -40,7 +40,7 @@ static char *twobyte_memmem(const unsign
 const unsigned char *n)
 {
 	uint16_t nw = n[0] << 8 | n[1], hw = h[0] << 8 | h[1];
-	for (h += 2, k -= 2; k; k--, hw = hw << 8 | *++h)
+	for (h += 2, k -= 2; k; k--, hw = hw << 8 | *h++)
 		if (hw == nw) return __UNCONST(h - 2);
 	return hw == nw ? __UNCONST(h - 2) : 0;
 }
@@ -50,7 +50,7 @@ static char *threebyte_memmem(const unsi
 {
 	uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8;
 	uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8;
-	for (h += 3, k -= 3; k; k--, hw = (hw|*++h) << 8)
+	for (h += 3, k -= 3; k; k--, hw = (hw|*h++) << 8)
 		if (hw == nw) return __UNCONST(h - 3);
 	return hw == nw ? __UNCONST(h - 3) : 0;
 }
@@ -60,7 +60,7 @@ static char *fourbyte_memmem(const unsig
 {
 	uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3];
 	uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3];
-	for (h += 4, k -= 4; k; k--, hw = hw << 8 | *++h)
+	for (h += 4, k -= 4; k; k--, hw = hw << 8 | *h++)
 		if (hw == nw) return __UNCONST(h - 4);
 	return hw == nw ? __UNCONST(h - 4) : 0;
 	return 0;



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Oct 15 18:58:35 UTC 2018

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

Log Message:
revert previous, arm doesn't have intr_establish_xname()

pointed out by jmcneill


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/ahcisata_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/ahcisata_acpi.c
diff -u src/sys/dev/acpi/ahcisata_acpi.c:1.2 src/sys/dev/acpi/ahcisata_acpi.c:1.3
--- src/sys/dev/acpi/ahcisata_acpi.c:1.2	Mon Oct 15 06:58:08 2018
+++ src/sys/dev/acpi/ahcisata_acpi.c	Mon Oct 15 18:58:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ahcisata_acpi.c,v 1.2 2018/10/15 06:58:08 jdolecek Exp $ */
+/* $NetBSD: ahcisata_acpi.c,v 1.3 2018/10/15 18:58:35 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_acpi.c,v 1.2 2018/10/15 06:58:08 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_acpi.c,v 1.3 2018/10/15 18:58:35 jdolecek Exp $");
 
 #include 
 #include 
@@ -103,8 +103,7 @@ ahcisata_acpi_attach(device_t parent, de
 	}
 
 	const int type = (irq->ar_type == ACPI_EDGE_SENSITIVE) ? IST_EDGE : IST_LEVEL;
-	ih = intr_establish_xname(irq->ar_irq, IPL_BIO, type, ahci_intr, sc,
-	device_xname(self));
+	ih = intr_establish(irq->ar_irq, IPL_BIO, type, ahci_intr, sc);
 	if (ih == NULL) {
 		aprint_error_dev(self, "couldn't install interrupt handler\n");
 		return;



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Oct 15 18:58:35 UTC 2018

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

Log Message:
revert previous, arm doesn't have intr_establish_xname()

pointed out by jmcneill


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/ahcisata_acpi.c

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



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

2018-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 15 18:37:19 UTC 2018

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

Log Message:
Avoid out-of-bounds reads
https://www.openwall.com/lists/musl/2017/06/29/6
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/string/memmem.c

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



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

2018-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 15 18:37:19 UTC 2018

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

Log Message:
Avoid out-of-bounds reads
https://www.openwall.com/lists/musl/2017/06/29/6
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/string/memmem.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/memmem.c
diff -u src/common/lib/libc/string/memmem.c:1.1 src/common/lib/libc/string/memmem.c:1.2
--- src/common/lib/libc/string/memmem.c:1.1	Sun Jul  8 13:53:12 2018
+++ src/common/lib/libc/string/memmem.c	Mon Oct 15 14:37:19 2018
@@ -25,7 +25,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/lib/libc/string/memmem.c 315468 2017-03-18 00:53:24Z emaste $");
 #else
-__RCSID("$NetBSD: memmem.c,v 1.1 2018/07/08 17:53:12 christos Exp $");
+__RCSID("$NetBSD: memmem.c,v 1.2 2018/10/15 18:37:19 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -36,29 +36,33 @@ __RCSID("$NetBSD: memmem.c,v 1.1 2018/07
 #include 
 #endif 
 
-static char *twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
+static char *twobyte_memmem(const unsigned char *h, size_t k,
+const unsigned char *n)
 {
-	uint16_t nw = n[0]<<8 | n[1], hw = h[0]<<8 | h[1];
-	for (h++, k--; k; k--, hw = hw<<8 | *++h)
-		if (hw == nw) return __UNCONST(h-1);
-	return 0;
+	uint16_t nw = n[0] << 8 | n[1], hw = h[0] << 8 | h[1];
+	for (h += 2, k -= 2; k; k--, hw = hw << 8 | *++h)
+		if (hw == nw) return __UNCONST(h - 2);
+	return hw == nw ? __UNCONST(h - 2) : 0;
 }
 
-static char *threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
+static char *threebyte_memmem(const unsigned char *h, size_t k,
+const unsigned char *n)
 {
-	uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8;
-	uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8;
-	for (h+=2, k-=2; k; k--, hw = (hw|*++h)<<8)
-		if (hw == nw) return __UNCONST(h-2);
-	return 0;
+	uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8;
+	uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8;
+	for (h += 3, k -= 3; k; k--, hw = (hw|*++h) << 8)
+		if (hw == nw) return __UNCONST(h - 3);
+	return hw == nw ? __UNCONST(h - 3) : 0;
 }
 
-static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
+static char *fourbyte_memmem(const unsigned char *h, size_t k,
+const unsigned char *n)
 {
-	uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3];
-	uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3];
-	for (h+=3, k-=3; k; k--, hw = hw<<8 | *++h)
-		if (hw == nw) return __UNCONST(h-3);
+	uint32_t nw = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3];
+	uint32_t hw = h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3];
+	for (h += 4, k -= 4; k; k--, hw = hw << 8 | *++h)
+		if (hw == nw) return __UNCONST(h - 4);
+	return hw == nw ? __UNCONST(h - 4) : 0;
 	return 0;
 }
 



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

2018-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 15 17:55:28 UTC 2018

Modified Files:
src/tests/lib/libc/string: Makefile t_memmem.c

Log Message:
simple memmem test to show buffer overrun.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libc/string/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/string/t_memmem.c

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

Modified files:

Index: src/tests/lib/libc/string/Makefile
diff -u src/tests/lib/libc/string/Makefile:1.10 src/tests/lib/libc/string/Makefile:1.11
--- src/tests/lib/libc/string/Makefile:1.10	Thu May 25 21:24:19 2017
+++ src/tests/lib/libc/string/Makefile	Mon Oct 15 13:55:28 2018
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.10 2017/05/26 01:24:19 perseant Exp $
+# $NetBSD: Makefile,v 1.11 2018/10/15 17:55:28 christos Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libc/string
+DBG=-g
 
 TESTS_C+=	t_bm
 TESTS_C+=	t_memchr

Index: src/tests/lib/libc/string/t_memmem.c
diff -u src/tests/lib/libc/string/t_memmem.c:1.3 src/tests/lib/libc/string/t_memmem.c:1.4
--- src/tests/lib/libc/string/t_memmem.c:1.3	Wed Jan 11 13:07:37 2017
+++ src/tests/lib/libc/string/t_memmem.c	Mon Oct 15 13:55:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_memmem.c,v 1.3 2017/01/11 18:07:37 christos Exp $ */
+/*	$NetBSD: t_memmem.c,v 1.4 2018/10/15 17:55:28 christos Exp $ */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 char p0[] = "";
 int lp0 = 0;
@@ -94,10 +95,40 @@ ATF_TC_BODY(memmem_basic, tc)
 	expect(memmem(b2, lb2, p8, lp8) == NULL);
 }
 
+ATF_TC(memmem_oob);
+ATF_TC_HEAD(memmem_oob, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test memmem out of bounds read");
+}
+
+ATF_TC_BODY(memmem_oob, tc)
+{
+	static const char str[] = "abcde";
+	size_t pg = getpagesize();
+	char *src = mmap(NULL, pg, PROT_READ|PROT_WRITE,
+	MAP_ANON|MAP_PRIVATE, -1, (off_t)0);
+	ATF_CHECK(src != MAP_FAILED); 
+	char *guard = mmap(src + pg, pg,
+	PROT_NONE, MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, (off_t)0);
+	for (size_t i = 2; i < 5; i++) {
+		char *search = src + pg - i;
+		char match[sizeof(str)];
+		search[-1] = str[0];
+		search[0] = str[0];
+		search[1] = str[0];
+		memcpy(match, str, i);
+		ATF_CHECK(memmem(search, i, match, i) != search);
+	}
+	munmap(guard, pg);
+	munmap(src, pg);
+}
+
+
 ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, memmem_basic);
+	ATF_TP_ADD_TC(tp, memmem_oob);
 
 	return atf_no_error();
 }



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

2018-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 15 17:55:28 UTC 2018

Modified Files:
src/tests/lib/libc/string: Makefile t_memmem.c

Log Message:
simple memmem test to show buffer overrun.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libc/string/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/string/t_memmem.c

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



CVS commit: src/sys/arch/evbarm

2018-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Oct 15 16:54:55 UTC 2018

Modified Files:
src/sys/arch/evbarm/armadaxp: armadaxp_start.S
src/sys/arch/evbarm/conf: OPENBLOCKS_AX3 std.altera std.amlogic
std.armadaxp std.bcm53xx std.beagle std.exynos std.igepv2 std.imx31
std.imx6ul std.imx7 std.kobo std.n900 std.netwalker std.nitrogen6
std.overo std.rpi std.sunxi std.tegra std.ti std.tisdp24xx
std.vexpress std.virt std.zynq
src/sys/arch/evbarm/imx31: imx31lk_start.S
src/sys/arch/evbarm/marvell: marvell_start.S

Log Message:
Only ent KERNEL_BASE_EXT when we want to change KERNEL_BASE from its
default of 0x8000_

Don't use KERNEL_BASE_EXT where KERNEL_BASE should be instead.

Workaround a as(1) weirdness in armadaxp_start.S


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/armadaxp/armadaxp_start.S
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/conf/OPENBLOCKS_AX3
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/std.altera \
src/sys/arch/evbarm/conf/std.imx6ul src/sys/arch/evbarm/conf/std.imx7 \
src/sys/arch/evbarm/conf/std.kobo
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.amlogic \
src/sys/arch/evbarm/conf/std.armadaxp src/sys/arch/evbarm/conf/std.n900 \
src/sys/arch/evbarm/conf/std.sunxi
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/std.bcm53xx \
src/sys/arch/evbarm/conf/std.beagle
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/std.exynos
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/std.igepv2 \
src/sys/arch/evbarm/conf/std.overo src/sys/arch/evbarm/conf/std.vexpress
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/conf/std.imx31 \
src/sys/arch/evbarm/conf/std.tisdp24xx
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/std.netwalker
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/std.nitrogen6
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/std.rpi
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/std.tegra
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/std.ti
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/std.virt
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/std.zynq
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/imx31/imx31lk_start.S
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/marvell/marvell_start.S

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

Modified files:

Index: src/sys/arch/evbarm/armadaxp/armadaxp_start.S
diff -u src/sys/arch/evbarm/armadaxp/armadaxp_start.S:1.4 src/sys/arch/evbarm/armadaxp/armadaxp_start.S:1.5
--- src/sys/arch/evbarm/armadaxp/armadaxp_start.S:1.4	Wed Apr 15 10:15:40 2015
+++ src/sys/arch/evbarm/armadaxp/armadaxp_start.S	Mon Oct 15 16:54:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: armadaxp_start.S,v 1.4 2015/04/15 10:15:40 hsuenaga Exp $	*/
+/*	$NetBSD: armadaxp_start.S,v 1.5 2018/10/15 16:54:54 skrll Exp $	*/
 /***
 Copyright (C) Marvell International Ltd. and its affiliates
 
@@ -44,7 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: armadaxp_start.S,v 1.4 2015/04/15 10:15:40 hsuenaga Exp $")
+RCSID("$NetBSD: armadaxp_start.S,v 1.5 2018/10/15 16:54:54 skrll Exp $")
 
 #ifdef KERNEL_BASES_EQUAL
 #error KERNEL_BASE_VIRT should not equal KERNEL_BASE_PHYS
@@ -143,8 +143,8 @@ uboot_regs_pa:
 
 #define MMU_INIT(va,pa,n_sec,attr) \
 	.word	n_sec	; \
-	.word	4*((va)>>L1_S_SHIFT)			; \
-	.word	(pa)|(attr);
+	.word	4*((va & 0x)>>L1_S_SHIFT)	; \
+	.word	(pa & 0xf000)|(attr)		;
 
 mmu_init_table:
 	/* fill all table VA==PA */
@@ -152,9 +152,9 @@ mmu_init_table:
 	MMU_INIT(MEMSTART, MEMSTART, 64, L1_TYPE_S|L1_S_C|L1_S_AP_KRW)
 
 	/* map VA 0x8000..0x83ff to PA */
-	MMU_INIT(KERNEL_BASE_EXT, MEMSTART, 64, L1_TYPE_S|L1_S_C|L1_S_AP_KRW)
+	MMU_INIT(KERNEL_BASE, MEMSTART, 64, L1_TYPE_S|L1_S_C|L1_S_AP_KRW)
 
-	/* 
+	/*
 	 * In case of early start debugging it might be useful to map
 	 * SoC registers (for UART access).
 	 */

Index: src/sys/arch/evbarm/conf/OPENBLOCKS_AX3
diff -u src/sys/arch/evbarm/conf/OPENBLOCKS_AX3:1.25 src/sys/arch/evbarm/conf/OPENBLOCKS_AX3:1.26
--- src/sys/arch/evbarm/conf/OPENBLOCKS_AX3:1.25	Wed Aug  1 20:04:11 2018
+++ src/sys/arch/evbarm/conf/OPENBLOCKS_AX3	Mon Oct 15 16:54:54 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: OPENBLOCKS_AX3,v 1.25 2018/08/01 20:04:11 maxv Exp $
+#	$NetBSD: OPENBLOCKS_AX3,v 1.26 2018/10/15 16:54:54 skrll Exp $
 #
 #	OPENBLOCKS_AX3 -- Plat'Home. OpenBlockS AX3 kernel
 #
@@ -33,8 +33,6 @@ options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 #options 	MULTIPROCESSOR
 options 	TPIDRPRW_IS_CURCPU
 
-no options 	KERNEL_BASE_EXT
-options 	KERNEL_BASE_EXT=0x8000
 makeoptions 	KERNEL_BASE_VIRT="0x80008000"
 
 # Standard system options

Index: src/sys/arch/evbarm/conf/std.altera
diff -u src/sys/arch/evbarm/conf/std.altera:1.3 src/sys/arch/evbarm/conf/std.altera:1.4

CVS commit: src/sys/arch/evbarm

2018-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Oct 15 16:54:55 UTC 2018

Modified Files:
src/sys/arch/evbarm/armadaxp: armadaxp_start.S
src/sys/arch/evbarm/conf: OPENBLOCKS_AX3 std.altera std.amlogic
std.armadaxp std.bcm53xx std.beagle std.exynos std.igepv2 std.imx31
std.imx6ul std.imx7 std.kobo std.n900 std.netwalker std.nitrogen6
std.overo std.rpi std.sunxi std.tegra std.ti std.tisdp24xx
std.vexpress std.virt std.zynq
src/sys/arch/evbarm/imx31: imx31lk_start.S
src/sys/arch/evbarm/marvell: marvell_start.S

Log Message:
Only ent KERNEL_BASE_EXT when we want to change KERNEL_BASE from its
default of 0x8000_

Don't use KERNEL_BASE_EXT where KERNEL_BASE should be instead.

Workaround a as(1) weirdness in armadaxp_start.S


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/armadaxp/armadaxp_start.S
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/conf/OPENBLOCKS_AX3
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/std.altera \
src/sys/arch/evbarm/conf/std.imx6ul src/sys/arch/evbarm/conf/std.imx7 \
src/sys/arch/evbarm/conf/std.kobo
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.amlogic \
src/sys/arch/evbarm/conf/std.armadaxp src/sys/arch/evbarm/conf/std.n900 \
src/sys/arch/evbarm/conf/std.sunxi
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/std.bcm53xx \
src/sys/arch/evbarm/conf/std.beagle
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/std.exynos
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/std.igepv2 \
src/sys/arch/evbarm/conf/std.overo src/sys/arch/evbarm/conf/std.vexpress
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/conf/std.imx31 \
src/sys/arch/evbarm/conf/std.tisdp24xx
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/std.netwalker
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/std.nitrogen6
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/std.rpi
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/std.tegra
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/std.ti
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/std.virt
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/std.zynq
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/imx31/imx31lk_start.S
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/marvell/marvell_start.S

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



CVS commit: src/sys/dev/pci

2018-10-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Oct 15 16:29:10 UTC 2018

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

Log Message:
Apply OpenBSD if_bwfm_pci.c:1.25 by patrick:

Add bus_dmamap_sync(9) calls to bwfm(4) so that we make sure the data
is synced properly before the CPU or the WiFi chip access the supplied
memory.  Makes PCIe-connected bwfm(4) work on ARM-based machines.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_bwfm_pci.c

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



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 12:46:43 UTC 2018

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

Log Message:
Fix signature for acpimcfg_configure_bus in non-PCI_NETBSD_CONFIGURE case


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/acpi/acpi_mcfg.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/acpi_mcfg.c
diff -u src/sys/dev/acpi/acpi_mcfg.c:1.8 src/sys/dev/acpi/acpi_mcfg.c:1.9
--- src/sys/dev/acpi/acpi_mcfg.c:1.8	Mon Oct 15 10:01:32 2018
+++ src/sys/dev/acpi/acpi_mcfg.c	Mon Oct 15 12:46:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_mcfg.c,v 1.8 2018/10/15 10:01:32 jmcneill Exp $	*/
+/*	$NetBSD: acpi_mcfg.c,v 1.9 2018/10/15 12:46:43 jmcneill Exp $	*/
 
 /*-
  * Copyright (C) 2015 NONAKA Kimihiro 
@@ -28,7 +28,7 @@
 #include "opt_pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.8 2018/10/15 10:01:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.9 2018/10/15 12:46:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -878,7 +878,7 @@ cleanup:
 #else
 int
 acpimcfg_configure_bus(device_t self, pci_chipset_tag_t pc, ACPI_HANDLE handle,
-int cacheline_size)
+int bus, int cacheline_size)
 {
 	return ENXIO;
 }



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 12:46:43 UTC 2018

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

Log Message:
Fix signature for acpimcfg_configure_bus in non-PCI_NETBSD_CONFIGURE case


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/acpi/acpi_mcfg.c

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



CVS commit: src/crypto/external/bsd/openssl/include/openssl

2018-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 15 12:45:53 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/include/openssl: opensslconf.h

Log Message:
Ooops - fix editor accident in previous


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl/include/openssl/opensslconf.h

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

Modified files:

Index: src/crypto/external/bsd/openssl/include/openssl/opensslconf.h
diff -u src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.5 src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.6
--- src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.5	Mon Oct 15 12:27:58 2018
+++ src/crypto/external/bsd/openssl/include/openssl/opensslconf.h	Mon Oct 15 12:45:52 2018
@@ -50,7 +50,7 @@ extern "C" {
 #endif
 #if !defined(_LP64) || defined(__sparc64__)
 # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
-  define OPENSSL_NO_EC_NISTP_64_GCC_128
+#  define OPENSSL_NO_EC_NISTP_64_GCC_128
 # endif
 #endif
 #ifndef OPENSSL_NO_EGD



CVS commit: src/crypto/external/bsd/openssl/include/openssl

2018-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 15 12:45:53 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/include/openssl: opensslconf.h

Log Message:
Ooops - fix editor accident in previous


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl/include/openssl/opensslconf.h

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



CVS commit: src/crypto/external/bsd/openssl/include/openssl

2018-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 15 12:27:58 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/include/openssl: opensslconf.h

Log Message:
Define OPENSSL_NO_EC_NISTP_64_GCC_128 for sparc64, the code does
not work there (or maybe any big endian machine).
Fixes PR bin/53670.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/include/openssl/opensslconf.h

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



CVS commit: src/crypto/external/bsd/openssl/include/openssl

2018-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 15 12:27:58 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/include/openssl: opensslconf.h

Log Message:
Define OPENSSL_NO_EC_NISTP_64_GCC_128 for sparc64, the code does
not work there (or maybe any big endian machine).
Fixes PR bin/53670.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/include/openssl/opensslconf.h

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

Modified files:

Index: src/crypto/external/bsd/openssl/include/openssl/opensslconf.h
diff -u src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.4 src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.5
--- src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.4	Wed Oct 10 06:16:55 2018
+++ src/crypto/external/bsd/openssl/include/openssl/opensslconf.h	Mon Oct 15 12:27:58 2018
@@ -48,9 +48,9 @@ extern "C" {
 #ifndef OPENSSL_NO_DEVCRYPTOENG
 # define OPENSSL_NO_DEVCRYPTOENG
 #endif
-#ifndef _LP64
+#if !defined(_LP64) || defined(__sparc64__)
 # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
-#  define OPENSSL_NO_EC_NISTP_64_GCC_128
+  define OPENSSL_NO_EC_NISTP_64_GCC_128
 # endif
 #endif
 #ifndef OPENSSL_NO_EGD



CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 11:57:06 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_70_mod.c
uipc_usrreq_70.c
src/sys/compat/sys [pgoyette-compat]: socket.h
src/sys/kern [pgoyette-compat]: compat_stub.c uipc_usrreq.c
src/sys/sys [pgoyette-compat]: compat_stub.h

Log Message:
Convert the compat70_unp_addsockcred hook to the MP-safe mechanism.

XXX One more remaining: sysvipc50_sysctl


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/compat/common/compat_70_mod.c
cvs rdiff -u -r1.1.20.2 -r1.1.20.3 src/sys/compat/common/uipc_usrreq_70.c
cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/compat/sys/socket.h
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.183.2.4 -r1.183.2.5 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 src/sys/sys/compat_stub.h

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



CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 11:57:06 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_70_mod.c
uipc_usrreq_70.c
src/sys/compat/sys [pgoyette-compat]: socket.h
src/sys/kern [pgoyette-compat]: compat_stub.c uipc_usrreq.c
src/sys/sys [pgoyette-compat]: compat_stub.h

Log Message:
Convert the compat70_unp_addsockcred hook to the MP-safe mechanism.

XXX One more remaining: sysvipc50_sysctl


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/compat/common/compat_70_mod.c
cvs rdiff -u -r1.1.20.2 -r1.1.20.3 src/sys/compat/common/uipc_usrreq_70.c
cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/compat/sys/socket.h
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.183.2.4 -r1.183.2.5 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 src/sys/sys/compat_stub.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/compat/common/compat_70_mod.c
diff -u src/sys/compat/common/compat_70_mod.c:1.1.2.11 src/sys/compat/common/compat_70_mod.c:1.1.2.12
--- src/sys/compat/common/compat_70_mod.c:1.1.2.11	Mon Oct 15 09:51:33 2018
+++ src/sys/compat/common/compat_70_mod.c	Mon Oct 15 11:57:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_70_mod.c,v 1.1.2.11 2018/10/15 09:51:33 pgoyette Exp $	*/
+/*	$NetBSD: compat_70_mod.c,v 1.1.2.12 2018/10/15 11:57:05 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_70_mod.c,v 1.1.2.11 2018/10/15 09:51:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_70_mod.c,v 1.1.2.12 2018/10/15 11:57:05 pgoyette Exp $");
 
 #include 
 #include 
@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: compat_70_mo
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -58,6 +59,7 @@ int compat_70_init(void)
 
 	compat70_ocreds_valid = true;
 	rtsock_70_init();
+	uipc_usrreq_70_init();
 
 	return 0;
 }
@@ -65,6 +67,7 @@ int compat_70_init(void)
 int compat_70_fini(void)
 {
 
+	uipc_usrreq_70_fini();
 	rtsock_70_fini();
 	compat70_ocreds_valid = false;
 

Index: src/sys/compat/common/uipc_usrreq_70.c
diff -u src/sys/compat/common/uipc_usrreq_70.c:1.1.20.2 src/sys/compat/common/uipc_usrreq_70.c:1.1.20.3
--- src/sys/compat/common/uipc_usrreq_70.c:1.1.20.2	Sat Sep 22 04:56:28 2018
+++ src/sys/compat/common/uipc_usrreq_70.c	Mon Oct 15 11:57:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq_70.c,v 1.1.20.2 2018/09/22 04:56:28 pgoyette Exp $	*/
+/*	$NetBSD: uipc_usrreq_70.c,v 1.1.20.3 2018/10/15 11:57:05 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq_70.c,v 1.1.20.2 2018/09/22 04:56:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq_70.c,v 1.1.20.3 2018/10/15 11:57:05 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -43,11 +43,12 @@ __KERNEL_RCSID(0, "$NetBSD: uipc_usrreq_
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
-struct mbuf *
-compat_70_unp_addsockcred(struct lwp *l, struct mbuf *control)
+int
+compat_70_unp_addsockcred(struct mbuf **ret, struct lwp *l, struct mbuf *control)
 {
 	struct sockcred70 *sc;
 	struct mbuf *m;
@@ -55,8 +56,10 @@ compat_70_unp_addsockcred(struct lwp *l,
 
 	m = sbcreatecontrol1(, SOCKCRED70SIZE(kauth_cred_ngroups(l->l_cred)),
 		SCM_OCREDS, SOL_SOCKET, M_WAITOK);
-	if (m == NULL)
-		return control;
+	if (m == NULL) {
+		*ret = control;
+		return 0;
+	}
 
 	sc = p;
 	sc->sc_uid = kauth_cred_getuid(l->l_cred);
@@ -68,5 +71,23 @@ compat_70_unp_addsockcred(struct lwp *l,
 	for (int i = 0; i < sc->sc_ngroups; i++)
 		sc->sc_groups[i] = kauth_cred_group(l->l_cred, i);
 
-	return m_add(control, m);
+	*ret = m_add(control, m);
+	return 0;
+}
+
+MODULE_SET_HOOK(compat_70_unp_hook, "unp_70", compat_70_unp_addsockcred);
+MODULE_UNSET_HOOK(compat_70_unp_hook);
+
+void
+uipc_usrreq_70_init(void)
+{
+
+	compat_70_unp_hook_set();
+}
+
+void
+uipc_usrreq_70_fini(void)
+{
+
+	compat_70_unp_hook_unset();
 }

Index: src/sys/compat/sys/socket.h
diff -u src/sys/compat/sys/socket.h:1.15 src/sys/compat/sys/socket.h:1.15.2.1
--- src/sys/compat/sys/socket.h:1.15	Sat Jul 29 06:12:50 2017
+++ src/sys/compat/sys/socket.h	Mon Oct 15 11:57:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.h,v 1.15 2017/07/29 06:12:50 maxv Exp $	*/
+/*	$NetBSD: socket.h,v 1.15.2.1 2018/10/15 11:57:05 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
@@ -105,7 +105,10 @@ u_long compat_cvtcmd(u_long cmd);
 int compat_ifioctl(struct socket *, u_long, u_long, void *, struct lwp *);
 int compat43_set_accrights(struct msghdr *, void *, int);
 
-struct mbuf * compat_70_unp_addsockcred(struct lwp *, struct mbuf *);
+int compat_70_unp_addsockcred(struct mbuf **, struct lwp *, struct mbuf *);
+

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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 11:35:42 UTC 2018

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

Log Message:
Add acpipchb


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 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.



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

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 11:35:42 UTC 2018

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

Log Message:
Add acpipchb


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 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.46 src/sys/arch/evbarm/conf/GENERIC64:1.47
--- src/sys/arch/evbarm/conf/GENERIC64:1.46	Fri Oct 12 23:26:41 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Mon Oct 15 11:35:42 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.46 2018/10/12 23:26:41 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.47 2018/10/15 11:35:42 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -201,6 +201,7 @@ tegra210xphy*	at tegra210xpad?
 
 # PCIE
 pcihost*	at fdt?			# Generic PCI host controller
+acpipchb*	at acpi?		# ACPI PCIe host bridge
 tegrapcie0	at fdt?			# NVIDIA Tegra PCIE
 pci*		at pcibus? 
 ppb*		at pci? dev ? function ?



CVS commit: src/sys/arch/arm

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 11:35:03 UTC 2018

Modified Files:
src/sys/arch/arm/acpi: acpi_machdep.c files.acpi
src/sys/arch/arm/fdt: acpi_fdt.c
Added Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c acpi_pci_machdep.h acpipchb.c

Log Message:
Add ARM ACPI PCI support.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/acpi_machdep.c \
src/sys/arch/arm/acpi/files.acpi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/acpi/acpi_pci_machdep.c \
src/sys/arch/arm/acpi/acpi_pci_machdep.h src/sys/arch/arm/acpi/acpipchb.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/fdt/acpi_fdt.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_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.1 src/sys/arch/arm/acpi/acpi_machdep.c:1.2
--- src/sys/arch/arm/acpi/acpi_machdep.c:1.1	Fri Oct 12 22:12:11 2018
+++ src/sys/arch/arm/acpi/acpi_machdep.c	Mon Oct 15 11:35:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.1 2018/10/12 22:12:11 jmcneill Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.2 2018/10/15 11:35:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.1 2018/10/12 22:12:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.2 2018/10/15 11:35:03 jmcneill Exp $");
 
 #include 
 #include 
@@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_machdep
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -239,6 +240,8 @@ acpi_md_callback(struct acpi_softc *sc)
 {
 	ACPI_TABLE_HEADER *hdrp;
 
+	acpimcfg_init(_generic_bs_tag, NULL);
+
 	if (acpi_madt_map() != AE_OK)
 		panic("Failed to map MADT");
 	acpi_madt_walk(acpi_md_madt_probe, sc);
Index: src/sys/arch/arm/acpi/files.acpi
diff -u src/sys/arch/arm/acpi/files.acpi:1.1 src/sys/arch/arm/acpi/files.acpi:1.2
--- src/sys/arch/arm/acpi/files.acpi:1.1	Fri Oct 12 22:20:04 2018
+++ src/sys/arch/arm/acpi/files.acpi	Mon Oct 15 11:35:03 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.1 2018/10/12 22:20:04 jmcneill Exp $
+#	$NetBSD: files.acpi,v 1.2 2018/10/15 11:35:03 jmcneill Exp $
 #
 # Configuration info for ACPI compliant ARM boards.
 #
@@ -11,6 +11,7 @@ defflag	opt_pcifixup.h		ACPI_PCI_FIXUP
 include "dev/acpi/files.acpi"
 
 file	arch/arm/acpi/acpi_machdep.c		acpi
+file	arch/arm/acpi/acpi_pci_machdep.c	acpi
 file	arch/arm/acpi/acpi_platform.c		acpi
 file	arch/arm/acpi/acpi_table.c		acpi
 
@@ -25,3 +26,7 @@ file	arch/arm/acpi/gtmr_acpi.c		gtmr_acp
 
 attach	plcom at acpinodebus with plcom_acpi
 file	arch/arm/acpi/plcom_acpi.c		plcom_acpi
+
+device	acpipchb: pcibus
+attach	acpipchb at acpinodebus
+file	arch/arm/acpi/acpipchb.c		acpipchb

Index: src/sys/arch/arm/fdt/acpi_fdt.c
diff -u src/sys/arch/arm/fdt/acpi_fdt.c:1.2 src/sys/arch/arm/fdt/acpi_fdt.c:1.3
--- src/sys/arch/arm/fdt/acpi_fdt.c:1.2	Sat Oct 13 00:15:10 2018
+++ src/sys/arch/arm/fdt/acpi_fdt.c	Mon Oct 15 11:35:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_fdt.c,v 1.2 2018/10/13 00:15:10 jmcneill Exp $ */
+/* $NetBSD: acpi_fdt.c,v 1.3 2018/10/15 11:35:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.2 2018/10/13 00:15:10 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.3 2018/10/15 11:35:03 jmcneill Exp $");
 
 #include 
 #include 
@@ -46,6 +46,8 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v
 
 #include 
 
+#include 
+
 static int	acpi_fdt_match(device_t, cfdata_t, void *);
 static void	acpi_fdt_attach(device_t, device_t, void *);
 
@@ -87,9 +89,9 @@ acpi_fdt_attach(device_t parent, device_
 
 	aa.aa_iot = 0;
 	aa.aa_memt = faa->faa_bst;
-	aa.aa_pc = NULL;
+	aa.aa_pc = _acpi_pci_chipset;
 	aa.aa_pciflags =
-	PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
+	/*PCI_FLAGS_IO_OKAY |*/ PCI_FLAGS_MEM_OKAY |
 	PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | 
 	PCI_FLAGS_MWI_OKAY;
 	aa.aa_ic = 0;

Added files:

Index: src/sys/arch/arm/acpi/acpi_pci_machdep.c
diff -u /dev/null src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.1
--- /dev/null	Mon Oct 15 11:35:03 2018
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Mon Oct 15 11:35:03 2018
@@ -0,0 +1,367 @@
+/* $NetBSD: acpi_pci_machdep.c,v 1.1 2018/10/15 11:35:03 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jared McNeill .
+ *
+ * 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 

CVS commit: src/sys/arch/arm

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 11:35:03 UTC 2018

Modified Files:
src/sys/arch/arm/acpi: acpi_machdep.c files.acpi
src/sys/arch/arm/fdt: acpi_fdt.c
Added Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c acpi_pci_machdep.h acpipchb.c

Log Message:
Add ARM ACPI PCI support.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/acpi_machdep.c \
src/sys/arch/arm/acpi/files.acpi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/acpi/acpi_pci_machdep.c \
src/sys/arch/arm/acpi/acpi_pci_machdep.h src/sys/arch/arm/acpi/acpipchb.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/fdt/acpi_fdt.c

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



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 11:33:09 UTC 2018

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

Log Message:
Do not attach a timecounter when PM_TMR_LEN is 0. According to ACPI 6.2
section 5.2.9 ("Fixed ACPI Description Table (FADT)"), a value of zero
here means that the PM timer is not supported.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/acpi/acpi_timer.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/acpi_timer.c
diff -u src/sys/dev/acpi/acpi_timer.c:1.22 src/sys/dev/acpi/acpi_timer.c:1.23
--- src/sys/dev/acpi/acpi_timer.c:1.22	Fri Dec 27 18:51:44 2013
+++ src/sys/dev/acpi/acpi_timer.c	Mon Oct 15 11:33:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_timer.c,v 1.22 2013/12/27 18:51:44 christos Exp $ */
+/* $NetBSD: acpi_timer.c,v 1.23 2018/10/15 11:33:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2006 Matthias Drochner 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.22 2013/12/27 18:51:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.23 2018/10/15 11:33:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -52,6 +52,12 @@ static struct timecounter acpi_timecount
 	NULL,
 };
 
+static bool
+acpitimer_supported(void)
+{
+	return AcpiGbl_FADT.PmTimerLength != 0;
+}
+
 int
 acpitimer_init(struct acpi_softc *sc)
 {
@@ -59,6 +65,9 @@ acpitimer_init(struct acpi_softc *sc)
 	uint32_t bits;
 	int i, j;
 
+	if (!acpitimer_supported())
+		return -1;
+
 	rv = AcpiGetTimerResolution();
 
 	if (ACPI_FAILURE(rv))
@@ -88,6 +97,9 @@ int
 acpitimer_detach(void)
 {
 
+	if (!acpitimer_supported())
+		return -1;
+
 	return tc_detach(_timecounter);
 }
 



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 11:33:09 UTC 2018

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

Log Message:
Do not attach a timecounter when PM_TMR_LEN is 0. According to ACPI 6.2
section 5.2.9 ("Fixed ACPI Description Table (FADT)"), a value of zero
here means that the PM timer is not supported.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/acpi/acpi_timer.c

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



CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 10:44:28 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: vfs_syscalls_10.c
src/sys/kern [pgoyette-compat]: compat_stub.c vfs_syscalls.c
src/sys/sys [pgoyette-compat]: compat_stub.h vfs_syscalls.h

Log Message:
Convert the openat_10 hook to use the MP-safe mechanism

XXX Still to do: compat70_unp_addsockcred and sysvipc50_sysctl


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/common/vfs_syscalls_10.c
cvs rdiff -u -r1.1.2.29 -r1.1.2.30 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.518.2.1 -r1.518.2.2 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.23.2.2 -r1.23.2.3 src/sys/sys/vfs_syscalls.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/compat/common/vfs_syscalls_10.c
diff -u src/sys/compat/common/vfs_syscalls_10.c:1.1.2.3 src/sys/compat/common/vfs_syscalls_10.c:1.1.2.4
--- src/sys/compat/common/vfs_syscalls_10.c:1.1.2.3	Sat Sep 22 04:56:28 2018
+++ src/sys/compat/common/vfs_syscalls_10.c	Mon Oct 15 10:44:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_10.c,v 1.1.2.3 2018/09/22 04:56:28 pgoyette Exp $	*/
+/* $NetBSD: vfs_syscalls_10.c,v 1.1.2.4 2018/10/15 10:44:27 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_10.c,v 1.1.2.3 2018/09/22 04:56:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_10.c,v 1.1.2.4 2018/10/15 10:44:27 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -40,11 +40,10 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
-static int (*orig_sys_openat_10)(struct pathbuf **);
-
 static int
 real_sys_openat_10(struct pathbuf **pb)
 {
@@ -53,15 +52,17 @@ real_sys_openat_10(struct pathbuf **pb)
 	return (*pb == NULL ? ENOMEM : 0);
 }
 
+MODULE_SET_HOOK(compat_10_openat_hook, "openat_10", real_sys_openat_10);
+MODULE_UNSET_HOOK(compat_10_openat_hook);
+
 void vfs_syscalls_10_init(void)
 {
 
-	orig_sys_openat_10 = vec_sys_openat_10;
-	vec_sys_openat_10 = real_sys_openat_10;
+	compat_10_openat_hook_set();
 }
 
 void vfs_syscalls_10_fini(void)
 {
 
-	vec_sys_openat_10 = orig_sys_openat_10;
+	compat_10_openat_hook_unset();
 }

Index: src/sys/kern/compat_stub.c
diff -u src/sys/kern/compat_stub.c:1.1.2.29 src/sys/kern/compat_stub.c:1.1.2.30
--- src/sys/kern/compat_stub.c:1.1.2.29	Mon Oct 15 09:51:33 2018
+++ src/sys/kern/compat_stub.c	Mon Oct 15 10:44:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.1.2.29 2018/10/15 09:51:33 pgoyette Exp $	*/
+/* $NetBSD: compat_stub.c,v 1.1.2.30 2018/10/15 10:44:27 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -193,3 +193,8 @@ struct rnd_ioctl_50_32_hook_t rnd_ioctl_
  */
 struct compat_60_ioctl_hook_t compat_60_ioctl_hook;
 
+/*
+ * Hook for compat_10 openat
+ */
+struct compat_10_openat_hook_t compat_10_openat_hook;
+

Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.518.2.1 src/sys/kern/vfs_syscalls.c:1.518.2.2
--- src/sys/kern/vfs_syscalls.c:1.518.2.1	Wed Mar 14 02:24:56 2018
+++ src/sys/kern/vfs_syscalls.c	Mon Oct 15 10:44:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.518.2.1 2018/03/14 02:24:56 pgoyette Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.518.2.2 2018/10/15 10:44:27 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.518.2.1 2018/03/14 02:24:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.518.2.2 2018/10/15 10:44:27 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -108,6 +108,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -141,11 +142,6 @@ static int fd_nameiat(struct lwp *, int,
 static int fd_nameiat_simple_user(struct lwp *, int, const char *,
 namei_simple_flags_t, struct vnode **);
 
-/* Routine for COMPAT_10 handling of NULL pathbuf passed to do_sys_openat */
-
-static int stub_sys_openat_10(struct pathbuf **);
-int (*vec_sys_openat_10)(struct pathbuf **) = stub_sys_openat_10;
-
 /*
  * This table is used to maintain compatibility with 4.3BSD
  * and NetBSD 0.9 mount syscalls - and possibly other systems.
@@ -1639,6 +1635,10 @@ stub_sys_openat_10(struct pathbuf **pb)
 	return 0;
 }
 
+MODULE_CALL_HOOK_DECL(compat_10_openat_hook, f, (struct pathbuf **));
+MODULE_CALL_HOOK(compat_10_openat_hook, f, (struct pathbuf **pb), (pb),
+stub_sys_openat_10(pb));
+
 static int
 do_sys_openat(lwp_t *l, int fdat, const char *path, int flags,
 int mode, int *fd)
@@ -1649,7 +1649,7 @@ do_sys_openat(lwp_t *l, int fdat, const 
 	int error;
 
 	if (path == NULL) 

CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 10:44:28 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: vfs_syscalls_10.c
src/sys/kern [pgoyette-compat]: compat_stub.c vfs_syscalls.c
src/sys/sys [pgoyette-compat]: compat_stub.h vfs_syscalls.h

Log Message:
Convert the openat_10 hook to use the MP-safe mechanism

XXX Still to do: compat70_unp_addsockcred and sysvipc50_sysctl


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/common/vfs_syscalls_10.c
cvs rdiff -u -r1.1.2.29 -r1.1.2.30 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.518.2.1 -r1.518.2.2 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.23.2.2 -r1.23.2.3 src/sys/sys/vfs_syscalls.h

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



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 10:01:32 UTC 2018

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

Log Message:
Add acpimcfg_configure_bus, which can be used by MD code to implement
PCI_NETBSD_CONFIGURE using ACPI MCFG tables.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/acpi_mcfg.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/acpi_mcfg.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_mcfg.c
diff -u src/sys/dev/acpi/acpi_mcfg.c:1.7 src/sys/dev/acpi/acpi_mcfg.c:1.8
--- src/sys/dev/acpi/acpi_mcfg.c:1.7	Sat Oct 13 13:32:50 2018
+++ src/sys/dev/acpi/acpi_mcfg.c	Mon Oct 15 10:01:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_mcfg.c,v 1.7 2018/10/13 13:32:50 jmcneill Exp $	*/
+/*	$NetBSD: acpi_mcfg.c,v 1.8 2018/10/15 10:01:32 jmcneill Exp $	*/
 
 /*-
  * Copyright (C) 2015 NONAKA Kimihiro 
@@ -25,16 +25,20 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_pci.h"
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.7 2018/10/13 13:32:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.8 2018/10/15 10:01:32 jmcneill Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -677,6 +681,209 @@ out:
 	return error;
 }
 
+#ifdef PCI_NETBSD_CONFIGURE
+struct acpimcfg_resource {
+	struct extent *ioext;
+	struct extent *memext;
+	struct extent *pmemext;
+};
+
+static ACPI_STATUS
+acpimcfg_configure_bus_cb(ACPI_RESOURCE *res, void *ctx)
+{
+	struct acpimcfg_resource *pcires = ctx;
+	struct extent *ex;
+	const char *s;
+	int error;
+
+	if (res->Type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
+	res->Type != ACPI_RESOURCE_TYPE_ADDRESS64)
+		return AE_OK;
+
+	if (res->Data.Address.ProducerConsumer != ACPI_PRODUCER)
+		return AE_OK;
+
+	if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE &&
+	res->Data.Address.ResourceType != ACPI_IO_RANGE)
+		return AE_OK;
+
+	if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE &&
+	res->Data.Address.Info.Mem.Caching == ACPI_PREFETCHABLE_MEMORY) {
+		if (pcires->pmemext == NULL) {
+			pcires->pmemext = extent_create("pcipmem", 0, ULONG_MAX,
+			NULL, 0, EX_WAITOK);
+			error = extent_alloc_region(pcires->pmemext, 0, ULONG_MAX,
+			EX_WAITOK);
+			if (error) {
+extent_destroy(pcires->pmemext);
+pcires->pmemext = NULL;
+return AE_NO_MEMORY;
+			}
+		}
+		ex = pcires->pmemext;
+		s = "prefetchable";
+	} else if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE &&
+	res->Data.Address.Info.Mem.Caching != ACPI_PREFETCHABLE_MEMORY) {
+		if (pcires->memext == NULL) {
+			pcires->memext = extent_create("pcimem", 0, ULONG_MAX,
+			NULL, 0, EX_WAITOK);
+			error = extent_alloc_region(pcires->memext, 0, ULONG_MAX,
+			EX_WAITOK);
+			if (error) {
+extent_destroy(pcires->memext);
+pcires->memext = NULL;
+return AE_NO_MEMORY;
+			}
+		}
+		ex = pcires->memext;
+		s = "non-prefetchable";
+	} else if (res->Data.Address.ResourceType == ACPI_IO_RANGE) {
+		if (pcires->ioext == NULL) {
+			pcires->ioext = extent_create("pciio", 0, ULONG_MAX,
+			NULL, 0, EX_WAITOK);
+			error = extent_alloc_region(pcires->ioext, 0, ULONG_MAX,
+			EX_WAITOK);
+			if (error) {
+extent_destroy(pcires->ioext);
+pcires->ioext = NULL;
+return AE_NO_MEMORY;
+			}
+		}
+		ex = pcires->ioext;
+		s = "i/o";
+		
+	}
+
+	switch (res->Type) {
+	case ACPI_RESOURCE_TYPE_ADDRESS16:
+		aprint_debug(
+		"MCFG: range 0x%04" PRIx16 " size %#" PRIx16 " (16-bit %s)\n",
+		res->Data.Address16.Address.Minimum,
+		res->Data.Address16.Address.AddressLength,
+		s);
+		error = extent_free(ex, res->Data.Address16.Address.Minimum,
+		res->Data.Address16.Address.AddressLength, EX_WAITOK);
+		if (error)
+			return AE_NO_MEMORY;
+		break;
+	case ACPI_RESOURCE_TYPE_ADDRESS32:
+		aprint_debug(
+		"MCFG: range 0x%08" PRIx32 " size %#" PRIx32 " (32-bit %s)\n",
+		res->Data.Address32.Address.Minimum,
+		res->Data.Address32.Address.AddressLength,
+		s);
+		error = extent_free(ex, res->Data.Address32.Address.Minimum,
+		res->Data.Address32.Address.AddressLength, EX_WAITOK);
+		if (error)
+			return AE_NO_MEMORY;
+		break;
+	case ACPI_RESOURCE_TYPE_ADDRESS64:
+		aprint_debug(
+		"MCFG: range 0x%016" PRIx64 " size %#" PRIx64 " (64-bit %s)\n",
+		res->Data.Address64.Address.Minimum,
+		res->Data.Address64.Address.AddressLength,
+		s);
+		error = extent_free(ex, res->Data.Address64.Address.Minimum,
+		res->Data.Address64.Address.AddressLength, EX_WAITOK);
+		if (error)
+			return AE_NO_MEMORY;
+		break;
+	}
+
+	return AE_OK;
+}
+
+int
+acpimcfg_configure_bus(device_t self, pci_chipset_tag_t pc, ACPI_HANDLE handle,
+int bus, int cacheline_size)
+{
+	struct acpimcfg_resource res;
+	struct mcfg_segment *seg;

CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 10:01:32 UTC 2018

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

Log Message:
Add acpimcfg_configure_bus, which can be used by MD code to implement
PCI_NETBSD_CONFIGURE using ACPI MCFG tables.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/acpi_mcfg.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/acpi_mcfg.h

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



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 10:00:30 UTC 2018

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

Log Message:
Add a function to find a PCI root bridge by segment and bus number.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/acpi/acpi_pci.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/acpi/acpi_pci.h

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



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 15 10:00:30 UTC 2018

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

Log Message:
Add a function to find a PCI root bridge by segment and bus number.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/acpi/acpi_pci.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/acpi/acpi_pci.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_pci.c
diff -u src/sys/dev/acpi/acpi_pci.c:1.22 src/sys/dev/acpi/acpi_pci.c:1.23
--- src/sys/dev/acpi/acpi_pci.c:1.22	Sat May  5 17:16:23 2018
+++ src/sys/dev/acpi/acpi_pci.c	Mon Oct 15 10:00:30 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci.c,v 1.22 2018/05/05 17:16:23 christos Exp $ */
+/* $NetBSD: acpi_pci.c,v 1.23 2018/10/15 10:00:30 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.22 2018/05/05 17:16:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.23 2018/10/15 10:00:30 jmcneill Exp $");
 
 #include 
 #include 
@@ -383,6 +383,33 @@ acpi_pcidev_find(uint16_t segment, uint1
 	return NULL;
 }
 
+/*
+ * acpi_pciroot_find:
+ *
+ *	Finds a PCI root bridge in the ACPI name space.
+ *
+ *	Returns an ACPI device node on success and NULL on failure.
+ */
+struct acpi_devnode *
+acpi_pciroot_find(uint16_t segment, uint16_t bus)
+{
+	struct acpi_softc *sc = acpi_softc;
+	struct acpi_devnode *ad;
+
+	if (sc == NULL)
+		return NULL;
+
+	SIMPLEQ_FOREACH(ad, >ad_head, ad_list) {
+
+		if (ad->ad_pciinfo != NULL &&
+		(ad->ad_pciinfo->ap_flags & ACPI_PCI_INFO_BRIDGE) &&
+		ad->ad_pciinfo->ap_segment == segment &&
+		ad->ad_pciinfo->ap_bus == bus)
+			return ad;
+	}
+
+	return NULL;
+}
 
 /*
  * acpi_pcidev_find_dev:

Index: src/sys/dev/acpi/acpi_pci.h
diff -u src/sys/dev/acpi/acpi_pci.h:1.8 src/sys/dev/acpi/acpi_pci.h:1.9
--- src/sys/dev/acpi/acpi_pci.h:1.8	Fri Dec 31 10:56:39 2010
+++ src/sys/dev/acpi/acpi_pci.h	Mon Oct 15 10:00:30 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci.h,v 1.8 2010/12/31 10:56:39 jruoho Exp $ */
+/* $NetBSD: acpi_pci.h,v 1.9 2018/10/15 10:00:30 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -37,5 +37,6 @@ ACPI_STATUS		 acpi_pcidev_ppb_downbus(ui
 struct acpi_devnode	*acpi_pcidev_find(uint16_t, uint16_t,
 	  uint16_t, uint16_t);
 device_t		 acpi_pcidev_find_dev(struct acpi_devnode *);
+struct acpi_devnode	*acpi_pciroot_find(uint16_t, uint16_t);
 
 #endif	/* !_SYS_DEV_ACPI_ACPI_PCI_H */



CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 09:51:34 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_70_mod.c tty_60.c
src/sys/compat/net [pgoyette-compat]: route_70.h
src/sys/kern [pgoyette-compat]: compat_stub.c tty.c tty_ptm.c
uipc_usrreq.c
src/sys/sys [pgoyette-compat]: compat_stub.h module.h tty.h

Log Message:
Convert another hook to the MP-sfe mechanism.

XXX still have three more to convert: openat_10, sysvipc50_sysctl and
XXX compat70_unp_addsockcred


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/compat/common/compat_70_mod.c
cvs rdiff -u -r1.4.16.4 -r1.4.16.5 src/sys/compat/common/tty_60.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/net/route_70.h
cvs rdiff -u -r1.1.2.28 -r1.1.2.29 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.275.2.4 -r1.275.2.5 src/sys/kern/tty.c
cvs rdiff -u -r1.37.16.1 -r1.37.16.2 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.183.2.3 -r1.183.2.4 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.41.14.13 -r1.41.14.14 src/sys/sys/module.h
cvs rdiff -u -r1.94.2.2 -r1.94.2.3 src/sys/sys/tty.h

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



CVS commit: [pgoyette-compat] src/sys

2018-10-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 15 09:51:34 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_70_mod.c tty_60.c
src/sys/compat/net [pgoyette-compat]: route_70.h
src/sys/kern [pgoyette-compat]: compat_stub.c tty.c tty_ptm.c
uipc_usrreq.c
src/sys/sys [pgoyette-compat]: compat_stub.h module.h tty.h

Log Message:
Convert another hook to the MP-sfe mechanism.

XXX still have three more to convert: openat_10, sysvipc50_sysctl and
XXX compat70_unp_addsockcred


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/compat/common/compat_70_mod.c
cvs rdiff -u -r1.4.16.4 -r1.4.16.5 src/sys/compat/common/tty_60.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/net/route_70.h
cvs rdiff -u -r1.1.2.28 -r1.1.2.29 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.275.2.4 -r1.275.2.5 src/sys/kern/tty.c
cvs rdiff -u -r1.37.16.1 -r1.37.16.2 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.183.2.3 -r1.183.2.4 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.41.14.13 -r1.41.14.14 src/sys/sys/module.h
cvs rdiff -u -r1.94.2.2 -r1.94.2.3 src/sys/sys/tty.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/compat/common/compat_70_mod.c
diff -u src/sys/compat/common/compat_70_mod.c:1.1.2.10 src/sys/compat/common/compat_70_mod.c:1.1.2.11
--- src/sys/compat/common/compat_70_mod.c:1.1.2.10	Sat Sep 22 04:56:28 2018
+++ src/sys/compat/common/compat_70_mod.c	Mon Oct 15 09:51:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_70_mod.c,v 1.1.2.10 2018/09/22 04:56:28 pgoyette Exp $	*/
+/*	$NetBSD: compat_70_mod.c,v 1.1.2.11 2018/10/15 09:51:33 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_70_mod.c,v 1.1.2.10 2018/09/22 04:56:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_70_mod.c,v 1.1.2.11 2018/10/15 09:51:33 pgoyette Exp $");
 
 #include 
 #include 
@@ -56,7 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: compat_70_mo
 int compat_70_init(void)
 {
 
-	vec_ocreds_valid = true;
+	compat70_ocreds_valid = true;
 	rtsock_70_init();
 
 	return 0;
@@ -66,7 +66,7 @@ int compat_70_fini(void)
 {
 
 	rtsock_70_fini();
-	vec_ocreds_valid = false;
+	compat70_ocreds_valid = false;
 
 	return 0;
 }

Index: src/sys/compat/common/tty_60.c
diff -u src/sys/compat/common/tty_60.c:1.4.16.4 src/sys/compat/common/tty_60.c:1.4.16.5
--- src/sys/compat/common/tty_60.c:1.4.16.4	Tue Sep  4 02:21:58 2018
+++ src/sys/compat/common/tty_60.c	Mon Oct 15 09:51:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_60.c,v 1.4.16.4 2018/09/04 02:21:58 pgoyette Exp $	*/
+/*	$NetBSD: tty_60.c,v 1.4.16.5 2018/10/15 09:51:33 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.4.16.4 2018/09/04 02:21:58 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.4.16.5 2018/10/15 09:51:33 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -117,17 +118,23 @@ compat_60_ptmioctl(dev_t dev, u_long cmd
 	}
 }
 
+/* 
+ * Hooks for compat_60 ttioctl and ptmioctl
+ */
+MODULE_SET_HOOK2(compat_60_ioctl_hook, "tty_60", compat_60_ttioctl,
+compat_60_ptmioctl);
+MODULE_UNSET_HOOK2(compat_60_ioctl_hook);
+
+
 void
 kern_tty_60_init(void)
 {
 
-	vec_compat_ttioctl_60 = compat_60_ttioctl;
-	vec_compat_ptmioctl_60 = compat_60_ptmioctl;
+	compat_60_ioctl_hook_set();
 }
 
 void
 kern_tty_60_fini(void)
 {
-	vec_compat_ttioctl_60 = NULL;
-	vec_compat_ptmioctl_60 = stub_compat_ptmioctl_60;
+	compat_60_ioctl_hook_unset();
 }

Index: src/sys/compat/net/route_70.h
diff -u src/sys/compat/net/route_70.h:1.1.2.3 src/sys/compat/net/route_70.h:1.1.2.4
--- src/sys/compat/net/route_70.h:1.1.2.3	Mon Oct 15 04:33:34 2018
+++ src/sys/compat/net/route_70.h	Mon Oct 15 09:51:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route_70.h,v 1.1.2.3 2018/10/15 04:33:34 pgoyette Exp $	*/
+/*	$NetBSD: route_70.h,v 1.1.2.4 2018/10/15 09:51:33 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -39,6 +39,6 @@
 void rtsock_70_init(void);
 void rtsock_70_fini(void);
 
-extern bool vec_ocreds_valid;
+extern bool compat70_ocreds_valid;
 
 #endif /* !_COMPAT_NET_ROUTE_70_H_ */

Index: src/sys/kern/compat_stub.c
diff -u src/sys/kern/compat_stub.c:1.1.2.28 src/sys/kern/compat_stub.c:1.1.2.29
--- src/sys/kern/compat_stub.c:1.1.2.28	Mon Oct 15 04:33:34 2018
+++ src/sys/kern/compat_stub.c	Mon Oct 15 09:51:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.1.2.28 2018/10/15 04:33:34 pgoyette Exp $	*/
+/* $NetBSD: compat_stub.c,v 1.1.2.29 2018/10/15 09:51:33 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, 

Re: CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jared McNeill

Hi Jaromir --

This change breaks the build of the one kernel that includes this code 
(evbarm GENERIC64) as intr_establish_xname is not an MI API.


Cheers,
Jared


On Mon, 15 Oct 2018, Jaromir Dolecek wrote:


Module Name:src
Committed By:   jdolecek
Date:   Mon Oct 15 06:58:08 UTC 2018

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

Log Message:
use intr_establish_xname()


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/ahcisata_acpi.c

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




CVS commit: src/sys/dev/pci

2018-10-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 15 09:27:30 UTC 2018

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

Log Message:
Add Adaptec RAID 2445 and 2805.
>From Dima Veselov.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/aac_pci.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/aac_pci.c
diff -u src/sys/dev/pci/aac_pci.c:1.38 src/sys/dev/pci/aac_pci.c:1.39
--- src/sys/dev/pci/aac_pci.c:1.38	Tue Sep 27 03:33:32 2016
+++ src/sys/dev/pci/aac_pci.c	Mon Oct 15 09:27:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: aac_pci.c,v 1.38 2016/09/27 03:33:32 pgoyette Exp $	*/
+/*	$NetBSD: aac_pci.c,v 1.39 2018/10/15 09:27:30 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aac_pci.c,v 1.38 2016/09/27 03:33:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aac_pci.c,v 1.39 2018/10/15 09:27:30 uwe Exp $");
 
 #include 
 #include 
@@ -364,6 +364,22 @@ static struct aac_ident {
 	{	PCI_VENDOR_ADP2,
 		PCI_PRODUCT_ADP2_ASR2200S,
 		PCI_VENDOR_ADP2,
+		PCI_PRODUCT_ADP2_2445,
+		AAC_HWIF_I960RX,
+		0,
+		"Adaptec RAID 2445"
+	},
+	{	PCI_VENDOR_ADP2,
+		PCI_PRODUCT_ADP2_ASR2200S,
+		PCI_VENDOR_ADP2,
+		PCI_PRODUCT_ADP2_2805,
+		AAC_HWIF_I960RX,
+		0,
+		"Adaptec RAID 2805"
+	},
+	{	PCI_VENDOR_ADP2,
+		PCI_PRODUCT_ADP2_ASR2200S,
+		PCI_VENDOR_ADP2,
 		PCI_PRODUCT_ADP2_3405,
 		AAC_HWIF_I960RX,
 		0,



CVS commit: src/sys/dev/pci

2018-10-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 15 09:27:30 UTC 2018

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

Log Message:
Add Adaptec RAID 2445 and 2805.
>From Dima Veselov.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/aac_pci.c

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



CVS commit: src/sys/dev/pci

2018-10-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 15 09:11:16 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Adaptec RAID 2445 and 2805


To generate a diff of this commit:
cvs rdiff -u -r1.1338 -r1.1339 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1337 -r1.1338 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2018-10-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 15 09:11:16 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Adaptec RAID 2445 and 2805


To generate a diff of this commit:
cvs rdiff -u -r1.1338 -r1.1339 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1337 -r1.1338 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/pci

2018-10-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 15 09:01:56 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Adaptec RAID 2445 and 2805


To generate a diff of this commit:
cvs rdiff -u -r1.1347 -r1.1348 src/sys/dev/pci/pcidevs

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



CVS commit: src/sys/dev/pci

2018-10-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 15 09:01:56 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Adaptec RAID 2445 and 2805


To generate a diff of this commit:
cvs rdiff -u -r1.1347 -r1.1348 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1347 src/sys/dev/pci/pcidevs:1.1348
--- src/sys/dev/pci/pcidevs:1.1347	Thu Aug 23 05:18:45 2018
+++ src/sys/dev/pci/pcidevs	Mon Oct 15 09:01:56 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1347 2018/08/23 05:18:45 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1348 2018/10/15 09:01:56 uwe Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -891,6 +891,8 @@ product ADP2 AAR2810SA		0x0292	AAR-2810S
 product ADP2 3405		0x02bb	RAID 3405
 product ADP2 3805		0x02bc	RAID 3805
 product ADP2 2405		0x02d5	RAID 2405
+product ADP2 2445		0x02d6	RAID 2445
+product ADP2 2805		0x02d7	RAID 2805
 product ADP2 AAC364		0x0364	AAC-364
 product ADP2 ASR5400S		0x0365	ASR-5400S
 product ADP2 PERC_2QC		0x1364	Dell PERC 2/QC



CVS commit: [netbsd-7] src/doc

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 08:05:43 UTC 2018

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

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/doc/CHANGES-7.3

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.3
diff -u src/doc/CHANGES-7.3:1.1.2.3 src/doc/CHANGES-7.3:1.1.2.4
--- src/doc/CHANGES-7.3:1.1.2.3	Mon Oct 15 07:56:09 2018
+++ src/doc/CHANGES-7.3	Mon Oct 15 08:05:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.3 2018/10/15 07:56:09 sborrill Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.4 2018/10/15 08:05:43 sborrill Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -68,7 +68,7 @@ usr.sbin/cpuctl/arch/i386.c			1.71,1.75-
 	  - Use aprint_error_dev() for error output.
 	[msaitoh, ticket #1636]
 
-sbin/gpt/gpt.c			1.76
+sbin/gpt/gpt.c	1.76
 
 	When changing entries skip those that do not match the -L option.
 	Should fix PR 53668.



CVS commit: [netbsd-7] src/doc

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 08:05:43 UTC 2018

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

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/doc/CHANGES-7.3

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



CVS commit: [netbsd-8] src/doc

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 08:04:20 UTC 2018

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

Log Message:
Ticket #1063


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

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



CVS commit: [netbsd-8] src/doc

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 08:04:20 UTC 2018

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

Log Message:
Ticket #1063


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.34 -r1.1.2.35 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.34 src/doc/CHANGES-8.1:1.1.2.35
--- src/doc/CHANGES-8.1:1.1.2.34	Mon Oct 15 03:13:46 2018
+++ src/doc/CHANGES-8.1	Mon Oct 15 08:04:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.34 2018/10/15 03:13:46 snj Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.35 2018/10/15 08:04:20 sborrill Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1396,3 +1396,9 @@ etc/mtree/NetBSD.dist.base			1.178-1.179
 	Add unbound /var/chroot/unbound/var/run.
 	[hannken, ticket #1062]
 
+sbin/gpt/gpt.c	1.76
+
+	When changing entries, skip those that do not match the -L option.
+	Should fix PR 53668.
+	[mlelstv, ticket #1063]
+



CVS commit: [netbsd-8] src/sbin/gpt

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 08:04:04 UTC 2018

Modified Files:
src/sbin/gpt [netbsd-8]: gpt.c

Log Message:
Pull up the following revisions(s) (requested by mlelstv in ticket #1063):
sbin/gpt/gpt.c: revision 1.76

When changing entries, skip those that do not match the -L option.
Should fix PR 53668.


To generate a diff of this commit:
cvs rdiff -u -r1.70.4.2 -r1.70.4.3 src/sbin/gpt/gpt.c

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

Modified files:

Index: src/sbin/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.70.4.2 src/sbin/gpt/gpt.c:1.70.4.3
--- src/sbin/gpt/gpt.c:1.70.4.2	Fri May  4 16:24:46 2018
+++ src/sbin/gpt/gpt.c	Mon Oct 15 08:04:04 2018
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.70.4.2 2018/05/04 16:24:46 martin Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.70.4.3 2018/10/15 08:04:04 sborrill Exp $");
 #endif
 
 #include 
@@ -1043,7 +1043,7 @@ gpt_change_ent(gpt_t gpt, const struct g
 			utf16_to_utf8(ent->ent_name,
 			__arraycount(ent->ent_name),
 			utfbuf, __arraycount(utfbuf));
-			if (strcmp((char *)find->label, (char *)utfbuf) == 0)
+			if (strcmp((char *)find->label, (char *)utfbuf) != 0)
 continue;
 		}
 



CVS commit: [netbsd-8] src/sbin/gpt

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 08:04:04 UTC 2018

Modified Files:
src/sbin/gpt [netbsd-8]: gpt.c

Log Message:
Pull up the following revisions(s) (requested by mlelstv in ticket #1063):
sbin/gpt/gpt.c: revision 1.76

When changing entries, skip those that do not match the -L option.
Should fix PR 53668.


To generate a diff of this commit:
cvs rdiff -u -r1.70.4.2 -r1.70.4.3 src/sbin/gpt/gpt.c

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



CVS commit: [netbsd-7] src/sbin/gpt

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 07:55:50 UTC 2018

Modified Files:
src/sbin/gpt [netbsd-7]: gpt.c

Log Message:
Pull up the following revisions(s) (requested by mlelstv in ticket #1643):
sbin/gpt/gpt.c: revision 1.76

When changing entries skip those that do not match the -L option.
Should fix PR 53668.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.2 -r1.28.2.3 src/sbin/gpt/gpt.c

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

Modified files:

Index: src/sbin/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.28.2.2 src/sbin/gpt/gpt.c:1.28.2.3
--- src/sbin/gpt/gpt.c:1.28.2.2	Mon Aug 13 16:12:12 2018
+++ src/sbin/gpt/gpt.c	Mon Oct 15 07:55:49 2018
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.28.2.2 2018/08/13 16:12:12 martin Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.28.2.3 2018/10/15 07:55:49 sborrill Exp $");
 #endif
 
 #include 
@@ -1043,7 +1043,7 @@ gpt_change_ent(gpt_t gpt, const struct g
 			utf16_to_utf8(ent->ent_name,
 			__arraycount(ent->ent_name),
 			utfbuf, __arraycount(utfbuf));
-			if (strcmp((char *)find->label, (char *)utfbuf) == 0)
+			if (strcmp((char *)find->label, (char *)utfbuf) != 0)
 continue;
 		}
 



CVS commit: [netbsd-7] src/sbin/gpt

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 07:55:50 UTC 2018

Modified Files:
src/sbin/gpt [netbsd-7]: gpt.c

Log Message:
Pull up the following revisions(s) (requested by mlelstv in ticket #1643):
sbin/gpt/gpt.c: revision 1.76

When changing entries skip those that do not match the -L option.
Should fix PR 53668.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.2 -r1.28.2.3 src/sbin/gpt/gpt.c

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



CVS commit: [netbsd-7] src/doc

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 07:56:09 UTC 2018

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

Log Message:
Ticket #1643


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/doc/CHANGES-7.3

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.3
diff -u src/doc/CHANGES-7.3:1.1.2.2 src/doc/CHANGES-7.3:1.1.2.3
--- src/doc/CHANGES-7.3:1.1.2.2	Tue Oct  9 15:54:57 2018
+++ src/doc/CHANGES-7.3	Mon Oct 15 07:56:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.2 2018/10/09 15:54:57 snj Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.3 2018/10/15 07:56:09 sborrill Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -68,3 +68,9 @@ usr.sbin/cpuctl/arch/i386.c			1.71,1.75-
 	  - Use aprint_error_dev() for error output.
 	[msaitoh, ticket #1636]
 
+sbin/gpt/gpt.c			1.76
+
+	When changing entries skip those that do not match the -L option.
+	Should fix PR 53668.
+	[mlelstv, ticket #1643]
+



CVS commit: [netbsd-7] src/doc

2018-10-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 15 07:56:09 UTC 2018

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

Log Message:
Ticket #1643


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/doc/CHANGES-7.3

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



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Oct 15 06:58:08 UTC 2018

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

Log Message:
use intr_establish_xname()


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/ahcisata_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/ahcisata_acpi.c
diff -u src/sys/dev/acpi/ahcisata_acpi.c:1.1 src/sys/dev/acpi/ahcisata_acpi.c:1.2
--- src/sys/dev/acpi/ahcisata_acpi.c:1.1	Fri Oct 12 23:26:18 2018
+++ src/sys/dev/acpi/ahcisata_acpi.c	Mon Oct 15 06:58:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ahcisata_acpi.c,v 1.1 2018/10/12 23:26:18 jmcneill Exp $ */
+/* $NetBSD: ahcisata_acpi.c,v 1.2 2018/10/15 06:58:08 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_acpi.c,v 1.1 2018/10/12 23:26:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_acpi.c,v 1.2 2018/10/15 06:58:08 jdolecek Exp $");
 
 #include 
 #include 
@@ -103,7 +103,8 @@ ahcisata_acpi_attach(device_t parent, de
 	}
 
 	const int type = (irq->ar_type == ACPI_EDGE_SENSITIVE) ? IST_EDGE : IST_LEVEL;
-	ih = intr_establish(irq->ar_irq, IPL_BIO, type, ahci_intr, sc);
+	ih = intr_establish_xname(irq->ar_irq, IPL_BIO, type, ahci_intr, sc,
+	device_xname(self));
 	if (ih == NULL) {
 		aprint_error_dev(self, "couldn't install interrupt handler\n");
 		return;



CVS commit: src/sys/dev/acpi

2018-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Oct 15 06:58:08 UTC 2018

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

Log Message:
use intr_establish_xname()


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/ahcisata_acpi.c

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