CVS commit: src/sys/dev/pci

2020-03-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Mar  8 06:44:27 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1387 -r1.1388 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1386 -r1.1387 src/sys/dev/pci/pcidevs_data.h

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

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1387 src/sys/dev/pci/pcidevs.h:1.1388
--- src/sys/dev/pci/pcidevs.h:1.1387	Thu Mar  5 15:43:30 2020
+++ src/sys/dev/pci/pcidevs.h	Sun Mar  8 06:44:26 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1387 2020/03/05 15:43:30 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1388 2020/03/08 06:44:26 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1399 2020/03/05 15:43:00 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1400 2020/03/08 06:43:06 msaitoh Exp
  */
 
 /*
@@ -6504,9 +6504,14 @@
 #define	PCI_PRODUCT_NVIDIA_GF_FX5950U	0x0333		/* GeForce FX 5950 Ultra */
 #define	PCI_PRODUCT_NVIDIA_QUADRO_FX_3000	0x0338		/* Quadro FX 3000 */
 #define	PCI_PRODUCT_NVIDIA_GF_FX5700_LE	0x0343		/* GeForce FX 5700 LE */
+#define	PCI_PRODUCT_NVIDIA_MCP55_LPC1	0x0360		/* nForce MCP55 LPC Bridge */
 #define	PCI_PRODUCT_NVIDIA_MCP55_LPC2	0x0361		/* nForce MCP55 LPC Bridge */
-#define	PCI_PRODUCT_NVIDIA_MCP55_ISA	0x0362		/* nForce MCP55 PCI-ISA Bridge */
-#define	PCI_PRODUCT_NVIDIA_MCP55_LPC	0x0364		/* nForce MCP55 LPC Bridge */
+#define	PCI_PRODUCT_NVIDIA_MCP55_LPC3	0x0362		/* nForce MCP55 LPC Bridge */
+#define	PCI_PRODUCT_NVIDIA_MCP55_LPC4	0x0363		/* nForce MCP55 LPC Bridge */
+#define	PCI_PRODUCT_NVIDIA_MCP55_LPC5	0x0364		/* nForce MCP55 LPC Bridge */
+#define	PCI_PRODUCT_NVIDIA_MCP55_LPC6	0x0365		/* nForce MCP55 LPC Bridge */
+#define	PCI_PRODUCT_NVIDIA_MCP55_LPC7	0x0366		/* nForce MCP55 LPC Bridge */
+#define	PCI_PRODUCT_NVIDIA_MCP55_LPC8	0x0367		/* nForce MCP55 LPC Bridge */
 #define	PCI_PRODUCT_NVIDIA_MCP55_SMB	0x0368		/* nForce MCP55 SMBus Controller */
 #define	PCI_PRODUCT_NVIDIA_MCP55_MEM	0x0369		/* nForce MCP55 Memory Controller */
 #define	PCI_PRODUCT_NVIDIA_MCP55_MEM2	0x036a		/* nForce MCP55 Memory Controller */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1386 src/sys/dev/pci/pcidevs_data.h:1.1387
--- src/sys/dev/pci/pcidevs_data.h:1.1386	Thu Mar  5 15:43:30 2020
+++ src/sys/dev/pci/pcidevs_data.h	Sun Mar  8 06:44:26 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1386 2020/03/05 15:43:30 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1387 2020/03/08 06:44:26 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1399 2020/03/05 15:43:00 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1400 2020/03/08 06:43:06 msaitoh Exp
  */
 
 /*
@@ -11458,11 +11458,21 @@ static const uint16_t pci_products[] = {
 	29719, 29726, 17793, 0,
 	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_GF_FX5700_LE, 
 	29654, 29726, 11602, 9827, 0,
+	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC1, 
+	29901, 30189, 8666, 6523, 0,
 	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC2, 
 	29901, 30189, 8666, 6523, 0,
-	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_ISA, 
-	29901, 30189, 6797, 6523, 0,
-	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC, 
+	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC3, 
+	29901, 30189, 8666, 6523, 0,
+	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC4, 
+	29901, 30189, 8666, 6523, 0,
+	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC5, 
+	29901, 30189, 8666, 6523, 0,
+	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC6, 
+	29901, 30189, 8666, 6523, 0,
+	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC7, 
+	29901, 30189, 8666, 6523, 0,
+	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LPC8, 
 	29901, 30189, 8666, 6523, 0,
 	PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_SMB, 
 	29901, 30189, 8670, 6415, 0,
@@ -14942,7 +14952,7 @@ static const char pci_words[] = { "." 
 	"ACCM\0" /* 1 refs @ 6506 */
 	"2188\0" /* 1 refs @ 6511 */
 	"VL-PCI\0" /* 3 refs @ 6516 */
-	"Bridge\0" /* 665 refs @ 6523 */
+	"Bridge\0" /* 670 refs @ 6523 */
 	"2051\0" /* 2 refs @ 6530 */
 	"Single\0" /* 7 refs @ 6535 */
 	"Solution\0" /* 2 refs @ 6542 */
