CVS commit: src/sys/dev

2017-01-14 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Jan 15 07:46:57 UTC 2017

Modified Files:
src/sys/dev: audiovar.h

Log Message:
Fix indent in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/audiovar.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/audiovar.h
diff -u src/sys/dev/audiovar.h:1.48 src/sys/dev/audiovar.h:1.49
--- src/sys/dev/audiovar.h:1.48	Wed Dec 28 02:44:59 2016
+++ src/sys/dev/audiovar.h	Sun Jan 15 07:46:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiovar.h,v 1.48 2016/12/28 02:44:59 nat Exp $	*/
+/*	$NetBSD: audiovar.h,v 1.49 2017/01/15 07:46:57 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -202,7 +202,7 @@ struct audio_softc {
 
 	/**
 	 *  userland
-	 *	|  write(2) & uiomove(9)
+	 *  |  write(2) & uiomove(9)
 	 *  sc_pstreams[0]	 == sc_pustream;
 	 *  |  sc_pfilters[0]
 	 *  sc_pstreams[1]	
@@ -216,9 +216,9 @@ struct audio_softc {
 	 *sc_pr
 	 *  |
 	 *  vchan[0]->sc_pustream
-	 *	|
+	 *  |
 	 *  vchan[0]->sc_mpr
-	 *	|
+	 *  |
 	 *  hardware
 	 */
 
