CVS commit: src/sys/uvm

2020-04-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr 18 03:27:13 UTC 2020

Modified Files:
src/sys/uvm: uvm_extern.h uvm_map.c

Log Message:
Add an API to get a reference on the identity of an individual byte of
virtual memory, a "virtual object address".  This is not a reference to
a physical byte of memory, per se, but a reference to a byte residing
in a page, owned by a unique UVM object (either a uobj or an anon).  Two
separate address+addresses space tuples that reference the same byte in
an object (such as a location in a shared memory segment) will resolve
to equivalent virtual object addresses.  Even if the residency status
of the page changes, the virtual object address remains unchanged.

struct uvm_voaddr -- a structure that encapsulates this address reference.

uvm_voaddr_acquire() -- a function to acquire this address reference,
given a vm_map and a vaddr_t.

uvm_voaddr_release() -- a function to release this address reference.

uvm_voaddr_compare() -- a function to compare two such address references.

uvm_voaddr_acquire() resolves the COW status of the object address before
acquiring.

In collaboration with riastradh@ and chs@.


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.378 -r1.379 src/sys/uvm/uvm_map.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.222 src/sys/uvm/uvm_extern.h:1.223
--- src/sys/uvm/uvm_extern.h:1.222	Sun Mar 22 18:32:42 2020
+++ src/sys/uvm/uvm_extern.h	Sat Apr 18 03:27:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.222 2020/03/22 18:32:42 ad Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.223 2020/04/18 03:27:13 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -606,6 +606,40 @@ extern struct vm_map *kernel_map;
 extern struct vm_map *phys_map;
 
 /*
+ *	uvm_voaddr:
+ *
+ *	This structure encapsulates UVM's unique virtual object address
+ *	for an individual byte inside a pageable page. Pageable pages can
+ *	be owned by either a uvm_object (UVM_VOADDR_TYPE_OBJECT) or a
+ *	vm_anon (UVM_VOADDR_TYPE_ANON).
+ *
+ *	In each case, the byte offset into the owning object
+ *	(uvm_object or vm_anon) is included in the ID, so that
+ *	two different offsets into the same page have distinct
+ *	IDs.
+ *
+ *	Note that the page does not necessarily have to be resident
+ *	in order to know the virtual object address.  However, it
+ *	is required that any pending copy-on-write is resolved.
+ *
+ *	When someone wants a virtual object address, an extra reference
+ *	is taken on the owner while the caller uses the ID.  This
+ *	ensures that the identity is stable for the duration of its
+ *	use.
+ */
+struct uvm_voaddr {
+	enum {
+		UVM_VOADDR_TYPE_OBJECT = 1,
+		UVM_VOADDR_TYPE_ANON = 2,
+	} type;
+	union {
+		struct uvm_object *uobj;
+		struct vm_anon *anon;
+	};
+	voff_t offset;
+};
+
+/*
  * macros
  */
 
@@ -710,6 +744,12 @@ void			uvmspace_free(struct vmspace *);
 void			uvmspace_share(struct proc *, struct proc *);
 void			uvmspace_unshare(struct lwp *);
 
+bool			uvm_voaddr_acquire(struct vm_map *, vaddr_t,
+			struct uvm_voaddr *);
+void			uvm_voaddr_release(struct uvm_voaddr *);
+int			uvm_voaddr_compare(const struct uvm_voaddr *,
+			const struct uvm_voaddr *);
+
 void			uvm_whatis(uintptr_t, void (*)(const char *, ...));
 
 /* uvm_meter.c */

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.378 src/sys/uvm/uvm_map.c:1.379
--- src/sys/uvm/uvm_map.c:1.378	Fri Apr 10 17:26:46 2020
+++ src/sys/uvm/uvm_map.c	Sat Apr 18 03:27:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.378 2020/04/10 17:26:46 ad Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.379 2020/04/18 03:27:13 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.378 2020/04/10 17:26:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.379 2020/04/18 03:27:13 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -4781,6 +4781,270 @@ uvm_map_unlock_entry(struct vm_map_entry
 	}
 }
 
+/*
+ * uvm_voaddr_acquire: returns the virtual object address corresponding
+ * to the specified virtual address.
+ *
+ * => resolves COW so the true page identity is tracked.
+ *
+ * => acquires a reference on the page's owner (uvm_object or vm_anon)
+ */
+bool
+uvm_voaddr_acquire(struct vm_map * const map, vaddr_t const va,
+struct uvm_voaddr * const voaddr)
+{
+	struct vm_map_entry *entry;
+	struct vm_anon *anon = NULL;
+	bool result = false;
+	bool exclusive = false;
+	void (*unlock_fn)(struct vm_map *);
+
+	UVMHIST_FUNC("uvm_voaddr_acquire"); UVMHIST_CALLED(maphist);
+	UVMHIST_LOG(maphist,"(map=%#jx,va=%jx)", (uintptr_t)map, va, 0, 0);
+
+	const vaddr_t start = trunc_page(va);
+	const vaddr_t end = round_page(va+1);
+
+ 

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

2020-04-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Apr 17 22:53:52 UTC 2020

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

Log Message:
Switch from C11 specific static_assert() to __CTASSERT()


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.170 src/tests/lib/libc/sys/t_ptrace_wait.c:1.171
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.170	Tue Apr 14 22:37:24 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Fri Apr 17 22:53:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.170 2020/04/14 22:37:24 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.171 2020/04/17 22:53:52 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.170 2020/04/14 22:37:24 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.171 2020/04/17 22:53:52 kamil Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -74,18 +74,14 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.17
 #ifdef ENABLE_TESTS
 
 /* Assumptions in the kernel code that must be kept. */
-static_assert(sizeof(((struct ptrace_state *)0)->pe_report_event) ==
-sizeof(((siginfo_t *)0)->si_pe_report_event),
-"pe_report_event and si_pe_report_event must be of the same size");
-static_assert(sizeof(((struct ptrace_state *)0)->pe_other_pid) ==
-sizeof(((siginfo_t *)0)->si_pe_other_pid),
-"pe_other_pid and si_pe_other_pid must be of the same size");
-static_assert(sizeof(((struct ptrace_state *)0)->pe_lwp) ==
-sizeof(((siginfo_t *)0)->si_pe_lwp),
-"pe_lwp and si_pe_lwp must be of the same size");
-static_assert(sizeof(((struct ptrace_state *)0)->pe_other_pid) ==
-sizeof(((struct ptrace_state *)0)->pe_lwp),
-"pe_other_pid and pe_lwp must be of the same size");
+__CTASSERT(sizeof(((struct ptrace_state *)0)->pe_report_event) ==
+sizeof(((siginfo_t *)0)->si_pe_report_event));
+__CTASSERT(sizeof(((struct ptrace_state *)0)->pe_other_pid) ==
+sizeof(((siginfo_t *)0)->si_pe_other_pid));
+__CTASSERT(sizeof(((struct ptrace_state *)0)->pe_lwp) ==
+sizeof(((siginfo_t *)0)->si_pe_lwp));
+__CTASSERT(sizeof(((struct ptrace_state *)0)->pe_other_pid) ==
+sizeof(((struct ptrace_state *)0)->pe_lwp));
 
 #include "h_macros.h"
 



CVS commit: src/external/historical/nawk/dist

2020-04-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Apr 17 22:35:18 UTC 2020

Modified Files:
src/external/historical/nawk/dist: lib.c

Log Message:
Now that inputFS is dynamically allocated, make sure it's always non-NULL.
Fixes core dumps when building CDE.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/historical/nawk/dist/lib.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/historical/nawk/dist/lib.c
diff -u src/external/historical/nawk/dist/lib.c:1.11 src/external/historical/nawk/dist/lib.c:1.12
--- src/external/historical/nawk/dist/lib.c:1.11	Thu Feb 20 19:59:12 2020
+++ src/external/historical/nawk/dist/lib.c	Fri Apr 17 22:35:18 2020
@@ -48,7 +48,7 @@ int	fieldssize = RECSIZE;
 
 Cell	**fldtab;	/* pointers to Cells */
 static size_t	len_inputFS = 0;
-static char	*inputFS = NULL; /* FS at time of input, for field splitting */
+static char	*inputFS; /* FS at time of input, for field splitting */
 
 #define	MAXFLD	2
 int	nfields	= MAXFLD;	/* last allocated slot for $i */
@@ -75,6 +75,7 @@ void recinit(unsigned int n)
 	fldtab[0]->sval = record;
 	fldtab[0]->nval = tostring("0");
 	makefields(1, nfields);
+	inputFS = strdup("");
 }
 
 void makefields(int n1, int n2)		/* create $n1..$n2 inclusive */



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