@@ -14980,7 +14990,7 @@ static const char pci_words[] = { "." 
 	"(5-8)\0" /* 1 refs @ 6779 */
 	"M1445\0" /* 1 refs @ 6785 */
 	"M1449\0" /* 1 refs @ 6791 */
-	"PCI-ISA\0" /* 49 refs @ 6797 */
+	"PCI-ISA\0" /* 48 refs @ 6797 */
 	"M1451\0" /* 1 refs @ 6805 */
 	"Host-PCI\0" /* 43 refs @ 6811 */
 	"M1461\0" /* 1 refs @ 6820 */
@@ -15233,7 +15243,7 @@ static const char pci_words[] = { "." 
 	"I/O\0" /* 53 refs @ 8653 */
 	"Hub\0" /* 22 refs @ 8657 */
 	"7461\0" /* 

CVS commit: src/sys/dev/pci

2020-03-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Mar  8 06:43:06 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
NVIDIA 0x036[0-7] are nForce MCP55 LPC Bridge.


To generate a diff of this commit:
cvs rdiff -u -r1.1399 -r1.1400 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1399 src/sys/dev/pci/pcidevs:1.1400
--- src/sys/dev/pci/pcidevs:1.1399	Thu Mar  5 15:43:00 2020
+++ src/sys/dev/pci/pcidevs	Sun Mar  8 06:43:06 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1399 2020/03/05 15:43:00 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1400 2020/03/08 06:43:06 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -6497,9 +6497,14 @@ product NVIDIA	GF_FX5900XT	0x0332	GeForc
 product NVIDIA	GF_FX5950U	0x0333	GeForce FX 5950 Ultra
 product NVIDIA	QUADRO_FX_3000	0x0338	Quadro FX 3000
 product NVIDIA	GF_FX5700_LE	0x0343	GeForce FX 5700 LE
+product NVIDIA	MCP55_LPC1	0x0360	nForce MCP55 LPC Bridge
 product NVIDIA	MCP55_LPC2	0x0361	nForce MCP55 LPC Bridge
-product NVIDIA	MCP55_ISA	0x0362	nForce MCP55 PCI-ISA Bridge
-product NVIDIA	MCP55_LPC	0x0364	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC3	0x0362	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC4	0x0363	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC5	0x0364	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC6	0x0365	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC7	0x0366	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC8	0x0367	nForce MCP55 LPC Bridge
 product NVIDIA	MCP55_SMB	0x0368	nForce MCP55 SMBus Controller
 product NVIDIA	MCP55_MEM	0x0369	nForce MCP55 Memory Controller
 product NVIDIA	MCP55_MEM2	0x036a	nForce MCP55 Memory Controller



CVS commit: src/sys/arch/sun2/conf

2020-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  8 06:32:41 UTC 2020

Modified Files:
src/sys/arch/sun2/conf: GENERIC NFS

Log Message:
Fix comments on root devices.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/sun2/conf/GENERIC
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sun2/conf/NFS

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/sun2/conf/GENERIC
diff -u src/sys/arch/sun2/conf/GENERIC:1.104 src/sys/arch/sun2/conf/GENERIC:1.105
--- src/sys/arch/sun2/conf/GENERIC:1.104	Sun Mar  8 06:25:10 2020
+++ src/sys/arch/sun2/conf/GENERIC	Sun Mar  8 06:32:41 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.104 2020/03/08 06:25:10 rin Exp $
+# $NetBSD: GENERIC,v 1.105 2020/03/08 06:32:41 rin Exp $
 #
 # GENERIC machine description file
 # 
@@ -19,7 +19,7 @@
 # device.
 
 # Supports Sun2 (2/120, 2/170, 2/50, ...)
-# Supports root on: ie0, sd*, ...
+# Supports root on: sd*, ... (FFS)
 
 include 	"arch/sun2/conf/std.sun2"
 
@@ -29,7 +29,7 @@ options 	INSECURE		# allow modload(8) in
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.104 $"
+#ident 		"GENERIC-$Revision: 1.105 $"
 
 makeoptions	COPTS="-Os -fno-inline-small-functions"
 	# bootloader has size limit (~2MB)

Index: src/sys/arch/sun2/conf/NFS
diff -u src/sys/arch/sun2/conf/NFS:1.1 src/sys/arch/sun2/conf/NFS:1.2
--- src/sys/arch/sun2/conf/NFS:1.1	Sun Mar  8 06:23:18 2020
+++ src/sys/arch/sun2/conf/NFS	Sun Mar  8 06:32:41 2020
@@ -1,9 +1,9 @@
-# $NetBSD: NFS,v 1.1 2020/03/08 06:23:18 rin Exp $
+# $NetBSD: NFS,v 1.2 2020/03/08 06:32:41 rin Exp $
 #
 # GENERIC machine description file for NFS root instead of FFS
 
 # Supports Sun2 (2/120, 2/170, 2/50, ...)
-# Supports root on: ie0, sd*, ...
+# Supports root on: ie0, ... (NFS)
 
 include 	"arch/sun2/conf/GENERIC"
 no file-system	FFS



CVS commit: src/lib/libc/compiler_rt

2020-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  8 06:30:06 UTC 2020

Modified Files:
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
Fix broken printf(3) %d output for numbers more than two digits, e.g.,

  printf("%d\n", 42) ---> "::" instead of "42"

Our __{,u}modsi3 codes assume that __udivsi3 returns remainder to
%d1 (volatile register). __udivsi3 in libgcc does not, and therefore
mixing them up results in mess.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/compiler_rt/Makefile.inc

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

Modified files:

Index: src/lib/libc/compiler_rt/Makefile.inc
diff -u src/lib/libc/compiler_rt/Makefile.inc:1.36 src/lib/libc/compiler_rt/Makefile.inc:1.37
--- src/lib/libc/compiler_rt/Makefile.inc:1.36	Tue Oct 29 16:08:50 2019
+++ src/lib/libc/compiler_rt/Makefile.inc	Sun Mar  8 06:30:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.36 2019/10/29 16:08:50 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.37 2020/03/08 06:30:06 rin Exp $
 
 COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -170,9 +170,16 @@ GENERIC_SRCS+= \
 GENERIC_SRCS+= \
 	divmodsi4.c \
 	divsi3.c \
-	modsi3.c \
 	udivmodsi4.c \
+
+. if ${LIBC_MACHINE_ARCH} != "m68000"
+# Our __{,u}modsi3 codes assume that __udivsi3 returns remainder to
+# %d1 (volatile register). __udivsi3 in libgcc does not, and therefore
+# mixing them up results in mess.
+GENERIC_SRCS+= \
+	modsi3.c \
 	umodsi3.c
+. endif
 
 . if ${LIBC_MACHINE_CPU} != "sh3"
 # On sh3 __udivsi3 is gcc "millicode" with special calling convention



CVS commit: src/sys/arch/sun2/conf

2020-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  8 06:25:10 UTC 2020

Modified Files:
src/sys/arch/sun2/conf: GENERIC

Log Message:
Retire md(4) in favor of tmpfs provided by module,
though both are not useful for 8MB RAM system...


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/sun2/conf/GENERIC

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/sun2/conf/GENERIC
diff -u src/sys/arch/sun2/conf/GENERIC:1.103 src/sys/arch/sun2/conf/GENERIC:1.104
--- src/sys/arch/sun2/conf/GENERIC:1.103	Sun Mar  8 06:23:18 2020
+++ src/sys/arch/sun2/conf/GENERIC	Sun Mar  8 06:25:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.103 2020/03/08 06:23:18 rin Exp $
+# $NetBSD: GENERIC,v 1.104 2020/03/08 06:25:10 rin Exp $
 #
 # GENERIC machine description file
 # 
@@ -29,7 +29,7 @@ options 	INSECURE		# allow modload(8) in
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.103 $"
+#ident 		"GENERIC-$Revision: 1.104 $"
 
 makeoptions	COPTS="-Os -fno-inline-small-functions"
 	# bootloader has size limit (~2MB)
@@ -228,7 +228,7 @@ options 	SCSI_OLD_NOINQUIRY
 #pseudo-device   accf_http		# "httpready" accept filter
 
 ## Memory-disk device.
-pseudo-device	md		
+#pseudo-device	md		
 
  Network interfaces.
 



CVS commit: src

2020-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  8 06:23:18 UTC 2020

Modified Files:
src/etc/etc.sun2: Makefile.inc
src/sys/arch/sun2/conf: GENERIC
Added Files:
src/sys/arch/sun2/conf: NFS

Log Message:
sun2 kernel is restricted to ~2MB due to bootloader.
It seems that working kernel should be more smaller.

Strip off most kernel options, and provide by kernel modules.
Also add GENERIC kernel for NFS root instead of FFS.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.sun2/Makefile.inc
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/sun2/conf/GENERIC
cvs rdiff -u -r0 -r1.1 src/sys/arch/sun2/conf/NFS

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.sun2/Makefile.inc
diff -u src/etc/etc.sun2/Makefile.inc:1.7 src/etc/etc.sun2/Makefile.inc:1.8
--- src/etc/etc.sun2/Makefile.inc:1.7	Tue Jul 24 10:49:28 2007
+++ src/etc/etc.sun2/Makefile.inc	Sun Mar  8 06:23:18 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.7 2007/07/24 10:49:28 pavel Exp $
+#	$NetBSD: Makefile.inc,v 1.8 2020/03/08 06:23:18 rin Exp $
 #
 #	etc.sun2/Makefile.inc -- sun2-specific etc Makefile targets
 #
@@ -6,7 +6,7 @@
 # If you change the list of distributed kernels, don't forget
 # to update the release documentation in distrib/notes/common/contents
 
-KERNEL_SETS=		GENERIC FOURMEG DISKLESS
+KERNEL_SETS=		GENERIC FOURMEG DISKLESS NFS
 
 EXTRA_KERNELS=		INSTALL
 

Index: src/sys/arch/sun2/conf/GENERIC
diff -u src/sys/arch/sun2/conf/GENERIC:1.102 src/sys/arch/sun2/conf/GENERIC:1.103
--- src/sys/arch/sun2/conf/GENERIC:1.102	Fri Apr 26 22:46:04 2019
+++ src/sys/arch/sun2/conf/GENERIC	Sun Mar  8 06:23:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.102 2019/04/26 22:46:04 sevan Exp $
+# $NetBSD: GENERIC,v 1.103 2020/03/08 06:23:18 rin Exp $
 #
 # GENERIC machine description file
 # 
@@ -23,11 +23,16 @@
 
 include 	"arch/sun2/conf/std.sun2"
 
+options 	MODULAR			# new style module(7) framework
+#options 	MODULAR_DEFAULT_AUTOLOAD
+options 	INSECURE		# allow modload(8) in multiuser mode
+
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.102 $"
+#ident 		"GENERIC-$Revision: 1.103 $"
 
-makeoptions	COPTS="-Os"	# optimize for size
+makeoptions	COPTS="-Os -fno-inline-small-functions"
+	# bootloader has size limit (~2MB)
 
 # Machines to be supported by this kernel
 #options 	FPU_EMULATE
@@ -37,12 +42,12 @@ maxusers	4
 
 # Standard system options
 options 	KTRACE		# system call tracing
-options 	SYSVMSG		# System V message queues
-options 	SYSVSEM		# System V semaphores
-options 	SYSVSHM		# System V shared memory
+#options 	SYSVMSG		# System V message queues
+#options 	SYSVSEM		# System V semaphores
+#options 	SYSVSHM		# System V shared memory
 #options 	INSECURE	# disable kernel security level
 #options 	USERCONF	# userconf(4) support
-#options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
+options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 #options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
 # Alternate buffer queue strategies for better responsiveness under high
@@ -73,15 +78,15 @@ include 	"conf/compat_netbsd16.config"
 
 # Filesystem options
 file-system	FFS		# Berkeley Fast Filesystem
-file-system	NFS		# Sun NFS client support
-file-system	CD9660		# ISO 9660 + Rock Ridge file system
+#file-system	NFS		# Sun NFS client support
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
 #file-system	FDESC		# /dev/fd/*
-file-system	KERNFS		# /kern
-file-system	NULLFS		# loopback file system
+#file-system	KERNFS		# /kern
+#file-system	NULLFS		# loopback file system
 #file-system	OVERLAY		# overlay file system
 #file-system	PROCFS		# /proc
 #file-system	UNION		# union file system
-file-system	MFS		# memory-based filesystem
+#file-system	MFS		# memory-based filesystem
 file-system	PTYFS		# /dev/pts/N support
 #file-system	TMPFS		# Efficient memory file-system
 #file-system	UDF		# experimental - OSTA UDF CD/DVD file-system

Added files:

Index: src/sys/arch/sun2/conf/NFS
diff -u /dev/null src/sys/arch/sun2/conf/NFS:1.1
--- /dev/null	Sun Mar  8 06:23:18 2020
+++ src/sys/arch/sun2/conf/NFS	Sun Mar  8 06:23:18 2020
@@ -0,0 +1,10 @@
+# $NetBSD: NFS,v 1.1 2020/03/08 06:23:18 rin Exp $
+#
+# GENERIC machine description file for NFS root instead of FFS
+
+# Supports Sun2 (2/120, 2/170, 2/50, ...)
+# Supports root on: ie0, sd*, ...
+
+include 	"arch/sun2/conf/GENERIC"
+no file-system	FFS
+file-system	NFS



CVS commit: src/sys/arch/m68k

2020-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  8 06:12:01 UTC 2020

Modified Files:
src/sys/arch/m68k/include: mutex.h
src/sys/arch/m68k/m68k: lock_stubs.s

Log Message:
Remove mutex stubs for 68010 that merely fall back to C codes, and
do not work with kern_mutex.c rev 1.85 and later:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_mutex.c#rev1.85
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_mutex.c#rev1.86

Fix sun2 kernel freeze during early boot stage in mutex_exit(9).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/include/mutex.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/m68k/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/m68k/include/mutex.h
diff -u src/sys/arch/m68k/include/mutex.h:1.9 src/sys/arch/m68k/include/mutex.h:1.10
--- src/sys/arch/m68k/include/mutex.h:1.9	Fri Nov 29 22:55:33 2019
+++ src/sys/arch/m68k/include/mutex.h	Sun Mar  8 06:12:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.9 2019/11/29 22:55:33 riastradh Exp $	*/
+/*	$NetBSD: mutex.h,v 1.10 2020/03/08 06:12:01 rin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -60,7 +60,9 @@ struct kmutex {
 #define	mtx_lock		u.s.mtxs_lock
 
 #define	__HAVE_SIMPLE_MUTEXES		1
+#ifndef	__mc68010__
 #define	__HAVE_MUTEX_STUBS		1
+#endif
 
 #define	MUTEX_CAS(p, o, n)		(atomic_cas_uint((p), (o), (n)) == (o))
 

Index: src/sys/arch/m68k/m68k/lock_stubs.s
diff -u src/sys/arch/m68k/m68k/lock_stubs.s:1.9 src/sys/arch/m68k/m68k/lock_stubs.s:1.10
--- src/sys/arch/m68k/m68k/lock_stubs.s:1.9	Thu Aug  1 13:42:52 2013
+++ src/sys/arch/m68k/m68k/lock_stubs.s	Sun Mar  8 06:12:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.s,v 1.9 2013/08/01 13:42:52 matt Exp $	*/
+/*	$NetBSD: lock_stubs.s,v 1.10 2020/03/08 06:12:01 rin Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -83,32 +83,30 @@ STRONG_ALIAS(_atomic_cas_ulong_ni,_atomi
 
 #if !defined(LOCKDEBUG)
 
+#if !defined(__mc68010__)
 /*
  * void mutex_enter(kmutex_t *mtx);
  */
 ENTRY(mutex_enter)
-#if !defined(__mc68010__)
 	movq	#0,%d0
 	movl	_C_LABEL(curlwp),%d1
 	movl	4(%sp),%a0
 	casl	%d0,%d1,(%a0)
 	bnes	1f
 	rts
-#endif /* !__mc68010__ */
 1:	jra	_C_LABEL(mutex_vector_enter)
 
 /*
  * void mutex_exit(kmutex_t *mtx);
  */
 ENTRY(mutex_exit)
-#if !defined(__mc68010__)
 	movl	_C_LABEL(curlwp),%d0
 	movq	#0,%d1
 	movl	4(%sp),%a0
 	casl	%d0,%d1,(%a0)
 	bnes	1f
 	rts
-#endif /* !__mc68010__ */
 1:	jra	_C_LABEL(mutex_vector_exit)
+#endif /* !__mc68010__ */
 
 #endif	/* !LOCKDEBUG */



CVS commit: src/sys/arch/sun2/sun2

2020-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  8 06:06:47 UTC 2020

Modified Files:
src/sys/arch/sun2/sun2: machdep.c

Log Message:
Support module(7).


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/sun2/sun2/machdep.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/sun2/sun2/machdep.c
diff -u src/sys/arch/sun2/sun2/machdep.c:1.81 src/sys/arch/sun2/sun2/machdep.c:1.82
--- src/sys/arch/sun2/sun2/machdep.c:1.81	Sun Mar  8 06:05:05 2020
+++ src/sys/arch/sun2/sun2/machdep.c	Sun Mar  8 06:06:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.81 2020/03/08 06:05:05 rin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.82 2020/03/08 06:06:46 rin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -149,7 +149,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.81 2020/03/08 06:05:05 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.82 2020/03/08 06:06:46 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_fpu_emulate.h"
@@ -172,6 +172,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1167,3 +1168,13 @@ mm_md_kernacc(void *ptr, vm_prot_t prot,
 		return 0;
 	return EFAULT;
 }
+
+#ifdef MODULAR
+/*
+ * Push any modules loaded by the bootloader etc.
+ */
+void
+module_init_md(void)
+{
+}
+#endif



CVS commit: src/sys/arch/sun2/sun2

2020-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  8 06:05:05 UTC 2020

Modified Files:
src/sys/arch/sun2/sun2: machdep.c

Log Message:
Sort headers.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/sun2/sun2/machdep.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/sun2/sun2/machdep.c
diff -u src/sys/arch/sun2/sun2/machdep.c:1.80 src/sys/arch/sun2/sun2/machdep.c:1.81
--- src/sys/arch/sun2/sun2/machdep.c:1.80	Tue Dec 31 13:07:12 2019
+++ src/sys/arch/sun2/sun2/machdep.c	Sun Mar  8 06:05:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.80 2019/12/31 13:07:12 ad Exp $	*/
+/*	$NetBSD: machdep.c,v 1.81 2020/03/08 06:05:05 rin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -149,67 +149,67 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.80 2019/12/31 13:07:12 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.81 2020/03/08 06:05:05 rin Exp $");
 
 #include "opt_ddb.h"
-#include "opt_kgdb.h"
 #include "opt_fpu_emulate.h"
+#include "opt_kgdb.h"
 #include "opt_modular.h"
 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
 #include 
-#include 
+#include 
+#include 
 #include 
-#include 
+#include 
+#include 		/* for MID_* */
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
+#include 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
-#include 
-#include 
-#include 		/* for MID_* */
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
+
 #ifdef	KGDB
 #include 
 #endif
 
 #include  /* XXX: not _extern ... need vm_map_create */
 
-#include 
-
 #include 
 #include 
 
-#include 
+#define _SUN68K_BUS_DMA_PRIVATE
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
+#include 
+#include 
 #include 
 #include 
-#define _SUN68K_BUS_DMA_PRIVATE
-#include 
-#include 
-#include 
-#include 
+#include 
 
 #if defined(DDB)
 #include 
-#include 
 #include 
+#include 
 #endif
 
 #include 



CVS commit: src/sys/compat/netbsd32

2020-03-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Mar  8 04:17:50 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_mod.c

Log Message:
fix indentation.  NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/netbsd32/netbsd32_mod.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/compat/netbsd32/netbsd32_mod.c
diff -u src/sys/compat/netbsd32/netbsd32_mod.c:1.17 src/sys/compat/netbsd32/netbsd32_mod.c:1.18
--- src/sys/compat/netbsd32/netbsd32_mod.c:1.17	Sun Mar  8 00:53:12 2020
+++ src/sys/compat/netbsd32/netbsd32_mod.c	Sun Mar  8 04:17:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_mod.c,v 1.17 2020/03/08 00:53:12 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_mod.c,v 1.18 2020/03/08 04:17:49 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.17 2020/03/08 00:53:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.18 2020/03/08 04:17:49 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -173,7 +173,8 @@ compat_netbsd32_modcmd(modcmd_t cmd, voi
 			netbsd32_machdep_md_init();
 			netbsd32_kern_proc_32_init();
 #if defined(__amd64__)
-		MODULE_HOOK_SET(amd64_oosyscall_hook, amd64_oosyscall_handle);
+			MODULE_HOOK_SET(amd64_oosyscall_hook,
+			amd64_oosyscall_handle);
 #endif
 		}
 		return error;



CVS commit: src/sys/dev/pci

2020-03-07 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  8 03:16:20 UTC 2020

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

Log Message:
Use BUS_ADDR_{HI,LO}32().


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_cas.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/if_cas.c
diff -u src/sys/dev/pci/if_cas.c:1.41 src/sys/dev/pci/if_cas.c:1.42
--- src/sys/dev/pci/if_cas.c:1.41	Sun Mar  1 05:39:05 2020
+++ src/sys/dev/pci/if_cas.c	Sun Mar  8 03:16:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cas.c,v 1.41 2020/03/01 05:39:05 thorpej Exp $	*/
+/*	$NetBSD: if_cas.c,v 1.42 2020/03/08 03:16:20 thorpej Exp $	*/
 /*	$OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $	*/
 
 /*
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.41 2020/03/01 05:39:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.42 2020/03/08 03:16:20 thorpej Exp $");
 
 #ifndef _MODULE
 #include "opt_inet.h"
@@ -1211,25 +1211,28 @@ cas_init(struct ifnet *ifp)
 	/* step 6 & 7. Program Descriptor Ring Base Addresses */
 	KASSERT((CAS_CDTXADDR(sc, 0) & 0x1fff) == 0);
 	bus_space_write_4(t, h, CAS_TX_RING_PTR_HI,
-	(((uint64_t)CAS_CDTXADDR(sc, 0)) >> 32));
-	bus_space_write_4(t, h, CAS_TX_RING_PTR_LO, CAS_CDTXADDR(sc, 0));
+	BUS_ADDR_HI32(CAS_CDTXADDR(sc, 0)));
+	bus_space_write_4(t, h, CAS_TX_RING_PTR_LO,
+	BUS_ADDR_LO32(CAS_CDTXADDR(sc, 0)));
 
 	KASSERT((CAS_CDRXADDR(sc, 0) & 0x1fff) == 0);
 	bus_space_write_4(t, h, CAS_RX_DRING_PTR_HI,
-	(((uint64_t)CAS_CDRXADDR(sc, 0)) >> 32));
-	bus_space_write_4(t, h, CAS_RX_DRING_PTR_LO, CAS_CDRXADDR(sc, 0));
+	BUS_ADDR_HI32(CAS_CDRXADDR(sc, 0)));
+	bus_space_write_4(t, h, CAS_RX_DRING_PTR_LO,
+	BUS_ADDR_LO32(CAS_CDRXADDR(sc, 0)));
 
 	KASSERT((CAS_CDRXCADDR(sc, 0) & 0x1fff) == 0);
 	bus_space_write_4(t, h, CAS_RX_CRING_PTR_HI,
-	(((uint64_t)CAS_CDRXCADDR(sc, 0)) >> 32));
-	bus_space_write_4(t, h, CAS_RX_CRING_PTR_LO, CAS_CDRXCADDR(sc, 0));
+	BUS_ADDR_HI32(CAS_CDRXCADDR(sc, 0)));
+	bus_space_write_4(t, h, CAS_RX_CRING_PTR_LO,
+	BUS_ADDR_LO32(CAS_CDRXCADDR(sc, 0)));
 
 	if (CAS_PLUS(sc)) {
 		KASSERT((CAS_CDRXADDR2(sc, 0) & 0x1fff) == 0);
 		bus_space_write_4(t, h, CAS_RX_DRING_PTR_HI2,
-		(((uint64_t)CAS_CDRXADDR2(sc, 0)) >> 32));
+		BUS_ADDR_HI32(CAS_CDRXADDR2(sc, 0)));
 		bus_space_write_4(t, h, CAS_RX_DRING_PTR_LO2,
-		CAS_CDRXADDR2(sc, 0));
+		BUS_ADDR_LO32(CAS_CDRXADDR2(sc, 0)));
 	}
 
 	/* step 8. Global Configuration & Interrupt Mask */



