CVS commit: src/lib/libc/gen

2011-03-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar 13 09:11:54 UTC 2011

Modified Files:
src/lib/libc/gen: unvis.3

Log Message:
Add serial comma, quote minus, add HISTORY for strnunvis and strnunvisx.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/gen/unvis.3

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/gen/unvis.3
diff -u src/lib/libc/gen/unvis.3:1.21 src/lib/libc/gen/unvis.3:1.22
--- src/lib/libc/gen/unvis.3:1.21	Sat Mar 12 19:52:48 2011
+++ src/lib/libc/gen/unvis.3	Sun Mar 13 09:11:54 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: unvis.3,v 1.21 2011/03/12 19:52:48 christos Exp $
+.\	$NetBSD: unvis.3,v 1.22 2011/03/13 09:11:54 wiz Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -199,12 +199,10 @@
 The functions
 .Fn strunvis ,
 .Fn strnunvis ,
-.Fn strunvisx
+.Fn strunvisx ,
 and
 .Fn strnunvisx
-will return
-.Dv -1
-on error and set
+will return \-1 on error and set
 .Va errno 
 to:
 .Bl -tag -width Er
@@ -238,3 +236,9 @@
 function
 first appeared in
 .Bx 4.4 .
+The
+.Fn strnunvis
+and
+.Fn strnunvisx
+functions appeared in
+.Nx 6.0 .



CVS commit: src/lib/libc/gen

2011-03-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar 13 09:12:35 UTC 2011

Modified Files:
src/lib/libc/gen: vis.3

Log Message:
Add serial comma, quote minus, fix NetBSD version in HISTORY.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/gen/vis.3

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/gen/vis.3
diff -u src/lib/libc/gen/vis.3:1.24 src/lib/libc/gen/vis.3:1.25
--- src/lib/libc/gen/vis.3:1.24	Sat Mar 12 19:52:48 2011
+++ src/lib/libc/gen/vis.3	Sun Mar 13 09:12:35 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: vis.3,v 1.24 2011/03/12 19:52:48 christos Exp $
+.\	$NetBSD: vis.3,v 1.25 2011/03/13 09:12:35 wiz Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -162,9 +162,7 @@
 .Fn strnvis
 and
 .Fn strnvisx
-functions return
-.Dv -1
-and set x
+functions return \-1 and set
 .Va errno
 to
 .Dv ENOSPC .
@@ -182,7 +180,7 @@
 .Fn nvis ,
 .Fn strvis ,
 .Fn strnvis ,
-.Fn strvisx
+.Fn strvisx ,
 and
 .Fn strnvisx
 but have an additional argument
@@ -247,7 +245,7 @@
 .Fn snvis ,
 .Fn strsvis ,
 .Fn strsnvis ,
-.Fn strsvisx .
+.Fn strsvisx ,
 and
 .Fn strsnvisx .
 When using these functions, place all graphic characters to be
@@ -397,9 +395,7 @@
 .Fn strsnvis ,
 and
 .Fn strsnvisx ,
-will return
-.Dv -1
-when the
+will return \-1 when the
 .Fa dlen
 destination buffer length size is not enough to perform the conversion while
 setting
@@ -442,4 +438,4 @@
 and 
 .Fn strsnvisx )
 appeared in
-.Nx 1.6 .
+.Nx 6.0 .



CVS commit: src/sys/arch/sandpoint/stand/altboot

2011-03-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Mar 13 15:23:43 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: README.altboot entry.S main.c
version

Log Message:
With the new boot argument altboot the program can replace itself with a
new binary while running.
The default boot path was changed from nfs: to wd0:.
Bumped altboot version to 1.7.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sandpoint/stand/altboot/README.altboot
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/entry.S
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sandpoint/stand/altboot/main.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/version

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/sandpoint/stand/altboot/README.altboot
diff -u src/sys/arch/sandpoint/stand/altboot/README.altboot:1.1 src/sys/arch/sandpoint/stand/altboot/README.altboot:1.2
--- src/sys/arch/sandpoint/stand/altboot/README.altboot:1.1	Sun Jan 23 01:05:30 2011
+++ src/sys/arch/sandpoint/stand/altboot/README.altboot	Sun Mar 13 15:23:43 2011
@@ -1,6 +1,6 @@
 /// notes about altboot ///
 