2020-04-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr 17 19:42:14 UTC 2020

Modified Files:
src/external/bsd/cron/dist: crontab.5

Log Message:
Move the range example (for 8-11) to follow the range definition, and to
preceed the random (?) discussion (and the corresponding random example)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/cron/dist/crontab.5

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/cron/dist/crontab.5
diff -u src/external/bsd/cron/dist/crontab.5:1.8 src/external/bsd/cron/dist/crontab.5:1.9
--- src/external/bsd/cron/dist/crontab.5:1.8	Fri Apr 17 18:39:31 2020
+++ src/external/bsd/cron/dist/crontab.5	Fri Apr 17 19:42:14 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: crontab.5,v 1.8 2020/04/17 18:39:31 christos Exp $
+.\" $NetBSD: crontab.5,v 1.9 2020/04/17 19:42:14 pgoyette Exp $
 .\"
 .\"/* Copyright 1988,1990,1993,1994 by Paul Vixie
 .\" * All rights reserved
@@ -141,6 +141,10 @@ or
 Ranges of numbers are allowed.
 Ranges are two numbers separated with a hyphen.
 The specified range is inclusive.
+For example,
+8\(en11 for an
+.Ar hour
+entry specifies execution at hours 8, 9, 10 and 11.
 .Pp
 A field may begin with a question mark
 .Pq Sq \&? ,
@@ -159,10 +163,6 @@ As just one example, this feature can be
 number of hosts from contacting a server simultaneously and
 overloading it by staggering the time at which a download script
 is executed.
-For example,
-8\(en11 for an
-.Ar hour
-entry specifies execution at hours 8, 9, 10 and 11.
 .Pp
 Step values can be used in conjunction with ranges (but not random ranges
 which represent a single number).



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

2020-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 17 18:39:31 UTC 2020

Modified Files:
src/external/bsd/cron/dist: crontab.5

Log Message:
Put back the ? syntax accidentally removed when syncing with the OpenBSD
man page.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/cron/dist/crontab.5

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/cron/dist/crontab.5
diff -u src/external/bsd/cron/dist/crontab.5:1.7 src/external/bsd/cron/dist/crontab.5:1.8
--- src/external/bsd/cron/dist/crontab.5:1.7	Fri Jun 15 19:15:56 2018
+++ src/external/bsd/cron/dist/crontab.5	Fri Apr 17 14:39:31 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: crontab.5,v 1.7 2018/06/15 23:15:56 wiz Exp $
+.\" $NetBSD: crontab.5,v 1.8 2020/04/17 18:39:31 christos Exp $
 .\"
 .\"/* Copyright 1988,1990,1993,1994 by Paul Vixie
 .\" * All rights reserved
@@ -21,7 +21,7 @@
 .\"
 .\" $OpenBSD: crontab.5,v 1.36 2018/06/13 13:27:37 jmc Exp $
 .\"
-.Dd June 14, 2018
+.Dd April 17, 2020
 .Dt CRONTAB 5
 .Os
 .Sh NAME
@@ -141,12 +141,31 @@ or
 Ranges of numbers are allowed.
 Ranges are two numbers separated with a hyphen.
 The specified range is inclusive.
+.Pp
+A field may begin with a question mark
+.Pq Sq \&? ,
+which indicates a single value randomly selected when the crontab
+file is read.
+If the field contains only a question mark, the value is randomly
+selected from the range of all possible values for the field.
+If the question mark precedes a range, the value is randomly selected
+from the range.
+For example,
+.Dq ? ?2-5 * * *
+specifies that a task will be performed daily between 2:00am and
+and 5:59am at a time randomly selected when the crontab file is
+first read.
+As just one example, this feature can be used to prevent a large
+number of hosts from contacting a server simultaneously and
+overloading it by staggering the time at which a download script
+is executed.
 For example,
 8\(en11 for an
 .Ar hour
 entry specifies execution at hours 8, 9, 10 and 11.
 .Pp
-Step values can be used in conjunction with ranges.
+Step values can be used in conjunction with ranges (but not random ranges
+which represent a single number).
 Following a range with
 .No / Ns Ar number
 specifies skips of



CVS commit: src/share/man/man9

2020-04-17 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Apr 17 17:43:38 UTC 2020

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

Log Message:
remove documentation for (non-atomic) boottime, it was eliminated
from kernel in 2020-01-02 by thorpej@


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/time_second.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/time_second.9
diff -u src/share/man/man9/time_second.9:1.7 src/share/man/man9/time_second.9:1.8
--- src/share/man/man9/time_second.9:1.7	Tue Oct 30 20:10:23 2018
+++ src/share/man/man9/time_second.9	Fri Apr 17 17:43:38 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: time_second.9,v 1.7 2018/10/30 20:10:23 kre Exp $
+.\" $NetBSD: time_second.9,v 1.8 2020/04/17 17:43:38 jdolecek Exp $
 .\"
 .\" Copyright (c) 1994 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,20 +32,17 @@
 .\"
 .\" <>
 .\"
-.Dd October 30, 2018
+.Dd April 17, 2020
 .Dt TIME_SECOND 9
 .Os
 .Sh NAME
 .Nm time_second ,
 .Nm time_uptime ,
-.Nm boottime
 .Nd system time variables
 .Sh SYNOPSIS
 .In sys/time.h
 .Vt extern time_t time_second;
 .Vt extern time_t time_uptime;
-.In sys/kernel.h
-.Vt extern struct timespec boottime;
 .Sh DESCRIPTION
 The
 .Va time_second
@@ -67,18 +64,8 @@ It is set at boot, and is updated period
 (It is not updated by
 .Xr settimeofday 2 . )
 .Pp
-The
-.Va boottime
-variable holds the system boot time.
-It is set at system boot, and is updated when the system time is adjusted
-with
-.Xr settimeofday 2 .
-The variable may be read and written without special precautions.
-.Pp
 All of these variables contain times
-expressed in seconds (and for
-.Va boottime ,
-nanoseconds) since midnight (0 hour),
+expressed in seconds since midnight (0 hour),
 January 1, 1970, UTC.
 .Pp
 The



CVS commit: src/sys/lib/libkern

2020-04-17 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 17 17:24:46 UTC 2020

Modified Files:
src/sys/lib/libkern: libkern.h

Log Message:
Slightly reorder for clarity, and add header.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/sys/lib/libkern/libkern.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/lib/libkern/libkern.h
diff -u src/sys/lib/libkern/libkern.h:1.139 src/sys/lib/libkern/libkern.h:1.140
--- src/sys/lib/libkern/libkern.h:1.139	Tue Apr  7 08:07:58 2020
+++ src/sys/lib/libkern/libkern.h	Fri Apr 17 17:24:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: libkern.h,v 1.139 2020/04/07 08:07:58 skrll Exp $	*/
+/*	$NetBSD: libkern.h,v 1.140 2020/04/17 17:24:46 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -38,6 +38,7 @@
 #include "opt_diagnostic.h"
 #include "opt_kasan.h"
 #include "opt_kcsan.h"
+#include "opt_kmsan.h"
 #endif
 
 #include 
@@ -360,7 +361,6 @@ tolower(int ch)
 void	*memcpy(void *, const void *, size_t);
 int	 memcmp(const void *, const void *, size_t);
 void	*memset(void *, int, size_t);
-void	*memmem(const void *, size_t, const void *, size_t);
 #if __GNUC_PREREQ__(2, 95) && !defined(_STANDALONE)
 #if defined(_KERNEL) && defined(KASAN)
 void	*kasan_memcpy(void *, const void *, size_t);
@@ -389,12 +389,11 @@ void	*kmsan_memset(void *, int, size_t);
 #define	memset(d, v, l)		__builtin_memset(d, v, l)
 #endif
 #endif
+void	*memmem(const void *, size_t, const void *, size_t);
 
 char	*strcpy(char *, const char *);
 int	 strcmp(const char *, const char *);
 size_t	 strlen(const char *);
-size_t	 strnlen(const char *, size_t);
-char	*strsep(char **, const char *);
 #if __GNUC_PREREQ__(2, 95) && !defined(_STANDALONE)
 #if defined(_KERNEL) && defined(KASAN)
 char	*kasan_strcpy(char *, const char *);
@@ -423,16 +422,18 @@ size_t	 kmsan_strlen(const char *);
 #define	strlen(a)		__builtin_strlen(a)
 #endif
 #endif
+size_t	 strnlen(const char *, size_t);
+char	*strsep(char **, const char *);
 
 /* Functions for which we always use built-ins. */
 #ifdef __GNUC__
 #define	alloca(s)		__builtin_alloca(s)
 #endif
 
+/* These exist in GCC 3.x, but we don't bother. */
 char	*strcat(char *, const char *);
 char	*strchr(const char *, int);
 char	*strrchr(const char *, int);
-/* These exist in GCC 3.x, but we don't bother. */
 #if defined(_KERNEL) && defined(KASAN)
 char	*kasan_strcat(char *, const char *);
 char	*kasan_strchr(const char *, int);
@@ -447,10 +448,6 @@ char	*kmsan_strrchr(const char *, int);
 #define	strcat(d, s)		kmsan_strcat(d, s)
 #define	strchr(s, c)		kmsan_strchr(s, c)
 #define	strrchr(s, c)		kmsan_strrchr(s, c)
-#else
-char	*strcat(char *, const char *);
-char	*strchr(const char *, int);
-char	*strrchr(const char *, int);
 #endif
 size_t	 strcspn(const char *, const char *);
 char	*strncpy(char *, const char *, size_t);



CVS commit: [phil-wifi] src/external/bsd/tmux/dist

2020-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr 17 16:18:09 UTC 2020

Modified Files:
src/external/bsd/tmux/dist [phil-wifi]: screen-write.c

Log Message:
Fix merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.3 -r1.8.4.4 src/external/bsd/tmux/dist/screen-write.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/tmux/dist/screen-write.c
diff -u src/external/bsd/tmux/dist/screen-write.c:1.8.4.3 src/external/bsd/tmux/dist/screen-write.c:1.8.4.4
--- src/external/bsd/tmux/dist/screen-write.c:1.8.4.3	Mon Apr 13 07:56:33 2020
+++ src/external/bsd/tmux/dist/screen-write.c	Fri Apr 17 16:18:09 2020
@@ -448,51 +448,6 @@ screen_write_menu(struct screen_write_ct
 	screen_write_set_cursor(ctx, cx, cy);
 }
 
-/* Draw a menu on screen. */
-void
-screen_write_menu(struct screen_write_ctx *ctx, struct menu *menu, int choice)
-{
-	struct screen		*s = ctx->s;
-	struct grid_cell	 gc;
-	u_int			 cx, cy, i, j;
-	const char		*name;
-
-	cx = s->cx;
-	cy = s->cy;
-
-	memcpy(, _default_cell, sizeof gc);
-
-	screen_write_box(ctx, menu->width + 4, menu->count + 2);
-	screen_write_cursormove(ctx, cx + 2, cy, 0);
-	format_draw(ctx, , menu->width, menu->title, NULL);
-
-	for (i = 0; i < menu->count; i++) {
-		name = menu->items[i].name;
-		if (name == NULL) {
-			screen_write_cursormove(ctx, cx, cy + 1 + i, 0);
-			screen_write_hline(ctx, menu->width + 4, 1, 1);
-		} else {
-			if (choice >= 0 && i == (u_int)choice && *name != '-')
-gc.attr |= GRID_ATTR_REVERSE;
-			screen_write_cursormove(ctx, cx + 2, cy + 1 + i, 0);
-			for (j = 0; j < menu->width; j++)
-screen_write_putc(ctx, , ' ');
-			screen_write_cursormove(ctx, cx + 2, cy + 1 + i, 0);
-			if (*name == '-') {
-name++;
-gc.attr |= GRID_ATTR_DIM;
-format_draw(ctx, , menu->width, name, NULL);
-gc.attr &= ~GRID_ATTR_DIM;
-			} else
-format_draw(ctx, , menu->width, name, NULL);
-			if (choice >= 0 && i == (u_int)choice)
-gc.attr &= ~GRID_ATTR_REVERSE;
-		}
-	}
-
-	screen_write_set_cursor(ctx, cx, cy);
-}
-
 /* Draw a box on screen. */
 void
 screen_write_box(struct screen_write_ctx *ctx, u_int nx, u_int ny)



CVS commit: src/include

2020-04-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Apr 17 15:22:35 UTC 2020

Modified Files:
src/include: assert.h

Log Message:
Remove the static_assert() fallback for pre-C11 and pre-C++11

C++ without real static_assert() can be incompatible with the C fallback
as presented in openjdk.

A pre-C11 compiler can be picky on the implementation.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/include/assert.h

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

Modified files:

Index: src/include/assert.h
diff -u src/include/assert.h:1.24 src/include/assert.h:1.25
--- src/include/assert.h:1.24	Mon May 27 07:31:11 2019
+++ src/include/assert.h	Fri Apr 17 15:22:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: assert.h,v 1.24 2019/05/27 07:31:11 kamil Exp $	*/
+/*	$NetBSD: assert.h,v 1.25 2020/04/17 15:22:34 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -105,10 +105,8 @@ void __diagassert13(const char *, int, c
 __END_DECLS
 #endif /* __ASSERT_DECLARED */
 
-#ifndef static_assert
 #if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L
+#ifndef static_assert
 #define static_assert _Static_assert
-#elif defined(_NETBSD_SOURCE) && (__cplusplus - 0) < 201103L
-#define static_assert(x, y) __CTASSERT(x)
 #endif /* static_assert */
 #endif



CVS commit: src/sys/sys

2020-04-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr 17 14:59:23 UTC 2020

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

Log Message:
Don't use typedef at all for __CTASSERT1.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/sys/cdefs.h

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

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.152 src/sys/sys/cdefs.h:1.153
--- src/sys/sys/cdefs.h:1.152	Fri Apr 17 14:33:42 2020
+++ src/sys/sys/cdefs.h	Fri Apr 17 14:59:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.152 2020/04/17 14:33:42 kamil Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.153 2020/04/17 14:59:23 joerg Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -172,10 +172,10 @@
 	   __CONCAT(_,b))
 #endif
 #define	__CTASSERT0(x, y, z)	__CTASSERT1(x, y, z)
-#define	__CTASSERT1(x, y, z)		\
-	typedef struct y ## z ## _struct __unused {			\
-		unsigned int y ## z : /*CONSTCOND*/(x) ? 1 : -1;	\
-	} y ## z ## _struct __unused
+#define	__CTASSERT1(x, y, z)	\
+	struct y ## z ## _struct { \
+		unsigned int y ## z : /*CONSTCOND*/(x) ? 1 : -1; \
+	}
 
 /*
  * The following macro is used to remove const cast-away warnings



CVS commit: src/distrib/utils/libhack

2020-04-17 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Apr 17 14:55:24 UTC 2020

Modified Files:
src/distrib/utils/libhack: Makefile.inc

Log Message:
include aligned_alloc(3), now needed for newfs and fsck_ffs


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/distrib/utils/libhack/Makefile.inc

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

Modified files:

Index: src/distrib/utils/libhack/Makefile.inc
diff -u src/distrib/utils/libhack/Makefile.inc:1.35 src/distrib/utils/libhack/Makefile.inc:1.36
--- src/distrib/utils/libhack/Makefile.inc:1.35	Sun Apr  5 11:18:02 2020
+++ src/distrib/utils/libhack/Makefile.inc	Fri Apr 17 14:55:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.35 2020/04/05 11:18:02 martin Exp $
+# $NetBSD: Makefile.inc,v 1.36 2020/04/17 14:55:24 jdolecek Exp $
 #
 # Include this fragment to build libhack.o
 # It is .o and not .a to make sure these are the
@@ -24,7 +24,8 @@ CPPFLAGS+=	-DLIBHACK
 HACKOBJS+=	getcap.o getgrent.o getnet.o getnetgr.o getpwent.o jemalloc.o \
 		localeconv.o multibyte.o perror.o runetable.o setlocale.o \
 		nl_langinfo.o strcasecmp.o \
-		strerror.o strsignal.o syslog.o utmp.o fmtcheck.o
+		strerror.o strsignal.o syslog.o utmp.o fmtcheck.o \
+	aligned_alloc.o
 
 .if (${USE_YP} != "no")
 HACKOBJS+=	yplib.o
@@ -90,6 +91,7 @@ localeconv.o:	${HACKSRC}/localeconv.c
 multibyte.o:	${HACKSRC}/multibyte.c
 perror.o:	${HACKSRC}/perror.c
 jemalloc.o:	${HACKSRC}/../../../lib/libc/stdlib/jemalloc.c
+aligned_alloc.o:	${HACKSRC}/../../../lib/libc/stdlib/aligned_alloc.c
 runetable.o:	${HACKSRC}/../../../lib/libc/locale/runetable.c
 setlocale.o:	${HACKSRC}/setlocale.c
 strerror.o:	${HACKSRC}/strerror.c



CVS commit: src/sys/sys

2020-04-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Apr 17 14:33:42 UTC 2020

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

Log Message:
Fix __CTASSERT1() in sys/cdefs.h for recent Clang/LLVM

Clang now implements a restriction on giving non-C-compatible anonymous
structs a typedef name for linkage purposes, as described in C++ committee
paper `P1766R1 '.

https://reviews.llvm.org/D74103


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/sys/cdefs.h

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

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.151 src/sys/sys/cdefs.h:1.152
--- src/sys/sys/cdefs.h:1.151	Sat Mar 21 22:45:47 2020
+++ src/sys/sys/cdefs.h	Fri Apr 17 14:33:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.151 2020/03/21 22:45:47 kamil Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.152 2020/04/17 14:33:42 kamil Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -172,9 +172,9 @@
 	   __CONCAT(_,b))
 #endif
 #define	__CTASSERT0(x, y, z)	__CTASSERT1(x, y, z)
-#define	__CTASSERT1(x, y, z)	\
-	typedef struct { \
-		unsigned int y ## z : /*CONSTCOND*/(x) ? 1 : -1; \
+#define	__CTASSERT1(x, y, z)		\
+	typedef struct y ## z ## _struct __unused {			\
+		unsigned int y ## z : /*CONSTCOND*/(x) ? 1 : -1;	\
 	} y ## z ## _struct __unused
 
 /*



CVS commit: src/sys

2020-04-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr 17 14:19:44 UTC 2020

Modified Files:
src/sys/arch/alpha/include: asm.h
src/sys/arch/amd64/include: asm.h
src/sys/arch/arm/include: asm.h
src/sys/arch/hppa/include: asm.h
src/sys/arch/i386/include: asm.h
src/sys/arch/ia64/include: asm.h
src/sys/arch/m68k/include: asm.h
src/sys/arch/mips/include: asm.h
src/sys/arch/or1k/include: asm.h
src/sys/arch/powerpc/include: asm.h
src/sys/arch/riscv/include: asm.h
src/sys/arch/sh3/include: asm.h
src/sys/arch/sparc/include: asm.h
src/sys/arch/vax/include: asm.h
src/sys/sys: cdefs_elf.h

Log Message:
Mark the .ident section as mergable string section to avoid redundant
entries.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/include/asm.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amd64/include/asm.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/include/asm.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hppa/include/asm.h
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/include/asm.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/include/asm.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/m68k/include/asm.h
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/mips/include/asm.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/or1k/include/asm.h
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/powerpc/include/asm.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/include/asm.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sh3/include/asm.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sparc/include/asm.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/vax/include/asm.h
cvs rdiff -u -r1.55 -r1.56 src/sys/sys/cdefs_elf.h

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

Modified files:

Index: src/sys/arch/alpha/include/asm.h
diff -u src/sys/arch/alpha/include/asm.h:1.36 src/sys/arch/alpha/include/asm.h:1.37
--- src/sys/arch/alpha/include/asm.h:1.36	Sat Jan 14 21:58:17 2017
+++ src/sys/arch/alpha/include/asm.h	Fri Apr 17 14:19:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: asm.h,v 1.36 2017/01/14 21:58:17 christos Exp $ */
+/* $NetBSD: asm.h,v 1.37 2020/04/17 14:19:43 joerg Exp $ */
 
 /*
  * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@@ -643,7 +643,9 @@ label:	ASCIZ msg;		\
  * Kernel RCS ID tag and copyright macros
  */
 #define	__SECTIONSTRING(_sec, _str)\
