CVS commit: src/tests/net/route

2016-04-23 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Apr 23 08:54:21 UTC 2016

Modified Files:
src/tests/net/route: t_flags.sh t_flags6.sh

Log Message:
Add more tests of RTF_REJECT


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/net/route/t_flags.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/net/route/t_flags6.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/net/route/t_flags.sh
diff -u src/tests/net/route/t_flags.sh:1.6 src/tests/net/route/t_flags.sh:1.7
--- src/tests/net/route/t_flags.sh:1.6	Fri Apr 22 06:24:10 2016
+++ src/tests/net/route/t_flags.sh	Sat Apr 23 08:54:20 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_flags.sh,v 1.6 2016/04/22 06:24:10 ozaki-r Exp $
+#	$NetBSD: t_flags.sh,v 1.7 2016/04/23 08:54:20 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -223,7 +223,7 @@ test_reject()
 	# Shouldn't be created
 	check_entry_fail 10.0.0.1 UH
 
-	# Gateway is lo0
+	# Gateway is lo0 (RTF_GATEWAY)
 
 	# Delete an existing route first
 	atf_check -s exit:0 -o ignore rump.route delete -net 10.0.0.0/24
@@ -241,6 +241,22 @@ test_reject()
 
 	# Shouldn't be created
 	check_entry_fail 10.0.0.1 UH
+
+	# Gateway is lo0 (RTF_HOST)
+
+	# Delete an existing route first
+	atf_check -s exit:0 -o ignore rump.route delete -net 10.0.0.0/24
+
+	atf_check -s exit:0 -o ignore \
+	rump.route add -host 10.0.0.1/24 127.0.0.1 -iface -reject
+	$DEBUG && rump.netstat -rn -f inet
+
+	# Up, Host, Reject, Static
+	check_entry_flags 10.0.0.1 UHRS
+
+	atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
+	rump.ping -n -w 1 -c 1 10.0.0.1
+	$DEBUG && rump.netstat -rn -f inet
 }
 
 test_icmp_redirect()

Index: src/tests/net/route/t_flags6.sh
diff -u src/tests/net/route/t_flags6.sh:1.3 src/tests/net/route/t_flags6.sh:1.4
--- src/tests/net/route/t_flags6.sh:1.3	Fri Apr 22 06:24:10 2016
+++ src/tests/net/route/t_flags6.sh	Sat Apr 23 08:54:20 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_flags6.sh,v 1.3 2016/04/22 06:24:10 ozaki-r Exp $
+#	$NetBSD: t_flags6.sh,v 1.4 2016/04/23 08:54:20 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -203,7 +203,7 @@ test_reject()
 	# Shouldn't be created
 	check_entry_fail $IP6_PEER UH
 
-	# Gateway is lo0
+	# Gateway is lo0 (RTF_GATEWAY)
 
 	# Delete an existing route first
 	atf_check -s exit:0 -o ignore \
@@ -222,6 +222,23 @@ test_reject()
 
 	# Shouldn't be created
 	check_entry_fail $IP6_PEER UH
+
+	# Gateway is lo0 (RTF_HOST)
+
+	# Delete an existing route first
+	atf_check -s exit:0 -o ignore \
+	rump.route delete -inet6 -net fc00::/64
+
+	atf_check -s exit:0 -o ignore \
+	rump.route add -inet6 -host fc00::/64 ::1 -iface -reject
+	$DEBUG && rump.netstat -rn -f inet6
+
+	# Up, Host, Reject, Static
+	check_entry_flags fc00:: UHRS
+
+	atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
+	rump.ping6 -n -X 1 -c 1 $IP6_PEER
+	$DEBUG && rump.netstat -rn -f inet6
 }
 
 test_announce()



CVS commit: src/sys

2016-04-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 23 10:15:32 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/amiga/dev: slhci_zbus.c
src/sys/arch/arm/allwinner: awin_otg.c awin_usb.c
src/sys/arch/arm/amlogic: amlogic_dwctwo.c
src/sys/arch/arm/at91: at91ohci.c
src/sys/arch/arm/broadcom: bcm2835_dwctwo.c bcm53xx_usb.c
src/sys/arch/arm/ep93xx: epohci.c
src/sys/arch/arm/gemini: obio_ehci.c
src/sys/arch/arm/imx: imxusb.c
src/sys/arch/arm/nvidia: tegra_ehci.c
src/sys/arch/arm/omap: obio_ohci.c omap3_ehci.c omapl1x_ohci.c tiotg.c
src/sys/arch/arm/rockchip: rockchip_dwctwo.c
src/sys/arch/arm/s3c2xx0: ohci_s3c24x0.c
src/sys/arch/arm/samsung: exynos_ehci.c exynos_ohci.c
src/sys/arch/arm/xscale: pxa2x0_ohci.c
src/sys/arch/arm/zynq: zynq_usb.c
src/sys/arch/evbmips/loongson: gdium_machdep.c
src/sys/arch/hpcarm/dev: nbp_slhci.c
src/sys/arch/hpcmips/dev: plumohci.c
src/sys/arch/i386/conf: GENERIC
src/sys/arch/i386/pci: gcscehci.c
src/sys/arch/mips/adm5120/dev: ahci.c ahcireg.h ahcivar.h
src/sys/arch/mips/alchemy/dev: ohci_aubus.c
src/sys/arch/mips/atheros/dev: ehci_arbus.c ohci_arbus.c
src/sys/arch/mips/conf: files.adm5120
src/sys/arch/mips/ingenic: ingenic_dwctwo.c ingenic_ehci.c
ingenic_ohci.c
src/sys/arch/mips/ralink: ralink_ehci.c ralink_eth.c ralink_ohci.c
src/sys/arch/mips/rmi: rmixl_ehci.c rmixl_intr.c rmixl_ohci.c
src/sys/arch/playstation2/dev: ohci_sbus.c
src/sys/arch/powerpc/booke/dev: pq3ehci.c
src/sys/arch/powerpc/ibm4xx/dev: dwctwo_plb.c
src/sys/arch/x68k/dev: slhci_intio.c
src/sys/dev: audio.c
src/sys/dev/cardbus: ehci_cardbus.c ohci_cardbus.c uhci_cardbus.c
src/sys/dev/ic: sl811hs.c sl811hsvar.h
src/sys/dev/isa: slhci_isa.c
src/sys/dev/marvell: ehci_mv.c
src/sys/dev/pci: ehci_pci.c ohci_pci.c uhci_pci.c xhci_pci.c
src/sys/dev/pcmcia: slhci_pcmcia.c
src/sys/dev/usb: TODO.usbmp aubtfwl.c auvitek.c auvitek_audio.c
auvitek_dtv.c auvitek_video.c auvitekvar.h ehci.c ehcireg.h
ehcivar.h emdtv.c emdtv_dtv.c emdtv_ir.c emdtvvar.h ezload.c
ezload.h files.usb hid.c hid.h if_athn_usb.c if_athn_usb.h if_atu.c
if_atureg.h if_aue.c if_auereg.h if_axe.c if_axen.c if_axenreg.h
if_axereg.h if_cdce.c if_cdcereg.h if_cue.c if_cuereg.h if_kue.c
if_kuereg.h if_otus.c if_otusvar.h if_rum.c if_rumreg.h if_rumvar.h
if_run.c if_runvar.h if_smsc.c if_smscvar.h if_udav.c if_udavreg.h
if_upgt.c if_upgtvar.h if_upl.c if_ural.c if_uralreg.h if_uralvar.h
if_url.c if_urlreg.h if_urndis.c if_urndisreg.h if_urtw.c
if_urtwn.c if_urtwnreg.h if_urtwnvar.h if_urtwreg.h if_zyd.c
if_zydreg.h irmce.c moscom.c motg.c motgvar.h ohci.c ohcireg.h
ohcivar.h pseye.c slurm.c stuirda.c u3g.c uark.c uatp.c uaudio.c
uberry.c ubsa.c ubsa_common.c ubsavar.h ubt.c uchcom.c ucom.c
ucomvar.h ucycom.c udl.c udl.h udsbr.c udsir.c uep.c uftdi.c
uftdireg.h ugen.c ugensa.c uhci.c uhcireg.h uhcivar.h uhid.c
uhidev.c uhidev.h uhmodem.c uhso.c uhub.c uipad.c uipaq.c uirda.c
uirdavar.h ukbd.c ukbdmap.c ukyopon.c ukyopon.h ulpt.c umass.c
umass_isdata.c umass_isdata.h umass_quirks.c umass_quirks.h
umass_scsipi.c umass_scsipi.h umassvar.h umcs.c umct.c umidi.c
umidi_quirks.c umidi_quirks.h umodem.c umodem_common.c umodemvar.h
ums.c uplcom.c urio.c urio.h usb.c usb.h usb_mem.c usb_mem.h
usb_quirks.c usb_quirks.h usb_subr.c usbdevices.config usbdevs
usbdevs.h usbdevs_data.h usbdi.c usbdi.h usbdi_util.c usbdi_util.h
usbdivar.h usbhid.h usbhist.h uscanner.c uslsa.c usscanner.c
ustir.c uthum.c utoppy.c uts.c uvideo.c uvisor.c uvscom.c uyap.c
uyap_firmware.h uyurex.c x1input_rdesc.h xhci.c xhcireg.h xhcivar.h
xinput_rdesc.h
src/sys/external/bsd/dwc2: dwc2.c dwc2var.h
src/sys/external/bsd/dwc2/dist: dwc2_hcd.h
src/sys/rump/dev/lib/libugenhc: Makefile ugenhc.c
src/sys/rump/dev/lib/libusb: Makefile
Added Files:
src/sys/dev/usb: usbroothub.c usbroothub.h
Removed Files:
src/sys/dev/usb: usbroothub_subr.c usbroothub_subr.h
src/sys/rump/dev/lib/libugenhc: ugenhc_dma.c

