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

2018-10-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 17 05:30:24 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: psci_fdt.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/fdt/psci_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/fdt/psci_fdt.c
diff -u src/sys/arch/arm/fdt/psci_fdt.c:1.18 src/sys/arch/arm/fdt/psci_fdt.c:1.19
--- src/sys/arch/arm/fdt/psci_fdt.c:1.18	Mon Sep 10 11:05:12 2018
+++ src/sys/arch/arm/fdt/psci_fdt.c	Wed Oct 17 05:30:24 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: psci_fdt.c,v 1.18 2018/09/10 11:05:12 ryo Exp $ */
+/* $NetBSD: psci_fdt.c,v 1.19 2018/10/17 05:30:24 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,14 +29,14 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.18 2018/09/10 11:05:12 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.19 2018/10/17 05:30:24 skrll Exp $");
 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
-#include 
+#include 
 
 #include 
 



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

2018-10-16 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Wed Oct 17 03:43:24 UTC 2018

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

Log Message:
The known_mpsafe parameter is used by intr.c:intr_establish_xname()
especially in the non -D MULTIPROCESSOR case. We used it incorrectly.

Fix this.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/xen/xen/xenevt.c

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

Modified files:

Index: src/sys/arch/xen/xen/xenevt.c
diff -u src/sys/arch/xen/xen/xenevt.c:1.49 src/sys/arch/xen/xen/xenevt.c:1.50
--- src/sys/arch/xen/xen/xenevt.c:1.49	Wed Oct 10 03:54:54 2018
+++ src/sys/arch/xen/xen/xenevt.c	Wed Oct 17 03:43:24 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: xenevt.c,v 1.49 2018/10/10 03:54:54 cherry Exp $  */
+/*  $NetBSD: xenevt.c,v 1.50 2018/10/17 03:43:24 cherry Exp $  */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.49 2018/10/10 03:54:54 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.50 2018/10/17 03:43:24 cherry Exp $");
 
 #include "opt_xen.h"
 #include 
@@ -163,11 +163,7 @@ xenevtattach(int n)
 {
 	struct intrhand *ih;
 	int level = IPL_HIGH;
-#ifdef MULTIPROCESSOR
 	bool mpsafe = (level != IPL_VM);
-#else
-	bool mpsafe = false;
-#endif /* MULTIPROCESSOR */
 
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_HIGH);
 	STAILQ_INIT(_pending);



CVS commit: src/sys/dev/acpi

2018-10-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 17 01:16:23 UTC 2018

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

Log Message:
Allow access to PCI configuration space for devices without extended
config support.

ok nonaka@


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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.9 src/sys/dev/acpi/acpi_mcfg.c:1.10
--- src/sys/dev/acpi/acpi_mcfg.c:1.9	Mon Oct 15 12:46:43 2018
+++ src/sys/dev/acpi/acpi_mcfg.c	Wed Oct 17 01:16:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_mcfg.c,v 1.9 2018/10/15 12:46:43 jmcneill Exp $	*/
+/*	$NetBSD: acpi_mcfg.c,v 1.10 2018/10/17 01:16:23 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.9 2018/10/15 12:46:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.10 2018/10/17 01:16:23 jmcneill Exp $");
 
 #include 
 #include 
@@ -52,9 +52,13 @@ ACPI_MODULE_NAME	("acpi_mcfg")
 
 #define	EXTCONF_OFFSET(d, f, r)	d) * 8 + (f)) * PCI_EXTCONF_SIZE) + (r))
 
-#define	EXTCONF_SET_VALID(mb, d, f)	((mb)->valid_devs[(d)] |= __BIT((f)))
-#define	EXTCONF_SET_INVALID(mb, d, f)	((mb)->valid_devs[(d)] &= ~__BIT((f)))
-#define	EXTCONF_IS_VALID(mb, d, f)	((mb)->valid_devs[(d)] & __BIT((f)))
+#define	PCIDEV_SET_VALID(mb, d, f)	((mb)->valid_devs[(d)] |= __BIT((f)))
+#define	PCIDEV_SET_INVALID(mb, d, f)	((mb)->valid_devs[(d)] &= ~__BIT((f)))
+#define	PCIDEV_IS_VALID(mb, d, f)	((mb)->valid_devs[(d)] & __BIT((f)))
+
+#define	EXTCONF_SET_VALID(mb, d, f)	((mb)->valid_extconf[(d)] |= __BIT((f)))
+#define	EXTCONF_SET_INVALID(mb, d, f)	((mb)->valid_extconf[(d)] &= ~__BIT((f)))
+#define	EXTCONF_IS_VALID(mb, d, f)	((mb)->valid_extconf[(d)] & __BIT((f)))
 
 struct mcfg_segment {
 	uint64_t ms_address;		/* Base address */