-$NetBSD: README.altboot,v 1.1 2011/01/23 01:05:30 nisimura Exp $
+$NetBSD: README.altboot,v 1.2 2011/03/13 15:23:43 phx Exp $
 
 Altboot is a functional bridge to fill the gap between a NAS product
 custom bootloader and the NetBSD kernel startup environment.  Altboot
@@ -17,7 +17,7 @@
   targets to make it possible having common NetBSD kernels for them.
 - builds and hands a bootinfo list to the NetBSD kernel.
 
-Altboot is known working on two models.
+Altboot is known working on at least three models.
 - KuroBox with a popular U-Boot as the replacement of vendor proprietary
 
U-Boot 1.1.4 LiSt 2.1.0 (Sep 21 2006 - 00:22:56) LinkStation / KuroBox
@@ -26,6 +26,10 @@
 
PPCBoot 2.0.0 (Mar  1 2005 - 15:31:41)
 
+- D-Link DSM-G600 with heavily restricted vendor custom U-Boot
+
+   U-Boot 0.2.0 (May 26 2005 - 19:38:32)
+
 The standard use of altboot is to invoke it with a short script from
 U-Boot/PPCboot, where the altboot image is stored in an unoccupied 128KB
 section of the target's HW NOR flash.  Combined with standard
@@ -45,4 +49,3 @@
 - preloaded kernel module names (under development).
 
  ### ### ###
-

Index: src/sys/arch/sandpoint/stand/altboot/entry.S
diff -u src/sys/arch/sandpoint/stand/altboot/entry.S:1.2 src/sys/arch/sandpoint/stand/altboot/entry.S:1.3
--- src/sys/arch/sandpoint/stand/altboot/entry.S:1.2	Sat Feb 26 20:11:24 2011
+++ src/sys/arch/sandpoint/stand/altboot/entry.S	Sun Mar 13 15:23:43 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: entry.S,v 1.2 2011/02/26 20:11:24 phx Exp $ */
+/* $NetBSD: entry.S,v 1.3 2011/03/13 15:23:43 phx Exp $ */
 
 #include powerpc/psl.h
 #include powerpc/spr.h
@@ -24,25 +24,12 @@
 	 * U-Boot/PPCBoot forgets to flush the cache when using the bootm
 	 * command, so we have to do that now.
 	 */
-	lis	3,_start@ha
-	addi	3,3,_start@l
-	andi.	3,3,~31@l
-	lis	4,(_edata+31)@ha
-	addi	4,4,(_edata+31)@l
-	mr	5,3
-10:
-	dcbst	0,5
-	addi	5,5,32
-	cmplw	5,4
-	ble	10b
-	sync
-11:
-	icbi	0,3
-	addi	3,3,32
-	cmplw	3,4
-	ble	11b
-	sync
-	isync
+	lis	11,_start@ha
+	addi	11,11,_start@l
+	andi.	11,11,~31@l
+	lis	12,(_edata+31)@ha
+	addi	12,12,(_edata+31)@l
+	bl	syncicache
 
 	mfspr	11,SPR_HID0
 	andi.	0,11,HID0_DCE
