CVS commit: src/share/mk

2021-03-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  7 07:37:35 UTC 2021

Modified Files:
src/share/mk: bsd.kmodule.mk

Log Message:
Build modules for PPC_OEA64 on evbppc64.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/share/mk/bsd.kmodule.mk

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

Modified files:

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.73 src/share/mk/bsd.kmodule.mk:1.74
--- src/share/mk/bsd.kmodule.mk:1.73	Sun Mar  7 07:30:15 2021
+++ src/share/mk/bsd.kmodule.mk	Sun Mar  7 07:37:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.73 2021/03/07 07:30:15 rin Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.74 2021/03/07 07:37:35 rin Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -85,6 +85,8 @@ CPPFLAGS+=	-DPPC_PCI_MACHDEP_IMPL=${DPPC
 CPPFLAGS+=	-DPPC_IBM4XX
 . elifdef PPC_BOOKE
 CPPFLAGS+=	-DPPC_BOOKE
+. elif ${MACHINE_ARCH} == "powerpc64"
+CPPFLAGS+=	-DPPC_OEA64
 . else
 CPPFLAGS+=	-DPPC_OEA
 . endif



CVS commit: src/share/mk

2021-03-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  7 07:30:15 UTC 2021

Modified Files:
src/share/mk: bsd.kmodule.mk

Log Message:
whitespace --> tab. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/share/mk/bsd.kmodule.mk

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

Modified files:

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.72 src/share/mk/bsd.kmodule.mk:1.73
--- src/share/mk/bsd.kmodule.mk:1.72	Sun Oct 18 19:57:44 2020
+++ src/share/mk/bsd.kmodule.mk	Sun Mar  7 07:30:15 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.72 2020/10/18 19:57:44 christos Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.73 2021/03/07 07:30:15 rin Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -78,15 +78,15 @@ PPC_INTR_IMPL=\"powerpc/intr.h\"
 . ifndef PPC_PCI_MACHDEP_IMPL
 PPC_PCI_MACHDEP_IMPL=\"powerpc/pci_machdep.h\"
 . endif
-CPPFLAGS+=  -DPPC_INTR_IMPL=${PPC_INTR_IMPL}
-CPPFLAGS+=  -DPPC_PCI_MACHDEP_IMPL=${DPPC_PCI_MACHDEP_IMPL}
+CPPFLAGS+=	-DPPC_INTR_IMPL=${PPC_INTR_IMPL}
+CPPFLAGS+=	-DPPC_PCI_MACHDEP_IMPL=${DPPC_PCI_MACHDEP_IMPL}
 
 . ifdef PPC_IBM4XX
-CPPFLAGS+=  -DPPC_IBM4XX
+CPPFLAGS+=	-DPPC_IBM4XX
 . elifdef PPC_BOOKE
-CPPFLAGS+=  -DPPC_BOOKE
+CPPFLAGS+=	-DPPC_BOOKE
 . else
-CPPFLAGS+=  -DPPC_OEA
+CPPFLAGS+=	-DPPC_OEA
 . endif
 
 .endif



CVS commit: src/distrib/amd64/cdroms

2021-03-06 Thread Darrin B. Jewell
Module Name:src
Committed By:   dbj
Date:   Sun Mar  7 03:55:47 UTC 2021

Modified Files:
src/distrib/amd64/cdroms: Makefile.cdrom
src/distrib/amd64/cdroms/bootcd-com: Makefile

Log Message:
distrib/amd64/cdroms: honor CDBOOTOPTIONS when installing EFI bootloader


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/distrib/amd64/cdroms/Makefile.cdrom
cvs rdiff -u -r1.8 -r1.9 src/distrib/amd64/cdroms/bootcd-com/Makefile

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

Modified files:

Index: src/distrib/amd64/cdroms/Makefile.cdrom
diff -u src/distrib/amd64/cdroms/Makefile.cdrom:1.25 src/distrib/amd64/cdroms/Makefile.cdrom:1.26
--- src/distrib/amd64/cdroms/Makefile.cdrom:1.25	Wed Feb 17 08:49:54 2021
+++ src/distrib/amd64/cdroms/Makefile.cdrom	Sun Mar  7 03:55:47 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.25 2021/02/17 08:49:54 dbj Exp $
+# $NetBSD: Makefile.cdrom,v 1.26 2021/03/07 03:55:47 dbj Exp $
 
 .include 
 .include 
@@ -27,6 +27,12 @@ ${EFIBOOTIMG}: ${DESTDIR}/usr/mdec/bootx
 	${RM} -rf efiboot/EFI/boot
 	${MKDIR} ${MKDIRPERM} efiboot/EFI/boot
 	${INSTALL} ${COPY} -m 0444 ${.ALLSRC} efiboot/EFI/boot/
+.if defined(CDBOOTOPTIONS)
+	${CHMOD} +w efiboot/EFI/boot/bootx64.efi efiboot/EFI/boot/bootia32.efi
+	${TOOL_INSTALLBOOT} -m${MACHINE} -e ${CDBOOTOPTIONS} efiboot/EFI/boot/bootx64.efi
+	${TOOL_INSTALLBOOT} -m${MACHINE} -e ${CDBOOTOPTIONS} efiboot/EFI/boot/bootia32.efi
+	${CHMOD} -w efiboot/EFI/boot/bootx64.efi efiboot/EFI/boot/bootia32.efi
+.endif
 	${TOOL_MAKEFS} -M 1m -m 1m -B ${TARGET_ENDIANNESS} ${MAKEFS_TIMESTAMP} \
 		-t msdos -o F=12,c=1 ${EFIBOOTIMG} efiboot
 

Index: src/distrib/amd64/cdroms/bootcd-com/Makefile
diff -u src/distrib/amd64/cdroms/bootcd-com/Makefile:1.8 src/distrib/amd64/cdroms/bootcd-com/Makefile:1.9
--- src/distrib/amd64/cdroms/bootcd-com/Makefile:1.8	Wed Feb 17 08:49:55 2021
+++ src/distrib/amd64/cdroms/bootcd-com/Makefile	Sun Mar  7 03:55:47 2021
@@ -1,11 +1,12 @@
-#	$NetBSD: Makefile,v 1.8 2021/02/17 08:49:55 dbj Exp $
+#	$NetBSD: Makefile,v 1.9 2021/03/07 03:55:47 dbj Exp $
 #
 
+# HP Proliant iLO serial console is on com1
+CDBOOTOPTIONS=	-o console=com0
+
 .include "${.CURDIR}/../Makefile.cdrom"
 
 CDBASE=		boot-com			# gives ${CDBASE}.iso
-# HP Proliant iLO serial console is on com1
-CDBOOTOPTIONS=	-o console=com0
 
 CDBUILDEXTRA+=	boot.cfg		# Add boot.cfg file
 CLEANFILES+=	boot.cfg



CVS commit: src/sys/arch/powerpc/ibm4xx/openbios

2021-03-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Mar  7 02:54:07 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx/openbios: locore.S

Log Message:
Remove unused/unreferenced legacy intrcnt/intrnames.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/ibm4xx/openbios/locore.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/powerpc/ibm4xx/openbios/locore.S
diff -u src/sys/arch/powerpc/ibm4xx/openbios/locore.S:1.15 src/sys/arch/powerpc/ibm4xx/openbios/locore.S:1.16
--- src/sys/arch/powerpc/ibm4xx/openbios/locore.S:1.15	Mon Jul  6 10:48:54 2020
+++ src/sys/arch/powerpc/ibm4xx/openbios/locore.S	Sun Mar  7 02:54:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.15 2020/07/06 10:48:54 rin Exp $	*/
+/*	$NetBSD: locore.S,v 1.16 2021/03/07 02:54:06 simonb Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -100,27 +100,6 @@
 #define	bdneq	bdnzf 2,
 
 /*
- * Globals
- */
-GLOBAL(intrnames)
-	.asciz	"clock", "irq1", "irq2", "irq3"
-	.asciz	"irq4", "irq5", "irq6", "irq7"
-	.asciz	"irq8", "irq9", "irq10", "irq11"
-	.asciz	"irq12", "irq13", "irq14", "irq15"
-	.asciz	"irq16", "irq17", "irq18", "irq19"
-	.asciz	"irq20", "irq21", "irq22", "irq23"
-	.asciz	"irq24", "irq25", "irq26", "irq27"
-	.asciz	"irq28", "softnet", "softclock", "softserial"
-	.asciz  "statclock"
-GLOBAL(eintrnames)
-	.align	4
-GLOBAL(intrcnt)
-	.long	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-	.long	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-	.long	0
-GLOBAL(eintrcnt)
-
-/*
  * This symbol is here for the benefit of kvm_mkdb, and is supposed to
  * mark the start of kernel text.
  */



CVS commit: src/external/bsd/blocklist

2021-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  7 00:46:39 UTC 2021

Modified Files:
src/external/bsd/blocklist: TODO
src/external/bsd/blocklist/etc/rc.d: blocklistd
src/external/bsd/blocklist/libexec: blocklistd-helper

Log Message:
TODO and ipfilter improvements from Greg A. Woods


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/blocklist/TODO
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/blocklist/etc/rc.d/blocklistd
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/blocklist/libexec/blocklistd-helper

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

Modified files:

Index: src/external/bsd/blocklist/TODO
diff -u src/external/bsd/blocklist/TODO:1.1.1.1 src/external/bsd/blocklist/TODO:1.2
--- src/external/bsd/blocklist/TODO:1.1.1.1	Sun Jun 14 21:52:52 2020
+++ src/external/bsd/blocklist/TODO	Sat Mar  6 19:46:39 2021
@@ -1,4 +1,4 @@
-# $NetBSD: TODO,v 1.1.1.1 2020/06/15 01:52:52 christos Exp $
+# $NetBSD: TODO,v 1.2 2021/03/07 00:46:39 christos Exp $
 
 - don't poll periodically, find the next timeout
 - use the socket also for commands? Or separate socket?
@@ -19,3 +19,89 @@
 	unblock
 - do we need an api in blocklistctl to perform maintenance
 - fix the blocklistctl output to be more user friendly
+
+- figure out some way to do distributed operation securely (perhaps with
+  a helper daemon that authenticates local sockets and then communicates
+  local DB changes to the central server over a secure channel --
+  perhaps blocklistd-helper can have a back-end that can send updates to
+  a central server)
+
+- add "blocklistd -l" to enable filter logging on all rules by default
+
+- add some new options in the config file
+
+	"/all"	- block both TCP and UDP (on the proto field?)
+
+	"/log"	- enable filter logging (if not the default) (on the name field?)
+	"/nolog"- disable filter logging (if not the default) (on the name field?)
+
+  The latter two probably require a new parameter for blocklistd-helper.
+
+- "blocklistd -f" should (also?) be a blocklistctl function!?!?!
+
+- if blocklistd was started with '-r' then a SIGHUP should also do a
+  "control flush $rulename" and then re-add all the filter rules?
+
+- should/could /etc/rc.conf.d/ipfilter be created with the following?
+
+	reload_postcmd=blocklistd_reload
+	start_postcmd=blocklistd_start
+	stop_precmd=blocklistd_stop
+	blocklistd_reload ()
+	{
+		/etc/rc.d/blocklistd reload	# IFF SIGHUP does flush/re-add
+		# /etc/rc.d/blocklistd restart
+	}
+	blocklistd_stop ()
+	{
+		/etc/rc.d/blocklistd stop
+	}
+	blocklistd_start ()
+	{
+		/etc/rc.d/blocklistd start
+	}
+
+  or is there a better way?
+
+- figure out some way to do distributed operation securely (perhaps with
+  a helper daemon that authenticates local sockets and then communicates
+  local DB changes to the central server over a secure channel --
+  perhaps blocklistd-helper can have a back-end that can send updates to
+  a central server)
+
+- add "blocklistd -l" to enable filter logging on all rules by default
+
+- add some new options in the config file
+
+	"/all"	- block both TCP and UDP (on the proto field?)
+
+	"/log"	- enable filter logging (if not the default) (on the name field?)
+	"/nolog"- disable filter logging (if not the default) (on the name field?)
+
+  The latter two probably require a new parameter for blocklistd-helper.
+
+- "blocklistd -f" should (also?) be a blocklistctl function!?!?!
+
+- if blocklistd was started with '-r' then a SIGHUP should also do a
+  "control flush $rulename" and then re-add all the filter rules?
+
+- should/could /etc/rc.conf.d/ipfilter be created with the following?
+
+	reload_postcmd=blocklistd_reload
+	start_postcmd=blocklistd_start
+	stop_precmd=blocklistd_stop
+	blocklistd_reload ()
+	{
+		/etc/rc.d/blocklistd reload	# IFF SIGHUP does flush/re-add
+		# /etc/rc.d/blocklistd restart
+	}
+	blocklistd_stop ()
+	{
+		/etc/rc.d/blocklistd stop
+	}
+	blocklistd_start ()
+	{
+		/etc/rc.d/blocklistd start
+	}
+
+  or is there a better way?

Index: src/external/bsd/blocklist/etc/rc.d/blocklistd
diff -u src/external/bsd/blocklist/etc/rc.d/blocklistd:1.1.1.1 src/external/bsd/blocklist/etc/rc.d/blocklistd:1.2
--- src/external/bsd/blocklist/etc/rc.d/blocklistd:1.1.1.1	Sun Jun 14 21:52:53 2020
+++ src/external/bsd/blocklist/etc/rc.d/blocklistd	Sat Mar  6 19:46:39 2021
@@ -1,10 +1,10 @@
 #!/bin/sh
 #
-# $NetBSD: blocklistd,v 1.1.1.1 2020/06/15 01:52:53 christos Exp $
+# $NetBSD: blocklistd,v 1.2 2021/03/07 00:46:39 christos Exp $
 #
 
 # PROVIDE: blocklistd
-# REQUIRE: npf
+# REQUIRE: npf pf ipfilter
 # BEFORE:  SERVERS
 
 $_rc_subr_loaded . /etc/rc.subr

Index: src/external/bsd/blocklist/libexec/blocklistd-helper
diff -u src/external/bsd/blocklist/libexec/blocklistd-helper:1.1.1.1 src/external/bsd/blocklist/libexec/blocklistd-helper:1.2
--- src/external/bsd/blocklist/libexec/blocklistd-helper:1.1.1.1	Sun Jun 14 

CVS commit: src/usr.sbin/rpcbind

2021-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  7 00:23:06 UTC 2021

Modified Files:
src/usr.sbin/rpcbind: Makefile pmap_svc.c rpcb_svc_com.c rpcbind.c
security.c

Log Message:
- Enable WARMSTART
- Pass fd to libwrap
- Add blocklist
>From Greg A. Woods

- Tidy up debugging


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/rpcbind/Makefile
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/rpcbind/pmap_svc.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/rpcbind/rpcb_svc_com.c
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/rpcbind/rpcbind.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/rpcbind/security.c

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

Modified files:

Index: src/usr.sbin/rpcbind/Makefile
diff -u src/usr.sbin/rpcbind/Makefile:1.16 src/usr.sbin/rpcbind/Makefile:1.17
--- src/usr.sbin/rpcbind/Makefile:1.16	Sun Oct 13 03:28:20 2019
+++ src/usr.sbin/rpcbind/Makefile	Sat Mar  6 19:23:06 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.16 2019/10/13 07:28:20 mrg Exp $
+#	$NetBSD: Makefile,v 1.17 2021/03/07 00:23:06 christos Exp $
 
 .include 
 
@@ -12,7 +12,7 @@ SRCS=	check_bound.c rpcb_stat.c rpcb_svc
 LIBCDIR=${NETBSDSRCDIR}/lib/libc
 LIBCRPCDIR= ${LIBCDIR}/rpc
 
-CPPFLAGS+=	-I${LIBCRPCDIR} -DPORTMAP -DLIBWRAP
+CPPFLAGS+=	-I${LIBCRPCDIR} -DPORTMAP -DLIBWRAP -DWARMSTART
 
 .if (${USE_INET6} != "no")
 CPPFLAGS+=	-DINET6
@@ -24,10 +24,11 @@ CPPFLAGS+=	-DYP
 
 # Uncomment these to get any useful output from 'rpcbind -d'
 # CPPFLAGS+=	-DRPCBIND_DEBUG
+# CPPFLAGS+=	-DDEBUG_RMTCALL
 # CPPFLAGS+=	-DSVC_RUN_DEBUG
 
-LDADD+= -lwrap -lutil
-DPADD+= ${LIBWRAP} ${LIBUTIL}
+LDADD+= -lwrap -lblocklist -lutil
+DPADD+= ${LIBWRAP} ${LIBBLOCKLIST} ${LIBUTIL}
 
 COPTS.rpcb_svc_4.c+=	${GCC_NO_CAST_FUNCTION_TYPE}
 COPTS.pmap_svc.c+=	${GCC_NO_CAST_FUNCTION_TYPE}

Index: src/usr.sbin/rpcbind/pmap_svc.c
diff -u src/usr.sbin/rpcbind/pmap_svc.c:1.9 src/usr.sbin/rpcbind/pmap_svc.c:1.10
--- src/usr.sbin/rpcbind/pmap_svc.c:1.9	Wed Aug 16 04:44:40 2017
+++ src/usr.sbin/rpcbind/pmap_svc.c	Sat Mar  6 19:23:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_svc.c,v 1.9 2017/08/16 08:44:40 christos Exp $	*/
+/*	$NetBSD: pmap_svc.c,v 1.10 2021/03/07 00:23:06 christos Exp $	*/
 /*	$FreeBSD: head/usr.sbin/rpcbind/pmap_svc.c 258564 2013-11-25 16:44:02Z hrs $ */
 
 /*-
@@ -173,6 +173,11 @@ pmapproc_change(struct svc_req *rqstp __
 	struct sockcred *sc;
 	char uidbuf[32];
 
+	if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *))) {
+		svcerr_decode(xprt);
+		return (FALSE);
+	}
+
 #ifdef RPCBIND_DEBUG
 	if (debugging)
 		fprintf(stderr, "%s request for (%lu, %lu) : ",
@@ -180,11 +185,6 @@ pmapproc_change(struct svc_req *rqstp __
 		reg.pm_prog, reg.pm_vers);
 #endif
 
-	if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *))) {
-		svcerr_decode(xprt);
-		return (FALSE);
-	}
-
 	if (!check_access(xprt, op, , PMAPVERS)) {
 		svcerr_weakauth(xprt);
 		return FALSE;

Index: src/usr.sbin/rpcbind/rpcb_svc_com.c
diff -u src/usr.sbin/rpcbind/rpcb_svc_com.c:1.23 src/usr.sbin/rpcbind/rpcb_svc_com.c:1.24
--- src/usr.sbin/rpcbind/rpcb_svc_com.c:1.23	Tue Jun 16 20:16:22 2020
+++ src/usr.sbin/rpcbind/rpcb_svc_com.c	Sat Mar  6 19:23:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpcb_svc_com.c,v 1.23 2020/06/17 00:16:22 kamil Exp $	*/
+/*	$NetBSD: rpcb_svc_com.c,v 1.24 2021/03/07 00:23:06 christos Exp $	*/
 /*	$FreeBSD: head/usr.sbin/rpcbind/rpcb_svc_com.c 301770 2016-06-09 22:25:00Z pfg $ */
 
 /*-
@@ -140,9 +140,9 @@ rpcbproc_set_com(void *arg, struct svc_r
 
 #ifdef RPCBIND_DEBUG
 	if (debugging)
-		fprintf(stderr, "RPCB_SET request for (%lu, %lu, %s, %s) : ",
-		(unsigned long)regp->r_prog, (unsigned long)regp->r_vers,
-		regp->r_netid, regp->r_addr);
+		fprintf(stderr, "%s: RPCB_SET request for (%lu, %lu, %s, %s): ",
+		__func__, (unsigned long)regp->r_prog,
+		(unsigned long)regp->r_vers, regp->r_netid, regp->r_addr);
 #endif
 	ans = map_set(regp, getowner(transp, owner, sizeof owner));
 #ifdef RPCBIND_DEBUG
@@ -228,9 +228,9 @@ rpcbproc_unset_com(void *arg, struct svc
 
 #ifdef RPCBIND_DEBUG
 	if (debugging)
-		fprintf(stderr, "RPCB_UNSET request for (%lu, %lu, %s) : ",
-		(unsigned long)regp->r_prog, (unsigned long)regp->r_vers,
-		regp->r_netid);
+		fprintf(stderr, "%s: RPCB_UNSET request for (%lu, %lu, %s): ",
+		__func__, (unsigned long)regp->r_prog,
+		(unsigned long)regp->r_vers, regp->r_netid);
 #endif
 	ans = map_unset(regp, getowner(transp, owner, sizeof owner));
 #ifdef RPCBIND_DEBUG
@@ -350,7 +350,7 @@ rpcbproc_getaddr_com(RPCB *regp, struct 
 	}
 #ifdef RPCBIND_DEBUG
 	if (debugging)
-		fprintf(stderr, "getaddr: %s\n", uaddr);
+		fprintf(stderr, "%s: %s\n", __func__, uaddr);
 #endif
 	/* XXX: should have used some defined constant here */
 	rpcbs_getaddr(rpcbversnum - 2, regp->r_prog, regp->r_vers,
@@ -508,9 +508,8 @@ create_rmtcall_fd(struct netconfig *ncon
 
 	if ((fd = __rpc_nconf2fd(nconf)) == -1) {
 		

CVS commit: src/tests/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 23:09:17 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt-nbacc.0 opt-nbacc.0.stdout opt-nbad.0
opt-nbad.0.stdout opt-nbadp.0 opt-nbadp.0.stdout opt-nbap.0
opt-nbap.0.stdout opt-nbbb.0 opt-nbbb.0.stdout opt-nbc.0
opt-nbc.0.stdout opt-nbs.0 opt-nbs.0.stdout opt-ncdb.0
opt-ncdb.0.stdout opt-ncs.0 opt-ncs.0.stdout opt-ndj.0
opt-ndj.0.stdout opt-neei.0 opt-neei.0.stdout

Log Message:
tests/indent: add tests for negative options

Since most of these options are of the form "don't do anything", the
input and output of these tests is very similar.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/opt-nbacc.0 \
src/tests/usr.bin/indent/opt-nbacc.0.stdout \
src/tests/usr.bin/indent/opt-nbad.0 \
src/tests/usr.bin/indent/opt-nbad.0.stdout \
src/tests/usr.bin/indent/opt-nbadp.0 \
src/tests/usr.bin/indent/opt-nbadp.0.stdout \
src/tests/usr.bin/indent/opt-nbap.0 \
src/tests/usr.bin/indent/opt-nbap.0.stdout \
src/tests/usr.bin/indent/opt-nbbb.0 \
src/tests/usr.bin/indent/opt-nbbb.0.stdout \
src/tests/usr.bin/indent/opt-nbc.0 \
src/tests/usr.bin/indent/opt-nbc.0.stdout \
src/tests/usr.bin/indent/opt-nbs.0 \
src/tests/usr.bin/indent/opt-nbs.0.stdout \
src/tests/usr.bin/indent/opt-ncdb.0 \
src/tests/usr.bin/indent/opt-ncdb.0.stdout \
src/tests/usr.bin/indent/opt-ncs.0 \
src/tests/usr.bin/indent/opt-ncs.0.stdout \
src/tests/usr.bin/indent/opt-ndj.0 \
src/tests/usr.bin/indent/opt-ndj.0.stdout \
src/tests/usr.bin/indent/opt-neei.0 \
src/tests/usr.bin/indent/opt-neei.0.stdout

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.bin/indent/opt-nbacc.0
diff -u src/tests/usr.bin/indent/opt-nbacc.0:1.1 src/tests/usr.bin/indent/opt-nbacc.0:1.2
--- src/tests/usr.bin/indent/opt-nbacc.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-nbacc.0	Sat Mar  6 23:09:17 2021
@@ -1,4 +1,19 @@
-/* $NetBSD: opt-nbacc.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-nbacc.0,v 1.2 2021/03/06 23:09:17 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int		a;
+#if 0
+int		b;
+#endif
+int		c;
+
+
+int		space_a;
+
+#if 0
+
+int		space_b;
+
+#endif
+
+int		space_c;
Index: src/tests/usr.bin/indent/opt-nbacc.0.stdout
diff -u src/tests/usr.bin/indent/opt-nbacc.0.stdout:1.1 src/tests/usr.bin/indent/opt-nbacc.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-nbacc.0.stdout:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-nbacc.0.stdout	Sat Mar  6 23:09:17 2021
@@ -1,4 +1,19 @@
-/* $NetBSD: opt-nbacc.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-nbacc.0.stdout,v 1.2 2021/03/06 23:09:17 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int		a;
+#if 0
+int		b;
+#endif
+int		c;
+
+
+int		space_a;
+
+#if 0
+
+int		space_b;
+
+#endif
+
+int		space_c;
Index: src/tests/usr.bin/indent/opt-nbad.0
diff -u src/tests/usr.bin/indent/opt-nbad.0:1.1 src/tests/usr.bin/indent/opt-nbad.0:1.2
--- src/tests/usr.bin/indent/opt-nbad.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-nbad.0	Sat Mar  6 23:09:17 2021
@@ -1,4 +1,13 @@
-/* $NetBSD: opt-nbad.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-nbad.0,v 1.2 2021/03/06 23:09:17 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int global_variable;
+void function_declaration(void);
+#if 0
+#endif
+void function_definition(void) {
+	int local_variable;
+	function_call();
+	int local_variable_after_statement;
+	function_call();
+}
Index: src/tests/usr.bin/indent/opt-nbad.0.stdout
diff -u src/tests/usr.bin/indent/opt-nbad.0.stdout:1.1 src/tests/usr.bin/indent/opt-nbad.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-nbad.0.stdout:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-nbad.0.stdout	Sat Mar  6 23:09:17 2021
@@ -1,4 +1,15 @@
-/* $NetBSD: opt-nbad.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-nbad.0.stdout,v 1.2 2021/03/06 23:09:17 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int		global_variable;
+void		function_declaration(void);
+#if 0
+#endif
+void
+function_definition(void)
+{
+	int		local_variable;
+	function_call();
+	int		local_variable_after_statement;
+	function_call();
+}
Index: src/tests/usr.bin/indent/opt-nbadp.0
diff -u src/tests/usr.bin/indent/opt-nbadp.0:1.1 src/tests/usr.bin/indent/opt-nbadp.0:1.2
--- src/tests/usr.bin/indent/opt-nbadp.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-nbadp.0	Sat Mar  6 23:09:17 2021
@@ -1,4 +1,33 @@
-/* $NetBSD: opt-nbadp.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-nbadp.0,v 1.2 2021/03/06 23:09:17 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+static void

CVS commit: src/tests/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 22:10:40 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt-fcb.0 opt-fcb.0.stdout opt-i.0
opt-i.0.stdout opt-ip.0 opt-ip.0.stdout opt-l.0 opt-l.0.stdout
opt-lc.0 opt-lc.0.stdout opt-ldi.0 opt-ldi.0.stdout opt-lp.0
opt-lp.0.stdout opt-nfcb.0 opt-nfcb.0.stdout opt-nip.0
opt-nip.0.stdout opt-nlp.0 opt-nlp.0.stdout

Log Message:
tests/indent: add more tests, discover more bugs


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/opt-fcb.0 \
src/tests/usr.bin/indent/opt-fcb.0.stdout \
src/tests/usr.bin/indent/opt-i.0 src/tests/usr.bin/indent/opt-i.0.stdout \
src/tests/usr.bin/indent/opt-ip.0 \
src/tests/usr.bin/indent/opt-ip.0.stdout src/tests/usr.bin/indent/opt-l.0 \
src/tests/usr.bin/indent/opt-l.0.stdout src/tests/usr.bin/indent/opt-lc.0 \
src/tests/usr.bin/indent/opt-lc.0.stdout \
src/tests/usr.bin/indent/opt-ldi.0 \
src/tests/usr.bin/indent/opt-ldi.0.stdout \
src/tests/usr.bin/indent/opt-lp.0 \
src/tests/usr.bin/indent/opt-lp.0.stdout \
src/tests/usr.bin/indent/opt-nfcb.0 \
src/tests/usr.bin/indent/opt-nfcb.0.stdout \
src/tests/usr.bin/indent/opt-nip.0 \
src/tests/usr.bin/indent/opt-nip.0.stdout \
src/tests/usr.bin/indent/opt-nlp.0 \
src/tests/usr.bin/indent/opt-nlp.0.stdout

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.bin/indent/opt-fcb.0
diff -u src/tests/usr.bin/indent/opt-fcb.0:1.1 src/tests/usr.bin/indent/opt-fcb.0:1.2
--- src/tests/usr.bin/indent/opt-fcb.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-fcb.0	Sat Mar  6 22:10:40 2021
@@ -1,4 +1,32 @@
-/* $NetBSD: opt-fcb.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-fcb.0,v 1.2 2021/03/06 22:10:40 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+/* FIXME: The options -fcb and -nfcb result in exactly the same output. */
+
+/* Not
+ *
+ * so carefully
+ * formatted
+ *  comment */
+
+/*-
+ * car mat men
+ *efu   for   ted   com   t
+ *   lly box   .
+ */
+
+void
+example(void)
+{
+	/* Not
+	 *
+	 * so carefully
+	 * formatted
+	 *  comment */
+
+	/*-
+	 * car mat men
+	 *efu   for   ted   com   t
+	 *   lly box   .
+	 */
+}
Index: src/tests/usr.bin/indent/opt-fcb.0.stdout
diff -u src/tests/usr.bin/indent/opt-fcb.0.stdout:1.1 src/tests/usr.bin/indent/opt-fcb.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-fcb.0.stdout:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-fcb.0.stdout	Sat Mar  6 22:10:40 2021
@@ -1,4 +1,32 @@
-/* $NetBSD: opt-fcb.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-fcb.0.stdout,v 1.2 2021/03/06 22:10:40 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+/* FIXME: The options -fcb and -nfcb result in exactly the same output. */
+
+/*
+ * Not
+ *
+ * so carefully formatted comment
+ */
+
+/*-
+ * car mat men
+ *efu   for   ted   com   t
+ *   lly box   .
+ */
+
+void
+example(void)
+{
+	/*
+	 * Not
+	 *
+	 * so carefully formatted comment
+	 */
+
+	/*-
+	 * car mat men
+	 *efu   for   ted   com   t
+	 *   lly box   .
+	 */
+}
Index: src/tests/usr.bin/indent/opt-i.0
diff -u src/tests/usr.bin/indent/opt-i.0:1.1 src/tests/usr.bin/indent/opt-i.0:1.2
--- src/tests/usr.bin/indent/opt-i.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-i.0	Sat Mar  6 22:10:40 2021
@@ -1,4 +1,8 @@
-/* $NetBSD: opt-i.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-i.0,v 1.2 2021/03/06 22:10:40 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+void
+example(void)
+{
+   if (1 > 0) if (2 > 1) return yes; return no;
+}
Index: src/tests/usr.bin/indent/opt-i.0.stdout
diff -u src/tests/usr.bin/indent/opt-i.0.stdout:1.1 src/tests/usr.bin/indent/opt-i.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-i.0.stdout:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-i.0.stdout	Sat Mar  6 22:10:40 2021
@@ -1,4 +1,11 @@
-/* $NetBSD: opt-i.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-i.0.stdout,v 1.2 2021/03/06 22:10:40 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+void
+example(void)
+{
+   if (1 > 0)
+  if (2 > 1)
+	 return yes;
+   return no;
+}
Index: src/tests/usr.bin/indent/opt-ip.0
diff -u src/tests/usr.bin/indent/opt-ip.0:1.1 src/tests/usr.bin/indent/opt-ip.0:1.2
--- src/tests/usr.bin/indent/opt-ip.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-ip.0	Sat Mar  6 22:10:40 2021
@@ -1,4 +1,21 @@
-/* $NetBSD: opt-ip.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-ip.0,v 1.2 2021/03/06 22:10:40 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+/* FIXME: 

CVS commit: src/tests/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 21:27:39 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt-cd.0 opt-cd.0.stdout opt-cdb.0
opt-cdb.0.stdout opt-ce.0 opt-ce.0.stdout opt-ci.0 opt-ci.0.stdout
opt-cli.0 opt-cli.0.stdout opt-cs.0 opt-cs.0.stdout opt-d.0
opt-d.0.stdout opt-di.0 opt-di.0.stdout opt-dj.0 opt-dj.0.stdout
opt-eei.0 opt-eei.0.stdout opt-ei.0 opt-ei.0.stdout opt-fbs.0
opt-fbs.0.stdout opt-fc1.0 opt-fc1.0.stdout opt-nce.0
opt-nce.0.stdout opt-nei.0 opt-nei.0.stdout opt-nfbs.0
opt-nfbs.0.stdout opt-nfc1.0 opt-nfc1.0.stdout

Log Message:
tests/indent: add 17 more tests, found only a single new bug

Discovering one bug in 17 command line options is acceptable.  This
compensates the bad first impression I got in the previous batch of
tests, which consisted of 11 tests and found 8 bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/opt-cd.0 \
src/tests/usr.bin/indent/opt-cd.0.stdout \
src/tests/usr.bin/indent/opt-cdb.0 \
src/tests/usr.bin/indent/opt-cdb.0.stdout \
src/tests/usr.bin/indent/opt-ce.0 \
src/tests/usr.bin/indent/opt-ce.0.stdout \
src/tests/usr.bin/indent/opt-ci.0 \
src/tests/usr.bin/indent/opt-ci.0.stdout \
src/tests/usr.bin/indent/opt-cli.0 \
src/tests/usr.bin/indent/opt-cli.0.stdout \
src/tests/usr.bin/indent/opt-cs.0 \
src/tests/usr.bin/indent/opt-cs.0.stdout src/tests/usr.bin/indent/opt-d.0 \
src/tests/usr.bin/indent/opt-d.0.stdout src/tests/usr.bin/indent/opt-di.0 \
src/tests/usr.bin/indent/opt-di.0.stdout \
src/tests/usr.bin/indent/opt-dj.0 \
src/tests/usr.bin/indent/opt-dj.0.stdout \
src/tests/usr.bin/indent/opt-eei.0 \
src/tests/usr.bin/indent/opt-eei.0.stdout \
src/tests/usr.bin/indent/opt-ei.0 \
src/tests/usr.bin/indent/opt-ei.0.stdout \
src/tests/usr.bin/indent/opt-fbs.0 \
src/tests/usr.bin/indent/opt-fbs.0.stdout \
src/tests/usr.bin/indent/opt-fc1.0 \
src/tests/usr.bin/indent/opt-fc1.0.stdout \
src/tests/usr.bin/indent/opt-nce.0 \
src/tests/usr.bin/indent/opt-nce.0.stdout \
src/tests/usr.bin/indent/opt-nei.0 \
src/tests/usr.bin/indent/opt-nei.0.stdout \
src/tests/usr.bin/indent/opt-nfbs.0 \
src/tests/usr.bin/indent/opt-nfbs.0.stdout \
src/tests/usr.bin/indent/opt-nfc1.0 \
src/tests/usr.bin/indent/opt-nfc1.0.stdout

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.bin/indent/opt-cd.0
diff -u src/tests/usr.bin/indent/opt-cd.0:1.1 src/tests/usr.bin/indent/opt-cd.0:1.2
--- src/tests/usr.bin/indent/opt-cd.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-cd.0	Sat Mar  6 21:27:39 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-cd.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-cd.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int aflag; /* Apply to all files. */
Index: src/tests/usr.bin/indent/opt-cd.0.stdout
diff -u src/tests/usr.bin/indent/opt-cd.0.stdout:1.1 src/tests/usr.bin/indent/opt-cd.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-cd.0.stdout:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-cd.0.stdout	Sat Mar  6 21:27:39 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-cd.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-cd.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int		aflag;/* Apply to all files. */
Index: src/tests/usr.bin/indent/opt-cdb.0
diff -u src/tests/usr.bin/indent/opt-cdb.0:1.1 src/tests/usr.bin/indent/opt-cdb.0:1.2
--- src/tests/usr.bin/indent/opt-cdb.0:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-cdb.0	Sat Mar  6 21:27:39 2021
@@ -1,4 +1,45 @@
-/* $NetBSD: opt-cdb.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-cdb.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+/* A single-line comment. */
+
+/* A
+ * multi-line
+ * comment. */
+
+/*
+ * A
+ * multi-line
+ * comment.
+ */
+
+int		ga;		/* A single-line comment. */
+
+int		gb;		/* A
+ * multi-line
+ * comment. */
+
+int		gc;		/*
+ * A
+ * multi-line
+ * comment.
+ */
+
+void
+example(void)
+{
+	/* A single-line comment. */
+	int la;
+
+	/* A
+	 * multi-line
+	 * comment. */
+	int lb;
+
+	/*
+	 * A
+	 * multi-line
+	 * comment.
+	 */
+	int lc;
+}
Index: src/tests/usr.bin/indent/opt-cdb.0.stdout
diff -u src/tests/usr.bin/indent/opt-cdb.0.stdout:1.1 src/tests/usr.bin/indent/opt-cdb.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-cdb.0.stdout:1.1	Sat Mar  6 17:56:34 2021
+++ src/tests/usr.bin/indent/opt-cdb.0.stdout	Sat Mar  6 21:27:39 2021
@@ -1,4 +1,35 @@
-/* $NetBSD: opt-cdb.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
+/* $NetBSD: opt-cdb.0.stdout,v 1.2 2021/03/06 21:27:39 

CVS commit: src/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 21:08:08 UTC 2021

Modified Files:
src/usr.bin/indent: indent.1

Log Message:
indent.1: sort options alphabetically


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

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/indent/indent.1
diff -u src/usr.bin/indent/indent.1:1.28 src/usr.bin/indent/indent.1:1.29
--- src/usr.bin/indent/indent.1:1.28	Thu Apr  4 22:02:06 2019
+++ src/usr.bin/indent/indent.1	Sat Mar  6 21:08:08 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: indent.1,v 1.28 2019/04/04 22:02:06 wiz Exp $
+.\"	$NetBSD: indent.1,v 1.29 2021/03/06 21:08:08 rillig Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"	@(#)indent.1	8.1 (Berkeley) 7/1/93
 .\" $FreeBSD: head/usr.bin/indent/indent.1 334944 2018-06-11 05:35:57Z pstef $
 .\"
-.Dd June 11, 2018
+.Dd March 6, 2021
 .Dt INDENT 1
 .Os
 .Sh NAME
@@ -62,8 +62,8 @@
 .Op Fl \ Ns Ar n
 .Op Fl dj | Fl ndj
 .Bk -words
-.Op Fl ei | Fl nei
 .Op Fl eei | Fl neei
+.Op Fl ei | Fl nei
 .Ek
 .Bk -words
 .Op Fl fbs | Fl nfbs
@@ -292,6 +292,16 @@ left justifies declarations.
 indents declarations the same as code.
 The default is
 .Fl ndj .
+.It Fl eei , neei
+Enables (disables) extra indentation on continuation lines of
+the expression part of
+.Ic if
+and
+.Ic while
+statements.
+These continuation lines will be indented one extra level.
+The default is
+.Fl neei .
 .It Fl \ , nei
 Enables (disables) special
 .Ic else-if
@@ -305,16 +315,6 @@ will have the same indentation as the pr
 statement.
 The default is
 .Fl ei .
-.It Fl eei , neei
-Enables (disables) extra indentation on continuation lines of
-the expression part of
-.Ic if
-and
-.Ic while
-statements.
-These continuation lines will be indented one extra level.
-The default is
-.Fl neei .
 .It Fl fbs , nfbs
 Enables (disables) splitting the function declaration and opening brace
 across two lines.



CVS commit: src/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 20:30:07 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c io.c parse.c

Log Message:
indent: fix space-tab alignment in indent's own code

These parts are not fixed automatically by indent since they are in box
comments.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/indent/io.c
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/indent/parse.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.27 src/usr.bin/indent/indent.c:1.28
--- src/usr.bin/indent/indent.c:1.27	Thu Apr 23 00:17:34 2020
+++ src/usr.bin/indent/indent.c	Sat Mar  6 20:30:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.27 2020/04/23 00:17:34 joerg Exp $	*/
+/*	$NetBSD: indent.c,v 1.28 2021/03/06 20:30:06 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 #include 
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.27 2020/04/23 00:17:34 joerg Exp $");
+__RCSID("$NetBSD: indent.c,v 1.28 2021/03/06 20:30:06 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -228,7 +228,7 @@ main(int argc, char **argv)
 simple_backup_suffix = envval;
 
 /*--*\
-|   		COMMAND LINE SCAN		 |
+|			COMMAND LINE SCAN		 |
 \*--*/
 
 #ifdef undef

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.20 src/usr.bin/indent/io.c:1.21
--- src/usr.bin/indent/io.c:1.20	Sat Oct 19 15:44:31 2019
+++ src/usr.bin/indent/io.c	Sat Mar  6 20:30:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.20 2019/10/19 15:44:31 christos Exp $	*/
+/*	$NetBSD: io.c,v 1.21 2021/03/06 20:30:06 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)io.c	8.1 (Be
 #include 
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.20 2019/10/19 15:44:31 christos Exp $");
+__RCSID("$NetBSD: io.c,v 1.21 2021/03/06 20:30:06 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -277,7 +277,7 @@ compute_label_target(void)
  *
  * FUNCTION: Reads one block of input into input_buffer
  *
- * HISTORY: initial coding 	November 1976	D A Willcox of CAC 1/7/77 A
+ * HISTORY: initial coding	November 1976	D A Willcox of CAC 1/7/77 A
  * Willcox of CAC	Added check for switch back to partly full input
  * buffer from temporary buffer
  *
@@ -395,7 +395,7 @@ fill_buffer(void)
  *
  * CALLED BY: dump_line
  *
- * HISTORY: initial coding 	November 1976	D A Willcox of CAC
+ * HISTORY: initial coding	November 1976	D A Willcox of CAC
  *
  */
 static int
@@ -442,7 +442,7 @@ pad_output(int current, int target)
  * RETURNS: Integer value of position after printing "buffer" starting in column
  * "current".
  *
- * HISTORY: initial coding 	November 1976	D A Willcox of CAC
+ * HISTORY: initial coding	November 1976	D A Willcox of CAC
  *
  */
 int

Index: src/usr.bin/indent/parse.c
diff -u src/usr.bin/indent/parse.c:1.10 src/usr.bin/indent/parse.c:1.11
--- src/usr.bin/indent/parse.c:1.10	Sat Oct 19 15:44:31 2019
+++ src/usr.bin/indent/parse.c	Sat Mar  6 20:30:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.10 2019/10/19 15:44:31 christos Exp $	*/
+/*	$NetBSD: parse.c,v 1.11 2021/03/06 20:30:06 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -265,7 +265,7 @@ parse(int tk) /* tk: the code for the co
  *
  * CALLED BY: parse
  *
- * HISTORY: initial coding 	November 1976	D A Willcox of CAC
+ * HISTORY: initial coding	November 1976	D A Willcox of CAC
  *
  */
 /*--*\



CVS commit: src/libexec/ld.elf_so/arch/mips

2021-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar  6 20:11:08 UTC 2021

Modified Files:
src/libexec/ld.elf_so/arch/mips: mips_reloc.c

Log Message:
Don't or the got object in, just assign it. Fixes cc -mabi=64 hello.c -lcrypto
Now all 64 bit binaries work, and I tested that we did not break the 32 bit
ones
XXX: That 0x8000 seems wrong for 64 bit stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/libexec/ld.elf_so/arch/mips/mips_reloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/mips/mips_reloc.c
diff -u src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.73 src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.74
--- src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.73	Sat Nov  2 23:15:59 2019
+++ src/libexec/ld.elf_so/arch/mips/mips_reloc.c	Sat Mar  6 15:11:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_reloc.c,v 1.73 2019/11/03 03:15:59 christos Exp $	*/
+/*	$NetBSD: mips_reloc.c,v 1.74 2021/03/06 20:11:08 christos Exp $	*/
 
 /*
  * Copyright 1997 Michael L. Hitch 
@@ -30,7 +30,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mips_reloc.c,v 1.73 2019/11/03 03:15:59 christos Exp $");
+__RCSID("$NetBSD: mips_reloc.c,v 1.74 2021/03/06 20:11:08 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -129,7 +129,7 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
 {
 	obj->pltgot[0] = (Elf_Addr) &_rtld_bind_start;
 	/* XXX only if obj->pltgot[1] & 0x8000 ?? */
-	obj->pltgot[1] |= (Elf_Addr) obj;
+	obj->pltgot[1] = (Elf_Addr) obj;
 }
 
 void



CVS commit: src/libexec/ld.elf_so

2021-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar  6 20:09:40 UTC 2021

Modified Files:
src/libexec/ld.elf_so: xprintf.c

Log Message:
pretend we know about %# and %j...


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/libexec/ld.elf_so/xprintf.c

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

Modified files:

Index: src/libexec/ld.elf_so/xprintf.c
diff -u src/libexec/ld.elf_so/xprintf.c:1.22 src/libexec/ld.elf_so/xprintf.c:1.23
--- src/libexec/ld.elf_so/xprintf.c:1.22	Sun Dec  8 17:41:42 2019
+++ src/libexec/ld.elf_so/xprintf.c	Sat Mar  6 15:09:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: xprintf.c,v 1.22 2019/12/08 22:41:42 uwe Exp $	 */
+/*	$NetBSD: xprintf.c,v 1.23 2021/03/06 20:09:39 christos Exp $	 */
 
 /*
  * Copyright 1996 Matt Thomas 
@@ -29,7 +29,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: xprintf.c,v 1.22 2019/12/08 22:41:42 uwe Exp $");
+__RCSID("$NetBSD: xprintf.c,v 1.23 2021/03/06 20:09:39 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -73,9 +73,11 @@ xvsnprintf(char *buf, size_t buflen, con
 prec = va_arg(ap, int);
 /* FALLTHROUGH */
 			case '.':
+			case '#':
 fmt++;
 goto rflag;
 			case 'l':
+			case 'j':
 size |= SZ_LONG;
 fmt++;
 goto rflag;



CVS commit: src/tests/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 19:51:25 UTC 2021

Modified Files:
src/tests/usr.bin/indent: declarations.0 opt-c.0 parens.0

Log Message:
tests/indent: fix unintended trailing whitespace and space-tab


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/declarations.0 \
src/tests/usr.bin/indent/parens.0
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt-c.0

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.bin/indent/declarations.0
diff -u src/tests/usr.bin/indent/declarations.0:1.1 src/tests/usr.bin/indent/declarations.0:1.2
--- src/tests/usr.bin/indent/declarations.0:1.1	Thu Apr  4 15:27:35 2019
+++ src/tests/usr.bin/indent/declarations.0	Sat Mar  6 19:51:24 2021
@@ -1,8 +1,8 @@
-/*	$NetBSD: declarations.0,v 1.1 2019/04/04 15:27:35 kamil Exp $	*/
+/*	$NetBSD: declarations.0,v 1.2 2021/03/06 19:51:24 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 /* See r303570 */
 
-typedef void 	(*voidptr) (int *);
+typedef void	(*voidptr) (int *);
 
 static const struct
 {
@@ -23,7 +23,7 @@ typedef struct Complex
 	double		y;
 }	Complex;
 
-void 
+void
 t1 (char *a, int b,
 	void (*fn)(void))
 {}
Index: src/tests/usr.bin/indent/parens.0
diff -u src/tests/usr.bin/indent/parens.0:1.1 src/tests/usr.bin/indent/parens.0:1.2
--- src/tests/usr.bin/indent/parens.0:1.1	Thu Apr  4 15:27:35 2019
+++ src/tests/usr.bin/indent/parens.0	Sat Mar  6 19:51:24 2021
@@ -1,9 +1,9 @@
-/*	$NetBSD: parens.0,v 1.1 2019/04/04 15:27:35 kamil Exp $	*/
+/*	$NetBSD: parens.0,v 1.2 2021/03/06 19:51:24 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/parens.0 334583 2018-06-03 19:05:20Z pstef $ */
-typedef void 	(*xxx) (int,
+typedef void	(*xxx) (int,
 char);
 
-typedef char 	(*) (int *,
+typedef char	(*) (int *,
 		 unsigned *,
 		 char,
 		 float *);

Index: src/tests/usr.bin/indent/opt-c.0
diff -u src/tests/usr.bin/indent/opt-c.0:1.2 src/tests/usr.bin/indent/opt-c.0:1.3
--- src/tests/usr.bin/indent/opt-c.0:1.2	Sat Mar  6 19:30:44 2021
+++ src/tests/usr.bin/indent/opt-c.0	Sat Mar  6 19:51:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-c.0,v 1.2 2021/03/06 19:30:44 rillig Exp $ */
+/* $NetBSD: opt-c.0,v 1.3 2021/03/06 19:51:24 rillig Exp $ */
 /* $FreeBSD$ */
 
 bool
@@ -8,5 +8,5 @@ is_prime(int n)
 		return n >= 2; /* special case */
 	if (n % 2 == 0)
 		return false;/* even numbers */
-	return true;
+	return true;
 }



CVS commit: src/tests/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 19:30:44 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt--version.0 opt-bacc.0 opt-bacc.0.stdout
opt-bad.0 opt-bad.0.stdout opt-badp.0 opt-badp.0.stdout opt-bap.0
opt-bap.0.stdout opt-bbb.0 opt-bbb.0.stdout opt-bc.0
opt-bc.0.stdout opt-bl.0 opt-bl.0.stdout opt-br.0 opt-br.0.stdout
opt-bs.0 opt-bs.0.stdout opt-c.0 opt-c.0.stdout

Log Message:
tests/indent: add 11 test cases, demonstrate 8 bugs


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/opt--version.0 \
src/tests/usr.bin/indent/opt-bacc.0 \
src/tests/usr.bin/indent/opt-bacc.0.stdout \
src/tests/usr.bin/indent/opt-bad.0 \
src/tests/usr.bin/indent/opt-bad.0.stdout \
src/tests/usr.bin/indent/opt-badp.0 \
src/tests/usr.bin/indent/opt-badp.0.stdout \
src/tests/usr.bin/indent/opt-bap.0 \
src/tests/usr.bin/indent/opt-bap.0.stdout \
src/tests/usr.bin/indent/opt-bbb.0 \
src/tests/usr.bin/indent/opt-bbb.0.stdout \
src/tests/usr.bin/indent/opt-bc.0 \
src/tests/usr.bin/indent/opt-bc.0.stdout \
src/tests/usr.bin/indent/opt-bl.0 \
src/tests/usr.bin/indent/opt-bl.0.stdout \
src/tests/usr.bin/indent/opt-br.0 \
src/tests/usr.bin/indent/opt-br.0.stdout \
src/tests/usr.bin/indent/opt-bs.0 \
src/tests/usr.bin/indent/opt-bs.0.stdout src/tests/usr.bin/indent/opt-c.0 \
src/tests/usr.bin/indent/opt-c.0.stdout

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.bin/indent/opt--version.0
diff -u src/tests/usr.bin/indent/opt--version.0:1.1 src/tests/usr.bin/indent/opt--version.0:1.2
--- src/tests/usr.bin/indent/opt--version.0:1.1	Sat Mar  6 17:56:33 2021
+++ src/tests/usr.bin/indent/opt--version.0	Sat Mar  6 19:30:44 2021
@@ -1,4 +1,6 @@
-/* $NetBSD: opt--version.0,v 1.1 2021/03/06 17:56:33 rillig Exp $ */
+/* $NetBSD: opt--version.0,v 1.2 2021/03/06 19:30:44 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+When the option '--version' is given, any other options are ignored.
+Therefore the source file, if given, can contain arbitrary text that
+even might generate syntax errors when given to a C compiler.
Index: src/tests/usr.bin/indent/opt-bacc.0
diff -u src/tests/usr.bin/indent/opt-bacc.0:1.1 src/tests/usr.bin/indent/opt-bacc.0:1.2
--- src/tests/usr.bin/indent/opt-bacc.0:1.1	Sat Mar  6 17:56:33 2021
+++ src/tests/usr.bin/indent/opt-bacc.0	Sat Mar  6 19:30:44 2021
@@ -1,4 +1,19 @@
-/* $NetBSD: opt-bacc.0,v 1.1 2021/03/06 17:56:33 rillig Exp $ */
+/* $NetBSD: opt-bacc.0,v 1.2 2021/03/06 19:30:44 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int		a;
+#if 0/* FIXME: need blank line above */
+int		b;
+#endif/* FIXME: need blank line below */
+int		c;
+
+
+int		space_a;
+
+#if 0/* FIXME: need blank line above */
+
+int		space_b;	/* FIXME: need no blank line above */
+
+#endif
+
+int		space_c;
Index: src/tests/usr.bin/indent/opt-bacc.0.stdout
diff -u src/tests/usr.bin/indent/opt-bacc.0.stdout:1.1 src/tests/usr.bin/indent/opt-bacc.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-bacc.0.stdout:1.1	Sat Mar  6 17:56:33 2021
+++ src/tests/usr.bin/indent/opt-bacc.0.stdout	Sat Mar  6 19:30:44 2021
@@ -1,4 +1,17 @@
-/* $NetBSD: opt-bacc.0.stdout,v 1.1 2021/03/06 17:56:33 rillig Exp $ */
+/* $NetBSD: opt-bacc.0.stdout,v 1.2 2021/03/06 19:30:44 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+int		a;
+#if 0/* FIXME: need blank line above */
+int		b;
+#endif/* FIXME: need blank line below */
+int		c;
+
+
+int		space_a;
+#if 0/* FIXME: need blank line above */
+
+int		space_b;	/* FIXME: need no blank line above */
+#endif
+
+int		space_c;
Index: src/tests/usr.bin/indent/opt-bad.0
diff -u src/tests/usr.bin/indent/opt-bad.0:1.1 src/tests/usr.bin/indent/opt-bad.0:1.2
--- src/tests/usr.bin/indent/opt-bad.0:1.1	Sat Mar  6 17:56:33 2021
+++ src/tests/usr.bin/indent/opt-bad.0	Sat Mar  6 19:30:44 2021
@@ -1,4 +1,18 @@
-/* $NetBSD: opt-bad.0,v 1.1 2021/03/06 17:56:33 rillig Exp $ */
+/* $NetBSD: opt-bad.0,v 1.2 2021/03/06 19:30:44 rillig Exp $ */
 /* $FreeBSD$ */
 
-/* TODO: implement the test */
+/*
+ * The option -bad only affects declarations of local variables.  It does not
+ * affect file-scoped declarations or definitions.
+ */
+
+int global_variable;
+void function_declaration(void);
+#if 0
+#endif
+void function_definition(void) {
+	int local_variable;
+	function_call();
+	int local_variable_after_statement;
+	function_call();
+}
Index: src/tests/usr.bin/indent/opt-bad.0.stdout
diff -u src/tests/usr.bin/indent/opt-bad.0.stdout:1.1 src/tests/usr.bin/indent/opt-bad.0.stdout:1.2
--- src/tests/usr.bin/indent/opt-bad.0.stdout:1.1	Sat Mar  6 17:56:33 2021
+++ src/tests/usr.bin/indent/opt-bad.0.stdout	Sat Mar  6 19:30:44 2021
@@ -1,4 +1,22 @@
-/* $NetBSD: opt-bad.0.stdout,v 1.1 

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

2021-03-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar  6 19:16:45 UTC 2021

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

Log Message:
return early from identify_hypervisor() if we already know we're running
Xen PV or PVH, as this was before 1.119.
Trying to read the BIOS faults (as expected, as there's no BIOS in this case).
Problem pointed out and fix tested by Brian Marcotte


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/x86/x86/identcpu.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/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.119 src/sys/arch/x86/x86/identcpu.c:1.120
--- src/sys/arch/x86/x86/identcpu.c:1.119	Fri Feb 19 02:15:24 2021
+++ src/sys/arch/x86/x86/identcpu.c	Sat Mar  6 19:16:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.119 2021/02/19 02:15:24 christos Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.120 2021/03/06 19:16:45 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.119 2021/02/19 02:15:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.120 2021/03/06 19:16:45 bouyer Exp $");
 
 #include "opt_xen.h"
 
@@ -1135,18 +1135,14 @@ identify_hypervisor(void)
 	const char *p;
 	int i;
 
-#if 0	
-	/* 
-	 * This is called from cpu_probe() and cpu_configure()
-	 * During cpu_probe() we have not called platform_init()
-	 * yet, so the bios tables have not been loaded.
-	 * We allow this to be called twice in order to override
-	 * the cpuid setting because some hypervisors don't return
-	 * specific enough info with cpuid it.
-	 */
-	if (vm_guest != VM_GUEST_NO)
+	switch(vm_guest) {
+	case VM_GUEST_XENPV:
+	case VM_GUEST_XENPVH:
+		/* guest type already known, no bios info */
 		return;
-#endif
+	default:
+		break;
+	}
 
 	/*
 	 * [RFC] CPUID usage for interaction between Hypervisors and Linux.



CVS commit: src

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 17:56:34 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile
Added Files:
src/tests/usr.bin/indent: opt--version.0 opt--version.0.pro
opt--version.0.stdout opt-P.0 opt-P.0.pro opt-P.0.stdout opt-T.0
opt-T.0.pro opt-T.0.stdout opt-U.0 opt-U.0.list opt-U.0.pro
opt-U.0.stdout opt-bacc.0 opt-bacc.0.pro opt-bacc.0.stdout
opt-bad.0 opt-bad.0.pro opt-bad.0.stdout opt-badp.0 opt-badp.0.pro
opt-badp.0.stdout opt-bap.0 opt-bap.0.pro opt-bap.0.stdout
opt-bbb.0 opt-bbb.0.pro opt-bbb.0.stdout opt-bc.0 opt-bc.0.pro
opt-bc.0.stdout opt-bl.0 opt-bl.0.pro opt-bl.0.stdout opt-br.0
opt-br.0.pro opt-br.0.stdout opt-bs.0 opt-bs.0.pro opt-bs.0.stdout
opt-c.0 opt-c.0.pro opt-c.0.stdout opt-cd.0 opt-cd.0.pro
opt-cd.0.stdout opt-cdb.0 opt-cdb.0.pro opt-cdb.0.stdout opt-ce.0
opt-ce.0.pro opt-ce.0.stdout opt-ci.0 opt-ci.0.pro opt-ci.0.stdout
opt-cli.0 opt-cli.0.pro opt-cli.0.stdout opt-cs.0 opt-cs.0.pro
opt-cs.0.stdout opt-d.0 opt-d.0.pro opt-d.0.stdout opt-di.0
opt-di.0.pro opt-di.0.stdout opt-dj.0 opt-dj.0.pro opt-dj.0.stdout
opt-eei.0 opt-eei.0.pro opt-eei.0.stdout opt-ei.0 opt-ei.0.pro
opt-ei.0.stdout opt-fbs.0 opt-fbs.0.pro opt-fbs.0.stdout opt-fc1.0
opt-fc1.0.pro opt-fc1.0.stdout opt-fcb.0 opt-fcb.0.pro
opt-fcb.0.stdout opt-i.0 opt-i.0.pro opt-i.0.stdout opt-ip.0
opt-ip.0.pro opt-ip.0.stdout opt-l.0 opt-l.0.pro opt-l.0.stdout
opt-lc.0 opt-lc.0.pro opt-lc.0.stdout opt-ldi.0 opt-ldi.0.pro
opt-ldi.0.stdout opt-lp.0 opt-lp.0.pro opt-lp.0.stdout opt-lpl.0
opt-lpl.0.pro opt-lpl.0.stdout opt-nbacc.0 opt-nbacc.0.pro
opt-nbacc.0.stdout opt-nbad.0 opt-nbad.0.pro opt-nbad.0.stdout
opt-nbadp.0 opt-nbadp.0.pro opt-nbadp.0.stdout opt-nbap.0
opt-nbap.0.pro opt-nbap.0.stdout opt-nbbb.0 opt-nbbb.0.pro
opt-nbbb.0.stdout opt-nbc.0 opt-nbc.0.pro opt-nbc.0.stdout
opt-nbs.0 opt-nbs.0.pro opt-nbs.0.stdout opt-ncdb.0 opt-ncdb.0.pro
opt-ncdb.0.stdout opt-nce.0 opt-nce.0.pro opt-nce.0.stdout
opt-ncs.0 opt-ncs.0.pro opt-ncs.0.stdout opt-ndj.0 opt-ndj.0.pro
opt-ndj.0.stdout opt-neei.0 opt-neei.0.pro opt-neei.0.stdout
opt-nei.0 opt-nei.0.pro opt-nei.0.stdout opt-nfbs.0 opt-nfbs.0.pro
opt-nfbs.0.stdout opt-nfc1.0 opt-nfc1.0.pro opt-nfc1.0.stdout
opt-nfcb.0 opt-nfcb.0.pro opt-nfcb.0.stdout opt-nip.0 opt-nip.0.pro
opt-nip.0.stdout opt-nlp.0 opt-nlp.0.pro opt-nlp.0.stdout
opt-nlpl.0 opt-nlpl.0.pro opt-nlpl.0.stdout opt-npcs.0
opt-npcs.0.pro opt-npcs.0.stdout opt-npro.0 opt-npro.0.pro
opt-npro.0.stdout opt-npsl.0 opt-npsl.0.pro opt-npsl.0.stdout
opt-nsc.0 opt-nsc.0.pro opt-nsc.0.stdout opt-nsob.0 opt-nsob.0.pro
opt-nsob.0.stdout opt-nut.0 opt-nut.0.pro opt-nut.0.stdout opt-nv.0
opt-nv.0.pro opt-nv.0.stdout opt-pcs.0 opt-pcs.0.pro
opt-pcs.0.stdout opt-psl.0 opt-psl.0.pro opt-psl.0.stdout opt-sc.0
opt-sc.0.pro opt-sc.0.stdout opt-sob.0 opt-sob.0.pro
opt-sob.0.stdout opt-ta.0 opt-ta.0.pro opt-ta.0.stdout opt-ts.0
opt-ts.0.pro opt-ts.0.stdout opt-ut.0 opt-ut.0.pro opt-ut.0.stdout
opt-v.0 opt-v.0.pro opt-v.0.stdout

Log Message:
tests/indent: add templates for options tests

Given that indent "has even more switches than ls(1)", there are far too
few tests.  To make it easier to add meaningful tests for each of the
options, add the templates for the tests right now, ready to be filled
in.


To generate a diff of this commit:
cvs rdiff -u -r1.1024 -r1.1025 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/opt--version.0 \
src/tests/usr.bin/indent/opt--version.0.pro \
src/tests/usr.bin/indent/opt--version.0.stdout \
src/tests/usr.bin/indent/opt-P.0 src/tests/usr.bin/indent/opt-P.0.pro \
src/tests/usr.bin/indent/opt-P.0.stdout src/tests/usr.bin/indent/opt-T.0 \
src/tests/usr.bin/indent/opt-T.0.pro \
src/tests/usr.bin/indent/opt-T.0.stdout src/tests/usr.bin/indent/opt-U.0 \
src/tests/usr.bin/indent/opt-U.0.list \
src/tests/usr.bin/indent/opt-U.0.pro \
src/tests/usr.bin/indent/opt-U.0.stdout \
src/tests/usr.bin/indent/opt-bacc.0 \
src/tests/usr.bin/indent/opt-bacc.0.pro \
src/tests/usr.bin/indent/opt-bacc.0.stdout \
src/tests/usr.bin/indent/opt-bad.0 src/tests/usr.bin/indent/opt-bad.0.pro \
src/tests/usr.bin/indent/opt-bad.0.stdout \
src/tests/usr.bin/indent/opt-badp.0 \
src/tests/usr.bin/indent/opt-badp.0.pro \

CVS commit: src/tests/usr.bin/indent

2021-03-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  6 15:02:38 UTC 2021

Modified Files:
src/tests/usr.bin/indent: comment-line-end.0 comment-line-end.0.stdout

Log Message:
tests/indent: extend test for '//' comments with more examples


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/comment-line-end.0 \
src/tests/usr.bin/indent/comment-line-end.0.stdout

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.bin/indent/comment-line-end.0
diff -u src/tests/usr.bin/indent/comment-line-end.0:1.1 src/tests/usr.bin/indent/comment-line-end.0:1.2
--- src/tests/usr.bin/indent/comment-line-end.0:1.1	Sun Feb 21 21:26:26 2021
+++ src/tests/usr.bin/indent/comment-line-end.0	Sat Mar  6 15:02:38 2021
@@ -1,9 +1,24 @@
-/* $NetBSD: comment-line-end.0,v 1.1 2021/02/21 21:26:26 rillig Exp $ */
+/* $NetBSD: comment-line-end.0,v 1.2 2021/03/06 15:02:38 rillig Exp $ */
 /* This $FreeBSD$ tag is required by the test suite, for no reason. */
 
 /*
- * Demonstrates that line-end comments can affect the following lines.
+ * Demonstrates handling of line-end comments.
  *
+ * Even though this type of comments was added in C99, indent doesn't support
+ * them, as of 2021, and instead messes up the code in unpredictable ways.
+ */
+
+int dummy // comment
+= // eq
+1 // one
++ // plus
+2; // two
+
+/separator/
+
+void function(void){}
+
+/*
  * FIXME: The '{' of main must be in column 1, not directly after the ')'.
  *
  * FIXME: The 'Note: removing' below gets "indented" to 'Note:removing'.
Index: src/tests/usr.bin/indent/comment-line-end.0.stdout
diff -u src/tests/usr.bin/indent/comment-line-end.0.stdout:1.1 src/tests/usr.bin/indent/comment-line-end.0.stdout:1.2
--- src/tests/usr.bin/indent/comment-line-end.0.stdout:1.1	Sun Feb 21 21:26:26 2021
+++ src/tests/usr.bin/indent/comment-line-end.0.stdout	Sat Mar  6 15:02:38 2021
@@ -1,9 +1,28 @@
-/* $NetBSD: comment-line-end.0.stdout,v 1.1 2021/02/21 21:26:26 rillig Exp $ */
+/* $NetBSD: comment-line-end.0.stdout,v 1.2 2021/03/06 15:02:38 rillig Exp $ */
 /* This $FreeBSD$ tag is required by the test suite, for no reason. */
 
 /*
- * Demonstrates that line-end comments can affect the following lines.
+ * Demonstrates handling of line-end comments.
  *
+ * Even though this type of comments was added in C99, indent doesn't support
+ * them, as of 2021, and instead messes up the code in unpredictable ways.
+ */
+
+int		dummy //comment
+= //eq
+1 // one
++ //plus
+2;
+//two
+
+/ separator /
+
+void
+function(void)
+{
+}
+
+/*
  * FIXME: The '{' of main must be in column 1, not directly after the ')'.
  *
  * FIXME: The 'Note: removing' below gets "indented" to 'Note:removing'.
@@ -11,7 +30,7 @@
  * FIXME: The 'line-end' gets "indented" to 'line - end'.
  */
 
-// Note:removing one of these line - end comments affects the formatting
+//Note:removing one of these line - end comments affects the formatting
 // of the main function below.
 
 int



CVS commit: src/share/man/man9

2021-03-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Mar  6 14:44:02 UTC 2021

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

Log Message:
Fix trivial typo. No need to bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/share/man/man9/kmem.9

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

Modified files:

Index: src/share/man/man9/kmem.9
diff -u src/share/man/man9/kmem.9:1.27 src/share/man/man9/kmem.9:1.28
--- src/share/man/man9/kmem.9:1.27	Sun Jan 24 17:29:11 2021
+++ src/share/man/man9/kmem.9	Sat Mar  6 14:44:02 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kmem.9,v 1.27 2021/01/24 17:29:11 thorpej Exp $
+.\"	$NetBSD: kmem.9,v 1.28 2021/03/06 14:44:02 rin Exp $
 .\"
 .\" Copyright (c)2006 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -78,7 +78,7 @@
 "size_t size" "void *stackbuf" "size_t stackbufsize" "km_flag_t kmflags"
 .Ft void
 .Fn kmem_tmpbuf_free \
-"void *p" "size_t size" "void *stsackbuf"
+"void *p" "size_t size" "void *stackbuf"
 .\" 
 .Pp
 .Cd "options KMEM_SIZE"



CVS commit: src/sys/arch/m68k/m68k

2021-03-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar  6 13:32:56 UTC 2021

Modified Files:
src/sys/arch/m68k/m68k: m68k_trap.c

Log Message:
Minimal (but hackish) change to make a DEBUG kernel compilable.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/m68k/m68k_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/m68k/m68k/m68k_trap.c
diff -u src/sys/arch/m68k/m68k/m68k_trap.c:1.2 src/sys/arch/m68k/m68k/m68k_trap.c:1.3
--- src/sys/arch/m68k/m68k/m68k_trap.c:1.2	Sat Apr  6 03:06:26 2019
+++ src/sys/arch/m68k/m68k/m68k_trap.c	Sat Mar  6 13:32:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_trap.c,v 1.2 2019/04/06 03:06:26 thorpej Exp $	*/
+/*	$NetBSD: m68k_trap.c,v 1.3 2021/03/06 13:32:56 martin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m68k_trap.c,v 1.2 2019/04/06 03:06:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k_trap.c,v 1.3 2021/03/06 13:32:56 martin Exp $");
 
 #include "opt_m68k_arch.h"
 
@@ -91,6 +91,15 @@ extern int suline(void *, void *);	/* lo
 #define	KDFAULT(c)	(KDFAULT_060(c) || KDFAULT_040(c) || KDFAULT_OTH(c))
 #define	WRFAULT(c)	(WRFAULT_060(c) || WRFAULT_040(c) || WRFAULT_OTH(c))
 
+
+#ifdef DEBUG
+extern int mmudebug, mmupid;
+#define MDB_FOLLOW	1
+#define MDB_WBFOLLOW	2
+#define MDB_WBFAILED	4
+#define MDB_ISPID(pid)	((pid) == mmupid)
+#endif
+
 #ifdef M68040
 #ifdef DEBUG
 struct writebackstats {



CVS commit: src/sys/dev/fdt

2021-03-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar  6 13:21:26 UTC 2021

Modified Files:
src/sys/dev/fdt: fdt_ddb.c

Log Message:
Improve fdt_isprint so that it returns false if there are consecutive
zeroes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fdt_ddb.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/fdt/fdt_ddb.c
diff -u src/sys/dev/fdt/fdt_ddb.c:1.1 src/sys/dev/fdt/fdt_ddb.c:1.2
--- src/sys/dev/fdt/fdt_ddb.c:1.1	Fri Oct 30 16:08:45 2020
+++ src/sys/dev/fdt/fdt_ddb.c	Sat Mar  6 13:21:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdt_ddb.c,v 1.1 2020/10/30 16:08:45 skrll Exp $	*/
+/*	$NetBSD: fdt_ddb.c,v 1.2 2021/03/06 13:21:26 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_ddb.c,v 1.1 2020/10/30 16:08:45 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_ddb.c,v 1.2 2021/03/06 13:21:26 skrll Exp $");
 
 #include 
 
@@ -49,8 +49,16 @@ fdt_isprint(const void *data, int len)
 	if (len == 0)
 		return false;
 
+	/* Count consecutive zeroes */
+	int cz = 0;
 	for (size_t j = 0; j < len; j++) {
-		if (!(isprint(c[j]) || c[j] == '\0'))
+		if (c[j] == '\0')
+			cz++;
+		else if (isprint(c[j]))
+			cz = 0;
+		else
+			return false;
+		if (cz > 1)
 			return false;
 	}
 	return true;



CVS commit: src/sys/arch/powerpc/powerpc

2021-03-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Mar  6 08:34:58 UTC 2021

Modified Files:
src/sys/arch/powerpc/powerpc: locore_subr.S

Log Message:
For ibm4xx and booke, restore saved PSL_EE bit as done for oea,
instead of forcibly enabling interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/powerpc/powerpc/locore_subr.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/powerpc/powerpc/locore_subr.S
diff -u src/sys/arch/powerpc/powerpc/locore_subr.S:1.64 src/sys/arch/powerpc/powerpc/locore_subr.S:1.65
--- src/sys/arch/powerpc/powerpc/locore_subr.S:1.64	Sat Mar  6 08:08:19 2021
+++ src/sys/arch/powerpc/powerpc/locore_subr.S	Sat Mar  6 08:34:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_subr.S,v 1.64 2021/03/06 08:08:19 rin Exp $	*/
+/*	$NetBSD: locore_subr.S,v 1.65 2021/03/06 08:34:58 rin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -401,7 +401,7 @@ _ENTRY(softint_fast_dispatch)
 	addi	%r1, %r5, USPACE - FRAMELEN - CALLFRAMELEN
 
 #if defined(PPC_IBM4XX) || defined(PPC_BOOKE)
-	wrteei	1			/* interrupts are okay again */
+	wrtee	%r29			/* interrupts are okay again */
 #else /* PPC_OEA */
 	mtmsr	%r29
 #endif



CVS commit: src/sys/arch/powerpc/powerpc

2021-03-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Mar  6 08:32:17 UTC 2021

Modified Files:
src/sys/arch/powerpc/powerpc: powerpc_machdep.c

Log Message:
Convert to KASSERTMSG(9) to display wrong IPL.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/powerpc/powerpc/powerpc_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/powerpc/powerpc/powerpc_machdep.c
diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.81 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.82
--- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.81	Sat Mar  6 08:08:19 2021
+++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c	Sat Mar  6 08:32:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: powerpc_machdep.c,v 1.81 2021/03/06 08:08:19 rin Exp $	*/
+/*	$NetBSD: powerpc_machdep.c,v 1.82 2021/03/06 08:32:17 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.81 2021/03/06 08:08:19 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.82 2021/03/06 08:32:17 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -381,7 +381,8 @@ void
 cpu_idle(void)
 {
 	KASSERT(mfmsr() & PSL_EE);
-	KASSERT(curcpu()->ci_cpl == IPL_NONE);
+	KASSERTMSG(curcpu()->ci_cpl == IPL_NONE,
+	"ci_cpl = %d", curcpu()->ci_cpl);
 	(*curcpu()->ci_idlespin)();
 }
 



CVS commit: src/sys/arch/evbppc/obs405

2021-03-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Mar  6 08:29:19 UTC 2021

Modified Files:
src/sys/arch/evbppc/obs405: obs600_machdep.c

Log Message:
Reorder things in cpu_startup() for clarity.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbppc/obs405/obs600_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/evbppc/obs405/obs600_machdep.c
diff -u src/sys/arch/evbppc/obs405/obs600_machdep.c:1.11 src/sys/arch/evbppc/obs405/obs600_machdep.c:1.12
--- src/sys/arch/evbppc/obs405/obs600_machdep.c:1.11	Tue Mar  2 07:27:24 2021
+++ src/sys/arch/evbppc/obs405/obs600_machdep.c	Sat Mar  6 08:29:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: obs600_machdep.c,v 1.11 2021/03/02 07:27:24 rin Exp $	*/
+/*	$NetBSD: obs600_machdep.c,v 1.12 2021/03/06 08:29:19 rin Exp $	*/
 /*	Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $	*/
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.11 2021/03/02 07:27:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.12 2021/03/06 08:29:19 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -206,11 +206,6 @@ cpu_startup(void)
 	 */
 	board_info_init();
 
-	/*
-	 * Now that we have VM, malloc()s are OK in bus_space.
-	 */
-	bus_space_mallocok();
-
 	pn = prop_number_create_integer(OBS600_CPU_FREQ);
 	KASSERT(pn != NULL);
 	if (prop_dictionary_set(board_properties, "processor-frequency", pn) ==
@@ -258,6 +253,11 @@ cpu_startup(void)
 	prop_object_release(pn);
 
 	/*
+	 * Now that we have VM, malloc()s are OK in bus_space.
+	 */
+	bus_space_mallocok();
+
+	/*
 	 * no fake mapiodev
 	 */
 	fake_mapiodev = 0;



CVS commit: src/sys/arch/powerpc

2021-03-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Mar  6 08:08:19 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke: trap.c
src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c trap.c
src/sys/arch/powerpc/include: proc.h psl.h ptrace.h
src/sys/arch/powerpc/powerpc: locore_subr.S powerpc_machdep.c
process_machdep.c

Log Message:
For booke and ibm4xx, switch to software-based single-stepping for PT_STEP
ptrace(2) command from broken hardware-based implementation.

As described in proposal on port-powerpc@,

http://mail-index.netbsd.org/port-powerpc/2021/02/26/msg003597.html

hardware debug facilities of booke and 4xx use critical interrupts, that
are difficult to handle for this purpose; they are not automatically masked
when entering kernel mode via system call trap or hardware interrupt.
See my proposal above for more details.

Now, hardware debug facilities are exclusively usable by kernel itself.
They are much more functional than PSL_SE MSR bit of oea, and should be
useful to, e.g., support byte-granular watchpoint for DDB in the future.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/powerpc/ibm4xx/trap.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/include/proc.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/include/psl.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/powerpc/include/ptrace.h
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/powerpc/powerpc/locore_subr.S
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/powerpc/powerpc/powerpc_machdep.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/powerpc/process_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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.36 src/sys/arch/powerpc/booke/trap.c:1.37
--- src/sys/arch/powerpc/booke/trap.c:1.36	Wed Jan  6 08:04:57 2021
+++ src/sys/arch/powerpc/booke/trap.c	Sat Mar  6 08:08:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.36 2021/01/06 08:04:57 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.37 2021/03/06 08:08:19 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.36 2021/01/06 08:04:57 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.37 2021/03/06 08:08:19 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -47,6 +47,7 @@ __KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.3
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -461,11 +462,31 @@ pgm_exception(struct trapframe *tf, ksig
 
 	ci->ci_ev_pgm.ev_count++;
 
+	KSI_INIT_TRAP(ksi);
+
 	if (tf->tf_esr & ESR_PTR) {
-		struct proc *p = curlwp->l_proc;
-		if (p->p_raslist != NULL
-		&& ras_lookup(p, (void *)tf->tf_srr0) != (void *) -1) {
-			tf->tf_srr0 += 4;
+		struct lwp * const l = curlwp;
+		struct proc * const p = curlwp->l_proc;
+		vaddr_t va = (vaddr_t)tf->tf_srr0;
+		int error;
+
+		/*
+		 * Restore original instruction and clear BP.
+		 */
+		if (p->p_md.md_ss_addr[0] == va ||
+		p->p_md.md_ss_addr[1] == va) {
+			error = ppc_sstep(l, 0);
+			if (error != 0) {
+vm_signal(error, EXC_PGM /* XXX */, va, ksi);
+return error;
+			}
+			ksi->ksi_code = TRAP_TRACE;
+		} else
+			ksi->ksi_code = TRAP_BRKPT;
+
+		if (p->p_raslist != NULL &&
+		ras_lookup(p, (void *)va) != (void *)-1) {
+			tf->tf_srr0 += (ksi->ksi_code == TRAP_TRACE) ? 0 : 4;
 			return 0;
 		}
 	}
@@ -494,7 +515,6 @@ pgm_exception(struct trapframe *tf, ksig
 		}
 	}
 
-	KSI_INIT_TRAP(ksi);
 	ksi->ksi_signo = SIGILL;
 	ksi->ksi_trap = EXC_PGM;
 	if (tf->tf_esr & ESR_PIL) {
@@ -503,7 +523,6 @@ pgm_exception(struct trapframe *tf, ksig
 		ksi->ksi_code = ILL_PRVOPC;
 	} else if (tf->tf_esr & ESR_PTR) {
 		ksi->ksi_signo = SIGTRAP;
-		ksi->ksi_code = TRAP_BRKPT;
 	} else {
 		ksi->ksi_code = 0;
 	}
@@ -511,6 +530,7 @@ pgm_exception(struct trapframe *tf, ksig
 	return rv;
 }
 
+#if 0
 static int
 debug_exception(struct trapframe *tf, ksiginfo_t *ksi)
 {
@@ -545,6 +565,7 @@ debug_exception(struct trapframe *tf, ks
 	ksi->ksi_code = TRAP_TRACE;
 	return rv;
 }
+#endif
 
 static int
 ali_exception(struct trapframe *tf, ksiginfo_t *ksi)
@@ -752,6 +773,7 @@ trap(enum ppc_booke_exceptions trap_code
 	switch (trap_code) {
 	case T_CRITIAL_INPUT:
 	case T_EXTERNAL_INPUT:
+	case T_DEBUG:
 	case T_DECREMENTER:
 	case T_FIXED_INTERVAL:
 	case T_WATCHDOG:
@@ -791,6 +813,7 @@ trap(enum ppc_booke_exceptions trap_code
 	case T_INSTRUCTION_TLB_ERROR:
 		rv = itlb_exception(tf, );
 		break;
+#if 0
 	case T_DEBUG:
 #ifdef DDB
 		if (!usertrap && ddb_exception(tf))
@@ -798,6 +821,7 @@ trap(enum ppc_booke_exceptions trap_code
 #endif
 		rv = debug_exception(tf, );
 		break;
+#endif
 	case T_EMBEDDED_FP_DATA:
 		rv =