@@ -226,20 +226,21 @@ struct audio_softc {
 
 	/**
 	 *  hardware
-	 *	|
+	 *  |
 	 * oc->sc_mrr		oc = sc->sc_vchan[0]
-	 *	:		Transform though filters same process as each vc to IF
+	 *  :		Transform though filters same process as each
+	 *  :		 vc to IF
 	 * oc->sc_rustream	Audio now in intermediate format (IF)
-	 *	|	mix_read();
+	 *  |	mix_read();
 	 *sc_rr
-	 *	|	audio_upmix	vc = sc->sc_vchan[n]
+	 *  |	audio_upmix	vc = sc->sc_vchan[n]
 	 * vc->sc_mrr		
-	 *	|  vc->sc_rfilters[0]
+	 *  |  vc->sc_rfilters[0]
 	 *  vc->sc_rstreams[0]	
 	 *  |  vc->sc_rfilters[1]
 	 *  vc->sc_rstreams[1]	
 	 *  :
-	 *	|  vc->sc_rfilters[n-1]
+	 *  |  vc->sc_rfilters[n-1]
 	 *  vc->sc_rstreams[n-1]	sc_rparams> == vc->sc_rustream
 	 *  |  uiomove(9) & read(2)
 	 *  userland



CVS commit: src/sys/dev/pci

2017-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Jan 15 04:45:40 UTC 2017

Modified Files:
src/sys/dev/pci: ichsmb.c pucdata.c

Log Message:
Add Intel 200 series devices.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/pucdata.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.47 src/sys/dev/pci/ichsmb.c:1.48
--- src/sys/dev/pci/ichsmb.c:1.47	Thu Oct 13 20:05:06 2016
+++ src/sys/dev/pci/ichsmb.c	Sun Jan 15 04:45:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.47 2016/10/13 20:05:06 jdolecek Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.48 2017/01/15 04:45:39 msaitoh Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.47 2016/10/13 20:05:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.48 2017/01/15 04:45:39 msaitoh Exp $");
 
 #include 
 #include 
@@ -115,6 +115,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_8SERIES_SMB:
 		case PCI_PRODUCT_INTEL_9SERIES_SMB:
 		case PCI_PRODUCT_INTEL_100SERIES_SMB:
+		case PCI_PRODUCT_INTEL_2HS_SMB:
 		case PCI_PRODUCT_INTEL_CORE4G_M_SMB:
 		case PCI_PRODUCT_INTEL_CORE5G_M_SMB:
 		case PCI_PRODUCT_INTEL_BAYTRAIL_PCU_SMB:

Index: src/sys/dev/pci/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.98 src/sys/dev/pci/pucdata.c:1.99
--- src/sys/dev/pci/pucdata.c:1.98	Tue Dec  1 10:08:03 2015
+++ src/sys/dev/pci/pucdata.c	Sun Jan 15 04:45:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.98 2015/12/01 10:08:03 msaitoh Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.99 2017/01/15 04:45:39 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.98 2015/12/01 10:08:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.99 2017/01/15 04:45:39 msaitoh Exp $");
 
 #include 
 #include 
@@ -1919,6 +1919,15 @@ const struct puc_device_description puc_
 	},
 	},
 
+	/* Intel 200 Series KT */
+	{   "Intel 200 Series KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_2HS_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+	
 	/* Intel C600/X79 Series KT */
 	{   "Intel C600/X79 Series KT",
 	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C600_KT, 0, 0 },



CVS commit: src/sys/dev/pci

2017-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Jan 15 04:43:28 UTC 2017

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

Log Message:
 Add Intel 200 series chipset devices from "Table 2-2. PCH-H Device and
Revision ID Table, Intel 200 Series Chipset Family Platform Controller
Hub(PCI) Datasheet Volume 1 of 2 (335192-001)".


To generate a diff of this commit:
cvs rdiff -u -r1.1277 -r1.1278 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.1277 src/sys/dev/pci/pcidevs:1.1278
--- src/sys/dev/pci/pcidevs:1.1277	Sun Jan 15 03:49:09 2017
+++ src/sys/dev/pci/pcidevs	Sun Jan 15 04:43:27 2017
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1277 2017/01/15 03:49:09 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1278 2017/01/15 04:43:27 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3602,10 +3602,10 @@ product INTEL 82801HO_LPC 	0x2814	82801H
 product INTEL 82801HBM_LPC  0x2815  82801HBM LPC Interface Bridge
 product INTEL 82801H_SATA_1	0x2820	82801H SATA Controller
 product INTEL 82801H_SATA_AHCI6	0x2821	82801H AHCI SATA Controller w/ 6 ports
-product INTEL 82801H_SATA_RAID	0x2822	82801H/C61x/X99/Z170 RAID SATA Controller
+product INTEL 82801H_SATA_RAID	0x2822	82801H/C61x/X99/Z170/[ZQH]270 RAID SATA Controller
 product INTEL 82801H_SATA_AHCI4	0x2824	82801H AHCI SATA Controller w/ 4 ports
 product INTEL 82801H_SATA_2	0x2825	82801H SATA Controller
-product INTEL C610_SATA_RAID_3	0x2826	C61x/X99 SATA Controller (RAID)
+product INTEL C610_SATA_RAID_3	0x2826	C61x/X99/[ZQH]270 SATA Controller (RAID)
 product INTEL C610_SSATA_RAID_2	0x2827	C61x/X99 sSATA Controller (RAID)
 product INTEL 82801HEM_SATA	0x2828	82801HEM SATA Controller
 product INTEL 82801HBM_SATA_AHCI 0x2829  82801HBM AHCI SATA Controller
@@ -4590,6 +4590,62 @@ product INTEL 100SERIES_PCIE_18	0xa168	1
 product INTEL 100SERIES_PCIE_19	0xa169	100 Series PCIE
 product INTEL 100SERIES_PCIE_20	0xa16a	100 Series PCIE
 product INTEL 100SERIES_HDA	0xa170	100 Series HD Audio
+product INTEL 2HS_AHCI		0xa282	200 Series SATA (AHCI)
+product INTEL 2HS_RAID		0xa286	200 Series SATA (RAID)
+product INTEL 2HS_RAID_RST_OPTANE 0xa28e 200 Series SATA (Acceleration with Optane)
+product INTEL 2HS_PCIE_1	0xa290	200 Series PCIE
+product INTEL 2HS_PCIE_2	0xa291	200 Series PCIE
+product INTEL 2HS_PCIE_3	0xa292	200 Series PCIE
+product INTEL 2HS_PCIE_4	0xa293	200 Series PCIE
+product INTEL 2HS_PCIE_5	0xa294	200 Series PCIE
+product INTEL 2HS_PCIE_6	0xa295	200 Series PCIE
+product INTEL 2HS_PCIE_7	0xa296	200 Series PCIE
+product INTEL 2HS_PCIE_8	0xa297	200 Series PCIE
+product INTEL 2HS_PCIE_9	0xa298	200 Series PCIE
+product INTEL 2HS_PCIE_10	0xa299	200 Series PCIE
+product INTEL 2HS_PCIE_11	0xa29a	200 Series PCIE
+product INTEL 2HS_PCIE_12	0xa29b	200 Series PCIE
+product INTEL 2HS_PCIE_13	0xa29c	200 Series PCIE
+product INTEL 2HS_PCIE_14	0xa29d	200 Series PCIE
+product INTEL 2HS_PCIE_15	0xa29e	200 Series PCIE
+product INTEL 2HS_PCIE_16	0xa29f	200 Series PCIE
+product INTEL 2HS_P2SB		0xa2a0	200 Series P2SB
+product INTEL 2HS_PMC		0xa2a1	200 Series PMC
+product INTEL 2HS_SMB		0xa2a3	200 Series SMBus
+product INTEL 2HS_SPI		0xa2a4	200 Series SPI
+product INTEL 2HS_TRACE		0xa2a6	200 Series Trace Hub
+product INTEL 2HS_UART_0	0xa2a7	200 Series UART 0
+product INTEL 2HS_UART_1	0xa2a8	200 Series UART 1
+product INTEL 2HS_GSPI_0	0xa2a9	200 Series GSPI 0
+product INTEL 2HS_GSPI_1	0xa2aa	200 Series GSPI 1
+product INTEL 2HS_XHCI		0xa2af	200 Series xHCI
+product INTEL 2HS_USBOTG	0xa2b0	200 Series USB (OTG)
+product INTEL 2HS_THERM		0xa2b1	200 Series Thermal
+product INTEL 2HS_ISH		0xa2b5	200 Series ISH
+product INTEL 2HS_MEI_1		0xa2ba	200 Series MEI
+product INTEL 2HS_MEI_2		0xa2bb	200 Series MEI
+product INTEL 2HS_IDER		0xa2bc	200 Series IDER
+product INTEL 2HS_KT		0xa2bd	200 Series KT
+product INTEL 2HS_MEI_3		0xa2be	200 Series MEI
+product INTEL 2HS_LPC_H27	0xa2c4	H270 LPC
+product INTEL 2HS_LPC_Z27	0xa2c5	Z270 LPC
+product INTEL 2HS_LPC_Q27	0xa2c6	Q270 LPC
+product INTEL 2HS_LPC_Q25	0xa2c7	Q250 LPC
+product INTEL 2HS_LPC_B25	0xa2c8	B250 LPC
+product INTEL 2HS_I2C_0		0xa2e0	200 Series I2C 0
+product INTEL 2HS_I2C_1		0xa2e1	200 Series I2C 1
+product INTEL 2HS_I2C_2		0xa2e2	200 Series I2C 2
+product INTEL 2HS_I2C_3		0xa2e3	200 Series I2C 3
+product INTEL 2HS_UART_2	0xa2e6	200 Series UART 2
+product INTEL 2HS_PCIE_17	0xa2e7	200 Series PCIE
+product INTEL 2HS_PCIE_18	0xa2e8	200 Series PCIE
+product INTEL 2HS_PCIE_19	0xa2e9	200 Series PCIE
+product INTEL 2HS_PCIE_20	0xa2ea	200 Series PCIE
+product INTEL 2HS_PCIE_21	0xa2eb	200 Series PCIE
+product INTEL 2HS_PCIE_22	0xa2ec	200 Series PCIE
+product INTEL 2HS_PCIE_23	0xa2ed	200 Series PCIE
+product INTEL 2HS_PCIE_24	0xa2ee	200 Series PCIE
+product INTEL 2HS_HDA		0xa2f0	200 Series HD Audio
 product INTEL 21152		0xb152	S21152BB PCI-PCI Bridge
 product 

CVS commit: src/sys/dev/pci

2017-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Jan 15 03:49:09 UTC 2017

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

Log Message:
 Add Core 7G devices from "7th Generation Intel Processor Families for
{S, U/Y, H} Platforms Datasheel Volume 2 of 2" (S: 335196-001, U/Y: 334662-002,
H: 335191-001). For 0x5906 (U processor, HD Graphics 610), it's taken from
ark.inte.com.


To generate a diff of this commit:
cvs rdiff -u -r1.1276 -r1.1277 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.1276 src/sys/dev/pci/pcidevs:1.1277
--- src/sys/dev/pci/pcidevs:1.1276	Tue Jan 10 05:04:31 2017
+++ src/sys/dev/pci/pcidevs	Sun Jan 15 03:49:09 2017
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1276 2017/01/10 05:04:31 nonaka Exp $
+$NetBSD: pcidevs,v 1.1277 2017/01/15 03:49:09 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4128,6 +4128,30 @@ product INTEL EP80579_LAN_1	0x5040	EP805
 product INTEL EP80579_LAN_2	0x5044	EP80579 LAN
 product INTEL EP80579_LAN_3	0x5048	EP80579 LAN
 product INTEL 80312_ATU		0x530d	80310 ATU
+product INTEL CORE7G_H_M_D_HOST_DRAM 0x5900 Core 7G (H, Mobile, Dual) Host Bridge, DRAM
+product INTEL CORE7G_PCIE_X16	0x5901	Core 7G PCIe x16
+product INTEL CORE7G_S_GT1	0x5902	HD Graphics 610 (GT1)
+product INTEL CORE7G_U_HOST_DRAM 0x5904	Core 7G (U) Host Bridge, DRAM
+product INTEL CORE7G_PCIE_X8	0x5905	Core 7G PCIe x8
+product INTEL CORE7G_U_GT1	0x5906	HD Graphics 610 (GT1)
+product INTEL CORE7G_PCIE_X4	0x5909	Core 7G PCIe x4
+product INTEL CORE7G_H_GT1	0x590b	HD Graphics (GT1)
+product INTEL CORE7G_Y_HOST_DRAM 0x590c	Core 7G (Y) Host Bridge, DRAM
+product INTEL CORE7G_Y_GT1	0x590e	HD Graphics (GT1)
+product INTEL CORE7G_S_D_HOST_DRAM 0x590f Core 7G (S, Dual) Host Bridge, DRAM
+product INTEL CORE7G_H_M_Q_HOST_DRAM 0x5910 Core 7G (H, Mobile, Quad) Host Bridge, DRAM
+product INTEL CORE7G_GMM	0x5911	Core 7G Gaussian Mixture Model
+product INTEL CORE7G_S_GT2	0x5912	HD Graphics 630 (GT1)
+product INTEL CORE7G_U_GT2	0x5916	HD Graphics 620 (GT2)
+product INTEL CORE7G_H_SW_HOST_DRAM 0x5918 Core 7G (H, Server or Workstation) Host Bridge, DRAM
+product INTEL CORE7G_IU		0x5919	Core 7G Image Unit
+product INTEL CORE7G_H_M_GT2	0x591b	HD Graphics 630 (GT2, Mobile)
+product INTEL CORE7G_HU_GT2	0x591d	HD Graphics P630 (GT2, H or U)
+product INTEL CORE7G_Y_GT2	0x591e	HD Graphics 615 (GT2)
+product INTEL CORE7G_S_Q_HOST_DRAM 0x591f Core 7G (S, Quad) Host Bridge, DRAM
+product INTEL CORE7G_U_GT3	0x5923	HD Graphics (GT3)
+product INTEL CORE7G_U_GT3E_15W	0x5926	Iris Plus Graphics 640 (GT3e, 15W)
+product INTEL CORE7G_U_GT3E_28W	0x5927	Iris Plus Graphics 650 (GT3e, 28W)
 product INTEL XEOND_HB_DMI2	0x6f00	Core i7-6xxxK/Xeon-D Host Bridge (DMI2)
 product INTEL XEOND_HB_PCIE	0x6f01	Xeon-D Host Bridge (PCIe)
 product INTEL XEOND_PCIE_1	0x6f02	Xeon-D PCIe Root Port (x8 or x4 max)



CVS commit: src/sys/rump/dev/lib/libdrvctl

2017-01-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 15 01:48:05 UTC 2017

Modified Files:
src/sys/rump/dev/lib/libdrvctl: drvctl_component.c

Log Message:
We no longer need ioconf.c - remove it to avoid "defined but not used"
compiler error.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/dev/lib/libdrvctl/drvctl_component.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/rump/dev/lib/libdrvctl/drvctl_component.c
diff -u src/sys/rump/dev/lib/libdrvctl/drvctl_component.c:1.3 src/sys/rump/dev/lib/libdrvctl/drvctl_component.c:1.4
--- src/sys/rump/dev/lib/libdrvctl/drvctl_component.c:1.3	Sat Jan 14 21:36:58 2017
+++ src/sys/rump/dev/lib/libdrvctl/drvctl_component.c	Sun Jan 15 01:48:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: drvctl_component.c,v 1.3 2017/01/14 21:36:58 pgoyette Exp $	*/
+/*	$NetBSD: drvctl_component.c,v 1.4 2017/01/15 01:48:05 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,15 +26,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drvctl_component.c,v 1.3 2017/01/14 21:36:58 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drvctl_component.c,v 1.4 2017/01/15 01:48:05 pgoyette Exp $");
 
 #include 
 #include 
 #include 
 #include 
 
-#include "ioconf.c"
-
 #include 
 #include 
 



CVS commit: src/sys/kern

2017-01-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jan 15 01:47:24 UTC 2017

Modified Files:
src/sys/kern: kern_module_vfs.c

Log Message:
use a bound string copy


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/kern_module_vfs.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/kern/kern_module_vfs.c
diff -u src/sys/kern/kern_module_vfs.c:1.14 src/sys/kern/kern_module_vfs.c:1.15
--- src/sys/kern/kern_module_vfs.c:1.14	Tue Mar 15 02:59:24 2016
+++ src/sys/kern/kern_module_vfs.c	Sun Jan 15 01:47:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module_vfs.c,v 1.14 2016/03/15 02:59:24 pgoyette Exp $	*/
+/*	$NetBSD: kern_module_vfs.c,v 1.15 2017/01/15 01:47:24 maya Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_module_vfs.c,v 1.14 2016/03/15 02:59:24 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module_vfs.c,v 1.15 2017/01/15 01:47:24 maya Exp $");
 
 #define _MODULE_INTERNAL
 #include 
@@ -162,7 +162,7 @@ module_load_plist_vfs(const char *modpat
 	base = NULL;
 
 	proppath = PNBUF_GET();
-	strcpy(proppath, modpath);
+	strlcpy(proppath, modpath, MAXPATHLEN);
 	pathlen = strlen(proppath);
 	if ((pathlen >= 6) && (strcmp([pathlen - 5], ".kmod") == 0)) {
 		strcpy([pathlen - 5], ".plist");



CVS commit: src/sys/kern

2017-01-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jan 15 01:28:14 UTC 2017

Modified Files:
src/sys/kern: sys_lwp.c

Log Message:
use a bound string copy


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/sys_lwp.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/kern/sys_lwp.c
diff -u src/sys/kern/sys_lwp.c:1.57 src/sys/kern/sys_lwp.c:1.58
--- src/sys/kern/sys_lwp.c:1.57	Fri Jul 24 13:02:52 2015
+++ src/sys/kern/sys_lwp.c	Sun Jan 15 01:28:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_lwp.c,v 1.57 2015/07/24 13:02:52 maxv Exp $	*/
+/*	$NetBSD: sys_lwp.c,v 1.58 2017/01/15 01:28:14 maya Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.57 2015/07/24 13:02:52 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.58 2017/01/15 01:28:14 maya Exp $");
 
 #include 
 #include 
@@ -822,7 +822,7 @@ sys__lwp_getname(struct lwp *l, const st
 	if (t->l_name == NULL)
 		name[0] = '\0';
 	else
-		strcpy(name, t->l_name);
+		strlcpy(name, t->l_name, sizeof(name));
 	lwp_unlock(t);
 	mutex_exit(p->p_lock);
 



CVS commit: src/sys/dev

2017-01-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Jan 15 00:04:02 UTC 2017

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

Log Message:
Forgot not to decrement sc_opens on unsuccessful open.


To generate a diff of this commit:
cvs rdiff -u -r1.290 -r1.291 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.290 src/sys/dev/audio.c:1.291
--- src/sys/dev/audio.c:1.290	Sat Jan 14 20:05:37 2017
+++ src/sys/dev/audio.c	Sun Jan 15 00:04:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.290 2017/01/14 20:05:37 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.291 2017/01/15 00:04:01 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.290 2017/01/14 20:05:37 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.291 2017/01/15 00:04:01 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -2027,11 +2027,6 @@ bad:
 	vc->sc_nrfilters = 0;
 	if (hw->close != NULL && sc->sc_opens == 0)
 		hw->close(sc->hw_hdl);
-	if (flags & FREAD)
-		sc->sc_recopens--;
-	sc->sc_opens--;
-	sc->sc_audiopid[n].pid = -1;
-	sc->sc_despid[n].pid = -1;
 	mutex_exit(sc->sc_lock);
 	audio_free_ring(sc, >sc_mpr);
 	audio_free_ring(sc, >sc_mrr);



CVS commit: src/usr.bin/make

2017-01-14 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Jan 14 22:58:04 UTC 2017

Modified Files:
src/usr.bin/make: make.1 var.c
src/usr.bin/make/unit-tests: varmisc.exp varmisc.mk

Log Message:
Allow providing a utc value to :{gm,local}time

Reviewed by: christos


To generate a diff of this commit:
cvs rdiff -u -r1.263 -r1.264 src/usr.bin/make/make.1
cvs rdiff -u -r1.208 -r1.209 src/usr.bin/make/var.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmisc.mk

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.263 src/usr.bin/make/make.1:1.264
--- src/usr.bin/make/make.1:1.263	Fri Aug 26 23:37:54 2016
+++ src/usr.bin/make/make.1	Sat Jan 14 22:58:04 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $
+.\"	$NetBSD: make.1,v 1.264 2017/01/14 22:58:04 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd August 26, 2016
+.Dd January 14, 2017
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -1204,18 +1204,24 @@ safely through recursive invocations of
 .Nm .
 .It Cm \&:R
 Replaces each word in the variable with everything but its suffix.
-.It Cm \&:gmtime
+.It Cm \&:gmtime[=utc]
 The value is a format string for
 .Xr strftime 3 ,
-using the current
+using
 .Xr gmtime 3 .
+If a
+.Va utc
+value is not provided or is 0, the current time is used.
 .It Cm \&:hash
 Compute a 32-bit hash of the value and encode it as hex digits.
-.It Cm \&:localtime
+.It Cm \&:localtime[=utc]
 The value is a format string for
 .Xr strftime 3 ,
-using the current
+using
 .Xr localtime 3 .
+If a
+.Va utc
+value is not provided or is 0, the current time is used.
 .It Cm \&:tA
 Attempt to convert variable to an absolute path using
 .Xr realpath 3 ,

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.208 src/usr.bin/make/var.c:1.209
--- src/usr.bin/make/var.c:1.208	Fri Jun  3 01:21:59 2016
+++ src/usr.bin/make/var.c	Sat Jan 14 22:58:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.209 2017/01/14 22:58:04 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.209 2017/01/14 22:58:04 sjg Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.209 2017/01/14 22:58:04 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2381,12 +2381,12 @@ VarHash(char *str)
 }
 
 static char *
-VarStrftime(const char *fmt, int zulu)
+VarStrftime(const char *fmt, int zulu, time_t utc)
 {
 char buf[BUFSIZ];
-time_t utc;
 
-time();
+if (!utc)
+	time();
 if (!*fmt)
 	fmt = "%c";
 strftime(buf, sizeof(buf), fmt, zulu ? gmtime() : localtime());
@@ -2483,6 +2483,8 @@ VarStrftime(const char *fmt, int zulu)
 /* we now have some modifiers with long names */
 #define STRMOD_MATCH(s, want, n) \
 (strncmp(s, want, n) == 0 && (s[n] == endc || s[n] == ':'))
+#define STRMOD_MATCHX(s, want, n) \
+(strncmp(s, want, n) == 0 && (s[n] == endc || s[n] == ':' || s[n] == '='))
 
 static char *
 ApplyModifiers(char *nstr, const char *tstr,
@@ -2494,12 +2496,14 @@ ApplyModifiers(char *nstr, const char *t
 const char *cp;	/* Secondary pointer into str (place marker
  * for tstr) */
 char	   *newStr;	/* New value to return */
+char	   *ep;
 char	termc;	/* Character which terminated scan */
 int cnt;	/* Used to count brace pairs when variable in
  * in parens or braces */
 char	delim;
 int		modifier;	/* that we are processing */
 Var_Parse_State parsestate; /* Flags passed to helper functions */
+time_t	utc;		/* for VarStrftime */
 
 delim = '\0';
 parsestate.oneBigWord = FALSE;
@@ -2896,8 +2900,6 @@ ApplyModifiers(char *nstr, const char *t
 		 * integer for :[N], or two integers
 		 * separated by ".." for :[start..end].
 		 */
-		char *ep;
-
 		VarSelectWords_t seldata = { 0, 0 };
 
 		seldata.start = strtol(estr, , 0);
@@ -2956,9 +2958,15 @@ ApplyModifiers(char *nstr, const char *t
 	}
 	case 'g':
 	cp = tstr + 1;	/* make sure it is set */
-	if (STRMOD_MATCH(tstr, "gmtime", 6)) {
-		newStr = VarStrftime(nstr, 1);
-		cp = tstr + 6;
+	if (STRMOD_MATCHX(tstr, "gmtime", 6)) {
+		if (tstr[6] == '=') {
+		utc = strtoul([7], , 10);
+		cp = ep;
+		} else {
+		utc = 0;
+		cp = tstr + 6;
+		}
+		newStr = VarStrftime(nstr, 1, utc);
 		termc = *cp;
 	} 

CVS commit: src/sys/arch/cesfic/include

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 22:24:43 UTC 2017

Modified Files:
src/sys/arch/cesfic/include: param.h

Log Message:
protect against multiple inclusion.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/cesfic/include/param.h

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

Modified files:

Index: src/sys/arch/cesfic/include/param.h
diff -u src/sys/arch/cesfic/include/param.h:1.12 src/sys/arch/cesfic/include/param.h:1.13
--- src/sys/arch/cesfic/include/param.h:1.12	Fri Feb 10 12:35:49 2012
+++ src/sys/arch/cesfic/include/param.h	Sat Jan 14 17:24:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.12 2012/02/10 17:35:49 para Exp $	*/
+/*	$NetBSD: param.h,v 1.13 2017/01/14 22:24:43 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -37,7 +37,8 @@
  *
  *	@(#)param.h	8.1 (Berkeley) 6/10/93
  */
-
+#ifndef _MACHINE_PARAM_H_
+#define _MACHINE_PARAM_H_
 /*
  * Machine dependent constants for CES FIC8234.
  */
@@ -83,3 +84,4 @@
 
 void	_delay(u_int);
 #endif /* _KERNEL && !_LOCORE */
+#endif /* _MACHINE_PARAM_H_ */



CVS commit: src/lib/libc/gen

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 22:19:29 UTC 2017

Modified Files:
src/lib/libc/gen: getpwent.c

Log Message:
don't include machine/param.h  already does WTF?


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/lib/libc/gen/getpwent.c

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

Modified files:

Index: src/lib/libc/gen/getpwent.c
diff -u src/lib/libc/gen/getpwent.c:1.81 src/lib/libc/gen/getpwent.c:1.82
--- src/lib/libc/gen/getpwent.c:1.81	Sat Sep  8 11:15:06 2012
+++ src/lib/libc/gen/getpwent.c	Sat Jan 14 17:19:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: getpwent.c,v 1.81 2012/09/08 15:15:06 dholland Exp $	*/
+/*	$NetBSD: getpwent.c,v 1.82 2017/01/14 22:19:29 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2000, 2004-2005 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
 #if 0
 static char sccsid[] = "@(#)getpwent.c	8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: getpwent.c,v 1.81 2012/09/08 15:15:06 dholland Exp $");
+__RCSID("$NetBSD: getpwent.c,v 1.82 2017/01/14 22:19:29 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -117,7 +117,6 @@ __RCSID("$NetBSD: getpwent.c,v 1.81 2012
 #endif
 
 #ifdef YP
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/alpha/include

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 21:58:17 UTC 2017

Modified Files:
src/sys/arch/alpha/include: asm.h

Log Message:
Undo; the correct fix was applied in csu/arch/alpha/crtbegin.h


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/alpha/include/asm.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/alpha/include/asm.h
diff -u src/sys/arch/alpha/include/asm.h:1.35 src/sys/arch/alpha/include/asm.h:1.36
--- src/sys/arch/alpha/include/asm.h:1.35	Sat Jan 14 11:15:10 2017
+++ src/sys/arch/alpha/include/asm.h	Sat Jan 14 16:58:17 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: asm.h,v 1.35 2017/01/14 16:15:10 martin Exp $ */
+/* $NetBSD: asm.h,v 1.36 2017/01/14 21:58:17 christos Exp $ */
 
 /*
  * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@@ -133,7 +133,6 @@
 /*
  * Useful stuff.
  */
-#undef __CONCAT
 #ifdef __STDC__
 #define	__CONCAT(a,b)	a ## b
 #else
@@ -643,7 +642,6 @@ label:	ASCIZ msg;		\
 /*
  * Kernel RCS ID tag and copyright macros
  */
-#undef __SECTIONSTRING
 #define	__SECTIONSTRING(_sec, _str)\
 	.pushsection _sec ; .asciz _str ; .popsection
 



CVS commit: src/sys/arch/evbarm/stand/bootimx23

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 21:57:20 UTC 2017

Modified Files:
src/sys/arch/evbarm/stand/bootimx23: args_prep.c

Log Message:
there is no  in standalone code; should be getting strcpy from
libkern.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/stand/bootimx23/args_prep.c

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

Modified files:

Index: src/sys/arch/evbarm/stand/bootimx23/args_prep.c
diff -u src/sys/arch/evbarm/stand/bootimx23/args_prep.c:1.2 src/sys/arch/evbarm/stand/bootimx23/args_prep.c:1.3
--- src/sys/arch/evbarm/stand/bootimx23/args_prep.c:1.2	Sat Jan 14 07:45:28 2017
+++ src/sys/arch/evbarm/stand/bootimx23/args_prep.c	Sat Jan 14 16:57:20 2017
@@ -1,4 +1,4 @@
-/* $Id: args_prep.c,v 1.2 2017/01/14 12:45:28 martin Exp $ */
+/* $Id: args_prep.c,v 1.3 2017/01/14 21:57:20 christos Exp $ */
 
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -82,8 +82,6 @@
 #include 
 #include 
 
-#include 
-
 #include "common.h"
 
 static void ngets(char *, int);



CVS commit: src/sys/rump

2017-01-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jan 14 21:36:59 UTC 2017

Modified Files:
src/sys/rump/dev/lib/libdrvctl: drvctl_component.c
src/sys/rump/librump/rumpkern: devsw.c

Log Message:
Don't call the drvctl module's initialization code during rump component
initialization.  Instead, temporarily attach the drvctl's cdevsw to
determine its device c-major, create the /dev/drvctl node using that
c-major, and then detach.  This leaves things in a state where normal
module initialization can run.

Since we're now creating the /dev/drvctl device node correctly, we don't
need to create it again.  So mark the device as DEVNODE_DONTBOTHER in
the devsw_conv0 conversion table.

This bug was introduced more than a year ago (src/sys/kern/kern_drvctl.c
rev 1.40), but was silently ignored except when running a rump_server
built with LOCKDEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libdrvctl/drvctl_component.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpkern/devsw.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/rump/dev/lib/libdrvctl/drvctl_component.c
diff -u src/sys/rump/dev/lib/libdrvctl/drvctl_component.c:1.2 src/sys/rump/dev/lib/libdrvctl/drvctl_component.c:1.3
--- src/sys/rump/dev/lib/libdrvctl/drvctl_component.c:1.2	Tue Jan 26 23:12:15 2016
+++ src/sys/rump/dev/lib/libdrvctl/drvctl_component.c	Sat Jan 14 21:36:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: drvctl_component.c,v 1.2 2016/01/26 23:12:15 pooka Exp $	*/
+/*	$NetBSD: drvctl_component.c,v 1.3 2017/01/14 21:36:58 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drvctl_component.c,v 1.2 2016/01/26 23:12:15 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drvctl_component.c,v 1.3 2017/01/14 21:36:58 pgoyette Exp $");
 
 #include 
 #include 
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: drvctl_compo
 #include "ioconf.c"
 
 #include 
+#include 
 
 RUMP_COMPONENT(RUMP_COMPONENT_DEV)
 {
@@ -43,13 +44,16 @@ RUMP_COMPONENT(RUMP_COMPONENT_DEV)
 	devmajor_t bmaj, cmaj;
 	int error;
 
-	drvctl_init();
-
-	config_init_component(cfdriver_ioconf_drvctl,
-	cfattach_ioconf_drvctl, cfdata_ioconf_drvctl);
-
 	bmaj = cmaj = NODEVMAJOR;
-	if ((error = devsw_attach("drvctl", NULL, ,
-	_cdevsw, )) != 0)
+	error = devsw_attach("drvctl", NULL, , _cdevsw, );
+	if (error != 0)
 		panic("drvctl devsw attach failed: %d", error);
+
+	error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/drvctl", cmaj, 0);
+	if ( error !=0)
+		panic("cannot create drvctl device node: %d", error);
+
+	error = devsw_detach(NULL, _cdevsw);
+	if (error != 0)
+		panic("cannot detach drvctl devsw: %d", error);
 }

Index: src/sys/rump/librump/rumpkern/devsw.c
diff -u src/sys/rump/librump/rumpkern/devsw.c:1.7 src/sys/rump/librump/rumpkern/devsw.c:1.8
--- src/sys/rump/librump/rumpkern/devsw.c:1.7	Fri Feb 25 18:56:20 2011
+++ src/sys/rump/librump/rumpkern/devsw.c	Sat Jan 14 21:36:58 2017
@@ -14,7 +14,7 @@ struct devsw_conv devsw_conv0[] = {
 	{ "pps", -1, 164, DEVNODE_DONTBOTHER, 0, { 0, 0 }},
 	{ "ptm", -1, 165, DEVNODE_DONTBOTHER, 0, { 0, 0 }},
 	{ "atabus", -1, 166, DEVNODE_VECTOR, 0, { 4, 0 }},
-	{ "drvctl", -1, 167, DEVNODE_SINGLE, 0, { 0, 0 }},
+	{ "drvctl", -1, 167, DEVNODE_DONTBOTHER, 0, { 0, 0 }},
 	{ "dk", 168, 168, DEVNODE_DONTBOTHER, 0, { 0, 0 }},
 	{ "tap", -1, 169, DEVNODE_VECTOR, 0, { 4, 0 }},
 	{ "veriexec", -1, 170, DEVNODE_DONTBOTHER, 0, { 0, 0 }},



CVS commit: src/sys/arch/powerpc/include

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 21:33:09 UTC 2017

Modified Files:
src/sys/arch/powerpc/include: param.h

Log Message:
belatedly fix constants for ppc64 (this does not define __arch64__ like sparc
does?)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/include/param.h

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

Modified files:

Index: src/sys/arch/powerpc/include/param.h
diff -u src/sys/arch/powerpc/include/param.h:1.29 src/sys/arch/powerpc/include/param.h:1.30
--- src/sys/arch/powerpc/include/param.h:1.29	Tue Jan 29 10:47:16 2013
+++ src/sys/arch/powerpc/include/param.h	Sat Jan 14 16:33:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.29 2013/01/29 15:47:16 kiyohara Exp $	*/
+/*	$NetBSD: param.h,v 1.30 2017/01/14 21:33:09 christos Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -41,17 +41,26 @@
 #endif
 
 /*
- * Machine dependent constants for PowerPC (32-bit only currently)
+ * Machine dependent constants for PowerPC
  * For userland regardless of port, force MACHINE to be "powerpc"
  */
 #ifndef _KERNEL
 #undef MACHINE
 #endif
-#ifndef MACHINE
-#define	MACHINE		"powerpc"
+
+#ifdef _LP64
+# ifndef MACHINE
+#  define	MACHINE		"powerpc64"
+# endif
+# define	MACHINE_ARCH	"powerpc64"
+# define	MID_MACHINE	MID_POWERPC64
+#else
+# ifndef MACHINE
+#  define	MACHINE		"powerpc"
+# endif
+# define	MACHINE_ARCH	"powerpc"
+# define	MID_MACHINE	MID_POWERPC
 #endif
-#define	MACHINE_ARCH	"powerpc"
-#define	MID_MACHINE	MID_POWERPC
 
 /* PowerPC-specific macro to align a stack pointer (downwards). */
 #define	STACK_ALIGNBYTES	(16 - 1)	/* AltiVec */



CVS commit: src/sys/sys

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 21:29:02 UTC 2017

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

Log Message:
Add PPC64


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/aout_mids.h

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

Modified files:

Index: src/sys/sys/aout_mids.h
diff -u src/sys/sys/aout_mids.h:1.6 src/sys/sys/aout_mids.h:1.7
--- src/sys/sys/aout_mids.h:1.6	Mon Dec  8 15:51:02 2014
+++ src/sys/sys/aout_mids.h	Sat Jan 14 16:29:02 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: aout_mids.h,v 1.6 2014/12/08 20:51:02 christos Exp $ */
+/* $NetBSD: aout_mids.h,v 1.7 2017/01/14 21:29:02 christos Exp $ */
 
 /*
  * Copyright (c) 2009, The NetBSD Foundation, Inc.
@@ -53,6 +53,7 @@
 #define	MID_M680002K	0x090	/* m68000 with 2K page sizes */
 #define	MID_SH3		0x091	/* SH3 */
 
+#define	MID_POWERPC64	0x094	/* big-endian PowerPC 64 */
 #define	MID_POWERPC	0x095	/* big-endian PowerPC */
 #define	MID_VAX		0x096	/* VAX */
 #define	MID_MIPS1	0x097	/* MIPS1 */



CVS commit: src/external/public-domain/xz/lib

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 21:20:39 UTC 2017

Modified Files:
src/external/public-domain/xz/lib: Makefile

Log Message:
Don't error out for psabi.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/public-domain/xz/lib/Makefile

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

Modified files:

Index: src/external/public-domain/xz/lib/Makefile
diff -u src/external/public-domain/xz/lib/Makefile:1.6 src/external/public-domain/xz/lib/Makefile:1.7
--- src/external/public-domain/xz/lib/Makefile:1.6	Tue Jan  5 08:07:47 2016
+++ src/external/public-domain/xz/lib/Makefile	Sat Jan 14 16:20:39 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2016/01/05 13:07:47 christos Exp $
+# $NetBSD: Makefile,v 1.7 2017/01/14 21:20:39 christos Exp $
 
 .include 
 
@@ -84,6 +84,10 @@ liblzma.pc:	${XZSRCDIR}/src/liblzma/libl
 	> ${.TARGET}.tmp && \
 	mv -f ${.TARGET}.tmp ${.TARGET}
 
+.if ${MACHINE_ARCH} == "i386"
+COPTS += -Wno-error=psabi
+.endif
+
 CLEANFILES+=	liblzma.pc
 
 LIBDPLIBS+=	pthread ${NETBSDSRCDIR}/lib/libpthread



CVS commit: src/doc

2017-01-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jan 14 21:18:40 UTC 2017

Modified Files:
src/doc: TODO.modules

Log Message:
Add an entry to discuss association of a kernel with its specific modules.

Prompted by recent Email discussion started by wiz (there have been many
earlier discussions on this topic, too).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/doc/TODO.modules

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

Modified files:

Index: src/doc/TODO.modules
diff -u src/doc/TODO.modules:1.9 src/doc/TODO.modules:1.10
--- src/doc/TODO.modules:1.9	Thu Dec 15 03:24:43 2016
+++ src/doc/TODO.modules	Sat Jan 14 21:18:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.modules,v 1.9 2016/12/15 03:24:43 pgoyette Exp $ */
+/* $NetBSD: TODO.modules,v 1.10 2017/01/14 21:18:40 pgoyette Exp $ */
 
 Some notes on the limitations of our current (as of 7.99.35) module
 subsystem.  This list was triggered by an Email exchange between
@@ -120,3 +120,13 @@ christos and pgoyette.
 select which modules to build and which modules from modules/mi to
 include in the release.  (This is not limited to PCI;  recently we
 encounter similar issues with spkr aka spkr_synth module.)
+
+14. As has been pointed out more than once, the current method of storing
+modules in a version-specific subdirectory of /stand is sub-optimal
+and leads to much difficulty and/or confusion.  A better mechanism of
+associating a kernel and its modules needs to be developed.  Some
+have suggested having a top-level directory (say, /netbsd) with a
+kernel and its modules at /netbsd/kernel and /netbsd/modules/...
+Whatever new mechanism we arrive at will probably require changes to
+installation procedures and bootstrap code, and will need to handle
+both the new and old mechanisms for compatability.



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

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 21:08:17 UTC 2017

Modified Files:
src/tests/lib/libc/setjmp: t_setjmp.c t_threadjmp.c

Log Message:
PR/51874: Ngie Cooper: Add __unused to signal handlers


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/setjmp/t_setjmp.c \
src/tests/lib/libc/setjmp/t_threadjmp.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/setjmp/t_setjmp.c
diff -u src/tests/lib/libc/setjmp/t_setjmp.c:1.1 src/tests/lib/libc/setjmp/t_setjmp.c:1.2
--- src/tests/lib/libc/setjmp/t_setjmp.c:1.1	Mon Dec 27 14:35:31 2010
+++ src/tests/lib/libc/setjmp/t_setjmp.c	Sat Jan 14 16:08:17 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $ */
+/* $NetBSD: t_setjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $");
+__RCSID("$NetBSD: t_setjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $");
 
 #include 
 
@@ -87,7 +87,7 @@ __RCSID("$NetBSD: t_setjmp.c,v 1.1 2010/
 static int expectsignal;
 
 static void
-aborthandler(int signo)
+aborthandler(int signo __unused)
 {
 	ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded");
 	atf_tc_pass();
Index: src/tests/lib/libc/setjmp/t_threadjmp.c
diff -u src/tests/lib/libc/setjmp/t_threadjmp.c:1.1 src/tests/lib/libc/setjmp/t_threadjmp.c:1.2
--- src/tests/lib/libc/setjmp/t_threadjmp.c:1.1	Thu Apr 21 14:58:20 2011
+++ src/tests/lib/libc/setjmp/t_threadjmp.c	Sat Jan 14 16:08:17 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $ */
+/* $NetBSD: t_threadjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $");
+__RCSID("$NetBSD: t_threadjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $");
 
 #include 
 
@@ -91,7 +91,7 @@ static pthread_t myself = NULL;
 static int expectsignal;
 
 static void
-aborthandler(int signo)
+aborthandler(int signo __unused)
 {
 	ATF_REQUIRE(myself == pthread_self());
 	ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded");



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

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:59:23 UTC 2017

Modified Files:
src/tests/lib/libc/regex: t_regex_att.c

Log Message:
PR/51873: Ngie Cooper: add util.h #include


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/regex/t_regex_att.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/regex/t_regex_att.c
diff -u src/tests/lib/libc/regex/t_regex_att.c:1.2 src/tests/lib/libc/regex/t_regex_att.c:1.3
--- src/tests/lib/libc/regex/t_regex_att.c:1.2	Fri Jan 13 19:50:56 2017
+++ src/tests/lib/libc/regex/t_regex_att.c	Sat Jan 14 15:59:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $	*/
+/*	$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,17 +37,18 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $");
+__RCSID("$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $");
 
 #include 
 
-#include 
+#include 
+#include 
 #include 
-#include 
+#include 
 #include 
+#include 
+#include 
 #include 
-#include 
-#include 
 
 static const char sep[] = "\r\n\t";
 static const char delim[3] = "\0";



CVS commit: src/tests/lib/librt

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:58:21 UTC 2017

Modified Files:
src/tests/lib/librt: t_sem.c

Log Message:
PR/51872: Ngie Cooper: call sem_unlink after :basic and :child


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/librt/t_sem.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/librt/t_sem.c
diff -u src/tests/lib/librt/t_sem.c:1.2 src/tests/lib/librt/t_sem.c:1.3
--- src/tests/lib/librt/t_sem.c:1.2	Mon Nov  8 08:05:49 2010
+++ src/tests/lib/librt/t_sem.c	Sat Jan 14 15:58:20 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $ */
+/* $NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $ */
 
 /*
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $");
+__RCSID("$NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $");
 
 #include 
 
@@ -72,7 +72,7 @@ __RCSID("$NetBSD: t_sem.c,v 1.2 2010/11/
 
 #define NCHILDREN 10
 
-ATF_TC(basic);
+ATF_TC_WITH_CLEANUP(basic);
 ATF_TC_HEAD(basic, tc)
 {
 	atf_tc_set_md_var(tc, "descr", "Checks basic functionality of POSIX "
@@ -108,8 +108,12 @@ ATF_TC_BODY(basic, tc)
 	ATF_REQUIRE_EQ(sem_close(sem_b), 0);
 	ATF_REQUIRE_EQ(sem_unlink("/sem_b"), 0);
 }
+ATF_TC_CLEANUP(basic, tc)
+{
+	(void)sem_unlink("/sem_b");
+}
 
-ATF_TC(child);
+ATF_TC_WITH_CLEANUP(child);
 ATF_TC_HEAD(child, tc)
 {
 	atf_tc_set_md_var(tc, "descr", "Checks using semaphores to synchronize "
@@ -124,7 +128,7 @@ ATF_TC_BODY(child, tc)
 
 	pid_t pid;
 
-	if (sysconf(_SC_SEMAPHORES) == -1) 
+	if (sysconf(_SC_SEMAPHORES) == -1)
 		atf_tc_skip("POSIX semaphores not supported");
 
 	sem_a = sem_open("/sem_a", O_CREAT | O_EXCL, 0644, 0);
@@ -164,6 +168,10 @@ ATF_TC_BODY(child, tc)
 	ATF_REQUIRE_EQ(sem_close(sem_a), 0);
 	ATF_REQUIRE_EQ(sem_unlink("/sem_a"), 0);
 }
+ATF_TC_CLEANUP(child, tc)
+{
+	(void)sem_unlink("/sem_a");
+}
 
 ATF_TP_ADD_TCS(tp)
 {



CVS commit: src/tests/kernel

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:57:24 UTC 2017

Modified Files:
src/tests/kernel: t_mqueue.c

Log Message:
PR/51871: Ngie Cooper: add fcntl.h for O_* fcntl/open constants


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/kernel/t_mqueue.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/kernel/t_mqueue.c
diff -u src/tests/kernel/t_mqueue.c:1.5 src/tests/kernel/t_mqueue.c:1.6
--- src/tests/kernel/t_mqueue.c:1.5	Tue Jan 10 17:10:22 2017
+++ src/tests/kernel/t_mqueue.c	Sat Jan 14 15:57:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mqueue.c,v 1.5 2017/01/10 22:10:22 christos Exp $ */
+/*	$NetBSD: t_mqueue.c,v 1.6 2017/01/14 20:57:24 christos Exp $ */
 
 /*
  * Test for POSIX message queue priority handling.
@@ -6,17 +6,17 @@
  * This file is in the Public Domain.
  */
 
-#include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
-#include 
-
 #define	MQ_PRIO_BASE	24
 
 static void



CVS commit: src/tests/lib/libc

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:55:26 UTC 2017

Modified Files:
src/tests/lib/libc/c063: t_mkfifoat.c
src/tests/lib/libc/sys: t_unlink.c

Log Message:
PR/51868: Ngie Cooper: mkfifo does not return an fd


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/c063/t_mkfifoat.c
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_unlink.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/c063/t_mkfifoat.c
diff -u src/tests/lib/libc/c063/t_mkfifoat.c:1.3 src/tests/lib/libc/c063/t_mkfifoat.c:1.4
--- src/tests/lib/libc/c063/t_mkfifoat.c:1.3	Tue Jan 10 10:15:09 2017
+++ src/tests/lib/libc/c063/t_mkfifoat.c	Sat Jan 14 15:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $ */
+/*	$NetBSD: t_mkfifoat.c,v 1.4 2017/01/14 20:55:26 christos Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $");
+__RCSID("$NetBSD: t_mkfifoat.c,v 1.4 2017/01/14 20:55:26 christos Exp $");
 
 #include 
 #include 
@@ -55,13 +55,11 @@ ATF_TC_HEAD(mkfifoat_fd, tc)
 ATF_TC_BODY(mkfifoat_fd, tc)
 {
 	int dfd;
-	int fd;
 	mode_t mode = 0600;
 
 	ATF_REQUIRE(mkdir(DIR, 0755) == 0);
 	ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
-	ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1);
-	ATF_REQUIRE(close(fd) == 0);
+	ATF_REQUIRE(mkfifoat(dfd, BASEFIFO, mode) != -1);
 	ATF_REQUIRE(access(FIFO, F_OK) == 0);
 	(void)close(dfd);
 }
@@ -74,12 +72,10 @@ ATF_TC_HEAD(mkfifoat_fdcwd, tc)
 }
 ATF_TC_BODY(mkfifoat_fdcwd, tc)
 {
-	int fd;
 	mode_t mode = 0600;
 
 	ATF_REQUIRE(mkdir(DIR, 0755) == 0);
-	ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFO, mode)) != -1);
-	ATF_REQUIRE(close(fd) == 0);
+	ATF_REQUIRE(mkfifoat(AT_FDCWD, FIFO, mode) != -1);
 	ATF_REQUIRE(access(FIFO, F_OK) == 0);
 }
 
@@ -91,10 +87,9 @@ ATF_TC_HEAD(mkfifoat_fdcwderr, tc)
 }
 ATF_TC_BODY(mkfifoat_fdcwderr, tc)
 {
-	int fd;
 	mode_t mode = 0600;
 
-	ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFOERR, mode)) == -1);
+	ATF_REQUIRE(mkfifoat(AT_FDCWD, FIFOERR, mode) == -1);
 }
 
 ATF_TC(mkfifoat_fderr);
@@ -110,7 +105,7 @@ ATF_TC_BODY(mkfifoat_fderr, tc)
 	ATF_REQUIRE(mkdir(DIR, 0755) == 0);
 	ATF_REQUIRE((fd = open(FIFO, O_CREAT|O_RDWR, 0644)) != -1);
 	ATF_REQUIRE(close(fd) == 0);
-	ATF_REQUIRE((fd = mkfifoat(-1, FIFO, mode)) == -1);
+	ATF_REQUIRE(mkfifoat(-1, FIFO, mode) == -1);
 }
 
 ATF_TP_ADD_TCS(tp)

Index: src/tests/lib/libc/sys/t_unlink.c
diff -u src/tests/lib/libc/sys/t_unlink.c:1.3 src/tests/lib/libc/sys/t_unlink.c:1.4
--- src/tests/lib/libc/sys/t_unlink.c:1.3	Fri Jan 13 14:33:03 2017
+++ src/tests/lib/libc/sys/t_unlink.c	Sat Jan 14 15:55:26 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $ */
+/* $NetBSD: t_unlink.c,v 1.4 2017/01/14 20:55:26 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $");
+__RCSID("$NetBSD: t_unlink.c,v 1.4 2017/01/14 20:55:26 christos Exp $");
 
 #include 
 
@@ -107,11 +107,8 @@ ATF_TC_HEAD(unlink_fifo, tc)
 
 ATF_TC_BODY(unlink_fifo, tc)
 {
-	int fd;
 
-	ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0,
-	"mkfifo failed: %s", strerror(errno));
-	(void)close(fd);
+	ATF_REQUIRE(mkfifo(path, 0666) == 0);
 	ATF_REQUIRE(unlink(path) == 0);
 
 	errno = 0;



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

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:52:42 UTC 2017

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

Log Message:
PR/51867: Ngie Cooper: misc cleanups


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_msync.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_msync.c
diff -u src/tests/lib/libc/sys/t_msync.c:1.2 src/tests/lib/libc/sys/t_msync.c:1.3
--- src/tests/lib/libc/sys/t_msync.c:1.2	Fri Mar 16 02:15:17 2012
+++ src/tests/lib/libc/sys/t_msync.c	Sat Jan 14 15:52:42 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $ */
+/* $NetBSD: t_msync.c,v 1.3 2017/01/14 20:52:42 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $");
+__RCSID("$NetBSD: t_msync.c,v 1.3 2017/01/14 20:52:42 christos Exp $");
 
 #include 
 
@@ -52,8 +52,7 @@ msync_sync(const char *garbage, int flag
 {
 	char *buf, *map = MAP_FAILED;
 	const char *str = NULL;
-	size_t i, len;
-	ssize_t tot;
+	size_t len;
 	int fd, rv;
 
 	/*
@@ -65,29 +64,17 @@ msync_sync(const char *garbage, int flag
 	if (buf == NULL)
 		return NULL;
 
-	for (i = 0; i < (size_t)page; i++)
-		buf[i] = 'x';
+	memset(buf, 'x', page);
 
 	fd = open(path, O_RDWR | O_CREAT, 0700);
 
 	if (fd < 0) {
-		str = "failed to open";
-		goto out;
+		free(buf);
+		return "failed to open";
 	}
 
-	tot = 0;
-
-	while (tot < page) {
-
-		rv = write(fd, buf, sizeof(buf));
-
-		if (rv < 0) {
-			str = "failed to write";
-			goto out;
-		}
-
-		tot += rv;
-	}
+	ATF_REQUIRE_MSG(write(fd, buf, page) != -1, "write(2) failed: %s",
+	strerror(errno));
 
 	map = mmap(NULL, page, PROT_READ | PROT_WRITE, MAP_FILE|MAP_PRIVATE,
 	 fd, 0);



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

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:51:13 UTC 2017

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

Log Message:
Pr/51866: Ngie Cooper: fix leak and release limit on memory to prevent
false positives with mlock/mmap


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/sys/t_mincore.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_mincore.c
diff -u src/tests/lib/libc/sys/t_mincore.c:1.9 src/tests/lib/libc/sys/t_mincore.c:1.10
--- src/tests/lib/libc/sys/t_mincore.c:1.9	Tue Jan 10 17:36:29 2017
+++ src/tests/lib/libc/sys/t_mincore.c	Sat Jan 14 15:51:13 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $ */
+/* $NetBSD: t_mincore.c,v 1.10 2017/01/14 20:51:13 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $");
+__RCSID("$NetBSD: t_mincore.c,v 1.10 2017/01/14 20:51:13 christos Exp $");
 
 #include 
 #include 
@@ -139,6 +139,7 @@ ATF_TC_WITH_CLEANUP(mincore_resid);
 ATF_TC_HEAD(mincore_resid, tc)
 {
 	atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)");
+	atf_tc_set_md_var(tc, "require.user", "root");
 }
 
 ATF_TC_BODY(mincore_resid, tc)
@@ -150,6 +151,11 @@ ATF_TC_BODY(mincore_resid, tc)
 	struct rlimit rlim;
 
 	ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, ) == 0);
+	/*
+	 * Bump the mlock limit to unlimited so the rest of the testcase
+	 * passes instead of failing on the mlock call.
+	 */
+	rlim.rlim_max = RLIM_INFINITY;
 	rlim.rlim_cur = rlim.rlim_max;
 	ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, ) == 0);
 
@@ -250,6 +256,7 @@ ATF_TC_BODY(mincore_resid, tc)
 	(void)munmap(addr2, npgs * page);
 	(void)munmap(addr3, npgs * page);
 	(void)unlink(path);
+	free(buf);
 }
 
 ATF_TC_CLEANUP(mincore_resid, tc)



CVS commit: src/doc/roadmaps

2017-01-14 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jan 14 20:50:15 UTC 2017

Modified Files:
src/doc/roadmaps: mess

Log Message:
note that the first step on the buffercache is to disentangle the buffer
cache and the buffer I/O path.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/doc/roadmaps/mess

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

Modified files:

Index: src/doc/roadmaps/mess
diff -u src/doc/roadmaps/mess:1.1 src/doc/roadmaps/mess:1.2
--- src/doc/roadmaps/mess:1.1	Fri Jan 13 10:14:58 2017
+++ src/doc/roadmaps/mess	Sat Jan 14 20:50:15 2017
@@ -1,4 +1,4 @@
-$NetBSD: mess,v 1.1 2017/01/13 10:14:58 dholland Exp $
+$NetBSD: mess,v 1.2 2017/01/14 20:50:15 dholland Exp $
 
 NetBSD Messes and Tentacular Horrors Roadmap
 
@@ -77,6 +77,10 @@ naming and terminology (things like BO_D
 reflects non-current assumptions about the way file system buffers
 should work.
 
+The first step on this is to disentangle the buffer cache
+(buffercache(9)) from the buffer I/O path (bufferio(9)) -- right now
+they both abusively share the same struct buf.
+
  - As of January 2017 nobody is currently working on this.
  - There is currently no clear timeframe or release target.
  - Contact dholland for further information.



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

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:49:24 UTC 2017

Modified Files:
src/tests/lib/libc/string: t_strlen.c

Log Message:
PR/51815: Ngie Cooper: don't leak dlopen'ed handle


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/string/t_strlen.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/t_strlen.c
diff -u src/tests/lib/libc/string/t_strlen.c:1.5 src/tests/lib/libc/string/t_strlen.c:1.6
--- src/tests/lib/libc/string/t_strlen.c:1.5	Thu Jul 14 03:33:20 2011
+++ src/tests/lib/libc/string/t_strlen.c	Sat Jan 14 15:49:24 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strlen.c,v 1.5 2011/07/14 07:33:20 jruoho Exp $ */
+/* $NetBSD: t_strlen.c,v 1.6 2017/01/14 20:49:24 christos Exp $ */
 
 /*
  * Written by J.T. Conklin 
@@ -40,6 +40,7 @@ ATF_TC_HEAD(strlen_basic, tc)
 
 ATF_TC_BODY(strlen_basic, tc)
 {
+	void *dl_handle;
 	/* try to trick the compiler */
 	size_t (*strlen_fn)(const char *);
 
@@ -107,7 +108,8 @@ ATF_TC_BODY(strlen_basic, tc)
 	 * During testing it is useful have the rest of the program
 	 * use a known good version!
 	 */
-	strlen_fn = dlsym(dlopen(NULL, RTLD_LAZY), "test_strlen");
+	dl_handle = dlopen(NULL, RTLD_LAZY);
+	strlen_fn = dlsym(dl_handle, "test_strlen");
 	if (!strlen_fn)
 		strlen_fn = strlen;
 
@@ -134,6 +136,7 @@ ATF_TC_BODY(strlen_basic, tc)
 			}
 		}
 	}