@@ -65,6 +69,7 @@ struct mcfg_segment {
 	struct mcfg_bus {
 		bus_space_handle_t bsh[32][8];
 		uint8_t valid_devs[32];
+		uint8_t valid_extconf[32];
 		int valid_ndevs;
 		pcitag_t last_probed;
 	} *ms_bus;
@@ -489,7 +494,7 @@ acpimcfg_device_probe(const struct pci_a
 			for (j = last_func; j < end_func; j++) {
 if (i == last_dev && j == last_func)
 	continue;
-EXTCONF_SET_INVALID(mb, i, j);
+PCIDEV_SET_INVALID(mb, i, j);
 			}
 			last_func = 0;
 		}
@@ -513,13 +518,14 @@ acpimcfg_device_probe(const struct pci_a
 		"(cfg[0x%03x]=0x%08x, alias=%s)\n", bus, dev, func,
 		PCI_CONF_SIZE, reg, alias ? "true" : "false");
 		EXTCONF_SET_INVALID(mb, dev, func);
-	} else {
-		aprint_debug_dev(acpi_sc->sc_dev,
-		"MCFG: %03d:%02d:%d: Ok (cfg[0x%03x]=0x%08x)\n",
-		bus, dev, func, PCI_CONF_SIZE, reg);
-		mb->valid_ndevs++;
 	}
 
+	aprint_debug_dev(acpi_sc->sc_dev,
+	"MCFG: %03d:%02d:%d: Ok (cfg[0x%03x]=0x%08x extconf=%c)\n",
+	bus, dev, func, PCI_CONF_SIZE, reg,
+	EXTCONF_IS_VALID(mb, dev, func) ? 'Y' : 'N');
+	mb->valid_ndevs++;
+
 	return 0;
 }
 
@@ -587,6 +593,7 @@ acpimcfg_map_bus(device_t self, pci_chip
 
 	/* Probe extended configuration space of all devices. */
 	memset(mb->valid_devs, 0xff, sizeof(mb->valid_devs));
+	memset(mb->valid_extconf, 0xff, sizeof(mb->valid_extconf));
 	mb->valid_ndevs = 0;
 	mb->last_probed = pci_make_tag(pc, bus, 0, 0);
 
@@ -613,7 +620,7 @@ acpimcfg_map_bus(device_t self, pci_chip
 		pci_conf_write(pc, tag, 0x54, reg);
 	}
 
-	/* Unmap extended configration space of all dev/func. */
+	/* Unmap configuration space of all dev/func. */
 	bus_space_unmap(seg->ms_bst, bsh, ACPIMCFG_SIZE_PER_BUS);
 	memset(mb->bsh, 0, sizeof(mb->bsh));
 
@@ -632,15 +639,15 @@ acpimcfg_map_bus(device_t self, pci_chip
 /* Don't mark invalid to last probed device. */
 continue;
 			}
-			EXTCONF_SET_INVALID(mb, i, j);
+			PCIDEV_SET_INVALID(mb, i, j);
 		}
 		last_func = 0;
 	}
 