@@ -169,6 +156,46 @@
 	bctr
 
 /*
+ * newaltboot(argc, argv, altboot_base, altboot_len)
+ * To be executed in a safe memory region. Copies the new altboot from
+ * altboot_base to 0x100 and starts it there.
+ */
+	.globl	newaltboot
+newaltboot:
+	lis	7,0x100@h
+	mr	11,7
+	subi	7,7,4
+	subi	5,5,4
+	add	12,11,6
+	addi	6,6,3
+	srawi	6,6,2
+	mtctr	6
+1:	lwzu	8,4(5)
+	stwu	8,4(7)
+	bdnz+	1b
+	mtctr	11
+	addi	12,12,31
+	bl	syncicache
+	bctr
+syncicache:
+/* r11=start, r12=end, r10=scratch */
+	mr	10,11
+2:	dcbst	0,10
+	addi	10,10,32
+	cmplw	10,12
+	ble	2b
+	sync
+3:	icbi	0,11
+	addi	11,11,32
+	cmplw	11,12
+	ble	3b
+	sync
+	isync
+	blr
+	.globl	newaltboot_end
+newaltboot_end:
+
+/*
  * reverse endian access to mimic outw/outl/inw/inl
  */
 	.globl out16rb

Index: src/sys/arch/sandpoint/stand/altboot/main.c
diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.11 src/sys/arch/sandpoint/stand/altboot/main.c:1.12
--- src/sys/arch/sandpoint/stand/altboot/main.c:1.11	Sun Mar 13 01:56:21 2011
+++ src/sys/arch/sandpoint/stand/altboot/main.c	Sun Mar 13 15:23:43 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.11 2011/03/13 01:56:21 phx Exp $ */
+/* $NetBSD: main.c,v 1.12 2011/03/13 15:23:43 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -54,7 +54,8 @@
 	{ quiet,	AB_QUIET },
 	{ verb,	AB_VERBOSE },
 	{ silent,	AB_SILENT },
-	{ debug,	AB_DEBUG }
+	{ debug,	AB_DEBUG },
+	{ altboot,	-1 }
 };
 
 void *bootinfo; /* low memory reserved to pass bootinfo structures */
@@ -89,7 +90,9 @@
 int module_open(struct 

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

2011-03-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Mar 13 15:40:01 UTC 2011

Modified Files:
src/tests/usr.bin/shmif_dumpbus: d_pcap.out.bz2.uue t_basic.sh

Log Message:
Use tcpdump -tt so that TZ doesn't affect the test result.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/shmif_dumpbus/t_basic.sh

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

Modified files:

Index: src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue
diff -u src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue:1.1 src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue:1.2
--- src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue:1.1	Fri Mar 11 10:35:29 2011
+++ src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue	Sun Mar 13 15:40:01 2011
@@ -1,105 +1,104 @@
 begin 644 d_pcap.out.bz2
-M0EIH.3%!62936:%_B\`D4S?@$`00`5_\0@B0``.Y_X@8=^`/#@
-M```#XR1.3@^W$2#!7!AO2GKJ52\/N.]FC:AXWH#QX-T`P]CT#AV]`X=
-MW`.PZ#SZ`?#24VJG_JJ?_ZGJJB#`$P8,@]Z-ZJ52*,E!J$]I5*H8
-M`!,`$J?ZI50GY5@T#(,(R!24II3U1^J--`!Z0VH]3U`J344T\HJ@T,@-`T
-M'A\@^,01]#AJK:C;#1LJV9AK5R3@U+:MJ;1CQMJ;;4VVIN$7-$O4OU*5'
-MY4E1A!A!I$3*(G$^:HLC1!265,DK^%195E3$EJD5:E8)?547RI1'RJ+)#
-M2.03])`3\(H4^N0$X2'WI`3UD!--55:O]Z`$@``
-M`$0```0``D(``!
-M(0```!``
+M0EIH.3%!62936=O8'4!%NW?@$`00`5_\0@B0``.Y_X@8=^\@0```!P
+M```![XY0O$\'N'@P'!M=O2E=5*#[0M50X0`Q@V@,$-!@@$%T!A:`P
+MNATWD`,83$T,0R,)AE/4?O1O52E*@P`$`820U`]4JH-#(#0-`)/5*JFU,:
+MAIDQ--,`(DJ$*EF@!B:9'JH%0J0BI0``:`#P[E![R+ZY%2,JMJ-E3
+M46V)*F;;EK75-KQMI2K*TT6+/K6_NM*C]*2HP@P@TB)E$3A/FJ+(T01D
+MEE3)*^*HLJRIC2U2*M!2L$O=47PI1'PJ+)#2.()^T@)^44*9`3@D/Q2`G
+MVD!-(%K\?\`!`DD`
+M`)```2$
+M0```
 M
 M
 M
 M