Log Message:
Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
-

CVS commit: src/sys/net

2016-04-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr 23 12:15:38 UTC 2016

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

Log Message:
Add missing breaks (cosmetic change only)


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/net/if_spppsubr.c

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

Modified files:

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.136 src/sys/net/if_spppsubr.c:1.137
--- src/sys/net/if_spppsubr.c:1.136	Wed Apr 20 09:01:04 2016
+++ src/sys/net/if_spppsubr.c	Sat Apr 23 12:15:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.136 2016/04/20 09:01:04 knakahara Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.137 2016/04/23 12:15:38 martin Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.136 2016/04/20 09:01:04 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.137 2016/04/23 12:15:38 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -5379,12 +5379,14 @@ sppp_auth_type_name(u_short proto, u_cha
 		case CHAP_SUCCESS:	return "success";
 		case CHAP_FAILURE:	return "failure";
 		}
+		break;
 	case PPP_PAP:
 		switch (type) {
 		case PAP_REQ:		return "req";
 		case PAP_ACK:		return "ack";
 		case PAP_NAK:		return "nak";
 		}
+		break;
 	}
 	snprintf(buf, sizeof(buf), "0x%x", type);
 	return buf;



CVS commit: src/sys/dev/usb

2016-04-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr 23 12:26:29 UTC 2016

Modified Files:
src/sys/dev/usb: if_smsc.c

Log Message:
When we  fail to allocate a usb xfer, abort TX list initialization.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/usb/if_smsc.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/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.27 src/sys/dev/usb/if_smsc.c:1.28
--- src/sys/dev/usb/if_smsc.c:1.27	Sat Apr 23 10:15:31 2016
+++ src/sys/dev/usb/if_smsc.c	Sat Apr 23 12:26:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.27 2016/04/23 10:15:31 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.28 2016/04/23 12:26:29 martin Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -1492,7 +1492,7 @@ smsc_tx_list_init(struct smsc_softc *sc)
 			sc->sc_bufsz, USBD_FORCE_SHORT_XFER, 0,
 			&c->sc_xfer);
 			if (error)
-;
+return EIO;
 			c->sc_buf = usbd_get_buffer(c->sc_xfer);
 		}
 	}



CVS commit: src/sys/conf

2016-04-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 23 12:50:35 UTC 2016

Modified Files:
src/sys/conf: files

Log Message:
Merge nick-nhusb (missed commit)


To generate a diff of this commit:
cvs rdiff -u -r1.1154 -r1.1155 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1154 src/sys/conf/files:1.1155
--- src/sys/conf/files:1.1154	Tue Apr 12 11:51:08 2016
+++ src/sys/conf/files	Sat Apr 23 12:50:35 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1154 2016/04/12 11:51:08 christos Exp $
+#	$NetBSD: files,v 1.1155 2016/04/23 12:50:35 skrll Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20150846
@@ -1230,10 +1230,8 @@ define	sdmmcbus { }			# SD/MMC attachmen
 # use them in an 'attach-with'.
 #
 
-defparam USB_MEM_RESERVE
-
 define	usbroothub
-file	dev/usb/usbroothub_subr.c	usbroothub
+file	dev/usb/usbroothub.c	usbroothub
 
 define	usb_dma
 
@@ -1259,7 +1257,7 @@ file	dev/usb/xhci.c			xhci			needs-flag
 
 # Mentor graphics OTG IP
 defflag	opt_motg.h	MOTG_ALLWINNER
-device	motg: usbus, usbroothub, usb_dma
+device	motg: usbus, usbroothub
 file	dev/usb/motg.c			motg			needs-flag
 
 # SL811HS/T USB controller



CVS commit: src/sys/sys

2016-04-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 23 12:53:52 UTC 2016

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

Log Message:
Bump kernel version for nick-nhusb merge and usb API change


To generate a diff of this commit:
cvs rdiff -u -r1.492 -r1.493 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.492 src/sys/sys/param.h:1.493
--- src/sys/sys/param.h:1.492	Mon Apr  4 08:42:53 2016
+++ src/sys/sys/param.h	Sat Apr 23 12:53:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.492 2016/04/04 08:42:53 ozaki-r Exp $	*/
+/*	$NetBSD: param.h,v 1.493 2016/04/23 12:53:52 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799002700	/* NetBSD 7.99.27 */
+#define	__NetBSD_Version__	799002800	/* NetBSD 7.99.28 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/dev/usb

2016-04-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 23 13:14:52 UTC 2016

Modified Files:
src/sys/dev/usb: uhci.c