+	(void)dlclose(dl_handle);
 }
 
 ATF_TC(strlen_huge);



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

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:47:41 UTC 2017

Modified Files:
src/tests/lib/libc/gen: t_glob.c

Log Message:
PR/51825: Ngie Cooper: use the non _ version of the macro


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/gen/t_glob.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/gen/t_glob.c
diff -u src/tests/lib/libc/gen/t_glob.c:1.4 src/tests/lib/libc/gen/t_glob.c:1.5
--- src/tests/lib/libc/gen/t_glob.c:1.4	Fri Jan 13 16:30:41 2017
+++ src/tests/lib/libc/gen/t_glob.c	Sat Jan 14 15:47:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $	*/
+/*	$NetBSD: t_glob.c,v 1.5 2017/01/14 20:47:41 christos Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $");
+__RCSID("$NetBSD: t_glob.c,v 1.5 2017/01/14 20:47:41 christos Exp $");
 
 #include 
 
@@ -146,7 +146,7 @@ gl_stat(const char *name , __gl_stat_t *
 	memset(st, 0, sizeof(*st));
 
 	if (strcmp(buf, "a") == 0 || strcmp(buf, "a/b") == 0) {
-		st->st_mode |= _S_IFDIR;
+		st->st_mode |= S_IFDIR;
 		return 0;
 	}
 



CVS commit: src/tests/usr.sbin/mtree

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:45:16 UTC 2017

Modified Files:
src/tests/usr.sbin/mtree: t_mtree.sh

Log Message:
PR/51876: Ngie Cooper: kyua 0.11 $TMPDIR fixes


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.sbin/mtree/t_mtree.sh

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

Modified files:

Index: src/tests/usr.sbin/mtree/t_mtree.sh
diff -u src/tests/usr.sbin/mtree/t_mtree.sh:1.6 src/tests/usr.sbin/mtree/t_mtree.sh:1.7
--- src/tests/usr.sbin/mtree/t_mtree.sh:1.6	Tue Feb  5 11:49:42 2013
+++ src/tests/usr.sbin/mtree/t_mtree.sh	Sat Jan 14 15:45:16 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_mtree.sh,v 1.6 2013/02/05 16:49:42 christos Exp $
+# $NetBSD: t_mtree.sh,v 1.7 2017/01/14 20:45:16 christos Exp $
 #
 # Copyright (c) 2009, 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -284,6 +284,13 @@ ignore_head()
 
 ignore_body()
 {
+	# Kyua 0.11 and above point TMPDIR to our work directory and atf-check
+	# generates a temporary file, which confuses mtree.  Put the mtree files
+	# into a subdirectory.
+	#
+	# See https://github.com/jmmv/kyua/issues/133 for details.
+	mkdir root && cd root
+
 	mkdir newdir
 	mtree -F ${FLAVOR} -c | mtree -F ${FLAVOR} -Ck uid,gid,mode > mtree.spec
 	ln -s newdir otherdir
@@ -313,6 +320,13 @@ mtree_ignore_body() 
 }
 netbsd6_ignore_body() 
 {
+	# Kyua 0.11 and above point TMPDIR to our work directory and atf-check
+	# generates a temporary file, which confuses mtree.  Put the mtree files
+	# into a subdirectory.
+	#
+	# See https://github.com/jmmv/kyua/issues/133 for details.
+	mkdir root && cd root
+
 	FLAVOR=netbsd6 ignore_body
 }
 



CVS commit: src/tests/usr.bin/grep

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 20:43:52 UTC 2017

Modified Files:
src/tests/usr.bin/grep: d_binary.out t_grep.sh

Log Message:
PR/51875: Ngie Cooper: portability fixes


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/grep/d_binary.out
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/grep/t_grep.sh

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

Modified files:

Index: src/tests/usr.bin/grep/d_binary.out
diff -u src/tests/usr.bin/grep/d_binary.out:1.1 src/tests/usr.bin/grep/d_binary.out:1.2
--- src/tests/usr.bin/grep/d_binary.out:1.1	Sat Mar 17 12:33:13 2012
+++ src/tests/usr.bin/grep/d_binary.out	Sat Jan 14 15:43:52 2017
@@ -1 +1 @@
-Binary file /bin/sh matches
+Binary file test.file matches

Index: src/tests/usr.bin/grep/t_grep.sh
diff -u src/tests/usr.bin/grep/t_grep.sh:1.2 src/tests/usr.bin/grep/t_grep.sh:1.3
--- src/tests/usr.bin/grep/t_grep.sh:1.2	Fri May 17 11:39:17 2013
+++ src/tests/usr.bin/grep/t_grep.sh	Sat Jan 14 15:43:52 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_grep.sh,v 1.2 2013/05/17 15:39:17 christos Exp $
+# $NetBSD: t_grep.sh,v 1.3 2017/01/14 20:43:52 christos Exp $
 #
 # Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -43,7 +43,9 @@ binary_head()
 }
 binary_body()
 {
-	atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh
+	dd if=/dev/zero count=1 of=test.file
+	echo -n "foobar" >> test.file
+	atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file
 }
 
 atf_test_case recurse
@@ -57,7 +59,7 @@ recurse_body()
 	echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish
 	echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish
 
-	atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse
+	atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort"
 }
 
 atf_test_case recurse_symlink



CVS commit: src/sys/dev

2017-01-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Jan 14 20:05:38 UTC 2017

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

Log Message:
Increment sc_opens only after channel is set up.

It should help PR kern/51746: Panics from audio.


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.289 src/sys/dev/audio.c:1.290
--- src/sys/dev/audio.c:1.289	Mon Jan  2 00:16:45 2017
+++ src/sys/dev/audio.c	Sat Jan 14 20:05:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.289 2017/01/02 00:16:45 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.290 2017/01/14 20:05:37 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.289 2017/01/02 00:16:45 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.290 2017/01/14 20:05:37 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -1783,7 +1783,7 @@ audio_initbufs(struct audio_softc *sc, i
 	(sc->sc_vchan[n]->sc_open & AUOPEN_READ)) {
 		audio_init_ringbuffer(sc, >sc_vchan[n]->sc_mrr,
 		AUMODE_RECORD);
-		if (sc->sc_opens == 1 && hw->init_input &&
+		if (sc->sc_opens == 0 && hw->init_input &&
 		(sc->sc_vchan[n]->sc_mode & AUMODE_RECORD)) {
 			error = hw->init_input(sc->hw_hdl, vc->sc_mrr.s.start,
    vc->sc_mrr.s.end - vc->sc_mrr.s.start);
@@ -1797,7 +1797,7 @@ audio_initbufs(struct audio_softc *sc, i
 		audio_init_ringbuffer(sc, >sc_vchan[n]->sc_mpr,
 		AUMODE_PLAY);
 		sc->sc_vchan[n]->sc_sil_count = 0;
-		if (sc->sc_opens == 1 && hw->init_output &&
+		if (sc->sc_opens == 0 && hw->init_output &&
 		(sc->sc_vchan[n]->sc_mode & AUMODE_PLAY)) {
 			error = hw->init_output(sc->hw_hdl, vc->sc_mpr.s.start,
 	vc->sc_mpr.s.end - vc->sc_mpr.s.start);
@@ -1921,9 +1921,6 @@ audio_open(dev_t dev, struct audio_softc
 		return EBUSY;
 	}
 
-	sc->sc_opens++;
-	sc->sc_audiopid[n].pid = curproc->p_pid;
-	sc->sc_despid[n].pid = curproc->p_pid;
 	error = audio_alloc_ring(sc, >sc_mpr,
 		AUMODE_PLAY, AU_RING_SIZE);
 	if (!error) {
@@ -1931,22 +1928,16 @@ audio_open(dev_t dev, struct audio_softc
 		AUMODE_RECORD, AU_RING_SIZE);
 	}
 	if (error) {
-		sc->sc_opens--;
-		sc->sc_audiopid[n].pid = -1;
-		sc->sc_despid[n].pid = -1;
 		kmem_free(vc, sizeof(struct virtual_channel));
 		return error;
 	}
 
-	if (sc->sc_opens == 1) {
+	if (sc->sc_opens == 0) {
 		if (hw->open != NULL) {
 			mutex_enter(sc->sc_intr_lock);
 			error = hw->open(sc->hw_hdl, flags);
 			mutex_exit(sc->sc_intr_lock);
 			if (error) {
-sc->sc_opens--;
-sc->sc_audiopid[n].pid = -1;
-sc->sc_despid[n].pid = -1;
 kmem_free(vc,
 sizeof(struct virtual_channel));
 return error;
@@ -1972,7 +1963,6 @@ audio_open(dev_t dev, struct audio_softc
 	if (flags & FREAD) {
 		vc->sc_open |= AUOPEN_READ;
 		mode |= AUMODE_RECORD;
-		sc->sc_recopens++;
 	}
 	if (flags & FWRITE) {
 		vc->sc_open |= AUOPEN_WRITE;
@@ -2012,6 +2002,11 @@ audio_open(dev_t dev, struct audio_softc
 	DPRINTF(("audio_open: done sc_mode = 0x%x\n", vc->sc_mode));
 
 	mutex_enter(sc->sc_intr_lock);
+	if (flags & FREAD)
+		sc->sc_recopens++;
+	sc->sc_opens++;
+	sc->sc_audiopid[n].pid = curproc->p_pid;
+	sc->sc_despid[n].pid = curproc->p_pid;
 	sc->sc_nmixer_states += 2;
 	mutex_exit(sc->sc_intr_lock);
 



CVS commit: src/sys/kern

2017-01-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 19:32:10 UTC 2017

Modified Files:
src/sys/kern: kern_lwp.c

Log Message:
Fix generation of PTRACE_LWP_EXIT event

Set p_lwp_exited instead of p_lwp_created for PTRACE_LWP_EXIT.

This made the lwp_exit1 ATF test passing.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/kern/kern_lwp.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/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.186 src/sys/kern/kern_lwp.c:1.187
--- src/sys/kern/kern_lwp.c:1.186	Sat Jan 14 06:36:52 2017
+++ src/sys/kern/kern_lwp.c	Sat Jan 14 19:32:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.186 2017/01/14 06:36:52 kamil Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.187 2017/01/14 19:32:10 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.186 2017/01/14 06:36:52 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.187 2017/01/14 19:32:10 kamil Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -1056,7 +1056,7 @@ lwp_exit(struct lwp *l)
 		/* Tracing */
 		KASSERT((l->l_flag & LW_SYSTEM) == 0);
 
