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

2020-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 14 05:22:25 UTC 2020

Modified Files:
src/tests/usr.sbin/cpuctl: t_cpuctl.sh

Log Message:
Fix a few copy + pastos, simplify shell arithmetic


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.sbin/cpuctl/t_cpuctl.sh

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

Modified files:

Index: src/tests/usr.sbin/cpuctl/t_cpuctl.sh
diff -u src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.4 src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.5
--- src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.4	Mon Jul 13 13:16:07 2020
+++ src/tests/usr.sbin/cpuctl/t_cpuctl.sh	Fri Aug 14 05:22:25 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_cpuctl.sh,v 1.4 2020/07/13 13:16:07 jruoho Exp $
+# $NetBSD: t_cpuctl.sh,v 1.5 2020/08/14 05:22:25 martin Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -39,14 +39,14 @@ setcpu() {
 
 	while [ $ncpu -gt 1 ]; do
 
-		cpuid=$(expr $ncpu - 1)
+		cpuid=$(( $ncpu - 1 ))
 		cpuctl $1 $cpuid >/dev/null 2>&1
 
 		if [ ! $? -eq 0 ]; then
 			$2 $3
 		fi
 
-		ncpu=$(expr $ncpu - 1)
+		ncpu=$(( $ncpu - 1 ))
 	done
 
 	# Additional check that interrupts cannot be
