Re: CVS commit: src/distrib/sets/lists/base

2019-06-30 Thread Masanobu SAITOH
On 2019/07/01 13:08, Masanobu SAITOH wrote:
> Hi.
> 
> On 2019/07/01 7:15, Brett Lymn wrote:
>> Module Name: src
>> Committed By:blymn
>> Date:Sun Jun 30 22:15:06 UTC 2019
>>
>> Modified Files:
>>  src/distrib/sets/lists/base: shl.mi
>>
>> Log Message:
>> Bump libcurses major and all dependent libraries.
>>
>>
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.865 -r1.866 src/distrib/sets/lists/base/shl.mi
>>
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
>>
> 
> This changed libcurses.so from 7.2 to 8.2.
> Is that a mistake of 8.0?
> 

And also please add new libraries to distrib/sets/lists/debug/shl.mi

See:
http://releng.netbsd.org/cgi-bin/builds.cgi

"Currently building tag: HEAD started at Sun Jun 30 23:35:01 UTC 2019 
65 failed so far "

On amd64:
> ===  8 extra files in DESTDIR  =
> Files in DESTDIR but missing from flist.
> File is obsolete or flist is out of date ?
> --
> ./usr/libdata/debug/usr/lib/i386/libcurses.so.8.2.debug
> ./usr/libdata/debug/usr/lib/i386/libform.so.7.0.debug
> ./usr/libdata/debug/usr/lib/i386/libmenu.so.7.0.debug
> ./usr/libdata/debug/usr/lib/i386/libpanel.so.2.0.debug
> ./usr/libdata/debug/usr/lib/libcurses.so.8.2.debug
> ./usr/libdata/debug/usr/lib/libform.so.7.0.debug
> ./usr/libdata/debug/usr/lib/libmenu.so.7.0.debug
> ./usr/libdata/debug/usr/lib/libpanel.so.2.0.debug
> =  end of 8 extra files  ===
> ==  8 missing files in DESTDIR  
> Files in flist but missing from DESTDIR.
> File wasn't installed ?
> --
> ./usr/libdata/debug/usr/lib/i386/libcurses.so.7.2.debug
> ./usr/libdata/debug/usr/lib/i386/libform.so.6.0.debug
> ./usr/libdata/debug/usr/lib/i386/libmenu.so.6.0.debug
> ./usr/libdata/debug/usr/lib/i386/libpanel.so.1.0.debug
> ./usr/libdata/debug/usr/lib/libcurses.so.7.2.debug
> ./usr/libdata/debug/usr/lib/libform.so.6.0.debug
> ./usr/libdata/debug/usr/lib/libmenu.so.6.0.debug
> ./usr/libdata/debug/usr/lib/libpanel.so.1.0.debug
>   end of 8 missing files  ==


-- 
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/distrib/sets/lists/base

2019-06-30 Thread Masanobu SAITOH
Hi.

On 2019/07/01 7:15, Brett Lymn wrote:
> Module Name:  src
> Committed By: blymn
> Date: Sun Jun 30 22:15:06 UTC 2019
> 
> Modified Files:
>   src/distrib/sets/lists/base: shl.mi
> 
> Log Message:
> Bump libcurses major and all dependent libraries.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.865 -r1.866 src/distrib/sets/lists/base/shl.mi
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

This changed libcurses.so from 7.2 to 8.2.
Is that a mistake of 8.0?

-- 
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


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

2019-06-30 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jul  1 02:04:38 UTC 2019

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

Log Message:
Avoid GCC warning on NetBSD/i386

Cast note_hdr.n_namesz to ssize_t through size_t to avoid potential
signedness bit shifts.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 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.130 src/tests/lib/libc/sys/t_ptrace_wait.c:1.131
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.130	Sun Jun 30 21:20:04 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Mon Jul  1 02:04:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.130 2019/06/30 21:20:04 mgorny Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.131 2019/07/01 02:04:37 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.130 2019/06/30 21:20:04 mgorny Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.131 2019/07/01 02:04:37 kamil Exp $");
 
 #include 
 #include 
@@ -7706,7 +7706,7 @@ static ssize_t core_find_note(const char
 			note_hdr.n_namesz <= sizeof(name_buf)) {
 SYSCALL_REQUIRE(pread(core_fd, name_buf,
 note_hdr.n_namesz, offset)
-== note_hdr.n_namesz);
+== (ssize_t)(size_t)note_hdr.n_namesz);
 
 if (!strncmp(note_name, name_buf, name_len) &&
 note_hdr.n_type == note_type)



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

2019-06-30 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jul  1 02:04:38 UTC 2019

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

Log Message:
Avoid GCC warning on NetBSD/i386

Cast note_hdr.n_namesz to ssize_t through size_t to avoid potential
signedness bit shifts.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 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.



CVS commit: src/sys/ufs/ufs

2019-06-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul  1 00:57:06 UTC 2019

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
Lay down some comments related to the previous few revisions of ufs_vnops.c.


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 src/sys/ufs/ufs/ufs_vnops.c

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



CVS commit: src/sys/ufs/ufs

2019-06-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul  1 00:57:06 UTC 2019

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
Lay down some comments related to the previous few revisions of ufs_vnops.c.


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 src/sys/ufs/ufs/ufs_vnops.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/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.246 src/sys/ufs/ufs/ufs_vnops.c:1.247
--- src/sys/ufs/ufs/ufs_vnops.c:1.246	Mon Feb 25 06:00:40 2019
+++ src/sys/ufs/ufs/ufs_vnops.c	Mon Jul  1 00:57:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.246 2019/02/25 06:00:40 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.247 2019/07/01 00:57:06 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.246 2019/02/25 06:00:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.247 2019/07/01 00:57:06 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1257,7 +1257,12 @@ ufs_readdir(void *v)
 
 	KASSERT(VOP_ISLOCKED(vp));
 
-	/* figure out where we want to read */
+	/*
+	 * Figure out where the user wants us to read and how much.
+	 *
+	 * XXX: there should probably be an upper bound on callerbytes
+	 * to avoid silliness trying to do large kernel allocations.
+	 */
 	callerbytes = calleruio->uio_resid;
 	startoffset = calleruio->uio_offset;
 	endoffset = startoffset + callerbytes;
@@ -1267,7 +1272,39 @@ ufs_readdir(void *v)
 		return EINVAL;
 	}
 
-	/* round start and end down to block boundaries */
+	/*
+	 * Now figure out where to actually start reading. Round the
+	 * start down to a block boundary: we need to start at the
+	 * beginning of a block in order to read the directory
+	 * correctly.
+	 *
+	 * We also want to always read a whole number of blocks so
+	 * that the copying code below doesn't have to worry about
+	 * partial entries. (It used to try at one point, and was a
+	 * horrible mess.)
+	 *
+	 * Furthermore, since blocks have to be scanned from the
+	 * beginning, if we go partially into another block now we'll
+	 * just have to rescan it on the next readdir call, which
+	 * doesn't really serve any useful purpose.
+	 *
+	 * So, round down the end as well. It's ok to underpopulate
+	 * the transfer buffer, as long as we send back at least one
+	 * dirent so as to avoid giving a bogus EOF indication.
+	 *
+	 * Note that because dirents are larger than ffs struct
+	 * directs, despite the rounding down we may not be able to
+	 * send all the entries in the blocks we read and may have to
+	 * rescan some of them on the next call anyway. Alternatively
+	 * if there's empty space on disk we might have actually been
+	 * able to fit the next block in, and so forth. None of this
+	 * actually matters that much in practice.
+	 *
+	 * XXX: what does ffs do if a directory block becomes
+	 * completely empty, and what happens if all the blocks we
+	 * read are completely empty even though we aren't at EOF? As
+	 * of this writing I (dholland) can't remember the details.
+	 */
 	physstart = rounddown2(startoffset, ump->um_dirblksiz);
 	physend = rounddown2(endoffset, ump->um_dirblksiz);
 
@@ -1276,10 +1313,42 @@ ufs_readdir(void *v)
 		return EINVAL;
 	}
 
+	/*
+	 * skipstart is the number of bytes we need to read in
+	 * (because we need to start at the beginning of a block) but
+	 * not transfer to the user.
+	 *
+	 * dropend is the number of bytes to ignore at the end of the
+	 * user's buffer.
+	 */
 	skipstart = startoffset - physstart;
 	dropend = endoffset - physend;
 
-	/* how much to actually read */
+	/*
+	 * Make a transfer buffer.
+	 *
+	 * Note: rawbufmax = physend - physstart. Proof:
+	 *
+	 * physend - physstart = physend - physstart
+	 *   = physend - physstart + startoffset - startoffset
+	 *   = physend + (startoffset - physstart) - startoffset
+	 *   = physend + skipstart - startoffset
+	 *   = physend + skipstart - startoffset + endoffset - endoffset
+	 *   = skipstart - startoffset + endoffset - (endoffset - physend)
+	 *   = skipstart - startoffset + endoffset - dropend
+	 *   = skipstart - startoffset + (startoffset + callerbytes) - dropend
+	 *   = skipstart + callerbytes - dropend
+	 *   = rawbufmax
+	 * Qed.
+	 *
+	 * XXX: this should just use physend - physstart.
+	 *
+	 * XXX: this should be rewritten to read the directs straight
+	 * out of bufferio buffers instead of copying twice. This would
+	 * also let us adapt better to the user's buffer size.
+	 */
+
+	/* Base buffer space for CALLERBYTES of new data */
 	rawbufmax = callerbytes + skipstart;
 	if (rawbufmax < callerbytes)
 		return EINVAL;