-		p->p_lwp_created = l->l_lid;
+		p->p_lwp_exited = l->l_lid;
 
 		KSI_INIT_EMPTY();
 		ksi.ksi_signo = SIGTRAP;



CVS commit: src/tests/kernel

2017-01-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 19:17:10 UTC 2017

Modified Files:
src/tests/kernel: t_ptrace_wait.c

Log Message:
Add additional check for pe_report_event in lwp_{create,exit}1

This caught bug that currently PTRACE_LWP_EXIT is reported as
PTRACE_LWP_CREATE.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/tests/kernel/t_ptrace_wait.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/kernel/t_ptrace_wait.c
diff -u src/tests/kernel/t_ptrace_wait.c:1.59 src/tests/kernel/t_ptrace_wait.c:1.60
--- src/tests/kernel/t_ptrace_wait.c:1.59	Sat Jan 14 06:36:52 2017
+++ src/tests/kernel/t_ptrace_wait.c	Sat Jan 14 19:17:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.59 2017/01/14 06:36:52 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.59 2017/01/14 06:36:52 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $");
 
 #include 
 #include 
@@ -5482,6 +5482,8 @@ ATF_TC_BODY(lwp_create1, tc)
 
 	ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, , slen) != -1);
 
+	ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_CREATE);
+
 	lid = state.pe_lwp;
 	printf("Reported PTRACE_LWP_CREATE event with lid %d\n", lid);
 