-	.pushsection _sec ; .asciz _str ; .popsection
+	.pushsection _sec,"MS",@progbits,1;			\
+	.asciz x;		\
+	.popsection
 
 #ifdef _KERNEL
 

Index: src/sys/arch/amd64/include/asm.h
diff -u src/sys/arch/amd64/include/asm.h:1.19 src/sys/arch/amd64/include/asm.h:1.20
--- src/sys/arch/amd64/include/asm.h:1.19	Thu May 22 14:59:01 2014
+++ src/sys/arch/amd64/include/asm.h	Fri Apr 17 14:19:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.19 2014/05/22 14:59:01 uebayasi Exp $	*/
+/*	$NetBSD: asm.h,v 1.20 2020/04/17 14:19:43 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -112,7 +112,9 @@
 
 #define	ASMSTR		.asciz
 
-#define RCSID(x)	.pushsection ".ident"; .asciz x; .popsection
+#define RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
+			.asciz x;	\
+			.popsection
 
 #define	WEAK_ALIAS(alias,sym)		\
 	.weak alias;			\

Index: src/sys/arch/arm/include/asm.h
diff -u src/sys/arch/arm/include/asm.h:1.31 src/sys/arch/arm/include/asm.h:1.32
--- src/sys/arch/arm/include/asm.h:1.31	Mon Apr 13 05:40:25 2020
+++ src/sys/arch/arm/include/asm.h	Fri Apr 17 14:19:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.31 2020/04/13 05:40:25 maxv Exp $	*/
+/*	$NetBSD: asm.h,v 1.32 2020/04/17 14:19:43 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -221,7 +221,9 @@
 #define	PIC_SYM(x,y)	x
 #endif	/* __PIC__ */
 
