CVS commit: src/sys/dev/pci/ixgbe

2018-06-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jun  4 02:42:23 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
 Don't call ixgbe_rearm_queues() in ixgbe_local_timer1().

   ixgbe_enable_queue() and ixgbe_disable_queue() try to enable/disable queue
  interrupt safely. It has the internal counter. When a queue's MSI-X is
  received, ixgbe_msix_que() is called (IPL_NET). This function disable the
  queue's interrupt by ixgbe_disable_queue() and issues an softint.
  ixgbe_handle() queue is called by the softint (IPL_SOFTNET), process TX, RX
  and call ixgbe_enable_queue() at the end.

   ixgbe_local_timer1() is a callout and run always on CPU 0 (IPL_SOFTCLOCK).
  When ixgbe_rearm_queues() called, an MSI-X interrupt is issued for a specific
  queue. It may not CPU 0. If this interrupt's ixgbe_msix_que() is called and
  sofint_schedule() is called before the last sofint's softint_execute() is not
  called, the softint_schedule() fails because of SOFTINT_PENDING. It result
  in breaking ixgbe_{enable,disable}_queue()'s internal counter.

   ixgbe_local_timer1() is written not to call ixgbe_rearm_queues() if
  the interrupt is disabled, but it's called because of unknown bug or a race.
  One solution to avoid this problem is to not to use the internal counter,
  but it's little difficult. Another solution is stop using
  ixgbe_rearm_queues() at all. Essentially, ixgbe_rearm_queues() is not
  required (it was added in ixgbe.c rev. 1.43 (2016/12/01)).
  ixgbe_rearm_queues() helps for lost interrupt problem but I've never seen it
  other than ixgbe_rearm_queues() problem.

XXX pullup-8.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.159 src/sys/dev/pci/ixgbe/ixgbe.c:1.160
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.159	Sun Jun  3 10:24:24 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Jun  4 02:42:23 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.159 2018/06/03 10:24:24 maxv Exp $ */
+/* $NetBSD: ixgbe.c,v 1.160 2018/06/04 02:42:23 msaitoh Exp $ */
 
 /**
 
@@ -4411,6 +4411,7 @@ ixgbe_local_timer1(void *arg)
 	/* Only truely watchdog if all queues show hung */
 	if (hung == adapter->num_queues)
 		goto watchdog;
+#if 0 /* XXX Avoid unexpectedly disabling interrupt forever (PR#53294) */
 	else if (queues != 0) { /* Force an IRQ on queues with work */
 		que = adapter->queues;
 		for (i = 0; i < adapter->num_queues; i++, que++) {
@@ -4421,6 +4422,7 @@ ixgbe_local_timer1(void *arg)
 			mutex_exit(>dc_mtx);
 		}
 	}
+#endif
 
 out:
 	callout_reset(>timer, hz, ixgbe_local_timer, adapter);
@@ -6643,7 +6645,7 @@ ixgbe_handle_link(void *context)
 /
  * ixgbe_rearm_queues
  /