@@ -5576,6 +5578,8 @@ ATF_TC_BODY(lwp_exit1, tc)
 
 	ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, , slen) != -1);
 
+	ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_EXIT);
+
 	lid = state.pe_lwp;
 	printf("Reported PTRACE_LWP_EXIT event with lid %d\n", lid);
 



CVS commit: src/bin/ksh

2017-01-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan 14 18:35:43 UTC 2017

Modified Files:
src/bin/ksh: history.c

Log Message:
reorganize the code so we test if open fails at the open call.
this doesn't actually make a functional difference as ftruncate can
handle it, but it's a bit clearer and appeases static analyzers.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/history.c

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

Modified files:

Index: src/bin/ksh/history.c
diff -u src/bin/ksh/history.c:1.11 src/bin/ksh/history.c:1.12
--- src/bin/ksh/history.c:1.11	Wed Aug 31 16:24:54 2011
+++ src/bin/ksh/history.c	Sat Jan 14 18:35:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: history.c,v 1.11 2011/08/31 16:24:54 plunky Exp $	*/
+/*	$NetBSD: history.c,v 1.12 2017/01/14 18:35:43 maya Exp $	*/
 
 /*
  * command history
@@ -19,7 +19,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: history.c,v 1.11 2011/08/31 16:24:54 plunky Exp $");
+__RCSID("$NetBSD: history.c,v 1.12 2017/01/14 18:35:43 maya Exp $");
 #endif
 
 
@@ -757,13 +757,14 @@ hist_finish()
   else
 hp = histlist;
 
-  fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0777);
-  /* Remove anything written before we got the lock */
-  ftruncate(fd, 0);
-  if (fd >= 0 && (fh = fdopen(fd, "w"))) {
-for (i = 0; hp + i <= histptr && hp[i]; i++)
-  fprintf(fh, "%s%c", hp[i], '\0');
-fclose(fh);
+  if ((fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0777)) != -1) {
+/* Remove anything written before we got the lock */
+ftruncate(fd, 0);
+if ((fh = fdopen(fd, "w")) != NULL) {
+  for (i = 0; hp + i <= histptr && hp[i]; i++)
+fprintf(fh, "%s%c", hp[i], '\0');
+  fclose(fh);
+}
   }
 }
 