Log Message:
Fix non-DIAGNOSTIC build


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/dev/usb/uhci.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/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.268 src/sys/dev/usb/uhci.c:1.269
--- src/sys/dev/usb/uhci.c:1.268	Sat Apr 23 10:15:32 2016
+++ src/sys/dev/usb/uhci.c	Sat Apr 23 13:14:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.268 2016/04/23 10:15:32 skrll Exp $	*/
+/*	$NetBSD: uhci.c,v 1.269 2016/04/23 13:14:52 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.268 2016/04/23 10:15:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.269 2016/04/23 13:14:52 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -2925,7 +2925,7 @@ uhci_device_isoc_init(struct usbd_xfer *
 Static void
 uhci_device_isoc_fini(struct usbd_xfer *xfer)
 {
-	struct uhci_xfer *ux = UHCI_XFER2UXFER(xfer);
+	struct uhci_xfer *ux __diagused = UHCI_XFER2UXFER(xfer);
 
 	KASSERT(ux->ux_type == UX_ISOC);
 }
@@ -3278,7 +3278,7 @@ uhci_device_isoc_done(struct usbd_xfer *
 void
 uhci_device_intr_done(struct usbd_xfer *xfer)
 {
-	uhci_softc_t *sc = UHCI_XFER2SC(xfer);
+	uhci_softc_t *sc __diagused = UHCI_XFER2SC(xfer);
 	struct uhci_pipe *upipe = UHCI_PIPE2UPIPE(xfer->ux_pipe);
 	uhci_soft_qh_t *sqh;
 	int i, npoll;



CVS commit: src/usr.sbin/makemandb

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 14:15:36 UTC 2016

Modified Files:
src/usr.sbin/makemandb: apropos.c

Log Message:
add a newline


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/makemandb/apropos.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/makemandb/apropos.c
diff -u src/usr.sbin/makemandb/apropos.c:1.19 src/usr.sbin/makemandb/apropos.c:1.20
--- src/usr.sbin/makemandb/apropos.c:1.19	Wed Apr 13 07:48:29 2016
+++ src/usr.sbin/makemandb/apropos.c	Sat Apr 23 10:15:36 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: apropos.c,v 1.19 2016/04/13 11:48:29 christos Exp $	*/
+/*	$NetBSD: apropos.c,v 1.20 2016/04/23 14:15:36 christos Exp $	*/
 /*-
  * Copyright (c) 2011 Abhinav Upadhyay 
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: apropos.c,v 1.19 2016/04/13 11:48:29 christos Exp $");
+__RCSID("$NetBSD: apropos.c,v 1.20 2016/04/23 14:15:36 christos Exp $");
 
 #include 
 #include 
@@ -72,6 +72,7 @@ parseargs(int argc, char **argv, struct 
 {
 	int ch;
 	char sec[2] = {0, 0};
+
 	while ((ch = getopt(argc, argv, "123456789Cchiln:PprS:s:")) != -1) {
 		switch (ch) {
 		case '1':



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo

2016-04-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr 23 14:48:45 UTC 2016

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo:
nouveau_engine_fifo_nv40.c

Log Message:
Mark fallthrough with a comment to appease Coverity, CID 703385.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nv40.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/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nv40.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nv40.c:1.1.1.1 src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nv40.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nv40.c:1.1.1.1	Wed Aug  6 12:36:24 2014
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nv40.c	Sat Apr 23 14:48:45 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_engine_fifo_nv40.c,v 1.1.1.1 2014/08/06 12:36:24 riastradh Exp $	*/
+/*	$NetBSD: nouveau_engine_fifo_nv40.c,v 1.2 2016/04/23 14:48:45 riastradh Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nv40.c,v 1.1.1.1 2014/08/06 12:36:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nv40.c,v 1.2 2016/04/23 14:48:45 riastradh Exp $");
 
 #include 
 #include 
@@ -315,6 +315,7 @@ nv40_fifo_init(struct nouveau_object *ob
 	case 0x49:
 	case 0x4b:
 		nv_wr32(priv, 0x002230, 0x0001);
+		/*FALLTHROUGH*/
 	case 0x40:
 	case 0x41:
 	case 0x42:



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp

2016-04-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr 23 14:59:01 UTC 2016

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp:
nouveau_engine_disp_nvd0.c

Log Message:
Make it clearer to Coverity that there's no array overrun.

CID 989067


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.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/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c:1.2 src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c:1.2	Sat Aug 23 08:03:33 2014
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c	Sat Apr 23 14:59:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_engine_disp_nvd0.c,v 1.2 2014/08/23 08:03:33 riastradh Exp $	*/
+/*	$NetBSD: nouveau_engine_disp_nvd0.c,v 1.3 2016/04/23 14:59:01 riastradh Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_disp_nvd0.c,v 1.2 2014/08/23 08:03:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_disp_nvd0.c,v 1.3 2016/04/23 14:59:01 riastradh Exp $");
 
 #include 
 #include 
@@ -1042,7 +1042,8 @@ exec_clkcmp(struct nv50_disp_priv *priv,
 	}
 
 	data = nvbios_ocfg_match(bios, data, conf, &ver, &hdr, &cnt, &len, &info2);
-	if (data && id < 0xff) {
+	CTASSERT(__arraycount(info2.clkcmp) <= 0xff);
+	if (data && id < __arraycount(info2.clkcmp)) {
 		data = nvbios_oclk_match(bios, info2.clkcmp[id], pclk);
 		if (data) {
 			struct nvbios_init init = {



CVS commit: src/tests/net/route

2016-04-23 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Apr 23 15:47:54 UTC 2016

Modified Files:
src/tests/net/route: t_flags.sh t_flags6.sh

Log Message:
Return 0 for $DEBUG=false case


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/net/route/t_flags.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/net/route/t_flags6.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/net/route/t_flags.sh
diff -u src/tests/net/route/t_flags.sh:1.7 src/tests/net/route/t_flags.sh:1.8
--- src/tests/net/route/t_flags.sh:1.7	Sat Apr 23 08:54:20 2016
+++ src/tests/net/route/t_flags.sh	Sat Apr 23 15:47:54 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_flags.sh,v 1.7 2016/04/23 08:54:20 ozaki-r Exp $
+#	$NetBSD: t_flags.sh,v 1.8 2016/04/23 15:47:54 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -257,6 +257,8 @@ test_reject()
 	atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
 	rump.ping -n -w 1 -c 1 10.0.0.1
 	$DEBUG && rump.netstat -rn -f inet
+
+	return 0
 }
 
 test_icmp_redirect()

Index: src/tests/net/route/t_flags6.sh
diff -u src/tests/net/route/t_flags6.sh:1.4 src/tests/net/route/t_flags6.sh:1.5
--- src/tests/net/route/t_flags6.sh:1.4	Sat Apr 23 08:54:20 2016
+++ src/tests/net/route/t_flags6.sh	Sat Apr 23 15:47:54 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_flags6.sh,v 1.4 2016/04/23 08:54:20 ozaki-r Exp $
+#	$NetBSD: t_flags6.sh,v 1.5 2016/04/23 15:47:54 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -239,6 +239,8 @@ test_reject()
 	atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
 	rump.ping6 -n -X 1 -c 1 $IP6_PEER
 	$DEBUG && rump.netstat -rn -f inet6
+
+	return 0
 }
 
 test_announce()



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

2016-04-23 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr 23 17:05:30 UTC 2016

Modified Files:
src/sys/arch/arm/omap: obio_wdt.c

Log Message:
Put omapwdt32k(4) in known state (disarmed) on attach.

Some newer U-Boot builds for am335x_evm (BeagleBone) hand us the hardware
with an armed watchdog.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/omap/obio_wdt.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/omap/obio_wdt.c
diff -u src/sys/arch/arm/omap/obio_wdt.c:1.6 src/sys/arch/arm/omap/obio_wdt.c:1.7
--- src/sys/arch/arm/omap/obio_wdt.c:1.6	Wed Sep  5 00:19:59 2012
+++ src/sys/arch/arm/omap/obio_wdt.c	Sat Apr 23 17:05:30 2016
@@ -33,7 +33,7 @@
 #include "opt_omap.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obio_wdt.c,v 1.6 2012/09/05 00:19:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_wdt.c,v 1.7 2016/04/23 17:05:30 jakllsch Exp $");
 
 #include 
 #include 
@@ -101,4 +101,17 @@ obiowdt32k_attach(device_t parent, devic
 	(1 << WD_SYSCONFIG_AUTOIDLE);
 	bus_space_write_4(omapwdt32k_sc->sc_iot, omapwdt32k_sc->sc_ioh,
 			  WD_SYSCONFIG, omapwdt_sysconfig);
+
+	/*
+	 * Put watchdog in known (disarmed) state.
+	 *
+	 * Some U-Boot versions on BeagleBone will leave the watchdog
+	 * armed at boot.
+	 * 
+	 * XXX Revisit this, perhaps we should just start tickling an
+	 * armed watchdog.
+	 */
+
+	sc->sc_armed = -1;
+	omapwdt32k_enable(0);
 }



CVS commit: src/sys/dev/usb

2016-04-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 23 18:54:42 UTC 2016

Modified Files:
src/sys/dev/usb: motg.c

Log Message:
Fix KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/motg.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/usb/motg.c
diff -u src/sys/dev/usb/motg.c:1.14 src/sys/dev/usb/motg.c:1.15
--- src/sys/dev/usb/motg.c:1.14	Sat Apr 23 10:15:32 2016
+++ src/sys/dev/usb/motg.c	Sat Apr 23 18:54:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.14 2016/04/23 10:15:32 skrll Exp $	*/
+/*	$NetBSD: motg.c,v 1.15 2016/04/23 18:54:42 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.14 2016/04/23 10:15:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.15 2016/04/23 18:54:42 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_motg.h"
@@ -1407,7 +1407,7 @@ motg_device_ctrl_intr_rx(struct motg_sof
 
 	KASSERT(mutex_owned(&sc->sc_lock));
 
-	KASSERT(ep->phase == DATA_IN || ep->phase != STATUS_IN);
+	KASSERT(ep->phase == DATA_IN || ep->phase == STATUS_IN);
 	/* select endpoint 0 */
 	UWRITE1(sc, MUSB2_REG_EPINDEX, 0);
 