-	/* Map extended configuration space per dev/func. */
+	/* Map configuration space per dev/func. */
 	for (i = 0; i < 32; i++) {
 		for (j = 0; j < 8; j++) {
-			if (!EXTCONF_IS_VALID(mb, i, j))
+			if (!PCIDEV_IS_VALID(mb, i, j))
 continue;
 			error = bus_space_map(seg->ms_bst,
 			baddr + EXTCONF_OFFSET(i, j, 0), PCI_EXTCONF_SIZE,
@@ -649,7 +656,7 @@ acpimcfg_map_bus(device_t self, pci_chip
 /* Unmap all handles when map failed. */
 do {
 	while (--j >= 0) {
-		if (!EXTCONF_IS_VALID(mb, i, j))
+		if (!PCIDEV_IS_VALID(mb, i, j))
 			continue;
 		bus_space_unmap(seg->ms_bst,
 		mb->bsh[i][j],
@@ -667,7 +674,7 @@ acpimcfg_map_bus(device_t self, pci_chip
 	aprint_debug_dev(acpi_sc->sc_dev, "MCFG: bus %d: valid devices\n", bus);
 	for (i = 0; i < 32; i++) {
 		for (j = 0; j < 8; j++) {
-			if (EXTCONF_IS_VALID(mb, i, j)) {
+			if (PCIDEV_IS_VALID(mb, i, j)) {
 aprint_debug_dev(acpi_sc->sc_dev,
 "MCFG: %03d:%02d:%d\n", 

CVS commit: src/sys/dev/pci

2018-10-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 17 01:16:51 UTC 2018

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

Log Message:
PCI_QUIRK_HASEXTCNF is no longer required for AMD Seattle PCHB


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 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.11 src/sys/dev/pci/pci_quirks.c:1.12
--- src/sys/dev/pci/pci_quirks.c:1.11	Tue Oct 16 00:10:58 2018
+++ src/sys/dev/pci/pci_quirks.c	Wed Oct 17 01:16:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_quirks.c,v 1.11 2018/10/16 00:10:58 jmcneill Exp $	*/
+/*	$NetBSD: pci_quirks.c,v 1.12 2018/10/17 01:16:50 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.11 2018/10/16 00:10:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_quirks.c,v 1.12 2018/10/17 01:16:50 jmcneill Exp $");
 
 #include 
 #include 
@@ -53,10 +53,6 @@ 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/arch/evbarm/conf

2018-10-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 17 00:04:07 UTC 2018

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

Log Message:
Add dwiic at acpi


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 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.50 src/sys/arch/evbarm/conf/GENERIC64:1.51
--- src/sys/arch/evbarm/conf/GENERIC64:1.50	Tue Oct 16 06:05:38 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Wed Oct 17 00:04:06 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.50 2018/10/16 06:05:38 skrll Exp $
+#	$NetBSD: GENERIC64,v 1.51 2018/10/17 00:04:06 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -255,6 +255,7 @@ plcom*		at acpi?
 # I2C controllers
 bsciic*		at fdt?			# Broadcom BCM283x Serial Control
 dwiic*		at fdt?			# Designware I2C
+dwiic*		at acpi?
 rkiic*		at fdt?			# Rockchip I2C
 sunxirsb*	at fdt?			# Allwinner RSB
 sunxitwi*	at fdt?			# Allwinner TWI



CVS commit: src/sys/dev/acpi

2018-10-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 17 00:03:47 UTC 2018

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

Log Message:
Add ACPI glue for DesignWare I2C controller.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/dwiic_acpi.c
cvs rdiff -u -r1.106 -r1.107 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/files.acpi
diff -u src/sys/dev/acpi/files.acpi:1.106 src/sys/dev/acpi/files.acpi:1.107
--- src/sys/dev/acpi/files.acpi:1.106	Tue Oct 16 10:25:33 2018
+++ src/sys/dev/acpi/files.acpi	Wed Oct 17 00:03:47 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.106 2018/10/16 10:25:33 jmcneill Exp $
+#	$NetBSD: files.acpi,v 1.107 2018/10/17 00:03:47 jmcneill Exp $
 
 include "dev/acpi/acpica/files.acpica"
 
@@ -237,4 +237,8 @@ file	dev/acpi/ahcisata_acpi.c	ahcisata_a
 attach	plgpio at acpinodebus with plgpio_acpi
 file	dev/acpi/plgpio_acpi.c		plgpio_acpi
 
+# DesignWare I2C controller
+attach	dwiic at acpinodebus with dwiic_acpi
+file	dev/acpi/dwiic_acpi.c		dwiic_acpi
+
 include	"dev/acpi/wmi/files.wmi"

Added files:

Index: src/sys/dev/acpi/dwiic_acpi.c
diff -u /dev/null src/sys/dev/acpi/dwiic_acpi.c:1.1
--- /dev/null	Wed Oct 17 00:03:47 2018
+++ src/sys/dev/acpi/dwiic_acpi.c	Wed Oct 17 00:03:47 2018
@@ -0,0 +1,177 @@
+/* $NetBSD: dwiic_acpi.c,v 1.1 2018/10/17 00:03:47 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: dwiic_acpi.c,v 1.1 2018/10/17 00:03:47 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+struct dwiic_acpi_param {
+	uint16_t hcnt;
+	uint16_t lcnt;
+	uint32_t ht;
+};
+
+static int	dwiic_acpi_match(device_t, cfdata_t, void *);
+static void	dwiic_acpi_attach(device_t, device_t, void *);
+
+static void	dwiic_acpi_parse_param(struct dwiic_softc *, ACPI_HANDLE,
+	  const char *, struct dwiic_acpi_param *);
+static void	dwiic_acpi_configure(struct dwiic_softc *, ACPI_HANDLE);
+
+CFATTACH_DECL_NEW(dwiic_acpi, sizeof(struct dwiic_softc), dwiic_acpi_match, dwiic_acpi_attach, NULL, NULL);
+
+static const char * const compatible[] = {
+	"AMDI0510",
+	NULL
+};
+
+static int
+dwiic_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
+dwiic_acpi_attach(device_t parent, device_t self, void *aux)
+{
+	struct dwiic_softc * const sc = device_private(self);
+	struct acpi_attach_args *aa = aux;
+	struct acpi_resources res;
+	struct acpi_mem *mem;
+	struct acpi_irq *irq;
+	ACPI_STATUS rv;
+	int error;
+	void *ih;
+
+	sc->sc_dev = self;
+	sc->sc_type = dwiic_type_generic;
+	sc->sc_iot = aa->aa_memt;
+
+	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;
+	}
+
+	irq = acpi_res_irq(, 0);
+	if (irq == NULL) {
+		aprint_error_dev(self, "couldn't find irq resource\n");
+		goto done;
+	}
+
+	error = bus_space_map(sc->sc_iot, mem->ar_base, mem->ar_length, 0, >sc_ioh);
+	if (error) {
+		aprint_error_dev(self, "couldn't map 

CVS commit: src/sys/dev/acpi

2018-10-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 22:29:43 UTC 2018

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

Log Message:
Ignore SCI and don't try to setup ACPI fixed hardware interfaces in HW-reduced 
mode


To generate a diff of this commit:
cvs rdiff -u -r1.276 -r1.277 src/sys/dev/acpi/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/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.276 src/sys/dev/acpi/acpi.c:1.277
--- src/sys/dev/acpi/acpi.c:1.276	Tue Oct 16 10:25:33 2018
+++ src/sys/dev/acpi/acpi.c	Tue Oct 16 22:29:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.276 2018/10/16 10:25:33 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.277 2018/10/16 22:29:43 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.276 2018/10/16 10:25:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.277 2018/10/16 22:29:43 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -524,16 +524,17 @@ acpi_attach(device_t parent, device_t se
 
 	acpi_active = 1;
 
-	/* Show SCI interrupt. */
-	if (AcpiGbl_FADT.SciInterrupt != 0)
+	if (!AcpiGbl_ReducedHardware) {
+		/* Show SCI interrupt. */
 		aprint_verbose_dev(self, "SCI interrupting at int %u\n",
 		AcpiGbl_FADT.SciInterrupt);
 
-	/*
-	 * Install fixed-event handlers.
-	 */
-	acpi_register_fixed_button(sc, ACPI_EVENT_POWER_BUTTON);
-	acpi_register_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON);
+		/*
+		 * Install fixed-event handlers.
+		 */
+		acpi_register_fixed_button(sc, ACPI_EVENT_POWER_BUTTON);
+		acpi_register_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON);
+	}
 
 	acpitimer_init(sc);
 	acpi_config_tree(sc);
@@ -583,8 +584,10 @@ acpi_detach(device_t self, int flags)
 	if ((rc = acpitimer_detach()) != 0)
 		return rc;
 
-	acpi_deregister_fixed_button(sc, ACPI_EVENT_POWER_BUTTON);
-	acpi_deregister_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON);
+	if (!AcpiGbl_ReducedHardware) {
+		acpi_deregister_fixed_button(sc, ACPI_EVENT_POWER_BUTTON);
+		acpi_deregister_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON);
+	}
 
 	pmf_device_deregister(self);
 



CVS commit: src/usr.sbin/acpitools/acpidump

2018-10-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 16 21:44:38 UTC 2018

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c

Log Message:
FACS is optional if the HW_REDUCED_ACPI flag is set in the FADT.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/acpitools/acpidump/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/usr.sbin/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.32 src/usr.sbin/acpitools/acpidump/acpi.c:1.33
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.32	Fri Oct  5 05:09:31 2018
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Tue Oct 16 21:44:37 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.32 2018/10/05 05:09:31 msaitoh Exp $ */
+/* $NetBSD: acpi.c,v 1.33 2018/10/16 21:44:37 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.32 2018/10/05 05:09:31 msaitoh Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.33 2018/10/16 21:44:37 jmcneill Exp $");
 
 #include 
 #include 
@@ -819,11 +819,16 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp)
 	fadt = (ACPI_TABLE_FADT *)sdp;
 	acpi_print_fadt(sdp);
 
-	facs = (ACPI_TABLE_FACS *)acpi_map_sdt(
-		acpi_select_address(fadt->Facs, fadt->XFacs));
-	if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64)
-		errx(EXIT_FAILURE, "FACS is corrupt");
-	acpi_print_facs(facs);
+	if (acpi_select_address(fadt->Facs, fadt->XFacs) == 0) {
+		if ((fadt->Flags & ACPI_FADT_HW_REDUCED) == 0)
+			errx(EXIT_FAILURE, "Missing FACS and HW_REDUCED_ACPI flag not set in FADT");
+	} else {
+		facs = (ACPI_TABLE_FACS *)acpi_map_sdt(
+			acpi_select_address(fadt->Facs, fadt->XFacs));
+		if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64)
+			errx(EXIT_FAILURE, "FACS is corrupt");
+		acpi_print_facs(facs);
+	}
 
 	dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(
 		acpi_select_address(fadt->Dsdt, fadt->XDsdt));



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

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

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

Log Message:
Fix size calculation in acpi_md_OsUnmapMemory


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

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

Modified files:

Index: src/sys/arch/arm/acpi/acpi_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.2 src/sys/arch/arm/acpi/acpi_machdep.c:1.3
--- src/sys/arch/arm/acpi/acpi_machdep.c:1.2	Mon Oct 15 11:35:03 2018
+++ src/sys/arch/arm/acpi/acpi_machdep.c	Tue Oct 16 16:38:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.2 2018/10/15 11:35:03 jmcneill Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.3 2018/10/16 16:38:22 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.2 2018/10/15 11:35:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.3 2018/10/16 16:38:22 jmcneill Exp $");
 
 #include 
 #include 
@@ -122,7 +122,7 @@ acpi_md_OsUnmapMemory(void *va, UINT32 s
 	vsize_t osz;
 
 	ova = trunc_page((vaddr_t)va);
-	osz = round_page((vaddr_t)va + size) - (vaddr_t)va;
+	osz = round_page((vaddr_t)va + size) - ova;
 
 	pmap_kremove(ova, osz);
 	pmap_update(pmap_kernel());



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

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

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

Log Message:
Only attach to usable processors


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/cpu_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/arch/arm/acpi/cpu_acpi.c
diff -u src/sys/arch/arm/acpi/cpu_acpi.c:1.1 src/sys/arch/arm/acpi/cpu_acpi.c:1.2
--- src/sys/arch/arm/acpi/cpu_acpi.c:1.1	Fri Oct 12 22:20:04 2018
+++ src/sys/arch/arm/acpi/cpu_acpi.c	Tue Oct 16 16:18:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_acpi.c,v 1.1 2018/10/12 22:20:04 jmcneill Exp $ */
+/* $NetBSD: cpu_acpi.c,v 1.2 2018/10/16 16:18:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_acpi.c,v 1.1 2018/10/12 22:20:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_acpi.c,v 1.2 2018/10/16 16:18:15 jmcneill Exp $");
 
 #include 
 #include 
@@ -63,8 +63,14 @@ static int
 cpu_acpi_match(device_t parent, cfdata_t cf, void *aux)
 {
 	ACPI_SUBTABLE_HEADER *hdrp = aux;
+	ACPI_MADT_GENERIC_INTERRUPT *gicc;
 
-	return hdrp->Type == ACPI_MADT_TYPE_GENERIC_INTERRUPT;
+	if (hdrp->Type != ACPI_MADT_TYPE_GENERIC_INTERRUPT)
+		return 0;
+
+	gicc = (ACPI_MADT_GENERIC_INTERRUPT *)hdrp;
+
+	return (gicc->Flags & ACPI_MADT_ENABLED) != 0;
 }
 
 static void



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

2018-10-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Oct 16 13:18:25 UTC 2018

Modified Files:
src/sys/external/bsd/libnv/dist: nv_kern_netbsd.c

Log Message:
fix the shit, as usual


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c

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

Modified files:

Index: src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c
diff -u src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c:1.5 src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c:1.6
--- src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c:1.5	Sun Sep 23 21:35:26 2018
+++ src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c	Tue Oct 16 13:18:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nv_kern_netbsd.c,v 1.5 2018/09/23 21:35:26 rmind Exp $	*/
+/*	$NetBSD: nv_kern_netbsd.c,v 1.6 2018/10/16 13:18:25 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.5 2018/09/23 21:35:26 rmind Exp $");
+__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.6 2018/10/16 13:18:25 maxv Exp $");
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include 
@@ -78,6 +78,9 @@ nvlist_copyin(const nvlist_ref_t *nref, 
 	nvlist_t *nvl;
 	void *buf;
 
+	if (len == 0) {
+		return EINVAL;
+	}
 	if (len >= lim) {
 		return E2BIG;
 	}
@@ -124,7 +127,7 @@ nvlist_copyout(nvlist_ref_t *nref, const
 	error = copyout(buf, uaddr, len);
 	if (error) {
 		uvm_unmap(>p_vmspace->vm_map, (vaddr_t)uaddr,
-		(vaddr_t)uaddr + len);
+		(vaddr_t)uaddr + rlen);
 		goto err;
 	}
 	nref->flags = nvlist_flags(nvl);
@@ -225,7 +228,7 @@ nv_strdup(const char *s1)
 	s2 = nv_malloc(len);
 	if (s2) {
 		memcpy(s2, s1, len);
-		s2[len] = '\0';
+		s2[len-1] = '\0';
 	}
 	return s2;
 }



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

2018-10-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 16 11:28:30 UTC 2018

Modified Files:
src/sys/arch/evbarm/marvell: marvell_start.S

Log Message:
Catch up with armadaxp_start.S:1.5... if only we had generic start code
for arm


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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/marvell/marvell_start.S
diff -u src/sys/arch/evbarm/marvell/marvell_start.S:1.9 src/sys/arch/evbarm/marvell/marvell_start.S:1.10
--- src/sys/arch/evbarm/marvell/marvell_start.S:1.9	Mon Oct 15 16:54:55 2018
+++ src/sys/arch/evbarm/marvell/marvell_start.S	Tue Oct 16 11:28:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvell_start.S,v 1.9 2018/10/15 16:54:55 skrll Exp $ */
+/*	$NetBSD: marvell_start.S,v 1.10 2018/10/16 11:28:30 skrll Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -66,7 +66,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: marvell_start.S,v 1.9 2018/10/15 16:54:55 skrll Exp $")
+RCSID("$NetBSD: marvell_start.S,v 1.10 2018/10/16 11:28:30 skrll Exp $")
 
 #ifndef SDRAM_START
 #define SDRAM_START	0x
@@ -244,8 +244,8 @@ cores_end:
 
 #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) & 0x) | (attr)		;
 
 mmu_init_table:
 	/* fill all table VA==PA */



CVS commit: src/sys

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

Modified Files:
src/sys/arch/evbarm/conf: std.generic64
src/sys/dev/acpi: acpi.c acpi_timer.c files.acpi
src/sys/external/bsd/acpica/dist/include/platform: acnetbsd.h

Log Message:
Rename options ACPI_REDUCED_HARDWARE to ACPI_REDUCED_HW. The former is
a boolean in the acpica build, so use the latter to select the correct
value.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.generic64
cvs rdiff -u -r1.275 -r1.276 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/acpi/acpi_timer.c
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/acpi/files.acpi
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.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/std.generic64
diff -u src/sys/arch/evbarm/conf/std.generic64:1.6 src/sys/arch/evbarm/conf/std.generic64:1.7
--- src/sys/arch/evbarm/conf/std.generic64:1.6	Tue Oct 16 00:32:07 2018
+++ src/sys/arch/evbarm/conf/std.generic64	Tue Oct 16 10:25:33 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: std.generic64,v 1.6 2018/10/16 00:32:07 jmcneill Exp $
+#	$NetBSD: std.generic64,v 1.7 2018/10/16 10:25:33 jmcneill Exp $
 #
 #	generic NetBSD/evbarm64 with FDT support
 
@@ -9,7 +9,7 @@ include		"arch/aarch64/conf/std.aarch64"
 # Architecture options
 options 	AARCH64
 
-options 	ACPI_REDUCED_HARDWARE
+options 	ACPI_REDUCED_HW
 options 	ARM_GENERIC_TODR
 options 	ARM_INTR_IMPL=""
 options 	DRAM_BLOCKS=256

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.275 src/sys/dev/acpi/acpi.c:1.276
--- src/sys/dev/acpi/acpi.c:1.275	Tue Oct 16 00:30:08 2018
+++ src/sys/dev/acpi/acpi.c	Tue Oct 16 10:25:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.275 2018/10/16 00:30:08 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.276 2018/10/16 10:25:33 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.275 2018/10/16 00:30:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.276 2018/10/16 10:25:33 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -1410,7 +1410,7 @@ 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)
+#if (!ACPI_REDUCED_HARDWARE)
 			AcpiHwDisableAllGpes();
 #endif
 

Index: src/sys/dev/acpi/acpi_timer.c
diff -u src/sys/dev/acpi/acpi_timer.c:1.24 src/sys/dev/acpi/acpi_timer.c:1.25
--- src/sys/dev/acpi/acpi_timer.c:1.24	Tue Oct 16 00:30:08 2018
+++ src/sys/dev/acpi/acpi_timer.c	Tue Oct 16 10:25:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_timer.c,v 1.24 2018/10/16 00:30:08 jmcneill Exp $ */
+/* $NetBSD: acpi_timer.c,v 1.25 2018/10/16 10:25:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2006 Matthias Drochner 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.24 2018/10/16 00:30:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.25 2018/10/16 10:25:33 jmcneill Exp $");
 
 #include 
 #include 
@@ -39,7 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_timer.c
 
 #include 
 
-#if !defined(ACPI_REDUCED_HARDWARE)
+#if (!ACPI_REDUCED_HARDWARE)
 static int	acpitimer_test(void);
 
 static struct timecounter acpi_timecounter = {
@@ -63,7 +63,7 @@ acpitimer_supported(void)
 int
 acpitimer_init(struct acpi_softc *sc)
 {
-#if !defined(ACPI_REDUCED_HARDWARE)
+#if (!ACPI_REDUCED_HARDWARE)
 	ACPI_STATUS rv;
 	uint32_t bits;
 	int i, j;
@@ -102,7 +102,7 @@ acpitimer_init(struct acpi_softc *sc)
 int
 acpitimer_detach(void)
 {
-#if !defined(ACPI_REDUCED_HARDWARE)
+#if (!ACPI_REDUCED_HARDWARE)
 	if (!acpitimer_supported())
 		return -1;
 
@@ -112,7 +112,7 @@ acpitimer_detach(void)
 #endif
 }
 
-#if !defined(ACPI_REDUCED_HARDWARE)
+#if (!ACPI_REDUCED_HARDWARE)
 u_int
 acpitimer_read_fast(struct timecounter *tc)
 {

Index: src/sys/dev/acpi/files.acpi
diff -u src/sys/dev/acpi/files.acpi:1.105 src/sys/dev/acpi/files.acpi:1.106
--- src/sys/dev/acpi/files.acpi:1.105	Tue Oct 16 00:30:08 2018
+++ src/sys/dev/acpi/files.acpi	Tue Oct 16 10:25:33 2018
@@ -1,10 +1,10 @@
-#	$NetBSD: files.acpi,v 1.105 2018/10/16 00:30:08 jmcneill Exp $
+#	$NetBSD: files.acpi,v 1.106 2018/10/16 10:25:33 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_REDUCED_HARDWARE ACPI__DIS_IS_BROKEN
+			ACPI_REDUCED_HW ACPI__DIS_IS_BROKEN
 defparam opt_acpi.h	ACPI_DSDT_FILE := "\"/dev/null\""
 defparam opt_acpi.h	ACPI_BLACKLIST_YEAR = 2000
 

Index: src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h
diff -u src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h:1.17 

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

2018-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Oct 16 09:23:29 UTC 2018

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

Log Message:
Handle ENOBUFS better and clean some whitespace.


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

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

Modified files:

Index: src/tests/lib/libc/sys/t_sendmmsg.c
diff -u src/tests/lib/libc/sys/t_sendmmsg.c:1.1 src/tests/lib/libc/sys/t_sendmmsg.c:1.2
--- src/tests/lib/libc/sys/t_sendmmsg.c:1.1	Tue Aug 21 10:38:09 2018
+++ src/tests/lib/libc/sys/t_sendmmsg.c	Tue Oct 16 09:23:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_sendmmsg.c,v 1.1 2018/08/21 10:38:09 christos Exp $	*/
+/*	$NetBSD: t_sendmmsg.c,v 1.2 2018/10/16 09:23:29 roy Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_sendmmsg.c,v 1.1 2018/08/21 10:38:09 christos Exp $");
+__RCSID("$NetBSD: t_sendmmsg.c,v 1.2 2018/10/16 09:23:29 roy Exp $");
 
 #include 
 #include 
@@ -142,7 +142,7 @@ ATF_TC_BODY(sendmmsg_basic, tc)
 			// XXX: ENOBUFS bug, on the receive side!!!
 			// in npkt = min(mmsgsize, mmsgcnt - n);
 			int npkt = min(3, mmsgcnt - n), a;
-			do { 
+			do {
 a = 0;
 ATF_REQUIRE(ioctl(fd[1], FIONSPACE, ) != -1);
 printf("1 %d\n", a);
@@ -184,11 +184,11 @@ ATF_TC_BODY(sendmmsg_basic, tc)
 if (rdied)
 	break;
 cnt = recv(fd[0], rgram, sizeof(rgram), 0);
-ATF_REQUIRE_MSG(cnt != -1, "recv failed (%s)",
-strerror(errno));
+ATF_REQUIRE_MSG(cnt != -1 || errno != ENOBUFS,
+"recv failed (%s)", strerror(errno));
 ATF_CHECK_EQ_MSG(cnt, sizeof(rgram),
 "packet length");
-ATF_CHECK_EQ_MSG(rgram[0], n, 
+ATF_CHECK_EQ_MSG(rgram[0], n,
 "number %u != %u", rgram[0], n);
 ATF_REQUIRE_MSG(memcmp(rgram + 1, DGRAM + 1,
 sizeof(rgram) - 1) == 0, "bad data");



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

2018-10-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 16 06:05:38 UTC 2018

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

Log Message:
Add SOC_THUNDERX (commented out for now as it changes COHERENCY_UNIT)


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 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.49 src/sys/arch/evbarm/conf/GENERIC64:1.50
--- src/sys/arch/evbarm/conf/GENERIC64:1.49	Mon Oct 15 23:59:36 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Tue Oct 16 06:05:38 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.49 2018/10/15 23:59:36 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.50 2018/10/16 06:05:38 skrll Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -65,6 +65,7 @@ options 	SOC_SUN50I_A64
 options 	SOC_SUN50I_H5
 options 	SOC_SUN50I_H6
 options 	SOC_TEGRA210
+#options 	SOC_THUNDERX
 options 	SOC_VIRT
 options 	MULTIPROCESSOR