CVS commit: src/sys/fs/msdosfs

2017-01-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan 14 17:17:53 UTC 2017

Modified Files:
src/sys/fs/msdosfs: denode.h

Log Message:
Be explicit about how we're placing part of the on-disk name into
the extension, so it doesn't appear like we are overrunning an array.
Appeases coverity, NFC.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/fs/msdosfs/denode.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/fs/msdosfs/denode.h
diff -u src/sys/fs/msdosfs/denode.h:1.24 src/sys/fs/msdosfs/denode.h:1.25
--- src/sys/fs/msdosfs/denode.h:1.24	Tue Jul  8 09:21:52 2014
+++ src/sys/fs/msdosfs/denode.h	Sat Jan 14 17:17:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: denode.h,v 1.24 2014/07/08 09:21:52 hannken Exp $	*/
+/*	$NetBSD: denode.h,v 1.25 2017/01/14 17:17:53 maya Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -212,7 +212,8 @@ struct denode {
 #define DE_INTERNALIZE32(dep, dp)			\
 	 ((dep)->de_StartCluster |= getushort((dp)->deHighClust) << 16)
 #define DE_INTERNALIZE(dep, dp)\
-	(memcpy((dep)->de_Name, (dp)->deName, 11),	\
+	(memcpy((dep)->de_Name, (dp)->deName, 8),	\
+	 memcpy((dep)->de_Name+8, (dp)->deExtension, 3),\
 	 (dep)->de_Attributes = (dp)->deAttributes,	\
 	 (dep)->de_CHun = (dp)->deCHundredth,		\
 	 (dep)->de_CTime = getushort((dp)->deCTime),	\
@@ -229,7 +230,8 @@ struct denode {
 #define DE_EXTERNALIZE16(dp, dep)			\
 	 putushort((dp)->deHighClust, 0)
 #define DE_EXTERNALIZE(dp, dep)\
-	(memcpy((dp)->deName, (dep)->de_Name, 11),	\
+	(memcpy((dp)->deName, (dep)->de_Name, 8),	\
+	 memcpy((dp)->deExtension, (dep)->de_Name+8, 3),\
 	 (dp)->deAttributes = (dep)->de_Attributes,	\
 	 (dp)->deCHundredth = (dep)->de_CHun,		\
 	 putushort((dp)->deCTime, (dep)->de_CTime),	\



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

2017-01-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jan 14 17:14:23 UTC 2017

Modified Files:
src/sys/arch/arm/include: byte_swap.h

Log Message:
Avoid gcc warnings


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/byte_swap.h

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

Modified files:

Index: src/sys/arch/arm/include/byte_swap.h
diff -u src/sys/arch/arm/include/byte_swap.h:1.14 src/sys/arch/arm/include/byte_swap.h:1.15
--- src/sys/arch/arm/include/byte_swap.h:1.14	Fri Jan 13 19:30:38 2017
+++ src/sys/arch/arm/include/byte_swap.h	Sat Jan 14 17:14:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap.h,v 1.14 2017/01/13 19:30:38 christos Exp $	*/
+/*	$NetBSD: byte_swap.h,v 1.15 2017/01/14 17:14:23 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2002 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@ __byte_swap_u16_variable(uint16_t v)
 	if (!__builtin_constant_p(v)) {
 		uint32_t v32 = v;
 		__asm("rev16\t%0, %1" : "=r" (v32) : "0" (v32));
-		return v32;
+		return (uint16_t)v32;
 	}
 #elif !defined(__thumb__) && 0	/* gcc produces decent code for this */
 	if (!__builtin_constant_p(v)) {
@@ -104,13 +104,13 @@ __byte_swap_u16_variable(uint16_t v)
 			"bic	%0, %0, %0, lsl #16"
 		: "=" (v0)
 		: "0" (v0));