CVS commit: src/tests/lib/libcurses

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:37:11 UTC 2019

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/check_files: pad1.chk pad3.chk

Log Message:
Fix test for pad and enable it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/pad1.chk \
src/tests/lib/libcurses/check_files/pad3.chk

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/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.16 src/tests/lib/libcurses/t_curses.sh:1.17
--- src/tests/lib/libcurses/t_curses.sh:1.16	Sun Jun 30 22:21:33 2019
+++ src/tests/lib/libcurses/t_curses.sh	Sun Jun 30 22:37:11 2019
@@ -804,7 +804,7 @@ atf_init_test_cases()
 	atf_add_test_case mvprintw
 	atf_add_test_case mvscanw
 	atf_add_test_case mvvline
-#	atf_add_test_case pad # not working
+	atf_add_test_case pad
 	atf_add_test_case nocbreak
 	atf_add_test_case nodelay
 }

Index: src/tests/lib/libcurses/check_files/pad1.chk
diff -u src/tests/lib/libcurses/check_files/pad1.chk:1.1 src/tests/lib/libcurses/check_files/pad1.chk:1.2
--- src/tests/lib/libcurses/check_files/pad1.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/pad1.chk	Sun Jun 30 22:37:11 2019
@@ -1,3 +1,3 @@
 cup12;6Xtestingtest
  testingtest
- testingtesthome
\ No newline at end of file
+ testingtest
Index: src/tests/lib/libcurses/check_files/pad3.chk
diff -u src/tests/lib/libcurses/check_files/pad3.chk:1.1 src/tests/lib/libcurses/check_files/pad3.chk:1.2
--- src/tests/lib/libcurses/check_files/pad3.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/pad3.chk	Sun Jun 30 22:37:11 2019
@@ -3,4 +3,4 @@ cup12;7Xel
  t   4cup15;9X44
   testi2233
   testi2233
-  testi2233home
+  testi2233
\ No newline at end of file



CVS commit: src/tests/lib/libcurses

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:37:11 UTC 2019

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/check_files: pad1.chk pad3.chk

Log Message:
Fix test for pad and enable it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/pad1.chk \
src/tests/lib/libcurses/check_files/pad3.chk

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



CVS commit: src/tests/lib/libcurses

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:21:33 UTC 2019

Modified Files:
src/tests/lib/libcurses: t_curses.sh

Log Message:
Enable mvscanw test since libcurses is now correct.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libcurses/t_curses.sh

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



CVS commit: src/tests/lib/libcurses

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:21:33 UTC 2019

Modified Files:
src/tests/lib/libcurses: t_curses.sh

Log Message:
Enable mvscanw test since libcurses is now correct.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libcurses/t_curses.sh

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

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.15 src/tests/lib/libcurses/t_curses.sh:1.16
--- src/tests/lib/libcurses/t_curses.sh:1.15	Wed Jun 26 22:18:44 2019
+++ src/tests/lib/libcurses/t_curses.sh	Sun Jun 30 22:21:33 2019
@@ -802,7 +802,7 @@ atf_init_test_cases()
 	atf_add_test_case mvhline
 	atf_add_test_case mvinchnstr
 	atf_add_test_case mvprintw
-#	atf_add_test_case mvscanw # disable for now - return is wrong
+	atf_add_test_case mvscanw
 	atf_add_test_case mvvline
 #	atf_add_test_case pad # not working
 	atf_add_test_case nocbreak



CVS commit: src/sys/dev/usb

2019-06-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 30 22:19:55 UTC 2019

Modified Files:
src/sys/dev/usb: TODO.usbmp

Log Message:
remove a few items that are done, and mark a few others as working
since i've personally tested.  most in the "drivers testing" i think
are working now since it's been a few releases and we've had minor
bug reports in them fixed, this list was rarely updated.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/TODO.usbmp

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/TODO.usbmp
diff -u src/sys/dev/usb/TODO.usbmp:1.12 src/sys/dev/usb/TODO.usbmp:1.13
--- src/sys/dev/usb/TODO.usbmp:1.12	Tue May  7 22:00:10 2019
+++ src/sys/dev/usb/TODO.usbmp	Sun Jun 30 22:19:55 2019
@@ -1,4 +1,4 @@
-$NetBSD: TODO.usbmp,v 1.12 2019/05/07 22:00:10 mrg Exp $
+$NetBSD: TODO.usbmp,v 1.13 2019/06/30 22:19:55 mrg Exp $
 
 
 the majority of the USB MP device interface is documented in usbdivar.h.
@@ -22,8 +22,6 @@ usb_detach_{waitold,wakeup} to usb_detac
   - drivers:
   if_aue.c
   if_axe.c
-  if_axen.c
-  if_smsc.c
   if_udav.c
   if_url.c
   stuirda.c
@@ -69,8 +67,6 @@ splusb drivers:
   - if_athn_usb.c
   - if_aue.c
   - if_axe.c
-  - if_axen.c
-  - if_cdce.c
   - if_cue.c
   - if_kue.c
   - if_otus.c
@@ -120,7 +116,6 @@ missing D_MPSAFE drivers:
 missing CALLOUT_MPSAFE drivers:
   - if_aue.c
   - if_axe.c
-  - if_axen.c
   - if_cue.c
   - if_otus.c
   - if_rum.c
@@ -158,7 +153,8 @@ driver testing:		STATUS
   - irmce
   - aue
   - axe			working
-  - cdce
+  - axen		working
+  - cdce		working
   - cue
   - kue
   - udav
@@ -169,8 +165,9 @@ driver testing:		STATUS
   - ral
   - rum
   - run
+  - ure			working
   - urtw		working
-  - urtwn
+  - urtwn		working
   - upgt
   - zyd
   - upl
@@ -194,14 +191,14 @@ ucom attachments:
   - umodem		working
   - uark
   - ubsa
-  - uchcom
-  - uftdi
+  - uchcom		working
+  - uftdi		working
   - uipaq
   - umct
   - uplcom		attaches ok
   - uslsa		working
-  - uvscom
-  - umcs
+  - uvscom		working
+  - umcs		working
   - uvisor
   - ukyopon
   - u3g



CVS commit: src/sys/dev/usb

2019-06-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 30 22:19:55 UTC 2019

Modified Files:
src/sys/dev/usb: TODO.usbmp

Log Message:
remove a few items that are done, and mark a few others as working
since i've personally tested.  most in the "drivers testing" i think
are working now since it's been a few releases and we've had minor
bug reports in them fixed, this list was rarely updated.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/TODO.usbmp

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



CVS commit: src/lib/libpanel

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:18:08 UTC 2019

Modified Files:
src/lib/libpanel: shlib_version

Log Message:
Bump major number due to libcurses major bump


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libpanel/shlib_version

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

Modified files:

Index: src/lib/libpanel/shlib_version
diff -u src/lib/libpanel/shlib_version:1.1 src/lib/libpanel/shlib_version:1.2
--- src/lib/libpanel/shlib_version:1.1	Mon Oct 26 23:09:49 2015
+++ src/lib/libpanel/shlib_version	Sun Jun 30 22:18:08 2019
@@ -1,5 +1,5 @@
-#	$NetBSD: shlib_version,v 1.1 2015/10/26 23:09:49 uwe Exp $
+#	$NetBSD: shlib_version,v 1.2 2019/06/30 22:18:08 blymn Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
-major=1
+major=2
 minor=0



CVS commit: src/lib/libmenu

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:17:46 UTC 2019

Modified Files:
src/lib/libmenu: menu_opts.3 shlib_version

Log Message:
Bump major number due to libcurses major bump


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libmenu/menu_opts.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libmenu/shlib_version

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

Modified files:

Index: src/lib/libmenu/menu_opts.3
diff -u src/lib/libmenu/menu_opts.3:1.9 src/lib/libmenu/menu_opts.3:1.10
--- src/lib/libmenu/menu_opts.3:1.9	Mon Jul  3 21:32:50 2017
+++ src/lib/libmenu/menu_opts.3	Sun Jun 30 22:17:46 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: menu_opts.3,v 1.9 2017/07/03 21:32:50 wiz Exp $
+.\"	$NetBSD: menu_opts.3,v 1.10 2019/06/30 22:17:46 blymn Exp $
 .\"
 .\" Copyright (c) 1999
 .\"	Brett Lymn - bl...@baea.com.au, brett_l...@yahoo.com.au
@@ -65,6 +65,15 @@ menu passed.
 The
 .Fn set_menu_opts
 sets the menu options to the value given in opts.
+Options may be logigally ORed together.
+Valid options are:
+.Bl -column -offset indent ".Sy Option" ".Sy Meaning"
+.It Sy Option Ta Sy Meaning
+.It O_ONEVALUE Ta The menu may only have one item selected at a time.
+The menu mark will indicate the current item.
+If this option is off then muliple menu items may be selected and
+the menu mark will be displayed on each selected item.
+.El
 .Sh RETURN VALUES
 The functions return one of the following error values:
 .Pp

Index: src/lib/libmenu/shlib_version
diff -u src/lib/libmenu/shlib_version:1.11 src/lib/libmenu/shlib_version:1.12
--- src/lib/libmenu/shlib_version:1.11	Sun Jan 11 03:07:48 2009
+++ src/lib/libmenu/shlib_version	Sun Jun 30 22:17:46 2019
@@ -1,5 +1,5 @@
-#	$NetBSD: shlib_version,v 1.11 2009/01/11 03:07:48 christos Exp $
+#	$NetBSD: shlib_version,v 1.12 2019/06/30 22:17:46 blymn Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
-major=6
+major=7
 minor=0



CVS commit: src/lib/libpanel

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:18:08 UTC 2019