-#define RCSID(x)	.pushsection ".ident"; .asciz x; .popsection
+#define RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
+			.asciz x;	\
+			.popsection
 
 #define	WEAK_ALIAS(alias,sym)		\
 	.weak alias;			\

Index: src/sys/arch/hppa/include/asm.h
diff -u src/sys/arch/hppa/include/asm.h:1.16 src/sys/arch/hppa/include/asm.h:1.17
--- src/sys/arch/hppa/include/asm.h:1.16	Tue Apr 16 12:25:17 2019
+++ src/sys/arch/hppa/include/asm.h	Fri Apr 17 14:19:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.16 2019/04/16 12:25:17 skrll Exp $	*/
+/*	$NetBSD: asm.h,v 1.17 2020/04/17 14:19:43 joerg Exp $	*/
 
 /*	$OpenBSD: asm.h,v 1.12 2001/03/29 02:15:57 mickey Exp $	*/
 
@@ -99,8 +99,8 @@
 #define ALTENTRY(x) ! .export x, entry ! .label x
 #define EXIT(x) ! .exit ! .procend ! .size x, .-x
 
-#define RCSID(x)	.pushsection ".ident"		!\
-			.asciz x			!\
+#define RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
+			.asciz x;	\
 			.popsection
 
 #define WEAK_ALIAS(alias,sym)\