-static void
+static __inline void
 ixgbe_rearm_queues(struct adapter *adapter, u64 queues)
 {
 	u32 mask;

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.103 src/sys/dev/pci/ixgbe/ixv.c:1.104
--- src/sys/dev/pci/ixgbe/ixv.c:1.103	Sun Jun  3 10:24:24 2018
+++ src/sys/dev/pci/ixgbe/ixv.c	Mon Jun  4 02:42:23 2018
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.103 2018/06/03 10:24:24 maxv Exp $*/
+/*$NetBSD: ixv.c,v 1.104 2018/06/04 02:42:23 msaitoh Exp $*/
 
 /**
 
@@ -1266,9 +1266,11 @@ ixv_local_timer_locked(void *arg)
 	/* Only truly watchdog if all queues show hung */
 	if (hung == adapter->num_queues)
 		goto watchdog;
+#if 0
 	else if (queues != 0) { /* Force an IRQ on queues with work */
 		ixv_rearm_queues(adapter, queues);
 	}
+#endif
 
 	callout_reset(>timer, hz, ixv_local_timer, adapter);
 



CVS commit: src/sys/rump/librump/rumpvfs

2018-06-03 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Jun  4 02:29:53 UTC 2018

Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
initialize the new gop_putrange method pointer in rumpfs_genfsops too.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/rump/librump/rumpvfs/rumpfs.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/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.152 src/sys/rump/librump/rumpvfs/rumpfs.c:1.153
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.152	Mon Nov 20 17:00:35 2017
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Mon Jun  4 02:29:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.152 2017/11/20 17:00:35 martin Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.153 2018/06/04 02:29:53 chs Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.152 2017/11/20 17:00:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.153 2018/06/04 02:29:53 chs Exp $");
 
 #include 
 #include 
@@ -164,6 +164,7 @@ struct rumpfs_dent {
 struct genfs_ops rumpfs_genfsops = {
 	.gop_size = genfs_size,
 	.gop_write = genfs_gop_write,
+	.gop_putrange = genfs_gop_putrange,
 
 	/* optional */
 	.gop_alloc = NULL,



CVS commit: src/usr.bin/fstat

2018-06-03 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Jun  4 01:42:49 UTC 2018

Modified Files:
src/usr.bin/fstat: misc.c

Log Message:
Update fstat for audio(4) and pad(4) devices.

XXX - pullup 8.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/fstat/misc.c

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

Modified files:

Index: src/usr.bin/fstat/misc.c
diff -u src/usr.bin/fstat/misc.c:1.17 src/usr.bin/fstat/misc.c:1.18
--- src/usr.bin/fstat/misc.c:1.17	Fri Dec 30 21:08:23 2016
+++ src/usr.bin/fstat/misc.c	Mon Jun  4 01:42:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.17 2016/12/30 21:08:23 christos Exp $	*/
+/*	$NetBSD: misc.c,v 1.18 2018/06/04 01:42:49 nat Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: misc.c,v 1.17 2016/12/30 21:08:23 christos Exp $");
+__RCSID("$NetBSD: misc.c,v 1.18 2018/06/04 01:42:49 nat Exp $");
 
 #include 
 #include 
@@ -102,7 +102,11 @@ static struct nlist nl[] = {
 { .n_name = "vnops" },
 #define NL_XENEVT	17
 { .n_name = "xenevt_fileops" },
-#define NL_MAX		18
+#define NL_AUDIO	18
+{ .n_name = "audio_fileops" },
+#define NL_PAD		19
+{ .n_name = "pad_fileops" },
+#define NL_MAX		20
 { .n_name = NULL }
 };
 
@@ -277,6 +281,12 @@ pmisc(struct file *f, const char *name)
 	case NL_CRYPTO:
 		printf("* crypto %p\n", f->f_data);
 		return 0;
+	case NL_AUDIO:
+		printf("* audio %p\n", f->f_data);
+		return 0;
+	case NL_PAD:
+		printf("* pad %p\n", f->f_data);
+		return 0;
 	case NL_MAX:
 		printf("* %s ops=%p %p\n", name, f->f_ops, f->f_data);
 		return 0;



CVS commit: src/distrib/sets/lists/comp

2018-06-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jun  3 22:32:58 UTC 2018

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
Fix names of module_{,un}register_callbacks pages


To generate a diff of this commit:
cvs rdiff -u -r1.2202 -r1.2203 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2202 src/distrib/sets/lists/comp/mi:1.2203
--- src/distrib/sets/lists/comp/mi:1.2202	Sun Jun  3 10:35:57 2018
+++ src/distrib/sets/lists/comp/mi	Sun Jun  3 22:32:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2202 2018/06/03 10:35:57 pgoyette Exp $
+#	$NetBSD: mi,v 1.2203 2018/06/03 22:32:57 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -11130,14 +11130,14 @@
 ./usr/share/man/cat9/module_load_vfs_init.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/module_name.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_rele.0		comp-sys-catman		.cat
-./usr/share/man/cat9/module_register.0		comp-sys-catman		.cat
+./usr/share/man/cat9/module_register_callbacks.0 	comp-sys-catman		.cat
 ./usr/share/man/cat9/module_setspecific.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/module_source.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_specific_key_create.0 comp-sys-catman	.cat
 ./usr/share/man/cat9/module_specific_key_delete.0 comp-sys-catman	.cat
 ./usr/share/man/cat9/module_start_unload_thread.0 comp-sys-catman	.cat
 ./usr/share/man/cat9/module_unload.0		comp-sys-catman		.cat
-./usr/share/man/cat9/module_unregister.0	comp-sys-catman		.cat
+./usr/share/man/cat9/module_unregister_callbacks.0 comp-sys-catman		.cat
 ./usr/share/man/cat9/mono_time.0		comp-obsolete		obsolete
 ./usr/share/man/cat9/mstohz.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/mtocl.0			comp-sys-catman		.cat
@@ -18836,12 +18836,12 @@
 ./usr/share/man/html9/module_load_vfs_init.html comp-sys-htmlman	html
 ./usr/share/man/html9/module_name.html		comp-sys-htmlman	html
 ./usr/share/man/html9/module_rele.html		comp-sys-htmlman	html
-./usr/share/man/html9/module_register.html	comp-sys-htmlman	html
+./usr/share/man/html9/module_register_callbacks.html comp-sys-htmlman	html
 ./usr/share/man/html9/module_setspecific.html	comp-sys-htmlman	html
 ./usr/share/man/html9/module_source.html	comp-sys-htmlman	html
 ./usr/share/man/html9/module_start_unload_thread.html comp-sys-htmlman	html
 ./usr/share/man/html9/module_unload.html	comp-sys-htmlman	html
-./usr/share/man/html9/module_unregister.html	comp-sys-htmlman	html
+./usr/share/man/html9/module_unregister_callbacks.html comp-sys-htmlman	html
 ./usr/share/man/html9/mstohz.html		comp-sys-htmlman	html
 ./usr/share/man/html9/mtocl.html		comp-sys-htmlman	html
 ./usr/share/man/html9/mtod.html			comp-sys-htmlman	html
@@ -26692,14 +26692,14 @@
 ./usr/share/man/man9/module_load_vfs_init.9	comp-sys-man		.man
 ./usr/share/man/man9/module_name.9		comp-sys-man		.man
 ./usr/share/man/man9/module_rele.9		comp-sys-man		.man
-./usr/share/man/man9/module_register.9		comp-sys-man		.man
+./usr/share/man/man9/module_register_callbacks.9 	comp-sys-man		.man
 ./usr/share/man/man9/module_setspecific.9	comp-sys-man		.man
 ./usr/share/man/man9/module_source.9		comp-sys-man		.man
 ./usr/share/man/man9/module_specific_key_create.9 comp-sys-man		.man
 ./usr/share/man/man9/module_specific_key_delete.9 comp-sys-man		.man
 ./usr/share/man/man9/module_start_unload_thread.9 comp-sys-man		.man
 ./usr/share/man/man9/module_unload.9		comp-sys-man		.man
-./usr/share/man/man9/module_unregister.9	comp-sys-man		.man
+./usr/share/man/man9/module_unregister_callbacks.9 comp-sys-man		.man
 ./usr/share/man/man9/mono_time.9		comp-obsolete		obsolete
 ./usr/share/man/man9/mstohz.9			comp-sys-man		.man
 ./usr/share/man/man9/mtocl.9			comp-sys-man		.man



CVS commit: src/external/cddl/osnet/sys/sys

2018-06-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  3 20:59:49 UTC 2018

Added Files:
src/external/cddl/osnet/sys/sys: README

Log Message:
Add a blurb of a general approach how to maintain these files.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/sys/sys/README

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

Added files:

Index: src/external/cddl/osnet/sys/sys/README
diff -u /dev/null src/external/cddl/osnet/sys/sys/README:1.1
--- /dev/null	Sun Jun  3 16:59:49 2018
+++ src/external/cddl/osnet/sys/sys/README	Sun Jun  3 16:59:49 2018
@@ -0,0 +1,41 @@
+# $NetBSD: README,v 1.1 2018/06/03 20:59:49 christos Exp $
+
+General guidelines for system wrapper header maintainance.
+
+There are two kinds of system header files:
+1. "infrastructure" headers that provide base definitions and
+   other stuff that other headers use (systm.h)
+2.  "feature" headers that provide a specific feature (proc.h).
+
+The solaris ones generally augment ours; the template should be:
+
+solaris/foo.h:
+
+#ifndef SOLARIS_SYS_FOO_H
+#define SOLARIS_SYS_FOO_H
+
+/*
+ * This include should not be in #ifdef KERNEL.
+ * It is the job of the header itself to protect itself.
+ * Unless Solaris exposes this header in userland, where
+ * it is probably better to fix our header...
+ */
+#include_next 
+
+/* More Solaris-specific definitions */
+
+#endif /* SOLARIS_SYS_FOO_H */
+
+Now there caaes where the solaris headers expose more stuff than ours,
+so we need to include more of our system headers from theirs. When that
+happens the rule should be that:
+
+Their infrastructure headers should not include our feature headers,
+but can include our infrastructure headers, otherwise we end up with
+circular dependencies. Violations to the rule should be kept to a minimum
+and tested carefully.
+
+In the general case, if we want the augmented symbols we should include
+the solaris ones first in the search path.
+
+



CVS commit: src/sys/arch/aarch64/aarch64

2018-06-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  3 20:18:10 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: db_interface.c

Log Message:
PR/53338: David Binderman: Widen shift to the LHS type.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/aarch64/db_interface.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/aarch64/aarch64/db_interface.c
diff -u src/sys/arch/aarch64/aarch64/db_interface.c:1.3 src/sys/arch/aarch64/aarch64/db_interface.c:1.4
--- src/sys/arch/aarch64/aarch64/db_interface.c:1.3	Thu May 31 05:37:16 2018
+++ src/sys/arch/aarch64/aarch64/db_interface.c	Sun Jun  3 16:18:10 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.3 2018/05/31 09:37:16 ryo Exp $ */
+/* $NetBSD: db_interface.c,v 1.4 2018/06/03 20:18:10 christos Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.3 2018/05/31 09:37:16 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.4 2018/06/03 20:18:10 christos Exp $");
 
 #include 
 #include 
@@ -147,7 +147,7 @@ db_fetch_reg(unsigned int reg, db_regs_t
 static inline uint64_t
 SignExtend(int bitwidth, uint64_t imm, unsigned int multiply)
 {
-	const uint64_t signbit = (1 << (bitwidth - 1));
+	const uint64_t signbit = ((uint64_t)1 << (bitwidth - 1));
 	const uint64_t immmax = signbit << 1;
 
 	if (imm & signbit)



CVS commit: src/sys/dev/pci

2018-06-03 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jun  3 19:50:20 UTC 2018

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

Log Message:
unload payload dma map upon command completion


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ld_virtio.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/ld_virtio.c
diff -u src/sys/dev/pci/ld_virtio.c:1.18 src/sys/dev/pci/ld_virtio.c:1.19
--- src/sys/dev/pci/ld_virtio.c:1.18	Sun Jun  3 19:47:35 2018
+++ src/sys/dev/pci/ld_virtio.c	Sun Jun  3 19:50:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_virtio.c,v 1.18 2018/06/03 19:47:35 jakllsch Exp $	*/
+/*	$NetBSD: ld_virtio.c,v 1.19 2018/06/03 19:50:20 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.18 2018/06/03 19:47:35 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.19 2018/06/03 19:50:20 jakllsch Exp $");
 
 #include 
 #include 
@@ -447,6 +447,7 @@ ld_virtio_vq_done1(struct ld_virtio_soft
 			0, bp->b_bcount,
 			(bp->b_flags & B_READ)?BUS_DMASYNC_POSTREAD
 	  :BUS_DMASYNC_POSTWRITE);
+	bus_dmamap_unload(virtio_dmat(vsc), vr->vr_payload);
 	bus_dmamap_sync(virtio_dmat(vsc), vr->vr_cmdsts,
 			sizeof(struct virtio_blk_req_hdr), sizeof(uint8_t),
 			BUS_DMASYNC_POSTREAD);



CVS commit: src/sys/dev/pci

2018-06-03 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jun  3 19:47:35 UTC 2018

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

Log Message:
add feature/register definitions from virtio-v1.0-cs04


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ld_virtio.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/ld_virtio.c
diff -u src/sys/dev/pci/ld_virtio.c:1.17 src/sys/dev/pci/ld_virtio.c:1.18
--- src/sys/dev/pci/ld_virtio.c:1.17	Sun Jun  3 02:13:09 2018
+++ src/sys/dev/pci/ld_virtio.c	Sun Jun  3 19:47:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_virtio.c,v 1.17 2018/06/03 02:13:09 jakllsch Exp $	*/
+/*	$NetBSD: ld_virtio.c,v 1.18 2018/06/03 19:47:35 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.17 2018/06/03 02:13:09 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.18 2018/06/03 19:47:35 jakllsch Exp $");
 
 #include 
 #include 
@@ -60,6 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,
 #define VIRTIO_BLK_CONFIG_GEOMETRY_H	18 /* 8bit */
 #define VIRTIO_BLK_CONFIG_GEOMETRY_S	19 /* 8bit */
 #define VIRTIO_BLK_CONFIG_BLK_SIZE	20 /* 32bit */
+#define VIRTIO_BLK_CONFIG_WRITEBACK	32 /* 8bit */
 
 /* Feature bits */
 #define VIRTIO_BLK_F_BARRIER	(1<<0)
@@ -70,6 +71,8 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,
 #define VIRTIO_BLK_F_BLK_SIZE	(1<<6)
 #define VIRTIO_BLK_F_SCSI	(1<<7)
 #define VIRTIO_BLK_F_FLUSH	(1<<9)
+#define VIRTIO_BLK_F_TOPOLOGY	(1<<10)
+#define VIRTIO_BLK_F_CONFIG_WCE	(1<<11)
 
 /*
  * Each block request uses at least two segments - one for the header
@@ -79,6 +82,8 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,
 
 #define VIRTIO_BLK_FLAG_BITS \
 	VIRTIO_COMMON_FLAG_BITS \
+	"\x0c""CONFIG_WCE" \
+	"\x0b""TOPOLOGY" \
 	"\x0a""FLUSH" \
 	"\x08""SCSI" \
 	"\x07""BLK_SIZE" \
@@ -91,11 +96,13 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,
 /* Command */
 #define VIRTIO_BLK_T_IN		0
 #define VIRTIO_BLK_T_OUT	1
+#define VIRTIO_BLK_T_FLUSH	4
 #define VIRTIO_BLK_T_BARRIER	0x8000
 
 /* Status */
 #define VIRTIO_BLK_S_OK		0
 #define VIRTIO_BLK_S_IOERR	1
+#define VIRTIO_BLK_S_UNSUPP	2
 
 /* Request header structure */
 struct virtio_blk_req_hdr {



CVS commit: src/usr.sbin/sysinst/arch/i386

2018-06-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  3 18:59:45 UTC 2018

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
add missing brace.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/arch/i386/md.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/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.10 src/usr.sbin/sysinst/arch/i386/md.c:1.11
--- src/usr.sbin/sysinst/arch/i386/md.c:1.10	Sun Jun  3 10:38:28 2018
+++ src/usr.sbin/sysinst/arch/i386/md.c	Sun Jun  3 14:59:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.10 2018/06/03 14:38:28 martin Exp $ */
+/*	$NetBSD: md.c,v 1.11 2018/06/03 18:59:45 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -329,6 +329,7 @@ md_post_newfs(void)
 		/* Defaulting the baud rate to that of stdin should suffice */
 		if (tcgetattr(0, ) != -1)
 			boottype.bp_conspeed = t.c_ispeed;
+	}
 
 	if (pm == NULL || !pm->no_part) {
 		/*



CVS commit: src/sys/dev/ata

2018-06-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Jun  3 18:38:36 UTC 2018

Modified Files:
src/sys/dev/ata: wd.c

Log Message:
take mutex around check for pending flush, as the code before dksubr
conversion had, to avoid possible race

on my system doesn't really change behaviour, besides the test runs
being slightly faster (3x parallell pkgsrc archive extraction, up
to 5% difference), thought that can just be noise

done as part of investigation for PR kern/53183 by Sevan Janiyan


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/sys/dev/ata/wd.c

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

Modified files:

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.438 src/sys/dev/ata/wd.c:1.439
--- src/sys/dev/ata/wd.c:1.438	Sun Jan  7 11:37:30 2018
+++ src/sys/dev/ata/wd.c	Sun Jun  3 18:38:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.438 2018/01/07 11:37:30 mlelstv Exp $ */
+/*	$NetBSD: wd.c,v 1.439 2018/06/03 18:38:35 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.438 2018/01/07 11:37:30 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.439 2018/06/03 18:38:35 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -765,6 +765,8 @@ wdstart(device_t self)
 	if (!device_is_active(dksc->sc_dev))
 		return;
 
+	mutex_enter(>sc_lock);
+
 	/*
 	 * Do not queue any transfers until flush is finished, so that
 	 * once flush is pending, it will get handled as soon as xfer
@@ -773,9 +775,12 @@ wdstart(device_t self)
 	if (ISSET(wd->sc_flags, WDF_FLUSH_PEND)) {
 		ATADEBUG_PRINT(("wdstart %s flush pend\n",
 		dksc->sc_xname), DEBUG_XFERS);
+		mutex_exit(>sc_lock);
 		return;
 	}
 
+	mutex_exit(>sc_lock);
+
 	dk_start(dksc, NULL);
 }
 



CVS commit: src/bin/ksh

2018-06-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun  3 16:09:31 UTC 2018

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

Log Message:
ksh: Remove symbol clash with libc

Rename local function glob() to ksh_glob().
This is needed for installing interceptors in sanitizers.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/eval.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/eval.c
diff -u src/bin/ksh/eval.c:1.23 src/bin/ksh/eval.c:1.24
--- src/bin/ksh/eval.c:1.23	Tue May  8 16:37:59 2018
+++ src/bin/ksh/eval.c	Sun Jun  3 16:09:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.23 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: eval.c,v 1.24 2018/06/03 16:09:31 kamil Exp $	*/
 
 /*
  * Expansion - quoting, separation, substitution, globbing
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: eval.c,v 1.23 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: eval.c,v 1.24 2018/06/03 16:09:31 kamil Exp $");
 #endif
 
 #include 
@@ -50,7 +50,7 @@ typedef struct Expand {
 static	int	varsub ARGS((Expand *xp, char *sp, char *word, int *stypep, int *slenp));
 static	int	comsub ARGS((Expand *xp, char *cp));
 static	char   *trimsub ARGS((char *str, char *pat, int how));
-static	void	glob ARGS((char *cp, XPtrV *wp, int markdirs));
+static	void	ksh_glob ARGS((char *cp, XPtrV *wp, int markdirs));
 static	void	globit ARGS((XString *xs, char **xpp, char *sp, XPtrV *wp,
 			 int check));
 static char	*maybe_expand_tilde ARGS((char *p, XString *dsp, char **dpp,
@@ -578,7 +578,7 @@ expand(cp, wp, f)
 else
 #endif /* BRACE_EXPAND */
 if (fdo & DOGLOB)
-	glob(p, wp, f & DOMARKDIRS);
+	ksh_glob(p, wp, f & DOMARKDIRS);
 else if ((f & DOPAT) || !(fdo & DOMAGIC_))
 	XPput(*wp, p);
 else
@@ -945,13 +945,13 @@ trimsub(str, pat, how)
 }
 
 /*
- * glob
+ * ksh_glob
  * Name derived from V6's /etc/glob, the program that expanded filenames.
  */
 
 /* XXX cp not const 'cause slashes are temporarily replaced with nulls... */
 static void
-glob(cp, wp, markdirs)
+ksh_glob(cp, wp, markdirs)
 	char *cp;
 	XPtrV *wp;
 	int markdirs;
@@ -1340,7 +1340,7 @@ alt_expand(wp, start, exp_start, end, fd
 		 * expansion. }
 		 */
 		if (fdo & DOGLOB)
-			glob(start, wp, fdo & DOMARKDIRS);
+			ksh_glob(start, wp, fdo & DOMARKDIRS);
 		else
 			XPput(*wp, debunk(start, start, end - start));
 		return;



CVS commit: src/sys/kern

2018-06-03 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jun  3 15:26:04 UTC 2018

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

Log Message:
Make identification of accounted aprint_error()s possible by putting a
big ugly "autoconfiguration error: " in the log when they occur.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/kern/subr_prf.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/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.170 src/sys/kern/subr_prf.c:1.171
--- src/sys/kern/subr_prf.c:1.170	Sat Apr 14 01:53:38 2018
+++ src/sys/kern/subr_prf.c	Sun Jun  3 15:26:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.170 2018/04/14 01:53:38 kre Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.170 2018/04/14 01:53:38 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -869,6 +869,7 @@ aprint_error_internal(const char *prefix
 
 	if (prefix)
 		kprintf_internal("%s: ", flags, NULL, NULL, prefix);
+	kprintf_internal("autoconfiguration error: ", TOLOG, NULL, NULL);
 	kprintf(fmt, flags, NULL, NULL, ap);
 
 	kprintf_unlock();



CVS commit: src/sys/dev/pckbport

2018-06-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  3 15:10:12 UTC 2018

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
restore \n printing.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.40 src/sys/dev/pckbport/synaptics.c:1.41
--- src/sys/dev/pckbport/synaptics.c:1.40	Sun Jun  3 10:41:05 2018
+++ src/sys/dev/pckbport/synaptics.c	Sun Jun  3 11:10:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.41 2018/06/03 15:10:12 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.41 2018/06/03 15:10:12 christos Exp $");
 
 #include 
 #include 
@@ -392,6 +392,7 @@ pms_synaptics_probe_init(void *vsc)
 sep = comma;
 			}
 		}
+		aprint_normal("\n");
 	}
 
 done:



CVS commit: src/sys/dev/pckbport

2018-06-03 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jun  3 15:02:56 UTC 2018

Modified Files:
src/sys/dev/pckbport: alps.c

Log Message:
Move two probe-time aprint_errors to debug and verbose level instead.

These two are regularly happening within qemu, and would muddle up the
aprint error counter otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pckbport/alps.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/pckbport/alps.c
diff -u src/sys/dev/pckbport/alps.c:1.4 src/sys/dev/pckbport/alps.c:1.5
--- src/sys/dev/pckbport/alps.c:1.4	Wed Aug 16 21:18:58 2017
+++ src/sys/dev/pckbport/alps.c	Sun Jun  3 15:02:56 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: alps.c,v 1.4 2017/08/16 21:18:58 nat Exp $ */
+/* $NetBSD: alps.c,v 1.5 2018/06/03 15:02:56 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2017 Ryo ONODERA 
@@ -30,7 +30,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.4 2017/08/16 21:18:58 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.5 2018/06/03 15:02:56 jakllsch Exp $");
 
 #include 
 #include 
@@ -261,7 +261,7 @@ pms_alps_ecsig(struct pms_softc *psc, ui
 	return 0;
 
 err:
-	aprint_error_dev(psc->sc_dev, "Failed to get EC signature.\n");
+	aprint_debug_dev(psc->sc_dev, "Failed to get EC signature.\n");
 	return res;
 }
 
@@ -752,7 +752,7 @@ err:
 	cmd[0] = PMS_RESET;
 	(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd,
 	1, 2, resp, 1);
-	aprint_error_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n");
+	aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n");
 	return res;
 }
 



CVS commit: src/external/cddl/osnet/sys/sys

2018-06-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  3 14:56:52 UTC 2018

Modified Files:
src/external/cddl/osnet/sys/sys: mutex.h

Log Message:
The native mutex.h has a userland visible portion. make it so and fix the
build.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/sys/sys/mutex.h

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

Modified files:

Index: src/external/cddl/osnet/sys/sys/mutex.h
diff -u src/external/cddl/osnet/sys/sys/mutex.h:1.4 src/external/cddl/osnet/sys/sys/mutex.h:1.5
--- src/external/cddl/osnet/sys/sys/mutex.h:1.4	Mon May 28 17:05:10 2018
+++ src/external/cddl/osnet/sys/sys/mutex.h	Sun Jun  3 10:56:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.4 2018/05/28 21:05:10 chs Exp $	*/
+/*	$NetBSD: mutex.h,v 1.5 2018/06/03 14:56:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -32,10 +32,10 @@
 #ifndef _OPENSOLARIS_SYS_MUTEX_H_
 #define	_OPENSOLARIS_SYS_MUTEX_H_
 
-#ifdef _KERNEL
-
 #include_next 
 
+#ifdef _KERNEL
+
 #define	MUTEX_HELD(x)		(mutex_owned(x))
 #define	MUTEX_NOT_HELD(x)	(!mutex_owned(x) || panicstr != NULL)
 #define	mutex_init(a, b, c, d)	mutex_init(a, MUTEX_DEFAULT, IPL_NONE)



CVS commit: src/sys/dev/pckbport

2018-06-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  3 14:41:05 UTC 2018

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
use a more data-driven :-) approach to avoid cut-n-pasted code.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.39 src/sys/dev/pckbport/synaptics.c:1.40
--- src/sys/dev/pckbport/synaptics.c:1.39	Sun Jun  3 03:24:18 2018
+++ src/sys/dev/pckbport/synaptics.c	Sun Jun  3 10:41:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $");
 
 #include 
 #include 
@@ -297,6 +297,24 @@ pms_synaptics_probe_extended(struct pms_
 	}
 }
 
+static const struct {
+	int bit;
+	const char *desc;
+} syn_flags[] = {
+	{ SYN_FLAG_HAS_EXTENDED_WMODE, "Extended W mode", },
+	{ SYN_FLAG_HAS_PASSTHROUGH, "Passthrough", },
+	{ SYN_FLAG_HAS_MIDDLE_BUTTON, "Middle button", },
+	{ SYN_FLAG_HAS_BUTTONS_4_5, "Buttons 4/5", },
+	{ SYN_FLAG_HAS_UP_DOWN_BUTTONS, "Up/down buttons", },
+	{ SYN_FLAG_HAS_PALM_DETECT, "Palm detect", },
+	{ SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD, "One button click pad", },
+	{ SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD, "Two button click pad", },
+	{ SYN_FLAG_HAS_VERTICAL_SCROLL, "Vertical scroll", },
+	{ SYN_FLAG_HAS_HORIZONTAL_SCROLL, "Horizontal scroll", },
+	{ SYN_FLAG_HAS_MULTI_FINGER_REPORT, "Multi-finger Report", },
+	{ SYN_FLAG_HAS_MULTI_FINGER, "Multi-finger", },
+};
+
 int
 pms_synaptics_probe_init(void *vsc)
 {
@@ -368,54 +386,12 @@ pms_synaptics_probe_init(void *vsc)
 		const char comma[] = ", ";
 		const char *sep = "";
 		aprint_normal_dev(psc->sc_dev, "");
-		if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) {
-			aprint_normal("%sExtended W mode", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) {
-			aprint_normal("%sPassthrough", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_MIDDLE_BUTTON) {
-			aprint_normal("%sMiddle button", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_BUTTONS_4_5) {
-			aprint_normal("%sButtons 4/5", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_UP_DOWN_BUTTONS) {
-			aprint_normal("%sUp/down buttons", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_PALM_DETECT) {
-			aprint_normal("%sPalm detect", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD) {
-			aprint_normal("%sOne button click pad", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD) {
-			aprint_normal("%sTwo button click pad", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_VERTICAL_SCROLL) {
-			aprint_normal("%sVertical scroll", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_HORIZONTAL_SCROLL) {
-			aprint_normal("%sHorizontal scroll", sep);
-			sep = comma;
-		}
-		if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER_REPORT) {
-			aprint_normal("%sMulti-finger Report", sep);
-			sep = comma;
+		for (size_t f = 0; f < __arraycount(syn_flags); f++) {
+			if (sc->flags & syn_flags[f].bit) {
+aprint_normal("%s%s", sep, syn_flags[f].desc);
+sep = comma;
+			}
 		}
-		if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER)
-			aprint_normal("%sMulti-finger", sep);
-
-		aprint_normal("\n");
 	}
 
 done:
@@ -437,8 +413,8 @@ pms_synaptics_enable(void *vsc)
 
 	if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) {
 		/*
-		 * Extended capability probes can confuse the passthrough device;
-		 * reset the touchpad now to cure that.
+		 * Extended capability probes can confuse the passthrough
+		 * device; reset the touchpad now to cure that.
 		 */
 		res = synaptics_poll_reset(psc);
 	}