Modified Files:
src/lib/libpanel: shlib_version

Log Message:
Bump major number due to libcurses major bump


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libpanel/shlib_version

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



CVS commit: src/lib/libmenu

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:17:46 UTC 2019

Modified Files:
src/lib/libmenu: menu_opts.3 shlib_version

Log Message:
Bump major number due to libcurses major bump


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libmenu/menu_opts.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libmenu/shlib_version

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



CVS commit: src/lib/libform

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:17:22 UTC 2019

Modified Files:
src/lib/libform: shlib_version

Log Message:
Bump major number due to libcurses major bump


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

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



CVS commit: src/lib/libform

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:17:22 UTC 2019

Modified Files:
src/lib/libform: shlib_version

Log Message:
Bump major number due to libcurses major bump


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

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

Modified files:

Index: src/lib/libform/shlib_version
diff -u src/lib/libform/shlib_version:1.17 src/lib/libform/shlib_version:1.18
--- src/lib/libform/shlib_version:1.17	Sun Jan 11 03:07:48 2009
+++ src/lib/libform/shlib_version	Sun Jun 30 22:17:22 2019
@@ -1,5 +1,5 @@
-#	$NetBSD: shlib_version,v 1.17 2009/01/11 03:07:48 christos Exp $
+#	$NetBSD: shlib_version,v 1.18 2019/06/30 22:17:22 blymn Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
-major=6
+major=7
 minor=0



CVS commit: src/lib/libcurses

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:16:20 UTC 2019

Modified Files:
src/lib/libcurses: fileio.h scanw.c shlib_version

Log Message:
Fix return for mvscanw to return ERR/OK instead of the number of
elements scanned, now matches SUSv2 specification

Bump lib major due to return change.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/fileio.h
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/scanw.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libcurses/shlib_version

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

Modified files:

Index: src/lib/libcurses/fileio.h
diff -u src/lib/libcurses/fileio.h:1.6 src/lib/libcurses/fileio.h:1.7
--- src/lib/libcurses/fileio.h:1.6	Mon May 20 22:17:41 2019
+++ src/lib/libcurses/fileio.h	Sun Jun 30 22:16:20 2019
@@ -4,5 +4,5 @@
  *   by  : NetBSD: genfileioh.awk,v 1.2 2008/05/02 11:13:02 martin Exp 
  */
 
-#define CURSES_LIB_MAJOR 7
+#define CURSES_LIB_MAJOR 8
 #define CURSES_LIB_MINOR 2