-		return v0;
+		return (uint16_t)v0;
 	}
 #endif
 	v &= 0x;
 	v = (uint16_t)((v >> 8) | (v << 8));
 
-	return v;
+	return (uint16_t)v;
 }
 
 __END_DECLS



CVS commit: src/sys

2017-01-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan 14 16:34:44 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c
src/sys/net: if_srt.c
src/sys/net80211: ieee80211_netbsd.c

Log Message:
appease coverity by using strlcpy instead of strncpy

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.23 -r1.24 src/sys/net/if_srt.c
cvs rdiff -u -r1.28 -r1.29 src/sys/net80211/ieee80211_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/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.88 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.88	Mon Dec 26 23:05:06 2016
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Sat Jan 14 16:34:44 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.88 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.89 2017/01/14 16:34:44 maya Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.88 2016/12/26 23:05:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89 2017/01/14 16:34:44 maya Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -335,7 +335,7 @@ static inline void
 netbsd32_to_ieee80211req(struct netbsd32_ieee80211req *ireq32,
 			 struct ieee80211req *ireq, u_long cmd)
 {
-	strncpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
+	strlcpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
 	ireq->i_type = ireq32->i_type;
 	ireq->i_val = ireq32->i_val;
 	ireq->i_len = ireq32->i_len;
@@ -349,7 +349,7 @@ netbsd32_to_ieee80211_nwkey(struct netbs
 {
 	int i;
 
-	strncpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
+	strlcpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
 	nwk->i_wepon = nwk32->i_wepon;
 	nwk->i_defkid = nwk32->i_defkid;
 	for (i = 0; i < IEEE80211_WEP_NKID; i++) {
@@ -758,7 +758,7 @@ static inline void
 netbsd32_from_ieee80211req(struct ieee80211req *ireq,
 			   struct netbsd32_ieee80211req *ireq32, u_long cmd)
 {
-	strncpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
+	strlcpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
 	ireq32->i_type = ireq->i_type;
 	ireq32->i_val = ireq->i_val;
 	ireq32->i_len = ireq->i_len;
@@ -772,7 +772,7 @@ netbsd32_from_ieee80211_nwkey(struct iee
 {
 	int i;
 
-	strncpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
+	strlcpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
 	nwk32->i_wepon = nwk->i_wepon;
 	nwk32->i_defkid = nwk->i_defkid;
 	for (i = 0; i < IEEE80211_WEP_NKID; i++) {

Index: src/sys/net/if_srt.c
diff -u src/sys/net/if_srt.c:1.23 src/sys/net/if_srt.c:1.24
--- src/sys/net/if_srt.c:1.23	Sun Aug  7 17:38:34 2016
+++ src/sys/net/if_srt.c	Sat Jan 14 16:34:44 2017
@@ -1,8 +1,8 @@
-/* $NetBSD: if_srt.c,v 1.23 2016/08/07 17:38:34 christos Exp $ */
+/* $NetBSD: if_srt.c,v 1.24 2017/01/14 16:34:44 maya Exp $ */
 /* This file is in the public domain. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.23 2016/08/07 17:38:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.24 2017/01/14 16:34:44 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -402,7 +402,7 @@ srt_ioctl(dev_t dev, u_long cmd, void *d
 		dr->af = scr->af;
 		dr->srcmatch = scr->srcmatch;
 		dr->srcmask = scr->srcmask;
-		strncpy(>u.dstifn[0],>u.dstifp->if_xname[0],IFNAMSIZ);
+		strlcpy(>u.dstifn[0],>u.dstifp->if_xname[0],IFNAMSIZ);
 		memcpy(>dst,>dst,scr->dst.sa.sa_len);
 		return 0;
 	case SRT_SETRT:
@@ -411,7 +411,7 @@ srt_ioctl(dev_t dev, u_long cmd, void *d
 		dr = (struct srt_rt *) data;
 		if (dr->inx > sc->nrt)
 			return EDOM;
-		strncpy([0],>u.dstifn[0],IFNAMSIZ);
+		strlcpy([0],>u.dstifn[0],IFNAMSIZ);
 		nbuf[IFNAMSIZ-1] = '\0';
 		if (dr->dst.sa.sa_family != dr->af)
 			return EIO;

Index: src/sys/net80211/ieee80211_netbsd.c
diff -u src/sys/net80211/ieee80211_netbsd.c:1.28 src/sys/net80211/ieee80211_netbsd.c:1.29
--- src/sys/net80211/ieee80211_netbsd.c:1.28	Tue Sep 27 20:20:06 2016
+++ src/sys/net80211/ieee80211_netbsd.c	Sat Jan 14 16:34:44 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ieee80211_netbsd.c,v 1.28 2016/09/27 20:20:06 christos Exp $ */
+/* $NetBSD: ieee80211_netbsd.c,v 1.29 2017/01/14 16:34:44 maya Exp $ */
 /*-
  * Copyright (c) 2003-2005 Sam Leffler, Errno Consulting
  * All rights reserved.
@@ -30,7 +30,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_freebsd.c,v 1.8 2005/08/08 18:46:35 sam Exp $");
 #else
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_netbsd.c,v 1.28 2016/09/27 20:20:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_netbsd.c,v 1.29 2017/01/14 16:34:44 maya Exp $");
 #endif
 
 /*
@@ -139,7 +139,7 @@ ieee80211_sysctl_parent(SYSCTLFN_ARGS)
 
 	node = *rnode;
 	ic = node.sysctl_data;
-	strncpy(pname, ic->ic_ifp->if_xname, IFNAMSIZ);
+	strlcpy(pname, ic->ic_ifp->if_xname, IFNAMSIZ);
 	

CVS commit: src/sys/arch/vax/include

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 16:21:28 UTC 2017

Modified Files:
src/sys/arch/vax/include: byte_swap.h

Log Message:
cast return value


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/vax/include/byte_swap.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/vax/include/byte_swap.h
diff -u src/sys/arch/vax/include/byte_swap.h:1.11 src/sys/arch/vax/include/byte_swap.h:1.12
--- src/sys/arch/vax/include/byte_swap.h:1.11	Fri Feb 17 03:41:31 2006
+++ src/sys/arch/vax/include/byte_swap.h	Sat Jan 14 11:21:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap.h,v 1.11 2006/02/17 08:41:31 skrll Exp $	*/
+/*	$NetBSD: byte_swap.h,v 1.12 2017/01/14 16:21:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991 Regents of the University of California.
@@ -61,7 +61,7 @@ static __inline uint16_t __attribute__((
 __byte_swap_u16_variable(uint16_t x)
 {
 
-	return (x << 8 | x >> 8);
+	return (uint16_t)(x << 8 | x >> 8);
 }
 
 __END_DECLS



CVS commit: src/sys/arch/alpha/include

2017-01-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jan 14 16:15:10 UTC 2017

Modified Files:
src/sys/arch/alpha/include: asm.h

Log Message:
Avoid stupid gcc redefinition warnings by #undef before redefine.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/alpha/include/asm.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/alpha/include/asm.h
diff -u src/sys/arch/alpha/include/asm.h:1.34 src/sys/arch/alpha/include/asm.h:1.35
--- src/sys/arch/alpha/include/asm.h:1.34	Thu Jul 11 19:50:55 2013
+++ src/sys/arch/alpha/include/asm.h	Sat Jan 14 16:15:10 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: asm.h,v 1.34 2013/07/11 19:50:55 matt Exp $ */
+/* $NetBSD: asm.h,v 1.35 2017/01/14 16:15:10 martin Exp $ */
 
 /*
  * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@@ -133,6 +133,7 @@
 /*
  * Useful stuff.
  */
+#undef __CONCAT
 #ifdef __STDC__
 #define	__CONCAT(a,b)	a ## b
 #else
@@ -642,6 +643,7 @@ label:	ASCIZ msg;		\
 /*
  * Kernel RCS ID tag and copyright macros
  */
+#undef __SECTIONSTRING
 #define	__SECTIONSTRING(_sec, _str)\
 	.pushsection _sec ; .asciz _str ; .popsection
 



CVS commit: src/sys/arch/ia64/include

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 16:12:51 UTC 2017

Modified Files:
src/sys/arch/ia64/include: cpu.h

Log Message:
define empty bodies for incomplete implementations


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/ia64/include/cpu.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/ia64/include/cpu.h
diff -u src/sys/arch/ia64/include/cpu.h:1.12 src/sys/arch/ia64/include/cpu.h:1.13
--- src/sys/arch/ia64/include/cpu.h:1.12	Sat Nov  9 19:50:13 2013
+++ src/sys/arch/ia64/include/cpu.h	Sat Jan 14 11:12:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.12 2013/11/10 00:50:13 christos Exp $	*/
+/*	$NetBSD: cpu.h,v 1.13 2017/01/14 16:12:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -149,13 +149,14 @@ struct clockframe {
 #define	TRAPF_CPL(tf)		((tf)->tf_special.psr & IA64_PSR_CPL)
 #define	TRAPF_USERMODE(tf)	(TRAPF_CPL(tf) != IA64_PSR_CPL_KERN)
 
+#define __empty do { } while (/*CONSTCOND*/0)
 /*
  * Give a profiling tick to the current process when the user profiling
  * buffer pages are invalid. XXX:Fixme On the ia64 I haven't yet figured 
  * out what to do about this.. XXX.
  */
 /* extern void	cpu_need_proftick(struct lwp *l); */
-#define cpu_need_proftick(l)
+#define cpu_need_proftick(l) __empty
 
 /*
  * Notify the LWP l that it has a signal pending, process as soon as possible.
@@ -168,14 +169,14 @@ struct clockframe {
 	__USE(f);			\
 } while(/*CONSTCOND*/0)
 
-#define setsoftclock()  /*XXX: FIXME */
+#define setsoftclock()__empty   /*XXX: FIXME */
 
 /* machdep.c */
 int cpu_maxproc(void); /*XXX: Fill in machdep.c */
 
-#define	cpu_proc_fork(p1, p2) /* XXX: Look into this. */
+#define	cpu_proc_fork(p1, p2)  __empty	/* XXX: Look into this. */
 
-#define DELAY(x)		/* XXX: FIXME */
+#define DELAY(x)	 __empty	/* XXX: FIXME */
 
 static inline void cpu_idle(void);
 static inline



CVS commit: src/sys/arch/sparc/include

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 16:07:53 UTC 2017

Modified Files:
src/sys/arch/sparc/include: ieeefp.h

Log Message:
remove dup definitions


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc/include/ieeefp.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/sparc/include/ieeefp.h
diff -u src/sys/arch/sparc/include/ieeefp.h:1.9 src/sys/arch/sparc/include/ieeefp.h:1.10
--- src/sys/arch/sparc/include/ieeefp.h:1.9	Sat Jan  3 13:12:12 2015
+++ src/sys/arch/sparc/include/ieeefp.h	Sat Jan 14 11:07:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieeefp.h,v 1.9 2015/01/03 18:12:12 martin Exp $	*/
+/*	$NetBSD: ieeefp.h,v 1.10 2017/01/14 16:07:53 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 6, 1995
@@ -9,15 +9,9 @@
 #define _SPARC_IEEEFP_H_
 
 #include 
+#include 
 
-#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
-
-#define	FE_TONEAREST	0	/* round to nearest representable number */
-#define	FE_TOWARDZERO	1	/* round to zero (truncate) */
-#define	FE_UPWARD	2	/* round toward positive infinity */
-#define	FE_DOWNWARD	3	/* round toward negative infinity */
-
-#if !defined(_ISOC99_SOURCE)
+#if defined(_NETBSD_SOURCE) && !defined(_ISOC99_SOURCE)
 
 typedef unsigned int fp_except;
 #define FP_X_IMP	0x01		/* imprecise (loss of precision) */
@@ -33,8 +27,6 @@ typedef enum {
 FP_RM=3			/* round toward negative infinity */
 } fp_rnd;
 
-#endif /* !_ISOC99_SOURCE */
-
-#endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
+#endif /* _NETBSD_SOURCE || !_ISOC99_SOURCE */
 
 #endif /* _SPARC_IEEEFP_H_ */



CVS commit: src/sys/arch/hppa/include

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 15:58:11 UTC 2017

Modified Files:
src/sys/arch/hppa/include: lock.h

Log Message:
fix constant types


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hppa/include/lock.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/hppa/include/lock.h
diff -u src/sys/arch/hppa/include/lock.h:1.16 src/sys/arch/hppa/include/lock.h:1.17
--- src/sys/arch/hppa/include/lock.h:1.16	Mon Apr 28 16:23:23 2008
+++ src/sys/arch/hppa/include/lock.h	Sat Jan 14 10:58:11 2017
@@ -1,4 +1,4 @@
-/* 	$NetBSD: lock.h,v 1.16 2008/04/28 20:23:23 martin Exp $	*/
+/* 	$NetBSD: lock.h,v 1.17 2017/01/14 15:58:11 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -45,8 +45,8 @@
 (volatile unsigned long *)(((uintptr_t)(p) + HPPA_LDCW_ALIGN - 1) & \
 ~(HPPA_LDCW_ALIGN - 1))
 
-#define __SIMPLELOCK_RAW_LOCKED		0
-#define __SIMPLELOCK_RAW_UNLOCKED	1
+#define __SIMPLELOCK_RAW_LOCKED		0UL
+#define __SIMPLELOCK_RAW_UNLOCKED	1UL
 
 static __inline int
 __SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr)



CVS commit: src/lib/csu/arch/alpha

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 15:50:24 UTC 2017

Modified Files:
src/lib/csu/arch/alpha: crtbegin.h

Log Message:
remove useless include; asm.h is not useful for c files. our current assumption
is that stuff in cdefs.h is duplicated in asm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/alpha/crtbegin.h

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

Modified files:

Index: src/lib/csu/arch/alpha/crtbegin.h
diff -u src/lib/csu/arch/alpha/crtbegin.h:1.1 src/lib/csu/arch/alpha/crtbegin.h:1.2
--- src/lib/csu/arch/alpha/crtbegin.h:1.1	Thu Jul 11 12:40:27 2013
+++ src/lib/csu/arch/alpha/crtbegin.h	Sat Jan 14 10:50:24 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: crtbegin.h,v 1.1 2013/07/11 16:40:27 matt Exp $ */
+/* $NetBSD: crtbegin.h,v 1.2 2017/01/14 15:50:24 christos Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,6 @@
  */
 
 #include 
-#include 
 
 /* Assume we need to reload our GP. */
 __asm(		".pushsection .init"



CVS commit: src/lib/libc/sys

2017-01-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan 14 14:33:18 UTC 2017

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Wording, macro use.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/lib/libc/sys/ptrace.2

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

Modified files:

Index: src/lib/libc/sys/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.54 src/lib/libc/sys/ptrace.2:1.55
--- src/lib/libc/sys/ptrace.2:1.54	Sat Jan 14 07:17:38 2017
+++ src/lib/libc/sys/ptrace.2	Sat Jan 14 14:33:18 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ptrace.2,v 1.54 2017/01/14 07:17:38 kamil Exp $
+.\"	$NetBSD: ptrace.2,v 1.55 2017/01/14 14:33:18 wiz Exp $
 .\"
 .\" This file is in the public domain.
 .Dd January 14, 2016
@@ -413,7 +413,7 @@ is generated twice,
 first for the parent and second for the child.
 The
 .Dv PTRACE_VFORK
-is the same like
+event is the same as
 .Dv PTRACE_FORK ,
 but the parent blocks after giving birth to the child.
 The
@@ -723,4 +723,4 @@ should be able to sidestep this.
 .Pp
 .Dv PTRACE_VFORK
 is currently unimplemented and it will return
-.Dv ENOTSUP .
+.Er ENOTSUP .



CVS commit: src/sys/arch/evbarm/stand/bootimx23

2017-01-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jan 14 12:45:28 UTC 2017

Modified Files:
src/sys/arch/evbarm/stand/bootimx23: args_prep.c

Log Message:
Include  for strcpy


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/stand/bootimx23/args_prep.c

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

Modified files:

Index: src/sys/arch/evbarm/stand/bootimx23/args_prep.c
diff -u src/sys/arch/evbarm/stand/bootimx23/args_prep.c:1.1 src/sys/arch/evbarm/stand/bootimx23/args_prep.c:1.2
--- src/sys/arch/evbarm/stand/bootimx23/args_prep.c:1.1	Sat Feb 23 16:22:39 2013
+++ src/sys/arch/evbarm/stand/bootimx23/args_prep.c	Sat Jan 14 12:45:28 2017
@@ -1,4 +1,4 @@
-/* $Id: args_prep.c,v 1.1 2013/02/23 16:22:39 jkunz Exp $ */
+/* $Id: args_prep.c,v 1.2 2017/01/14 12:45:28 martin Exp $ */
 
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -82,6 +82,8 @@
 #include 
 #include 
 
+#include 
+
 #include "common.h"
 
 static void ngets(char *, int);



CVS commit: src/sys/arch/sparc/include

2017-01-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jan 14 12:00:13 UTC 2017

Modified Files:
src/sys/arch/sparc/include: fenv.h

Log Message:
Make the copies of the FE_* macros match verbatim to avoid a gcc warning
when both ieeefp.h and fenv.h are included.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc/include/fenv.h

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

Modified files:

Index: src/sys/arch/sparc/include/fenv.h
diff -u src/sys/arch/sparc/include/fenv.h:1.1 src/sys/arch/sparc/include/fenv.h:1.2
--- src/sys/arch/sparc/include/fenv.h:1.1	Fri May 20 21:42:49 2011
+++ src/sys/arch/sparc/include/fenv.h	Sat Jan 14 12:00:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.1 2011/05/20 21:42:49 nakayama Exp $	*/
+/*	$NetBSD: fenv.h,v 1.2 2017/01/14 12:00:13 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -62,10 +62,10 @@ typedef	uint32_t	fexcept_t;
  * We can't just use the hardware bit values here, because that would
  * make FE_UPWARD and FE_DOWNWARD negative, which is not allowed.
  */
-#define	FE_TONEAREST	0x0
-#define	FE_TOWARDZERO	0x1
-#define	FE_UPWARD	0x2
-#define	FE_DOWNWARD	0x3
+#define	FE_TONEAREST	0	/* round to nearest representable number */
+#define	FE_TOWARDZERO	1	/* round to zero (truncate) */
+#define	FE_UPWARD	2	/* round toward positive infinity */
+#define	FE_DOWNWARD	3	/* round toward negative infinity */
 #define	_ROUND_MASK	(FE_TONEAREST | FE_DOWNWARD | \
 FE_UPWARD | FE_TOWARDZERO)
 #define	_ROUND_SHIFT	30