@@ -65,7 +65,7 @@ clean() {
 
 	while read line; do
 
-		i=$(expr $i + 1)
+		i=$(( $i + 1 ))
 
 		if [ $i -lt 3 ]; then
 			continue
@@ -95,7 +95,7 @@ ncpu_head() {
 ncpu_body() {
 
 	lst=$(cpuctl list | wc -l)
-	ncpu=$(expr $lst - 2)
+	ncpu=$(( $lst - 2 ))
 
 	if [ $ncpu -eq 1 ]; then
 		atf_pass
@@ -132,13 +132,13 @@ err_body() {
 		-o empty -x cpuctl nointr -1
 
 	atf_check -s exit:1 -e ignore \
-		-o empty -x cpuctl identify $(expr ncpu + 1)
+		-o empty -x cpuctl identify $(( $ncpu + 1 ))
 
 	atf_check -s exit:1 -e ignore \
-		  -o empty -x cpuctl offline $(expr ncpu + 1)
+		  -o empty -x cpuctl offline $(( $ncpu + 1 ))
 
 	atf_check -s exit:1 -e ignore \
-		-o empty -x cpuctl nointr $(expr ncpu + 1)
+		-o empty -x cpuctl nointr $(( $ncpu + 1 ))
 }
 
 err_cleanup() {
@@ -159,9 +159,9 @@ identify_body() {
 	ncpu=$(sysctl -n hw.ncpu)
 
 	while [ $ncpu -gt 0 ]; do
-		cpuid=$(expr $ncpu - 1)
+		cpuid=$(( $ncpu - 1 ))
 		atf_check -s exit:0 -o not-empty -x cpuctl identify $cpuid
-		ncpu=$(expr $ncpu - 1)
+		ncpu=$(( $ncpu - 1 ))
 	done
 
 	atf_pass



CVS commit: src/sys/arch/x68k/stand/xxboot

2020-08-13 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 14 03:54:46 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot xxboot.ldscript

Log Message:
Reduce binary size as possible.  These reduce filesize about 20 words.
- Use word alignment (rather than longword alignment) for text/data section.
- Use short reference.  In the bootloader, all symbols can be expressed in
  short.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript

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/x68k/stand/xxboot/Makefile.xxboot
diff -u src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.16 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.17
--- src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.16	Fri Aug 14 03:40:47 2020
+++ src/sys/arch/x68k/stand/xxboot/Makefile.xxboot	Fri Aug 14 03:54:46 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.xxboot,v 1.16 2020/08/14 03:40:47 isaki Exp $
+#	$NetBSD: Makefile.xxboot,v 1.17 2020/08/14 03:54:46 isaki Exp $
 
 NOMAN=		# defined
 
@@ -40,6 +40,7 @@ CPPFLAGS+= -DHEAP_START=0x0010
 CPPFLAGS+= -nostdinc -I${.OBJDIR} -I${S}
 CPPFLAGS+= -I$M/stand/libiocs -I$M/stand/libsa -I$M/stand/common
 AFLAGS=	   ${CFLAGS:M-[ID]*}
+AFLAGS+=   -Wa,-l
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/../xxboot.ldscript
 LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
 LINKFLAGS+=  --defsym=BOOT_TEXTADDR=$(BOOT_TEXT)

Index: src/sys/arch/x68k/stand/xxboot/xxboot.ldscript
diff -u src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.8 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.9
--- src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.8	Fri Aug 14 03:25:39 2020
+++ src/sys/arch/x68k/stand/xxboot/xxboot.ldscript	Fri Aug 14 03:54:46 2020
@@ -8,6 +8,8 @@ SECTIONS
 {
   . = TEXTADDR;
   .text :
+  ALIGN(2)
+  SUBALIGN(2)
   {
 CREATE_OBJECT_SYMBOLS
 *(.text)
@@ -24,6 +26,8 @@ SECTIONS
 _etext = .;
   }
   .data :
+  ALIGN(2)
+  SUBALIGN(2)
   {
 /* The first three sections are for SunOS dynamic linking.  */
 *(.dynamic)



CVS commit: src/sys/arch/x68k/stand/xxboot

2020-08-13 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 14 03:43:28 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/xxboot: bootmain.c

Log Message:
Use DEV_OPEN() macro.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x68k/stand/xxboot/bootmain.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/x68k/stand/xxboot/bootmain.c
diff -u src/sys/arch/x68k/stand/xxboot/bootmain.c:1.6 src/sys/arch/x68k/stand/xxboot/bootmain.c:1.7
--- src/sys/arch/x68k/stand/xxboot/bootmain.c:1.6	Fri Aug 14 03:34:22 2020
+++ src/sys/arch/x68k/stand/xxboot/bootmain.c	Fri Aug 14 03:43:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootmain.c,v 1.6 2020/08/14 03:34:22 isaki Exp $	*/
+/*	$NetBSD: bootmain.c,v 1.7 2020/08/14 03:43:28 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994 Takumi Nakamura.
@@ -163,5 +163,5 @@ devopen(struct open_file *f, const char 
 {
 
 	*file = __UNCONST(fname);
-	return xxopen(f);
+	return DEV_OPEN()(f);
 }



CVS commit: src/sys/arch/x68k/stand/xxboot

2020-08-13 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 14 03:40:48 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2: Makefile

Log Message:
Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
cvs rdiff -u -r1.2 -r1.3 \
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile

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/x68k/stand/xxboot/Makefile.xxboot
diff -u src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.15 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.16
--- src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.15	Fri Aug 14 03:29:23 2020
+++ src/sys/arch/x68k/stand/xxboot/Makefile.xxboot	Fri Aug 14 03:40:47 2020
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile.xxboot,v 1.15 2020/08/14 03:29:23 isaki Exp $
+#	$NetBSD: Makefile.xxboot,v 1.16 2020/08/14 03:40:47 isaki Exp $
 
 NOMAN=		# defined
 
 .include 
 
-BOOT=	$(DEV)boot_$(FS)
+BOOT=	xxboot_$(FS)
 VERSIONFILE=	${.CURDIR}/../version
 VERSION!=	${TOOL_AWK} -F: '$$1 ~ /^[0-9.]*$$/ { it = $$1; } \
 			END { print it }' ${VERSIONFILE}
@@ -25,7 +25,7 @@ BINMODE=	444
 S=		${.CURDIR}/../../../../..
 M=		$S/arch/x68k
 .PATH:		${.CURDIR}/..
-SRCS=	boot.S bootmain.c conf.c consio1.c $(DEVDRV).c
+SRCS=	boot.S bootmain.c conf.c consio1.c xx.c
 
 .include "${S}/conf/newvers_stand.mk"
 
@@ -51,7 +51,7 @@ LDLIBS+=  -L${LIBIOCS} -liocs
 
 .PATH: $S/lib/libsa
 CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=$(FS)
-CPPFLAGS+= -DLIBSA_SINGLE_DEVICE=$(DEV)
+CPPFLAGS+= -DLIBSA_SINGLE_DEVICE=xx
 CPPFLAGS+= -DLIBSA_NO_FD_CHECKING
 CPPFLAGS+= -DLIBSA_NO_FS_WRITE
 CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS

Index: src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile
diff -u src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile:1.2 src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile:1.3
--- src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile:1.2	Sat Nov 17 19:10:46 2012
+++ src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile	Fri Aug 14 03:40:47 2020
@@ -1,7 +1,5 @@
-#	$NetBSD: Makefile,v 1.2 2012/11/17 19:10:46 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.3 2020/08/14 03:40:47 isaki Exp $
 
-DEV=		xx
-DEVDRV=		xx
 FS=		cd9660
 BOOTCPPFLAGS=	-DCDBOOT
 

Index: src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile
diff -u src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile:1.4 src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile:1.5
--- src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile:1.4	Sat Nov 17 19:10:47 2012
+++ src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile	Fri Aug 14 03:40:47 2020
@@ -1,7 +1,5 @@
-#	$NetBSD: Makefile,v 1.4 2012/11/17 19:10:47 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.5 2020/08/14 03:40:47 isaki Exp $
 
-DEV=		xx
-DEVDRV=		xx
 FS=		ffsv1
 BOOTCPPFLAGS=	-DSDBOOT -DFDBOOT
 

Index: src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile
diff -u src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile:1.4 src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile:1.5
--- src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile:1.4	Sat Nov 17 19:10:47 2012
+++ src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile	Fri Aug 14 03:40:47 2020
@@ -1,7 +1,5 @@
-#	$NetBSD: Makefile,v 1.4 2012/11/17 19:10:47 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.5 2020/08/14 03:40:47 isaki Exp $
 
-DEV=		xx
-DEVDRV=		xx
 FS=		ffsv2
 BOOTCPPFLAGS=	-DSDBOOT -DFDBOOT
 

Index: src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile
diff -u src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile:1.4 src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile:1.5
--- src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile:1.4	Sat Nov 17 19:10:47 2012
+++ src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile	Fri Aug 14 03:40:47 2020
@@ -1,7 +1,5 @@
-#	$NetBSD: Makefile,v 1.4 2012/11/17 19:10:47 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.5 2020/08/14 03:40:47 isaki Exp $
 
-DEV=		xx
-DEVDRV=		xx
 FS=		lfsv1
 BOOTCPPFLAGS=	-DSDBOOT -DFDBOOT
 

Index: src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile
diff -u src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile:1.4 src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile:1.5
--- src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile:1.4	Sat Nov 17 19:10:47 2012
+++ 

CVS commit: src/sys/arch/x68k/stand/xxboot

2020-08-13 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 14 03:34:22 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/xxboot: bootmain.c xx.c
Added Files:
src/sys/arch/x68k/stand/xxboot: xxboot.h

Log Message:
Add xxboot.h common header to share prototype definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/xxboot/bootmain.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/xxboot/xx.c
cvs rdiff -u -r0 -r1.3 src/sys/arch/x68k/stand/xxboot/xxboot.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/x68k/stand/xxboot/bootmain.c
diff -u src/sys/arch/x68k/stand/xxboot/bootmain.c:1.5 src/sys/arch/x68k/stand/xxboot/bootmain.c:1.6
--- src/sys/arch/x68k/stand/xxboot/bootmain.c:1.5	Fri Aug 14 02:51:48 2020
+++ src/sys/arch/x68k/stand/xxboot/bootmain.c	Fri Aug 14 03:34:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootmain.c,v 1.5 2020/08/14 02:51:48 isaki Exp $	*/
+/*	$NetBSD: bootmain.c,v 1.6 2020/08/14 03:34:22 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994 Takumi Nakamura.
@@ -39,25 +39,12 @@
 #include 
 #include 
 
+#include "xxboot.h"
 #include "libx68k.h"
 #include "iocs.h"
 #include "exec_image.h"
 
 #define EXSCSI_BDID	((void *)0x00ea0001)
-#define BINF_ISFD(pbinf)	(*((uint8_t *)(pbinf) + 1) == 0)
-
-/* boot.S */
-extern int badbaddr(volatile void *);
-extern unsigned int ID;		/* target SCSI ID */
-extern unsigned int BOOT_INFO;	/* result of IOCS(__BOOTINF) */
-extern struct {
-	struct fdfmt{
-		uint8_t	N;	/* sector length 0: 128, ..., 3: 1K */
-		uint8_t	C;	/* cylinder # */
-		uint8_t	H;	/* head # */
-		uint8_t	R;	/* sector # */
-	} minsec, maxsec;
-} FDSECMINMAX;			/* FD format type of the first track */
 
 /* for debug */
 unsigned int startregs[16];
@@ -107,8 +94,6 @@ get_scsi_host_adapter(char *devstr)
 	return ha;
 }
 
-extern const char bootprog_name[], bootprog_rev[];
-
 void
 bootmain(void)
 {

Index: src/sys/arch/x68k/stand/xxboot/xx.c
diff -u src/sys/arch/x68k/stand/xxboot/xx.c:1.2 src/sys/arch/x68k/stand/xxboot/xx.c:1.3
--- src/sys/arch/x68k/stand/xxboot/xx.c:1.2	Sat Nov 17 16:02:00 2012
+++ src/sys/arch/x68k/stand/xxboot/xx.c	Fri Aug 14 03:34:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xx.c,v 1.2 2012/11/17 16:02:00 tsutsui Exp $	*/
+/*	$NetBSD: xx.c,v 1.3 2020/08/14 03:34:22 isaki Exp $	*/
 
 /*
  * Copyright (c) 2010 MINOURA Makoto.
@@ -28,7 +28,7 @@
 #include 
 #include 
 
-extern void RAW_READ(void *buf, uint32_t blkpos, size_t bytelen);
+#include "xxboot.h"
 
 int
 xxopen(struct open_file *f, ...)

Added files:

Index: src/sys/arch/x68k/stand/xxboot/xxboot.h
diff -u /dev/null src/sys/arch/x68k/stand/xxboot/xxboot.h:1.3
--- /dev/null	Fri Aug 14 03:34:22 2020
+++ src/sys/arch/x68k/stand/xxboot/xxboot.h	Fri Aug 14 03:34:22 2020
@@ -0,0 +1,51 @@
+/*	$NetBSD: xxboot.h,v 1.3 2020/08/14 03:34:22 isaki Exp $	*/
+
+/*
+ * Copyright (C) 2020 Tetsuya Isaki. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#define BINF_ISFD(pbinf)	(*((uint8_t *)(pbinf) + 1) == 0)
+
+/* boot.S */
+extern void RAW_READ(void *, uint32_t, size_t);
+extern int badbaddr(volatile void *);
+extern unsigned int BOOT_INFO;	/* result of IOCS(__BOOTINF) */
+extern unsigned int ID;		/* target SCSI ID */
+extern struct {
+	struct fdfmt{
+		uint8_t	N;	/* sector length 0: 128, ..., 3: 1K */
+		uint8_t	C;	/* cylinder # */
+		uint8_t	H;	/* head # */
+		uint8_t	R;	/* sector # */
+	} minsec, maxsec;
+} FDSECMINMAX;			/* FD format type of the first track */
+
+/* xx.c */
+extern int xxopen(struct open_file *, ...);
+extern int xxclose(struct open_file *);
+extern int xxstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+
+/* vers.c */
+extern 

CVS commit: src/sys/arch/x68k/stand

2020-08-13 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 14 03:29:23 UTC 2020

Modified Files:
src/sys/arch/x68k/stand: Makefile
src/sys/arch/x68k/stand/xxboot: Makefile Makefile.xxboot

Log Message:
Style fixes.  One entry per line for some parts.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x68k/stand/Makefile
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x68k/stand/xxboot/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot

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/x68k/stand/Makefile
diff -u src/sys/arch/x68k/stand/Makefile:1.13 src/sys/arch/x68k/stand/Makefile:1.14
--- src/sys/arch/x68k/stand/Makefile:1.13	Fri Oct 12 20:15:52 2012
+++ src/sys/arch/x68k/stand/Makefile	Fri Aug 14 03:29:23 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2012/10/12 20:15:52 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.14 2020/08/14 03:29:23 isaki Exp $
 
 # host tools
 SUBDIR= newdisk installboot
@@ -8,7 +8,9 @@ SUBDIR+= libdos libiocs libsa .WAIT
 
 # standalone bootloaders
 SUBDIR+= mboot
-SUBDIR+= boot_ufs boot_ustar xxboot
+SUBDIR+= boot_ufs
+SUBDIR+= boot_ustar
+SUBDIR+= xxboot
 SUBDIR+= boot netboot
 
 # Human68k utility

Index: src/sys/arch/x68k/stand/xxboot/Makefile
diff -u src/sys/arch/x68k/stand/xxboot/Makefile:1.15 src/sys/arch/x68k/stand/xxboot/Makefile:1.16
--- src/sys/arch/x68k/stand/xxboot/Makefile:1.15	Tue Mar 20 13:01:32 2012
+++ src/sys/arch/x68k/stand/xxboot/Makefile	Fri Aug 14 03:29:23 2020
@@ -1,5 +1,9 @@
-#	$NetBSD: Makefile,v 1.15 2012/03/20 13:01:32 minoura Exp $
+#	$NetBSD: Makefile,v 1.16 2020/08/14 03:29:23 isaki Exp $
 
-SUBDIR=	cdboot_cd9660 xxboot_ffsv1 xxboot_ffsv2 xxboot_lfsv1 xxboot_lfsv2
+SUBDIR+=	cdboot_cd9660
+SUBDIR+=	xxboot_ffsv1
+SUBDIR+=	xxboot_ffsv2
+SUBDIR+=	xxboot_lfsv1
+SUBDIR+=	xxboot_lfsv2
 
 .include 

Index: src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
diff -u src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.14 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.15
--- src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.14	Fri Aug 14 03:25:39 2020
+++ src/sys/arch/x68k/stand/xxboot/Makefile.xxboot	Fri Aug 14 03:29:23 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.xxboot,v 1.14 2020/08/14 03:25:39 isaki Exp $
+#	$NetBSD: Makefile.xxboot,v 1.15 2020/08/14 03:29:23 isaki Exp $
 
 NOMAN=		# defined
 
@@ -52,7 +52,10 @@ LDLIBS+=  -L${LIBIOCS} -liocs
 .PATH: $S/lib/libsa
 CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=$(FS)
 CPPFLAGS+= -DLIBSA_SINGLE_DEVICE=$(DEV)
-CPPFLAGS+= -DLIBSA_NO_TWIDDLE -DLIBSA_NO_FD_CHECKING -DLIBSA_NO_RAW_ACCESS -DLIBSA_NO_FS_WRITE
+CPPFLAGS+= -DLIBSA_NO_FD_CHECKING
+CPPFLAGS+= -DLIBSA_NO_FS_WRITE
+CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS
+CPPFLAGS+= -DLIBSA_NO_TWIDDLE
 SRCS+=	open.c close.c read.c lseek.c loadfile.c loadfile_aout.c alloc.c
 SRCS+=  $(FS).c
 



CVS commit: src/sys/arch/x68k/stand/xxboot

2020-08-13 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 14 03:25:39 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot xxboot.ldscript

Log Message:
- Restore display of first_kbyte.  This is helpful for development.
- Check the filesize of resulting file instead of section sizes.
  If there is a gap between sections, the filesize may be exceeded even
  though the section total is not exceeded.  Of course that doesn't
  usually happen but I've experienced this during development.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript

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/x68k/stand/xxboot/Makefile.xxboot
diff -u src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.13 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.14
--- src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.13	Mon Aug 10 07:00:49 2020
+++ src/sys/arch/x68k/stand/xxboot/Makefile.xxboot	Fri Aug 14 03:25:39 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.xxboot,v 1.13 2020/08/10 07:00:49 rin Exp $
+#	$NetBSD: Makefile.xxboot,v 1.14 2020/08/14 03:25:39 isaki Exp $
 
 NOMAN=		# defined
 
@@ -61,10 +61,19 @@ SRCS+=	exec_image.S
 
 .include "${.CURDIR}/../../Makefile.booters"
 
+CLEANFILES+=	${PROG}.map
+
 
 ${PROG}: $(OBJS)
 	${_MKTARGET_LINK}
-	$(LD) $(LINKFLAGS) -o ${PROG} $(OBJS) $(LDLIBS)
+	$(LD) $(LINKFLAGS) -Map=${PROG}.map -o ${PROG} $(OBJS) $(LDLIBS)
+	: Print some addresses for convenience
+	@${TOOL_AWK} '/first_kbyte$$/ { print "\t\t" $$2 "\t" $$1 }' ${PROG}.map
+	@echo "		filesize	"`${TOOL_STAT} -f %z ${PROG}`
+	@if [ `${TOOL_STAT} -f %z ${PROG}` -gt 8192 ]; then \
+	echo "${PROG} filesize exceeds 8192 bytes"; \
+		exit 1; \
+	fi
 	${TOUCHPROG}
 
 .include 

Index: src/sys/arch/x68k/stand/xxboot/xxboot.ldscript
diff -u src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.7 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.8
--- src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.7	Tue Jan 28 11:57:22 2020
+++ src/sys/arch/x68k/stand/xxboot/xxboot.ldscript	Fri Aug 14 03:25:39 2020
@@ -48,6 +48,4 @@ SECTIONS
 }
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
-ASSERT(_edata - TEXTADDR <= TEXTDATASIZE,
-"Error: text+data is too large to bootarea");
 ASSERT(_end <= BOOT_TEXTADDR, "Error: _end conflicts BOOT_TEXT");



CVS commit: src/sys/arch/x68k/stand/xxboot

2020-08-13 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 14 02:51:48 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/xxboot: bootmain.c

Log Message:
Make compilable even with XXBOOT_DEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/xxboot/bootmain.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/x68k/stand/xxboot/bootmain.c
diff -u src/sys/arch/x68k/stand/xxboot/bootmain.c:1.4 src/sys/arch/x68k/stand/xxboot/bootmain.c:1.5
--- src/sys/arch/x68k/stand/xxboot/bootmain.c:1.4	Sat Nov 17 19:10:46 2012
+++ src/sys/arch/x68k/stand/xxboot/bootmain.c	Fri Aug 14 02:51:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootmain.c,v 1.4 2012/11/17 19:10:46 tsutsui Exp $	*/
+/*	$NetBSD: bootmain.c,v 1.5 2020/08/14 02:51:48 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994 Takumi Nakamura.
@@ -135,7 +135,8 @@ bootmain(void)
 		/* floppy */
 #ifdef XXBOOT_DEBUG
 		*(uint32_t *)bootdevstr =
-		('f' << 24 | 'd' << 16 | '@' << 8 | '0' + (BOOT_INFO & 3));
+		('f' << 24) | ('d' << 16) | ('@' << 8) |
+		('0' + (BOOT_INFO & 3));
 		bootdevstr[4] = '\0';
 #endif
 		/* fdNa for 1024 bytes/sector, fdNc for 512 bytes/sector */



CVS commit: src/doc

2020-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 14 01:14:17 UTC 2020

Modified Files:
src/doc: CHANGES

Log Message:
Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2728 -r1.2729 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2728 src/doc/CHANGES:1.2729
--- src/doc/CHANGES:1.2728	Fri Aug 14 01:07:56 2020
+++ src/doc/CHANGES	Fri Aug 14 01:14:17 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2728 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2729 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -212,7 +212,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	libuv: Import version 1.38.0. [christos 20200524]
 	bind: Import version 9.16.3. [christos 20200524]
 	tzcode: Updated to 2020a. [christos 20200525]
-	ntp: Import ntp 4.2.8p14. [christos 20200525] 
+	ntp: Import ntp 4.2.8p14. [christos 20200525]
 	acpi(4): Updated ACPICA to 20200430. [christos 20200525]
 	postfix(1): Import version 3.5.2. [christos 20200525]
 	OpenSSH: Import 8.3. [christos 20200528]



CVS commit: src/doc

2020-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 14 01:07:57 UTC 2020

Modified Files:
src/doc: CHANGES

Log Message:
Note getrandom.


To generate a diff of this commit:
cvs rdiff -u -r1.2727 -r1.2728 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2727 src/doc/CHANGES:1.2728
--- src/doc/CHANGES:1.2727	Tue Aug 11 13:18:04 2020
+++ src/doc/CHANGES	Fri Aug 14 01:07:56 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2727 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2728 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -270,3 +270,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	bind: Import version 9.16.5. [christos 20200803]
 	dhcp: Import version 4.4.2. [christos 20200803]
 	openldap: Import 2.4.50. [christos 20200811]
+	kernel: Add getrandom system call. [riastradh 20200813]



CVS commit: src/sys

2020-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 14 00:55:03 UTC 2020

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

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.323 -r1.324 src/sys/kern/syscalls.c
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/systrace_args.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/rump.sysmap
cvs rdiff -u -r1.122 -r1.123 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.153 -r1.154 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.317 -r1.318 src/sys/sys/syscall.h
cvs rdiff -u -r1.301 -r1.302 src/sys/sys/syscallargs.h

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

Modified files:

Index: src/sys/kern/init_sysent.c
diff -u src/sys/kern/init_sysent.c:1.335 src/sys/kern/init_sysent.c:1.336
--- src/sys/kern/init_sysent.c:1.335	Thu Jun 11 03:45:30 2020
+++ src/sys/kern/init_sysent.c	Fri Aug 14 00:55:02 2020
@@ -1,14 +1,14 @@
-/* $NetBSD: init_sysent.c,v 1.335 2020/06/11 03:45:30 dholland Exp $ */
+/* $NetBSD: init_sysent.c,v 1.336 2020/08/14 00:55:02 riastradh Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.305 2020/05/16 18:31:50 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.306 2020/08/14 00:53:16 riastradh Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.335 2020/06/11 03:45:30 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.336 2020/08/14 00:55:02 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -530,8 +530,10 @@ struct sysent sysent[] = {
 		.sy_call = (sy_call_t *)sys_dup2
 	},		/* 90 = dup2 */
 	{
-		.sy_call = sys_nosys,
-	},		/* 91 = filler */
+		ns(struct sys_getrandom_args),
+		.sy_flags = SYCALL_ARG_PTR,
+		.sy_call = (sy_call_t *)sys_getrandom
+	},		/* 91 = getrandom */
 	{
 		ns(struct sys_fcntl_args),
 		.sy_flags = SYCALL_ARG_PTR,

Index: src/sys/kern/syscalls.c
diff -u src/sys/kern/syscalls.c:1.323 src/sys/kern/syscalls.c:1.324
--- src/sys/kern/syscalls.c:1.323	Thu Jun 11 03:45:30 2020
+++ src/sys/kern/syscalls.c	Fri Aug 14 00:55:02 2020
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls.c,v 1.323 2020/06/11 03:45:30 dholland Exp $ */
+/* $NetBSD: syscalls.c,v 1.324 2020/08/14 00:55:02 riastradh Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.305 2020/05/16 18:31:50 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.306 2020/08/14 00:53:16 riastradh Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.323 2020/06/11 03:45:30 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.324 2020/08/14 00:55:02 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #ifdef _KERNEL_OPT
@@ -121,7 +121,7 @@ const char *const syscallnames[] = {
 	/*  88 */	"compat_43_osethostname",
 	/*  89 */	"compat_43_ogetdtablesize",
 	/*  90 */	"dup2",
-	/*  91 */	"#91 (unimplemented getdopt)",
+	/*  91 */	"getrandom",
 	/*  92 */	"fcntl",
 	/*  93 */	"compat_50_select",
 	/*  94 */	"#94 (unimplemented setdopt)",
@@ -658,7 +658,7 @@ const char *const altsyscallnames[] = {
 	/*  88 */	NULL, /* compat_43_osethostname */
 	/*  89 */	NULL, /* compat_43_ogetdtablesize */
 	/*  90 */	NULL, /* dup2 */
-	/*  91 */	NULL, /* unimplemented getdopt */
+	/*  91 */	NULL, /* getrandom */
 	/*  92 */	NULL, /* fcntl */
 	/*  93 */	NULL, /* compat_50_select */
 	/*  94 */	NULL, /* unimplemented setdopt */

Index: src/sys/kern/systrace_args.c
diff -u src/sys/kern/systrace_args.c:1.42 src/sys/kern/systrace_args.c:1.43
--- src/sys/kern/systrace_args.c:1.42	Thu Jun 11 03:45:30 2020
+++ src/sys/kern/systrace_args.c	Fri Aug 14 00:55:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: systrace_args.c,v 1.42 2020/06/11 03:45:30 dholland Exp $ */
+/* $NetBSD: systrace_args.c,v 1.43 2020/08/14 00:55:02 riastradh Exp $ */
 
 /*
  * System call argument to DTrace register array converstion.
@@ -663,6 +663,15 @@ systrace_args(register_t sysnum, const v
 		*n_args = 2;
 		break;
 	}
+	/* sys_getrandom */
+	case 91: {
+		const struct sys_getrandom_args *p = params;
+		uarg[0] = (intptr_t) SCARG(p, buf); /* void * */
+		uarg[1] = SCARG(p, buflen); /* size_t */
+		uarg[2] = SCARG(p, flags); /* unsigned int */
+		*n_args = 3;
+		break;
+	}
 	/* sys_fcntl */
 	case 92: {
 		const struct sys_fcntl_args *p = params;
@@ -4868,6 +4877,22 @@ systrace_entry_setargdesc(int sysnum, in
 			break;
 		};
 		break;
+	/* sys_getrandom */
+	case 91:
+		switch(ndx) {
+		case 0:
+			p = "void *";
+			break;
+		case 1:
+			p = "size_t";
+			break;
+		case 2:
+			p = "unsigned int";
+			break;
+		

CVS commit: src

2020-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 14 00:53:16 UTC 2020

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/lib/libc/sys: Makefile.inc
src/sys/dev: random.c
src/sys/kern: files.kern kern_entropy.c syscalls.master
src/sys/rump/librump/rumpkern: Makefile.rumpkern
src/sys/sys: Makefile entropy.h
src/tests/lib/libc/sys: Makefile
Added Files:
src/lib/libc/sys: getrandom.2
src/sys/kern: sys_getrandom.c
src/sys/sys: random.h
src/tests/lib/libc/sys: t_getrandom.c

Log Message:
New system call getrandom() compatible with Linux and others.

Three ways to call:

getrandom(p, n, 0)  Blocks at boot until full entropy.
Returns up to n bytes at p; guarantees
up to 256 bytes even if interrupted
after blocking.  getrandom(0,0,0)
serves as an entropy barrier: return
only after system has full entropy.

getrandom(p, n, GRND_INSECURE)  Never blocks.  Guarantees up to 256
bytes even if interrupted.  Equivalent
to /dev/urandom.  Safe only after
successful getrandom(...,0),
getrandom(...,GRND_RANDOM), or read
from /dev/random.

getrandom(p, n, GRND_RANDOM)May block at any time.  Returns up to n
bytes at p, but no guarantees about how
many -- may return as short as 1 byte.
Equivalent to /dev/random.  Legacy.
Provided only for source compatibility
with Linux.

Can also use flags|GRND_NONBLOCK to fail with EWOULDBLOCK/EAGAIN
without producing any output instead of blocking.

- The combination GRND_INSECURE|GRND_NONBLOCK is the same as
  GRND_INSECURE, since GRND_INSECURE never blocks anyway.

- The combinations GRND_INSECURE|GRND_RANDOM and
  GRND_INSECURE|GRND_RANDOM|GRND_NONBLOCK are nonsensical and fail
  with EINVAL.

As proposed on tech-userlevel, tech-crypto, tech-security, and
tech-kern, and subsequently adopted by core (minus the getentropy part
of the proposal, because other operating systems and participants in
the discussion couldn't come to an agreement about getentropy and
blocking semantics):

https://mail-index.netbsd.org/tech-userlevel/2020/05/02/msg012333.html


To generate a diff of this commit:
cvs rdiff -u -r1.2342 -r1.2343 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.326 -r1.327 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.888 -r1.889 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.244 -r1.245 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/getrandom.2
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/random.c
cvs rdiff -u -r1.50 -r1.51 src/sys/kern/files.kern
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/kern_entropy.c
cvs rdiff -u -r0 -r1.1 src/sys/kern/sys_getrandom.c
cvs rdiff -u -r1.305 -r1.306 src/sys/kern/syscalls.master
cvs rdiff -u -r1.184 -r1.185 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r1.175 -r1.176 src/sys/sys/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/entropy.h
cvs rdiff -u -r0 -r1.1 src/sys/sys/random.h
cvs rdiff -u -r1.66 -r1.67 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_getrandom.c

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2342 src/distrib/sets/lists/comp/mi:1.2343
--- src/distrib/sets/lists/comp/mi:1.2342	Tue Aug 11 13:19:15 2020
+++ src/distrib/sets/lists/comp/mi	Fri Aug 14 00:53:15 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2342 2020/08/11 13:19:15 christos Exp $
+#	$NetBSD: mi,v 1.2343 2020/08/14 00:53:15 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3137,6 +3137,7 @@
 ./usr/include/sys/quotactl.h			comp-c-include
 ./usr/include/sys/radioio.h			comp-c-include
 ./usr/include/sys/radixtree.h			comp-c-include
+./usr/include/sys/random.h			comp-c-include
 ./usr/include/sys/ras.hcomp-c-include
 ./usr/include/sys/rb.hcomp-obsolete		obsolete
 ./usr/include/sys/rbtree.h			comp-c-include
@@ -12742,6 +12743,7 @@
 ./usr/share/man/html2/getpid.html		comp-c-htmlman		html
 ./usr/share/man/html2/getppid.html		comp-c-htmlman		html
 ./usr/share/man/html2/getpriority.html		comp-c-htmlman		html
+./usr/share/man/html2/getrandom.html		comp-c-htmlman		html
 ./usr/share/man/html2/getrlimit.html		comp-c-htmlman		html
 ./usr/share/man/html2/getrusage.html		comp-c-htmlman		html
 

CVS commit: src/usr.bin/make

2020-08-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Aug 13 20:13:46 UTC 2020

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make(1): fix type mismatch in compare_expression

This was caught by a simple "typedef double Boolean" in sprite.h.

If only there were a C compiler with "strict" mode, where pointers,
numbers and booleans were separate and unassignable data types, this
copy-and-paste typo would have been caught much earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/make/cond.c

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

Modified files:

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.94 src/usr.bin/make/cond.c:1.95
--- src/usr.bin/make/cond.c:1.94	Thu Aug 13 19:30:37 2020
+++ src/usr.bin/make/cond.c	Thu Aug 13 20:13:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.95 2020/08/13 20:13:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.95 2020/08/13 20:13:46 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.95 2020/08/13 20:13:46 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -531,7 +531,7 @@ compare_expression(Boolean doEval)
 
 t = TOK_ERROR;
 rhs = NULL;
-lhsFree = rhsFree = FALSE;
+lhsFree = rhsFree = NULL;
 lhsQuoted = rhsQuoted = FALSE;
 
 /*



CVS commit: xsrc/external/mit/xorg-server.old/dist/hw/sun

2020-08-13 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Thu Aug 13 19:52:23 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server.old/dist/hw/sun: sun.h sunInit.c sunIo.c
sunKbd.c sunMouse.c

Log Message:
More cherry-picks to sync with xorg-server:

 Remove more redundant command option arg checks.
 Avoid dumb DevicePtr casts.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xorg-server.old/dist/hw/sun/sun.h \
xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c
cvs rdiff -u -r1.1 -r1.2 \
xsrc/external/mit/xorg-server.old/dist/hw/sun/sunMouse.c

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

Modified files:

Index: xsrc/external/mit/xorg-server.old/dist/hw/sun/sun.h
diff -u xsrc/external/mit/xorg-server.old/dist/hw/sun/sun.h:1.3 xsrc/external/mit/xorg-server.old/dist/hw/sun/sun.h:1.4
--- xsrc/external/mit/xorg-server.old/dist/hw/sun/sun.h:1.3	Sun Aug  9 16:01:19 2020
+++ xsrc/external/mit/xorg-server.old/dist/hw/sun/sun.h	Thu Aug 13 19:52:23 2020
@@ -300,6 +300,7 @@ extern fbFd		sunFbs[];
 extern Bool		sunSwapLkeys;
 extern Bool		sunForceMono;
 extern Bool		sunDebug;
+extern char		*sunDeviceList;
 extern Bool		sunFlipPixels;
 extern Bool		sunFbInfo;
 extern Bool		sunCG4Frob;
Index: xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c
diff -u xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c:1.3 xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c:1.4
--- xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c:1.3	Sun Aug  9 16:01:19 2020
+++ xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c	Thu Aug 13 19:52:23 2020
@@ -170,9 +170,10 @@ AbortDDX(void)
 #else
 (void) OsSignal (SIGIO, SIG_IGN);
 #endif
-devPtr = (DevicePtr)sunKeyboardDevice;
-if (devPtr)
+if (sunKeyboardDevice) {
+devPtr = >public;
 	(void) sunChangeKbdTranslation (((sunKbdPrivPtr)(devPtr->devicePrivate))->fd, FALSE);
+}
 #if defined(SVR4) || defined(CSRG_BASED)
 sunNonBlockConsoleOff ();
 #else
@@ -209,7 +210,9 @@ ddxProcessArgument(int argc, char *argv[
 	return 1;
 }
 if (strcmp (argv[i], "-dev") == 0) {	/* -dev /dev/mumble */
-	if (++i >= argc) UseMsg ();
+	if (++i >= argc)
+	UseMsg();
+	sunDeviceList = argv[i];
 	return 2;
 }
 if (strcmp (argv[i], "-mono") == 0) {	/* -mono */
@@ -228,14 +231,6 @@ ddxProcessArgument(int argc, char *argv[
 	sunFbInfo = TRUE;
 	return 1;
 }
-if (strcmp (argv[i], "-kbd") == 0) {	/* -kbd */
-	if (++i >= argc) UseMsg();
-	return 2;
-}
-if (strcmp (argv[i], "-protect") == 0) {	/* -protect */
-	if (++i >= argc) UseMsg();
-	return 2;
-}
 if (strcmp (argv[i], "-cg4frob") == 0) {
 	sunCG4Frob = TRUE;
 	return 1;

Index: xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c
diff -u xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c:1.4 xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c:1.5
--- xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c:1.4	Sun Aug  9 16:01:19 2020
+++ xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c	Thu Aug 13 19:52:23 2020
@@ -132,6 +132,7 @@ EventList *sunEvents = NULL;
 
 Bool sunSwapLkeys = FALSE;
 Bool sunDebug = FALSE;
+char *sunDeviceList = NULL;
 Bool sunForceMono = FALSE;
 Bool sunFlipPixels = FALSE;
 Bool sunFbInfo = FALSE;
@@ -403,14 +404,9 @@ GetDeviceList(int argc, char **argv)
 {
 int		i;
 char	*envList = NULL;
-char	*cmdList = NULL;
+char	*cmdList = sunDeviceList;
 char	**deviceList = (char **)NULL;
 
-for (i = 1; i < argc; i++)
-	if (strcmp (argv[i], "-dev") == 0 && i+1 < argc) {
-	cmdList = argv[i + 1];
-	break;
-	}
 if (!cmdList)
 	envList = getenv ("XDEVICE");
 

Index: xsrc/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c
diff -u xsrc/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c:1.2 xsrc/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c:1.3
--- xsrc/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c:1.2	Sat Aug  1 13:40:55 2020
+++ xsrc/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c	Thu Aug 13 19:52:23 2020
@@ -607,7 +607,7 @@ sunInitKbdNames(XkbRMLVOSet *rmlvo, sunK
 int
 sunKbdProc(DeviceIntPtr device, int what)
 {
-DevicePtr pKeyboard = (DevicePtr) device;
+DevicePtr pKeyboard = >public;
 sunKbdPrivPtr pPriv;
 KeybdCtrl*	ctrl = >kbdfeed->ctrl;
 XkbRMLVOSet rmlvo;
@@ -617,7 +617,7 @@ sunKbdProc(DeviceIntPtr device, int what
 
 switch (what) {
 case DEVICE_INIT:
-	if (pKeyboard != (DevicePtr)sunKeyboardDevice) {
+	if (pKeyboard != >public) {
 	ErrorF ("Cannot open non-system keyboard\n");
 	return (!Success);
 	}

Index: xsrc/external/mit/xorg-server.old/dist/hw/sun/sunMouse.c
diff -u xsrc/external/mit/xorg-server.old/dist/hw/sun/sunMouse.c:1.1 

CVS commit: src/usr.bin/make

2020-08-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Aug 13 19:30:37 UTC 2020

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make(1): fix type of local variable in CondGetString

When the Boolean type from sprite.h is replaced with C99's standard bool
type, the chained assignment leads to the following compile error with
GCC 5:

cond.c:404:5: error: suggest parentheses around assignment used as truth
 value [-Werror=parentheses]
 *quoted = qt = *condExpr == '"' ? 1 : 0;

Changing the type of qt from int to bool fixes this.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/make/cond.c

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

Modified files:

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.93 src/usr.bin/make/cond.c:1.94
--- src/usr.bin/make/cond.c:1.93	Sun Aug  9 19:51:02 2020
+++ src/usr.bin/make/cond.c	Thu Aug 13 19:30:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.93 2020/08/09 19:51:02 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.93 2020/08/09 19:51:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.93 2020/08/09 19:51:02 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -395,7 +395,7 @@ CondGetString(Boolean doEval, Boolean *q
 const char *cp;
 const char *str;
 int len;
-int qt;
+Boolean qt;
 const char *start;
 
 Buf_Init(, 0);



CVS commit: src/sys/ufs/lfs

2020-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 13 17:26:43 UTC 2020

Modified Files:
src/sys/ufs/lfs: lfs_segment.c

Log Message:
Skip unlinked inodes.

They no longer matter on disk so we don't need to write anything out
for them.


To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 src/sys/ufs/lfs/lfs_segment.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/lfs/lfs_segment.c
diff -u src/sys/ufs/lfs/lfs_segment.c:1.286 src/sys/ufs/lfs/lfs_segment.c:1.287
--- src/sys/ufs/lfs/lfs_segment.c:1.286	Sun Feb 23 15:46:42 2020
+++ src/sys/ufs/lfs/lfs_segment.c	Thu Aug 13 17:26:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_segment.c,v 1.286 2020/02/23 15:46:42 ad Exp $	*/
+/*	$NetBSD: lfs_segment.c,v 1.287 2020/08/13 17:26:43 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.286 2020/02/23 15:46:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.287 2020/08/13 17:26:43 riastradh Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {		\
@@ -487,7 +487,7 @@ lfs_writevnodes_selector(void *cl, struc
 	KASSERT(mutex_owned(vp->v_interlock));
 
 	ip = VTOI(vp);
-	if (ip == NULL || vp->v_type == VNON)
+	if (ip == NULL || vp->v_type == VNON || ip->i_nlink <= 0)
 		return false;
 	if ((op == VN_DIROP && !(vp->v_uflag & VU_DIROP)) ||
 	(op != VN_DIROP && op != VN_CLEAN && (vp->v_uflag & VU_DIROP))) {



CVS commit: src/sys/dev

2020-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 13 16:45:58 UTC 2020

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

Log Message:
Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/video.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/video.c
diff -u src/sys/dev/video.c:1.38 src/sys/dev/video.c:1.39
--- src/sys/dev/video.c:1.38	Mon Aug 10 19:27:27 2020
+++ src/sys/dev/video.c	Thu Aug 13 16:45:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: video.c,v 1.38 2020/08/10 19:27:27 rjs Exp $ */
+/* $NetBSD: video.c,v 1.39 2020/08/13 16:45:58 riastradh Exp $ */
 
 /*
  * Copyright (c) 2008 Patrick Mahoney 
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: video.c,v 1.38 2020/08/10 19:27:27 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: video.c,v 1.39 2020/08/13 16:45:58 riastradh Exp $");
 
 #include "video.h"
 #if NVIDEO > 0
@@ -140,7 +140,7 @@ struct video_stream {
 	  * sequence, wraps around */
 	bool			vs_drop; /* drop payloads from current
 	  * frameno? */
-	
+
 	enum v4l2_buf_type	vs_type;
 	uint8_t			vs_nbufs;
 	struct video_buffer	**vs_buf;
@@ -325,7 +325,7 @@ static void	video_stream_sample_done(str
 static const char *	video_ioctl_str(u_long);
 #endif
 
-	
+
 static int
 video_match(device_t parent, cfdata_t match, void *aux)
 {
@@ -347,7 +347,7 @@ video_attach(device_t parent, device_t s
 
 	sc = device_private(self);
 	args = aux;
-	
+
 	sc->sc_dev = self;
 	sc->hw_dev = parent;
 	sc->hw_if = args->hw_if;
@@ -398,7 +398,7 @@ video_detach(device_t self, int flags)
 	sc->sc_dying = true;
 
 	pmf_device_deregister(self);
-	
+
 	maj = cdevsw_lookup_major(_cdevsw);
 	mn = device_unit(self);
 	/* close open instances */
@@ -495,7 +495,7 @@ v4l2id_to_control_id(uint32_t v4l2id)
 	case V4L2_CID_AUDIO_TREBLE:	return VIDEO_CONTROL_UNDEFINED;
 	case V4L2_CID_AUDIO_MUTE:	return VIDEO_CONTROL_UNDEFINED;
 	case V4L2_CID_AUDIO_LOUDNESS:	return VIDEO_CONTROL_UNDEFINED;
-		
+
 	case V4L2_CID_AUTO_WHITE_BALANCE:
 		return VIDEO_CONTROL_WHITE_BALANCE_AUTO;
 	case V4L2_CID_DO_WHITE_BALANCE:
@@ -571,7 +571,7 @@ video_query_control(struct video_softc *
 		desc_group.group_id = desc.group_id;
 		desc_group.length = 1;
 		desc_group.desc = 
-		
+
 		err = hw->get_control_desc_group(sc->hw_softc, _group);
 		if (err != 0)
 			return err;
@@ -618,7 +618,7 @@ video_get_control(struct video_softc *sc
 		err = hw->get_control_group(sc->hw_softc, );
 		if (err != 0)
 			return err;
-		
+
 		vcontrol->value = control.value;
 		return 0;
 	} else {
@@ -641,7 +641,7 @@ video_format_to_v4l2_format(const struct
 	dest->fmt.pix.bytesperline = src->stride;
 	dest->fmt.pix.sizeimage = src->sample_size;
 	dest->fmt.pix.priv = src->priv;
-	
+
 	switch (src->color.primaries) {
 	case VIDEO_COLOR_PRIMARIES_SMPTE_170M:
 		dest->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
@@ -828,7 +828,7 @@ video_enum_framesizes(struct video_softc
 		printf("video_enum_framesizes: type mismatch %x %x\n",
 		fmt.fmt.pix.pixelformat, frmdesc->pixel_format);
 	}
-	
+
 	frmdesc->type = V4L2_FRMSIZE_TYPE_DISCRETE; /* TODO: only one type for now */
 	frmdesc->discrete.width = vfmt.width;
 	frmdesc->discrete.height = vfmt.height;
@@ -867,7 +867,7 @@ video_get_format(struct video_softc *sc,
 		return err;
 
 	video_format_to_v4l2_format(, format);
-	
+
 	return 0;
 }
 
@@ -890,7 +890,7 @@ video_set_format(struct video_softc *sc,
 
 	video_format_to_v4l2_format(, fmt);
 	sc->sc_stream_in.vs_format = vfmt;
-	
+
 	return 0;
 }
 
@@ -1049,7 +1049,7 @@ video_get_standard(struct video_softc *s
 
 	video_standard_to_v4l2_standard(vstd, );
 	*stdid = std.id;
-	
+
 	return 0;
 }
 
@@ -1472,7 +1472,7 @@ video_set_control(struct video_softc *sc
 		group.group_id = control.group_id;
 		group.length = 1;
 		group.control = 
-		
+
 		return (hw->set_control_group(sc->hw_softc, ));
 	} else {
 		return EINVAL;
@@ -1529,7 +1529,7 @@ video_query_buf(struct video_softc *sc,
 		return EINVAL;
 	if (buf->index >= vs->vs_nbufs)
 		return EINVAL;
-	
+
 	memcpy(buf, vs->vs_buf[buf->index]->vb_buf, sizeof(*buf));
 
 	return 0;
@@ -1543,7 +1543,7 @@ video_queue_buf(struct video_softc *sc, 
 	struct video_stream *vs = >sc_stream_in;
 	struct video_buffer *vb;
 	struct v4l2_buffer *driverbuf;
-	
+
 	if (userbuf->type != vs->vs_type) {
 		DPRINTF(("video_queue_buf: expected type=%d got type=%d\n",
 			 userbuf->type, vs->vs_type));
@@ -1562,9 +1562,9 @@ video_queue_buf(struct video_softc *sc, 
  userbuf->memory));
 			return EINVAL;
 		}
-		
+
 		mutex_enter(>vs_lock);
-		
+
 		vb = vs->vs_buf[userbuf->index];
 		driverbuf = vb->vb_buf;
 		if (driverbuf->flags & V4L2_BUF_FLAG_QUEUED) {
@@ -1575,7 +1575,7 @@ video_queue_buf(struct video_softc *sc, 
 		}
 		video_stream_enqueue(vs, vb);
 		memcpy(userbuf, driverbuf, sizeof(*driverbuf));
-		
+
 		mutex_exit(>vs_lock);
 		break;
 	default:
@@ -1593,14 

CVS commit: [netbsd-9] src/doc

2020-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 13 15:09:35 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.1

Log Message:
Tickets #1046 - #1048


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.93 -r1.1.2.94 src/doc/CHANGES-9.1

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-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.93 src/doc/CHANGES-9.1:1.1.2.94
--- src/doc/CHANGES-9.1:1.1.2.93	Tue Aug 11 19:12:33 2020
+++ src/doc/CHANGES-9.1	Thu Aug 13 15:09:35 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.93 2020/08/11 19:12:33 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.94 2020/08/13 15:09:35 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -4052,3 +4052,19 @@ sys/kern/uipc_mbuf.c1.235
 	Mask all the MMC counter interrupts if the MMC module is present.
 	[mrg, ticket #1045]
 
+etc/etc.amd64/MAKEDEV.conf			1.31
+etc/etc.i386/MAKEDEV.conf			1.32
+
+	Create 8 /dev/ldX by default, as with other disk drivers and ports.
+	[nia, ticket #1046]
+
+sys/arch/evbarm/conf/GENERIC.common		1.35
+
+	Add cgd(4) to evbarm GENERIC kernels.
+	[nia, ticket #1047]
+
+etc/etc.news68k/MAKEDEV.conf			1.4
+
+	Add missing bpf(4) node for dhcpcd(8) in INSTALL floppies.
+	[tsutsui, ticket #1048]
+



CVS commit: [netbsd-9] src/etc/etc.news68k

2020-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 13 14:53:45 UTC 2020

Modified Files:
src/etc/etc.news68k [netbsd-9]: MAKEDEV.conf

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

etc/etc.news68k/MAKEDEV.conf: revision 1.4

Add missed bpf(4) node for dhcpcd(8) in INSTALL floppies.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.44.1 src/etc/etc.news68k/MAKEDEV.conf

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

Modified files:

Index: src/etc/etc.news68k/MAKEDEV.conf
diff -u src/etc/etc.news68k/MAKEDEV.conf:1.3 src/etc/etc.news68k/MAKEDEV.conf:1.3.44.1
--- src/etc/etc.news68k/MAKEDEV.conf:1.3	Sun Nov 20 17:18:34 2011
+++ src/etc/etc.news68k/MAKEDEV.conf	Thu Aug 13 14:53:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.3 2011/11/20 17:18:34 tsutsui Exp $
+# $NetBSD: MAKEDEV.conf,v 1.3.44.1 2020/08/13 14:53:44 martin Exp $
 
 all_md)
 	makedev sd0 sd1 sd2 sd3 cd0 st0 st1
@@ -9,7 +9,7 @@ all_md)
 	;;
 
 floppy)
-	makedev std sd0 sd1 sd2 sd3 cd0 st0 st1
+	makedev std bpf sd0 sd1 sd2 sd3 cd0 st0 st1
 	makedev opty tty0 tty1 md0
 	makedev romcons
 	;;



CVS commit: [netbsd-9] src/sys/arch/evbarm/conf

2020-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 13 14:43:31 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf [netbsd-9]: GENERIC.common

Log Message:
Pull up following revision(s) (requested by nia in ticket #1047):

sys/arch/evbarm/conf/GENERIC.common: revision 1.35

Add cgd to evbarm GENERIC.common.


To generate a diff of this commit:
cvs rdiff -u -r1.34.2.1 -r1.34.2.2 src/sys/arch/evbarm/conf/GENERIC.common

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC.common
diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.34.2.1 src/sys/arch/evbarm/conf/GENERIC.common:1.34.2.2
--- src/sys/arch/evbarm/conf/GENERIC.common:1.34.2.1	Thu Nov 21 18:17:59 2019
+++ src/sys/arch/evbarm/conf/GENERIC.common	Thu Aug 13 14:43:31 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC.common,v 1.34.2.1 2019/11/21 18:17:59 martin Exp $
+#	$NetBSD: GENERIC.common,v 1.34.2.2 2020/08/13 14:43:31 martin Exp $
 #
 #	GENERIC evbarm kernel config (template)
 #
@@ -130,6 +130,7 @@ pseudo-device	swcrypto		# software crypt
 pseudo-device	vnd			# disk-like interface to files
 #pseudo-device	fss			# file system snapshot device
 pseudo-device	drvctl			# driver control
+pseudo-device	cgd			# cryptographic disk devices
 
 # network pseudo-devices
 pseudo-device	bpfilter		# Berkeley packet filter



CVS commit: [netbsd-9] src/etc

2020-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 13 14:40:44 UTC 2020

Modified Files:
src/etc/etc.amd64 [netbsd-9]: MAKEDEV.conf
src/etc/etc.i386 [netbsd-9]: MAKEDEV.conf

Log Message:
Pull up following revision(s) (requested by nia in ticket #1046):

etc/etc.i386/MAKEDEV.conf: revision 1.32
etc/etc.amd64/MAKEDEV.conf: revision 1.31

Create 8 /dev/ldX by default, as with other disk drivers and ports


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.2.1 src/etc/etc.amd64/MAKEDEV.conf
cvs rdiff -u -r1.30 -r1.30.2.1 src/etc/etc.i386/MAKEDEV.conf

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

Modified files:

Index: src/etc/etc.amd64/MAKEDEV.conf
diff -u src/etc/etc.amd64/MAKEDEV.conf:1.28 src/etc/etc.amd64/MAKEDEV.conf:1.28.2.1
--- src/etc/etc.amd64/MAKEDEV.conf:1.28	Sun Jul 21 11:14:18 2019
+++ src/etc/etc.amd64/MAKEDEV.conf	Thu Aug 13 14:40:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.28 2019/07/21 11:14:18 maya Exp $
+# $NetBSD: MAKEDEV.conf,v 1.28.2.1 2020/08/13 14:40:44 martin Exp $
 
 # As of 2003-04-17, the "init" case must not create more than 890 entries.
 all_md)
@@ -17,7 +17,7 @@ all_md)
 	makedev nvme2 nvme2ns1 nvme2ns2 nvme2ns3 nvme2ns4
 	makedev nvme3 nvme3ns1 nvme3ns2 nvme3ns3 nvme3ns4
 	makedev raid0 raid1 raid2 raid3
-	makedev ld0 ld1 ld2 ld3
+	makedev ld0 ld1 ld2 ld3 ld4 ld5 ld6 ld7
 	makedev xbd0 xbd1 xbd2 xbd3 xen
 	makedev usbs
 	makedev local

Index: src/etc/etc.i386/MAKEDEV.conf
diff -u src/etc/etc.i386/MAKEDEV.conf:1.30 src/etc/etc.i386/MAKEDEV.conf:1.30.2.1
--- src/etc/etc.i386/MAKEDEV.conf:1.30	Sun Jul 21 11:14:19 2019
+++ src/etc/etc.i386/MAKEDEV.conf	Thu Aug 13 14:40:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.30 2019/07/21 11:14:19 maya Exp $
+# $NetBSD: MAKEDEV.conf,v 1.30.2.1 2020/08/13 14:40:44 martin Exp $
 
 # As of 2005-03-15, the "init" case must not create more than 1024 entries.
 all_md)
@@ -18,7 +18,7 @@ all_md)
 	makedev nvme2 nvme2ns1 nvme2ns2 nvme2ns3 nvme2ns4
 	makedev nvme3 nvme3ns1 nvme3ns2 nvme3ns3 nvme3ns4
 	makedev raid0 raid1 raid2 raid3
-	makedev ld0 ld1 ld2 ld3
+	makedev ld0 ld1 ld2 ld3 ld4 ld5 ld6 ld7
 	makedev xbd0 xbd1 xbd2 xbd3 xen
 	makedev usbs
 	makedev ipty



CVS commit: src/tools/gcc

2020-08-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 13 10:57:54 UTC 2020

Modified Files:
src/tools/gcc: Makefile

Log Message:
set MODULE to ${EXTERNAL_GCC_SUBDIR} so this actually works..


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/tools/gcc/Makefile

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

Modified files:

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.97 src/tools/gcc/Makefile:1.98
--- src/tools/gcc/Makefile:1.97	Wed Nov  6 07:26:31 2019
+++ src/tools/gcc/Makefile	Thu Aug 13 10:57:53 2020
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.97 2019/11/06 07:26:31 mrg Exp $
+#	$NetBSD: Makefile,v 1.98 2020/08/13 10:57:53 mrg Exp $
 
 .include 
 
 GCC_LANGUAGES=c c++ objc
-MODULE=			gcc4
+MODULE=		${EXTERNAL_GCC_SUBDIR}
 
 GCCDIST=	${.CURDIR}/../../external/gpl3/${EXTERNAL_GCC_SUBDIR}/dist
 GNUHOSTDIST=	${GCCDIST}



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

2020-08-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 13 08:42:18 UTC 2020

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

Log Message:
 Set recovery_mode_timer workqueue's name correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/dev/pci/ixgbe/ixgbe.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.234 src/sys/dev/pci/ixgbe/ixgbe.c:1.235
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.234	Thu Aug 13 08:38:50 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Aug 13 08:42:18 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.234 2020/08/13 08:38:50 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.235 2020/08/13 08:42:18 msaitoh Exp $ */
 
 /**
 
@@ -1228,6 +1228,8 @@ ixgbe_attach(device_t parent, device_t d
 		/* Set up the timer callout */
 		callout_init(>recovery_mode_timer,
 		IXGBE_CALLOUT_FLAGS);
+		snprintf(wqname, sizeof(wqname), "%s-recovery",
+		device_xname(dev));
 		error = workqueue_create(>recovery_mode_timer_wq,
 		wqname, ixgbe_handle_recovery_mode_timer, adapter,
 		IXGBE_WORKQUEUE_PRI, IPL_NET, IXGBE_TASKLET_WQ_FLAGS);



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

2020-08-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 13 08:38:50 UTC 2020

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

Log Message:
 Use atomic_cas_uint() and atomic_store_relaxed(). Advised by thorpej@.
Tested by me. OK'd by knakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/pci/ixgbe/ixv.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.233 src/sys/dev/pci/ixgbe/ixgbe.c:1.234
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.233	Thu Jun 25 07:53:01 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Aug 13 08:38:50 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.233 2020/06/25 07:53:01 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.234 2020/08/13 08:38:50 msaitoh Exp $ */
 
 /**
 
@@ -1512,11 +1512,9 @@ static void
 ixgbe_schedule_admin_tasklet(struct adapter *adapter)
 {
 	if (adapter->schedule_wqs_ok) {
-		if (!adapter->admin_pending) {
-			atomic_or_uint(>admin_pending, 1);
+		if (atomic_cas_uint(>admin_pending, 0, 1) == 0)
 			workqueue_enqueue(adapter->admin_wq,
 			>admin_wc, NULL);
-		}
 	}
 }
 
@@ -4063,7 +4061,7 @@ ixgbe_init_locked(struct adapter *adapte
 	ixgbe_enable_rx_dma(hw, rxctrl);
 
 	callout_reset(>timer, hz, ixgbe_local_timer, adapter);
-	atomic_and_uint(>timer_pending, ~1);
+	atomic_store_relaxed(>timer_pending, 0);
 	if (adapter->feat_en & IXGBE_FEATURE_RECOVERY_MODE)
 		callout_reset(>recovery_mode_timer, hz,
 		ixgbe_recovery_mode_timer, adapter);
@@ -4446,11 +,9 @@ ixgbe_local_timer(void *arg)
 	struct adapter *adapter = arg;
 
 	if (adapter->schedule_wqs_ok) {
-		if (!adapter->timer_pending) {
-			atomic_or_uint(>timer_pending, 1);
+		if (atomic_cas_uint(>timer_pending, 0, 1) == 0)
 			workqueue_enqueue(adapter->timer_wq,
 			>timer_wc, NULL);
-		}
 	}
 }
 
@@ -4549,7 +4545,7 @@ ixgbe_handle_timer(struct work *wk, void
 #endif
 
 out:
-	atomic_and_uint(>timer_pending, ~1);
+	atomic_store_relaxed(>timer_pending, 0);
 	IXGBE_CORE_UNLOCK(adapter);
 	callout_reset(>timer, hz, ixgbe_local_timer, adapter);
 	return;
@@ -4570,8 +4566,8 @@ ixgbe_recovery_mode_timer(void *arg)
 {
 	struct adapter *adapter = arg;
 
-	if (!adapter->recovery_mode_timer_pending) {
-		atomic_or_uint(>recovery_mode_timer_pending, 1);
+	if (atomic_cas_uint(>recovery_mode_timer_pending, 0, 1) == 0)
+	{
 		workqueue_enqueue(adapter->recovery_mode_timer_wq,
 		>recovery_mode_timer_wc, NULL);
 	}
@@ -4595,7 +4591,7 @@ ixgbe_handle_recovery_mode_timer(struct 
 	} else
 		atomic_cas_uint(>recovery_mode, 1, 0);
 
-	atomic_and_uint(>recovery_mode_timer_pending, ~1);
+	atomic_store_relaxed(>recovery_mode_timer_pending, 0);
 	callout_reset(>recovery_mode_timer, hz,
 	ixgbe_recovery_mode_timer, adapter);
 	IXGBE_CORE_UNLOCK(adapter);
@@ -4808,7 +4804,7 @@ ixgbe_handle_admin(struct work *wk, void
 		}
 #endif
 	}
-	atomic_and_uint(>admin_pending, ~1);
+	atomic_store_relaxed(>admin_pending, 0);
 	if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0) {
 		/* Re-enable other interrupts */
 		IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
@@ -4829,9 +4825,9 @@ ixgbe_ifstop(struct ifnet *ifp, int disa
 	IXGBE_CORE_UNLOCK(adapter);
 
 	workqueue_wait(adapter->admin_wq, >admin_wc);
-	atomic_and_uint(>admin_pending, ~1);
+	atomic_store_relaxed(>admin_pending, 0);
 	workqueue_wait(adapter->timer_wq, >timer_wc);
-	atomic_and_uint(>timer_pending, ~1);
+	atomic_store_relaxed(>timer_pending, 0);
 }
 
 /

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.151 src/sys/dev/pci/ixgbe/ixv.c:1.152
--- src/sys/dev/pci/ixgbe/ixv.c:1.151	Thu Jun 25 07:53:02 2020
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Aug 13 08:38:50 2020
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.151 2020/06/25 07:53:02 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.152 2020/08/13 08:38:50 msaitoh Exp $*/
 
 /**
 
@@ -787,7 +787,7 @@ ixv_init_locked(struct adapter *adapter)
 
 	/* Start watchdog */
 	callout_reset(>timer, hz, ixv_local_timer, adapter);
-	atomic_and_uint(>timer_pending, ~1);
+	atomic_store_relaxed(>timer_pending, 0);
 
 	/* OK to schedule workqueues. */
 	adapter->schedule_wqs_ok = true;
@@ -1063,11 +1063,9 @@ static void
 ixv_schedule_admin_tasklet(struct adapter *adapter)
 {
 	if (adapter->schedule_wqs_ok) {
-		if (!adapter->admin_pending) {
-			atomic_or_uint(>admin_pending, 1);
+		if (atomic_cas_uint(>admin_pending, 0, 1) == 0)
 			workqueue_enqueue(adapter->admin_wq,
 			>admin_wc, NULL);
-		}
 	}
 }
 
@@ -1252,11 +1250,9 @@ ixv_local_timer(void *arg)
 	struct adapter *adapter = arg;
 
 	if (adapter->schedule_wqs_ok) {
-		if (!adapter->timer_pending) 

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

2020-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 13 07:14:04 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: lock_stubs.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/lock_stubs.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/lock_stubs.S
diff -u src/sys/arch/aarch64/aarch64/lock_stubs.S:1.1 src/sys/arch/aarch64/aarch64/lock_stubs.S:1.2
--- src/sys/arch/aarch64/aarch64/lock_stubs.S:1.1	Wed Aug 12 13:28:46 2020
+++ src/sys/arch/aarch64/aarch64/lock_stubs.S	Thu Aug 13 07:14:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.S,v 1.1 2020/08/12 13:28:46 skrll Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.2 2020/08/13 07:14:04 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include "assym.h"
 
-RCSID("$NetBSD: lock_stubs.S,v 1.1 2020/08/12 13:28:46 skrll Exp $")
+RCSID("$NetBSD: lock_stubs.S,v 1.2 2020/08/13 07:14:04 skrll Exp $")
 
 #ifndef LOCKDEBUG
 /*
@@ -53,7 +53,7 @@ ENTRY(mutex_enter)
 	ret
 2:
 	b	1b
-3:	
+3:
 	b	_C_LABEL(mutex_vector_enter)
 END(mutex_enter)
 
@@ -75,7 +75,7 @@ ENTRY(mutex_exit)
 	ret
 2:
 	b	1b
-3:	
+3:
 	b	_C_LABEL(mutex_vector_exit)
 END(mutex_exit)
 #endif	/* !LOCKDEBUG */