Index: src/lib/libcurses/scanw.c
diff -u src/lib/libcurses/scanw.c:1.22 src/lib/libcurses/scanw.c:1.23
--- src/lib/libcurses/scanw.c:1.22	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/scanw.c	Sun Jun 30 22:16:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: scanw.c,v 1.22 2017/01/06 13:53:18 roy Exp $	*/
+/*	$NetBSD: scanw.c,v 1.23 2019/06/30 22:16:20 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)scanw.c	8.3 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: scanw.c,v 1.22 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: scanw.c,v 1.23 2019/06/30 22:16:20 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -116,9 +116,16 @@ int
 vw_scanw(WINDOW *win, const char *fmt, va_list ap)
 {
 	charbuf[1024];
+	int	ret;
 
-	return wgetnstr(win, buf, (int) sizeof(buf)) == OK ?
-	vsscanf(buf, fmt, ap) : ERR;
+	ret = ERR;
+	if (wgetnstr(win, buf, (int) sizeof(buf)) == OK) {
+		if (vsscanf(buf, fmt, ap) > 0) {
+			ret = OK;
+		}
+	}
+
+	return ret;
 }
 
 __strong_alias(vwscanw, vw_scanw)

Index: src/lib/libcurses/shlib_version
diff -u src/lib/libcurses/shlib_version:1.43 src/lib/libcurses/shlib_version:1.44
--- src/lib/libcurses/shlib_version:1.43	Fri Nov 16 10:12:00 2018
+++ src/lib/libcurses/shlib_version	Sun Jun 30 22:16:20 2019
@@ -1,8 +1,8 @@
-#	$NetBSD: shlib_version,v 1.43 2018/11/16 10:12:00 blymn Exp $
+#	$NetBSD: shlib_version,v 1.44 2019/06/30 22:16:20 blymn Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #	Remember to run `make fileio.h` when changing
 #	Remember to increment the major numbers of libform, libmenu and
 #	libpanel when the libcurses major number increments.
 #
-major=7
+major=8
 minor=2



CVS commit: src/lib/libcurses

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:16:20 UTC 2019

Modified Files:
src/lib/libcurses: fileio.h scanw.c shlib_version

Log Message:
Fix return for mvscanw to return ERR/OK instead of the number of
elements scanned, now matches SUSv2 specification

Bump lib major due to return change.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/fileio.h
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/scanw.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libcurses/shlib_version

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



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

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:15:06 UTC 2019

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

Log Message:
Bump libcurses major and all dependent libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.865 -r1.866 src/distrib/sets/lists/base/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.865 src/distrib/sets/lists/base/shl.mi:1.866
--- src/distrib/sets/lists/base/shl.mi:1.865	Tue Jun  4 08:44:08 2019
+++ src/distrib/sets/lists/base/shl.mi	Sun Jun 30 22:15:06 2019
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.865 2019/06/04 08:44:08 hannken Exp $
+# $NetBSD: shl.mi,v 1.866 2019/06/30 22:15:06 blymn Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -245,8 +245,8 @@
 ./usr/lib/libctf.so.3base-sys-shlib		compatfile,ctf
 ./usr/lib/libctf.so.3.0base-sys-shlib		compatfile,ctf
 ./usr/lib/libcurses.sobase-sys-shlib		compatfile
-./usr/lib/libcurses.so.7			base-sys-shlib		compatfile
-./usr/lib/libcurses.so.7.2			base-sys-shlib		compatfile
+./usr/lib/libcurses.so.8			base-sys-shlib		compatfile
+./usr/lib/libcurses.so.8.2			base-sys-shlib		compatfile
 ./usr/lib/libdes.sobase-crypto-shlib	compatfile
 ./usr/lib/libdes.so.12base-crypto-shlib	compatfile,openssl=10
 ./usr/lib/libdes.so.12.0base-crypto-shlib	compatfile,openssl=10
@@ -295,8 +295,8 @@
 ./usr/lib/libfetch.so.3base-sys-shlib		compatfile
 ./usr/lib/libfetch.so.3.0			base-sys-shlib		compatfile
 ./usr/lib/libform.sobase-sys-shlib		compatfile
-./usr/lib/libform.so.6base-sys-shlib		compatfile
-./usr/lib/libform.so.6.0			base-sys-shlib		compatfile
+./usr/lib/libform.so.7base-sys-shlib		compatfile
+./usr/lib/libform.so.7.0			base-sys-shlib		compatfile
 ./usr/lib/libgcc_s.sobase-sys-shlib		compatfile,gcc
 ./usr/lib/libgcc_s.so.1base-sys-shlib		compatfile,gcc
 ./usr/lib/libgcc_s.so.1.0			base-sys-shlib		compatfile,gcc
@@ -415,8 +415,8 @@
 ./usr/lib/libmagic.so.6base-sys-shlib		compatfile
 ./usr/lib/libmagic.so.6.0			base-sys-shlib		compatfile
 ./usr/lib/libmenu.sobase-sys-shlib		compatfile
-./usr/lib/libmenu.so.6base-sys-shlib		compatfile
-./usr/lib/libmenu.so.6.0			base-sys-shlib		compatfile
+./usr/lib/libmenu.so.7base-sys-shlib		compatfile
+./usr/lib/libmenu.so.7.0			base-sys-shlib		compatfile
 ./usr/lib/libmj.sobase-crypto-shlib	compatfile
 ./usr/lib/libmj.so.1base-crypto-shlib	compatfile
 ./usr/lib/libmj.so.1.0base-crypto-shlib	compatfile
@@ -451,8 +451,8 @@
 ./usr/lib/libpam.so.4base-sys-shlib		compatfile,pam
 ./usr/lib/libpam.so.4.1base-sys-shlib		compatfile,pam
 ./usr/lib/libpanel.sobase-sys-shlib		compatfile
-./usr/lib/libpanel.so.1base-sys-shlib		compatfile
-./usr/lib/libpanel.so.1.0			base-sys-shlib		compatfile
+./usr/lib/libpanel.so.2base-sys-shlib		compatfile
+./usr/lib/libpanel.so.2.0			base-sys-shlib		compatfile
 ./usr/lib/libpcap.sobase-net-shlib		compatfile
 ./usr/lib/libpcap.so.7base-net-shlib		compatfile
 ./usr/lib/libpcap.so.7.0			base-net-shlib		compatfile



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

2019-06-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun 30 22:15:06 UTC 2019

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

Log Message:
Bump libcurses major and all dependent libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.865 -r1.866 src/distrib/sets/lists/base/shl.mi

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



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

2019-06-30 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Sun Jun 30 21:20:04 UTC 2019

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

Log Message:
Add a test for verifying procinfo note inside coredumps.

Add a first test for triggering a core dump in the debugged process
(via PT_DUMPCORE) and verifying it.  The test finds procinfo note
and checks its contents.

The core dump is processed through libelf.  However, it only provides
for finding all note segments (or sections?).  I had to implement
finding and processing individual notes myself.  I've added
a core_find_note() function that will be reused in future tests.

Reviewed by kamil.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.129 -r1.130 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.



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

2019-06-30 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Sun Jun 30 21:20:04 UTC 2019

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

Log Message:
Add a test for verifying procinfo note inside coredumps.

Add a first test for triggering a core dump in the debugged process
(via PT_DUMPCORE) and verifying it.  The test finds procinfo note
and checks its contents.

The core dump is processed through libelf.  However, it only provides
for finding all note segments (or sections?).  I had to implement
finding and processing individual notes myself.  I've added
a core_find_note() function that will be reused in future tests.

Reviewed by kamil.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.129 -r1.130 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/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.56 src/tests/lib/libc/sys/Makefile:1.57
--- src/tests/lib/libc/sys/Makefile:1.56	Fri Apr 26 20:41:10 2019
+++ src/tests/lib/libc/sys/Makefile	Sun Jun 30 21:20:04 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.56 2019/04/26 20:41:10 maya Exp $
+# $NetBSD: Makefile,v 1.57 2019/06/30 21:20:04 mgorny Exp $
 
 MKMAN=	no
 
@@ -88,12 +88,12 @@ SRCS.t_mprotect=	t_mprotect.c ${SRCS_EXE
 
 LDADD.t_getpid+=-lpthread
 
-LDADD.t_ptrace_wait+=		-pthread -lm
-LDADD.t_ptrace_wait3+=		-pthread -lm
-LDADD.t_ptrace_wait4+=		-pthread -lm
-LDADD.t_ptrace_wait6+=		-pthread -lm
-LDADD.t_ptrace_waitid+=		-pthread -lm
-LDADD.t_ptrace_waitpid+=	-pthread -lm
+LDADD.t_ptrace_wait+=		-pthread -lm -lelf
+LDADD.t_ptrace_wait3+=		-pthread -lm -lelf
+LDADD.t_ptrace_wait4+=		-pthread -lm -lelf
+LDADD.t_ptrace_wait6+=		-pthread -lm -lelf
+LDADD.t_ptrace_waitid+=		-pthread -lm -lelf
+LDADD.t_ptrace_waitpid+=	-pthread -lm -lelf
 
 .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE)
 CPPFLAGS.t_posix_fadvise.c += -D_KERNTYPES

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.129 src/tests/lib/libc/sys/t_ptrace_wait.c:1.130
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.129	Wed Jun 26 12:30:13 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sun Jun 30 21:20:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.129 2019/06/26 12:30:13 mgorny Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.130 2019/06/30 21:20:04 mgorny Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,10 +27,11 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.129 2019/06/26 12:30:13 mgorny Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.130 2019/06/30 21:20:04 mgorny Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -43,6 +44,7 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.12
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -66,6 +68,9 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.12
 #include 
 #endif
 
+#include 
+#include 
+
 #include 
 
 #include "h_macros.h"
@@ -7639,6 +7644,180 @@ USER_VA0_DISABLE(user_va0_disable_pt_det
 
 /// 
 
+/*
+ * Parse the core file and find the requested note.  If the reading or parsing
+ * fails, the test is failed.  If the note is found, it is read onto buf, up to
+ * buf_len.  The actual length of the note is returned (which can be greater
+ * than buf_len, indicating that it has been truncated).  If the note is not
+ * found, -1 is returned.
+ */
+static ssize_t core_find_note(const char *core_path,
+const char *note_name, uint64_t note_type, void *buf, size_t buf_len)
+{
+	int core_fd;
+	Elf *core_elf;
+	size_t core_numhdr, i;
+	ssize_t ret = -1;
+	/* note: we assume note name will be null-terminated */
+	size_t name_len = strlen(note_name) + 1;
+
+	SYSCALL_REQUIRE((core_fd = open(core_path, O_RDONLY)) != -1);
+	SYSCALL_REQUIRE(elf_version(EV_CURRENT) != EV_NONE);
+	SYSCALL_REQUIRE((core_elf = elf_begin(core_fd, ELF_C_READ, NULL)));
+
+	SYSCALL_REQUIRE(elf_getphnum(core_elf, &core_numhdr) != 0);
+	for (i = 0; i < core_numhdr && ret == -1; i++) {
+		GElf_Phdr core_hdr;
+		size_t offset;
+		SYSCALL_REQUIRE(gelf_getphdr(core_elf, i, &core_hdr));
+		if (core_hdr.p_type != PT_NOTE)
+		continue;
+
+		for (offset = core_hdr.p_offset;
+		offset < core_hdr.p_offset + core_hdr.p_filesz;) {
+			Elf64_Nhdr note_hdr;
+			char name_buf[64];
+
+			switch (gelf_getclass(core_elf)) {
+			case ELFCLASS64:
+SYSCALL_REQUIRE(pread(core_fd, ¬e_hdr,
+sizeof(note_hdr), offset)
+== sizeof(note_hdr));
+offset += sizeof(note_hdr);
+break;
+			case ELFCLASS32:
+{
+Elf32_Nhdr tmp_hdr;
+SYSCALL_REQUIRE(pread(core_fd, &tmp_hdr,
+sizeof(tmp_hdr), offset)
+== sizeof(tmp_hdr));
+offset += sizeof(tmp_hdr);
+note_hdr.n_namesz = tmp_hdr.n_namesz;

CVS commit: src/usr.bin

2019-06-30 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Jun 30 19:57:24 UTC 2019

Modified Files:
src/usr.bin/systat: vmstat.c vmstat.h
src/usr.bin/vmstat: drvstats.c drvstats.h

Log Message:
Make the scaling of the "bytes written" sticky, so that if we go
to K, we don't return to unscaled, and similar for higher scales
(though it takes some effort, due to the wide field...)
Fixes PR#54334.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/systat/vmstat.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/systat/vmstat.h
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/vmstat/drvstats.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/vmstat/drvstats.h

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/systat/vmstat.c
diff -u src/usr.bin/systat/vmstat.c:1.86 src/usr.bin/systat/vmstat.c:1.87
--- src/usr.bin/systat/vmstat.c:1.86	Fri Jan 25 15:34:22 2019
+++ src/usr.bin/systat/vmstat.c	Sun Jun 30 19:57:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmstat.c,v 1.86 2019/01/25 15:34:22 christos Exp $	*/
+/*	$NetBSD: vmstat.c,v 1.87 2019/06/30 19:57:23 he Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1989, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 1/12/94";
 #endif
-__RCSID("$NetBSD: vmstat.c,v 1.86 2019/01/25 15:34:22 christos Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.87 2019/06/30 19:57:23 he Exp $");
 #endif /* not lint */
 
 /*
@@ -756,7 +756,7 @@ cputime(int indx)
 }
 
 void
-puthumanint(u_int64_t n, int l, int c, int w)
+puthumanint_scale(u_int64_t n, int l, int c, int w, int scale)
 {
 	char b[128];
 
@@ -766,7 +766,7 @@ puthumanint(u_int64_t n, int l, int c, i
 		hline(' ', w);
 		return;
 	}
-	if (humanize_number(b, w, n, "", HN_AUTOSCALE, HN_NOSPACE) == -1 ) {
+	if (humanize_number(b, w, n, "", scale, HN_NOSPACE) == -1 ) {
 		hline('*', w);
 		return;
 	}
@@ -774,6 +774,28 @@ puthumanint(u_int64_t n, int l, int c, i
 }
 
 void
+puthumanint_sticky(u_int64_t n, int l, int c, int w, int *scale)
+{
+	char b[128];
+	int sc;
+
+	sc = humanize_number(b, w, n, "", HN_GETSCALE, HN_NOSPACE);
+	if (sc > *scale)
+		*scale = sc;
+	else
+		sc = *scale;
+
+	puthumanint_scale(n, l, c, w, sc);
+}
+
+void
+puthumanint(u_int64_t n, int l, int c, int w)
+{
+
+	puthumanint_scale(n, l, c, w, HN_AUTOSCALE);
+}
+
+void
 putint(int n, int l, int c, int w)
 {
 	char b[128];
@@ -899,8 +921,8 @@ dinfo(int dn, int r, int c)
 	putint((int)((cur.rxfer[dn]+cur.wxfer[dn])/dtime+0.5),
 	r, c, DISKCOLWIDTH);
 	ADV;
-	puthumanint((cur.rbytes[dn] + cur.wbytes[dn]) / dtime + 0.5,
-		r, c, DISKCOLWIDTH);
+	puthumanint_sticky((cur.rbytes[dn] + cur.wbytes[dn]) / dtime + 0.5,
+		r, c, DISKCOLWIDTH, &cur.scale[dn]);
 	ADV;
 
 	/* time busy in disk activity */

Index: src/usr.bin/systat/vmstat.h
diff -u src/usr.bin/systat/vmstat.h:1.1 src/usr.bin/systat/vmstat.h:1.2
--- src/usr.bin/systat/vmstat.h:1.1	Sat Mar 18 14:58:49 2006
+++ src/usr.bin/systat/vmstat.h	Sun Jun 30 19:57:23 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: vmstat.h,v 1.1 2006/03/18 14:58:49 dsl Exp $  */
+/*  $NetBSD: vmstat.h,v 1.2 2019/06/30 19:57:23 he Exp $  */
 
 /*-
  * Copyright (c) 1983, 1989, 1992, 1993
@@ -35,6 +35,8 @@ extern double etime;
 
 void putfloat(double, int, int, int, int, int);
 void putint(int, int, int, int);
+void puthumanint_scale(u_int64_t, int, int, int, int);
+void puthumanint_sticky(u_int64_t, int, int, int, int*);
 void puthumanint(u_int64_t, int, int, int);
 
 typedef struct uvmexp_sysctl uvmexp_sysctl_t;

Index: src/usr.bin/vmstat/drvstats.c
diff -u src/usr.bin/vmstat/drvstats.c:1.12 src/usr.bin/vmstat/drvstats.c:1.13
--- src/usr.bin/vmstat/drvstats.c:1.12	Thu Feb  8 09:05:21 2018
+++ src/usr.bin/vmstat/drvstats.c	Sun Jun 30 19:57:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: drvstats.c,v 1.12 2018/02/08 09:05:21 dholland Exp $	*/
+/*	$NetBSD: drvstats.c,v 1.13 2019/06/30 19:57:24 he Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -346,6 +346,7 @@ drvinit(int selected)
 	cur.seek = calloc(ndrive, sizeof(u_int64_t));
 	cur.rbytes = calloc(ndrive, sizeof(u_int64_t));
 	cur.wbytes = calloc(ndrive, sizeof(u_int64_t));
+	cur.scale = calloc(ndrive, sizeof(int));
 	last.time = calloc(ndrive, sizeof(struct timeval));
 	last.wait = calloc(ndrive, sizeof(struct timeval));
 	last.waitsum = calloc(ndrive, sizeof(struct timeval));

Index: src/usr.bin/vmstat/drvstats.h
diff -u src/usr.bin/vmstat/drvstats.h:1.5 src/usr.bin/vmstat/drvstats.h:1.6
--- src/usr.bin/vmstat/drvstats.h:1.5	Tue Jul  4 21:19:33 2017
+++ src/usr.bin/vmstat/drvstats.h	Sun Jun 30 19:57:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: drvstats.h,v 1.5 2017/07/04 21:19:33 mlelstv Exp $	*/
+/*	$NetBSD: drvstats.h,v 1.6 2019/06/30 19:57:24 he Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -45,6 +45,7 @@ struct _drive {
 	u_int64_t	 *seek;	/* # of seeks (currently unused). */
 	u_int64_t	 *rbytes;	/* # of bytes read. */
 	u_int64_t	 *wbytes;	/* # of byte

CVS commit: src/usr.bin

2019-06-30 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Jun 30 19:57:24 UTC 2019

Modified Files:
src/usr.bin/systat: vmstat.c vmstat.h
src/usr.bin/vmstat: drvstats.c drvstats.h

Log Message:
Make the scaling of the "bytes written" sticky, so that if we go
to K, we don't return to unscaled, and similar for higher scales
(though it takes some effort, due to the wide field...)
Fixes PR#54334.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/systat/vmstat.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/systat/vmstat.h
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/vmstat/drvstats.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/vmstat/drvstats.h

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



CVS commit: [netbsd-8] src/doc

2019-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 19:00:38 UTC 2019

Modified Files:
src/doc [netbsd-8]: CHANGES-8.2

Log Message:
Ticket #1283


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/doc/CHANGES-8.2

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



CVS commit: [netbsd-8] src/doc

2019-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 19:00:38 UTC 2019

Modified Files:
src/doc [netbsd-8]: CHANGES-8.2

Log Message:
Ticket #1283


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/doc/CHANGES-8.2

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.4 src/doc/CHANGES-8.2:1.1.2.5
--- src/doc/CHANGES-8.2:1.1.2.4	Thu Jun 27 13:18:28 2019
+++ src/doc/CHANGES-8.2	Sun Jun 30 19:00:38 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.4 2019/06/27 13:18:28 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.5 2019/06/30 19:00:38 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -75,3 +75,8 @@ sys/arch/x86/include/bootinfo.h			1.30
 	Some systems require a larger bootinfo size for memory descriptors.
 	[nonaka, ticket #1282]
 
+sys/dev/ic/mvsata.c1.47-1.48
+
+	PR/54205: fix "mvsata:0:0:1: buffer load failed: error=27" failure.
+	[tsutsui, ticket #1283]
+



CVS commit: [netbsd-8] src/sys/dev/ic

2019-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 19:00:10 UTC 2019

Modified Files:
src/sys/dev/ic [netbsd-8]: mvsata.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1283):

sys/dev/ic/mvsata.c: revision 1.47
sys/dev/ic/mvsata.c: revision 1.48

Fix "mvsata:0:0:1: buffer load failed: error=27" failure.  PR/54205
Ok'ed by jdolecek@.
Should be pulled up to netbsd-8.

Add a missing newline in an error message.  Noticed in PR/54205


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.10.1 src/sys/dev/ic/mvsata.c

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



CVS commit: [netbsd-8] src/sys/dev/ic

2019-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 19:00:10 UTC 2019

Modified Files:
src/sys/dev/ic [netbsd-8]: mvsata.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1283):

sys/dev/ic/mvsata.c: revision 1.47
sys/dev/ic/mvsata.c: revision 1.48

Fix "mvsata:0:0:1: buffer load failed: error=27" failure.  PR/54205
Ok'ed by jdolecek@.
Should be pulled up to netbsd-8.

Add a missing newline in an error message.  Noticed in PR/54205


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.10.1 src/sys/dev/ic/mvsata.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/ic/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.35 src/sys/dev/ic/mvsata.c:1.35.10.1
--- src/sys/dev/ic/mvsata.c:1.35	Mon May  2 19:18:29 2016
+++ src/sys/dev/ic/mvsata.c	Sun Jun 30 19:00:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata.c,v 1.35 2016/05/02 19:18:29 christos Exp $	*/
+/*	$NetBSD: mvsata.c,v 1.35.10.1 2019/06/30 19:00:10 martin Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35 2016/05/02 19:18:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35.10.1 2019/06/30 19:00:10 martin Exp $");
 
 #include "opt_mvsata.h"
 
@@ -103,7 +103,8 @@ int	mvsata_debug = 2;
 	   sending a cmd */
 #define ATAPI_MODE_DELAY	1000	/* 1s, timeout for SET_FEATURE cmds */
 
-#define MVSATA_EPRD_MAX_SIZE	(sizeof(struct eprd) * (MAXPHYS / PAGE_SIZE))
+#define MVSATA_MAX_SEGS		(MAXPHYS / PAGE_SIZE + 1)
+#define MVSATA_EPRD_MAX_SIZE	(sizeof(struct eprd) * MVSATA_MAX_SEGS)
 
 
 static void mvsata_probe_drive(struct ata_channel *);
@@ -2918,7 +2919,7 @@ mvsata_port_init(struct mvsata_hc *mvhc,
 	}
 	for (i = 0; i < MVSATA_EDMAQ_LEN; i++) {
 		rv = bus_dmamap_create(mvport->port_dmat, MAXPHYS,
-		MAXPHYS / PAGE_SIZE, MAXPHYS, 0, BUS_DMA_NOWAIT,
+		MVSATA_MAX_SEGS, MAXPHYS, 0, BUS_DMA_NOWAIT,
 		&mvport->port_reqtbl[i].data_dmamap);
 		if (rv != 0) {
 			aprint_error("%s:%d:%d:"
@@ -3125,7 +3126,7 @@ mvsata_dma_bufload(struct mvsata_port *m
 	rv = bus_dmamap_load(mvport->port_dmat, data_dmamap, databuf, datalen,
 	NULL, BUS_DMA_NOWAIT | lop);
 	if (rv) {
-		aprint_error("%s:%d:%d: buffer load failed: error=%d",
+		aprint_error("%s:%d:%d: buffer load failed: error=%d\n",
 		device_xname(MVSATA_DEV2(mvport)), mvport->port_hc->hc,
 		mvport->port, rv);
 		return rv;



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

2019-06-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 30 17:33:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Cleanup ThunderX quirk and print cache / shareability details for ITT tables


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.20 src/sys/arch/arm/cortex/gicv3_its.c:1.21
--- src/sys/arch/arm/cortex/gicv3_its.c:1.20	Sun Jun 30 10:10:19 2019
+++ src/sys/arch/arm/cortex/gicv3_its.c	Sun Jun 30 17:33:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.20 2019/06/30 10:10:19 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.21 2019/06/30 17:33:59 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.20 2019/06/30 10:10:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.21 2019/06/30 17:33:59 jmcneill Exp $");
 
 #include 
 #include 
@@ -61,7 +61,29 @@ __KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,
  */
 #define GITS_IIDR_PID_CAVIUM_THUNDERX	0xa1
 #define GITS_IIDR_IMP_CAVIUM		0x34c
-
+#define	GITS_IIDR_CAVIUM_ERRATA_MASK	(GITS_IIDR_Implementor|GITS_IIDR_ProductID|GITS_IIDR_Variant)
+#define	GITS_IIDR_CAVIUM_ERRATA_VALUE			\
+		(__SHIFTIN(GITS_IIDR_IMP_CAVIUM, GITS_IIDR_Implementor) |		\
+		 __SHIFTIN(GITS_IIDR_PID_CAVIUM_THUNDERX, GITS_IIDR_ProductID) |	\
+		 __SHIFTIN(0, GITS_IIDR_Variant))
+
+static const char * gits_cache_type[] = {
+	[GITS_Cache_DEVICE_nGnRnE]	= "Device-nGnRnE",
+	[GITS_Cache_NORMAL_NC]		= "Non-cacheable",
+	[GITS_Cache_NORMAL_RA_WT]	= "Cacheable RA WT",
+	[GITS_Cache_NORMAL_RA_WB]	= "Cacheable RA WB",
+	[GITS_Cache_NORMAL_WA_WT]	= "Cacheable WA WT",
+	[GITS_Cache_NORMAL_WA_WB]	= "Cacheable WA WB",
+	[GITS_Cache_NORMAL_RA_WA_WT]	= "Cacheable RA WA WT",
+	[GITS_Cache_NORMAL_RA_WA_WB]	= "Cacheable RA WA WB",
+};
+
+static const char * gits_share_type[] = {
+	[GITS_Shareability_NS]		= "Non-shareable",
+	[GITS_Shareability_IS]		= "Inner shareable",
+	[GITS_Shareability_OS]		= "Outer shareable",
+	[3]= "(Reserved)",
+};
 
 static inline uint32_t
 gits_read_4(struct gicv3_its *its, bus_size_t reg)
@@ -617,34 +639,36 @@ gicv3_its_command_init(struct gicv3_soft
 }
 
 static void
-gicv3_its_table_init(struct gicv3_softc *sc, struct gicv3_its *its)
+gicv3_its_table_params(struct gicv3_softc *sc, struct gicv3_its *its,
+u_int *devbits, u_int *innercache, u_int *share)
 {
-	u_int table_size, page_size, table_align;
-	uint64_t baser;
-	int tab;
 
 	const uint64_t typer = gits_read_8(its, GITS_TYPER);
+	const uint32_t iidr = gits_read_4(its, GITS_IIDR);
 
-	/* devbits and innercache defaults */
-	u_int devbits = __SHIFTOUT(typer, GITS_TYPER_Devbits) + 1;
-	u_int innercache = GITS_Cache_NORMAL_WA_WB;
-	u_int share = GITS_Shareability_IS;
-
-	uint32_t iidr = gits_read_4(its, GITS_IIDR);
-	const uint32_t ctx =
-	   __SHIFTIN(GITS_IIDR_IMP_CAVIUM, GITS_IIDR_Implementor) |
-	   __SHIFTIN(GITS_IIDR_PID_CAVIUM_THUNDERX, GITS_IIDR_ProductID) |
-	   __SHIFTIN(0, GITS_IIDR_Variant);
-	const uint32_t mask =
-	GITS_IIDR_Implementor |
-	GITS_IIDR_ProductID |
-	GITS_IIDR_Variant;
-
-	if ((iidr & mask) == ctx) {
-		devbits = 20;		/* 8Mb */
-		innercache = GITS_Cache_DEVICE_nGnRnE;
+	/* Default values */
+	*devbits = __SHIFTOUT(typer, GITS_TYPER_Devbits) + 1;
+	*innercache = GITS_Cache_NORMAL_WA_WB;
+	*share = GITS_Shareability_IS;
+
+	/* Cavium ThunderX errata */
+	if ((iidr & GITS_IIDR_CAVIUM_ERRATA_MASK) == GITS_IIDR_CAVIUM_ERRATA_VALUE) {
+		*devbits = 20;		/* 8Mb */
+		*innercache = GITS_Cache_DEVICE_nGnRnE;
 		aprint_normal_dev(sc->sc_dev, "Cavium ThunderX errata detected\n");
 	}
+}
+
+static void
+gicv3_its_table_init(struct gicv3_softc *sc, struct gicv3_its *its)
+{
+	u_int table_size, page_size, table_align;
+	u_int devbits, innercache, share;
+	const char *table_type;
+	uint64_t baser;
+	int tab;
+
+	gicv3_its_table_params(sc, its, &devbits, &innercache, &share);
 
 	for (tab = 0; tab < 8; tab++) {
 		baser = gits_read_8(its, GITS_BASERn(tab));
@@ -673,12 +697,14 @@ gicv3_its_table_init(struct gicv3_softc 
 			 * Table size scales with the width of the DeviceID.
 			 */
 			table_size = roundup(entry_size * (1 << devbits), page_size);
+			table_type = "Devices";
 			break;
 		case GITS_Type_InterruptCollections:
 			/*
 			 * Allocate space for one interrupt collection per CPU.
 			 */
 			table_size = roundup(entry_size * MAXCPUS, page_size);
+			table_type = "Collections";
 			break;
 		default:
 			table_size = 0;
@@ -688,7 +714,6 @@ gicv3_its_table_init(struct gicv3_softc 
 		if (table_size == 0)
 			continue;
 
-		aprint_normal_dev(sc->sc_dev, "ITS TT%u type %#x size %#x\n", tab, (u_int)__SHIFTOUT(baser, GITS_BASER_Type), table_

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

2019-06-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 30 17:33:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Cleanup ThunderX quirk and print cache / shareability details for ITT tables


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/cortex/gicv3_its.c

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



CVS commit: src/sys/compat/sys

2019-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 30 14:37:33 UTC 2019

Modified Files:
src/sys/compat/sys: sigtypes.h ucontext.h

Log Message:
This code is used in 32 bit arm emulations so always expose the stack32_t
and the 32 bit machine context structure definition and types.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/sigtypes.h
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/sys/ucontext.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/compat/sys/sigtypes.h
diff -u src/sys/compat/sys/sigtypes.h:1.3 src/sys/compat/sys/sigtypes.h:1.4
--- src/sys/compat/sys/sigtypes.h:1.3	Wed Jun 26 21:58:49 2019
+++ src/sys/compat/sys/sigtypes.h	Sun Jun 30 10:37:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sigtypes.h,v 1.3 2019/06/27 01:58:49 christos Exp $	*/
+/*	$NetBSD: sigtypes.h,v 1.4 2019/06/30 14:37:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -63,7 +63,7 @@ struct sigaltstack13 {
 
 #endif	/* _POSIX_C_SOURCE || _XOPEN_SOURCE || ... */
 
-#if defined(_LP64) && defined(_KERNEL)
+#ifdef _KERNEL
 
 struct __sigaltstack32 {
 	uint32_t	ss_sp;
@@ -73,7 +73,7 @@ struct __sigaltstack32 {
 
 typedef struct __sigaltstack32 stack32_t;
 
-#endif /* _LP64 && _KERNEL */
+#endif /* _KERNEL */
 
 
 #endif	/* !_COMPAT_SYS_SIGTYPES_H_ */

Index: src/sys/compat/sys/ucontext.h
diff -u src/sys/compat/sys/ucontext.h:1.7 src/sys/compat/sys/ucontext.h:1.8
--- src/sys/compat/sys/ucontext.h:1.7	Wed Jun 26 21:58:49 2019
+++ src/sys/compat/sys/ucontext.h	Sun Jun 30 10:37:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucontext.h,v 1.7 2019/06/27 01:58:49 christos Exp $	*/
+/*	$NetBSD: ucontext.h,v 1.8 2019/06/30 14:37:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2003 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include 
 
-#if defined(_LP64) && defined(_KERNEL)
+#ifdef _KERNEL
 
 typedef struct __ucontext32   ucontext32_t;
 
@@ -61,6 +61,6 @@ int	cpu_mcontext32_validate(struct lwp *
 void	cpu_getmcontext32(struct lwp *, mcontext32_t *, unsigned int *);
 int	cpu_setmcontext32(struct lwp *, const mcontext32_t *, unsigned int);
 
-#endif /* _LP64 && _KERNEL */
+#endif /* _KERNEL */
 
 #endif /* !_COMPAT_SYS_UCONTEXT_H_ */



CVS commit: src/sys/compat/sys

2019-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 30 14:37:33 UTC 2019

Modified Files:
src/sys/compat/sys: sigtypes.h ucontext.h

Log Message:
This code is used in 32 bit arm emulations so always expose the stack32_t
and the 32 bit machine context structure definition and types.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/sigtypes.h
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/sys/ucontext.h

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



CVS commit: src/lib/libedit

2019-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 30 13:30:15 UTC 2019

Modified Files:
src/lib/libedit: terminal.c

Log Message:
Add a comment explaining why we don't use DO here. Correct the attribution
on the previous patch: The patch was from Jordan Lewis and the report from
Raphael Poss.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libedit/terminal.c

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



CVS commit: src/lib/libedit

2019-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 30 13:30:15 UTC 2019

Modified Files:
src/lib/libedit: terminal.c

Log Message:
Add a comment explaining why we don't use DO here. Correct the attribution
on the previous patch: The patch was from Jordan Lewis and the report from
Raphael Poss.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libedit/terminal.c

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

Modified files:

Index: src/lib/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.37 src/lib/libedit/terminal.c:1.38
--- src/lib/libedit/terminal.c:1.37	Sat Jun 29 17:35:09 2019
+++ src/lib/libedit/terminal.c	Sun Jun 30 09:30:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.37 2019/06/29 21:35:09 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.38 2019/06/30 13:30:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c	8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.37 2019/06/29 21:35:09 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.38 2019/06/30 13:30:15 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -509,6 +509,10 @@ terminal_move_to_line(EditLine *el, int 
 		return;
 	}
 	if ((del = where - el->el_cursor.v) > 0) {
+		/*
+		 * We don't use DO here because some terminals are buggy
+		 * if the destination is beyond bottom of the screen.
+		 */
 		for (; del > 0; del--)
 			terminal__putc(el, '\n');
 		/* because the \n will become \r\n */



CVS commit: src/sbin

2019-06-30 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Jun 30 11:38:16 UTC 2019

Modified Files:
src/sbin/gpt: gpt.h gpt_private.h gpt_uuid.h map.h
src/sbin/ifconfig: env.h parse.h util.h
src/sbin/newfs_udf: newfs_udf.h
src/sbin/route: rtutil.h

Log Message:
Add rcsid


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/gpt/gpt.h
cvs rdiff -u -r1.2 -r1.3 src/sbin/gpt/gpt_private.h
cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/gpt_uuid.h
cvs rdiff -u -r1.6 -r1.7 src/sbin/gpt/map.h
cvs rdiff -u -r1.3 -r1.4 src/sbin/ifconfig/env.h
cvs rdiff -u -r1.7 -r1.8 src/sbin/ifconfig/parse.h
cvs rdiff -u -r1.12 -r1.13 src/sbin/ifconfig/util.h
cvs rdiff -u -r1.5 -r1.6 src/sbin/newfs_udf/newfs_udf.h
cvs rdiff -u -r1.3 -r1.4 src/sbin/route/rtutil.h

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

Modified files:

Index: src/sbin/gpt/gpt.h
diff -u src/sbin/gpt/gpt.h:1.40 src/sbin/gpt/gpt.h:1.41
--- src/sbin/gpt/gpt.h:1.40	Tue Jun 25 03:42:45 2019
+++ src/sbin/gpt/gpt.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: gpt.h,v 1.41 2019/06/30 11:38:16 sevan Exp $	*/
+
 /*-
  * Copyright (c) 2002 Marcel Moolenaar
  * All rights reserved.

Index: src/sbin/gpt/gpt_private.h
diff -u src/sbin/gpt/gpt_private.h:1.2 src/sbin/gpt/gpt_private.h:1.3
--- src/sbin/gpt/gpt_private.h:1.2	Thu Feb 16 03:32:17 2017
+++ src/sbin/gpt/gpt_private.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: gpt_private.h,v 1.3 2019/06/30 11:38:16 sevan Exp $	*/
+
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
  * All rights reserved.

Index: src/sbin/gpt/gpt_uuid.h
diff -u src/sbin/gpt/gpt_uuid.h:1.8 src/sbin/gpt/gpt_uuid.h:1.9
--- src/sbin/gpt/gpt_uuid.h:1.8	Thu Dec 20 14:58:10 2018
+++ src/sbin/gpt/gpt_uuid.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: gpt_uuid.h,v 1.9 2019/06/30 11:38:16 sevan Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.

Index: src/sbin/gpt/map.h
diff -u src/sbin/gpt/map.h:1.6 src/sbin/gpt/map.h:1.7
--- src/sbin/gpt/map.h:1.6	Thu Dec  3 21:30:54 2015
+++ src/sbin/gpt/map.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: map.h,v 1.7 2019/06/30 11:38:16 sevan Exp $	*/
+
 /*-
  * Copyright (c) 2002 Marcel Moolenaar
  * All rights reserved.

Index: src/sbin/ifconfig/env.h
diff -u src/sbin/ifconfig/env.h:1.3 src/sbin/ifconfig/env.h:1.4
--- src/sbin/ifconfig/env.h:1.3	Thu Nov  4 23:31:12 2010
+++ src/sbin/ifconfig/env.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: env.h,v 1.4 2019/06/30 11:38:16 sevan Exp $	*/
+
 #ifndef _IFCONFIG_ENV_H
 #define _IFCONFIG_ENV_H
 

Index: src/sbin/ifconfig/parse.h
diff -u src/sbin/ifconfig/parse.h:1.7 src/sbin/ifconfig/parse.h:1.8
--- src/sbin/ifconfig/parse.h:1.7	Thu Jul  1 16:44:05 2010
+++ src/sbin/ifconfig/parse.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: parse.h,v 1.8 2019/06/30 11:38:16 sevan Exp $	*/
+
 #ifndef _IFCONFIG_PARSE_H
 #define _IFCONFIG_PARSE_H
 

Index: src/sbin/ifconfig/util.h
diff -u src/sbin/ifconfig/util.h:1.12 src/sbin/ifconfig/util.h:1.13
--- src/sbin/ifconfig/util.h:1.12	Thu Jan  7 11:32:21 2016
+++ src/sbin/ifconfig/util.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: util.h,v 1.13 2019/06/30 11:38:16 sevan Exp $	*/
+
 #ifndef _IFCONFIG_UTIL_H
 #define _IFCONFIG_UTIL_H
 

Index: src/sbin/newfs_udf/newfs_udf.h
diff -u src/sbin/newfs_udf/newfs_udf.h:1.5 src/sbin/newfs_udf/newfs_udf.h:1.6
--- src/sbin/newfs_udf/newfs_udf.h:1.5	Fri Aug  9 15:11:08 2013
+++ src/sbin/newfs_udf/newfs_udf.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: newfs_udf.h,v 1.6 2019/06/30 11:38:16 sevan Exp $	*/
+
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
  * All rights reserved.

Index: src/sbin/route/rtutil.h
diff -u src/sbin/route/rtutil.h:1.3 src/sbin/route/rtutil.h:1.4
--- src/sbin/route/rtutil.h:1.3	Wed Jan  7 22:38:32 2015
+++ src/sbin/route/rtutil.h	Sun Jun 30 11:38:16 2019
@@ -1,3 +1,5 @@
+/*	$NetBSD: rtutil.h,v 1.4 2019/06/30 11:38:16 sevan Exp $	*/
+
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.



CVS commit: src/sbin

2019-06-30 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Jun 30 11:38:16 UTC 2019

Modified Files:
src/sbin/gpt: gpt.h gpt_private.h gpt_uuid.h map.h
src/sbin/ifconfig: env.h parse.h util.h
src/sbin/newfs_udf: newfs_udf.h
src/sbin/route: rtutil.h

Log Message:
Add rcsid


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/gpt/gpt.h
cvs rdiff -u -r1.2 -r1.3 src/sbin/gpt/gpt_private.h
cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/gpt_uuid.h
cvs rdiff -u -r1.6 -r1.7 src/sbin/gpt/map.h
cvs rdiff -u -r1.3 -r1.4 src/sbin/ifconfig/env.h
cvs rdiff -u -r1.7 -r1.8 src/sbin/ifconfig/parse.h
cvs rdiff -u -r1.12 -r1.13 src/sbin/ifconfig/util.h
cvs rdiff -u -r1.5 -r1.6 src/sbin/newfs_udf/newfs_udf.h
cvs rdiff -u -r1.3 -r1.4 src/sbin/route/rtutil.h

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



CVS commit: src/share/misc

2019-06-30 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Jun 30 11:22:54 UTC 2019

Modified Files:
src/share/misc: acronyms.comp

Log Message:
SPAN


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.272 src/share/misc/acronyms.comp:1.273
--- src/share/misc/acronyms.comp:1.272	Sat Jun 29 10:34:59 2019
+++ src/share/misc/acronyms.comp	Sun Jun 30 11:22:54 2019
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.272 2019/06/29 10:34:59 sevan Exp $
+$NetBSD: acronyms.comp,v 1.273 2019/06/30 11:22:54 sevan Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -1449,6 +1449,7 @@ SOM	system on module
 SP	service pack
 SP	stack pointer
 SPA	storage pool allocator
+SPAN	switched port analyzer
 SPARC	scalable processor architecture
 SPARQL	SPARQL Protocol and RDF Query Language
 SPD	security policy database



CVS commit: src/share/misc

2019-06-30 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Jun 30 11:22:54 UTC 2019

Modified Files:
src/share/misc: acronyms.comp

Log Message:
SPAN


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/share/misc/acronyms.comp

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



CVS commit: src/usr.bin/calendar/calendars

2019-06-30 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Jun 30 11:21:40 UTC 2019

Modified Files:
src/usr.bin/calendar/calendars: calendar.birthday

Log Message:
Add John von Neumann's date of death


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/calendar/calendars/calendar.birthday

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



CVS commit: src/usr.bin/calendar/calendars

2019-06-30 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Jun 30 11:21:40 UTC 2019

Modified Files:
src/usr.bin/calendar/calendars: calendar.birthday

Log Message:
Add John von Neumann's date of death


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/calendar/calendars/calendar.birthday

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/calendar/calendars/calendar.birthday
diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.27 src/usr.bin/calendar/calendars/calendar.birthday:1.28
--- src/usr.bin/calendar/calendars/calendar.birthday:1.27	Sat Dec  9 23:16:27 2017
+++ src/usr.bin/calendar/calendars/calendar.birthday	Sun Jun 30 11:21:40 2019
@@ -39,6 +39,7 @@
 02/06	King George VI of UK dies;  his daughter becomes Elizabeth II, 1952
 02/07	Sinclair Lewis born, 1885
 02/08	Friedleib F. Runge born, 1795, father of paper chromatography
+02/08	John von Neumann died, 1957
 02/08	Jules Verne born in Nantes, France, 1828
 02/09	George Hartmann born, 1489, designed astrolabes, timepieces, etc.
 02/10	Charles Lamb born, 1775



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

2019-06-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 30 11:11:38 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3.c gicv3.h

Log Message:
Fix size of LPI pending table allocation and enable caching of LPI conf
and pending tables where possible.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/cortex/gicv3.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/gicv3.h

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

Modified files:

Index: src/sys/arch/arm/cortex/gicv3.c
diff -u src/sys/arch/arm/cortex/gicv3.c:1.19 src/sys/arch/arm/cortex/gicv3.c:1.20
--- src/sys/arch/arm/cortex/gicv3.c:1.19	Wed Jun 26 23:00:09 2019
+++ src/sys/arch/arm/cortex/gicv3.c	Sun Jun 30 11:11:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3.c,v 1.19 2019/06/26 23:00:09 jmcneill Exp $ */
+/* $NetBSD: gicv3.c,v 1.20 2019/06/30 11:11:38 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -31,7 +31,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.19 2019/06/26 23:00:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.20 2019/06/30 11:11:38 jmcneill Exp $");
 
 #include 
 #include 
@@ -41,6 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -516,10 +518,13 @@ gicv3_lpi_unblock_irqs(struct pic_softc 
 
 	while ((bit = ffs(mask)) != 0) {
 		sc->sc_lpiconf.base[irqbase + bit - 1] |= GIC_LPICONF_Enable;
+		if (sc->sc_lpiconf_flush)
+			cpu_dcache_wb_range((vaddr_t)&sc->sc_lpiconf.base[irqbase + bit - 1], 1);
 		mask &= ~__BIT(bit - 1);
 	}
 
-	bus_dmamap_sync(sc->sc_dmat, sc->sc_lpiconf.map, irqbase, 32, BUS_DMASYNC_PREWRITE);
+	if (!sc->sc_lpiconf_flush)
+		__asm __volatile ("dsb ishst");
 }
 
 static void
@@ -530,10 +535,13 @@ gicv3_lpi_block_irqs(struct pic_softc *p
 
 	while ((bit = ffs(mask)) != 0) {
 		sc->sc_lpiconf.base[irqbase + bit - 1] &= ~GIC_LPICONF_Enable;
+		if (sc->sc_lpiconf_flush)
+			cpu_dcache_wb_range((vaddr_t)&sc->sc_lpiconf.base[irqbase + bit - 1], 1);
 		mask &= ~__BIT(bit - 1);
 	}
 
-	bus_dmamap_sync(sc->sc_dmat, sc->sc_lpiconf.map, irqbase, 32, BUS_DMASYNC_PREWRITE);
+	if (!sc->sc_lpiconf_flush)
+		__asm __volatile ("dsb ishst");
 }
 
 static void
@@ -543,7 +551,10 @@ gicv3_lpi_establish_irq(struct pic_softc
 
 	sc->sc_lpiconf.base[is->is_irq] = IPL_TO_LPIPRIO(sc, is->is_ipl) | GIC_LPICONF_Res1;
 
-	bus_dmamap_sync(sc->sc_dmat, sc->sc_lpiconf.map, is->is_irq, 1, BUS_DMASYNC_PREWRITE);
+	if (sc->sc_lpiconf_flush)
+		cpu_dcache_wb_range((vaddr_t)&sc->sc_lpiconf.base[is->is_irq], 1);
+	else
+		__asm __volatile ("dsb ishst");
 }
 
 static void
@@ -551,6 +562,7 @@ gicv3_lpi_cpu_init(struct pic_softc *pic
 {
 	struct gicv3_softc * const sc = LPITOSOFTC(pic);
 	struct gicv3_lpi_callback *cb;
+	uint64_t propbase, pendbase;
 	uint32_t ctlr;
 
 	/* If physical LPIs are not supported on this redistributor, just return. */
@@ -568,18 +580,36 @@ gicv3_lpi_cpu_init(struct pic_softc *pic
 	arm_dsb();
 
 	/* Setup the LPI configuration table */
-	const uint64_t propbase = sc->sc_lpiconf.segs[0].ds_addr |
+	propbase = sc->sc_lpiconf.segs[0].ds_addr |
 	__SHIFTIN(ffs(pic->pic_maxsources) - 1, GICR_PROPBASER_IDbits) |
-	__SHIFTIN(GICR_Shareability_NS, GICR_PROPBASER_Shareability) |
-	__SHIFTIN(GICR_Cache_NORMAL_NC, GICR_PROPBASER_InnerCache);
+	__SHIFTIN(GICR_Shareability_IS, GICR_PROPBASER_Shareability) |
+	__SHIFTIN(GICR_Cache_NORMAL_RA_WA_WB, GICR_PROPBASER_InnerCache);
 	gicr_write_8(sc, ci->ci_gic_redist, GICR_PROPBASER, propbase);
+	propbase = gicr_read_8(sc, ci->ci_gic_redist, GICR_PROPBASER);
+	if (__SHIFTOUT(propbase, GICR_PROPBASER_Shareability) != GICR_Shareability_IS) {
+		if (__SHIFTOUT(propbase, GICR_PROPBASER_Shareability) == GICR_Shareability_NS) {
+			propbase &= ~GICR_PROPBASER_Shareability;
+			propbase |= __SHIFTIN(GICR_Shareability_NS, GICR_PROPBASER_Shareability);
+			propbase &= ~GICR_PROPBASER_InnerCache;
+			propbase |= __SHIFTIN(GICR_Cache_NORMAL_NC, GICR_PROPBASER_InnerCache);
+			gicr_write_8(sc, ci->ci_gic_redist, GICR_PROPBASER, propbase);
+		}
+		sc->sc_lpiconf_flush = true;
+	}
 
 	/* Setup the LPI pending table */
-	const uint64_t pendbase = sc->sc_lpipend[cpu_index(ci)].segs[0].ds_addr |
-	__SHIFTIN(GICR_Shareability_NS, GICR_PENDBASER_Shareability) |
-	__SHIFTIN(GICR_Cache_NORMAL_NC, GICR_PENDBASER_InnerCache) |
-	GICR_PENDBASER_PTZ;
+	pendbase = sc->sc_lpipend[cpu_index(ci)].segs[0].ds_addr |
+	__SHIFTIN(GICR_Shareability_IS, GICR_PENDBASER_Shareability) |
+	__SHIFTIN(GICR_Cache_NORMAL_RA_WA_WB, GICR_PENDBASER_InnerCache);
 	gicr_write_8(sc, ci->ci_gic_redist, GICR_PENDBASER, pendbase);
+	pendbase = gicr_read_8(sc, ci->ci_gic_redist, GICR_PENDBASER);
+	if (__SHIFTOUT(pendbase, GICR_PENDBASER_Shareability) == GICR_Shareability_NS) {
+		pendbase &= ~GICR_PENDBASER_Shareability;
+		pendbase |= __SHIFTIN(GICR_Shareability_NS, GI

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

2019-06-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 30 11:11:38 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3.c gicv3.h

Log Message:
Fix size of LPI pending table allocation and enable caching of LPI conf
and pending tables where possible.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/cortex/gicv3.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/gicv3.h

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



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

2019-06-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 30 10:10:20 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Enable caching of ITS tables when possible


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.19 src/sys/arch/arm/cortex/gicv3_its.c:1.20
--- src/sys/arch/arm/cortex/gicv3_its.c:1.19	Sat Jun 29 16:48:07 2019
+++ src/sys/arch/arm/cortex/gicv3_its.c	Sun Jun 30 10:10:19 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.19 2019/06/29 16:48:07 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.20 2019/06/30 10:10:19 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.19 2019/06/29 16:48:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.20 2019/06/30 10:10:19 jmcneill Exp $");
 
 #include 
 #include 
@@ -627,7 +627,8 @@ gicv3_its_table_init(struct gicv3_softc 
 
 	/* devbits and innercache defaults */
 	u_int devbits = __SHIFTOUT(typer, GITS_TYPER_Devbits) + 1;
-	u_int innercache = GITS_Cache_NORMAL_NC;
+	u_int innercache = GITS_Cache_NORMAL_WA_WB;
+	u_int share = GITS_Shareability_IS;
 
 	uint32_t iidr = gits_read_4(its, GITS_IIDR);
 	const uint32_t ctx =
@@ -697,10 +698,18 @@ gicv3_its_table_init(struct gicv3_softc 
 		baser &= ~GITS_BASER_InnerCache;
 		baser |= __SHIFTIN(innercache, GITS_BASER_InnerCache);
 		baser &= ~GITS_BASER_Shareability;
-		baser |= __SHIFTIN(GITS_Shareability_NS, GITS_BASER_Shareability);
+		baser |= __SHIFTIN(share, GITS_BASER_Shareability);
 		baser |= GITS_BASER_Valid;
 
 		gits_write_8(its, GITS_BASERn(tab), baser);
+
+		baser = gits_read_8(its, GITS_BASERn(tab));
+		if (__SHIFTOUT(baser, GITS_BASER_Shareability) == GITS_Shareability_NS) {
+			baser &= ~GITS_BASER_InnerCache;
+			baser |= __SHIFTIN(GITS_Cache_NORMAL_NC, GITS_BASER_InnerCache);
+
+			gits_write_8(its, GITS_BASERn(tab), baser);
+		}
 	}
 }
 



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

2019-06-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 30 10:10:20 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Enable caching of ITS tables when possible


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/cortex/gicv3_its.c

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



CVS commit: src/sys/compat/sys

2019-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 08:49:21 UTC 2019

Modified Files:
src/sys/compat/sys: siginfo.h

Log Message:
Provide the compat structures even if not building 64bit kernels, as
we have same-bitness netbsd32 emulations for different ABIs on some
architectures.


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

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



CVS commit: src/sys/compat/sys

2019-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 08:49:21 UTC 2019

Modified Files:
src/sys/compat/sys: siginfo.h

Log Message:
Provide the compat structures even if not building 64bit kernels, as
we have same-bitness netbsd32 emulations for different ABIs on some
architectures.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/siginfo.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/compat/sys/siginfo.h
diff -u src/sys/compat/sys/siginfo.h:1.6 src/sys/compat/sys/siginfo.h:1.7
--- src/sys/compat/sys/siginfo.h:1.6	Thu Jun 27 01:58:49 2019
+++ src/sys/compat/sys/siginfo.h	Sun Jun 30 08:49:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: siginfo.h,v 1.6 2019/06/27 01:58:49 christos Exp $	 */
+/*	$NetBSD: siginfo.h,v 1.7 2019/06/30 08:49:21 martin Exp $	 */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #ifndef	_COMPAT_SYS_SIGINFO_H_
 #define	_COMPAT_SYS_SIGINFO_H_
 
-#if defined(_LP64) && defined(_KERNEL)
+#ifdef _KERNEL
 
 typedef union sigval32 {
 	int sival_int;
@@ -83,6 +83,6 @@ typedef union siginfo32 {
 	struct __ksiginfo32 _info;
 } siginfo32_t;
 
-#endif /* _LP64 && _KERNEL */
+#endif /* _KERNEL */
 
 #endif /* !_COMPAT_SYS_SIGINFO_H_ */