CVS commit: src/sys/dev/pci

2020-03-07 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  8 02:44:12 UTC 2020

Modified Files:
src/sys/dev/pci: if_sip.c if_sipreg.h

Log Message:
Support 64-bit DMA addressing on the DP83820, used only when a 64-bit
DMA tag is available.


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/dev/pci/if_sip.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_sipreg.h

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

Modified files:

Index: src/sys/dev/pci/if_sip.c
diff -u src/sys/dev/pci/if_sip.c:1.178 src/sys/dev/pci/if_sip.c:1.179
--- src/sys/dev/pci/if_sip.c:1.178	Fri Feb  7 00:04:28 2020
+++ src/sys/dev/pci/if_sip.c	Sun Mar  8 02:44:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sip.c,v 1.178 2020/02/07 00:04:28 thorpej Exp $	*/
+/*	$NetBSD: if_sip.c,v 1.179 2020/03/08 02:44:12 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.178 2020/02/07 00:04:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.179 2020/03/08 02:44:12 thorpej Exp $");
 
 #include 
 #include 
@@ -208,9 +208,14 @@ struct sip_softc {
 	struct ethercom sc_ethercom;	/* ethernet common data */
 
 	const struct sip_product *sc_model; /* which model are we? */
-	int sc_gigabit;			/* 1: 83820, 0: other */
+	bool sc_gigabit;		/* 1: 83820, 0: other */
+	bool sc_dma64;			/* using 64-bit DMA addresses */
 	int sc_rev;			/* chip revision */
 
+	unsigned int sc_bufptr_idx;
+	unsigned int sc_cmdsts_idx;
+	unsigned int sc_extsts_idx;	/* DP83820 only */
+
 	void *sc_ih;			/* interrupt cookie */
 
 	struct mii_data sc_mii;		/* MII/media information */