-M)T^6S.^WW_'9V]-
-M[S][WO?MV?0('`[NC,S```_8!I\`8/H$DD@`%/CX`4``
-M```!X```H```#G.X```
-M`[N[NZ222#,S,S!F9F9@S,S,P9F9F8222``
-M``!N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,\$`20%C;IWY=3335UG)G@P@2`L;=._+J:::NLY,\$`20$

CVS commit: src/sys/modules/ffs

2011-03-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 13 18:23:30 UTC 2011

Modified Files:
src/sys/modules/ffs: Makefile

Log Message:
Fix source list for ffs module.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/modules/ffs/Makefile

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

Modified files:

Index: src/sys/modules/ffs/Makefile
diff -u src/sys/modules/ffs/Makefile:1.5 src/sys/modules/ffs/Makefile:1.6
--- src/sys/modules/ffs/Makefile:1.5	Sun Mar  6 17:08:36 2011
+++ src/sys/modules/ffs/Makefile	Sun Mar 13 18:23:30 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2011/03/06 17:08:36 bouyer Exp $
+#	$NetBSD: Makefile,v 1.6 2011/03/13 18:23:30 bouyer Exp $
 
 .include ../Makefile.inc
 
@@ -10,11 +10,11 @@
 .PATH:	${S}/ufs/ufs
 SRCS=	ufs_bmap.c ufs_dirhash.c ufs_extattr.c ufs_ihash.c ufs_inode.c \
 	ufs_lookup.c ufs_quota.c ufs_quota1.c ufs_quota2.c ufs_vfsops.c \
-	ufs_vnops.c ufs_wapbl.c
+	ufs_vnops.c ufs_wapbl.c quota2_subr.c
 
 .PATH:	${S}/ufs/ffs
 SRCS+=	ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_subr.c ffs_tables.c \
 	ffs_vfsops.c ffs_vnops.c ffs_snapshot.c \
-	ffs_bswap.c ffs_wapbl.c ffs_appleufs.c
+	ffs_bswap.c ffs_wapbl.c ffs_appleufs.c ffs_quota2.c
 
 .include bsd.kmodule.mk



CVS commit: src/libexec/ld.elf_so

2011-03-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Mar 13 21:08:45 UTC 2011

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

Log Message:
Fill in TLS related fields in dl_iterate_phdr if TLS is supported


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/libexec/ld.elf_so/rtld.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/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.139 src/libexec/ld.elf_so/rtld.c:1.140
--- src/libexec/ld.elf_so/rtld.c:1.139	Wed Mar  9 23:10:07 2011
+++ src/libexec/ld.elf_so/rtld.c	Sun Mar 13 21:08:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.139 2011/03/09 23:10:07 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.140 2011/03/13 21:08:45 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rtld.c,v 1.139 2011/03/09 23:10:07 joerg Exp $);
+__RCSID($NetBSD: rtld.c,v 1.140 2011/03/13 21:08:45 joerg Exp $);
 #endif /* not lint */
 
 #include err.h
@@ -1154,12 +1154,12 @@
 		STAILQ_FIRST(obj-names)-name : obj-path;
 		phdr_info.dlpi_phdr = obj-phdr;
 		phdr_info.dlpi_phnum = obj-phsize / sizeof(obj-phdr[0]);
-#if 1
-		phdr_info.dlpi_tls_modid = 0;
-		phdr_info.dlpi_tls_data = 0;
-#else
+#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
 		phdr_info.dlpi_tls_modid = obj-tlsindex;
 		phdr_info.dlpi_tls_data = obj-tlsinit;