CVS commit: src/etc/rc.d

2016-04-23 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Apr 23 21:24:31 UTC 2016

Modified Files:
src/etc/rc.d: sysdb

Log Message:
Avoid unnecessary use of basename(1). From Jukka Salmi a long, long time
ago on a tech-kern far, far away.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/etc/rc.d/sysdb

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

Modified files:

Index: src/etc/rc.d/sysdb
diff -u src/etc/rc.d/sysdb:1.24 src/etc/rc.d/sysdb:1.25
--- src/etc/rc.d/sysdb:1.24	Sun Jun  3 21:42:45 2012
+++ src/etc/rc.d/sysdb	Sat Apr 23 21:24:31 2016
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sysdb,v 1.24 2012/06/03 21:42:45 joerg Exp $
+# $NetBSD: sysdb,v 1.25 2016/04/23 21:24:31 dholland Exp $
 #
 
 # PROVIDE: sysdb
@@ -44,7 +44,7 @@ check_file()
 		return
 	fi
 	if [ \( ! -f "$db" \) -o \( "$src" -nt "$db" \) ]; then
-		$echo -n "$comma$(basename "$src")"
+		$echo -n "$comma${src##*/}"
 		comma=", "
 		"$@"
 	fi



CVS commit: src/sys

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 23:08:26 UTC 2016

Modified Files:
src/sys/kern: kern_time.c subr_time.c syscalls.master
src/sys/sys: time.h

Log Message:
Add clock_getcpuclockid2(2) as well as CLOCK_{PROCESS,THREAD}_CPUTIME_ID.


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/sys/kern/kern_time.c
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_time.c
cvs rdiff -u -r1.283 -r1.284 src/sys/kern/syscalls.master
cvs rdiff -u -r1.71 -r1.72 src/sys/sys/time.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/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.185 src/sys/kern/kern_time.c:1.186
--- src/sys/kern/kern_time.c:1.185	Tue Mar  8 00:02:55 2016
+++ src/sys/kern/kern_time.c	Sat Apr 23 19:08:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.185 2016/03/08 05:02:55 christos Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.186 2016/04/23 23:08:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.185 2016/03/08 05:02:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.186 2016/04/23 23:08:26 christos Exp $");
 
 #include 
 #include 
@@ -97,6 +97,7 @@ CTASSERT(ITIMER_VIRTUAL == CLOCK_VIRTUAL
 CTASSERT(ITIMER_PROF == CLOCK_PROF);
 CTASSERT(ITIMER_MONOTONIC == CLOCK_MONOTONIC);
 
+
 /*
  * Initialize timekeeping.
  */
@@ -377,6 +378,36 @@ again:
 	return error;
 }
 