@@ -471,6 +476,24 @@ sip_rxchain_link(struct sip_softc *sc, s
 #define	SIP_CDRXADDR(sc, x)	((sc)->sc_cddma + SIP_CDRXOFF((x)))
 
 static inline void
+sip_set_rxdp(struct sip_softc *sc, bus_addr_t addr)
+{
+	if (sc->sc_gigabit)
+		bus_space_write_4(sc->sc_st, sc->sc_sh, SIP_RXDP_HI,
+		BUS_ADDR_HI32(addr));
+	bus_space_write_4(sc->sc_st, sc->sc_sh, SIP_RXDP, BUS_ADDR_LO32(addr));
+}
+
+static inline void
+sip_set_txdp(struct sip_softc *sc, bus_addr_t addr)
+{
+	if (sc->sc_gigabit)
+		bus_space_write_4(sc->sc_st, sc->sc_sh, SIP_TXDP_HI,
+		BUS_ADDR_HI32(addr));
+	bus_space_write_4(sc->sc_st, sc->sc_sh, SIP_TXDP, BUS_ADDR_LO32(addr));
+}
+
+static inline void
 sip_cdtxsync(struct sip_softc *sc, const int x0, const int n0, const int ops)
 {
 	int x, n;
@@ -499,26 +522,51 @@ sip_cdrxsync(struct sip_softc *sc, int x
 	SIP_CDRXOFF(x), sizeof(struct sip_desc), ops);
 }
 
-#if 0
-#ifdef DP83820
-	uint32_t	sipd_bufptr;	/* pointer to DMA segment */
-	uint32_t	sipd_cmdsts;	/* command/status word */
-#else
-	uint32_t	sipd_cmdsts;	/* command/status word */
-	uint32_t	sipd_bufptr;	/* pointer to DMA segment */
-#endif /* DP83820 */
-#endif /* 0 */
-
-static inline volatile uint32_t *
-sipd_cmdsts(struct sip_softc *sc, struct sip_desc *sipd)
+static void
+sip_init_txring(struct sip_softc *sc)
 {
-	return >sipd_cbs[(sc->sc_gigabit) ? 1 : 0];
+	struct sip_desc *sipd;
+	bus_addr_t next_desc;
+	int i;
+
+	memset(sc->sc_txdescs, 0, sizeof(sc->sc_txdescs));
+	for (i = 0; i < sc->sc_ntxdesc; i++) {
+		sipd = >sc_txdescs[i];
+		next_desc = SIP_CDTXADDR(sc, sip_nexttx(sc, i));
+		if (sc->sc_dma64) {
+			sipd->sipd_words[GSIP64_DESC_LINK_LO] =
+			htole32(BUS_ADDR_LO32(next_desc));
+			sipd->sipd_words[GSIP64_DESC_LINK_HI] =
+			htole32(BUS_ADDR_HI32(next_desc));
+		} else {
+			/* SIP_DESC_LINK == GSIP_DESC_LINK */
+			sipd->sipd_words[SIP_DESC_LINK] = htole32(next_desc);
+		}
+	}
+	sip_cdtxsync(sc, 0, sc->sc_ntxdesc,
+	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	sc->sc_txfree = sc->sc_ntxdesc;
+	sc->sc_txnext = 0;
+	sc->sc_txwin = 0;
 }
 
-static inline volatile uint32_t *
-sipd_bufptr(struct sip_softc *sc, struct sip_desc *sipd)
+static inline void
+sip_init_txdesc(struct sip_softc *sc, int x, bus_addr_t bufptr, uint32_t cmdsts)
 {
-	return >sipd_cbs[(sc->sc_gigabit) ? 0 : 1];
+	struct sip_desc *sipd = >sc_txdescs[x];
+
+	if (sc->sc_dma64) {
+		sipd->sipd_words[GSIP64_DESC_BUFPTR_LO] =
+		htole32(BUS_ADDR_LO32(bufptr));
+		sipd->sipd_words[GSIP64_DESC_BUFPTR_HI] =
+		htole32(BUS_ADDR_HI32(bufptr));
+	} else {
+		sipd->sipd_words[sc->sc_bufptr_idx] = htole32(bufptr);
+	}
+	sipd->sipd_words[sc->sc_extsts_idx] = 0;
+	membar_producer();
+	sipd->sipd_words[sc->sc_cmdsts_idx] = htole32(cmdsts);
+	/* sip_cdtxsync() will be done later. */
 }
 
 static inline void
@@ -526,12 +574,27 @@ sip_init_rxdesc(struct sip_softc *sc, in
 {
 	struct sip_rxsoft *rxs = >sc_rxsoft[x];
 	struct sip_desc *sipd = >sc_rxdescs[x];
+	const bus_addr_t next_desc = SIP_CDRXADDR(sc, sip_nextrx(sc, x));
 
-	sipd->sipd_link = htole32(SIP_CDRXADDR(sc, sip_nextrx(sc, x)));
-	*sipd_bufptr(sc, sipd) = htole32(rxs->rxs_dmamap->dm_segs[0].ds_addr);
-	*sipd_cmdsts(sc, sipd) = htole32(CMDSTS_INTR |
-	(sc->sc_parm->p_rxbuf_len 

CVS commit: src/sys/sys

2020-03-07 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  8 02:42:00 UTC 2020

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

Log Message:
Add BUS_ADDR_{LO,HI}32() macros to correctly extract the lower and
upper halves of 64-bit DMA addresses for 32-bit and 64-bit bus_addr_t.
This is a common pattern in modern drivers, so it's a good idea to provide
a common correct definition.

This particular implementation suggested by riastradh@.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/bus.h

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

Modified files:

Index: src/sys/sys/bus.h
diff -u src/sys/sys/bus.h:1.12 src/sys/sys/bus.h:1.13
--- src/sys/sys/bus.h:1.12	Thu Apr 19 21:19:07 2018
+++ src/sys/sys/bus.h	Sun Mar  8 02:42:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.12 2018/04/19 21:19:07 christos Exp $	*/
+/*	$NetBSD: bus.h,v 1.13 2020/03/08 02:42:00 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -245,4 +245,12 @@ typedef struct bus_dmamap {
 } *bus_dmamap_t;
 #endif /* __HAVE_NO_BUS_DMA */
 
+/*
+ * Convenience macros to correctly extract the upper and lower
+ * 32 bits of a bus_addr_t (which may be a 32-bit or 64-bit
+ * value).
+ */
+#define	BUS_ADDR_HI32(a)	((uint32_t) __SHIFTOUT(a, __BITS(32,63)))
+#define	BUS_ADDR_LO32(a)	((uint32_t) __SHIFTOUT(a, __BITS(0,31)))
+
 #endif	/* _SYS_BUS_H_ */



CVS commit: src/sys

2020-03-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Mar  8 00:53:13 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64: trap.c
src/sys/compat/netbsd32: netbsd32_mod.c
src/sys/sys: compat_stub.h

Log Message:
Fix another left-over from last year's [pgoyette-compat] work.  This
allows recognition of the oosyscall sequence for amd64.

Fixes PR kern/55038

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.16 -r1.17 src/sys/compat/netbsd32/netbsd32_mod.c
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/compat_stub.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/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.125 src/sys/arch/amd64/amd64/trap.c:1.126
--- src/sys/arch/amd64/amd64/trap.c:1.125	Thu Nov 21 19:23:58 2019
+++ src/sys/arch/amd64/amd64/trap.c	Sun Mar  8 00:53:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.125 2019/11/21 19:23:58 ad Exp $	*/
+/*	$NetBSD: trap.c,v 1.126 2020/03/08 00:53:12 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.125 2019/11/21 19:23:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.126 2020/03/08 00:53:12 pgoyette Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -83,14 +83,11 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.1
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
-#ifdef COMPAT_NETBSD32
-#include 
-#include 
-#endif
-
 #include 
 #include 
 #include 
@@ -118,6 +115,11 @@ dtrace_trap_func_t dtrace_trap_func = NU
 dtrace_doubletrap_func_t dtrace_doubletrap_func = NULL;
 #endif
 
+/*
+ * Module hook for amd64_oosyscall
+ */
+struct amd64_oosyscall_hook_t amd64_oosyscall_hook;
+
 void nmitrap(struct trapframe *);
 void doubletrap(struct trapframe *);
 void trap(struct trapframe *);
@@ -342,32 +344,13 @@ trap(struct trapframe *frame)
 		goto we_re_toast;
 
 	case T_PROTFLT|T_USER:		/* protection fault */
-#if defined(COMPAT_NETBSD32) && defined(COMPAT_10)
+	{	int hook_ret;
 
-/*
- * XXX This code currently not included in loadable module;  it is
- * only included in built-in modules.
- */
-	{
-		static const char lcall[7] = { 0x9a, 0, 0, 0, 0, 7, 0 };
-		const size_t sz = sizeof(lcall);
-		char tmp[sizeof(lcall) /* Avoids VLA */];
-
-		/* Check for the oosyscall lcall instruction. */
-		if (p->p_emul == _netbsd32 &&
-		frame->tf_rip < VM_MAXUSER_ADDRESS32 - sz &&
-		copyin((void *)frame->tf_rip, tmp, sz) == 0 &&
-		memcmp(tmp, lcall, sz) == 0) {
-
-			/* Advance past the lcall. */
-			frame->tf_rip += sz;
-
-			/* Do the syscall. */
-			p->p_md.md_syscall(frame);
+		MODULE_HOOK_CALL(amd64_oosyscall_hook, (p, frame),
+			ENOSYS, hook_ret);
+		if (hook_ret == 0)
 			goto out;
-		}
 	}
-#endif
 		/* FALLTHROUGH */
 	case T_TSSFLT|T_USER:
 	case T_SEGNPFLT|T_USER:

Index: src/sys/compat/netbsd32/netbsd32_mod.c
diff -u src/sys/compat/netbsd32/netbsd32_mod.c:1.16 src/sys/compat/netbsd32/netbsd32_mod.c:1.17
--- src/sys/compat/netbsd32/netbsd32_mod.c:1.16	Wed Nov 20 19:37:53 2019
+++ src/sys/compat/netbsd32/netbsd32_mod.c	Sun Mar  8 00:53:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_mod.c,v 1.16 2019/11/20 19:37:53 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_mod.c,v 1.17 2020/03/08 00:53:12 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,8 +29,37 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+ * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum, and by Maxime Villard.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 

CVS commit: src/sys/kern

2020-03-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar  8 00:31:19 UTC 2020

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

Log Message:
KMEM_SIZE: append the size_t to the allocated buffer, rather than
prepending, so it doesn't screw up the alignment of the buffer.

Reported-by: syzbot+c024c50570cccac51...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/kern/subr_kmem.c

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

Modified files:

Index: src/sys/kern/subr_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.78 src/sys/kern/subr_kmem.c:1.79
--- src/sys/kern/subr_kmem.c:1.78	Sat Jan 25 15:08:40 2020
+++ src/sys/kern/subr_kmem.c	Sun Mar  8 00:31:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kmem.c,v 1.78 2020/01/25 15:08:40 ad Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.79 2020/03/08 00:31:19 ad Exp $	*/
 
 /*
  * Copyright (c) 2009-2020 The NetBSD Foundation, Inc.
@@ -62,23 +62,23 @@
 
 /*
  * KMEM_SIZE: detect alloc/free size mismatch bugs.
- *	Prefix each allocations with a fixed-sized, aligned header and record
- *	the exact user-requested allocation size in it. When freeing, compare
- *	it with kmem_free's "size" argument.
+ *	Append to each allocation a fixed-sized footer and record the exact
+ *	user-requested allocation size in it.  When freeing, compare it with
+ *	kmem_free's "size" argument.
  *
  * This option is enabled on DIAGNOSTIC.
  *
- *  |CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|
- *  +-+-+-+-+-+-+-+-+-+---+-+
- *  |/| | | | | | | | |   |U|
- *  |/HSZ/| | | | | | | | |   |U|
- *  |/| | | | | | | | |   |U|
- *  +-+-+-+-+-+-+-+-+-+---+-+
- *  |Size |Buffer usable by the caller (requested size)   |Unused\
+ *  |CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK| |
+ *  +-+-+-+-+-+-+-+-+-+-+
+ *  | | | | | | | | |/|U|
+ *  | | | | | | | | |/HSZ/|U|
+ *  | | | | | | | | |/|U|
+ *  +-+-+-+-+-+-+-+-+-+-+
+ *  | Buffer usable by the caller (requested size)  |Size |Unused
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.78 2020/01/25 15:08:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.79 2020/03/08 00:31:19 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kmem.h"
@@ -168,10 +168,7 @@ static void *kmem_freecheck;
 #endif
 
 #if defined(KMEM_SIZE)
-struct kmem_header {
-	size_t		size;
-} __aligned(KMEM_ALIGN);
-#define	SIZE_SIZE	sizeof(struct kmem_header)
+#define	SIZE_SIZE	sizeof(size_t)
 static void kmem_size_set(void *, size_t);
 static void kmem_size_check(void *, size_t);
 #else
@@ -229,7 +226,6 @@ kmem_intr_alloc(size_t requested_size, k
 	if (__predict_true(p != NULL)) {
 		FREECHECK_OUT(_freecheck, p);
 		kmem_size_set(p, requested_size);
-		p += SIZE_SIZE;
 		kasan_mark(p, origsize, size, KASAN_KMEM_REDZONE);
 		return p;
 	}
@@ -283,7 +279,6 @@ kmem_intr_free(void *p, size_t requested
 
 	kasan_mark(p, size, size, 0);
 
-	p = (uint8_t *)p - SIZE_SIZE;
 	kmem_size_check(p, requested_size);
 	FREECHECK_IN(_freecheck, p);
 	LOCKDEBUG_MEM_CHECK(p, size);
@@ -485,25 +480,21 @@ kmem_strfree(char *str)
 static void
 kmem_size_set(void *p, size_t sz)
 {
-	struct kmem_header *hd;
-	hd = (struct kmem_header *)p;
-	hd->size = sz;
+	memcpy((size_t *)((uintptr_t)p + sz), , sizeof(size_t));
 }
 
 static void
 kmem_size_check(void *p, size_t sz)
 {
-	struct kmem_header *hd;
 	size_t hsz;
 
-	hd = (struct kmem_header *)p;
-	hsz = hd->size;
+	memcpy(, (size_t *)((uintptr_t)p + sz), sizeof(size_t));
 
 	if (hsz != sz) {
-		panic("kmem_free(%p, %zu) != allocated size %zu",
-		(const uint8_t *)p + SIZE_SIZE, sz, hsz);
+		panic("kmem_free(%p, %zu) != allocated size %zu; overwrote?",
+		p, sz, hsz);
 	}
 
-	hd->size = -1;
+	memset((size_t *)((uintptr_t)p + sz), 0xff, sizeof(size_t));
 }
 #endif /* defined(KMEM_SIZE) */



CVS commit: src/sys/kern

2020-03-07 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Mar  8 00:26:06 UTC 2020

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

Log Message:
split an "a && b" assertion into two so it's clear in the dump which condition
was not true even if both are true by the time the dump is written.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/kern/kern_mutex.c

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

Modified files:

Index: src/sys/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.89 src/sys/kern/kern_mutex.c:1.90
--- src/sys/kern/kern_mutex.c:1.89	Thu Jan 23 12:35:23 2020
+++ src/sys/kern/kern_mutex.c	Sun Mar  8 00:26:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.89 2020/01/23 12:35:23 ad Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.90 2020/03/08 00:26:06 chs Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.89 2020/01/23 12:35:23 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.90 2020/03/08 00:26:06 chs Exp $");
 
 #include 
 #include 
@@ -384,8 +384,8 @@ mutex_destroy(kmutex_t *mtx)
 	uintptr_t owner = mtx->mtx_owner;
 
 	if (MUTEX_ADAPTIVE_P(owner)) {
-		MUTEX_ASSERT(mtx, !MUTEX_OWNED(owner) &&
-		!MUTEX_HAS_WAITERS(mtx));
+		MUTEX_ASSERT(mtx, !MUTEX_OWNED(owner));
+		MUTEX_ASSERT(mtx, !MUTEX_HAS_WAITERS(mtx));
 	} else {
 		MUTEX_ASSERT(mtx, !MUTEX_SPINBIT_LOCKED_P(mtx));
 	}



CVS commit: src/sys/ufs/ufs

2020-03-07 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Mar  8 00:23:59 UTC 2020

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

Log Message:
in ufsdirhash_free(), only examine dh->dh_onlist after taking the
dirhashlist lock.  if we skip the lock then we might see that
dh_onlist is zero while ufsdirhash_recycle() is still working on
the dirhash.  the symptom I saw was that ufsdirhash_free() would
try to destroy the dh_lock mutex while it was still held.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/ufs/ufs/ufs_dirhash.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_dirhash.c
diff -u src/sys/ufs/ufs/ufs_dirhash.c:1.37 src/sys/ufs/ufs/ufs_dirhash.c:1.38
--- src/sys/ufs/ufs/ufs_dirhash.c:1.37	Sat Dec 20 00:28:05 2014
+++ src/sys/ufs/ufs/ufs_dirhash.c	Sun Mar  8 00:23:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_dirhash.c,v 1.37 2014/12/20 00:28:05 christos Exp $	*/
+/*	$NetBSD: ufs_dirhash.c,v 1.38 2020/03/08 00:23:59 chs Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Ian Dowse.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_dirhash.c,v 1.37 2014/12/20 00:28:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_dirhash.c,v 1.38 2020/03/08 00:23:59 chs Exp $");
 
 /*
  * This implements a hash-based lookup scheme for UFS directories.
@@ -285,12 +285,10 @@ ufsdirhash_free(struct inode *ip)
 
 	ip->i_dirhash = NULL;
 
-	if (dh->dh_onlist) {
-		DIRHASHLIST_LOCK();
-		if (dh->dh_onlist)
-			TAILQ_REMOVE(_list, dh, dh_list);
-		DIRHASHLIST_UNLOCK();
-	}
+	DIRHASHLIST_LOCK();
+	if (dh->dh_onlist)
+		TAILQ_REMOVE(_list, dh, dh_list);
+	DIRHASHLIST_UNLOCK();
 
 	/* The dirhash pointed to by 'dh' is exclusively ours now. */
 	mem = sizeof(*dh);



CVS commit: src/sys/conf

2020-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  8 00:18:41 UTC 2020

Modified Files:
src/sys/conf: files

Log Message:
undo previous since config has been fixed


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

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1260 src/sys/conf/files:1.1261
--- src/sys/conf/files:1.1260	Sat Mar  7 13:08:47 2020
+++ src/sys/conf/files	Sat Mar  7 19:18:41 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1260 2020/03/07 18:08:47 thorpej Exp $
+#	$NetBSD: files,v 1.1261 2020/03/08 00:18:41 christos Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -169,13 +169,11 @@ defflagCOMPAT_ULTRIX: COMPAT_50
 # other users of COMPAT_NETBSD32 need EXEC_AOUT
 ifdef mips
 defflagCOMPAT_NETBSD32
-else
-ifdef aarch64
+elifdef aarch64
 defflagCOMPAT_NETBSD32
 else
 defflagCOMPAT_NETBSD32	: EXEC_AOUT
 endif
-endif
 
 defflagCOMPAT_SYSV
 defflagSYSV_IPC	: SYSVSHM, SYSVSEM, SYSVMSG



CVS commit: src/lib/libkvm

2020-03-07 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Mar  8 00:14:18 UTC 2020

Modified Files:
src/lib/libkvm: kvm_x86_64.c

Log Message:
use a binary search in _kvm_pa2off().  this helps a lot for sparse dumps,
which can have millions of memory segments.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libkvm/kvm_x86_64.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/libkvm/kvm_x86_64.c
diff -u src/lib/libkvm/kvm_x86_64.c:1.10 src/lib/libkvm/kvm_x86_64.c:1.11
--- src/lib/libkvm/kvm_x86_64.c:1.10	Wed Feb 19 20:21:22 2014
+++ src/lib/libkvm/kvm_x86_64.c	Sun Mar  8 00:14:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm_x86_64.c,v 1.10 2014/02/19 20:21:22 dsl Exp $	*/
+/*	$NetBSD: kvm_x86_64.c,v 1.11 2020/03/08 00:14:18 chs Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_hp300.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: kvm_x86_64.c,v 1.10 2014/02/19 20:21:22 dsl Exp $");
+__RCSID("$NetBSD: kvm_x86_64.c,v 1.11 2020/03/08 00:14:18 chs Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -186,6 +186,36 @@ _kvm_kvatop(kvm_t *kd, vaddr_t va, paddr
 	return (0);
 }
 
+struct p2o {
+	paddr_t pa;
+	psize_t sz;
+	off_t off;
+};
+
+static int
+cmp_p2o(const void *a, const void *b)
+{
+	const struct p2o *p1 = a;
+	const struct p2o *p2 = b;
+
+	/* If one range contains the start of the other, it's a match. */
+	if (p1->pa >= p2->pa && p1->pa < p2->pa + p2->sz) {
+		return 0;
+	}
+	if (p2->pa >= p1->pa && p2->pa < p1->pa + p1->sz) {
+		return 0;
+	}
+
+	/* Otherwise sort by pa. */
+	if (p1->pa < p2->pa)
+		return -1;
+	else if (p1->pa > p2->pa)
+		return 1;
+	else
+		return 0;
+}
+
+
 /*
  * Translate a physical address to a file-offset in the crash dump.
  */
@@ -197,19 +227,36 @@ _kvm_pa2off(kvm_t *kd, paddr_t pa)
 	off_t off;
 	int i;
 
+	static struct p2o *map;
+	struct p2o key, *val;
+
 	cpu_kh = kd->cpu_data;
 	ramsegs = (void *)((char *)(void *)cpu_kh + ALIGN(sizeof *cpu_kh));
 
-	off = 0;
-	for (i = 0; i < cpu_kh->nmemsegs; i++) {
-		if (pa >= ramsegs[i].start &&
-		(pa - ramsegs[i].start) < ramsegs[i].size) {
-			off += (pa - ramsegs[i].start);
-			break;
+	if (map == NULL) {
+		map = calloc(sizeof *map, cpu_kh->nmemsegs);
+		off = 0;
+		for (i = 0; i < cpu_kh->nmemsegs; i++) {
+			map[i].pa = ramsegs[i].start;
+			map[i].sz = ramsegs[i].size;
+			map[i].off = off;
+			off += ramsegs[i].size;
 		}
-		off += ramsegs[i].size;
+#if 0
+		/* The array appears to be sorted already */
+		qsort(map, cpu_kh->nmemsegs, sizeof(*map), cmp_p2o);
+#endif
 	}
 
+	key.pa = pa;
+	key.sz = 1;
+	key.off = -1;
+	val = bsearch(, map, cpu_kh->nmemsegs, sizeof (key), cmp_p2o);
+	if (val)
+		off = val->off + pa - val->pa;
+	else
+		off = 0;
+
 	return (kd->dump_off + off);
 }
 



CVS commit: src/usr.bin/config

2020-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  8 00:04:12 UTC 2020

Modified Files:
src/usr.bin/config: scan.l

Log Message:
Recognize {if{,n}def,elfif{,n}def,else,endif} only at the beginning of the
line or after whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/config/scan.l

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/config/scan.l
diff -u src/usr.bin/config/scan.l:1.28 src/usr.bin/config/scan.l:1.29
--- src/usr.bin/config/scan.l:1.28	Sat Mar  7 17:35:16 2020
+++ src/usr.bin/config/scan.l	Sat Mar  7 19:04:11 2020
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: scan.l,v 1.28 2020/03/07 22:35:16 christos Exp $	*/
+/*	$NetBSD: scan.l,v 1.29 2020/03/08 00:04:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: scan.l,v 1.28 2020/03/07 22:35:16 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.29 2020/03/08 00:04:11 christos Exp $");
 
 #include 
 #include 
@@ -107,6 +107,7 @@ QCHARS	\"(\\.|[^\\"])*\" 
 WORD	[A-Za-z_][-A-Za-z_0-9]*
 FILENAME	({PATH}|{QCHARS})
 RESTOFLINE	[ \t]*(#[^\n]*)?\n
+WS	^[ \t]*
 
 %x	IGNORED
 
@@ -169,7 +170,7 @@ with		return WITH;
 \+=		return PLUSEQ;
 :=		return COLONEQ;
 
-<*>ifdef[ \t]+{WORD}{RESTOFLINE} {
+<*>{WS}ifdef[ \t]+{WORD}{RESTOFLINE} {
 		ifdefstate <<= IDS_SHIFT;
 		if (++ifdefshift >= IDS_MAX_DEPTH) {
 			yyerror("too many levels of conditional");
@@ -183,7 +184,7 @@ with		return WITH;
 		yyline++;
 	}
 
-<*>ifndef[ \t]+{WORD}{RESTOFLINE} {
+<*>{WS}ifndef[ \t]+{WORD}{RESTOFLINE} {
 		ifdefstate <<= IDS_SHIFT;
 		if (++ifdefshift >= IDS_MAX_DEPTH) {
 			yyerror("too many levels of conditional");
@@ -198,7 +199,7 @@ with		return WITH;
 	}
 
 
-<*>elifdef[ \t]+{WORD}{RESTOFLINE} {
+<*>{WS}elifdef[ \t]+{WORD}{RESTOFLINE} {
 		int st = ifdefstate & IDS_BITS;
 		if (ifdefshift == -1 || (st & IDS_ELSE) != 0) {
 			yyerror("mismatched elifdef");
@@ -213,7 +214,7 @@ with		return WITH;
 		yyline++;
 	}
 
-<*>elifndef[ \t]+{WORD}{RESTOFLINE} {
+<*>{WS}elifndef[ \t]+{WORD}{RESTOFLINE} {
 		int st = ifdefstate & IDS_BITS;
 		if (ifdefshift == -1 || (st & IDS_ELSE) != 0) {
 			yyerror("mismatched elifndef");
@@ -228,7 +229,7 @@ with		return WITH;
 		yyline++;
 	}
 
-<*>else{RESTOFLINE} {
+<*>{WS}else{RESTOFLINE} {
 		int st = ifdefstate & IDS_BITS;
 		if (ifdefshift == -1 || (st & IDS_ELSE) != 0) {
 			yyerror("mismatched else");
@@ -243,7 +244,7 @@ with		return WITH;
 		yyline++;
 	}
 
-<*>endif{RESTOFLINE} {
+<*>{WS}endif{RESTOFLINE} {
 		if (ifdefshift == -1) {
 			yyerror("mismatched endif");
 		}



CVS commit: src/lib/libkvm

2020-03-07 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Mar  8 00:06:42 UTC 2020

Modified Files:
src/lib/libkvm: kvm.c

Log Message:
only do bounce buffering for character devices.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/lib/libkvm/kvm.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/libkvm/kvm.c
diff -u src/lib/libkvm/kvm.c:1.104 src/lib/libkvm/kvm.c:1.105
--- src/lib/libkvm/kvm.c:1.104	Mon Nov  5 00:43:30 2018
+++ src/lib/libkvm/kvm.c	Sun Mar  8 00:06:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm.c,v 1.104 2018/11/05 00:43:30 mrg Exp $	*/
+/*	$NetBSD: kvm.c,v 1.105 2020/03/08 00:06:42 chs Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm.c	8.2 (Berkeley) 2/13/94";
 #else
-__RCSID("$NetBSD: kvm.c,v 1.104 2018/11/05 00:43:30 mrg Exp $");
+__RCSID("$NetBSD: kvm.c,v 1.105 2020/03/08 00:06:42 chs Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -352,7 +352,12 @@ _kvm_open(kvm_t *kd, const char *uf, con
 			/* swap is not configured?  not fatal */
 		}
 	} else {
-		kd->fdalign = DEV_BSIZE;	/* XXX */
+		if (S_ISCHR(st.st_mode)) {
+			kd->fdalign = DEV_BSIZE;
+		} else {
+			kd->fdalign = 1;
+		}
+
 		/*
 		 * This is a crash dump.
 		 * Initialize the virtual address translation machinery.



CVS commit: src/sys/kern

2020-03-07 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Mar  7 23:20:19 UTC 2020

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

Log Message:
clean trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/kern/subr_tftproot.c

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

Modified files:

Index: src/sys/kern/subr_tftproot.c
diff -u src/sys/kern/subr_tftproot.c:1.23 src/sys/kern/subr_tftproot.c:1.24
--- src/sys/kern/subr_tftproot.c:1.23	Sun Jan 20 21:26:13 2019
+++ src/sys/kern/subr_tftproot.c	Sat Mar  7 23:20:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_tftproot.c,v 1.23 2019/01/20 21:26:13 bad Exp $ */
+/*	$NetBSD: subr_tftproot.c,v 1.24 2020/03/07 23:20:19 tnn Exp $ */
 
 /*-
  * Copyright (c) 2007 Emmanuel Dreyfus, all rights reserved.
@@ -14,14 +14,14 @@
  * 3. All advertising materials mentioning features or use of this software
  *must display the following acknowledgement:
  *	This product includes software developed by Emmanuel Dreyfus
- * 4. The name of the author may not be used to endorse or promote 
- *products derived from this software without specific prior written 
+ * 4. The name of the author may not be used to endorse or promote
+ *products derived from this software without specific prior written
  *permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS'' 
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+ * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -39,7 +39,7 @@
 #include "opt_md.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.23 2019/01/20 21:26:13 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.24 2020/03/07 23:20:19 tnn Exp $");
 
 #include 
 #include 
@@ -65,8 +65,8 @@ __KERNEL_RCSID(0, "$NetBSD: subr_tftproo
 #include 
 #include 
 
-/* 
- * Copied from  
+/*
+ * Copied from 
  */
 
 #define SEGSIZE 512 /* data segment size */
@@ -134,7 +134,7 @@ tftproot_dhcpboot(device_t bootdv)
 			if (strcmp(rootspec, ifp->if_xname) == 0)
 break;
 		pserialize_read_exit(s);
-	} 
+	}
 
 	if ((ifp == NULL) &&
 	(bootdv != NULL && device_class(bootdv) == DV_IFNET)) {
@@ -167,12 +167,12 @@ tftproot_dhcpboot(device_t bootdv)
 	nd->nd_nomount = 1;
 
 	if ((error = nfs_boot_init(nd, l)) != 0) {
-		DPRINTF(("%s():%d nfs_boot_init returned %d\n", 
+		DPRINTF(("%s():%d nfs_boot_init returned %d\n",
 		__func__, __LINE__, error));
 		goto out;
 	}
 
-	/* 
+	/*
 	 * Strip leading "tftp:"
 	 */
 #define PREFIX "tftp:"
@@ -189,7 +189,7 @@ tftproot_dhcpboot(device_t bootdv)
 	trh.trh_block = 1;
 
 	if ((error = tftproot_getfile(, l)) != 0) {
-		DPRINTF(("%s():%d tftproot_getfile returned %d\n", 
+		DPRINTF(("%s():%d tftproot_getfile returned %d\n",
 		__func__, __LINE__, error));
 		goto out;
 	}
@@ -203,7 +203,7 @@ out:
 	return error;
 }
 
-static int 
+static int
 tftproot_getfile(struct tftproot_handle *trh, struct lwp *l)
 {
 	struct socket *so = NULL;
@@ -218,7 +218,7 @@ tftproot_getfile(struct tftproot_handle 
 	char *cp;
 	
 	if ((error = socreate(AF_INET, , SOCK_DGRAM, 0, l, NULL)) != 0) {
-		DPRINTF(("%s():%d socreate returned %d\n", 
+		DPRINTF(("%s():%d socreate returned %d\n",
 		__func__, __LINE__, error));
 		goto out;
 	}
@@ -227,7 +227,7 @@ tftproot_getfile(struct tftproot_handle 
 	 * Set timeout
 	 */
 	if ((error = nfs_boot_setrecvtimo(so))) {
-		DPRINTF(("%s():%d SO_RCVTIMEO failed %d\n", 
+		DPRINTF(("%s():%d SO_RCVTIMEO failed %d\n",
 		__func__, __LINE__, error));
 		goto out;
 	}
@@ -244,7 +244,7 @@ tftproot_getfile(struct tftproot_handle 
 	namelen = strlen(trh->trh_nd->nd_bootfile) + 1;
 	packetlen = sizeof(tftp->th_opcode) + namelen + sizeof(octetstr);
 	if (packetlen > MSIZE) {
-		DPRINTF(("%s():%d boot filename too long (%ld bytes)\n", 
+		DPRINTF(("%s():%d boot filename too long (%ld bytes)\n",
 		__func__, __LINE__, (long)namelen));
 		error = E2BIG;
 		goto out;
@@ -265,10 +265,10 @@ tftproot_getfile(struct tftproot_handle 
 	cp += namelen;
 	(void)strncpy(cp, octetstr, sizeof(octetstr));
 
-	/* 
+	/*
 	 * Perform the file transfer
 	 */
-	printf("tftproot: download %s:%s ", 
+	printf("tftproot: download %s:%s ",
 	inet_ntoa(sin.sin_addr), trh->trh_nd->nd_bootfile);
 
 	do {
@@ -281,19 +281,19 @@ tftproot_getfile(struct tftproot_handle 
 		if ((trh->trh_block % 

CVS commit: src/share/man/man4

2020-03-07 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Mar  7 23:17:47 UTC 2020

Modified Files:
src/share/man/man4: options.4

Log Message:
correct documentation for options TFTPROOT

TFTPROOT does *not* require MEMORY_DISK_IS_ROOT. In fact, it doesn't
work at all when MEMORY_DISK_IS_ROOT is set, because then setroot()
tries to perform dhcp on md0 instead of the network card.


To generate a diff of this commit:
cvs rdiff -u -r1.508 -r1.509 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.508 src/share/man/man4/options.4:1.509
--- src/share/man/man4/options.4:1.508	Sat Feb  8 07:07:06 2020
+++ src/share/man/man4/options.4	Sat Mar  7 23:17:47 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.508 2020/02/08 07:07:06 maxv Exp $
+.\"	$NetBSD: options.4,v 1.509 2020/03/07 23:17:47 tnn Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd February 8, 2020
+.Dd March 7, 2020
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -1323,10 +1323,9 @@ embedded in the kernel using
 .Xr mdsetimage 8 .
 The RAM disk name is obtained using DHCP's filename parameter.
 This option requires
-.Em MEMORY_DISK_HOOKS ,
-.Em MEMORY_DISK_DYNAMIC ,
+.Em MEMORY_DISK_HOOKS
 and
-.Em MEMORY_DISK_IS_ROOT .
+.Em MEMORY_DISK_DYNAMIC .
 It is incompatible with
 .Em MEMORY_DISK_ROOT_SIZE .
 .It Cd options HZ=integer



CVS commit: src/usr.bin/config

2020-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar  7 22:35:16 UTC 2020

Modified Files:
src/usr.bin/config: scan.l

Log Message:
PR/55057: Paul Goyette: Don't use % 6 arithmetic that hurts the brain for
the ifdef state machine, use bits and shifts instead. Also don't forget to
restore the state once an include file ends.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/config/scan.l

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/config/scan.l
diff -u src/usr.bin/config/scan.l:1.27 src/usr.bin/config/scan.l:1.28
--- src/usr.bin/config/scan.l:1.27	Sat Mar  7 14:26:13 2020
+++ src/usr.bin/config/scan.l	Sat Mar  7 17:35:16 2020
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: scan.l,v 1.27 2020/03/07 19:26:13 christos Exp $	*/
+/*	$NetBSD: scan.l,v 1.28 2020/03/07 22:35:16 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: scan.l,v 1.27 2020/03/07 19:26:13 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.28 2020/03/07 22:35:16 christos Exp $");
 
 #include 
 #include 
@@ -62,34 +62,23 @@ int	yyline;
 const char *yyfile;
 const char *lastfile;
 char curinclpath[PATH_MAX];
-int ifdefstate = -1;
-int st;
-#define IDS_PARENT_DISABLED \
-((ifdefstate > 6) && ifdefstate/6)-1) & 1) == 1))
-#define IDS_MAX_DEPTH		362797056 /* 6^11 */
-/* States for ifdefstate:
-
-  0  -> matched ifdef
-  1  -> unmatched ifdef
-  2  -> matched elifdef
-  3  -> unmatched elifdef
-  4  -> matched else
-  5  -> unmatched else
-
-  Upon "ifdef", add one and multiply by 6.
-  Upon "endif", divide by 6, remove 1.
-
-  ifdef -> MATCH => continue
-   MISMATCH => set to 1
-  elifdef -> if (!1) -> MISMATCH
- MATCH => set to 2
- MISMATCH => if (2 || 3) set to 3, else set to 1
-  else -> if (1) -> MATCH
-  MATCH => set to 4
-  MISMATCH => set to 5
+uint64_t ifdefstate;
+int	 ifdefshift = -1;
+
+/*
+ * The state is represented by 3 bits.
+ */
+#define IDS_MATCH	1ll
+#define IDS_ELIF	2ll
+#define	IDS_ELSE	4ll
+
+#define IDS_BITS	7
+#define IDS_SHIFT	3
 
-  in each case, if parent & 1 == 1, MISMATCH
-*/
+#define IDS_ISMATCH(st) (((st) & IDS_MATCH) != 0)
+#define IDS_PARENT_DISABLED \
+	(ifdefshift > 0 && !IDS_ISMATCH(ifdefstate >> IDS_SHIFT))
+#define IDS_MAX_DEPTH	21 /* 64 / 3 */
  
 /*
  * Data for returning to previous files from include files.
@@ -100,7 +89,8 @@ struct incl {
 	struct where in_where;
 	int	in_ateof;	/* token to insert at EOF */
 	int	in_interesting;	/* previous value for "interesting" */
-	int	in_ifdefstate;	/* conditional level */
+	uint64_t	in_ifdefstate;	/* conditional level */
+	int	in_ifdefshift;	/* conditional level */
 };
 static struct incl *incl;
 static int endinclude(void);
@@ -180,97 +170,88 @@ with		return WITH;
 :=		return COLONEQ;
 
 <*>ifdef[ \t]+{WORD}{RESTOFLINE} {
-		ifdefstate = (ifdefstate + 1) * 6;
-		if (ifdefstate >= IDS_MAX_DEPTH) {
+		ifdefstate <<= IDS_SHIFT;
+		if (++ifdefshift >= IDS_MAX_DEPTH) {
 			yyerror("too many levels of conditional");
 		}
-		if (!IDS_PARENT_DISABLED && getcurifdef()) {
-			BEGIN(INITIAL);
-		} else {
-			ifdefstate++;
+		if (IDS_PARENT_DISABLED || !getcurifdef()) {
 			BEGIN(IGNORED);
+		} else {
+			ifdefstate |= IDS_MATCH;
+			BEGIN(INITIAL);
 		}
 		yyline++;
 	}
 
 <*>ifndef[ \t]+{WORD}{RESTOFLINE} {
-		ifdefstate = (ifdefstate + 1) * 6;
-		if (ifdefstate >= IDS_MAX_DEPTH) {
+		ifdefstate <<= IDS_SHIFT;
+		if (++ifdefshift >= IDS_MAX_DEPTH) {
 			yyerror("too many levels of conditional");
 		}
-		if (!IDS_PARENT_DISABLED && !getcurifdef()) {
-			BEGIN(INITIAL);
-		} else {
-			ifdefstate++;
+		if (IDS_PARENT_DISABLED || getcurifdef()) {
 			BEGIN(IGNORED);
+		} else {
+			ifdefstate |= IDS_MATCH;
+			BEGIN(INITIAL);
 		}
 		yyline++;
 	}
 
 
 <*>elifdef[ \t]+{WORD}{RESTOFLINE} {
-		st = ifdefstate % 6;
-		if (ifdefstate < 0 || st > 3) {
+		int st = ifdefstate & IDS_BITS;
+		if (ifdefshift == -1 || (st & IDS_ELSE) != 0) {
 			yyerror("mismatched elifdef");
 		}
-		if (IDS_PARENT_DISABLED ||
-		st != 1 || !getcurifdef()) {
-			if (st == 2 || st == 3) {
-ifdefstate += 3 - st;
-			} else {
-ifdefstate += 1 - st;
-			}
+		if (IDS_PARENT_DISABLED || IDS_ISMATCH(st) || !getcurifdef()) {
 			BEGIN(IGNORED);
 		} else {
-			ifdefstate++;
+			ifdefstate |= IDS_MATCH;
 			BEGIN(INITIAL);
 		}
+		ifdefstate |= IDS_ELIF;
 		yyline++;
 	}
 
 <*>elifndef[ \t]+{WORD}{RESTOFLINE} {
-		st = ifdefstate % 6;
-		if (ifdefstate < 0 || st > 3) {
+		int st = ifdefstate & IDS_BITS;
+		if (ifdefshift == -1 || (st & IDS_ELSE) != 0) {
 			yyerror("mismatched elifndef");
 		}
-		if (IDS_PARENT_DISABLED ||
-		st != 1 || getcurifdef()) {
-			if (st == 2 || st == 3) {
-ifdefstate += 3 - st;
-			} else {
-ifdefstate += 1 - st;
-			}
+		if (IDS_PARENT_DISABLED || IDS_ISMATCH(st) || getcurifdef()) {
 			BEGIN(IGNORED);
 		} else {
-			

CVS commit: src/sys/arch/amiga/conf

2020-03-07 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Sat Mar  7 20:27:55 UTC 2020

Modified Files:
src/sys/arch/amiga/conf: WSCONS files.amiga

Log Message:
Whitespace police


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/amiga/conf/WSCONS
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/amiga/conf/files.amiga

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/amiga/conf/WSCONS
diff -u src/sys/arch/amiga/conf/WSCONS:1.71 src/sys/arch/amiga/conf/WSCONS:1.72
--- src/sys/arch/amiga/conf/WSCONS:1.71	Fri Nov  4 18:06:08 2016
+++ src/sys/arch/amiga/conf/WSCONS	Sat Mar  7 20:27:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: WSCONS,v 1.71 2016/11/04 18:06:08 phx Exp $
+# $NetBSD: WSCONS,v 1.72 2020/03/07 20:27:54 is Exp $
 
 # GENERIC with wscons(4)
 #
@@ -13,7 +13,7 @@ options 	FONT_VT220ISO8x16
 
 wskbd0		at kbd0 console ?
 
-ukbd*		at uhidev? reportid ?  
+ukbd*		at uhidev? reportid ?
 wskbd*		at ukbd? console ?
 
 wsmouse*	at ms?
@@ -43,8 +43,8 @@ no ite5		at grf5
 no ite6		at grf6
 no ite7		at grf7
 
-mntva*  at zbus?# MNTMN VA2000
-#options MNTVA_CONSOLE
+mntva*		at zbus?		# MNTMN VA2000
+#options	MNTVA_CONSOLE
 
 # PCI framebuffers
 #genfb*		at pci?			# CyberVisionPPC/BlizzardVisionPPC only

Index: src/sys/arch/amiga/conf/files.amiga
diff -u src/sys/arch/amiga/conf/files.amiga:1.182 src/sys/arch/amiga/conf/files.amiga:1.183
--- src/sys/arch/amiga/conf/files.amiga:1.182	Wed May  8 13:40:13 2019
+++ src/sys/arch/amiga/conf/files.amiga	Sat Mar  7 20:27:54 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amiga,v 1.182 2019/05/08 13:40:13 isaki Exp $
+#	$NetBSD: files.amiga,v 1.183 2020/03/07 20:27:54 is Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16			# NOTE THAT AMIGA IS SPECIAL!
@@ -20,7 +20,7 @@ defflag	opt_amigacons.h		RETINACONSOLE U
 defflag	opt_amigacons.h		CV64CONSOLE CV3DCONSOLE TSENGCONSOLE
 defflag	opt_amigacons.h		SERCONSOLE
 
-defflag opt_mntva.h		MNTVA_CONSOLE
+defflag	opt_mntva.h		MNTVA_CONSOLE
 
 defflag	opt_kfont.h		KFONT_CONS_ISO8859_1
 defflag	opt_kfont.h		KFONT_CONS_ISO8859_2
@@ -34,7 +34,7 @@ defflagP5PPC68KBOARD
 defflagLEV6_DEFER
 defflagDEVRELOAD
 
-defflag opt_p5pb.h		P5PB_DEBUG P5PB_CONSOLE
+defflag	opt_p5pb.h		P5PB_DEBUG P5PB_CONSOLE
 
 defparam			IOBZCLOCK
 
@@ -51,7 +51,7 @@ file	arch/amiga/amiga/amiga_bus_simple_4
 define	amibus_ww
 file	arch/amiga/amiga/amiga_bus_simple_2word.c
 
-define amibus_wb
+define	amibus_wb
 file	arch/amiga/amiga/amiga_bus_simple_1word.c
 
 define	amibus_b16
@@ -66,7 +66,7 @@ file	arch/amiga/amiga/amiga_bus_simple_0
 define	amibus_b4000
 file	arch/amiga/amiga/amiga_bus_simple_0x4000.c	amibus_b4000
 
-define  amibus_empb
+define	amibus_empb
 file	arch/amiga/pci/empb_bsm.c	amibus_empb
 
 file	arch/amiga/amiga/bus.c
@@ -122,7 +122,7 @@ device repulse: audiobus, ac97
 attach	repulse at zbus
 file	arch/amiga/dev/repulse.c	repulse
 
-device toccata: audiobus, ad1848
+device	toccata: audiobus, ad1848
 attach	toccata at zbus
 file	arch/amiga/dev/toccata.c	toccata
 
@@ -322,7 +322,7 @@ file	arch/amiga/dev/gvpbus.c		gvpbus
 attach	lpt at supio with lpt_supio
 file	arch/amiga/dev/lpt_supio.c	lpt_supio
 
-include "dev/scsipi/files.scsipi"
+include	"dev/scsipi/files.scsipi"
 
 # wd 33c93 contrllers
 define	sbic
@@ -339,8 +339,8 @@ attach	ahsc at mainbus
 file	arch/amiga/dev/ahsc.c		ahsc needs-flag
 
 # C= A2091
-device atzsc: scsi, sbic
-attach atzsc at zbus
+device	atzsc: scsi, sbic
+attach	atzsc at zbus
 file	arch/amiga/dev/atzsc.c		atzsc needs-flag
 
 # ncr 5380 controllers
@@ -480,9 +480,9 @@ file	arch/amiga/dev/gayle_pcmcia.c		pcca
 device	pccard: pcmciabus, gayle
 attach	pccard at mainbus
 
-include "dev/pcmcia/files.pcmcia"
+include	"dev/pcmcia/files.pcmcia"
 
-include "dev/ata/files.ata"
+include	"dev/ata/files.ata"
 
 # Amiga 4000/1200 IDE using MI wdc
 attach	wdc at mainbus with wdc_amiga: gayle, amibus_b1000
@@ -493,32 +493,32 @@ attach	wdc at zbus with wdc_buddha
 file	arch/amiga/dev/wdc_buddha.c	wdc_buddha
 
 # FastATA 
-device  efa: ata, wdc_common, amibus_b1000
-attach  efa at mainbus
-filearch/amiga/dev/efa.c		efa
+device	efa: ata, wdc_common, amibus_b1000
+attach	efa at mainbus
+file	arch/amiga/dev/efa.c		efa
 
 # Compatibility modules
 
 # NetBSD m68k a.out Binary Compatibility (COMPAT_AOUT_M68K)
-include "compat/aoutm68k/files.aoutm68k"
+include	"compat/aoutm68k/files.aoutm68k"
 
 # SunOS Binary Compatibility (COMPAT_SUNOS)
-include "compat/sunos/files.sunos"
+include	"compat/sunos/files.sunos"
 file	arch/m68k/m68k/sunos_machdep.c	compat_sunos
 
 # Linux binary compatibility (COMPAT_LINUX)
-include "compat/linux/files.linux"
-include "compat/linux/arch/m68k/files.linux_m68k"
-file arch/m68k/m68k/linux_trap.c		compat_linux
+include	"compat/linux/files.linux"
+include	"compat/linux/arch/m68k/files.linux_m68k"
+file	arch/m68k/m68k/linux_trap.c		compat_linux

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

2020-03-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Mar  7 19:47:44 UTC 2020

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

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libc/sys/t_ptrace_wait.h

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.h
diff -u src/tests/lib/libc/sys/t_ptrace_wait.h:1.25 src/tests/lib/libc/sys/t_ptrace_wait.h:1.26
--- src/tests/lib/libc/sys/t_ptrace_wait.h:1.25	Sat Mar  7 14:53:14 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.h	Sat Mar  7 19:47:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.h,v 1.25 2020/03/07 14:53:14 christos Exp $	*/
+/*	$NetBSD: t_ptrace_wait.h,v 1.26 2020/03/07 19:47:44 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -672,7 +672,7 @@ are_fpu_exceptions_supported(void)
 	return true;
 }
 #else
-#define are_fpu_exceptions_supporter() 1
+#define are_fpu_exceptions_supported() 1
 #endif
 
 static void __used



CVS commit: src/usr.bin/config

2020-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar  7 19:26:13 UTC 2020

Modified Files:
src/usr.bin/config: defs.h files.c gram.y main.c scan.l sem.c util.c

Log Message:
Keep track where more objects are declared so that we can print where things
have been redefined.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/usr.bin/config/defs.h
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/config/files.c
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/config/gram.y
cvs rdiff -u -r1.98 -r1.99 src/usr.bin/config/main.c
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/config/scan.l
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/config/sem.c
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/config/util.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/config/defs.h
diff -u src/usr.bin/config/defs.h:1.104 src/usr.bin/config/defs.h:1.105
--- src/usr.bin/config/defs.h:1.104	Mon Aug 27 12:04:45 2018
+++ src/usr.bin/config/defs.h	Sat Mar  7 14:26:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.104 2018/08/27 16:04:45 riastradh Exp $	*/
+/*	$NetBSD: defs.h,v 1.105 2020/03/07 19:26:13 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -110,6 +110,10 @@ extern const char *progname;
 #define CONFIG_VERSION		20180827
 #define CONFIG_MINVERSION	0
 
+struct where {
+	const char *w_srcfile;		/* file name where we are defined */
+	u_short	w_srcline;		/* line number where we are defined */
+};
 /*
  * Name/value lists.  Values can be strings or pointers and/or can carry
  * integers.  The names can be NULL, resulting in simple value lists.
@@ -123,6 +127,7 @@ struct nvlist {
 	int		nv_ifunit;		/* XXX XXX XXX */
 	int		nv_flags;
 #define	NV_DEPENDED	1
+	struct where	nv_where;
 };
 
 /*
@@ -131,10 +136,10 @@ struct nvlist {
 struct config {
 	TAILQ_ENTRY(config) cf_next;
 	const char *cf_name;		/* "netbsd" */
-	int	cf_lineno;		/* source line */
 	const char *cf_fstype;		/* file system type */
 	struct	nvlist *cf_root;	/* "root on ra0a" */
 	struct	nvlist *cf_dump;	/* "dumps on ra0b" */
+	struct where	cf_where;
 };
 
 /*
@@ -147,6 +152,7 @@ struct defoptlist {
 	const char *dl_lintvalue;
 	int dl_obsolete;
 	struct nvlist *dl_depends;
+	struct where	dl_where;
 };
 
 struct files;
@@ -199,6 +205,7 @@ struct attr {
 
 	/* "device class" */
 	const char *a_devclass;		/* device class described */
+	struct where a_where;
 };
 
 /*
@@ -277,8 +284,7 @@ struct devbase {
 	struct	deva *d_ahead;		/* first attachment, if any */
 	struct	deva **d_app;		/* used for tacking on attachments */
 	struct	attr *d_classattr;	/* device class attribute (if any) */
-	const char *d_srcfile;		/* file name where we are defined */
-	u_short	d_srcline;		/* line number where we are defined */
+	struct	where d_where;
 };
 
 struct deva {
@@ -291,8 +297,7 @@ struct deva {
 	struct	attrlist *d_attrs;	/* attributes, if any */
 	struct	devi *d_ihead;		/* first instance, if any */
 	struct	devi **d_ipp;		/* used for tacking on more instances */
-	const char *d_srcfile;		/* file name where we are defined */
-	u_short	d_srcline;		/* line number where we are defined */
+	struct	where d_where;
 };
 
 /*
@@ -319,8 +324,6 @@ struct devi {
 	struct	deva *i_atdeva;
 	const char **i_locs;	/* locators (as given by pspec's iattr) */
 	int	i_cfflags;	/* flags from config line */
-	int	i_lineno;	/* line # in config, for later errors */
-	const char *i_srcfile;	/* file it appears in */
 	int	i_level;	/* position between negated instances */
 	int	i_active;
 #define	DEVI_ORPHAN	0	/* instance has no active parent */
@@ -333,7 +336,7 @@ struct devi {
 	short	i_collapsed;	/* set => this alias no longer needed */
 	u_short	i_cfindex;	/* our index in cfdata */
 	int	i_locoff;	/* offset in locators.vec */
-
+	struct	where i_where;
 };
 /* special units */
 #define	STAR	(-1)		/* unit number for, e.g., "sd*" */
@@ -346,8 +349,7 @@ struct devi {
 struct files {
 	TAILQ_ENTRY(files) fi_next;
 	TAILQ_ENTRY(files) fi_snext;	/* per-suffix list */
-	const char *fi_srcfile;	/* the name of the "files" file that got us */
-	u_short	fi_srcline;	/* and the line number */
+	struct	where fi_where;
 	u_char fi_flags;	/* as below */
 	const char *fi_tail;	/* name, i.e., strrchr(fi_path, '/') + 1 */
 	const char *fi_base;	/* tail minus ".c" (or whatever) */
@@ -418,13 +420,12 @@ struct prefix {
  */
 struct devm {
 	TAILQ_ENTRY(devm) dm_next;
-	const char	*dm_srcfile;	/* the name of the "majors" file */
-	u_short		dm_srcline;	/* the line number */
 	const char	*dm_name;	/* [bc]devsw name */
 	devmajor_t	dm_cmajor;	/* character major */
 	devmajor_t	dm_bmajor;	/* block major */
 	struct condexpr	*dm_opts;	/* options */
 	struct nvlist	*dm_devnodes;	/* information on /dev nodes */
+	struct where dm_where;
 };
 
 /*
@@ -581,7 +582,7 @@ void	deloption(const char *, int);
 void	delfsoption(const char *, int);
 void	delmkoption(const char *, int);
 int	devbase_has_instances(struct devbase *, int);
-int	

CVS commit: src/sys/arch/mips/mips

2020-03-07 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Mar  7 18:49:49 UTC 2020

Modified Files:
src/sys/arch/mips/mips: trap.c

Log Message:
Add missing newline to a diagnostic printf.


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.250 src/sys/arch/mips/mips/trap.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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.249 src/sys/arch/mips/mips/trap.c:1.250
--- src/sys/arch/mips/mips/trap.c:1.249	Sat Apr  6 11:54:20 2019
+++ src/sys/arch/mips/mips/trap.c	Sat Mar  7 18:49:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.249 2019/04/06 11:54:20 kamil Exp $	*/
+/*	$NetBSD: trap.c,v 1.250 2020/03/07 18:49:49 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.249 2019/04/06 11:54:20 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.250 2020/03/07 18:49:49 thorpej Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -298,7 +298,7 @@ trap(uint32_t status, uint32_t cause, va
 		kpreempt_enable();
 		if (ok != 1)
 			printf("pmap_tlb_update_addr(%p,%#"
-			PRIxVADDR",%#"PRIxPTE", 0) returned %d",
+			PRIxVADDR",%#"PRIxPTE", 0) returned %d\n",
 			pmap, vaddr, pte_value(pte), ok);
 		paddr_t pa = pte_to_paddr(pte);
 		KASSERTMSG(uvm_pageismanaged(pa),



CVS commit: src/sys/conf

2020-03-07 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Mar  7 18:08:48 UTC 2020

Modified Files:
src/sys/conf: files

Log Message:
Fix MIPS builds by working around an apparent bug in config(8)'s elif
handling.


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

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1259 src/sys/conf/files:1.1260
--- src/sys/conf/files:1.1259	Thu Mar  5 21:08:36 2020
+++ src/sys/conf/files	Sat Mar  7 18:08:47 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1259 2020/03/05 21:08:36 pgoyette Exp $
+#	$NetBSD: files,v 1.1260 2020/03/07 18:08:47 thorpej Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -169,11 +169,13 @@ defflagCOMPAT_ULTRIX: COMPAT_50
 # other users of COMPAT_NETBSD32 need EXEC_AOUT
 ifdef mips
 defflagCOMPAT_NETBSD32
-elifdef aarch64
+else
+ifdef aarch64
 defflagCOMPAT_NETBSD32
 else
 defflagCOMPAT_NETBSD32	: EXEC_AOUT
 endif
+endif
 
 defflagCOMPAT_SYSV
 defflagSYSV_IPC	: SYSVSHM, SYSVSEM, SYSVMSG



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

2020-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar  7 14:53:14 UTC 2020

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

Log Message:
Try to fix the build. This is why all those inlines should really be in a
separate file as regular function. The code is too large and hard to manage
this way, and only increases in complexity as time goes by.


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/tests/lib/libc/sys/t_ptrace_wait.c
cvs rdiff -u -r1.24 -r1.25 src/tests/lib/libc/sys/t_ptrace_wait.h

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.168 src/tests/lib/libc/sys/t_ptrace_wait.c:1.169
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.168	Fri Mar  6 09:06:56 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sat Mar  7 09:53:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.168 2020/03/06 14:06:56 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.169 2020/03/07 14:53:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.168 2020/03/06 14:06:56 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.169 2020/03/07 14:53:14 christos Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -60,11 +60,6 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.16
 #include 
 #include 
 
-#include 
-#if (__arm__ && !__SOFTFP__) || __aarch64__
-#include  /* only need for ARM Cortex/Neon hack */
-#endif
-
 #if defined(__i386__) || defined(__x86_64__)
 #include 
 #include 

Index: src/tests/lib/libc/sys/t_ptrace_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_wait.h:1.24 src/tests/lib/libc/sys/t_ptrace_wait.h:1.25
--- src/tests/lib/libc/sys/t_ptrace_wait.h:1.24	Fri Mar  6 12:03:35 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.h	Sat Mar  7 09:53:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.h,v 1.24 2020/03/06 17:03:35 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.h,v 1.25 2020/03/07 14:53:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -654,10 +654,14 @@ trigger_ill(void)
 #endif
 }
 
+#include 
+
+#if (__arm__ && !__SOFTFP__) || __aarch64__
+#include  /* only need for ARM Cortex/Neon hack */
+
 static bool __used
 are_fpu_exceptions_supported(void)
 {
-#if (__arm__ && !__SOFTFP__) || __aarch64__
 	/*
 	 * Some NEON fpus do not trap on IEEE 754 FP exceptions.
 	 * Skip these tests if running on them and compiled for
@@ -665,9 +669,11 @@ are_fpu_exceptions_supported(void)
 	 */
 	if (0 == fpsetmask(fpsetmask(FP_X_INV)))
 		return false;
-#endif
 	return true;
 }
+#else
+#define are_fpu_exceptions_supporter() 1
+#endif
 
 static void __used
 trigger_fpe(void)



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

2020-03-07 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Mar  7 13:28:45 UTC 2020

Modified Files:
src/sys/arch/x86/x86: via_padlock.c

Log Message:
Fold constant. err is always 0, so switch to return 0;


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/x86/x86/via_padlock.c

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

Modified files:

Index: src/sys/arch/x86/x86/via_padlock.c
diff -u src/sys/arch/x86/x86/via_padlock.c:1.27 src/sys/arch/x86/x86/via_padlock.c:1.28
--- src/sys/arch/x86/x86/via_padlock.c:1.27	Sat Mar  7 12:31:50 2020
+++ src/sys/arch/x86/x86/via_padlock.c	Sat Mar  7 13:28:45 2020
@@ -1,5 +1,5 @@
 /*	$OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $	*/
-/*	$NetBSD: via_padlock.c,v 1.27 2020/03/07 12:31:50 fcambus Exp $ */
+/*	$NetBSD: via_padlock.c,v 1.28 2020/03/07 13:28:45 maya Exp $ */
 
 /*-
  * Copyright (c) 2003 Jason Wright
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.27 2020/03/07 12:31:50 fcambus Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.28 2020/03/07 13:28:45 maya Exp $");
 
 #include 
 #include 
@@ -370,7 +370,6 @@ via_padlock_crypto_encdec(struct cryptop
 struct via_padlock_session *ses, struct via_padlock_softc *sc, void *buf)
 {
 	uint32_t *key;
-	int err = 0;
 
 	if ((crd->crd_len % 16) != 0)
 		return (EINVAL);
@@ -461,7 +460,7 @@ via_padlock_crypto_encdec(struct cryptop
 		sc->op_buf = NULL;
 	}
 
-	return (err);
+	return 0;
 }
 
 int



CVS commit: src/distrib/sets

2020-03-07 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Sat Mar  7 13:01:07 UTC 2020

Modified Files:
src/distrib/sets: attrs

Log Message:
Delete unavailable package from attrs


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/attrs

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/attrs
diff -u src/distrib/sets/attrs:1.2 src/distrib/sets/attrs:1.3
--- src/distrib/sets/attrs:1.2	Sat Feb 15 03:27:58 2020
+++ src/distrib/sets/attrs	Sat Mar  7 13:01:07 2020
@@ -17,4 +17,3 @@ etc-sys-root	preserve
 etc-sysutil-etc	preserve
 etc-sysutil-log	preserve
 etc-sysutil-rc	preserve
-modules-base-kernel	preserve



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

2020-03-07 Thread Frederic Cambus
Module Name:src
Committed By:   fcambus
Date:   Sat Mar  7 12:31:50 UTC 2020

Modified Files:
src/sys/arch/x86/x86: via_padlock.c

Log Message:
Return error values directly where appropriate, instead of using the err
variable.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/x86/via_padlock.c

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

Modified files:

Index: src/sys/arch/x86/x86/via_padlock.c
diff -u src/sys/arch/x86/x86/via_padlock.c:1.26 src/sys/arch/x86/x86/via_padlock.c:1.27
--- src/sys/arch/x86/x86/via_padlock.c:1.26	Sat Jul 14 14:46:41 2018
+++ src/sys/arch/x86/x86/via_padlock.c	Sat Mar  7 12:31:50 2020
@@ -1,5 +1,5 @@
 /*	$OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $	*/
-/*	$NetBSD: via_padlock.c,v 1.26 2018/07/14 14:46:41 maxv Exp $ */
+/*	$NetBSD: via_padlock.c,v 1.27 2020/03/07 12:31:50 fcambus Exp $ */
 
 /*-
  * Copyright (c) 2003 Jason Wright
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.26 2018/07/14 14:46:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.27 2020/03/07 12:31:50 fcambus Exp $");
 
 #include 
 #include 
@@ -372,16 +372,12 @@ via_padlock_crypto_encdec(struct cryptop
 	uint32_t *key;
 	int err = 0;
 
-	if ((crd->crd_len % 16) != 0) {
-		err = EINVAL;
-		return (err);
-	}
+	if ((crd->crd_len % 16) != 0)
+		return (EINVAL);
 
 	sc->op_buf = malloc(crd->crd_len, M_DEVBUF, M_NOWAIT);
-	if (sc->op_buf == NULL) {
-		err = ENOMEM;
-		return (err);
-	}
+	if (sc->op_buf == NULL)
+		return (ENOMEM);
 
 	if (crd->crd_flags & CRD_F_ENCRYPT) {
 		sc->op_cw[0] = ses->ses_cw0 | C3_CRYPT_CWLO_ENCRYPT;