Index: src/sys/arch/i386/include/asm.h
diff -u src/sys/arch/i386/include/asm.h:1.42 src/sys/arch/i386/include/asm.h:1.43
--- 

CVS commit: [phil-wifi] src/sys/dev/usb

2020-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr 17 13:44:38 UTC 2020

Modified Files:
src/sys/dev/usb [phil-wifi]: if_urtwn.c

Log Message:
Make it compilable with URTWN_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.59.2.11 -r1.59.2.12 src/sys/dev/usb/if_urtwn.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_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.59.2.11 src/sys/dev/usb/if_urtwn.c:1.59.2.12
--- src/sys/dev/usb/if_urtwn.c:1.59.2.11	Thu Apr 16 17:24:49 2020
+++ src/sys/dev/usb/if_urtwn.c	Fri Apr 17 13:44:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.59.2.11 2020/04/16 17:24:49 nat Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.59.2.12 2020/04/17 13:44:37 martin Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.59.2.11 2020/04/16 17:24:49 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.59.2.12 2020/04/17 13:44:37 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3452,7 +3452,9 @@ urtwn_parent(struct ieee80211com *ic)
 static void
 urtwn_scan_start(struct ieee80211com *ic)
 {
-	//struct urtwn_softc *sc = ic->ic_softc;
+#ifdef URTWN_DEBUG
+	struct urtwn_softc *sc = ic->ic_softc;
+#endif
 	//uint32_t reg;
 	//int s;
 
@@ -3515,7 +3517,9 @@ urtwn_scan_start(struct ieee80211com *ic
 static void
 urtwn_scan_end(struct ieee80211com *ic)
 {
-	//struct urtwn_softc *sc = ic->ic_softc;
+#ifdef URTWN_DEBUG
+	struct urtwn_softc *sc = ic->ic_softc;
+#endif
 
 	DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__));
 



CVS commit: src

2020-04-17 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Fri Apr 17 13:36:49 UTC 2020

Modified Files:
src/share/man/man5: ifconfig.if.5
src/usr.sbin/rtsold: rtsold.8

Log Message:
Update date


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/share/man/man5/ifconfig.if.5
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/rtsold/rtsold.8

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/man5/ifconfig.if.5
diff -u src/share/man/man5/ifconfig.if.5:1.19 src/share/man/man5/ifconfig.if.5:1.20
--- src/share/man/man5/ifconfig.if.5:1.19	Wed Apr 15 20:31:57 2020
+++ src/share/man/man5/ifconfig.if.5	Fri Apr 17 13:36:48 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.if.5,v 1.19 2020/04/15 20:31:57 kim Exp $
+.\"	$NetBSD: ifconfig.if.5,v 1.20 2020/04/17 13:36:48 kim Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd December 18, 2014
+.Dd April 15, 2020
 .Dt IFCONFIG.IF 5
 .Os
 .Sh NAME

Index: src/usr.sbin/rtsold/rtsold.8
diff -u src/usr.sbin/rtsold/rtsold.8:1.41 src/usr.sbin/rtsold/rtsold.8:1.42
--- src/usr.sbin/rtsold/rtsold.8:1.41	Thu Apr 16 07:23:58 2020
+++ src/usr.sbin/rtsold/rtsold.8	Fri Apr 17 13:36:49 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rtsold.8,v 1.41 2020/04/16 07:23:58 wiz Exp $
+.\"	$NetBSD: rtsold.8,v 1.42 2020/04/17 13:36:49 kim Exp $
 .\"	$KAME: rtsold.8,v 1.17 2001/07/09 22:30:37 itojun Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -28,7 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 12, 2014
+.Dd April 15, 2020
 .Dt RTSOLD 8
 .Os
 .\"



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

2020-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr 17 11:21:06 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Fix build after PV locking change


To generate a diff of this commit:
cvs rdiff -u -r1.406 -r1.407 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.406 src/sys/arch/arm/arm32/pmap.c:1.407
--- src/sys/arch/arm/arm32/pmap.c:1.406	Fri Apr 17 08:17:06 2020
+++ src/sys/arch/arm/arm32/pmap.c	Fri Apr 17 11:21:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.406 2020/04/17 08:17:06 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.407 2020/04/17 11:21:06 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -198,7 +198,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.406 2020/04/17 08:17:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.407 2020/04/17 11:21:06 skrll Exp $");
 
 #include 
 #include 
@@ -2413,7 +2413,7 @@ pmap_clearbit(struct vm_page_md *md, pad
 		/*
 		 * Kernel entries are unmanaged and as such not to be changed.
 		 */
-		if (PV_IS_KENTRY_P(oflags))
+		if (PV_IS_KENTRY_P(oflags)) {
 			pv = SLIST_NEXT(pv, pv_link);
 			continue;
 		}



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

2020-04-17 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Apr 17 10:35:06 UTC 2020

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

Log Message:
constify xbddkdriver


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.117 src/sys/arch/xen/xen/xbd_xenbus.c:1.118
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.117	Fri Apr 17 10:32:19 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Fri Apr 17 10:35:06 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.117 2020/04/17 10:32:19 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.118 2020/04/17 10:35:06 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.117 2020/04/17 10:32:19 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.118 2020/04/17 10:35:06 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -250,7 +250,7 @@ const struct cdevsw xbd_cdevsw = {
 
 extern struct cfdriver xbd_cd;
 
-static struct dkdriver xbddkdriver = {
+static const struct dkdriver xbddkdriver = {
 .d_strategy = xbdstrategy,
 	.d_minphys = xbdminphys,
 	.d_open = xbdopen,



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

2020-04-17 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Apr 17 10:32:19 UTC 2020

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

Log Message:
remove some old #if 0 code


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.116 src/sys/arch/xen/xen/xbd_xenbus.c:1.117
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.116	Thu Apr 16 16:38:43 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Fri Apr 17 10:32:19 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.116 2020/04/16 16:38:43 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.117 2020/04/17 10:32:19 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.116 2020/04/16 16:38:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.117 2020/04/17 10:32:19 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -186,12 +186,6 @@ struct xbd_xenbus_softc {
 	struct evcnt sc_cnt_indirect;
 };
 
-#if 0
-/* too big to be on stack */
-static multicall_entry_t rq_mcl[XBD_RING_SIZE+1];
-static paddr_t rq_pages[XBD_RING_SIZE];
-#endif
-
 static int  xbd_xenbus_match(device_t, cfdata_t, void *);
 static void xbd_xenbus_attach(device_t, device_t, void *);
 static int  xbd_xenbus_detach(device_t, int);



CVS commit: src/sbin/fsck_ffs

2020-04-17 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Apr 17 09:42:27 UTC 2020

Modified Files:
src/sbin/fsck_ffs: inode.c setup.c utilities.c

Log Message:
align buffers used for I/O to DEV_BSIZE so it's executed more optimally
when run for xbd(4) raw (character) device


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sbin/fsck_ffs/inode.c
cvs rdiff -u -r1.102 -r1.103 src/sbin/fsck_ffs/setup.c
cvs rdiff -u -r1.65 -r1.66 src/sbin/fsck_ffs/utilities.c

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

Modified files:

Index: src/sbin/fsck_ffs/inode.c
diff -u src/sbin/fsck_ffs/inode.c:1.72 src/sbin/fsck_ffs/inode.c:1.73
--- src/sbin/fsck_ffs/inode.c:1.72	Wed Feb  8 16:11:40 2017
+++ src/sbin/fsck_ffs/inode.c	Fri Apr 17 09:42:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: inode.c,v 1.72 2017/02/08 16:11:40 rin Exp $	*/
+/*	$NetBSD: inode.c,v 1.73 2020/04/17 09:42:27 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)inode.c	8.8 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: inode.c,v 1.72 2017/02/08 16:11:40 rin Exp $");
+__RCSID("$NetBSD: inode.c,v 1.73 2020/04/17 09:42:27 jdolecek Exp $");
 #endif
 #endif /* not lint */
 
@@ -463,7 +463,7 @@ setinodebuf(ino_t inum)
 		partialsize = inobufsize;
 	}
 	if (inodebuf == NULL &&
-	(inodebuf = malloc((unsigned)inobufsize)) == NULL)
+	(inodebuf = aligned_alloc(DEV_BSIZE, (unsigned)inobufsize)) == NULL)
 		errexit("Cannot allocate space for inode buffer");
 }
 

Index: src/sbin/fsck_ffs/setup.c
diff -u src/sbin/fsck_ffs/setup.c:1.102 src/sbin/fsck_ffs/setup.c:1.103
--- src/sbin/fsck_ffs/setup.c:1.102	Fri Oct  5 09:49:23 2018
+++ src/sbin/fsck_ffs/setup.c	Fri Apr 17 09:42:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: setup.c,v 1.102 2018/10/05 09:49:23 hannken Exp $	*/
+/*	$NetBSD: setup.c,v 1.103 2020/04/17 09:42:27 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)setup.c	8.10 (Berkeley) 5/9/95";
 #else
-__RCSID("$NetBSD: setup.c,v 1.102 2018/10/05 09:49:23 hannken Exp $");
+__RCSID("$NetBSD: setup.c,v 1.103 2020/04/17 09:42:27 jdolecek Exp $");
 #endif
 #endif /* not lint */
 
@@ -126,10 +126,10 @@ setup(const char *dev, const char *origd
 	lfdir = 0;
 	initbarea();
 	initbarea();
-	sblk.b_un.b_buf = malloc(SBLOCKSIZE);
-	sblock = malloc(SBLOCKSIZE);
-	asblk.b_un.b_buf = malloc(SBLOCKSIZE);
-	altsblock = malloc(SBLOCKSIZE);
+	sblk.b_un.b_buf = aligned_alloc(DEV_BSIZE, SBLOCKSIZE);
+	sblock = aligned_alloc(DEV_BSIZE, SBLOCKSIZE);
+	asblk.b_un.b_buf = aligned_alloc(DEV_BSIZE, SBLOCKSIZE);
+	altsblock = aligned_alloc(DEV_BSIZE, SBLOCKSIZE);
 	if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL ||
 		sblock == NULL || altsblock == NULL)
 		errexit("Cannot allocate space for superblock");
@@ -458,12 +458,14 @@ setup(const char *dev, const char *origd
 	 * read in the summary info.
 	 */
 	asked = 0;
-	sblock->fs_csp = (struct csum *)calloc(1, sblock->fs_cssize);
+	sblock->fs_csp = (struct csum *)aligned_alloc(DEV_BSIZE,
+	sblock->fs_cssize);
 	if (sblock->fs_csp == NULL) {
 		pwarn("cannot alloc %u bytes for summary info\n",
 		sblock->fs_cssize);	
 		goto badsblabel;
 	}
+	memset(sblock->fs_csp, 0, sblock->fs_cssize);
 	for (i = 0, j = 0; i < sblock->fs_cssize; i += sblock->fs_bsize, j++) {
 		size = sblock->fs_cssize - i < sblock->fs_bsize ?
 		sblock->fs_cssize - i : sblock->fs_bsize;
@@ -492,12 +494,13 @@ setup(const char *dev, const char *origd
 	 * allocate and initialize the necessary maps
 	 */
 	bmapsize = roundup(howmany(maxfsblock, NBBY), sizeof(int16_t));
-	blockmap = calloc((unsigned)bmapsize, sizeof (char));
+	blockmap = aligned_alloc(DEV_BSIZE, (unsigned)bmapsize);
 	if (blockmap == NULL) {
 		pwarn("cannot alloc %u bytes for blockmap\n",
 		(unsigned)bmapsize);
 		goto badsblabel;
 	}
+	memset(blockmap, 0, bmapsize);
 	inostathead = calloc((unsigned)(sblock->fs_ncg),
 	sizeof(struct inostatlist));
 	if (inostathead == NULL) {
@@ -526,7 +529,7 @@ setup(const char *dev, const char *origd
 		(unsigned)(numdirs * sizeof(struct inoinfo *)));
 		goto badsblabel;
 	}
-	cgrp = malloc(sblock->fs_cgsize);
+	cgrp = aligned_alloc(DEV_BSIZE, sblock->fs_cgsize);
 	if (cgrp == NULL) {
 		pwarn("cannot alloc %u bytes for cylinder group\n",
 		sblock->fs_cgsize);

Index: src/sbin/fsck_ffs/utilities.c
diff -u src/sbin/fsck_ffs/utilities.c:1.65 src/sbin/fsck_ffs/utilities.c:1.66
--- src/sbin/fsck_ffs/utilities.c:1.65	Wed Feb  8 16:11:40 2017
+++ src/sbin/fsck_ffs/utilities.c	Fri Apr 17 09:42:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: utilities.c,v 1.65 2017/02/08 16:11:40 rin Exp $	*/
+/*	$NetBSD: utilities.c,v 1.66 2020/04/17 09:42:27 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utilities.c	8.6 (Berkeley) 5/19/95";
 #else
-__RCSID("$NetBSD: utilities.c,v 1.65 

CVS commit: src/sbin/newfs

2020-04-17 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Apr 17 09:33:37 UTC 2020

Modified Files:
src/sbin/newfs: mkfs.c newfs.c

Log Message:
align buffers used for I/O to DEV_BSIZE so it's executed more optimally
when run for xbd(4) device


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sbin/newfs/mkfs.c
cvs rdiff -u -r1.115 -r1.116 src/sbin/newfs/newfs.c

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

Modified files:

Index: src/sbin/newfs/mkfs.c
diff -u src/sbin/newfs/mkfs.c:1.128 src/sbin/newfs/mkfs.c:1.129
--- src/sbin/newfs/mkfs.c:1.128	Wed Feb  8 16:11:40 2017
+++ src/sbin/newfs/mkfs.c	Fri Apr 17 09:33:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs.c,v 1.128 2017/02/08 16:11:40 rin Exp $	*/
+/*	$NetBSD: mkfs.c,v 1.129 2020/04/17 09:33:37 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
 #if 0
 static char sccsid[] = "@(#)mkfs.c	8.11 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: mkfs.c,v 1.128 2017/02/08 16:11:40 rin Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.129 2020/04/17 09:33:37 jdolecek Exp $");
 #endif
 #endif /* not lint */
 
@@ -200,10 +200,12 @@ mkfs(const char *fsys, int fi, int fo,
 			exit(12);
 	}
 #endif
-	if ((fsun = calloc(1, sizeof(*fsun))) == NULL)
+	if ((fsun = aligned_alloc(DEV_BSIZE, sizeof(*fsun))) == NULL)
 		exit(12);
-	if ((cgun = calloc(1, sizeof(*cgun))) == NULL)
+	memset(fsun, 0, sizeof(*fsun));
+	if ((cgun = aligned_alloc(DEV_BSIZE, sizeof(*cgun))) == NULL)
 		exit(12);
+	memset(cgun, 0, sizeof(*cgun));
 
 	fsi = fi;
 	fso = fo;
@@ -633,7 +635,7 @@ mkfs(const char *fsys, int fi, int fo,
 
 #ifndef NO_APPLE_UFS
 		if (isappleufs) {
-			struct appleufslabel appleufs;
+			struct appleufslabel appleufs __aligned(DEV_BSIZE);
 			ffs_appleufs_set(, appleufs_volname,
 			tv.tv_sec, 0);
 			wtfs(APPLEUFS_LABEL_OFFSET/sectorsize,
@@ -1034,7 +1036,7 @@ int
 fsinit(const struct timeval *tv, mode_t mfsmode, uid_t mfsuid, gid_t mfsgid)
 {
 	union dinode node;
-	union Buffer buf;
+	union Buffer buf __aligned(DEV_BSIZE);
 	int i;
 	int qblocks = 0;
 	int qinos = 0;
@@ -1584,7 +1586,7 @@ static void
 zap_old_sblock(int sblkoff)
 {
 	static int cg0_data;
-	uint32_t oldfs[SBLOCKSIZE / 4];
+	uint32_t oldfs[SBLOCKSIZE / 4] __aligned(DEV_BSIZE);
 	static const struct fsm {
 		uint32_t	offset;
 		uint32_t	magic;

Index: src/sbin/newfs/newfs.c
diff -u src/sbin/newfs/newfs.c:1.115 src/sbin/newfs/newfs.c:1.116
--- src/sbin/newfs/newfs.c:1.115	Wed Feb  8 16:11:40 2017
+++ src/sbin/newfs/newfs.c	Fri Apr 17 09:33:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs.c,v 1.115 2017/02/08 16:11:40 rin Exp $	*/
+/*	$NetBSD: newfs.c,v 1.116 2020/04/17 09:33:37 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1993, 1994
@@ -78,7 +78,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)newfs.c	8.13 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: newfs.c,v 1.115 2017/02/08 16:11:40 rin Exp $");
+__RCSID("$NetBSD: newfs.c,v 1.116 2020/04/17 09:33:37 jdolecek Exp $");
 #endif
 #endif /* not lint */
 
@@ -619,9 +619,10 @@ main(int argc, char *argv[])
 		} else
 			bufsize = sfs.f_iosize;
 
-		if ((buf = calloc(1, bufsize)) == NULL)
+		if ((buf = aligned_alloc(DEV_BSIZE, bufsize)) == NULL)
 			err(1, "can't malloc buffer of %d",
 			bufsize);
+		memset(buf, 0, bufsize);
 		bufrem = fssize * sectorsize;
 		if (verbosity > 0)
 			printf( "Creating file system image in `%s', "



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

2020-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr 17 08:17:06 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Use UVMHIST_CALLARGS


To generate a diff of this commit:
cvs rdiff -u -r1.405 -r1.406 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.405 src/sys/arch/arm/arm32/pmap.c:1.406
--- src/sys/arch/arm/arm32/pmap.c:1.405	Thu Apr 16 21:20:43 2020
+++ src/sys/arch/arm/arm32/pmap.c	Fri Apr 17 08:17:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.405 2020/04/16 21:20:43 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.406 2020/04/17 08:17:06 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -198,7 +198,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.405 2020/04/16 21:20:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.406 2020/04/17 08:17:06 skrll Exp $");
 
 #include 
 #include 
@@ -3133,9 +3133,8 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_
 	struct pv_entry *old_pv = NULL;
 	int error = 0;
 
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
-
-	UVMHIST_LOG(maphist, " (pm %#jx va %#jx pa %#jx prot %#jx",
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, "pm %#jx va %#jx pa %#jx prot %#jx",
 	(uintptr_t)pm, va, pa, prot);
 	UVMHIST_LOG(maphist, "  flag %#jx", flags, 0, 0, 0);
 
@@ -3503,8 +3502,8 @@ pmap_remove(pmap_t pm, vaddr_t sva, vadd
 {
 	SLIST_HEAD(,pv_entry) opv_list;
 	struct pv_entry *pv, *npv;
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
-	UVMHIST_LOG(maphist, " (pm=%#jx, sva=%#jx, eva=%#jx)",
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, " (pm=%#jx, sva=%#jx, eva=%#jx)",
 	(uintptr_t)pm, sva, eva, 0);
 
 #ifdef PMAP_FAULTINFO
@@ -3751,9 +3750,9 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 	UVMHIST_FUNC(__func__);
 
 	if (pmap_initialized) {
-		UVMHIST_CALLED(maphist);
-		UVMHIST_LOG(maphist, " (va=%#jx, pa=%#jx, prot=%#jx, flags=%#jx",
-		va, pa, prot, flags);
+		UVMHIST_CALLARGS(maphist,
+		"va=%#jx, pa=%#jx, prot=%#jx, flags=%#jx", va, pa, prot,
+		 flags);
 	}
 
 	pmap_t kpm = pmap_kernel();
@@ -3908,9 +3907,8 @@ pmap_kremove(vaddr_t va, vsize_t len)
 
 	PMAPCOUNT(kenter_unmappings);
 
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
-
-	UVMHIST_LOG(maphist, " (va=%#jx, len=%#jx)", va, len, 0, 0);
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, " (va=%#jx, len=%#jx)", va, len, 0, 0);
 
 	const vaddr_t eva = va + len;
 	pmap_t kpm = pmap_kernel();
@@ -4425,14 +4423,14 @@ pmap_fault_fixup(pmap_t pm, vaddr_t va, 
 	const size_t l1slot = l1pte_index(va);
 	int rv = 0;
 
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, "pm=%#jx, va=%#jx, ftype=%#jx, user=%jd",
+	(uintptr_t)pm, va, ftype, user);
 
 	va = trunc_page(va);
 
 	KASSERT(!user || (pm != pmap_kernel()));
 
-	UVMHIST_LOG(maphist, " (pm=%#jx, va=%#jx, ftype=%#jx, user=%jd)",
-	(uintptr_t)pm, va, ftype, user);
 #ifdef ARM_MMU_EXTENDED
 	UVMHIST_LOG(maphist, " ti=%#jx pai=%#jx asid=%#jx",
 	(uintptr_t)cpu_tlb_info(curcpu()),
@@ -4897,7 +4895,12 @@ pmap_unwire(pmap_t pm, vaddr_t va)
 void
 pmap_md_pdetab_activate(pmap_t pm, struct lwp *l)
 {
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
+	UVMHIST_FUNC(__func__);
+	struct cpu_info * const ci = curcpu();
+	struct pmap_asid_info * const pai = PMAP_PAI(pm, cpu_tlb_info(ci));
+
+	UVMHIST_CALLARGS(maphist, "pm %#jx (pm->pm_l1_pa %08jx asid %ju)",
+	(uintptr_t)pm, pm->pm_l1_pa, pai->pai_asid, 0);
 
 	/*
 	 * Assume that TTBR1 has only global mappings and TTBR0 only
@@ -4912,9 +4915,6 @@ pmap_md_pdetab_activate(pmap_t pm, struc
 
 	pmap_tlb_asid_acquire(pm, l);
 
-	struct cpu_info * const ci = curcpu();
-	struct pmap_asid_info * const pai = PMAP_PAI(pm, cpu_tlb_info(ci));
-
 	cpu_setttb(pm->pm_l1_pa, pai->pai_asid);
 	/*
 	 * Now we can reenable tablewalks since the CONTEXTIDR and TTRB0
@@ -4939,7 +4939,8 @@ void
 pmap_md_pdetab_deactivate(pmap_t pm)
 {
 
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, "pm %#jx", (uintptr_t)pm, 0, 0, 0);
 
 	kpreempt_disable();
 	struct cpu_info * const ci = curcpu();
@@ -4967,10 +4968,9 @@ pmap_activate(struct lwp *l)
 	extern int block_userspace_access;
 	pmap_t npm = l->l_proc->p_vmspace->vm_map.pmap;
 
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
-
-	UVMHIST_LOG(maphist, "(l=%#jx) pm=%#jx", (uintptr_t)l, (uintptr_t)npm,
-	0, 0);
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, "l=%#jx pm=%#jx", (uintptr_t)l,
+	(uintptr_t)npm, 0, 0);
 
 	struct cpu_info * const ci = curcpu();
 
@@ -5125,10 +5125,9 @@ pmap_deactivate(struct lwp *l)
 {
 	pmap_t pm = l->l_proc->p_vmspace->vm_map.pmap;
 
-	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
-
-	UVMHIST_LOG(maphist, "(l=%#jx) pm=%#jx", (uintptr_t)l, (uintptr_t)pm,
-	

CVS commit: src/sys/dev/audio

2020-04-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Apr 17 07:48:35 UTC 2020

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

Log Message:
Improve diagnostic messages.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/audio/audio.c

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

Modified files:

Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.65 src/sys/dev/audio/audio.c:1.66
--- src/sys/dev/audio/audio.c:1.65	Thu Mar 26 13:32:03 2020
+++ src/sys/dev/audio/audio.c	Fri Apr 17 07:48:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.65 2020/03/26 13:32:03 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.66 2020/04/17 07:48:35 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.65 2020/03/26 13:32:03 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.66 2020/04/17 07:48:35 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -5468,7 +5468,9 @@ audio_pintr(void *arg)
 		return;
 	if (sc->sc_pbusy == false) {
 #if defined(DIAGNOSTIC)
-		device_printf(sc->sc_dev, "stray interrupt\n");
+		device_printf(sc->sc_dev,
+		"DIAGNOSTIC: %s raised stray interrupt\n",
+		device_xname(sc->hw_dev));
 #endif
 		return;
 	}
@@ -5737,7 +5739,9 @@ audio_rintr(void *arg)
 		return;
 	if (sc->sc_rbusy == false) {
 #if defined(DIAGNOSTIC)
-		device_printf(sc->sc_dev, "stray interrupt\n");
+		device_printf(sc->sc_dev,
+		"DIAGNOSTIC: %s raised stray interrupt\n",
+		device_xname(sc->hw_dev));
 #endif
 		return;
 	}