+int
+sys_clock_getcpuclockid2(struct lwp *l,
+const struct sys_clock_getcpuclockid2_args *uap,
+register_t *retval)
+{
+	/* {
+		syscallarg(idtype_t idtype;
+		syscallarg(id_t id);
+		syscallarg(clockid_t *)clock_id;
+	} */
+	pid_t pid;
+	lwpid_t lid;
+	clockid_t clock_id;
+	id_t id = SCARG(uap, id);
+
+	switch (SCARG(uap, idtype)) {
+	case P_PID:
+		pid = id == 0 ? l->l_proc->p_pid : id; 
+		clock_id = CLOCK_PROCESS_CPUTIME_ID | pid;
+		break;
+	case P_LWPID:
+		lid = id == 0 ? l->l_lid : id;
+		clock_id = CLOCK_THREAD_CPUTIME_ID | lid;
+		break;
+	default:
+		return EINVAL;
+	}
+	return copyout(&clock_id, SCARG(uap, clock_id), sizeof(clock_id));
+}
+
 /* ARGSUSED */
 int
 sys___gettimeofday50(struct lwp *l, const struct sys___gettimeofday50_args *uap,

Index: src/sys/kern/subr_time.c
diff -u src/sys/kern/subr_time.c:1.17 src/sys/kern/subr_time.c:1.18
--- src/sys/kern/subr_time.c:1.17	Wed May 22 12:00:52 2013
+++ src/sys/kern/subr_time.c	Sat Apr 23 19:08:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_time.c,v 1.17 2013/05/22 16:00:52 christos Exp $	*/
+/*	$NetBSD: subr_time.c,v 1.18 2016/04/23 23:08:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -33,15 +33,24 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.17 2013/05/22 16:00:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.18 2016/04/23 23:08:26 christos Exp $");
 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+#ifdef DEBUG_STICKS
+#define DPRINTF(a) uprintf a
+#else
+#define DPRINTF(a) 
+#endif
+
 /*
  * Compute number of hz until specified time.  Used to compute second
  * argument to callout_reset() from an absolute time.
@@ -218,9 +227,72 @@ gettimeleft(struct timespec *ts, struct 
 	return tstohz(ts);
 }
 
+static void
+ticks2ts(uint64_t ticks, struct timespec *ts)
+{
+	ts->tv_sec = ticks / hz;
+	uint64_t sticks = ticks - ts->tv_sec * hz;
+	if (sticks > 18446744073709551LL)	/* floor(2^64 / 1000) */
+		ts->tv_nsec = sticks / hz * 10LL;
+   	else if (sticks > 18446744073709LL)	/* floor(2^64 / 100) */
+   		ts->tv_nsec = sticks * 1000LL / hz * 100LL;
+	else
+   		ts->tv_nsec = sticks * 10LL / hz;
+	DPRINTF(("%s: %ju/%ju -> %ju.%ju\n", __func__,
+	(uintmax_t)ticks, (uintmax_t)sticks,
+	(uintmax_t)ts->tv_sec, (uintmax_t)ts->tv_nsec));
+}
+
 int
 clock_gettime1(clockid_t clock_id, struct timespec *ts)
 {
+	int error;
+	uint64_t ticks;
+	struct proc *p;
+
+#define CPUCLOCK_ID_MASK (~(CLOCK_THREAD_CPUTIME_ID|CLOCK_PROCESS_CPUTIME_ID))
+	if (clock_id & CLOCK_PROCESS_CPUTIME_ID) {
+		pid_t pid = clock_id & CPUCLOCK_ID_MASK;
+
+		mutex_enter(proc_lock);
+		p = pid == 0 ? curproc : proc_find(pid);
+		if (p == NULL) {
+			mutex_exit(proc_lock);
+			return ESRCH;
+		}
+		ticks = p->p_uticks + p->p_sticks + p->p_iticks;
+		DPRINTF(("%s: u=%ju, s=%ju, i=%ju\n", __func__,
+		(uintmax_t)p->p_uticks, (uintmax_t)p->p_sticks,
+		(uintmax_t)p->p_iticks));
+		mutex_exit(proc_lock);
+
+		// XXX: Perhaps create a special kauth type
+		error = kauth_authorize_process(curlwp->l_cred,
+		KAUTH_PROCESS_PTRACE, p,
+		KAUTH_ARG(KAUTH_REQ_PROCESS_CANSEE_ENTRY), NULL, NULL);
+		if (error)
+			return error;
+	} else if (clock_id & CLOCK_THREAD_CPUTIME_ID) {
+		struct lwp *l;
+		lwpid_t lid = clock_id & CPUCLOCK_ID_MASK;
+		p = curproc;
+		mutex_enter(p->p_lo

CVS commit: src/include

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 23:10:10 UTC 2016

Modified Files:
src/include: time.h

Log Message:
add clock_cpugetclockid{2,}


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/include/time.h

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

Modified files:

Index: src/include/time.h
diff -u src/include/time.h:1.45 src/include/time.h:1.46
--- src/include/time.h:1.45	Thu Oct 29 13:48:55 2015
+++ src/include/time.h	Sat Apr 23 19:10:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.h,v 1.45 2015/10/29 17:48:55 christos Exp $	*/
+/*	$NetBSD: time.h,v 1.46 2016/04/23 23:10:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -156,6 +156,12 @@ int timer_gettime(timer_t, struct itimer
 int timer_settime(timer_t, int, const struct itimerspec * __restrict, 
 struct itimerspec * __restrict) __RENAME(__timer_settime50);
 #endif
+#ifdef _NETBSD_SOURCE
+#include 
+int clock_getcpuclockid2(idtype_t, id_t, clockid_t *);
+#endif
+int clock_getcpuclockid(pid_t, clockid_t *);
+
 int timer_create(clockid_t, struct sigevent * __restrict,
 timer_t * __restrict);
 int timer_delete(timer_t);



CVS commit: src/lib/libc

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 23:11:31 UTC 2016

Modified Files:
src/lib/libc: shlib_version
src/lib/libc/sys: Makefile.inc clock_settime.2
Added Files:
src/lib/libc/sys: clock_getcpuclockid.c clock_getcpuclockid2.2

Log Message:
add clock_getcpuclockid{2,}


To generate a diff of this commit:
cvs rdiff -u -r1.263 -r1.264 src/lib/libc/shlib_version
cvs rdiff -u -r1.229 -r1.230 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/clock_getcpuclockid.c \
src/lib/libc/sys/clock_getcpuclockid2.2
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/sys/clock_settime.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/shlib_version
diff -u src/lib/libc/shlib_version:1.263 src/lib/libc/shlib_version:1.264
--- src/lib/libc/shlib_version:1.263	Sat Apr  2 20:19:42 2016
+++ src/lib/libc/shlib_version	Sat Apr 23 19:11:31 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: shlib_version,v 1.263 2016/04/03 00:19:42 christos Exp $
+#	$NetBSD: shlib_version,v 1.264 2016/04/23 23:11:31 christos Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 # things we wish to do on next major version bump:
@@ -44,4 +44,4 @@
 # - decide whether soft-float should support fenv.h, including thread-local contett
 # - stop all math functions from setting errno
 major=12
-minor=201
+minor=202

Index: src/lib/libc/sys/Makefile.inc
diff -u src/lib/libc/sys/Makefile.inc:1.229 src/lib/libc/sys/Makefile.inc:1.230
--- src/lib/libc/sys/Makefile.inc:1.229	Sat Apr  2 20:19:42 2016
+++ src/lib/libc/sys/Makefile.inc	Sat Apr 23 19:11:31 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.229 2016/04/03 00:19:42 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.230 2016/04/23 23:11:31 christos Exp $
 #	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -8,7 +8,8 @@
 SRCS+=	cpuset.c
 # glue to offer userland wrappers for some syscalls
 SRCS+=	posix_fadvise.c posix_madvise.c sched.c sigqueue.c sigtimedwait.c \
-	sigwait.c sigwaitinfo.c statvfs.c swapon.c semctl.c 
+	sigwait.c sigwaitinfo.c statvfs.c swapon.c semctl.c \
+	clock_getcpuclockid.c
 
 .if ${RUMPRUN} != "yes"
 # modules with non-default implementations on at least one architecture:
@@ -32,7 +33,7 @@ CLEANFILES+=	${_LSRC:MLintSys*.c}
 # with old syscall interfaces.
 GLUE+= fdiscard.c ftruncate.c lseek.c mmap.c \
 	pread.c preadv.c pwrite.c pwritev.c truncate.c ntp_adjtime.c \
-	mknodat.c
+	mknodat.c 
 GLUENOERR+= posix_fallocate.c
 GLUE50+= adjtime.c clock_settime.c settimeofday.c
 
@@ -91,6 +92,7 @@ ASM_GLUE+= tmp___${glue:.c=}50.S
 ASM=	access.S acct.S \
 	bind.S \
 	chdir.S chflags.S chmod.S chown.S chroot.S clock_nanosleep.S \
+		clock_getcpuclockid2.S \
 		__clock_getres50.S __clock_gettime50.S \
 	dup.S dup2.S dup3.S \
 	extattrctl.S \
@@ -241,7 +243,8 @@ LintSysPseudoNoerr.c: ${LIBCDIR}/sys/mak
 	-s ${DESTDIR}/usr/include/sys/syscall.h ${PSEUDONOERR}
 
 MAN+=	accept.2 access.2 acct.2 adjtime.2 bind.2 brk.2 chdir.2 \
-	chflags.2 chmod.2 chown.2 chroot.2 clock_settime.2 clone.2 close.2 \
+	chflags.2 chmod.2 chown.2 chroot.2 clock_getcpuclockid2.2 \
+	clock_settime.2 clone.2 close.2 \
 	connect.2 dup.2 execve.2 _exit.2 extattr_get_file.2 \
 	fcntl.2 fdatasync.2 fdiscard.2 fhopen.2 \
 	flock.2 fork.2 fsync.2 getcontext.2 getdents.2 \
@@ -378,3 +381,4 @@ MLINKS+=write.2 writev.2 write.2 pwrite.
 MLINKS+=pipe.2 pipe2.2
 MLINKS+=accept.2 paccept.2
 MLINKS+=nanosleep.2 clock_nanosleep.2
+MLINKS+=clock_getcpuclockid2.2 clock_getcpuclockid.2

Index: src/lib/libc/sys/clock_settime.2
diff -u src/lib/libc/sys/clock_settime.2:1.24 src/lib/libc/sys/clock_settime.2:1.25
--- src/lib/libc/sys/clock_settime.2:1.24	Wed Dec  9 03:30:03 2015
+++ src/lib/libc/sys/clock_settime.2	Sat Apr 23 19:11:31 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: clock_settime.2,v 1.24 2015/12/09 08:30:03 wiz Exp $
+.\" $NetBSD: clock_settime.2,v 1.25 2016/04/23 23:11:31 christos Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 8, 2015
+.Dd April 23, 2016
 .Dt CLOCK_SETTIME 2
 .Os
 .Sh NAME
@@ -88,10 +88,11 @@ and obtained by
 represent the amount of time (in seconds and nanoseconds)
 since 00:00 Universal Coordinated Time, January 1, 1970.
 .Pp
-A
+The following
 .Fa clock_id
-of
-.Dv CLOCK_MONOTONIC
+values are supported:
+.Bl -tag -width CLOCK_MONOTONIC
+.It Dv CLOCK_MONOTONIC
 identifies a clock that increases at a steady rate (monotonically).
 This clock
 is not affected by calls to
@@ -104,20 +105,19 @@ fail with an
 error if it's the clock specified in a call to
 .Fn clock_settime .
 The origin of the clock is unspecified.
-.Pp
-A
-.Fa clock_id
-of
-.Dv CLOCK_VIRTUAL
+.It Dv CLOCK_VIRTUAL
 identifies a clock that increments only when the CPU is running in
 user mode o

CVS commit: src/lib/libpthread

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 23:12:19 UTC 2016

Modified Files:
src/lib/libpthread: Makefile pthread.h
Added Files:
src/lib/libpthread: pthread_getcpuclockid.3 pthread_getcpuclockid.c

Log Message:
Add pthread_getcpuclockid(3)


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/lib/libpthread/Makefile
cvs rdiff -u -r1.35 -r1.36 src/lib/libpthread/pthread.h
cvs rdiff -u -r0 -r1.1 src/lib/libpthread/pthread_getcpuclockid.3 \
src/lib/libpthread/pthread_getcpuclockid.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/libpthread/Makefile
diff -u src/lib/libpthread/Makefile:1.85 src/lib/libpthread/Makefile:1.86
--- src/lib/libpthread/Makefile:1.85	Tue Dec 16 15:05:54 2014
+++ src/lib/libpthread/Makefile	Sat Apr 23 19:12:19 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.85 2014/12/16 20:05:54 pooka Exp $
+#	$NetBSD: Makefile,v 1.86 2016/04/23 23:12:19 christos Exp $
 #
 
 WARNS?=	5
@@ -54,6 +54,7 @@ SRCS+=	pthread_barrier.c
 SRCS+=	pthread_cancelstub.c
 .endif
 SRCS+=	pthread_cond.c
+SRCS+=	pthread_getcpuclockid.c
 SRCS+=	pthread_lock.c 
 SRCS+=	${PTHREAD_MAKELWP}
 SRCS+=	pthread_misc.c
@@ -134,6 +135,7 @@ MAN+=	affinity.3 pthread.3 \
 	pthread_create.3 pthread_detach.3 pthread_equal.3 \
 	pthread_curcpu_np.3 \
 	pthread_exit.3 \
+	pthread_getcpuclockid.3 \
 	pthread_getname_np.3 \
 	pthread_getspecific.3 pthread_join.3 \
 	pthread_key_create.3 pthread_kill.3 \

Index: src/lib/libpthread/pthread.h
diff -u src/lib/libpthread/pthread.h:1.35 src/lib/libpthread/pthread.h:1.36
--- src/lib/libpthread/pthread.h:1.35	Fri Nov  2 23:10:50 2012
+++ src/lib/libpthread/pthread.h	Sat Apr 23 19:12:19 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.h,v 1.35 2012/11/03 03:10:50 christos Exp $	*/
+/*	$NetBSD: pthread.h,v 1.36 2016/04/23 23:12:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -138,6 +138,8 @@ int	pthread_resume_np(pthread_t);
 
 unsigned int	pthread_curcpu_np(void);
 
+int	pthread_getcpuclockid(pthread_t, clockid_t *);
+
 struct pthread_cleanup_store {
 	void	*pad[4];
 };

Added files:

Index: src/lib/libpthread/pthread_getcpuclockid.3
diff -u /dev/null src/lib/libpthread/pthread_getcpuclockid.3:1.1
--- /dev/null	Sat Apr 23 19:12:19 2016
+++ src/lib/libpthread/pthread_getcpuclockid.3	Sat Apr 23 19:12:19 2016
@@ -0,0 +1,121 @@
+.\"	$NetBSD: pthread_getcpuclockid.3,v 1.1 2016/04/23 23:12:19 christos Exp $
+.\"
+.\" Copyright (c) 2016 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Christos Zoulas.
+.\"
+.\" 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.
+.\"
+.Dd April 23, 2016
+.Dt clock_getcpuclockid2 2
+.Os
+.Sh NAME
+.Nm clock_getcpuclockid2
+.Nd retrieve the clock id of a process or lwp
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In time.h
+.Ft int
+.Fn clock_getcpuclockid2 "idtype_t idtype" "id_t id" "clockid_t *clock_id"
+.Ft int
+.Fn clock_getcpuclockid "pid_t pid" "clockid_t *clock_id"
+.Sh DESCRIPTION
+The
+.Fn cpu_getcpuclockid2
+function retrieves the
+.Fa clock_id
+for the specified
+.Fa id
+and
+.Fa idtype.
+Supported
+.Fa idtypes
+are:
+.Bl -tag -width P_LWPID
+.It Dv P_PID
+The specified process id or
+.Dv 0
+for the current process.
+.It Dv P_LWPID
+The specified LWP id or
+.Dv 0
+for the current LWP.
+.El
+.Pp
+The
+.Fn clock_getcpuclockid
+function is equivalent to calling
+.Fn clock_getcpuclockid2
+with
+.Fa idtype
+.Dv P_PID
+and
+.Fa id
+.Fa pid .
+.Pp
+The
+.Xr clock_gettime 2
+function can be used with the returned
+.Fa clock_id
+to retriev

CVS commit: src/sys

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 23:09:27 UTC 2016

Modified Files:
src/sys/kern: init_sysent.c syscalls.c syscalls_autoload.c
systrace_args.c
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c
src/sys/sys: syscall.h syscallargs.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.309 -r1.310 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.299 -r1.300 src/sys/kern/syscalls.c
cvs rdiff -u -r1.18 -r1.19 src/sys/kern/syscalls_autoload.c \
src/sys/kern/systrace_args.c
cvs rdiff -u -r1.99 -r1.100 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.126 -r1.127 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.293 -r1.294 src/sys/sys/syscall.h
cvs rdiff -u -r1.277 -r1.278 src/sys/sys/syscallargs.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/kern/init_sysent.c
diff -u src/sys/kern/init_sysent.c:1.309 src/sys/kern/init_sysent.c:1.310
--- src/sys/kern/init_sysent.c:1.309	Sat Apr  2 21:22:39 2016
+++ src/sys/kern/init_sysent.c	Sat Apr 23 19:09:27 2016
@@ -1,14 +1,14 @@
-/* $NetBSD: init_sysent.c,v 1.309 2016/04/03 01:22:39 christos Exp $ */
+/* $NetBSD: init_sysent.c,v 1.310 2016/04/23 23:09:27 christos Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.283 2016/04/03 01:00:26 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.284 2016/04/23 23:08:26 christos Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.309 2016/04/03 01:22:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.310 2016/04/23 23:09:27 christos Exp $");
 
 #include "opt_modular.h"
 #include "opt_ntp.h"
@@ -2323,8 +2323,10 @@ struct sysent sysent[] = {
 		.sy_call = (sy_call_t *)sys_wait6
 	},		/* 481 = wait6 */
 	{
-		.sy_call = sys_nosys,
-	},		/* 482 = filler */
+		ns(struct sys_clock_getcpuclockid2_args),
+		.sy_flags = SYCALL_ARG_PTR,
+		.sy_call = (sy_call_t *)sys_clock_getcpuclockid2
+	},		/* 482 = clock_getcpuclockid2 */
 	{
 		.sy_call = sys_nosys,
 	},		/* 483 = filler */

Index: src/sys/kern/syscalls.c
diff -u src/sys/kern/syscalls.c:1.299 src/sys/kern/syscalls.c:1.300
--- src/sys/kern/syscalls.c:1.299	Sat Apr  2 21:22:39 2016
+++ src/sys/kern/syscalls.c	Sat Apr 23 19:09:27 2016
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls.c,v 1.299 2016/04/03 01:22:39 christos Exp $ */
+/* $NetBSD: syscalls.c,v 1.300 2016/04/23 23:09:27 christos Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.283 2016/04/03 01:00:26 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.284 2016/04/23 23:08:26 christos Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.299 2016/04/03 01:22:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.300 2016/04/23 23:09:27 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_modular.h"
@@ -529,7 +529,7 @@ const char *const syscallnames[] = {
 	/* 479 */	"posix_fallocate",
 	/* 480 */	"fdiscard",
 	/* 481 */	"wait6",
-	/* 482 */	"# filler",
+	/* 482 */	"clock_getcpuclockid2",
 	/* 483 */	"# filler",
 	/* 484 */	"# filler",
 	/* 485 */	"# filler",
@@ -1066,7 +1066,7 @@ const char *const altsyscallnames[] = {
 	/* 479 */	NULL, /* posix_fallocate */
 	/* 480 */	NULL, /* fdiscard */
 	/* 481 */	NULL, /* wait6 */
-	/* 482 */	NULL, /* filler */
+	/* 482 */	NULL, /* clock_getcpuclockid2 */
 	/* 483 */	NULL, /* filler */
 	/* 484 */	NULL, /* filler */
 	/* 485 */	NULL, /* filler */

Index: src/sys/kern/syscalls_autoload.c
diff -u src/sys/kern/syscalls_autoload.c:1.18 src/sys/kern/syscalls_autoload.c:1.19
--- src/sys/kern/syscalls_autoload.c:1.18	Sat Apr  2 21:22:39 2016
+++ src/sys/kern/syscalls_autoload.c	Sat Apr 23 19:09:27 2016
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls_autoload.c,v 1.18 2016/04/03 01:22:39 christos Exp $ */
+/* $NetBSD: syscalls_autoload.c,v 1.19 2016/04/23 23:09:27 christos Exp $ */
 
 /*
  * System call autoload table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.283 2016/04/03 01:00:26 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.284 2016/04/23 23:08:26 christos Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscalls_autoload.c,v 1.18 2016/04/03 01:22:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscalls_autoload.c,v 1.19 2016/04/23 23:09:27 christos Exp $");
 
 #include 
 static struct sc_autoload netbsd_syscalls_autoload[] = {
Index: src/sys/kern/systrace_args.c
diff -u src/sys/kern/systrace_args.c:1.18 src/sys/kern/systrace_args.c:1.19
--- src/sys/kern/systrace_args.c:1.18	Sat Apr  2 21:22:39 2016
+++ src/sys/kern/systrace_args.c	Sat Apr 23 19:09:27 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: systrace_args.c,v 1.18 2016

CVS commit: src/lib/libpthread

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 23:23:18 UTC 2016

Modified Files:
src/lib/libpthread: shlib_version

Log Message:
bump


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libpthread/shlib_version

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

Modified files:

Index: src/lib/libpthread/shlib_version
diff -u src/lib/libpthread/shlib_version:1.16 src/lib/libpthread/shlib_version:1.17
--- src/lib/libpthread/shlib_version:1.16	Wed Apr  3 11:45:21 2013
+++ src/lib/libpthread/shlib_version	Sat Apr 23 19:23:17 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: shlib_version,v 1.16 2013/04/03 15:45:21 christos Exp $
+#	$NetBSD: shlib_version,v 1.17 2016/04/23 23:23:17 christos Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 # Things to do when bumping major version:
@@ -16,4 +16,4 @@
 #	without compat_netbsd32 shims??
 #
 major=1
-minor=2
+minor=3



CVS commit: src/distrib/sets/lists

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 23 23:28:13 UTC 2016

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
Add {pthread,clock}_getcpuid man pages and bump.


To generate a diff of this commit:
cvs rdiff -u -r1.769 -r1.770 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2030 -r1.2031 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.131 -r1.132 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.769 src/distrib/sets/lists/base/shl.mi:1.770
--- src/distrib/sets/lists/base/shl.mi:1.769	Thu Apr 14 21:35:25 2016
+++ src/distrib/sets/lists/base/shl.mi	Sat Apr 23 19:28:13 2016
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.769 2016/04/15 01:35:25 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.770 2016/04/23 23:28:13 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -18,7 +18,7 @@
 ./lib/libblacklist.so.0.0			base-sys-shlib		dynamicroot
 ./lib/libc.so	base-sys-shlib		dynamicroot
 ./lib/libc.so.12base-sys-shlib		dynamicroot
-./lib/libc.so.12.201base-sys-shlib		dynamicroot
+./lib/libc.so.12.202base-sys-shlib		dynamicroot
 ./lib/libcrypt.sobase-sys-shlib		dynamicroot
 ./lib/libcrypt.so.1base-sys-shlib		dynamicroot
 ./lib/libcrypt.so.1.0base-sys-shlib		dynamicroot
@@ -211,7 +211,7 @@
 ./usr/lib/libc++.so.1.0base-sys-shlib		compatfile,libcxx
 ./usr/lib/libc.sobase-sys-shlib		compatfile
 ./usr/lib/libc.so.12base-sys-shlib		compatfile
-./usr/lib/libc.so.12.201			base-sys-shlib		compatfile
+./usr/lib/libc.so.12.202			base-sys-shlib		compatfile
 ./usr/lib/libcdk.sobase-obsolete		compatfile,obsolete
 ./usr/lib/libcom_err.sobase-krb5-shlib		compatfile,kerberos
 ./usr/lib/libcom_err.so.7			base-krb5-shlib		compatfile,kerberos
@@ -447,7 +447,7 @@
 ./usr/lib/libprop.so.1.1			base-sys-shlib		compatfile
 ./usr/lib/libpthread.sobase-sys-shlib		compatfile
 ./usr/lib/libpthread.so.1			base-sys-shlib		compatfile
-./usr/lib/libpthread.so.1.2			base-sys-shlib		compatfile
+./usr/lib/libpthread.so.1.3			base-sys-shlib		compatfile
 ./usr/lib/libpthread_dbg.so			base-sys-shlib		compatfile
 ./usr/lib/libpthread_dbg.so.2			base-sys-shlib		compatfile
 ./usr/lib/libpthread_dbg.so.2.0			base-sys-shlib		compatfile

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2030 src/distrib/sets/lists/comp/mi:1.2031
--- src/distrib/sets/lists/comp/mi:1.2030	Thu Apr 14 21:35:26 2016
+++ src/distrib/sets/lists/comp/mi	Sat Apr 23 19:28:13 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2030 2016/04/15 01:35:26 ozaki-r Exp $
+#	$NetBSD: mi,v 1.2031 2016/04/23 23:28:13 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -4026,6 +4026,8 @@
 ./usr/share/man/cat2/chmod.0			comp-c-catman		.cat
 ./usr/share/man/cat2/chown.0			comp-c-catman		.cat
 ./usr/share/man/cat2/chroot.0			comp-c-catman		.cat
+./usr/share/man/cat2/clock_getcpuclockid.0	comp-c-catman		.cat
+./usr/share/man/cat2/clock_getcpuclockid2.0	comp-c-catman		.cat
 ./usr/share/man/cat2/clock_getres.0		comp-c-catman		.cat
 ./usr/share/man/cat2/clock_gettime.0		comp-c-catman		.cat
 ./usr/share/man/cat2/clock_nanosleep.0		comp-c-catman		.cat
@@ -8351,6 +8353,7 @@
 ./usr/share/man/cat3/pthread_exit.0		comp-c-catman		.cat
 ./usr/share/man/cat3/pthread_getaffinity_np.0	comp-c-catman		.cat
 ./usr/share/man/cat3/pthread_getattr_np.0	comp-c-catman		.cat
+./usr/share/man/cat3/pthread_getcpuclockid.0	comp-c-catman		.cat
 ./usr/share/man/cat3/pthread_getname_np.0	comp-c-catman		.cat
 ./usr/share/man/cat3/pthread_getschedparam.0	comp-c-catman		.cat
 ./usr/share/man/cat3/pthread_getspecific.0	comp-c-catman		.cat
@@ -11289,6 +11292,8 @@
 ./usr/share/man/html2/chmod.html		comp-c-htmlman		html
 ./usr/share/man/html2/chown.html		comp-c-htmlman		html
 ./usr/share/man/html2/chroot.html		comp-c-htmlman		html
+./usr/share/man/html2/clock_getcpuclockid.html	comp-c-htmlman		html
+./usr/share/man/html2/clock_getcpuclockid2.html	comp-c-htmlman		html
 ./usr/share/man/html2/clock_getres.html		comp-c-htmlman		html
 ./usr/share/man/html2/clock_gettime.html	comp-c-htmlman		html
 ./usr/share/man/html2/clock_nanosleep.html	comp-c-htmlman		html
@@ -15500,6 +15505,7 @@
 ./usr/share/man/html3/pthread_exit.html		comp-c-htmlman		html
 ./usr/share/man/html3/pthread_getaffinity_np.html	comp-c-htmlman		html
 ./usr/share/man/html3/pthread_getattr_np.html	comp-c-htmlman		html
+./usr/share/man/html3/pthread_getcpuclockid.html	comp-c-htmlman		html
 ./usr/share/man/html3/pthread_getname_np.html	comp-c-htmlman		html
 ./usr/share/man/html3/pthread_getschedparam.html	comp-c-htmlman		html
 ./usr/share

CVS commit: src/lib/libpthread

2016-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 24 00:05:28 UTC 2016

Modified Files:
src/lib/libpthread: pthread_getcpuclockid.3

Log Message:
commit the right file.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libpthread/pthread_getcpuclockid.3

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

Modified files:

Index: src/lib/libpthread/pthread_getcpuclockid.3
diff -u src/lib/libpthread/pthread_getcpuclockid.3:1.1 src/lib/libpthread/pthread_getcpuclockid.3:1.2
--- src/lib/libpthread/pthread_getcpuclockid.3:1.1	Sat Apr 23 19:12:19 2016
+++ src/lib/libpthread/pthread_getcpuclockid.3	Sat Apr 23 20:05:28 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pthread_getcpuclockid.3,v 1.1 2016/04/23 23:12:19 christos Exp $
+.\"	$NetBSD: pthread_getcpuclockid.3,v 1.2 2016/04/24 00:05:28 christos Exp $
 .\"
 .\" Copyright (c) 2016 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,64 +28,34 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .Dd April 23, 2016
-.Dt clock_getcpuclockid2 2
+.Dt pthread_getcpuclockid 3
 .Os
 .Sh NAME
-.Nm clock_getcpuclockid2
-.Nd retrieve the clock id of a process or lwp
+.Nm pthread_getcpuclockid
+.Nd retrieve the clockid of the give thread
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In time.h
+.In pthread.h
 .Ft int
-.Fn clock_getcpuclockid2 "idtype_t idtype" "id_t id" "clockid_t *clock_id"
-.Ft int
-.Fn clock_getcpuclockid "pid_t pid" "clockid_t *clock_id"
+.Fn pthread_getcpuclockid "pthread_t thread" "clockid_t *clock_id"
 .Sh DESCRIPTION
 The
-.Fn cpu_getcpuclockid2
+.Fn pthread_getcpuclockid
 function retrieves the
 .Fa clock_id
 for the specified
-.Fa id
-and
-.Fa idtype.
-Supported
-.Fa idtypes
-are:
-.Bl -tag -width P_LWPID
-.It Dv P_PID
-The specified process id or
-.Dv 0
-for the current process.
-.It Dv P_LWPID
-The specified LWP id or
-.Dv 0
-for the current LWP.
-.El
-.Pp
-The
-.Fn clock_getcpuclockid
-function is equivalent to calling
-.Fn clock_getcpuclockid2
-with
-.Fa idtype
-.Dv P_PID
-and
-.Fa id
-.Fa pid .
+.Fa thread .
 .Pp
-The
+The 
 .Xr clock_gettime 2
 function can be used with the returned
 .Fa clock_id
-to retrieve process and LWP times.
+to retrieve LWP times.
 .Sh RETURN VALUES
-The
-.Fn clock_getcpuclockid
-and
-.Fn clock_getcpuclockid2
-functions succeed and return 0, placing the requested
+On success the
+.Fn pthread_getcpuclockid
+function returns 0, placing the requested
 .Fa clock_id 
 in the argument.
 On error, the value \-1 is returned
@@ -95,27 +65,20 @@ is set to reflect what went wrong.
 .Sh ERRORS
 These functions fail if:
 .Bl -tag -width Er
-.It Bq Er EINVAL
-An unsuppored
-.Fa idtype
-was supplied.
+.It Bq Er ESRCH
+No thread with this id was found.
 .El
 .Sh SEE ALSO
-.Xr clock_gettime 2
+.Xr clock_getcpuclockid2 2 ,
+.Xr clock_gettime 2 ,
 .Sh STANDARDS
 The
-.Fn clock_getcpuclockid
+.Fn pthread_getcpuclockid
 function conforms to
 .St -p1003.1-2001 .
-The
-.Fn clock_getcpuclockid2
-is a
-.Nx
 extension.
 .Sh HISTORY
 The
-.Fn clock_getcpuclockid
-and
-.Fn clock_getcpuclockid2
-functions appeared in
+.Fn pthread_getcpuclockid
+function appeared in
 .Nx 8 .



CVS commit: src/sys/external/bsd/drm2

2016-04-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 24 04:26:12 UTC 2016

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_bo.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_ttm.c
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_tt.c
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_bo_driver.h
src/sys/external/bsd/drm2/include/drm/ttm: ttm_page_alloc.h
src/sys/external/bsd/drm2/ttm: ttm_bus_dma.c

Log Message:
Rework ttm tt swapin/swapout logic.

Rather than handling `swapping in/out' here, per se, we let uvm do
that, we interpret `swap out' as `deactivate pages', and we add
generic ttm operations to wire and unwire pages, for the ttm_tt
driver to use.

This fixes certain graphics buffer eviction logic, which enables
nouveau to suspend/resume on one of my machines.  (The machine
doesn't resume overall for other reasons, but the nouveau device
suspends and resumes in isolation.)

XXX pullup to netbsd-7 after a couple weeks


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_driver.h
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/include/drm/ttm/ttm_page_alloc.h
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/ttm/ttm_bus_dma.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/drm2/dist/drm/nouveau/nouveau_bo.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c:1.6 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c:1.6	Thu Oct 29 08:08:52 2015
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c	Sun Apr 24 04:26:12 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_bo.c,v 1.6 2015/10/29 08:08:52 mrg Exp $	*/
+/*	$NetBSD: nouveau_bo.c,v 1.7 2016/04/24 04:26:12 riastradh Exp $	*/
 
 /*
  * Copyright 2007 Dave Airlied
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.6 2015/10/29 08:08:52 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.7 2016/04/24 04:26:12 riastradh Exp $");
 
 #include 
 #include 
@@ -1524,6 +1524,16 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt 
 #endif
 }
 
+#ifdef __NetBSD__
+static void
+nouveau_ttm_tt_swapout(struct ttm_tt *ttm)
+{
+	struct ttm_dma_tt *ttm_dma = container_of(ttm, struct ttm_dma_tt, ttm);
+
+	ttm_bus_dma_swapout(ttm_dma);
+}
+#endif
+
 void
 nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence)
 {
@@ -1581,6 +1591,7 @@ struct ttm_bo_driver nouveau_bo_driver =
 	.ttm_tt_populate = &nouveau_ttm_tt_populate,
 	.ttm_tt_unpopulate = &nouveau_ttm_tt_unpopulate,
 #ifdef __NetBSD__
+	.ttm_tt_swapout = &nouveau_ttm_tt_swapout,
 	.ttm_uvm_ops = &nouveau_uvm_ops,
 #endif
 	.invalidate_caches = nouveau_bo_invalidate_caches,

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.7 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.8
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.7	Fri Apr 10 17:44:35 2015
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c	Sun Apr 24 04:26:12 2016
@@ -716,6 +716,15 @@ static void radeon_ttm_tt_unpopulate(str
 }
 
 #ifdef __NetBSD__
+static void radeon_ttm_tt_swapout(struct ttm_tt *ttm)
+{
+	struct radeon_ttm_tt *gtt = container_of(ttm, struct radeon_ttm_tt,
+	ttm.ttm);
+	struct ttm_dma_tt *ttm_dma = >t->ttm;
+
+	ttm_bus_dma_swapout(ttm_dma);
+}
+
 static int	radeon_ttm_fault(struct uvm_faultinfo *, vaddr_t,
 		struct vm_page **, int, int, vm_prot_t, int);
 
@@ -731,6 +740,7 @@ static struct ttm_bo_driver radeon_bo_dr
 	.ttm_tt_populate = &radeon_ttm_tt_populate,
 	.ttm_tt_unpopulate = &radeon_ttm_tt_unpopulate,
 #ifdef __NetBSD__
+	.ttm_tt_swapout = &radeon_ttm_tt_swapout,
 	.ttm_uvm_ops = &radeon_uvm_ops,
 #endif
 	.invalidate_caches = &radeon_invalidate_caches,

Index: src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c
diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.6 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.6	Sun Jul 27 00:40:39 2014
+++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c	Sun Apr 24 04:26:12 2016
@@ -349,15 +349,30 @@ int ttm_tt_bind(struct ttm_tt *ttm, stru
 }
 EXPORT_SYMBOL(ttm_tt_bind);
 
-int ttm_tt_swapin(struct ttm_tt *ttm)
-{
 #ifdef __NetBSD__
+/*
+ * ttm_tt_wire(ttm)
+ *
+ *	Wire the uvm pages of ttm and fill the ttm page array.  ttm
+ *	must be unpopulated or unbound, and must be marked swapped.
+ *	This does not change either state -- the caller is expected to
+ *	include it among other operations for