+#else
+		phdr_info.dlpi_tls_modid = 0;
+		phdr_info.dlpi_tls_data = 0;
 #endif
 		phdr_info.dlpi_adds = _rtld_objloads;
 		phdr_info.dlpi_subs = _rtld_objloads - _rtld_objcount;



CVS commit: src/sys/dev/filemon

2011-03-13 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Mar 13 21:26:31 UTC 2011

Modified Files:
src/sys/dev/filemon: filemon_wrapper.c

Log Message:
EJUSTRETURN is expected return from sys_execve()


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/filemon/filemon_wrapper.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/filemon/filemon_wrapper.c
diff -u src/sys/dev/filemon/filemon_wrapper.c:1.1 src/sys/dev/filemon/filemon_wrapper.c:1.2
--- src/sys/dev/filemon/filemon_wrapper.c:1.1	Thu Sep  9 00:10:16 2010
+++ src/sys/dev/filemon/filemon_wrapper.c	Sun Mar 13 21:26:31 2011
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: filemon_wrapper.c,v 1.1 2010/09/09 00:10:16 sjg Exp $);
+__KERNEL_RCSID(0, $NetBSD: filemon_wrapper.c,v 1.2 2011/03/13 21:26:31 sjg Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -82,7 +82,7 @@
 	
 	error = copyinstr(SCARG(uap, path), fname, sizeof(fname), done);
 
-	if ((ret = sys_execve(l, uap, retval)) == 0  error == 0) {
+	if ((ret = sys_execve(l, uap, retval)) == EJUSTRETURN  error == 0) {
 		filemon = filemon_lookup(curproc);
 
 		if (filemon) {



CVS commit: src/sys/kern

2011-03-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 13 23:44:15 UTC 2011

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

Log Message:
fix debugging printfs.


To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.312 src/sys/kern/kern_exec.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_exec.c
diff -u src/sys/kern/kern_exec.c:1.311 src/sys/kern/kern_exec.c:1.312
--- src/sys/kern/kern_exec.c:1.311	Fri Mar  4 17:25:31 2011
+++ src/sys/kern/kern_exec.c	Sun Mar 13 19:44:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.311 2011/03/04 22:25:31 joerg Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.312 2011/03/13 23:44:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.311 2011/03/04 22:25:31 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.312 2011/03/13 23:44:14 christos Exp $);
 
 #include opt_ktrace.h
 #include opt_modular.h
@@ -113,8 +113,11 @@
 
 #ifdef DEBUG_EXEC
 #define DPRINTF(a) printf a
+#define COPYPRINTF(s, a, b) printf(%s, %d: copyout%s @%p %zu\n, __func__, \
+__LINE__, (s), (a), (b))
 #else
 #define DPRINTF(a)
+#define COPYPRINTF(s, a, b)
 #endif /* DEBUG_EXEC */
 
 /*
@@ -588,7 +591,8 @@
 	 */
 	error = pathbuf_copyin(path, pb);
 	if (error) {
-		DPRINTF((execve: pathbuf_copyin path @%p %d\n, path, error));
+		DPRINTF((%s: pathbuf_copyin path @%p %d\n, __func__,
+		path, error));
 		goto clrflg;
 	}
 	pathstring = pathbuf_stringcopy_get(pb);
@@ -621,7 +625,8 @@
 	/* see if we can run it. */
 	if ((error = check_exec(l, pack, pb)) != 0) {
 		if (error != ENOENT) {
-			DPRINTF((execve: check exec failed %d\n, error));
+			DPRINTF((%s: check exec failed %d\n,
+			__func__, error));
 		}
 		goto freehdr;
 	}
@@ -655,7 +660,7 @@
 
 	/* Now get argv  environment */
 	if (args == NULL) {
-		DPRINTF((execve: null args\n));
+		DPRINTF((%s: null args\n, __func__));
 		error = EINVAL;
 		goto bad;
 	}
@@ -667,13 +672,14 @@
 	while (1) {
 		len = argp + ARG_MAX - dp;
 		if ((error = (*fetch_element)(args, i, sp)) != 0) {
-			DPRINTF((execve: fetch_element args %d\n, error));
+			DPRINTF((%s: fetch_element args %d\n,
+			error, __func__));
 			goto bad;
 		}
 		if (!sp)
 			break;
 		if ((error = copyinstr(sp, dp, len, len)) != 0) {
-			DPRINTF((execve: copyinstr args %d\n, error));
+			DPRINTF((%s: copyinstr args %d\n, __func__, error));
 			if (error == ENAMETOOLONG)
 error = E2BIG;
 			goto bad;
@@ -691,13 +697,15 @@
 		while (1) {
 			len = argp + ARG_MAX - dp;
 			if ((error = (*fetch_element)(envs, i, sp)) != 0) {
-DPRINTF((execve: fetch_element env %d\n, error));
+DPRINTF((%s: fetch_element env %d\n,
+__func__, error));
 goto bad;
 			}
 			if (!sp)
 break;
 			if ((error = copyinstr(sp, dp, len, len)) != 0) {
-DPRINTF((execve: copyinstr env %d\n, error));
+DPRINTF((%s: copyinstr env %d\n,
+__func__, error));
 if (error == ENAMETOOLONG)
 	error = E2BIG;
 goto bad;
@@ -750,7 +758,7 @@
 #endif
 
 	if (len  pack.ep_ssize) { /* in effect, compare to initial limit */
-		DPRINTF((execve: stack limit exceeded %zu\n, len));
+		DPRINTF((%s: stack limit exceeded %zu\n, __func__, len));
 		error = ENOMEM;
 		goto bad;
 	}
@@ -810,7 +818,7 @@
 	/* create the new process's VM space by running the vmcmds */
 #ifdef DIAGNOSTIC
 	if (pack.ep_vmcmds.evs_used == 0)
-		panic(execve: no vmcmds);
+		panic(%s: no vmcmds, __func__);
 #endif
 	for (i = 0; i  pack.ep_vmcmds.evs_used  !error; i++) {
 		struct exec_vmcmd *vcp;
@@ -819,9 +827,11 @@
 		if (vcp-ev_flags  VMCMD_RELATIVE) {
 #ifdef DIAGNOSTIC
 			if (base_vcp == NULL)
-panic(execve: relative vmcmd with no base);
+panic(%s: relative vmcmd with no base,
+__func__);
 			if (vcp-ev_flags  VMCMD_BASE)
-panic(execve: illegal base  relative vmcmd);
+panic(%s: illegal base  relative vmcmd,
+__func__);
 #endif
 			vcp-ev_addr += base_vcp-ev_addr;
 		}
@@ -860,7 +870,7 @@
 
 	/* if an error happened, deallocate and punt */
 	if (error) {
-		DPRINTF((execve: vmcmd %zu failed: %d\n, i - 1, error));
+		DPRINTF((%s: vmcmd %zu failed: %d\n, __func__, i - 1, error));
 		goto exec_abort;
 	}
 
@@ -944,7 +954,7 @@
 		pack.ep_path = NULL;
 	}
 	if (error) {
-		DPRINTF((execve: copyargs failed %d\n, error));
+		DPRINTF((%s: copyargs failed %d\n, __func__, error));
 		goto exec_abort;
 	}
 	/* Move the stack back to original point */
@@ -963,8 +973,8 @@
 
 	/* copy out the process's ps_strings structure */
 	if ((error = copyout(aip, (void *)p-p_psstrp, ps_strings_sz)) != 0) {
-		DPRINTF((execve: ps_strings copyout %p-%p size %zu failed\n,
-		   aip, (void *)p-p_psstrp, ps_strings_sz));
+		DPRINTF((%s: ps_strings copyout %p-%p size %zu failed\n,
+		__func__, aip, (void *)p-p_psstrp, ps_strings_sz));
 		goto exec_abort;
 	}