@@ -477,46 +453,23 @@ pms_synaptics_enable(void *vsc)
 
 	/*
 	 * Enable multi-finger capability in cold boot case with
-	 * undocumented dequence.
+	 * undocumented sequence.
 	 * Parameters from
 	 * https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/
 	 * VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp
 	 * setTouchPadModeByte function.
 	 */
 	if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) {
-		cmd[0] = 0xe6;
-		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
-		cmd, 1, 3, resp, 0);
-		cmd[0] = 0xe8;
-		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
-		cmd, 1, 3, resp, 0);
-		cmd[0] = 0x00;
-		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
-		cmd, 1, 3, resp, 0);
-		cmd[0] = 0xe8;
-		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
-		cmd, 1, 3, resp, 0);
-		cmd[0] = 0x00;
-		

CVS commit: src/usr.sbin/sysinst/arch/i386

2018-06-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun  3 14:38:28 UTC 2018

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Default console device and speed to that used by syinst


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/arch/i386/md.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/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.9 src/usr.sbin/sysinst/arch/i386/md.c:1.10
--- src/usr.sbin/sysinst/arch/i386/md.c:1.9	Sun Jun  3 13:16:30 2018
+++ src/usr.sbin/sysinst/arch/i386/md.c	Sun Jun  3 14:38:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.9 2018/06/03 13:16:30 martin Exp $ */
+/*	$NetBSD: md.c,v 1.10 2018/06/03 14:38:28 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -317,6 +317,19 @@ md_post_newfs(void)
 	struct termios t;
 	dev_t condev;
 
+	/*
+	 * Get console device, should either be ttyE0 or tty0n.
+	 * Too hard to double check, so just 'know' the device numbers.
+	 */
+	len = sizeof condev;
+	if (sysctl(conmib, __arraycount(conmib), , , NULL, 0) != -1
+	&& (condev & ~3) == 0x800) {
+		/* Motherboard serial port */
+		boottype.bp_consdev = (condev & 3) + 1;
+		/* Defaulting the baud rate to that of stdin should suffice */
+		if (tcgetattr(0, ) != -1)
+			boottype.bp_conspeed = t.c_ispeed;
+
 	if (pm == NULL || !pm->no_part) {
 		/*
 		 * Get console device, should either be ttyE0 or tty0n.



CVS commit: src/usr.bin/ktruss

2018-06-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun  3 13:41:30 UTC 2018

Modified Files:
src/usr.bin/ktruss: dump.c

Log Message:
ktruss: Remove symbol clash with libc

Rename local function wprintf() to xwprintf().
This is needed for installing interceptors in sanitizers.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/ktruss/dump.c

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

Modified files:

Index: src/usr.bin/ktruss/dump.c
diff -u src/usr.bin/ktruss/dump.c:1.42 src/usr.bin/ktruss/dump.c:1.43
--- src/usr.bin/ktruss/dump.c:1.42	Tue Jul 17 14:39:08 2012
+++ src/usr.bin/ktruss/dump.c	Sun Jun  3 13:41:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dump.c,v 1.42 2012/07/17 14:39:08 njoly Exp $	*/
+/*	$NetBSD: dump.c,v 1.43 2018/06/03 13:41:30 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #endif
-__RCSID("$NetBSD: dump.c,v 1.42 2012/07/17 14:39:08 njoly Exp $");
+__RCSID("$NetBSD: dump.c,v 1.43 2018/06/03 13:41:30 kamil Exp $");
 #endif /* not lint */
 
 #include 
@@ -112,11 +112,11 @@ void	putpendq(struct ktr_entry *);
 void	syscallnameprint(int);
 void	syscallprint(struct ktr_header *);
 void	sysretprint(struct ktr_header *);
-int	wprintf(const char *, ...) __printflike(1, 2);
+int	xwprintf(const char *, ...) __printflike(1, 2);
 void	*xrealloc(void *, size_t *, size_t);
 
 int
-wprintf(const char *fmt, ...)
+xwprintf(const char *fmt, ...)
 {
 	va_list ap;
 	int w;
@@ -146,7 +146,7 @@ indent(int col)
 {
 
 	while (width < col)
-		if (wprintf(" ") < 0)
+		if (xwprintf(" ") < 0)
 			break;
 }
 
@@ -350,10 +350,10 @@ dumpheader(struct ktr_header *kth)
 	union timeholder temp;
 
 	temp.tv.tv_sec = temp.tv.tv_usec = 0;
-	wprintf("%6d ", kth->ktr_pid);
+	xwprintf("%6d ", kth->ktr_pid);
 	if (kth->ktr_version > KTRFAC_VERSION(KTRFACv0))
-		wprintf("%6d ", kth->ktr_lid);
-	wprintf("%-8.*s ", MAXCOMLEN, kth->ktr_comm);
+		xwprintf("%6d ", kth->ktr_lid);
+	xwprintf("%-8.*s ", MAXCOMLEN, kth->ktr_comm);
 	if (timestamp) {
 		if (timestamp == 2) {
 			switch (kth->ktr_version) {
@@ -404,10 +404,10 @@ dumpheader(struct ktr_header *kth)
 			}
 		}
 		if (kth->ktr_version == KTRFAC_VERSION(KTRFACv0))
-			wprintf("%lld.%06ld ",
+			xwprintf("%lld.%06ld ",
 			(long long)temp.tv.tv_sec, (long)temp.tv.tv_usec);
 		else
-			wprintf("%lld.%09ld ",
+			xwprintf("%lld.%09ld ",
 			(long long)temp.ts.tv_sec, (long)temp.ts.tv_nsec);
 	}
 }
@@ -423,13 +423,13 @@ ioctldecode(u_long cmd)
 		*dir++ = 'R';
 	*dir = '\0';
 
-	wprintf(decimal ? ", _IO%s('%c',%ld" : ", _IO%s('%c',%#lx",
+	xwprintf(decimal ? ", _IO%s('%c',%ld" : ", _IO%s('%c',%#lx",
 	dirbuf, (int) ((cmd >> 8) & 0xff), cmd & 0xff);
 	if ((cmd & IOC_VOID) == 0)
-		wprintf(decimal ? ",%ld)" : ",%#lx)",
+		xwprintf(decimal ? ",%ld)" : ",%#lx)",
 		(cmd >> 16) & 0xff);
 	else
-		wprintf(")");
+		xwprintf(")");
 }
 
 void
@@ -447,7 +447,7 @@ nameiargprint(const char *prefix, struct
 	if (kte == NULL)
 		argprint(prefix, ap, argsize);
 	else {
-		wprintf("%s", prefix);
+		xwprintf("%s", prefix);
 		nameiprint(>kte_kth);
 		free(kte);
 		(*ap)++;
@@ -460,9 +460,9 @@ syscallnameprint(int code)
 {
 
 	if (code >= cur_emul->nsysnames || code < 0)
-		wprintf("[%d]", code);
+		xwprintf("[%d]", code);
 	else
-		wprintf("%s", cur_emul->sysnames[code]);
+		xwprintf("%s", cur_emul->sysnames[code]);
 }
 
 void
@@ -470,9 +470,9 @@ argprint(const char *prefix, register_t 
 {
 
 	if (decimal)
-		wprintf("%s%ld", prefix, (long)**ap);
+		xwprintf("%s%ld", prefix, (long)**ap);
 	else
-		wprintf("%s%#lx", prefix, (long)**ap);
+		xwprintf("%s%#lx", prefix, (long)**ap);
 	(*ap)++;
 	*argsize -= sizeof(register_t);
 }
@@ -492,7 +492,7 @@ syscallprint(struct ktr_header *kth)
 	 */
 	argsize = ktr->ktr_argsize;
 	if (argsize == 0) {
-		wprintf("(");
+		xwprintf("(");
 		goto noargument;
 	}
 
@@ -558,7 +558,7 @@ syscallprint(struct ktr_header *kth)
 		break;
 
 	case SYS_compat_16___sigaction14 :
-		wprintf("(%s", signals[(int)*ap].name);
+		xwprintf("(%s", signals[(int)*ap].name);
 		ap++;
 		argsize -= sizeof(register_t);
 		break;
@@ -566,7 +566,7 @@ syscallprint(struct ktr_header *kth)
 	case SYS_ioctl :
 		argprint("(", , );
 		if ((s = ioctlname(*ap)) != NULL)
-			wprintf(", %s", s);
+			xwprintf(", %s", s);
 		else
 			ioctldecode(*ap);
 		ap++;
@@ -576,9 +576,9 @@ syscallprint(struct ktr_header *kth)
 	case SYS_ptrace :
 		if ((long)*ap >= 0 &&
 		*ap < (register_t)(sizeof(ptrace_ops) / sizeof(ptrace_ops[0])))
-			wprintf("(%s", ptrace_ops[*ap]);
+			xwprintf("(%s", ptrace_ops[*ap]);
 		else
-			wprintf("(%ld", (long)*ap);
+			xwprintf("(%ld", (long)*ap);
 		ap++;
 		argsize -= sizeof(register_t);
 		break;
@@ -594,7 +594,7 @@ print_first:
 		argprint(", ", , );
 
 noargument:
-	wprintf(")");
+	xwprintf(")");
 }
 
 void

CVS commit: src/usr.sbin/sysinst

2018-06-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun  3 13:23:58 UTC 2018

Modified Files:
src/usr.sbin/sysinst: menus.mi

Log Message:
Reorder fetch options: http before ftp


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/menus.mi

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/sysinst/menus.mi
diff -u src/usr.sbin/sysinst/menus.mi:1.12 src/usr.sbin/sysinst/menus.mi:1.13
--- src/usr.sbin/sysinst/menus.mi:1.12	Fri May 18 12:23:22 2018
+++ src/usr.sbin/sysinst/menus.mi	Sun Jun  3 13:23:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.mi,v 1.12 2018/05/18 12:23:22 joerg Exp $	*/
+/*	$NetBSD: menus.mi,v 1.13 2018/06/03 13:23:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -327,8 +327,8 @@ menu sizechoice, sub menu, y=0, title MS
 
 menu distmedium, title MSG_Select_medium, y=-5;
 	option MSG_cdrom, exit, action { *(int *)arg = get_via_cdrom(); };
-	option MSG_ftp,	  exit, action { *(int *)arg = get_via_ftp("ftp"); };
 	option MSG_http,  exit, action { *(int *)arg = get_via_ftp("http"); };
+	option MSG_ftp,	  exit, action { *(int *)arg = get_via_ftp("ftp"); };
 	option MSG_nfs,	  exit, action { *(int *)arg = get_via_nfs(); };
 	option MSG_floppy,exit, action { *(int *)arg = get_via_floppy(); };
 	option MSG_local_fs,  exit, action { *(int *)arg = get_via_localfs(); };



CVS commit: src/usr.sbin/sysinst

2018-06-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun  3 13:18:06 UTC 2018

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
In the generated /etc/fstab, do not use the (temporary, during sysinst)
path name for the file in the comment, but instead the one it will
have on the target system.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/disks.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/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.15 src/usr.sbin/sysinst/disks.c:1.16
--- src/usr.sbin/sysinst/disks.c:1.15	Sun Jun  3 13:16:30 2018
+++ src/usr.sbin/sysinst/disks.c	Sun Jun  3 13:18:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.15 2018/06/03 13:16:30 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.16 2018/06/03 13:18:06 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1039,8 +1039,8 @@ make_fstab(void)
 #endif
 	}
 
-	scripting_fprintf(f, "# NetBSD %s/etc/fstab\n# See /usr/share/examples/"
-			"fstab/ for more examples.\n", target_prefix());
+	scripting_fprintf(f, "# NetBSD /etc/fstab\n# See /usr/share/examples/"
+			"fstab/ for more examples.\n");
 
 	if (pm->no_part) {
 		/* single dk? target */



CVS commit: src/usr.sbin/sysinst

2018-06-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun  3 13:16:30 UTC 2018

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c defs.h disks.c mbr.c msg.mi.de
msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/defs.h \
src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/msg.mi.de \
src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/i386/md.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/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.3 src/usr.sbin/sysinst/bsddisklabel.c:1.4
--- src/usr.sbin/sysinst/bsddisklabel.c:1.3	Fri May 18 12:23:22 2018
+++ src/usr.sbin/sysinst/bsddisklabel.c	Sun Jun  3 13:16:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.3 2018/05/18 12:23:22 joerg Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.4 2018/06/03 13:16:30 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -566,6 +566,9 @@ make_bsd_partitions(void)
 	int no_swap = 0, valid_part = -1;
 	partinfo *p, savedlabel[MAXPARTITIONS];
 
+	if (pm && pm->no_part)
+		return 1;
+
 	memcpy(, >bsdlabel, sizeof savedlabel);
 
 	/*

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.10 src/usr.sbin/sysinst/defs.h:1.11
--- src/usr.sbin/sysinst/defs.h:1.10	Fri May 18 12:23:22 2018
+++ src/usr.sbin/sysinst/defs.h	Sun Jun  3 13:16:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.10 2018/05/18 12:23:22 joerg Exp $	*/
+/*	$NetBSD: defs.h,v 1.11 2018/06/03 13:16:30 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -294,6 +294,7 @@ typedef struct pm_devs_t {
 partinfo bsdlabel[MAXPARTITIONS]; /* What we want it to look like */
 int gpt;
 int no_mbr; /* set for raid (etc) */
+int no_part;	/* can not be partitioned, e.g. dk0 */
 int rootpart; /* partition we install into */
 const char *disktype; /* ST506, SCSI, ... */
 const char *doessf;
Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.10 src/usr.sbin/sysinst/msg.mi.en:1.11
--- src/usr.sbin/sysinst/msg.mi.en:1.10	Sun May 17 10:13:24 2015
+++ src/usr.sbin/sysinst/msg.mi.en	Sun Jun  3 13:16:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.10 2015/05/17 10:13:24 martin Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.11 2018/06/03 13:16:30 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1189,3 +1189,11 @@ message addusertowheel {Do you wish to a
 message Delete_partition
 {Delete partition}
 
+message No_filesystem_newfs
+{The selected partition does not seem to have a valid file system. 
+Do you want to newfs (format) it?}
+
+message Auto_add_swap_part
+{A swap partition (named %s) seems to exist on %s. 
+Do you want to use that?}
+

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.14 src/usr.sbin/sysinst/disks.c:1.15
--- src/usr.sbin/sysinst/disks.c:1.14	Tue May  1 09:01:45 2018
+++ src/usr.sbin/sysinst/disks.c	Sun Jun  3 13:16:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.14 2018/05/01 09:01:45 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.15 2018/06/03 13:16:30 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -68,7 +68,7 @@
 struct disk_desc {
 	char	dd_name[SSTRSIZE];
 	char	dd_descr[70];
-	uint	dd_no_mbr;
+	bool	dd_no_mbr, dd_no_part;
 	uint	dd_cyl;
 	uint	dd_head;
 	uint	dd_sec;
@@ -104,7 +104,7 @@ static int foundffs(struct data *, size_
 #ifdef USE_SYSVBFS
 static int foundsysvbfs(struct data *, size_t);
 #endif
-static int fsck_preen(const char *, int, const char *);
+static int fsck_preen(const char *, int, const char *, bool silent);
 static void fixsb(const char *, const char *, char);
 static bool is_gpt(const char *);
 static int incoregpt(pm_devs_t *, partinfo *);
@@ -113,7 +113,8 @@ static int incoregpt(pm_devs_t *, partin
 #define DISK_NAMES "wd", "sd", "ld", "raid"
 #endif
 
-static const char *disk_names[] = { DISK_NAMES, "vnd", "cgd", NULL };
+static const char *disk_names[] = { DISK_NAMES,
+"vnd", "cgd", "dk:no_part", NULL };
 
 static bool tmpfs_on_var_shm(void);
 
@@ -396,8 +397,118 @@ get_default_cdrom(void)
 	return cdrom_devices[0];
 }
 
+static void
+get_wedge_descr(struct disk_desc *dd)
+{
+	struct dkwedge_info dkw;
+	char buf[MAXPATHLEN];
+	int fd;
+
+	fd = opendisk(dd->dd_name, O_RDONLY, buf, sizeof(buf), 

CVS commit: src/share/man/man9

2018-06-03 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jun  3 12:54:51 UTC 2018

Modified Files:
src/share/man/man9: Makefile

Log Message:
Remove stray space to unbreak build


To generate a diff of this commit:
cvs rdiff -u -r1.426 -r1.427 src/share/man/man9/Makefile

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

Modified files:

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.426 src/share/man/man9/Makefile:1.427
--- src/share/man/man9/Makefile:1.426	Sun Jun  3 10:34:59 2018
+++ src/share/man/man9/Makefile	Sun Jun  3 12:54:51 2018
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.426 2018/06/03 10:34:59 pgoyette Exp $
+#   $NetBSD: Makefile,v 1.427 2018/06/03 12:54:51 gson Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -887,7 +887,7 @@ MLINKS+=specificdata.9 specificdata_doma
 	specificdata.9 specificdata_getspecific.9 \
 	specificdata.9 specificdata_getspecific_unlocked.9 \
 	specificdata.9 specificdata_setspecific.9 \
-	specificdata.9 specificdata_setspecific_nowait .9
+	specificdata.9 specificdata_setspecific_nowait.9
 MLINKS+=spl.9 spl0.9 spl.9 splbio.9 spl.9 splclock.9 spl.9 splhigh.9 \
 	spl.9 splimp.9 \
 	spl.9 spllowersoftclock.9 spl.9 splnet.9 \



CVS commit: src/bin/ksh

2018-06-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun  3 12:18:29 UTC 2018

Modified Files:
src/bin/ksh: c_ksh.c edit.c exec.c proto.h table.c table.h

Log Message:
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/edit.c
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/exec.c
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/proto.h
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/table.c
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/table.h

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/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.28 src/bin/ksh/c_ksh.c:1.29
--- src/bin/ksh/c_ksh.c:1.28	Tue May  8 16:37:59 2018
+++ src/bin/ksh/c_ksh.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * built-in Korn commands: c_*
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 #include 
@@ -1032,7 +1032,7 @@ c_unalias(wp)
 	if (all) {
 		struct tstate ts;
 
-		for (twalk(, t); (ap = tnext()); ) {
+		for (ksh_twalk(, t); (ap = tnext()); ) {
 			if (ap->flag) {
 ap->flag &= ~(ALLOC|ISSET);
 afree((void*)ap->val.s, APERM);

Index: src/bin/ksh/edit.c
diff -u src/bin/ksh/edit.c:1.34 src/bin/ksh/edit.c:1.35
--- src/bin/ksh/edit.c:1.34	Sat Jul  1 23:12:08 2017
+++ src/bin/ksh/edit.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $	*/
+/*	$NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * Command line editing - common code
@@ -7,7 +7,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $");
+__RCSID("$NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 #include 
@@ -938,7 +938,7 @@ glob_table(pat, wp, tp)
 	struct tstate ts;
 	struct tbl *te;
 
-	for (twalk(, tp); (te = tnext()); ) {
+	for (ksh_twalk(, tp); (te = tnext()); ) {
 		if (gmatch(te->name, pat, false))
 			XPput(*wp, str_save(te->name, ATEMP));
 	}

Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.27 src/bin/ksh/exec.c:1.28
--- src/bin/ksh/exec.c:1.27	Tue May  8 16:37:59 2018
+++ src/bin/ksh/exec.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 #include 
@@ -999,7 +999,7 @@ flushcom(all)
 	struct tbl *tp;
 	struct tstate ts;
 
-	for (twalk(, ); (tp = tnext()) != NULL; )
+	for (ksh_twalk(, ); (tp = tnext()) != NULL; )
 		if ((tp->flag) && (all || !ISDIRSEP(tp->val.s[0]))) {
 			if (tp->flag) {
 tp->flag &= ~(ALLOC|ISSET);

Index: src/bin/ksh/proto.h
diff -u src/bin/ksh/proto.h:1.12 src/bin/ksh/proto.h:1.13
--- src/bin/ksh/proto.h:1.12	Wed Jan 24 09:53:21 2018
+++ src/bin/ksh/proto.h	Sun Jun  3 12:18:29 2018
@@ -1,9 +1,9 @@
-/*	$NetBSD: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $	*/
+/*	$NetBSD: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * prototypes for PD-KSH
  * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
- * $Id: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $
+ * $Id: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $
  */
 
 #include 
@@ -219,7 +219,7 @@ void 	tinit		ARGS((struct table *, Area 
 struct tbl *	mytsearch	ARGS((struct table *, const char *, unsigned int));
 struct tbl *	tenter	ARGS((struct table *, const char *, unsigned int));
 void 	mytdelete		ARGS((struct tbl *));
-void 	twalk		ARGS((struct tstate *, struct table *));
+void 	ksh_twalk		ARGS((struct tstate *, struct table *));
 struct tbl *	tnext	ARGS((struct tstate *));
 struct tbl **	tsort	ARGS((struct table *));
 /* trace.c */

Index: src/bin/ksh/table.c
diff -u src/bin/ksh/table.c:1.7 src/bin/ksh/table.c:1.8
--- src/bin/ksh/table.c:1.7	Tue May  8 16:37:59 2018
+++ src/bin/ksh/table.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * dynamic hashed associative table for commands and variables
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 
@@ -151,7 +151,7 @@ mytdelete(p)
 }
 
 void
-twalk(ts, tp)
+ksh_twalk(ts, tp)
 	struct tstate *ts;
 	struct table *tp;
 {
@@ 

CVS commit: src/share/man/man9

2018-06-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jun  3 11:55:27 UTC 2018

Modified Files:
src/share/man/man9: specificdata.9

Log Message:
Clean-up, improve wording, and use terminology from the implementation
(notably, value --> datum).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/specificdata.9

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

Modified files:

Index: src/share/man/man9/specificdata.9
diff -u src/share/man/man9/specificdata.9:1.1 src/share/man/man9/specificdata.9:1.2
--- src/share/man/man9/specificdata.9:1.1	Sun Jun  3 09:22:34 2018
+++ src/share/man/man9/specificdata.9	Sun Jun  3 11:55:27 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: specificdata.9,v 1.1 2018/06/03 09:22:34 pgoyette Exp $
+.\"	$NetBSD: specificdata.9,v 1.2 2018/06/03 11:55:27 pgoyette Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -78,39 +78,49 @@ within a particular domain.
 .Sh FUNCTIONS
 .Bl -tag -width abcd
 .It Fn specificdata_domain_create
-Create a new domain.
+Create a new
+.Nm domain .
 .It Fn specificdata_domain_delete sd
-Delete a domain.
+Deletes domain
+.Fa sd .
 .It Fn specificdata_key_create sd keyp dtor
-Create a new key for the domain.
-The
+Create a new key for
+.Fa sd .
+If the
 .Fa dtor
-argument specifies a destructor which is called when an item with the
-specified key is deleted.
+argument is not
+.Dv NULL ,
+it specifies a destructor which will be called when a datum associated
+with the specified key is deleted from a container within the
+.Fa sd .
+The unique identifier of the created key is returned in
+.Fa keyp .
 .It Fn specificdata_key_delete sd key
-Delete a key for the domain, and delete any associated values.
+Delete a key for
+.Fa sd ,
+and delete any associated data from all containers within the domain.
 .It Fn specificdata_init sd ref
 Initialize the
 .Nm
 container
 .Fa ref
-for use in the specified domain.
+for use in
+.Fa sd .
 .It Fn specificdata_fini sd ref
 Destroy the
 .Nm
 container
 .Fa ref ,
-and destroy all of the data values stuffed into the container.
-.It Fn specificdata_getspecific "specificdata_domain_t sd" \
-"specificdata_reference *ref" "specificdata_key_t key"
-Retrieve the data value from the
+and destroy all of the data stuffed into the container.
+.It Fn specificdata_getspecific sd ref key
+Retrieve the datum from the
 .Nm
 container
 .Fa ref
 associated with
 .Fa key .
 .It Fn specificdata_getspecific_unlocked sd ref key
-Retrieve the data value from the
+Retrieve the datum from the
 .Nm
 container
 .Fa ref
@@ -123,7 +133,7 @@ to become invalid (i.e. point at the wro
 .Fn setspecific
 call or by destroying the container.
 .It Fn specificdata_setspecific sd ref key data
-Store the value
+Store
 .Fa data
 in the
 .Nm
@@ -131,8 +141,8 @@ container
 .Fa ref
 and associate it with
 .Fa key .
-If a value has previously been set, the new value replaces the original
-value.
+If a datum has previously been stored, the new value replaces the original;
+the original value is not destroyed, i.e. its destructor is not invoked.
 .It Fn specificdata_setspecific_nowait sd ref key data
 (Unimplemented)
 .El
@@ -154,7 +164,7 @@ subsystem first appeared in
 .An -nosplit
 The
 .Nm
-system was written by
+subsystem was written by
 .An Jason Thorpe Aq Mt thor...@netbsd.org .
 This manual page was written by
 .An Paul Goyette Aq Mt pgoye...@netbsd.org .



CVS commit: src/sys/dev/usb

2018-06-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun  3 10:59:35 UTC 2018

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

Log Message:
Constify atu_devs[] so that it lands in .rodata (600 bytes).


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/usb/if_atu.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_atu.c
diff -u src/sys/dev/usb/if_atu.c:1.57 src/sys/dev/usb/if_atu.c:1.58
--- src/sys/dev/usb/if_atu.c:1.57	Tue May  1 16:18:13 2018
+++ src/sys/dev/usb/if_atu.c	Sun Jun  3 10:59:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_atu.c,v 1.57 2018/05/01 16:18:13 maya Exp $ */
+/*	$NetBSD: if_atu.c,v 1.58 2018/06/03 10:59:35 maxv Exp $ */
 /*	$OpenBSD: if_atu.c,v 1.48 2004/12/30 01:53:21 dlg Exp $ */
 /*
  * Copyright (c) 2003, 2004
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.57 2018/05/01 16:18:13 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.58 2018/06/03 10:59:35 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -108,7 +108,7 @@ int atudebug = 1;
 /*
  * Various supported device vendors/products/radio type.
  */
-struct atu_type atu_devs[] = {
+static const struct atu_type atu_devs[] = {
 	{ USB_VENDOR_3COM,	USB_PRODUCT_3COM_3CRSHEW696,
 	  RadioRFMD,		ATU_NO_QUIRK },
 	{ USB_VENDOR_ABOCOM,	USB_PRODUCT_ABOCOM_BWU613,
@@ -1101,7 +1101,7 @@ atu_match(device_t parent, cfdata_t matc
 	int			i;
 
 	for (i = 0; i < __arraycount(atu_devs); i++) {
-		struct atu_type *t = _devs[i];
+		const struct atu_type *t = _devs[i];
 
 		if (uaa->uaa_vendor == t->atu_vid &&
 		uaa->uaa_product == t->atu_pid) {
@@ -1280,7 +1280,7 @@ atu_attach(device_t parent, device_t sel
 	 * basically does the same as atu_match
 	 */
 	for (i = 0; i < __arraycount(atu_devs); i++) {
-		struct atu_type *t = _devs[i];
+		const struct atu_type *t = _devs[i];
 
 		if (uaa->uaa_vendor == t->atu_vid &&
 		uaa->uaa_product == t->atu_pid) {



CVS commit: src/sys/dev/pci

2018-06-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun  3 10:45:16 UTC 2018

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

Log Message:
Constify ahc_pci_ident_table[] so that it lands in .rodata (1488 bytes).


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/ahc_pci.c

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

Modified files:

Index: src/sys/dev/pci/ahc_pci.c
diff -u src/sys/dev/pci/ahc_pci.c:1.71 src/sys/dev/pci/ahc_pci.c:1.72
--- src/sys/dev/pci/ahc_pci.c:1.71	Thu Jul 14 04:00:46 2016
+++ src/sys/dev/pci/ahc_pci.c	Sun Jun  3 10:45:16 2018
@@ -39,7 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: ahc_pci.c,v 1.71 2016/07/14 04:00:46 msaitoh Exp $
+ * $Id: ahc_pci.c,v 1.72 2018/06/03 10:45:16 maxv Exp $
  *
  * //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#57 $
  *
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.71 2016/07/14 04:00:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.72 2018/06/03 10:45:16 maxv Exp $");
 
 #include 
 #include 
@@ -266,7 +266,7 @@ static ahc_device_setup_t ahc_aha394XX_s
 static ahc_device_setup_t ahc_aha494XX_setup;
 static ahc_device_setup_t ahc_aha398XX_setup;
 
-static struct ahc_pci_identity ahc_pci_ident_table [] =
+static const struct ahc_pci_identity ahc_pci_ident_table[] =
 {
 	/* aic7850 based controllers */
 	{



CVS commit: src/sys/external/bsd/ipf/netinet

2018-06-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun  3 10:37:23 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet: fil.c ip_fil.h ip_frag.c ip_ftp_pxy.c
ip_log.c ip_nat.c ip_proxy.c ip_state.c ip_tftp_pxy.c

Log Message:
Constify a bunch of global varialbes under ipf/ so that they land in
.rodata (3472 bytes).

Also, remove ipf_tuneables[], unused.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/ipf/netinet/fil.c
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/ipf/netinet/ip_fil.h \
src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/ipf/netinet/ip_frag.c \
src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c \
src/sys/external/bsd/ipf/netinet/ip_proxy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/ipf/netinet/ip_log.c
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/ipf/netinet/ip_nat.c
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/ipf/netinet/ip_state.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/ipf/netinet/fil.c
diff -u src/sys/external/bsd/ipf/netinet/fil.c:1.22 src/sys/external/bsd/ipf/netinet/fil.c:1.23
--- src/sys/external/bsd/ipf/netinet/fil.c:1.22	Sun Feb  4 08:19:42 2018
+++ src/sys/external/bsd/ipf/netinet/fil.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fil.c,v 1.22 2018/02/04 08:19:42 mrg Exp $	*/
+/*	$NetBSD: fil.c,v 1.23 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -138,7 +138,7 @@ extern struct timeout ipf_slowtimer_ch;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.22 2018/02/04 08:19:42 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.23 2018/06/03 10:37:23 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c	1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -304,7 +304,7 @@ static ipfunc_resolve_t ipf_availfuncs[]
 	{ "",	   NULL,	  NULL,	  NULL }
 };
 
-static ipftuneable_t ipf_main_tuneables[] = {
+static const ipftuneable_t ipf_main_tuneables[] = {
 	{ { (void *)offsetof(struct ipf_main_softc_s, ipf_flags) },
 		"ipf_flags",		0,	0x,
 		stsizeof(ipf_main_softc_t, ipf_flags),
@@ -6923,7 +6923,7 @@ ipf_tune_array_unlink(ipf_main_softc_t *
 /* ipftp_void that points to the stored value.  */
 /*  */
 ipftuneable_t *
-ipf_tune_array_copy(void *base, size_t size, ipftuneable_t *template)
+ipf_tune_array_copy(void *base, size_t size, const ipftuneable_t *template)
 {
 	ipftuneable_t *copy;
 	int i;

Index: src/sys/external/bsd/ipf/netinet/ip_fil.h
diff -u src/sys/external/bsd/ipf/netinet/ip_fil.h:1.5 src/sys/external/bsd/ipf/netinet/ip_fil.h:1.6
--- src/sys/external/bsd/ipf/netinet/ip_fil.h:1.5	Sat Jun 29 21:06:57 2013
+++ src/sys/external/bsd/ipf/netinet/ip_fil.h	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil.h,v 1.5 2013/06/29 21:06:57 rmind Exp $	*/
+/*	$NetBSD: ip_fil.h,v 1.6 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -1881,7 +1881,7 @@ extern	int	ipf_tune_array_link(ipf_main_
 extern	int	ipf_tune_array_unlink(ipf_main_softc_t *,
 	   ipftuneable_t *);
 extern	ipftuneable_t *ipf_tune_array_copy(void *, size_t,
-		ipftuneable_t *);
+		const ipftuneable_t *);
 
 extern int	ipf_pr_pullup(fr_info_t *, int);
 
Index: src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c
diff -u src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c:1.5 src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c:1.6
--- src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c:1.5	Mon Jul 30 19:27:47 2012
+++ src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_tftp_pxy.c,v 1.5 2012/07/30 19:27:47 pgoyette Exp $	*/
+/*	$NetBSD: ip_tftp_pxy.c,v 1.6 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -49,7 +49,7 @@ typedef struct tftpinfo {
 	ipnat_t		*ti_rule;
 } tftpinfo_t;
 
-static  ipftuneable_t   ipf_tftp_tuneables[] = {
+static  const ipftuneable_t   ipf_tftp_tuneables[] = {
 	{ { (void *)offsetof(ipf_tftp_softc_t, ipf_p_tftp_readonly) },
 		"tftp_read_only",	0,	1,
 		stsizeof(ipf_tftp_softc_t, ipf_p_tftp_readonly),

Index: src/sys/external/bsd/ipf/netinet/ip_frag.c
diff -u src/sys/external/bsd/ipf/netinet/ip_frag.c:1.6 src/sys/external/bsd/ipf/netinet/ip_frag.c:1.7
--- src/sys/external/bsd/ipf/netinet/ip_frag.c:1.6	Thu May  3 07:13:48 2018
+++ src/sys/external/bsd/ipf/netinet/ip_frag.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_frag.c,v 1.6 2018/05/03 07:13:48 maxv Exp $	*/
+/*	$NetBSD: ip_frag.c,v 1.7 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -86,7 +86,7 @@ struct file;
 #if !defined(lint)
 #if 

CVS commit: src/distrib/sets/lists/comp

2018-06-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jun  3 10:35:57 UTC 2018

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
Add the module specificdata entries to the sets lists.  While here, sort
the entries for module(9) and specificdata(9) and use the correct setname
selectors for the latter.


To generate a diff of this commit:
cvs rdiff -u -r1.2201 -r1.2202 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2201 src/distrib/sets/lists/comp/mi:1.2202
--- src/distrib/sets/lists/comp/mi:1.2201	Sun Jun  3 01:55:16 2018
+++ src/distrib/sets/lists/comp/mi	Sun Jun  3 10:35:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2201 2018/06/03 01:55:16 pgoyette Exp $
+#	$NetBSD: mi,v 1.2202 2018/06/03 10:35:57 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -11121,6 +11121,7 @@
 ./usr/share/man/cat9/module_autoload.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_builtin_require_force.0 comp-sys-catman	.cat
 ./usr/share/man/cat9/module_find_section.0	comp-sys-catman		.cat
+./usr/share/man/cat9/module_getspecific.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/module_hold.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_init.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_init_class.0	comp-sys-catman		.cat
@@ -11130,7 +11131,10 @@
 ./usr/share/man/cat9/module_name.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_rele.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_register.0		comp-sys-catman		.cat
+./usr/share/man/cat9/module_setspecific.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/module_source.0		comp-sys-catman		.cat
+./usr/share/man/cat9/module_specific_key_create.0 comp-sys-catman	.cat
+./usr/share/man/cat9/module_specific_key_delete.0 comp-sys-catman	.cat
 ./usr/share/man/cat9/module_start_unload_thread.0 comp-sys-catman	.cat
 ./usr/share/man/cat9/module_unload.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module_unregister.0	comp-sys-catman		.cat
@@ -11546,6 +11550,17 @@
 ./usr/share/man/cat9/softintr_disestablish.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/softintr_establish.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/softintr_schedule.0	comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata.0		comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata_domain_create.0 comp-sys-catman	.cat
+./usr/share/man/cat9/specificdata_domain_delete.0 comp-sys-catman	.cat
+./usr/share/man/cat9/specificdata_fini.0	comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata_getspecific.0	comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata_getspecific_unlocked.0 comp-sys-catman .cat
+./usr/share/man/cat9/specificdata_init.0	comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata_key_create.0	comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata_key_delete.0	comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata_setspecific.0	comp-sys-catman		.cat
+./usr/share/man/cat9/specificdata_setspecific_nowait.0 comp-sys-catman	.cat
 ./usr/share/man/cat9/spinlockinit.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/spinlockmgr.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/spl.0			comp-sys-catman		.cat
@@ -18809,7 +18824,10 @@
 ./usr/share/man/html9/module.html		comp-sys-htmlman	html
 ./usr/share/man/html9/module_autoload.html	comp-sys-htmlman	html
 ./usr/share/man/html9/module_builtin_require_force.html comp-sys-htmlman html
+./usr/share/man/html9/module_specific_key_create.html comp-sys-htmlman	html
+./usr/share/man/html9/module_specific_key_delete.html comp-sys-htmlman	html
 ./usr/share/man/html9/module_find_section.html	comp-sys-htmlman	html
+./usr/share/man/html9/module_getspecific.html	comp-sys-htmlman	html
 ./usr/share/man/html9/module_hold.html		comp-sys-htmlman	html
 ./usr/share/man/html9/module_init.html		comp-sys-htmlman	html
 ./usr/share/man/html9/module_init_class.html	comp-sys-htmlman	html
@@ -18819,6 +18837,7 @@
 ./usr/share/man/html9/module_name.html		comp-sys-htmlman	html
 ./usr/share/man/html9/module_rele.html		comp-sys-htmlman	html
 ./usr/share/man/html9/module_register.html	comp-sys-htmlman	html
+./usr/share/man/html9/module_setspecific.html	comp-sys-htmlman	html
 ./usr/share/man/html9/module_source.html	comp-sys-htmlman	html
 ./usr/share/man/html9/module_start_unload_thread.html comp-sys-htmlman	html
 ./usr/share/man/html9/module_unload.html	comp-sys-htmlman	html
@@ -19213,6 +19232,17 @@
 ./usr/share/man/html9/softintr_disestablish.html	comp-sys-htmlman	html
 ./usr/share/man/html9/softintr_establish.html	comp-sys-htmlman	html
 ./usr/share/man/html9/softintr_schedule.html	comp-sys-htmlman	html
+./usr/share/man/html9/specificdata.html		comp-sys-htmlman	html
+./usr/share/man/html9/specificdata_domain_create.html comp-sys-htmlman	html

CVS commit: src/share/man/man9

2018-06-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jun  3 10:34:59 UTC 2018

Modified Files:
src/share/man/man9: Makefile module.9

Log Message:
Finish documenting the new modules(9) interfaces by adding the module
specificdata routines.


To generate a diff of this commit:
cvs rdiff -u -r1.425 -r1.426 src/share/man/man9/Makefile
cvs rdiff -u -r1.45 -r1.46 src/share/man/man9/module.9

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

Modified files:

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.425 src/share/man/man9/Makefile:1.426
--- src/share/man/man9/Makefile:1.425	Sun Jun  3 09:22:34 2018
+++ src/share/man/man9/Makefile	Sun Jun  3 10:34:59 2018
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.425 2018/06/03 09:22:34 pgoyette Exp $
+#   $NetBSD: Makefile,v 1.426 2018/06/03 10:34:59 pgoyette Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -522,6 +522,7 @@ MLINKS+=microuptime.9 binuptime.9 \
 MLINKS+=module.9 module_autoload.9 \
 	module.9 module_builtin_require_force.9 \
 	module.9 module_find_section.9 \
+	module.9 module_getspecific.9 \
 	module.9 module_hold.9 \
 	module.9 module_init.9 \
 	module.9 module_init_class.9 \
@@ -530,7 +531,10 @@ MLINKS+=module.9 module_autoload.9 \
 	module.9 module_load_vfs_init.9 \
 	module.9 module_name.9 \
 	module.9 module_rele.9 \
+	module.9 module_setspecific.9 \
 	module.9 module_source.9 \
+	module.9 module_specific_key_create.9 \
+	module.9 module_specific_key_delete.9 \
 	module.9 module_start_unload_thread.9 \
 	module.9 module_unload.9 \
 	module.9 module_register_callbacks.9 \

Index: src/share/man/man9/module.9
diff -u src/share/man/man9/module.9:1.45 src/share/man/man9/module.9:1.46
--- src/share/man/man9/module.9:1.45	Sun Jun  3 01:52:47 2018
+++ src/share/man/man9/module.9	Sun Jun  3 10:34:59 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: module.9,v 1.45 2018/06/03 01:52:47 pgoyette Exp $
+.\"	$NetBSD: module.9,v 1.46 2018/06/03 10:34:59 pgoyette Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -43,7 +43,11 @@
 .Nm module_name ,
 .Nm module_source ,
 .Nm module_register_callbacks ,
-.Nm module_unregister_callbacks
+.Nm module_unregister_callbacks ,
+.Nm module_specific_key_create ,
+.Nm module_specific_key_delete ,
+.Nm module_getspecific ,
+.Nm module_setspecific
 .Nd kernel module loader
 .Sh SYNOPSIS
 .In sys/module.h
@@ -82,6 +86,15 @@
 "void (*unload)(struct module *)"
 .Ft void
 .Fn module_unregister_callbacks "void *"
+.Ft specificdata_key_t
+.Fn module_specific_key_create "specificdata_key_t *keyp" \
+"specificdata_dtor_t dtor"
+.Ft void
+.Fn module_specific_key_delete "specificdata_key_t key"
+.Ft "void *"
+.Fn module_getspecific "module_t *mod" "specificdata_key_t key"
+.Ft "void *"
+.Fn module_setspecific "module_t *mod" "specificdata_key_t key" "void *data"
 .Sh DESCRIPTION
 Modules are sections of code that can be independently linked and selectively
 loaded into or unloaded from a running kernel.
@@ -479,6 +492,31 @@ The
 argument should be the return value from the previous
 .Fn module_register_callbacks
 call.
+.It module_specific_key_create "specificdata_key_t *keyp" \
+"specificdata_dtor_t dtor"
+Creates a new specificdata_key for use within the
+.Nm
+domain.
+The key identifier is returned in
+.Fa keyp .
+.It module_specific_key_delete "specificdata_key_t key"
+Deletes the specified specificdata_key
+.Fa key
+from the
+.Nm domain.
+.It module_getspecific "module_t *mod" "specificdata_key_t key"
+Retrieves the value associated with
+.Fa key
+from module
+.Fa mod .
+.It module_setspecific "module_t *mod" "specificdata_key_t key" "void *data"
+Stores
+.Fa data
+as the value associated with
+.Fa key
+for module
+.Fa mod .
+
 .El
 .Sh PROGRAMMING CONSIDERATIONS
 The module subsystem is designed to be called recursively, but only within



CVS commit: src/sys/dev/pci/ixgbe

2018-06-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun  3 10:24:25 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
Constify several variables in ixgbe/ so that they land in .rodata (1038
bytes).


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.158 src/sys/dev/pci/ixgbe/ixgbe.c:1.159
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.158	Wed May 30 09:17:17 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sun Jun  3 10:24:24 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.158 2018/05/30 09:17:17 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.159 2018/06/03 10:24:24 maxv Exp $ */
 
 /**
 
@@ -80,7 +80,7 @@
 /
  * Driver version
  /
-char ixgbe_driver_version[] = "4.0.1-k";
+static const char ixgbe_driver_version[] = "4.0.1-k";
 
 
 /
@@ -92,7 +92,7 @@ char ixgbe_driver_version[] = "4.0.1-k";
  *
  *   { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index }
  /
-static ixgbe_vendor_info_t ixgbe_vendor_info_array[] =
+static const ixgbe_vendor_info_t ixgbe_vendor_info_array[] =
 {
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, 0, 0, 0},
@@ -266,7 +266,7 @@ static void	ixgbe_handle_phy(void *);
 /* Workqueue handler for deferred work */
 static void	ixgbe_handle_que_work(struct work *, void *);
 
-static ixgbe_vendor_info_t *ixgbe_lookup(const struct pci_attach_args *);
+static const ixgbe_vendor_info_t *ixgbe_lookup(const struct pci_attach_args *);
 
 /
  *  NetBSD Device Interface Entry Points
@@ -769,7 +769,7 @@ ixgbe_attach(device_t parent, device_t d
 	u32		ctrl_ext;
 	u16		high, low, nvmreg;
 	pcireg_t	id, subid;
-	ixgbe_vendor_info_t *ent;
+	const ixgbe_vendor_info_t *ent;
 	struct pci_attach_args *pa = aux;
 	const char *str;
 	char buf[256];
@@ -5934,10 +5934,10 @@ ixgbe_probe(device_t dev, cfdata_t cf, v
 	return (ixgbe_lookup(pa) != NULL) ? 1 : 0;
 }
 
-static ixgbe_vendor_info_t *
+static const ixgbe_vendor_info_t *
 ixgbe_lookup(const struct pci_attach_args *pa)
 {
-	ixgbe_vendor_info_t *ent;
+	const ixgbe_vendor_info_t *ent;
 	pcireg_t subid;
 
 	INIT_DEBUGOUT("ixgbe_lookup: begin");

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.102 src/sys/dev/pci/ixgbe/ixv.c:1.103
--- src/sys/dev/pci/ixgbe/ixv.c:1.102	Wed May 30 08:35:26 2018
+++ src/sys/dev/pci/ixgbe/ixv.c	Sun Jun  3 10:24:24 2018
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.102 2018/05/30 08:35:26 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.103 2018/06/03 10:24:24 maxv Exp $*/
 
 /**
 
@@ -46,7 +46,7 @@
 /
  * Driver version
  /
-char ixv_driver_version[] = "2.0.1-k";
+static const char ixv_driver_version[] = "2.0.1-k";
 
 /
  * PCI Device ID Table
@@ -57,7 +57,7 @@ char ixv_driver_version[] = "2.0.1-k";
  *
  *   { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index }
  /
-static ixgbe_vendor_info_t ixv_vendor_info_array[] =
+static const ixgbe_vendor_info_t ixv_vendor_info_array[] =
 {
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_VF, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_VF, 0, 0, 0},
@@ -154,7 +154,7 @@ static void ixv_handle_link(void *);
 static void	ixv_handle_que_work(struct work *, void *);
 
 const struct sysctlnode *ixv_sysctl_instance(struct adapter *);
-static ixgbe_vendor_info_t *ixv_lookup(const struct pci_attach_args *);
+static const ixgbe_vendor_info_t *ixv_lookup(const struct pci_attach_args *);
 
 /
  * FreeBSD Device Interface Entry Points
@@ -259,10 +259,10 @@ ixv_probe(device_t dev, cfdata_t cf, voi
 #endif
 } /* ixv_probe */
 
-static ixgbe_vendor_info_t *
+static const ixgbe_vendor_info_t *
 ixv_lookup(const struct pci_attach_args *pa)
 {
-	ixgbe_vendor_info_t *ent;
+	const ixgbe_vendor_info_t *ent;
 	pcireg_t subid;
 
 	INIT_DEBUGOUT("ixv_lookup: begin");
@@ -302,7 +302,7 @@ ixv_attach(device_t parent, 

CVS commit: src/sys/dev/ata

2018-06-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun  3 10:20:55 UTC 2018

Modified Files:
src/sys/dev/ata: ld_ataraid.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/ata/ld_ataraid.c

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

Modified files:

Index: src/sys/dev/ata/ld_ataraid.c
diff -u src/sys/dev/ata/ld_ataraid.c:1.44 src/sys/dev/ata/ld_ataraid.c:1.45
--- src/sys/dev/ata/ld_ataraid.c:1.44	Tue Sep 27 08:05:34 2016
+++ src/sys/dev/ata/ld_ataraid.c	Sun Jun  3 10:20:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_ataraid.c,v 1.44 2016/09/27 08:05:34 pgoyette Exp $	*/
+/*	$NetBSD: ld_ataraid.c,v 1.45 2018/06/03 10:20:54 martin Exp $ */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -42,12 +42,12 @@
  * controllers we're dealing with (Promise, etc.) only support
  * configuration data on the component disks, with the BIOS supporting
  * booting from the RAID volumes.
- *
+ *	  
  * bio(4) support was written by Juan Romero Pardines .
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.44 2016/09/27 08:05:34 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.45 2018/06/03 10:20:54 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "bio.h"
@@ -92,11 +92,11 @@ struct ld_ataraid_softc {
 
 	void	(*sc_iodone)(struct buf *);
 
-   pool_cache_t sc_cbufpool;
+	pool_cache_t sc_cbufpool;
 
-   SIMPLEQ_HEAD(, cbuf) sc_cbufq;
+	SIMPLEQ_HEAD(, cbuf) sc_cbufq;
 
-   void*sc_sih_cookie;
+	void	*sc_sih_cookie;
 };
 
 static int	ld_ataraid_match(device_t, cfdata_t, void *);
@@ -125,14 +125,14 @@ CFATTACH_DECL_NEW(ld_ataraid, sizeof(str
 ld_ataraid_match, ld_ataraid_attach, NULL, NULL);
 
 struct cbuf {
-	struct buf	cb_buf;		/* new I/O buf */
+	struct buf	cb_buf; 	/* new I/O buf */
 	struct buf	*cb_obp;	/* ptr. to original I/O buf */
-	struct ld_ataraid_softc *cb_sc;	/* pointer to ld softc */
+	struct ld_ataraid_softc *cb_sc; /* pointer to ld softc */
 	u_int		cb_comp;	/* target component */
 	SIMPLEQ_ENTRY(cbuf) cb_q;	/* fifo of component buffers */
 	struct cbuf	*cb_other;	/* other cbuf in case of mirror */
 	int		cb_flags;
-#define	CBUF_IODONE	0x0001	/* I/O is already successfully done */
+#define CBUF_IODONE	0x0001	/* I/O is already successfully done */
 };
 
 #defineCBUF_GET()  pool_cache_get(sc->sc_cbufpool, PR_NOWAIT);
@@ -159,10 +159,10 @@ ld_ataraid_attach(device_t parent, devic
 
 	ld->sc_dv = self;
 
-   sc->sc_cbufpool = pool_cache_init(sizeof(struct cbuf), 0,
-   0, 0, "ldcbuf", NULL, IPL_BIO, cbufpool_ctor, cbufpool_dtor, sc);
-   sc->sc_sih_cookie = softint_establish(SOFTINT_BIO,
-   ld_ataraid_start_vstrategy, sc);
+	sc->sc_cbufpool = pool_cache_init(sizeof(struct cbuf), 0,
+	0, 0, "ldcbuf", NULL, IPL_BIO, cbufpool_ctor, cbufpool_dtor, sc);
+	sc->sc_sih_cookie = softint_establish(SOFTINT_BIO,
+	ld_ataraid_start_vstrategy, sc);
 
 	sc->sc_aai = aai;	/* this data persists */
 
@@ -260,24 +260,24 @@ ld_ataraid_attach(device_t parent, devic
 static int
 cbufpool_ctor(void *arg, void *obj, int flags)
 {
-   struct ld_ataraid_softc *sc = arg;
-   struct ld_softc *ld = >sc_ld;
-   struct cbuf *cbp = obj;
-
-   /* We release/reacquire the spinlock before calling buf_init() */
-   mutex_exit(>sc_mutex);
-   buf_init(>cb_buf);
-   mutex_enter(>sc_mutex);
+	struct ld_ataraid_softc *sc = arg;
+	struct ld_softc *ld = >sc_ld;
+	struct cbuf *cbp = obj;
+
+	/* We release/reacquire the spinlock before calling buf_init() */
+	mutex_exit(>sc_mutex);
+	buf_init(>cb_buf);
+	mutex_enter(>sc_mutex);
 
-   return 0;
+	return 0;
 }
 
 static void
 cbufpool_dtor(void *arg, void *obj)
 {
-   struct cbuf *cbp = obj;
+	struct cbuf *cbp = obj;
 
-   buf_destroy(>cb_buf);
+	buf_destroy(>cb_buf);
 }
 
 static struct cbuf *
@@ -288,7 +288,7 @@ ld_ataraid_make_cbuf(struct ld_ataraid_s
 
 	cbp = CBUF_GET();
 	if (cbp == NULL)
-   return NULL;
+		return NULL;
 	cbp->cb_buf.b_flags = bp->b_flags;
 	cbp->cb_buf.b_oflags = bp->b_oflags;
 	cbp->cb_buf.b_cflags = bp->b_cflags;
@@ -307,24 +307,24 @@ ld_ataraid_make_cbuf(struct ld_ataraid_s
 	cbp->cb_other = NULL;
 	cbp->cb_flags = 0;
 
-   return cbp;
+	return cbp;
 }
 
 static void
 ld_ataraid_start_vstrategy(void *arg)
 {
-   struct ld_ataraid_softc *sc = arg;
-   struct cbuf *cbp;
+	struct ld_ataraid_softc *sc = arg;
+	struct cbuf *cbp;
 
-   while ((cbp = SIMPLEQ_FIRST(>sc_cbufq)) != NULL) {
-   SIMPLEQ_REMOVE_HEAD(>sc_cbufq, cb_q);
-   if ((cbp->cb_buf.b_flags & B_READ) == 0) {
-   mutex_enter(cbp->cb_buf.b_vp->v_interlock);
-   cbp->cb_buf.b_vp->v_numoutput++;
-   mutex_exit(cbp->cb_buf.b_vp->v_interlock);
-   }
-   VOP_STRATEGY(cbp->cb_buf.b_vp, >cb_buf);
-   }
+	

CVS commit: src/sys/arch/x86/pci

2018-06-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun  3 10:13:54 UTC 2018

Modified Files:
src/sys/arch/x86/pci: ichlpcib.c

Log Message:
Constify lpcib_devices[] so that it lands in .rodata (1584 bytes).


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.51 src/sys/arch/x86/pci/ichlpcib.c:1.52
--- src/sys/arch/x86/pci/ichlpcib.c:1.51	Sat Aug  6 21:57:04 2016
+++ src/sys/arch/x86/pci/ichlpcib.c	Sun Jun  3 10:13:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.51 2016/08/06 21:57:04 jakllsch Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.52 2018/06/03 10:13:54 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.51 2016/08/06 21:57:04 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.52 2018/06/03 10:13:54 maxv Exp $");
 
 #include 
 #include 
@@ -163,7 +163,7 @@ struct lpcib_softc *speedstep_cookie;	/*
 CFATTACH_DECL2_NEW(ichlpcib, sizeof(struct lpcib_softc),
 lpcibmatch, lpcibattach, lpcibdetach, NULL, lpcibrescan, lpcibchilddet);
 
-static struct lpcib_device {
+static const struct lpcib_device {
 	pcireg_t vendor, product;
 	int has_rcba;
 	int has_ich5_hpet;
@@ -291,7 +291,7 @@ static int
 lpcibmatch(device_t parent, cfdata_t match, void *aux)
 {
 	struct pci_attach_args *pa = aux;
-	struct lpcib_device *lpcib_dev;
+	const struct lpcib_device *lpcib_dev;
 
 	/* We are ISA bridge, of course */
 	if (PCI_CLASS(pa->pa_class) != PCI_CLASS_BRIDGE ||
@@ -312,7 +312,7 @@ lpcibattach(device_t parent, device_t se
 {
 	struct pci_attach_args *pa = aux;
 	struct lpcib_softc *sc = device_private(self);
-	struct lpcib_device *lpcib_dev;
+	const struct lpcib_device *lpcib_dev;
 	pcireg_t pmbase;
 
 	sc->sc_pa = *pa;



CVS commit: src/sys/dev/ic

2018-06-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun  3 10:04:41 UTC 2018

Modified Files:
src/sys/dev/ic: ug.c ugvar.h

Log Message:
Constify ug2_mb[], so that it lands in .rodata.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/ug.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/ugvar.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/ic/ug.c
diff -u src/sys/dev/ic/ug.c:1.12 src/sys/dev/ic/ug.c:1.13
--- src/sys/dev/ic/ug.c:1.12	Mon Jun 20 18:12:06 2011
+++ src/sys/dev/ic/ug.c	Sun Jun  3 10:04:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ug.c,v 1.12 2011/06/20 18:12:06 pgoyette Exp $ */
+/* $NetBSD: ug.c,v 1.13 2018/06/03 10:04:40 maxv Exp $ */
 
 /*
  * Copyright (c) 2007 Mihai Chelaru 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ug.c,v 1.12 2011/06/20 18:12:06 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ug.c,v 1.13 2018/06/03 10:04:40 maxv Exp $");
 
 #include 
 #include 
@@ -56,7 +56,7 @@ uint8_t ug_ver;
  * Imported from linux driver
  */
 
-struct ug2_motherboard_info ug2_mb[] = {
+static const struct ug2_motherboard_info ug2_mb[] = {
 	{ 0x000C, "unknown. Please send-pr(1)", {
 		{ "CPU Core", 0, 0, 10, 1, 0 },
 		{ "DDR", 1, 0, 10, 1, 0 },
@@ -485,8 +485,8 @@ ug2_attach(device_t dv)
 	struct ug_softc *sc = device_private(dv);
 	uint8_t buf[2];
 	int i;
-	struct ug2_motherboard_info *ai;
-	struct ug2_sensor_info *si;
+	const struct ug2_motherboard_info *ai;
+	const struct ug2_sensor_info *si;
 
 	aprint_normal(": Abit uGuru 2005 system monitor\n");
 
@@ -509,7 +509,7 @@ ug2_attach(device_t dv)
 	aprint_normal_dev(dv, "mainboard %s (%.2X%.2X)\n",
 	ai->name, buf[0], buf[1]);
 
-	sc->mbsens = (void*)ai->sensors;
+	sc->mbsens = (const void *)ai->sensors;
 	sc->sc_sme = sysmon_envsys_create();
 
 	for (i = 0, si = ai->sensors; si && si->name; si++, i++) {
@@ -552,7 +552,8 @@ void
 ug2_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
 {
 	struct ug_softc *sc = sme->sme_cookie;
-	struct ug2_sensor_info *si = (struct ug2_sensor_info *)sc->mbsens;
+	const struct ug2_sensor_info *si =
+	(const struct ug2_sensor_info *)sc->mbsens;
 	int rfact = 1;
 	uint8_t v;
 

Index: src/sys/dev/ic/ugvar.h
diff -u src/sys/dev/ic/ugvar.h:1.4 src/sys/dev/ic/ugvar.h:1.5
--- src/sys/dev/ic/ugvar.h:1.4	Wed Mar 26 16:09:37 2008
+++ src/sys/dev/ic/ugvar.h	Sun Jun  3 10:04:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ugvar.h,v 1.4 2008/03/26 16:09:37 xtraeme Exp $ */
+/* $NetBSD: ugvar.h,v 1.5 2018/06/03 10:04:40 maxv Exp $ */
 
 /*
  * Copyright (c) 2007 Mihai Chelaru 
@@ -35,7 +35,7 @@ struct ug_softc {
 	struct sysmon_envsys *sc_sme;
 	envsys_data_t sc_sensor[UG_MAX_SENSORS];
 	uint8_t version;
-	void *mbsens;
+	const void *mbsens;
 };
 
 struct ug2_sensor_info {



CVS commit: src/sys/dev

2018-06-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun  3 10:01:22 UTC 2018

Modified Files:
src/sys/dev/microcode/bnx: bnxfw.h
src/sys/dev/pci: if_bnxreg.h

Log Message:
Constify the microcode variables used by BNX. This moves 38 pages of kernel
memory from .data to .rodata.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/microcode/bnx/bnxfw.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/if_bnxreg.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/microcode/bnx/bnxfw.h
diff -u src/sys/dev/microcode/bnx/bnxfw.h:1.3 src/sys/dev/microcode/bnx/bnxfw.h:1.4
--- src/sys/dev/microcode/bnx/bnxfw.h:1.3	Wed Nov 18 23:11:16 2009
+++ src/sys/dev/microcode/bnx/bnxfw.h	Sun Jun  3 10:01:21 2018
@@ -60,7 +60,7 @@ static int bnx_COM_b06FwSbssLen = 0x38;
 static u_int32_t bnx_COM_b06FwSDataAddr = 0x;
 static int bnx_COM_b06FwSDataLen = 0x0;
 #endif
-static u_int32_t bnx_COM_b06FwText[(0x4df0/4) + 1] = {
+static const u_int32_t bnx_COM_b06FwText[(0x4df0/4) + 1] = {
 0xa3e, 0x0, 0x0, 
 0xd, 0x636f6d34, 0x2e362e31, 0x3700, 
 0x4061102, 0x0, 0x3, 0x14, 
@@ -1309,15 +1309,15 @@ static u_int32_t bnx_COM_b06FwText[(0x4d
 0xaf5101c0, 0xa34201c4, 0x3c021000, 0xaf4201f8, 
 0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x3e8, 
 0x27bd0020, 0x0 };
-static u_int32_t bnx_COM_b06FwData[(0x0/4) + 1] = { 0x0 };
-static u_int32_t bnx_COM_b06FwRodata[(0x14/4) + 1] = {
+static const u_int32_t bnx_COM_b06FwData[(0x0/4) + 1] = { 0x0 };
+static const u_int32_t bnx_COM_b06FwRodata[(0x14/4) + 1] = {
 0x8000ec8, 
 0x8000f10, 0x8000f50, 0x8000f9c, 0x8000fd0, 
 0x0 };
-static u_int32_t bnx_COM_b06FwBss[(0xbc/4) + 1] = { 0x0 };
-static u_int32_t bnx_COM_b06FwSbss[(0x38/4) + 1] = { 0x0 };
+static const u_int32_t bnx_COM_b06FwBss[(0xbc/4) + 1] = { 0x0 };
+static const u_int32_t bnx_COM_b06FwSbss[(0x38/4) + 1] = { 0x0 };
 #ifdef unused
-static u_int32_t bnx_COM_b06FwSdata[(0x0/4) + 1] = { 0x0 };
+static const u_int32_t bnx_COM_b06FwSdata[(0x0/4) + 1] = { 0x0 };
 #endif
 
 
@@ -1339,7 +1339,7 @@ static int bnx_RXP_b06FwSbssLen = 0x54;
 static u_int32_t bnx_RXP_b06FwSDataAddr = 0x;
 static int bnx_RXP_b06FwSDataLen = 0x0;
 #endif
-static u_int32_t bnx_RXP_b06FwText[(0x70dc/4) + 1] = {
+static const u_int32_t bnx_RXP_b06FwText[(0x70dc/4) + 1] = {
 0xa000c76, 0x0, 0x0,
 0xd, 0x72787034, 0x2e362e31, 0x3700,
 0x4061103, 0x0, 0x1, 0x0,
@@ -3147,16 +3147,16 @@ static u_int32_t bnx_RXP_b06FwText[(0x70
 0x8fb3001c, 0x8fb20018, 0x8fb10014, 0x8fb00010,
 0x3c021000, 0x27bd0028, 0x3e8, 0xaf4201b8,
 0x0 };
-static u_int32_t bnx_RXP_b06FwData[(0x0/4) + 1] = { 0x0 };
-static u_int32_t bnx_RXP_b06FwRodata[(0x24/4) + 1] = {
+static const u_int32_t bnx_RXP_b06FwData[(0x0/4) + 1] = { 0x0 };
+static const u_int32_t bnx_RXP_b06FwRodata[(0x24/4) + 1] = {
 0x8004c28,
 0x8004c28, 0x8004ba0, 0x8004bd8, 0x8004c0c,
 0x8004c30, 0x8004c30, 0x8004c30, 0x8004b10,
 0x0 };
-static u_int32_t bnx_RXP_b06FwBss[(0x450/4) + 1] = { 0x0 };
-static u_int32_t bnx_RXP_b06FwSbss[(0x54/4) + 1] = { 0x0 };
+static const u_int32_t bnx_RXP_b06FwBss[(0x450/4) + 1] = { 0x0 };
+static const u_int32_t bnx_RXP_b06FwSbss[(0x54/4) + 1] = { 0x0 };
 #ifdef unused
-static u_int32_t bnx_RXP_b06FwSdata[(0x0/4) + 1] = { 0x0 };
+static const u_int32_t bnx_RXP_b06FwSdata[(0x0/4) + 1] = { 0x0 };
 #endif
 
 
@@ -3178,7 +3178,7 @@ static int bnx_TPAT_b06FwSbssLen = 0x44;
 static u_int32_t bnx_TPAT_b06FwSDataAddr = 0x;
 static int bnx_TPAT_b06FwSDataLen = 0x0;
 #endif
-static u_int32_t bnx_TPAT_b06FwText[(0x175c/4) + 1] = {
+static const u_int32_t bnx_TPAT_b06FwText[(0x175c/4) + 1] = {
 0xa000122, 0x0, 0x0,
 0xd, 0x74706134, 0x2e362e31, 0x3700,
 0x4061101, 0x0, 0x0, 0x0,
@@ -3554,12 +3554,12 @@ static u_int32_t bnx_TPAT_b06FwText[(0x1
 0xc35021, 0x8fbf0010, 0xa4c02, 0x312200ff,
 0x27bd0018, 0xaf8a002c, 0x3e8, 0xaf890030,
 0x0 };
-static u_int32_t bnx_TPAT_b06FwData[(0x0/4) + 1] = { 0x0 };
-static u_int32_t bnx_TPAT_b06FwRodata[(0x0/4) + 1] = { 0x0 };
-static u_int32_t bnx_TPAT_b06FwBss[(0x450/4) + 1] = { 0x0 };
-static u_int32_t bnx_TPAT_b06FwSbss[(0x44/4) + 1] = { 0x0 };
+static const u_int32_t bnx_TPAT_b06FwData[(0x0/4) + 1] = { 0x0 };
+static const u_int32_t bnx_TPAT_b06FwRodata[(0x0/4) + 1] = { 0x0 };
+static const u_int32_t bnx_TPAT_b06FwBss[(0x450/4) + 1] = { 0x0 };
+static const u_int32_t bnx_TPAT_b06FwSbss[(0x44/4) + 1] = { 0x0 };
 #ifdef unused
-static u_int32_t bnx_TPAT_b06FwSdata[(0x0/4) + 1] = { 0x0 };
+static const u_int32_t bnx_TPAT_b06FwSdata[(0x0/4) + 1] = { 0x0 };
 #endif
 
 
@@ -3581,7 +3581,7 @@ static int bnx_TXP_b06FwSbssLen = 0x68;
 static u_int32_t bnx_TXP_b06FwSDataAddr = 0x;
 static int bnx_TXP_b06FwSDataLen = 0x0;
 #endif
-static u_int32_t bnx_TXP_b06FwText[(0x3a74/4) + 1] = {
+static const u_int32_t bnx_TXP_b06FwText[(0x3a74/4) + 1] = {
 0xa26, 0x0, 0x0,
 0xd, 0x74787034, 0x2e362e31, 0x3700,
 

CVS commit: src/share/man/man9

2018-06-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jun  3 09:22:34 UTC 2018

Modified Files:
src/share/man/man9: Makefile
Added Files:
src/share/man/man9: specificdata.9

Log Message:
Make a first pass at documenting the specificdata functionality.

XXX This is just a first pass, and I've probably made a ton of mistakes
XXX while reading the code!  Updates and corrections greatly appreciated.


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/specificdata.9

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

Modified files:

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.424 src/share/man/man9/Makefile:1.425
--- src/share/man/man9/Makefile:1.424	Sun Jun  3 01:52:47 2018
+++ src/share/man/man9/Makefile	Sun Jun  3 09:22:34 2018
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.424 2018/06/03 01:52:47 pgoyette Exp $
+#   $NetBSD: Makefile,v 1.425 2018/06/03 09:22:34 pgoyette Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -51,7 +51,8 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	secmodel_bsd44.9 secmodel_extensions.9 \
 	secmodel_overlay.9 secmodel_securelevel.9 secmodel_suser.9 \
 	SET.9 setbit.9 setjmp.9 shutdownhook_establish.9 \
-	signal.9 skpc.9 sockopt.9 softintr.9 spl.9 splraiseipl.9 \
+	signal.9 skpc.9 sockopt.9 softintr.9 spl.9 specificdata.9 \
+	splraiseipl.9 \
 	store.9 suspendsched.9 \
 	sysctl.9 sysmon_envsys.9 sysmon_pswitch.9 sysmon_taskq.9 tc.9 \
 	tcp_congctl.9 timecounter.9 time_second.9 todr.9 ts2timo.9 tvtohz.9 \
@@ -873,6 +874,16 @@ MLINKS+=softintr.9 softintr_establish.9 
 	softintr.9 softintr_schedule.9 softintr.9 softint.9 \
 	softintr.9 softint_establish.9 softintr.9 softint_disestablish.9 \
 	softintr.9 softint_schedule.9
+MLINKS+=specificdata.9 specificdata_domain_create.9 \
+	specificdata.9 specificdata_domain_delete.9 \
+	specificdata.9 specificdata_key_create.9 \
+	specificdata.9 specificdata_key_delete.9 \
+	specificdata.9 specificdata_init.9 \
+	specificdata.9 specificdata_fini.9 \
+	specificdata.9 specificdata_getspecific.9 \
+	specificdata.9 specificdata_getspecific_unlocked.9 \
+	specificdata.9 specificdata_setspecific.9 \
+	specificdata.9 specificdata_setspecific_nowait .9
 MLINKS+=spl.9 spl0.9 spl.9 splbio.9 spl.9 splclock.9 spl.9 splhigh.9 \
 	spl.9 splimp.9 \
 	spl.9 spllowersoftclock.9 spl.9 splnet.9 \

Added files:

Index: src/share/man/man9/specificdata.9
diff -u /dev/null src/share/man/man9/specificdata.9:1.1
--- /dev/null	Sun Jun  3 09:22:34 2018
+++ src/share/man/man9/specificdata.9	Sun Jun  3 09:22:34 2018
@@ -0,0 +1,160 @@
+.\"	$NetBSD: specificdata.9,v 1.1 2018/06/03 09:22:34 pgoyette Exp $
+.\"
+.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jason R. Thorpe
+.\"
+.\" 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 June 3, 2018
+.Dt MODULE 9
+.Os
+.Sh NAME
+.Nm specificdata ,
+.Nm specificdata_domain_create ,
+.Nm specificdata_domain_delete ,
+.Nm specificdata_key_create ,
+.Nm specificdata_key_delete ,
+.Nm specificdata_init ,
+.Nm specificdata_fini ,
+.Nm specificdata_getspecific ,
+.Nm specificdata_getspecific_unlocked ,
+.Nm specificdata_setspecific ,
+.Nm specificdata_setspecific_nowait
+.Nd manipulate arbitrary data attached to objects
+.Sh SYNOPSIS
+.In sys/specificdata.h
+.Ft specificdata_domain_t
+.Fn specificdata_domain_create
+.Ft void
+.Fn specificdata_domain_delete "specificdata_domain_t sd"
+.Ft int
+.Fn 

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

2018-06-03 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jun  3 08:48:37 UTC 2018

Modified Files:
src/tests/lib/libc/time: t_strptime.c

Log Message:
use ATF_CHECK instead of ATF_REQUIRE
(continue on failure, to see the rest of the failures)

>From Ngie Cooper in PR bin/51834


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/time/t_strptime.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/time/t_strptime.c
diff -u src/tests/lib/libc/time/t_strptime.c:1.14 src/tests/lib/libc/time/t_strptime.c:1.15
--- src/tests/lib/libc/time/t_strptime.c:1.14	Fri Oct 27 05:14:11 2017
+++ src/tests/lib/libc/time/t_strptime.c	Sun Jun  3 08:48:37 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strptime.c,v 1.14 2017/10/27 05:14:11 kre Exp $ */
+/* $NetBSD: t_strptime.c,v 1.15 2018/06/03 08:48:37 maya Exp $ */
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_strptime.c,v 1.14 2017/10/27 05:14:11 kre Exp $");
+__RCSID("$NetBSD: t_strptime.c,v 1.15 2018/06/03 08:48:37 maya Exp $");
 
 #include 
 #include 
@@ -51,12 +51,12 @@ h_pass(const char *buf, const char *fmt,
 	exp = buf + len;
 	ret = strptime(buf, fmt, );
 
-	ATF_REQUIRE_MSG(ret == exp,
+	ATF_CHECK_MSG(ret == exp,
 	"strptime(\"%s\", \"%s\", tm): incorrect return code: "
 	"expected: %p, got: %p", buf, fmt, exp, ret);
 
 #define H_REQUIRE_FIELD(field)		\
-		ATF_REQUIRE_MSG(tm.field == field,			\
+		ATF_CHECK_MSG(tm.field == field,			\
 		"strptime(\"%s\", \"%s\", tm): incorrect %s: "	\
 		"expected: %d, but got: %d", buf, fmt,		\
 		___STRING(field), field, tm.field)
@@ -78,7 +78,7 @@ h_fail(const char *buf, const char *fmt)
 {
 	struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL };
 
-	ATF_REQUIRE_MSG(strptime(buf, fmt, ) == NULL, "strptime(\"%s\", "
+	ATF_CHECK_MSG(strptime(buf, fmt, ) == NULL, "strptime(\"%s\", "
 	"\"%s\", ) should fail, but it didn't", buf, fmt);
 }
 
@@ -182,7 +182,7 @@ ztest1(const char *name, const char *fmt
 		break;
 	}
 
-	ATF_REQUIRE_MSG(tm.tm_gmtoff == value,
+	ATF_CHECK_MSG(tm.tm_gmtoff == value,
 	"strptime(\"%s\", \"%s\", ): "
 	"expected: tm.tm_gmtoff=%ld, got: tm.tm_gmtoff=%ld",
 	name, fmt, value, tm.tm_gmtoff);



CVS commit: src/tests/lib/libm

2018-06-03 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jun  3 08:39:00 UTC 2018

Modified Files:
src/tests/lib/libm: t_scalbn.c

Log Message:
Test and clear exception around scalbn calls.
Second part of PR bin/51834.

ifdef out vax to avoid netbsd-specific macros.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libm/t_scalbn.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/libm/t_scalbn.c
diff -u src/tests/lib/libm/t_scalbn.c:1.14 src/tests/lib/libm/t_scalbn.c:1.15
--- src/tests/lib/libm/t_scalbn.c:1.14	Fri Jan 13 21:09:12 2017
+++ src/tests/lib/libm/t_scalbn.c	Sun Jun  3 08:39:00 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_scalbn.c,v 1.14 2017/01/13 21:09:12 agc Exp $ */
+/* $NetBSD: t_scalbn.c,v 1.15 2018/06/03 08:39:00 maya Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,12 +29,13 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_scalbn.c,v 1.14 2017/01/13 21:09:12 agc Exp $");
+__RCSID("$NetBSD: t_scalbn.c,v 1.15 2018/06/03 08:39:00 maya Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -46,16 +47,17 @@ struct testcase {
 	double inval;
 	double result;
 	int error;
+	int except;
 };
 struct testcase test_vals[] = {
-	{ 0,		1.00085,	1.00085,	0 },
-	{ 0,		0.99755,	0.99755,	0 },
-	{ 0,		-1.00085,	-1.00085,	0 },
-	{ 0,		-0.99755,	-0.99755,	0 },
-	{ 1,		1.00085,	2.0* 1.00085,	0 },
-	{ 1,		0.99755,	2.0* 0.99755,	0 },
-	{ 1,		-1.00085,	2.0* -1.00085,	0 },
-	{ 1,		-0.99755,	2.0* -0.99755,	0 },
+	{ 0,		1.00085,	1.00085,	0, 0 },
+	{ 0,		0.99755,	0.99755,	0, 0 },
+	{ 0,		-1.00085,	-1.00085,	0, 0 },
+	{ 0,		-0.99755,	-0.99755,	0, 0 },
+	{ 1,		1.00085,	2.0* 1.00085,	0, 0 },
+	{ 1,		0.99755,	2.0* 0.99755,	0, 0 },
+	{ 1,		-1.00085,	2.0* -1.00085,	0, 0 },
+	{ 1,		-0.99755,	2.0* -0.99755,	0, 0 },
 
 	/*
 	 * We could add more corner test cases here, but we would have to
@@ -82,10 +84,19 @@ ATF_TC_BODY(scalbn_val, tc)
 
 	for (i = 0; i < tcnt; i++) {
 		errno = 0;
+#ifndef __vax__
+		feclearexcept(FE_ALL_EXCEPT);
+#endif
 		rv = scalbn(tests[i].inval, tests[i].exp);
 		ATF_CHECK_EQ_MSG(errno, tests[i].error,
 		"test %zu: errno %d instead of %d", i, errno,
 		tests[i].error);
+#ifndef __vax__
+		ATF_CHECK_EQ_MSG(errno, tests[i].error,
+		"test %zu: fetestexcept %d instead of %d", i,
+		fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW),
+		tests[i].except);
+#endif
 		ATF_CHECK_MSG(fabs(rv-tests[i].result)<2.0*DBL_EPSILON,
 		"test %zu: return value %g instead of %g (difference %g)",
 		i, rv, tests[i].result, tests[i].result-rv);



CVS commit: src/external/bsd/nvi/dist

2018-06-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun  3 08:08:37 UTC 2018

Modified Files:
src/external/bsd/nvi/dist/common: conv.h
src/external/bsd/nvi/dist/vi: vs_line.c vs_relative.c

Log Message:
Make sure that every wide char occupies at least one display width:
  - Replace non-printable multibyte char with ?-symbol.
  - Put space before non-spacing char.

Fix problems reported in PR bin/53164 and
PR bin/53323, that are because we did not take into account non-printable
multibyte char of wctob(wc) == EOF && wcwidth(wc) == -1.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/nvi/dist/common/conv.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/nvi/dist/vi/vs_line.c \
src/external/bsd/nvi/dist/vi/vs_relative.c

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

Modified files:

Index: src/external/bsd/nvi/dist/common/conv.h
diff -u src/external/bsd/nvi/dist/common/conv.h:1.2 src/external/bsd/nvi/dist/common/conv.h:1.3
--- src/external/bsd/nvi/dist/common/conv.h:1.2	Fri Nov 22 15:52:05 2013
+++ src/external/bsd/nvi/dist/common/conv.h	Sun Jun  3 08:08:36 2018
@@ -1,9 +1,14 @@
-/*	$NetBSD: conv.h,v 1.2 2013/11/22 15:52:05 christos Exp $	*/
+/*	$NetBSD: conv.h,v 1.3 2018/06/03 08:08:36 rin Exp $	*/
+
+/*
+ * We ensure that every wide char occupies at least one display width.
+ * See vs_line.c for more details.
+ */
+#define WIDE_COL(sp, ch)		\
+	(CHAR_WIDTH(sp, ch) >= 0 ? CHAR_WIDTH(sp, ch) : 1)
+
 #define KEY_COL(sp, ch)			\
-	(INTISWIDE(ch) ? 		\
-	(CHAR_WIDTH(sp, ch) >= 0) ?	\
-	   (size_t)CHAR_WIDTH(sp, ch) : 1 /* extra space */		\
-	: KEY_LEN(sp,ch))
+	(INTISWIDE(ch) ? (size_t)WIDE_COL(sp, ch) : KEY_LEN(sp, ch))
 
 struct _conv_win {
 void*bp1;

Index: src/external/bsd/nvi/dist/vi/vs_line.c
diff -u src/external/bsd/nvi/dist/vi/vs_line.c:1.4 src/external/bsd/nvi/dist/vi/vs_line.c:1.5
--- src/external/bsd/nvi/dist/vi/vs_line.c:1.4	Fri Nov 10 14:44:13 2017
+++ src/external/bsd/nvi/dist/vi/vs_line.c	Sun Jun  3 08:08:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vs_line.c,v 1.4 2017/11/10 14:44:13 rin Exp $ */
+/*	$NetBSD: vs_line.c,v 1.5 2018/06/03 08:08:37 rin Exp $ */
 /*-
  * Copyright (c) 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: vs_line.c,v 10.38 2002/01/19 21:59:07 skimo Exp  (Berkeley) Date: 2002/01/19 21:59:07 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: vs_line.c,v 1.4 2017/11/10 14:44:13 rin Exp $");
+__RCSID("$NetBSD: vs_line.c,v 1.5 2018/06/03 08:08:37 rin Exp $");
 #endif
 
 #include 
@@ -497,10 +497,23 @@ display:
 
 			/*  this needs some rethinking */
 			if (INTISWIDE(ch)) {
-/* Put a space before non-spacing char. */
-if (CHAR_WIDTH(sp, ch) <= 0)
+/*
+ * We ensure that every wide char occupies at
+ * least one display width, as noted in conv.h:
+ *   - Replace non-printable char with ?-symbol.
+ *   - Put space before non-spacing char.
+ */
+switch (CHAR_WIDTH(sp, ch)) {
+case -1:
+	*cbp++ = L('?');
+	break;
+case 0:
 	*cbp++ = L(' ');
-*cbp++ = ch;
+	/* FALLTHROUGH */
+default:
+	*cbp++ = ch;
+	break;
+}
 			} else
 for (kp = KEY_NAME(sp, ch) + offset_in_char; 
  chlen--;)
Index: src/external/bsd/nvi/dist/vi/vs_relative.c
diff -u src/external/bsd/nvi/dist/vi/vs_relative.c:1.4 src/external/bsd/nvi/dist/vi/vs_relative.c:1.5
--- src/external/bsd/nvi/dist/vi/vs_relative.c:1.4	Fri Nov 10 14:44:13 2017
+++ src/external/bsd/nvi/dist/vi/vs_relative.c	Sun Jun  3 08:08:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vs_relative.c,v 1.4 2017/11/10 14:44:13 rin Exp $ */
+/*	$NetBSD: vs_relative.c,v 1.5 2018/06/03 08:08:37 rin Exp $ */
 /*-
  * Copyright (c) 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: vs_relative.c,v 10.18 2001/07/08 13:02:48 skimo Exp  (Berkeley) Date: 2001/07/08 13:02:48 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: vs_relative.c,v 1.4 2017/11/10 14:44:13 rin Exp $");
+__RCSID("$NetBSD: vs_relative.c,v 1.5 2018/06/03 08:08:37 rin Exp $");
 #endif
 
 #include 
@@ -178,7 +178,7 @@ done:		if (diffp != NULL)		/* XXX */
 			}
 
 			/* multibyte case */
-			chlen = CHAR_WIDTH(sp, ch);
+			chlen = WIDE_COL(sp, ch);
 			last = scno;
 			scno += chlen;
 			len--;
@@ -216,7 +216,7 @@ done:		if (diffp != NULL)		/* XXX */
 			}
 
 			/* multibyte case */
-			chlen = CHAR_WIDTH(sp, ch);
+			chlen = WIDE_COL(sp, ch);
 			last = scno;
 			scno += chlen;
 			p++;



CVS commit: src/share/locale/ctype

2018-06-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun  3 07:54:51 UTC 2018

Modified Files:
src/share/locale/ctype: en_US.UTF-8.src

Log Message:
Add characters in "Emoji & Pictographs" from Unicode 10.0.0:
  http://www.unicode.org/charts/

They are classified as PUNCT, which is historically used for characters other
than blank, alphabetic, or digit ones.

Glyph widths are taken from "East Asian Width":
  https://www.unicode.org/Public/10.0.0/ucd/EastAsianWidth.txt
Characters of "F" or "W" are classified to SWIDTH2, and others are classified
to SWIDTH1, as implicitly done in the previous revisions.

Should address problems like PR bin/53323.

Discussed with soda@. We thank Takuya SHIOZAKI (tshiozak@) for useful comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/locale/ctype/en_US.UTF-8.src

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

Modified files:

Index: src/share/locale/ctype/en_US.UTF-8.src
diff -u src/share/locale/ctype/en_US.UTF-8.src:1.5 src/share/locale/ctype/en_US.UTF-8.src:1.6
--- src/share/locale/ctype/en_US.UTF-8.src:1.5	Wed Aug  8 18:40:37 2012
+++ src/share/locale/ctype/en_US.UTF-8.src	Sun Jun  3 07:54:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: en_US.UTF-8.src,v 1.5 2012/08/08 18:40:37 tnozaki Exp $	*/
+/*	$NetBSD: en_US.UTF-8.src,v 1.6 2018/06/03 07:54:51 rin Exp $	*/
 /*	$FreeBSD: /repoman/r/ncvs/src/share/mklocale/UTF-8.src,v 1.1 2004/03/27 08:14:14 tjr Exp $	*/
 
 /*
@@ -1858,19 +1858,15 @@ SWIDTH1   0x2600 - 0x2613  0x2616  0x261
  * U+2700 - U+27BF : Dingbats
  */
 
-GRAPH 0x2701 - 0x2704  0x2706 - 0x2709  0x270c - 0x2727  0x2729 - 0x274b
-GRAPH 0x274d  0x274f - 0x2752  0x2756  0x2758 - 0x275e  0x2761 - 0x2794
-GRAPH 0x2798 - 0x27af  0x27b1 - 0x27be
-PUNCT 0x2701 - 0x2704  0x2706 - 0x2709  0x270c - 0x2727  0x2729 - 0x274b
-PUNCT 0x274d  0x274f - 0x2752  0x2756  0x2758 - 0x275e  0x2761 - 0x2775
-PUNCT 0x2794  0x2798 - 0x27af  0x27b1 - 0x27be
-PRINT 0x2701 - 0x2704  0x2706 - 0x2709  0x270c - 0x2727  0x2729 - 0x274b
-PRINT 0x274d  0x274f - 0x2752  0x2756  0x2758 - 0x275e  0x2761 - 0x2794
-PRINT 0x2798 - 0x27af  0x27b1 - 0x27be
+GRAPH 0x2700 - 0x27bf
+PUNCT 0x2700 - 0x2775  0x2794 - 0x27bf
+PRINT 0x2700 - 0x27bf
 SPECIAL   0x2776 - 0x2793
-SWIDTH1   0x2701 - 0x2704  0x2706 - 0x2709  0x270c - 0x2727  0x2729 - 0x274b
-SWIDTH1   0x274d  0x274f - 0x2752  0x2756  0x2758 - 0x275e  0x2761 - 0x2794
-SWIDTH1   0x2798 - 0x27af  0x27b1 - 0x27be
+SWIDTH1   0x2700 - 0x2704  0x2706 - 0x2709  0x270c - 0x2727  0x2729 - 0x274b
+SWIDTH1   0x274d  0x274f - 0x2752  0x2756  0x2758 - 0x2794  0x2798 - 0x27af
+SWIDTH1   0x27b1 - 0x27be
+SWIDTH2   0x2705  0x270a - 0x270b  0x2728  0x274c  0x274e  0x2753 - 0x2755
+SWIDTH2   0x2757  0x2795 - 0x2797  0x27b0  0x27bf
 
 
 /*
@@ -2396,6 +2392,74 @@ SWIDTH1   0x1d7ce - 0x1d7ff
 
 
 /*
+ * U+1F300 - U+1F5FF : Miscellaneous Symbols and Pictographs
+ */
+
+GRAPH 0x1f300 - 0x1f5ff
+PUNCT 0x1f300 - 0x1f5ff
+PRINT 0x1f300 - 0x1f5ff
+SWIDTH1   0x1f321 - 0x1f32c  0x1f336  0x1f37d  0x1f394 - 0x1f39f
+SWIDTH1   0x1f3cb - 0x1f3ce  0x1f3d4 - 0x1f3df  0x1f3f1 - 0x1f3f3
+SWIDTH1   0x1f3f5 - 0x1f3f7  0x1f43f  0x1f441  0x1f4fd - 0x1f4fe
+SWIDTH1   0x1f53e - 0x1f54a  0x1f54f  0x1f568 - 0x1f579  0x1f57b - 0x1f594
+SWIDTH1   0x1f597 - 0x1f5a3  0x1f5a5 - 0x1f5fa
+SWIDTH2   0x1f300 - 0x1f320  0x1f32d - 0x1f335  0x1f337 - 0x1f37c
+SWIDTH2   0x1f37e - 0x1f393  0x1f3a0 - 0x1f3ca  0x1f3cf - 0x1f3d3
+SWIDTH2   0x1f3e0 - 0x1f3f0  0x1f3f4  0x1f3f8 - 0x1f43e  0x1f440
+SWIDTH2   0x1f442 - 0x1f4fc  0x1f4ff - 0x1f53d  0x1f54b - 0x1f54e
+SWIDTH2   0x1f550 - 0x1f567  0x1f57a  0x1f595 - 0x1f596  0x1f5a4
+SWIDTH2   0x1f5fb - 0x1f5ff
+
+
+/*
+ * U+1F600 - U+1F64F : Emoticons
+ */
+
+GRAPH 0x1f600 - 0x1f64f
+PUNCT 0x1f600 - 0x1f64f
+PRINT 0x1f600 - 0x1f64f
+SWIDTH2   0x1f600 - 0x1f64f
+
+
+/*
+ * U+1F650 - U+1F67F : Ornamental Dingbats
+ */
+
+GRAPH 0x1f650 - 0x1f67f
+PUNCT 0x1f650 - 0x1f67f
+PRINT 0x1f650 - 0x1f67f
+SWIDTH1   0x1f650 - 0x1f67f
+
+
+/*
+ * U+1F680 - U+1F6FF : Transport and Map Symbols
+ */
+
+GRAPH 0x1f680 - 0x1f6d4  0x1f6e0 - 0x1f6ec  0x1f6f0 - 0x1f6f8
+PUNCT 0x1f680 - 0x1f6d4  0x1f6e0 - 0x1f6ec  0x1f6f0 - 0x1f6f8
+PRINT 0x1f680 - 0x1f6d4  0x1f6e0 - 0x1f6ec  0x1f6f0 - 0x1f6f8
+SWIDTH1   0x1f6c6 - 0x1f6cb  0x1f6cd - 0x1f6cf  0x1f6d3 - 0x1f6d4
+SWIDTH1   0x1f6e0 - 0x1f6ea  0x1f6f0 - 0x1f6f3
+SWIDTH2   0x1f680 - 0x1f6c5  0x1f6cc  0x1f6d0 - 0x1f6d2  0x1f6eb - 0x1f6ec
+SWIDTH2   0x1f6f4 - 0x1f6f8
+
+
+/*
+ * U+1F900 - U+1F9FF : Supplemental Symbols and Pictographs
+ */
+
+GRAPH 0x1f900 - 0x1f90b  0x1f910 - 0x1f93e  0x1f940 - 0x1f94c
+GRAPH 0x1f950 - 0x1f96b  0x1f980 - 0x1f997  0x1f9c0  0x1f9d0 - 0x1f9e6
+PUNCT 0x1f900 - 0x1f90b  0x1f910 - 0x1f93e  0x1f940 - 0x1f94c
+PUNCT 0x1f950 - 0x1f96b  0x1f980 - 0x1f997  0x1f9c0  0x1f9d0 - 0x1f9e6
+PRINT 0x1f900 - 0x1f90b  0x1f910 - 

CVS commit: src/sys/dev/pckbport

2018-06-03 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sun Jun  3 07:24:18 UTC 2018

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
Enable Synaptics multifinger capability (Extended W mode)

Magic parameters are taken from
  https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/.
Tested on HP ProBook 4630s, Lenovo E530, VAIO Pro 11 and HP Spectre x360 ae.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.38 src/sys/dev/pckbport/synaptics.c:1.39
--- src/sys/dev/pckbport/synaptics.c:1.38	Wed May 30 13:20:39 2018
+++ src/sys/dev/pckbport/synaptics.c	Sun Jun  3 07:24:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.38 2018/05/30 13:20:39 ryoon Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.38 2018/05/30 13:20:39 ryoon Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $");
 
 #include 
 #include 
@@ -433,6 +433,7 @@ pms_synaptics_enable(void *vsc)
 	struct synaptics_softc *sc = >u.synaptics;
 	u_char enable_modes;
 	int res;
+	u_char cmd[1], resp[3];
 
 	if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) {
 		/*
@@ -474,6 +475,50 @@ pms_synaptics_enable(void *vsc)
 	for (int i = 0; i < 2; i++)
 		synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0);
 
+	/*
+	 * Enable multi-finger capability in cold boot case with
+	 * undocumented dequence.
+	 * Parameters from
+	 * https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/
+	 * VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp
+	 * setTouchPadModeByte function.
+	 */
+	if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) {
+		cmd[0] = 0xe6;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0xe8;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0x00;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0xe8;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0x00;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0xe8;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0x00;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0xe8;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0x03;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0xf3;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+		cmd[0] = 0xc8;
+		(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+		cmd, 1, 3, resp, 0);
+	}
+
 	synaptics_poll_cmd(psc, PMS_DEV_ENABLE, 0);
 
 	sc->up_down = 0;