CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 10:46:59 UTC 2011

Modified Files:
src/sys/arch/usermode/usermode: pmap.c

Log Message:
Indent debug aprint_debug()'s


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/usermode/usermode/pmap.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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.32 src/sys/arch/usermode/usermode/pmap.c:1.33
--- src/sys/arch/usermode/usermode/pmap.c:1.32	Wed Aug 24 20:13:56 2011
+++ src/sys/arch/usermode/usermode/pmap.c	Thu Aug 25 10:46:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.32 2011/08/24 20:13:56 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.33 2011/08/25 10:46:59 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.32 2011/08/24 20:13:56 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.33 2011/08/25 10:46:59 reinoud Exp $);
 
 #include opt_memsize.h
 #include opt_kmempages.h
@@ -551,7 +551,7 @@
 {
 	struct pv_entry *pv, *npv;
 
-aprint_debug(pv_release ppn %PRIdPTR, lpn %PRIdPTR\n, ppn, lpn);
+	aprint_debug(pv_release ppn %PRIdPTR, lpn %PRIdPTR\n, ppn, lpn);
 	pv = pv_table[ppn];
 	/*
 	 * If it is the first entry on the list, it is actually
@@ -590,7 +590,7 @@
 	struct pv_entry *pv;
 	int s;
 
-aprint_debug(pmap_remove() called\n);
+	aprint_debug(pmap_remove() called\n);
 
 	slpn = atop(sva); elpn = atop(eva);
 	s = splvm();



CVS commit: src/sys/arch/usermode/include

2011-08-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Aug 25 11:02:58 UTC 2011

Modified Files:
src/sys/arch/usermode/include: bus.h

Log Message:
add bus_addr_t typedef


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/include/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/arch/usermode/include/bus.h
diff -u src/sys/arch/usermode/include/bus.h:1.3 src/sys/arch/usermode/include/bus.h:1.4
--- src/sys/arch/usermode/include/bus.h:1.3	Thu Aug 18 13:47:22 2011
+++ src/sys/arch/usermode/include/bus.h	Thu Aug 25 11:02:57 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.h,v 1.3 2011/08/18 13:47:22 reinoud Exp $ */
+/* $NetBSD: bus.h,v 1.4 2011/08/25 11:02:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -33,6 +33,7 @@
 typedef struct bus_space_tag *bus_space_tag_t;
 
 typedef vaddr_t bus_space_handle_t;
+typedef paddr_t bus_addr_t;
 
 bool bus_space_is_equal(bus_space_tag_t, bus_space_tag_t);
 bool bus_space_handle_is_equal(bus_space_tag_t, bus_space_handle_t,



CVS commit: src/sys/arch/usermode

2011-08-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Aug 25 11:06:29 UTC 2011

Modified Files:
src/sys/arch/usermode/conf: Makefile.usermode files.usermode
majors.usermode
src/sys/arch/usermode/dev: mainbus.c
src/sys/arch/usermode/include: mainbus.h thunk.h
src/sys/arch/usermode/usermode: machdep.c thunk.c

Log Message:
- build thunk code with warnings
- add option SDL which pulls in thunk_sdl code and links the kernel to libSDL
- add an experimental framebuffer driver based on thunk_sdl, enable with:
options SDL
genfb* at mainbus?
wsdisplay* at genfb?
options WS_KERNEL_FG=WSCOL_GREEN
options WSEMUL_VT100
- reserve a major # for wsdisplay
- add thunk_getenv()


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/usermode/conf/Makefile.usermode
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/usermode/conf/files.usermode
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/usermode/conf/majors.usermode
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/usermode/dev/mainbus.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/include/mainbus.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/usermode/include/thunk.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/usermode/usermode/machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/usermode/usermode/thunk.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/usermode/conf/Makefile.usermode
diff -u src/sys/arch/usermode/conf/Makefile.usermode:1.13 src/sys/arch/usermode/conf/Makefile.usermode:1.14
--- src/sys/arch/usermode/conf/Makefile.usermode:1.13	Mon Aug 22 21:45:38 2011
+++ src/sys/arch/usermode/conf/Makefile.usermode	Thu Aug 25 11:06:29 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.usermode,v 1.13 2011/08/22 21:45:38 jmcneill Exp $
+# $NetBSD: Makefile.usermode,v 1.14 2011/08/25 11:06:29 jmcneill Exp $
 
 MACHINE_ARCH=			usermode
 USETOOLS?=			no
@@ -15,12 +15,22 @@
 ## (2) compile settings
 ##
 USERMODE_LIBS=	-lrt
+USERMODE_CPPFLAGS=-U_KERNEL -I/usr/include
+USERMODE_CPPFLAGS+=${CWARNFLAGS} ${NOGCCERROR:D:U-Werror}
 
 DEFCOPTS=	-fno-omit-frame-pointer
 CPPFLAGS+=	-Dusermode
 CPPFLAGS.init_main.c+=	-Dmain=kernmain
 
-CPPFLAGS.thunk.c+=	-U_KERNEL -I/usr/include 
+OPT_SDL=	%SDL%
+.if !empty(OPT_SDL)
+SDL_CFLAGS!=	sdl-config --cflags
+SDL_LIBS!=	sdl-config --libs
+USERMODE_LIBS+=	-Wl,-Bdynamic ${SDL_LIBS}
+.endif
+
+CPPFLAGS.thunk.c+=	${USERMODE_CPPFLAGS}
+CPPFLAGS.thunk_sdl.c+=	${SDL_CFLAGS} ${USERMODE_CPPFLAGS}
 
 ##
 ## (3) libkern and compat
@@ -33,6 +43,10 @@
 ##
 MD_OBJS=	thunk.o
 MD_CFILES=	${USERMODE}/usermode/thunk.c
+.if !empty(OPT_SDL)
+MD_OBJS+=	thunk_sdl.o
+MD_CFILES+=	${USERMODE}/usermode/thunk_sdl.c
+.endif
 MD_SFILES=
 
 ##
@@ -57,6 +71,9 @@
 thunk.o: ${USERMODE}/usermode/thunk.c
 	${CC} ${CPPFLAGS.thunk.c} -c -o $@ ${USERMODE}/usermode/thunk.c
 
+thunk_sdl.o: ${USERMODE}/usermode/thunk_sdl.c
+	${CC} ${CPPFLAGS.thunk_sdl.c} -c -o $@ ${USERMODE}/usermode/thunk_sdl.c
+
 ##
 ## (7) misc settings
 ##

Index: src/sys/arch/usermode/conf/files.usermode
diff -u src/sys/arch/usermode/conf/files.usermode:1.5 src/sys/arch/usermode/conf/files.usermode:1.6
--- src/sys/arch/usermode/conf/files.usermode:1.5	Wed Aug 24 10:59:10 2011
+++ src/sys/arch/usermode/conf/files.usermode	Thu Aug 25 11:06:29 2011
@@ -1,9 +1,10 @@
-# $NetBSD: files.usermode,v 1.5 2011/08/24 10:59:10 jmcneill Exp $
+# $NetBSD: files.usermode,v 1.6 2011/08/25 11:06:29 jmcneill Exp $
 
 maxpartitions 8
 maxusers 8 16 64
 
 defparam opt_memsize.hMEMSIZE
+defflag opt_sdl.hSDL
 
 define	thunkbus { }
 
@@ -26,6 +27,9 @@
 attach	ld at thunkbus with ld_thunkbus
 file	arch/usermode/dev/ld_thunkbus.c		ld_thunkbus
 
+attach	genfb at thunkbus with genfb_thunkbus
+file	arch/usermode/dev/genfb_thunkbus.c	genfb_thunkbus
+
 file	arch/usermode/usermode/copy.c
 file	arch/usermode/usermode/machdep.c
 file	arch/usermode/usermode/pmap.c

Index: src/sys/arch/usermode/conf/majors.usermode
diff -u src/sys/arch/usermode/conf/majors.usermode:1.2 src/sys/arch/usermode/conf/majors.usermode:1.3
--- src/sys/arch/usermode/conf/majors.usermode:1.2	Fri Aug 12 12:59:13 2011
+++ src/sys/arch/usermode/conf/majors.usermode	Thu Aug 25 11:06:29 2011
@@ -1,4 +1,4 @@
-# $NetBSD: majors.usermode,v 1.2 2011/08/12 12:59:13 jmcneill Exp $
+# $NetBSD: majors.usermode,v 1.3 2011/08/25 11:06:29 jmcneill Exp $
 
 device-major	cons		char 0
 device-major	ctty		char 1
@@ -10,4 +10,5 @@
 device-major	log		char 7
 device-major	com		char 8			com
 device-major	md		char 24	block 17	md
+device-major	wsdisplay	char 47			wsdisplay
 device-major	ld		char 69 block 19	ld

Index: src/sys/arch/usermode/dev/mainbus.c
diff -u src/sys/arch/usermode/dev/mainbus.c:1.4 src/sys/arch/usermode/dev/mainbus.c:1.5
--- src/sys/arch/usermode/dev/mainbus.c:1.4	Fri Aug 12 12:59:13 2011
+++ src/sys/arch/usermode/dev/mainbus.c	Thu Aug 25 11:06:29 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.4 2011/08/12 12:59:13 jmcneill Exp $ 

CVS commit: src/sys/arch/usermode

2011-08-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Aug 25 11:45:26 UTC 2011

Added Files:
src/sys/arch/usermode/dev: genfb_thunkbus.c
src/sys/arch/usermode/usermode: thunk_sdl.c

Log Message:
- build thunk code with warnings
- add option SDL which pulls in thunk_sdl code and links the kernel to libSDL
- add an experimental framebuffer driver based on thunk_sdl, enable with:
options SDL
genfb* at mainbus?
wsdisplay* at genfb?
options WS_KERNEL_FG=WSCOL_GREEN
options WSEMUL_VT100
- reserve a major # for wsdisplay
- add thunk_getenv()


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/usermode/dev/genfb_thunkbus.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/usermode/usermode/thunk_sdl.c

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

Added files:

Index: src/sys/arch/usermode/dev/genfb_thunkbus.c
diff -u /dev/null src/sys/arch/usermode/dev/genfb_thunkbus.c:1.1
--- /dev/null	Thu Aug 25 11:45:26 2011
+++ src/sys/arch/usermode/dev/genfb_thunkbus.c	Thu Aug 25 11:45:25 2011
@@ -0,0 +1,156 @@
+/* $NetBSD: genfb_thunkbus.c,v 1.1 2011/08/25 11:45:25 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: genfb_thunkbus.c,v 1.1 2011/08/25 11:45:25 jmcneill Exp $);
+
+#include sys/param.h
+#include sys/proc.h
+#include sys/systm.h
+#include sys/device.h
+
+#include dev/wsfb/genfbvar.h
+
+#include machine/mainbus.h
+#include machine/thunk.h
+
+#ifdef _KERNEL_OPT
+#include opt_sdl.h
+#endif
+
+#if !defined(SDL)
+#error genfb_thunkbus requires options SDL
+#endif
+
+#define GENFB_THUNKBUS_WIDTH	640
+#define	GENFB_THUNKBUS_HEIGHT	480
+#define	GENFB_THUNKBUS_DEPTH	32
+#define	GENFB_THUNKBUS_FBSIZE	\
+	(GENFB_THUNKBUS_WIDTH * GENFB_THUNKBUS_HEIGHT * (GENFB_THUNKBUS_DEPTH / 8))
+
+static int	genfb_thunkbus_match(device_t, cfdata_t, void *);
+static void	genfb_thunkbus_attach(device_t, device_t, void *);
+static int	genfb_thunkbus_ioctl(void *, void *, u_long, void *, int, lwp_t *);
+static paddr_t	genfb_thunkbus_mmap(void *, void *, off_t, int);
+
+int		genfb_thunkbus_cnattach(void);
+
+struct genfb_thunkbus_softc {
+	struct genfb_softc	sc_gen;
+};
+
+static void *	genfb_thunkbus_fbaddr;
+
+CFATTACH_DECL_NEW(genfb_thunkbus, sizeof(struct genfb_thunkbus_softc),
+genfb_thunkbus_match, genfb_thunkbus_attach, NULL, NULL);
+
+static int
+genfb_thunkbus_match(device_t parent, cfdata_t match, void *opaque)
+{
+	struct thunkbus_attach_args *taa = opaque;
+
+	if (taa-taa_type != THUNKBUS_TYPE_GENFB)
+		return 0;
+
+	if (thunk_getenv(DISPLAY) == NULL)
+		return 0;
+
+	return 1;
+}
+
+static void
+genfb_thunkbus_attach(device_t parent, device_t self, void *opaque)
+{
+	struct genfb_thunkbus_softc *sc = device_private(self);
+	struct genfb_ops ops;
+	prop_dictionary_t dict = device_properties(self);
+
+	aprint_naive(\n);
+	aprint_normal(\n);
+
+	sc-sc_gen.sc_dev = self;
+	sc-sc_gen.sc_fbaddr = genfb_thunkbus_fbaddr;
+
+	prop_dictionary_set_bool(dict, is_console, true);
+	prop_dictionary_set_uint32(dict, width, GENFB_THUNKBUS_WIDTH);
+	prop_dictionary_set_uint32(dict, height, GENFB_THUNKBUS_HEIGHT);
+	prop_dictionary_set_uint8(dict, depth, GENFB_THUNKBUS_DEPTH);
+	prop_dictionary_set_uint16(dict, linebytes,
+	GENFB_THUNKBUS_WIDTH * (GENFB_THUNKBUS_DEPTH / 8));
+	prop_dictionary_set_uint64(dict, address, 0);
+	prop_dictionary_set_uint64(dict, virtual_address,
+	(vaddr_t)sc-sc_gen.sc_fbaddr);
+
+	genfb_init(sc-sc_gen);
+
+	memset(ops, 0, sizeof(ops));
+	ops.genfb_ioctl = 

CVS commit: src/sys/arch/usermode/include

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 14:24:48 UTC 2011

Modified Files:
src/sys/arch/usermode/include: pcb.h

Log Message:
Add trapframe and extent pcb for NetBSD/usermode; both mere dummies since
there are no traps delivered nor a process has ever been started...


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/include/pcb.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/usermode/include/pcb.h
diff -u src/sys/arch/usermode/include/pcb.h:1.3 src/sys/arch/usermode/include/pcb.h:1.4
--- src/sys/arch/usermode/include/pcb.h:1.3	Fri Aug 12 00:57:24 2011
+++ src/sys/arch/usermode/include/pcb.h	Thu Aug 25 14:24:48 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pcb.h,v 1.3 2011/08/12 00:57:24 jmcneill Exp $ */
+/* $NetBSD: pcb.h,v 1.4 2011/08/25 14:24:48 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -32,9 +32,23 @@
 #include sys/cdefs.h
 #include sys/ucontext.h
 
+/*
+ * Trap frame.  Pushed onto the kernel stack on a trap (synchronous exception).
+ * XXX move to frame.h?
+ */
+
+typedef struct trapframe {
+	int		tf_reason;	/* XXX unused */
+	vaddr_t		tf_pc;		/* return address */
+	uintptr_t	tf_out[8];	/* to transport info */
+} trapframe_t;
+
+
 struct pcb {
 	ucontext_t	pcb_ucp;
 	bool		pcb_needfree;
+	struct trapframe *pcb_tf;	/* XXX */
+	void *		pcb_onfault;	/* on fault handler */
 };
 
 #endif /* !_ARCH_USERMODE_INCLUDE_PCB_H */



CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 14:37:57 UTC 2011

Modified Files:
src/sys/arch/usermode/usermode: pmap.c trap.c

Log Message:
Implement first generation of memory access handler for the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/usermode/usermode/pmap.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/usermode/usermode/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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.33 src/sys/arch/usermode/usermode/pmap.c:1.34
--- src/sys/arch/usermode/usermode/pmap.c:1.33	Thu Aug 25 10:46:59 2011
+++ src/sys/arch/usermode/usermode/pmap.c	Thu Aug 25 14:37:57 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.33 2011/08/25 10:46:59 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.34 2011/08/25 14:37:57 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.33 2011/08/25 10:46:59 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.34 2011/08/25 14:37:57 reinoud Exp $);
 
 #include opt_memsize.h
 #include opt_kmempages.h
@@ -94,6 +94,8 @@
 static void	pv_free(struct pv_entry *pv);
 static void	pmap_deferred_init(void);
 
+extern void	setup_signal_handlers(void);
+
 /* exposed to signal handler */
 vaddr_t kmem_k_start, kmem_k_end;
 vaddr_t kmem_ext_start, kmem_ext_end;
@@ -164,7 +166,7 @@
 	mpos += kmem_len;
 	kmem_ext_end   = mpos;
 
-#if 0
+#if 1
 	/* protect complete UVM area (---) */
 	addr = thunk_mmap((void*) mem_uvm,
 		uvm_len,
@@ -319,6 +321,8 @@
 	/* create pmap pool */
 	pool_init(pmap_pool, sizeof(struct pmap), 0, 0, 0,
 	pmappool, NULL, IPL_NONE);
+
+	setup_signal_handlers();
 }
 
 pmap_t
@@ -661,7 +665,7 @@
 void
 pmap_kremove(vaddr_t va, vsize_t size)
 {
-aprint_debug(pmap_kremove not implented\n');
+	pmap_remove(pmap_kernel(), va, va + size);
 }
 
 void

Index: src/sys/arch/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.2 src/sys/arch/usermode/usermode/trap.c:1.3
--- src/sys/arch/usermode/usermode/trap.c:1.2	Wed Oct 21 16:07:00 2009
+++ src/sys/arch/usermode/usermode/trap.c	Thu Aug 25 14:37:57 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.2 2009/10/21 16:07:00 snj Exp $ */
+/* $NetBSD: trap.c,v 1.3 2011/08/25 14:37:57 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -27,14 +27,127 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.2 2009/10/21 16:07:00 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.3 2011/08/25 14:37:57 reinoud Exp $);
 
 #include sys/types.h
 #include sys/param.h
 #include sys/systm.h
 #include sys/proc.h
+#include uvm/uvm_extern.h
+#include machine/cpu.h
+//#include machine/ctlreg.h
+//#include machine/trap.h
+//#include machine/instr.h
+#include machine/pcb.h
+#include machine/pmap.h
+//#include machine/userret.h
+#include machine/thunk.h
+
+
+void setup_signal_handlers(void);
+static void mem_access_handler(int sig, siginfo_t *info, void *ctx);
+
+static struct sigaction sa;
+extern int errno;
 
 void
 startlwp(void *arg)
 {
+
+}
+
+void
+setup_signal_handlers(void)
+{
+	sigemptyset(sa.sa_mask);
+	sa.sa_flags = SA_RESTART | SA_SIGINFO;
+	sa.sa_sigaction = mem_access_handler;
+	if (thunk_sigaction(SIGSEGV, sa, NULL) == -1)
+		panic(couldn't register SIGSEGV handler : %d, errno);
+	if (thunk_sigaction(SIGBUS, sa, NULL) == -1)
+		panic(couldn't register SIGBUS handler : %d, errno);
+}
+
+static struct trapframe kernel_tf;
+
+static void
+mem_access_handler(int sig, siginfo_t *info, void *ctx)
+{
+	struct proc *p;
+	struct lwp *l;
+	struct pcb *pcb;
+	struct vmspace *vm;
+	struct vm_map *vm_map;
+	struct trapframe *tf;
+	vm_prot_t atype;
+	vaddr_t va;
+	vaddr_t onfault;
+	int kmem, rv;
+
+printf(trap\n);
+	if ((info-si_signo == SIGSEGV) || (info-si_signo == SIGBUS)) {
+		l = curlwp;
+		p = l-l_proc;
+		pcb = lwp_getpcb(l);
+		onfault = (vaddr_t) pcb-pcb_onfault;
+		vm = p-p_vmspace;
+
+#if 0
+		printf(SIGSEGV or SIGBUS!\n);
+		printf(\tsi_signo = %d\n, info-si_signo);
+		printf(\tsi_errno = %d\n, info-si_errno);
+		printf(\tsi_code  = %d\n, info-si_code);
+		if (info-si_code == SEGV_MAPERR) {
+			printf(\t\tSEGV_MAPERR\n);
+		}
+		if (info-si_code == SEGV_ACCERR) {
+			printf(\t\tSEGV_ACCERR\n);
+		}
+		if (info-si_code == BUS_ADRALN) {
+			printf(\t\tBUS_ADRALN\n);
+		}
+		if (info-si_code == BUS_ADRERR) {
+			printf(\t\tBUS_ADRERR\n);
+		}
+		if (info-si_code == BUS_OBJERR) {
+			printf(\t\tBUS_OBJERR\n);
+		}
+		printf(\tsi_addr = %p\n, info-si_addr);
+		printf(\tsi_trap = %d\n, info-si_trap);
+#endif
+
+		va = (vaddr_t) info-si_addr;
+		va = trunc_page(va);
+
+		kmem = 1;
+		vm_map = kernel_map;
+		if ((va = VM_MIN_ADDRESS)  (va = VM_MAXUSER_ADDRESS)) {
+			kmem = 0;
+			vm_map = vm-vm_map;
+		}
+
+		pcb-pcb_onfault = NULL;
+		/* XXX 

CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 14:38:56 UTC 2011

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

Log Message:
Update and claim copyright


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/usermode/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/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.3 src/sys/arch/usermode/usermode/trap.c:1.4
--- src/sys/arch/usermode/usermode/trap.c:1.3	Thu Aug 25 14:37:57 2011
+++ src/sys/arch/usermode/usermode/trap.c	Thu Aug 25 14:38:56 2011
@@ -1,7 +1,7 @@
-/* $NetBSD: trap.c,v 1.3 2011/08/25 14:37:57 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.4 2011/08/25 14:38:56 reinoud Exp $ */
 
 /*-
- * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
+ * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.3 2011/08/25 14:37:57 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.4 2011/08/25 14:38:56 reinoud Exp $);
 
 #include sys/types.h
 #include sys/param.h



CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 15:02:54 UTC 2011

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

Log Message:
Check if we pee'd outside the box!


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/usermode/usermode/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/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.4 src/sys/arch/usermode/usermode/trap.c:1.5
--- src/sys/arch/usermode/usermode/trap.c:1.4	Thu Aug 25 14:38:56 2011
+++ src/sys/arch/usermode/usermode/trap.c	Thu Aug 25 15:02:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.4 2011/08/25 14:38:56 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.5 2011/08/25 15:02:54 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.4 2011/08/25 14:38:56 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.5 2011/08/25 15:02:54 reinoud Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -125,6 +125,9 @@
 			kmem = 0;
 			vm_map = vm-vm_map;
 		}
+		if ((va  VM_MIN_ADDRESS) || (va  VM_MAX_ADDRESS)) {
+			panic(peeing outside the box!);
+		}
 
 		pcb-pcb_onfault = NULL;
 		/* XXX atype?? */



CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 15:06:09 UTC 2011

Modified Files:
src/sys/arch/usermode/usermode: pmap.c

Log Message:
For all virtual to logical page translations we need to substract
VM_MIN_ADDRESS first! I forgot to add this to pmap_remove().

Now we are here, mark the lines with V-L or L-V.l


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/usermode/usermode/pmap.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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.34 src/sys/arch/usermode/usermode/pmap.c:1.35
--- src/sys/arch/usermode/usermode/pmap.c:1.34	Thu Aug 25 14:37:57 2011
+++ src/sys/arch/usermode/usermode/pmap.c	Thu Aug 25 15:06:09 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.34 2011/08/25 14:37:57 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.35 2011/08/25 15:06:09 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.34 2011/08/25 14:37:57 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.35 2011/08/25 15:06:09 reinoud Exp $);
 
 #include opt_memsize.h
 #include opt_kmempages.h
@@ -424,7 +424,7 @@
 pmap_page_activate(struct pv_entry *pv)
 {
 	paddr_t pa = pv-pv_ppn * PAGE_SIZE;
-	vaddr_t va = pv-pv_lpn * PAGE_SIZE + VM_MIN_ADDRESS; /* V-A */
+	vaddr_t va = pv-pv_lpn * PAGE_SIZE + VM_MIN_ADDRESS; /* L-V */
 	void *addr;
 
 	addr = thunk_mmap((void *) va, PAGE_SIZE, pv-pv_mmap_ppl,
@@ -482,7 +482,7 @@
 
 	/* to page numbers */
 	ppn = atop(pa);
-	lpn = atop(va - VM_MIN_ADDRESS);	/* V-A */
+	lpn = atop(va - VM_MIN_ADDRESS);	/* V-L */
 #ifdef DIAGNOSTIC
 	if ((va  VM_MIN_ADDRESS) || (va  VM_MAX_ADDRESS))
 		panic(pmap_do_enter: invalid va isued\n);
@@ -594,9 +594,12 @@
 	struct pv_entry *pv;
 	int s;
 
-	aprint_debug(pmap_remove() called\n);
+	slpn = atop(sva - VM_MIN_ADDRESS);	/* V-L */
+ 	elpn = atop(eva - VM_MIN_ADDRESS);	/* V-L */
+
+	aprint_debug(pmap_remove() called from 
+		lpn %PRIdPTR to lpn %PRIdPTR\n, slpn, elpn);
 
-	slpn = atop(sva); elpn = atop(eva);
 	s = splvm();
 	for (lpn = slpn; lpn  elpn; lpn++) {
 		pv = pmap-pm_entries[lpn];
@@ -613,7 +616,6 @@
 		}
 	}
 	splx(s);
-
 }
 
 void
@@ -641,7 +643,7 @@
 
 	/* TODO protect against roque values */
 	aprint_debug(pmap_extract: extracting va %p\n, (void *) va);
-	pv = pmap-pm_entries[atop(va - VM_MIN_ADDRESS)]; /* V-A */
+	pv = pmap-pm_entries[atop(va - VM_MIN_ADDRESS)]; /* V-L */
 
 	if (pv == NULL)
 		return false;



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

2011-08-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 25 15:06:10 UTC 2011

Modified Files:
src/sys/arch/x86/include: bus_defs.h

Log Message:
Add to x86 bus_space_tag_t a member, bst_exists, that tells whether a
routine is overridden by this tag or by any ancestral tag.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/include/bus_defs.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/x86/include/bus_defs.h
diff -u src/sys/arch/x86/include/bus_defs.h:1.1 src/sys/arch/x86/include/bus_defs.h:1.2
--- src/sys/arch/x86/include/bus_defs.h:1.1	Fri Jul  1 17:10:01 2011
+++ src/sys/arch/x86/include/bus_defs.h	Thu Aug 25 15:06:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_defs.h,v 1.1 2011/07/01 17:10:01 dyoung Exp $	*/
+/*	$NetBSD: bus_defs.h,v 1.2 2011/08/25 15:06:10 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -86,7 +86,12 @@
 struct bus_space_tag {
 	int	bst_type;
 	bus_space_tag_tbst_super;
+	/* bst_present: bitmap indicating overrides present (1) in *this* tag,
+	 * bst_exists: bitmap indicating overrides present (1) in *this* tag
+	 * or in an ancestor's tag (follow bst_super to ancestors)
+	 */
 	uint64_tbst_present;
+	uint64_tbst_exists;
 	const struct bus_space_overrides	*bst_ov;
 	void	*bst_ctx;
 };



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

2011-08-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 25 15:08:49 UTC 2011

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

Log Message:
Initialize bst_exists in bus_space_tag_create(9).  Use it to avoid
walking the chain of ancestor tags to see if a bus_space(9) routine was
overridden.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x86/x86/bus_space.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/bus_space.c
diff -u src/sys/arch/x86/x86/bus_space.c:1.36 src/sys/arch/x86/x86/bus_space.c:1.37
--- src/sys/arch/x86/x86/bus_space.c:1.36	Mon Jul 25 20:34:07 2011
+++ src/sys/arch/x86/x86/bus_space.c	Thu Aug 25 15:08:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.36 2011/07/25 20:34:07 dyoung Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.37 2011/08/25 15:08:49 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.36 2011/07/25 20:34:07 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.37 2011/08/25 15:08:49 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -161,7 +161,9 @@
 	bus_space_tag_t it;
 	int error;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_MAP) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_MAP) == 0)
 			continue;
 		return (*it-bst_ov-ov_space_map)(it-bst_ctx, t, bpa, size,
@@ -187,7 +189,9 @@
 	bus_size_t size;
 	bus_space_tag_t it;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_RESERVATION_MAP) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_RESERVATION_MAP) == 0)
 			continue;
 		return (*it-bst_ov-ov_space_reservation_map)(it-bst_ctx, t,
@@ -251,7 +255,9 @@
 	int error;
 	bus_space_tag_t it;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_RESERVE) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_RESERVE) == 0)
 			continue;
 		return (*it-bst_ov-ov_space_reserve)(it-bst_ctx, t,
@@ -298,7 +304,9 @@
 	int error;
 	bus_space_tag_t it;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_RESERVE_SUBREGION) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_RESERVE_SUBREGION) ==
 		0)
 			continue;
@@ -350,7 +358,9 @@
 	struct extent *ex;
 	bus_space_tag_t it;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_RELEASE) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_RELEASE) == 0)
 			continue;
 		(*it-bst_ov-ov_space_release)(it-bst_ctx, t, bsr);
@@ -386,7 +396,9 @@
 	bus_space_tag_t it;
 	int error;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_ALLOC) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_ALLOC) == 0)
 			continue;
 		return (*it-bst_ov-ov_space_alloc)(it-bst_ctx, t,
@@ -572,7 +584,9 @@
 {
 	bus_space_tag_t it;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_RESERVATION_UNMAP) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_RESERVATION_UNMAP) ==
 		0)
 			continue;
@@ -592,7 +606,9 @@
 	bus_space_reservation_t bsr;
 	bus_space_tag_t it;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_UNMAP) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_UNMAP) == 0)
 			continue;
 		(*it-bst_ov-ov_space_unmap)(it-bst_ctx, t, bsh, size);
@@ -610,7 +626,9 @@
 {
 	bus_space_tag_t it;
 
-	for (it = t; it != NULL; it = it-bst_super) {
+	if ((t-bst_exists  BUS_SPACE_OVERRIDE_FREE) == 0)
+		;	/* skip override */
+	else for (it = t; it != NULL; it = it-bst_super) {
 		if ((it-bst_present  BUS_SPACE_OVERRIDE_FREE) == 0)
 			continue;
 		(*it-bst_ov-ov_space_free)(it-bst_ctx, t, bsh, size);
@@ -933,6 +951,7 @@
 	}
 
 	bst-bst_ov = ov;
+	bst-bst_exists = obst-bst_exists | present;
 	bst-bst_present = present;
 	bst-bst_ctx = ctx;
 



CVS commit: src/common/lib/libppath

2011-08-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 25 15:12:38 UTC 2011

Modified Files:
src/common/lib/libppath: ppath.3 ppath_bool.3 ppath_number.3
ppath_object.3

Log Message:
Fix Dt argument, remove trailing whitespace, fix formatting nit.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libppath/ppath.3 \
src/common/lib/libppath/ppath_bool.3 \
src/common/lib/libppath/ppath_number.3 \
src/common/lib/libppath/ppath_object.3

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

Modified files:

Index: src/common/lib/libppath/ppath.3
diff -u src/common/lib/libppath/ppath.3:1.1 src/common/lib/libppath/ppath.3:1.2
--- src/common/lib/libppath/ppath.3:1.1	Thu Aug 25 14:55:36 2011
+++ src/common/lib/libppath/ppath.3	Thu Aug 25 15:12:38 2011
@@ -1,5 +1,5 @@
-.\	$NetBSD: ppath.3,v 1.1 2011/08/25 14:55:36 dyoung Exp $
-.\	$Id: ppath.3,v 1.1 2011/08/25 14:55:36 dyoung Exp $
+.\	$NetBSD: ppath.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
+.\	$Id: ppath.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -29,7 +29,7 @@
 .\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
 .Dd August 24, 2011
-.Dt ppath 3
+.Dt PPATH 3
 .Os
 .Sh NAME
 .Nm ppath ,
@@ -125,7 +125,7 @@
 The abstract function
 .Fn E
 evaluates
-a property-list path against a 
+a property-list path against a
 .Vt prop_object_t ,
 .Va o ,
 to yield a
@@ -169,7 +169,6 @@
 to paths in a file system, where property arrays and dictionaries
 correspond to directories, and all other property types correspond
 to files.
-.Pp
 .Sh DATA TYPES
 .Nm
 provides two opaque types:
@@ -177,13 +176,13 @@
 .It Vt ppath_component_t
 A property-list path component: a single key or index.
 .Nm
-counts references to a 
+counts references to a
 .Vt ppath_component_t
 and reclaims its storage when there are no more references.
 .It Vt ppath_t
 An array of zero or more property-list path components.
 .Nm
-counts references to a 
+counts references to a
 .Vt ppath_t
 and reclaims its storage when there are no more references.
 .El
@@ -251,13 +250,13 @@
 is the empty path or
 .Dv NULL ,
 return
-.Dv NULL.
+.Dv NULL .
 Otherwise, remove the last component from
 .Fa p
 and return
 .Fa p ,
 and if
-.Fa pcp 
+.Fa pcp
 is not
 .Dv NULL ,
 write the removed component to
Index: src/common/lib/libppath/ppath_bool.3
diff -u src/common/lib/libppath/ppath_bool.3:1.1 src/common/lib/libppath/ppath_bool.3:1.2
--- src/common/lib/libppath/ppath_bool.3:1.1	Thu Aug 25 14:55:36 2011
+++ src/common/lib/libppath/ppath_bool.3	Thu Aug 25 15:12:38 2011
@@ -1,5 +1,5 @@
-.\	$NetBSD: ppath_bool.3,v 1.1 2011/08/25 14:55:36 dyoung Exp $
-.\	$Id: ppath_bool.3,v 1.1 2011/08/25 14:55:36 dyoung Exp $
+.\	$NetBSD: ppath_bool.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
+.\	$Id: ppath_bool.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -29,7 +29,7 @@
 .\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
 .Dd August 24, 2011
-.Dt ppath_bool 3
+.Dt PPATH_BOOL 3
 .Os
 .Sh NAME
 .Nm ppath_bool ,
@@ -212,8 +212,8 @@
 and
 .Fn ppath_copyset_bool
 return
-.Er ENOMEM 
-if there was insufficient memory to complete the operation.  
+.Er ENOMEM
+if there was insufficient memory to complete the operation.
 .El
 .Sh SEE ALSO
 .\ Cross-references should be ordered by section (low to high), then in
Index: src/common/lib/libppath/ppath_number.3
diff -u src/common/lib/libppath/ppath_number.3:1.1 src/common/lib/libppath/ppath_number.3:1.2
--- src/common/lib/libppath/ppath_number.3:1.1	Thu Aug 25 14:55:36 2011
+++ src/common/lib/libppath/ppath_number.3	Thu Aug 25 15:12:38 2011
@@ -1,5 +1,5 @@
-.\	$NetBSD: ppath_number.3,v 1.1 2011/08/25 14:55:36 dyoung Exp $
-.\	$Id: ppath_number.3,v 1.1 2011/08/25 14:55:36 dyoung Exp $
+.\	$NetBSD: ppath_number.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
+.\	$Id: ppath_number.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -29,7 +29,7 @@
 .\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
 .Dd August 24, 2011
-.Dt ppath_number 3
+.Dt PPATH_NUMBER 3
 .Os
 .Sh NAME
 .Nm ppath_number ,
@@ -257,8 +257,8 @@
 and
 .Fn ppath_copyset_uint64
 return
-.Er ENOMEM 
-if there was insufficient memory to complete the operation.  
+.Er ENOMEM
+if there was insufficient memory to complete the operation.
 .El
 .Sh SEE ALSO
 .\ Cross-references should be ordered by section (low to high), then in
Index: src/common/lib/libppath/ppath_object.3
diff -u src/common/lib/libppath/ppath_object.3:1.1 src/common/lib/libppath/ppath_object.3:1.2
--- src/common/lib/libppath/ppath_object.3:1.1	Thu Aug 25 14:55:36 2011
+++ src/common/lib/libppath/ppath_object.3	Thu Aug 25 15:12:38 2011
@@ -1,5 +1,5 @@
-.\	$NetBSD: ppath_object.3,v 1.1 2011/08/25 14:55:36 dyoung Exp $
-.\	$Id: ppath_object.3,v 1.1 2011/08/25 

CVS commit: src/sys/rump/net/lib/libshmif

2011-08-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 25 15:14:19 UTC 2011

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Use VMEM_ADDR_MIN and VMEM_ADDR_MAX.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/net/lib/libshmif/if_shmem.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/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.41 src/sys/rump/net/lib/libshmif/if_shmem.c:1.42
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.41	Tue Aug 23 22:00:57 2011
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Thu Aug 25 15:14:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.41 2011/08/23 22:00:57 dyoung Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.42 2011/08/25 15:14:19 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_shmem.c,v 1.41 2011/08/23 22:00:57 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_shmem.c,v 1.42 2011/08/25 15:14:19 dyoung Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -293,8 +293,8 @@
 			return error;
 	}
 
-	unit = vmem_xalloc(shmif_units, 1, 0, 0, 0, 0, ~(vmem_addr_t)0,
-	VM_INSTANTFIT | VM_SLEEP) - 1;
+	unit = vmem_xalloc(shmif_units, 1, 0, 0, 0,
+	VMEM_ADDR_MIN, VMEM_ADDR_MAX, VM_INSTANTFIT | VM_SLEEP) - 1;
 
 	if ((error = allocif(unit, sc)) != 0) {
 		if (path)



CVS commit: src/common/lib/libppath

2011-08-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 25 15:14:43 UTC 2011

Modified Files:
src/common/lib/libppath: ppath_bool.3

Log Message:
Fix Nd argument.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libppath/ppath_bool.3

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

Modified files:

Index: src/common/lib/libppath/ppath_bool.3
diff -u src/common/lib/libppath/ppath_bool.3:1.2 src/common/lib/libppath/ppath_bool.3:1.3
--- src/common/lib/libppath/ppath_bool.3:1.2	Thu Aug 25 15:12:38 2011
+++ src/common/lib/libppath/ppath_bool.3	Thu Aug 25 15:14:43 2011
@@ -1,5 +1,5 @@
-.\	$NetBSD: ppath_bool.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
-.\	$Id: ppath_bool.3,v 1.2 2011/08/25 15:12:38 wiz Exp $
+.\	$NetBSD: ppath_bool.3,v 1.3 2011/08/25 15:14:43 wiz Exp $
+.\	$Id: ppath_bool.3,v 1.3 2011/08/25 15:14:43 wiz Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -39,7 +39,7 @@
 .Nm ppath_set_bool ,
 .Nm ppath_get_bool ,
 .Nm ppath_delete_bool
-.Nd integer property path operations
+.Nd boolean property path operations
 .Sh LIBRARY
 .Lb libppath
 .Sh SYNOPSIS



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

2011-08-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 25 15:29:05 UTC 2011

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

Log Message:
Set-list repair: add 'nls' tag to some files that need it, sort some
firmware files, move some graphics-adapter firmware into the syspkg
base-firmware-root.


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

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.947 src/distrib/sets/lists/base/mi:1.948
--- src/distrib/sets/lists/base/mi:1.947	Mon Aug 15 15:13:59 2011
+++ src/distrib/sets/lists/base/mi	Thu Aug 25 15:29:04 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.947 2011/08/15 15:13:59 wiz Exp $
+# $NetBSD: mi,v 1.948 2011/08/25 15:29:04 dyoung Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -140,21 +140,21 @@
 ./libdata/firmware/if_iwi/ipw2200-sniffer.fw	base-firmware-root
 ./libdata/firmware/if_iwn			base-firmware-root
 ./libdata/firmware/if_iwn/LICENSE.iwlwifi-1000-ucode	base-firmware-root
-./libdata/firmware/if_iwn/README.iwlwifi-1000-ucode	base-firmware-root
-./libdata/firmware/if_iwn/iwlwifi-1000-3.ucode	base-firmare-root
 ./libdata/firmware/if_iwn/LICENSE.iwlwifi-4965-ucode	base-firmware-root
+./libdata/firmware/if_iwn/LICENSE.iwlwifi-5000-ucode	base-firmware-root
+./libdata/firmware/if_iwn/LICENSE.iwlwifi-5150-ucode	base-firmware-root
+./libdata/firmware/if_iwn/LICENSE.iwlwifi-6000-ucode	base-firmware-root
+./libdata/firmware/if_iwn/README.iwlwifi-1000-ucode	base-firmware-root
 ./libdata/firmware/if_iwn/README.iwlwifi-4965-ucode	base-firmware-root
+./libdata/firmware/if_iwn/README.iwlwifi-5000-ucode	base-firmware-root
+./libdata/firmware/if_iwn/README.iwlwifi-5150-ucode	base-firmware-root
+./libdata/firmware/if_iwn/README.iwlwifi-6000-ucode	base-firmware-root
+./libdata/firmware/if_iwn/iwlwifi-1000-3.ucode	base-firmware-root
 ./libdata/firmware/if_iwn/iwlwifi-4965-1.ucode	base-obsolete		obsolete
 ./libdata/firmware/if_iwn/iwlwifi-4965-2.ucode	base-firmware-root
-./libdata/firmware/if_iwn/LICENSE.iwlwifi-5000-ucode	base-firmware-root
-./libdata/firmware/if_iwn/README.iwlwifi-5000-ucode	base-firmware-root
 ./libdata/firmware/if_iwn/iwlwifi-5000-1.ucode	base-obsolete		obsolete
 ./libdata/firmware/if_iwn/iwlwifi-5000-2.ucode	base-firmware-root
-./libdata/firmware/if_iwn/LICENSE.iwlwifi-5150-ucode	base-firmware-root
-./libdata/firmware/if_iwn/README.iwlwifi-5150-ucode	base-firmware-root
 ./libdata/firmware/if_iwn/iwlwifi-5150-2.ucode	base-firmware-root
-./libdata/firmware/if_iwn/LICENSE.iwlwifi-6000-ucode	base-firmware-root
-./libdata/firmware/if_iwn/README.iwlwifi-6000-ucode	base-firmware-root
 ./libdata/firmware/if_iwn/iwlwifi-6000-4.ucode	base-firmware-root
 ./libdata/firmware/if_iwn/LICENSE.iwlwifi-6000g2a-ucode	base-firmware-root
 ./libdata/firmware/if_iwn/README.iwlwifi-6000g2a-ucode	base-firmware-root
@@ -168,10 +168,10 @@
 ./libdata/firmware/if_otus/otus-main		base-firmware-root
 ./libdata/firmware/if_wpi			base-firmware-root
 ./libdata/firmware/if_wpi/LICENSE.ipw3945-ucode	base-obsolete	obsolete
-./libdata/firmware/if_wpi/README.ipw3945-ucode	base-obsolete	obsolete
-./libdata/firmware/if_wpi/ipw3945.ucode		base-obsolete	obsolete
 ./libdata/firmware/if_wpi/LICENSE.iwlwifi-3945-ucode	base-firmware-root
+./libdata/firmware/if_wpi/README.ipw3945-ucode	base-obsolete	obsolete
 ./libdata/firmware/if_wpi/README.iwlwifi-3945-ucode	base-firmware-root
+./libdata/firmware/if_wpi/ipw3945.ucode		base-obsolete	obsolete
 ./libdata/firmware/if_wpi/iwlwifi-3945.ucode		base-firmware-root
 ./libdata/firmware/ralbase-firmware-root
 ./libdata/firmware/ral/ral-license		base-firmware-root
@@ -946,49 +946,49 @@
 ./usr/libdata/debug/usr/libexec/uucp		base-obsolete		obsolete
 ./usr/libdata/debug/usr/mdec			base-sys-usr
 ./usr/libdata/debug/usr/sbin			base-sys-usr
-./usr/libdata/firmwarebase-sys-usr
-./usr/libdata/firmware/radeon			base-sys-usr
-./usr/libdata/firmware/radeon/CEDAR_me.bin	base-sys-usr
-./usr/libdata/firmware/radeon/CEDAR_pfp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/CEDAR_rlc.bin	base-sys-usr
-./usr/libdata/firmware/radeon/CYPRESS_me.bin	base-sys-usr
-./usr/libdata/firmware/radeon/CYPRESS_pfp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/CYPRESS_rlc.bin	base-sys-usr
-./usr/libdata/firmware/radeon/JUNIPER_me.bin	base-sys-usr
-./usr/libdata/firmware/radeon/JUNIPER_pfp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/JUNIPER_rlc.bin	base-sys-usr
-./usr/libdata/firmware/radeon/R100_cp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/R200_cp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/R300_cp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/R420_cp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/R520_cp.bin	base-sys-usr
-./usr/libdata/firmware/radeon/R600_me.bin	

CVS commit: src/crypto/external/bsd/libsaslc/lib

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 15:30:54 UTC 2011

Modified Files:
src/crypto/external/bsd/libsaslc/lib: Makefile

Log Message:
msg.c uses non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/libsaslc/lib/Makefile

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

Modified files:

Index: src/crypto/external/bsd/libsaslc/lib/Makefile
diff -u src/crypto/external/bsd/libsaslc/lib/Makefile:1.4 src/crypto/external/bsd/libsaslc/lib/Makefile:1.5
--- src/crypto/external/bsd/libsaslc/lib/Makefile:1.4	Fri Apr 15 18:05:42 2011
+++ src/crypto/external/bsd/libsaslc/lib/Makefile	Thu Aug 25 15:30:54 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2011/04/15 18:05:42 elric Exp $
+# $NetBSD: Makefile,v 1.5 2011/08/25 15:30:54 joerg Exp $
 
 .include bsd.own.mk
 
@@ -26,6 +26,8 @@
 SRCS+= saslc.c
 SRCS+= xsess.c
 
+COPTS.msg.c = -Wno-format-nonliteral
+
 CPPFLAGS+=-I${EXTDIST}/include
 MAN=libsaslc.3
 WARNS?=4



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

2011-08-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 25 15:34:05 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Set-list repair: remove the 'gcccmds' tag from lines where it does not
belong.


To generate a diff of this commit:
cvs rdiff -u -r1.376 -r1.377 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.376 src/distrib/sets/lists/tests/mi:1.377
--- src/distrib/sets/lists/tests/mi:1.376	Fri Jul 15 13:54:31 2011
+++ src/distrib/sets/lists/tests/mi	Thu Aug 25 15:34:05 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.376 2011/07/15 13:54:31 jruoho Exp $
+# $NetBSD: mi,v 1.377 2011/08/25 15:34:05 dyoung Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -550,7 +550,7 @@
 ./usr/libdata/debug/usr/tests/lib/libm/t_round.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libm/t_tanh.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libobjctests-lib-debug
-./usr/libdata/debug/usr/tests/lib/libobjc/t_threads.debug		tests-lib-debug		debug,atf,gcccmds
+./usr/libdata/debug/usr/tests/lib/libobjc/t_threads.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libposixtests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libposix/bsdtests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libposix/bsd/t_rename.debug		tests-lib-debug		debug,atf
@@ -2249,7 +2249,7 @@
 ./usr/tests/lib/libm/t_tanh			tests-lib-tests		atf
 ./usr/tests/lib/libobjctests-lib-tests		atf
 ./usr/tests/lib/libobjc/Atffile			tests-lib-tests		atf
-./usr/tests/lib/libobjc/t_threads		tests-lib-tests		atf,gcccmds
+./usr/tests/lib/libobjc/t_threads		tests-lib-tests		atf
 ./usr/tests/lib/libposix			tests-lib-tests		atf
 ./usr/tests/lib/libposix/Atffile		tests-lib-tests		atf
 ./usr/tests/lib/libposix/bsd			tests-lib-tests		atf



CVS commit: src/crypto/external/bsd/openssh/dist

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 15:37:00 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: log.c

Log Message:
Avoid using non-literal format strings and optimizing code a bit at the
same time.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssh/dist/log.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/log.c
diff -u src/crypto/external/bsd/openssh/dist/log.c:1.3 src/crypto/external/bsd/openssh/dist/log.c:1.4
--- src/crypto/external/bsd/openssh/dist/log.c:1.3	Mon Jul 25 03:03:10 2011
+++ src/crypto/external/bsd/openssh/dist/log.c	Thu Aug 25 15:37:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.c,v 1.3 2011/07/25 03:03:10 christos Exp $	*/
+/*	$NetBSD: log.c,v 1.4 2011/08/25 15:37:00 joerg Exp $	*/
 /* $OpenBSD: log.c,v 1.41 2008/06/10 04:50:25 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen y...@cs.hut.fi
@@ -36,8 +36,9 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: log.c,v 1.3 2011/07/25 03:03:10 christos Exp $);
+__RCSID($NetBSD: log.c,v 1.4 2011/08/25 15:37:00 joerg Exp $);
 #include sys/types.h
+#include sys/uio.h
 
 #include stdarg.h
 #include stdio.h
@@ -302,8 +303,10 @@
 #ifdef SYSLOG_DATA_INIT
 	struct syslog_data sdata = SYSLOG_DATA_INIT;
 #endif
-	char msgbuf[MSGBUFSIZ];
-	char fmtbuf[4 * sizeof(msgbuf) + 1];
+	size_t len, len2;
+	int len3;
+	char msgbuf[MSGBUFSIZ], *msgbufp;
+	char visbuf[MSGBUFSIZ * 4 + 1];
 	const char *txt = NULL;
 	int pri = LOG_INFO;
 	int saved_errno = errno;
@@ -345,24 +348,33 @@
 		pri = LOG_ERR;
 		break;
 	}
+	len = sizeof(msgbuf);
+	msgbufp = msgbuf;
 	if (txt != NULL) {
-		snprintf(fmtbuf, sizeof(fmtbuf), %s: %s, txt, fmt);
-		vsnprintf(msgbuf, sizeof(msgbuf), fmtbuf, args);
-	} else {
-		vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
+		len2 = strlen(txt);
+		if (len2 = len)
+			len2 = len - 1;
+		memcpy(msgbufp, txt, len2);
+		msgbufp += len2;
+		*msgbufp++ = '\0';
+		len -= len2 + 1;
 	}
-	strvis(fmtbuf, msgbuf, VIS_SAFE|VIS_OCTAL);
+	vsnprintf(msgbufp, len, fmt, args);
+	len3 = strvis(visbuf, msgbuf, VIS_SAFE|VIS_OCTAL);
 	if (log_on_stderr) {
-		snprintf(msgbuf, sizeof msgbuf, %s\r\n, fmtbuf);
-		write(STDERR_FILENO, msgbuf, strlen(msgbuf));
+		struct iovec iov[] = {
+			{ visbuf, len3 },
+			{ __UNCONST(\r\n), 2 },
+		};
+		writev(STDERR_FILENO, iov, __arraycount(iov));
 	} else {
 #ifdef SYSLOG_DATA_INIT
 		openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, sdata);
-		syslog_r(pri, sdata, %.500s, fmtbuf);
+		syslog_r(pri, sdata, %.500s, visbuf);
 		closelog_r(sdata);
 #else
 		openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
-		syslog(pri, %.500s, fmtbuf);
+		syslog(pri, %.500s, visbuf);
 		closelog();
 #endif
 	}



CVS commit: src/distrib/utils/sysinst/arch/bebox

2011-08-25 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug 25 15:42:33 UTC 2011

Modified Files:
src/distrib/utils/sysinst/arch/bebox: md.c

Log Message:
bebox not support md_post_newfs() and md_post_disklabel() now. Change null-func.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/distrib/utils/sysinst/arch/bebox/md.c

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

Modified files:

Index: src/distrib/utils/sysinst/arch/bebox/md.c
diff -u src/distrib/utils/sysinst/arch/bebox/md.c:1.55 src/distrib/utils/sysinst/arch/bebox/md.c:1.56
--- src/distrib/utils/sysinst/arch/bebox/md.c:1.55	Mon Apr  4 08:30:20 2011
+++ src/distrib/utils/sysinst/arch/bebox/md.c	Thu Aug 25 15:42:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.55 2011/04/04 08:30:20 mbalmer Exp $ */
+/*	$NetBSD: md.c,v 1.56 2011/08/25 15:42:33 kiyohara Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -102,12 +102,6 @@
 int
 md_post_disklabel(void)
 {
-	/* Sector forwarding / badblocks ... */
-	if (*doessf) {
-		printf (%s, msg_string (MSG_dobad144));
-		return run_program(RUN_DISPLAY, /usr/sbin/bad144 %s 0,
-		diskdev);
-	}
 	return 0;
 }
 
@@ -119,11 +113,6 @@
 int
 md_post_newfs(void)
 {
-	/* boot blocks ... */
-	printf (msg_string(MSG_dobootblks), diskdev);
-	run_program(RUN_DISPLAY,
-	/usr/mdec/installboot -v /usr/mdec/biosboot.sym /dev/r%sa,
-	diskdev);
 	return 0;
 }
 



CVS commit: src/bin/csh

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 15:44:51 UTC 2011

Modified Files:
src/bin/csh: Makefile

Log Message:
Uses non-literal format strings in err.c


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/bin/csh/Makefile

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

Modified files:

Index: src/bin/csh/Makefile
diff -u src/bin/csh/Makefile:1.31 src/bin/csh/Makefile:1.32
--- src/bin/csh/Makefile:1.31	Sun Aug 14 10:53:16 2011
+++ src/bin/csh/Makefile	Thu Aug 25 15:44:51 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.31 2011/08/14 10:53:16 christos Exp $
+#	$NetBSD: Makefile,v 1.32 2011/08/25 15:44:51 joerg Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 #
 # C Shell with process control; VM/UNIX VAX Makefile
@@ -52,6 +52,7 @@
 .if defined(HAVE_GCC)  ${HAVE_GCC} == 4  ${MACHINE_ARCH} == vax
 COPTS.parse.c+=	-O0
 .endif
+COPTS.err.c = -Wno-format-nonliteral
 COPTS.printf.c = -Wno-format-nonliteral
 COPTS.proc.c = -Wno-format-nonliteral
 COPTS.strpct.c = -Wno-format-nonliteral



CVS commit: src/games/sail

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 15:50:45 UTC 2011

Modified Files:
src/games/sail: Makefile

Log Message:
Uses non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/games/sail/Makefile

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

Modified files:

Index: src/games/sail/Makefile
diff -u src/games/sail/Makefile:1.17 src/games/sail/Makefile:1.18
--- src/games/sail/Makefile:1.17	Sat Feb  6 23:45:26 2010
+++ src/games/sail/Makefile	Thu Aug 25 15:50:45 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2010/02/06 23:45:26 he Exp $
+#	$NetBSD: Makefile,v 1.18 2011/08/25 15:50:45 joerg Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 
 PROG=	sail
@@ -11,4 +11,7 @@
 HIDEGAME=hidegame
 SETGIDGAME=yes
 
+COPTS.pl_7.c+=	-Wno-format-nonliteral
+COPTS.sync.c+=	-Wno-format-nonliteral
+
 .include bsd.prog.mk



CVS commit: src/sbin/routed

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:12:38 UTC 2011

Modified Files:
src/sbin/routed: Makefile

Log Message:
main.c uses non-literal format strings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/routed/Makefile

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

Modified files:

Index: src/sbin/routed/Makefile
diff -u src/sbin/routed/Makefile:1.24 src/sbin/routed/Makefile:1.25
--- src/sbin/routed/Makefile:1.24	Sun Aug 14 11:34:11 2011
+++ src/sbin/routed/Makefile	Thu Aug 25 16:12:37 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.24 2011/08/14 11:34:11 christos Exp $
+#	$NetBSD: Makefile,v 1.25 2011/08/25 16:12:37 joerg Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/19/93
 
 USE_FORT?= yes	# network client/server
@@ -14,6 +14,7 @@
 MLINKS=	routed.8 rdisc.8
 #COPTS+=-g -DDEBUG -Wall
 
+COPTS.main.c = -Wno-format-nonliteral
 COPTS.trace.c = -Wno-format-nonliteral
 
 .include bsd.prog.mk



CVS commit: src/common/include/ppath

2011-08-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 25 16:15:29 UTC 2011

Added Files:
src/common/include/ppath: Makefile ppath.h ppath_impl.h

Log Message:
Add ppath/ headers that I had overlooked.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/common/include/ppath/Makefile \
src/common/include/ppath/ppath.h src/common/include/ppath/ppath_impl.h

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

Added files:

Index: src/common/include/ppath/Makefile
diff -u /dev/null src/common/include/ppath/Makefile:1.1
--- /dev/null	Thu Aug 25 16:15:29 2011
+++ src/common/include/ppath/Makefile	Thu Aug 25 16:15:29 2011
@@ -0,0 +1,9 @@
+#	$Id: Makefile,v 1.1 2011/08/25 16:15:29 dyoung Exp $
+#	$NetBSD: Makefile,v 1.1 2011/08/25 16:15:29 dyoung Exp $
+
+INCS=	ppath.h ppath_impl.h
+
+INCSDIR=	/usr/include/ppath
+
+.include bsd.prog.mk
+
Index: src/common/include/ppath/ppath.h
diff -u /dev/null src/common/include/ppath/ppath.h:1.1
--- /dev/null	Thu Aug 25 16:15:29 2011
+++ src/common/include/ppath/ppath.h	Thu Aug 25 16:15:29 2011
@@ -0,0 +1,91 @@
+/* $Id: ppath.h,v 1.1 2011/08/25 16:15:29 dyoung Exp $ */
+
+/* Copyright (c) 2010 David Young.  All rights reserved. */
+
+#ifndef _PPATH_H
+#define _PPATH_H
+
+#include prop/proplib.h
+
+#define	PPATH_MAX_COMPONENTS	16
+
+struct _ppath;
+struct _ppath_component;
+typedef struct _ppath ppath_t;
+typedef struct _ppath_component ppath_component_t;
+
+ppath_component_t *ppath_idx(unsigned int);
+ppath_component_t *ppath_key(const char *);
+
+ppath_component_t *ppath_component_retain(ppath_component_t *);
+void ppath_component_release(ppath_component_t *);
+
+ppath_t *ppath_create(void);
+unsigned int ppath_length(const ppath_t *);
+int ppath_component_idx(const ppath_component_t *);
+const char *ppath_component_key(const ppath_component_t *);
+ppath_t *ppath_pop(ppath_t *, ppath_component_t **);
+ppath_t *ppath_push(ppath_t *, ppath_component_t *);
+ppath_component_t *ppath_component_at(const ppath_t *, unsigned int);
+ppath_t *ppath_subpath(const ppath_t *, unsigned int, unsigned int);
+ppath_t *ppath_push_idx(ppath_t *, unsigned int);
+ppath_t *ppath_push_key(ppath_t *, const char *);
+ppath_t *ppath_replace_idx(ppath_t *, unsigned int);
+ppath_t *ppath_replace_key(ppath_t *, const char *);
+
+ppath_t *ppath_copy(const ppath_t *);
+ppath_t *ppath_retain(ppath_t *);
+void ppath_release(ppath_t *);
+
+prop_object_t ppath_lookup(prop_object_t, const ppath_t *);
+
+int ppath_copydel_object(prop_object_t, prop_object_t *, const ppath_t *);
+int ppath_copyset_object(prop_object_t, prop_object_t *, const ppath_t *,
+prop_object_t);
+int ppath_create_object(prop_object_t, const ppath_t *, prop_object_t);
+int ppath_set_object(prop_object_t, const ppath_t *, prop_object_t);
+int ppath_get_object(prop_object_t, const ppath_t *, prop_object_t *);
+int ppath_delete_object(prop_object_t, const ppath_t *);
+
+int ppath_copydel_bool(prop_object_t, prop_object_t *, const ppath_t *);
+int ppath_copyset_bool(prop_object_t, prop_object_t *, const ppath_t *, bool);
+int ppath_create_bool(prop_object_t, const ppath_t *, bool);
+int ppath_create_int64(prop_object_t, const ppath_t *, int64_t);
+int ppath_create_uint64(prop_object_t, const ppath_t *, uint64_t);
+int ppath_create_data(prop_object_t, const ppath_t *, const void *, size_t);
+int ppath_create_string(prop_object_t, const ppath_t *, const char *);
+int ppath_set_bool(prop_object_t, const ppath_t *, bool);
+int ppath_get_bool(prop_object_t, const ppath_t *, bool *);
+int ppath_delete_bool(prop_object_t, const ppath_t *);
+
+int ppath_copydel_data(prop_object_t, prop_object_t *, const ppath_t *);
+int ppath_copyset_data(prop_object_t, prop_object_t *, const ppath_t *,
+const void *, size_t);
+int ppath_set_data(prop_object_t, const ppath_t *, const void *, size_t);
+int ppath_get_data(prop_object_t, const ppath_t *, const void **, size_t *);
+int ppath_dup_data(prop_object_t, const ppath_t *, void **, size_t *);
+int ppath_delete_data(prop_object_t, const ppath_t *);
+
+int ppath_copydel_int64(prop_object_t, prop_object_t *, const ppath_t *);
+int ppath_copyset_int64(prop_object_t, prop_object_t *, const ppath_t *,
+int64_t);
+int ppath_set_int64(prop_object_t, const ppath_t *, int64_t);
+int ppath_get_int64(prop_object_t, const ppath_t *, int64_t *);
+int ppath_delete_int64(prop_object_t, const ppath_t *);
+
+int ppath_copydel_string(prop_object_t, prop_object_t *, const ppath_t *);
+int ppath_copyset_string(prop_object_t, prop_object_t *, const ppath_t *,
+const char *);
+int ppath_set_string(prop_object_t, const ppath_t *, const char *);
+int ppath_get_string(prop_object_t, const ppath_t *, const char **);
+int ppath_dup_string(prop_object_t, const ppath_t *, char **);
+int ppath_delete_string(prop_object_t, const ppath_t *);
+
+int ppath_copydel_uint64(prop_object_t, prop_object_t *, const ppath_t *);
+int 

CVS commit: src/sbin/newfs

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:17:58 UTC 2011

Modified Files:
src/sbin/newfs: mkfs.c

Log Message:
Avoid magic manipulation of the format string.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sbin/newfs/mkfs.c

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

Modified files:

Index: src/sbin/newfs/mkfs.c
diff -u src/sbin/newfs/mkfs.c:1.109 src/sbin/newfs/mkfs.c:1.110
--- src/sbin/newfs/mkfs.c:1.109	Sun Mar  6 17:08:16 2011
+++ src/sbin/newfs/mkfs.c	Thu Aug 25 16:17:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs.c,v 1.109 2011/03/06 17:08:16 bouyer Exp $	*/
+/*	$NetBSD: mkfs.c,v 1.110 2011/08/25 16:17:58 joerg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
 #if 0
 static char sccsid[] = @(#)mkfs.c	8.11 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: mkfs.c,v 1.109 2011/03/06 17:08:16 bouyer Exp $);
+__RCSID($NetBSD: mkfs.c,v 1.110 2011/08/25 16:17:58 joerg Exp $);
 #endif
 #endif /* not lint */
 
@@ -677,7 +677,7 @@
 			continue;
 		}
 		/* Print superblock numbers */
-		len = printf( %* PRIu64 , + !col, fld_width,
+		len = printf(%s%* PRIu64 ,, col ?   : , fld_width,
 		(uint64_t)fsbtodb(sblock, cgsblock(sblock, cylno)));
 		col += len;
 		if (col + len  max_cols)



CVS commit: src/games/sail

2011-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 16:18:29 UTC 2011

Modified Files:
src/games/sail: pl_7.c

Log Message:
add printf attributes.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/games/sail/pl_7.c

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

Modified files:

Index: src/games/sail/pl_7.c
diff -u src/games/sail/pl_7.c:1.40 src/games/sail/pl_7.c:1.41
--- src/games/sail/pl_7.c:1.40	Fri Aug  6 05:14:40 2010
+++ src/games/sail/pl_7.c	Thu Aug 25 12:18:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pl_7.c,v 1.40 2010/08/06 09:14:40 dholland Exp $	*/
+/*	$NetBSD: pl_7.c,v 1.41 2011/08/25 16:18:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)pl_7.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: pl_7.c,v 1.40 2010/08/06 09:14:40 dholland Exp $);
+__RCSID($NetBSD: pl_7.c,v 1.41 2011/08/25 16:18:28 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -238,7 +238,7 @@
 /*
  * Likewise but a printf.
  */
-static void
+static void __attribute__((__format__(__printf__, 6, 7)))
 mvselprintw(int y, int x0, int item, int curitem,
 	size_t width, const char *fmt, ...)
 {
@@ -296,7 +296,7 @@
 /*
  * Complain briefly.
  */
-static void
+static void __attribute__((__format__(__printf__, 3, 4)))
 oops(int y, int x, const char *fmt, ...)
 {
 	int oy, ox;



CVS commit: src/usr.bin/bthset

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:19:23 UTC 2011

Modified Files:
src/usr.bin/bthset: bthset.c

Log Message:
Avoid using non-literal format strings. Fix verbose option -- va_list is
passed by reference and vprintf would have processed all arguments
already.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/bthset/bthset.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/bthset/bthset.c
diff -u src/usr.bin/bthset/bthset.c:1.5 src/usr.bin/bthset/bthset.c:1.6
--- src/usr.bin/bthset/bthset.c:1.5	Tue May 12 18:39:55 2009
+++ src/usr.bin/bthset/bthset.c	Thu Aug 25 16:19:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bthset.c,v 1.5 2009/05/12 18:39:55 plunky Exp $	*/
+/*	$NetBSD: bthset.c,v 1.6 2011/08/25 16:19:23 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -33,12 +33,13 @@
 
 #include sys/cdefs.h
 __COPYRIGHT(@(#) Copyright (c) 2006 Itronix, Inc.  All rights reserved.);
-__RCSID($NetBSD: bthset.c,v 1.5 2009/05/12 18:39:55 plunky Exp $);
+__RCSID($NetBSD: bthset.c,v 1.6 2011/08/25 16:19:23 joerg Exp $);
 
 #include sys/types.h
 #include sys/audioio.h
 #include sys/ioctl.h
 #include sys/time.h
+#include sys/uio.h
 
 #include assert.h
 #include bluetooth.h
@@ -427,23 +428,26 @@
 int
 send_rfcomm(const char *msg, ...)
 {
-	char buf[128], fmt[128];
+	struct iovec iov[3];
+	char buf[128];
 	va_list ap;
-	int len;
-
-	va_start(ap, msg);
 
 	if (verbose) {
-		snprintf(fmt, sizeof(fmt),  %s\n, msg);
-		vprintf(fmt, ap);
+		fputs( , stdout);
+		va_start(ap, msg);
+		vprintf(msg, ap);
+		va_end(ap);
+		putchar('\n');
 	}
 
-	snprintf(fmt, sizeof(fmt), \r\n%s\r\n, msg);
-	vsnprintf(buf, sizeof(buf), fmt, ap);
-	len = send(rf, buf, strlen(buf), 0);
-
+	iov[0].iov_base = iov[2].iov_base = __UNCONST(\r\n);
+	iov[0].iov_len = iov[2].iov_len = 2;
+	va_start(ap, msg);
+	iov[1].iov_base = buf;
+	iov[1].iov_len = vsnprintf(buf, sizeof(buf), msg, ap);
 	va_end(ap);
-	return len;
+
+	return writev(rf, iov, __arraycount(iov));
 }
 
 /*



CVS commit: src/usr.sbin/altq/altqd

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:22:44 UTC 2011

Modified Files:
src/usr.sbin/altq/altqd: Makefile

Log Message:
Use of non-literal format string.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/altq/altqd/Makefile

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/altq/altqd/Makefile
diff -u src/usr.sbin/altq/altqd/Makefile:1.7 src/usr.sbin/altq/altqd/Makefile:1.8
--- src/usr.sbin/altq/altqd/Makefile:1.7	Tue Aug 16 12:39:29 2011
+++ src/usr.sbin/altq/altqd/Makefile	Thu Aug 25 16:22:43 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2011/08/16 12:39:29 christos Exp $
+#	$NetBSD: Makefile,v 1.8 2011/08/25 16:22:43 joerg Exp $
 
 .include bsd.own.mk
 
@@ -16,4 +16,6 @@
 DPADD+=	${LIBUTIL} ${LIBM}
 LDADD+=	-lutil -lm
 
+COPTS.libaltq2.c+=	-Wno-format-nonliteral
+
 .include bsd.prog.mk



CVS commit: src/external/bsd/ntp/lib

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:29:40 UTC 2011

Modified Files:
src/external/bsd/ntp/lib/libiscntp: Makefile
src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
Use of non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/lib/libiscntp/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/lib/libntp/Makefile

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/ntp/lib/libiscntp/Makefile
diff -u src/external/bsd/ntp/lib/libiscntp/Makefile:1.3 src/external/bsd/ntp/lib/libiscntp/Makefile:1.4
--- src/external/bsd/ntp/lib/libiscntp/Makefile:1.3	Wed Aug 17 09:32:55 2011
+++ src/external/bsd/ntp/lib/libiscntp/Makefile	Thu Aug 25 16:29:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/08/17 09:32:55 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2011/08/25 16:29:39 joerg Exp $
 
 LIBISPRIVATE=yes
 
@@ -41,4 +41,6 @@
 time.c \
 sockaddr.c
 
+COPTS.log.c+=	-Wno-format-nonliteral
+
 .include bsd.lib.mk

Index: src/external/bsd/ntp/lib/libntp/Makefile
diff -u src/external/bsd/ntp/lib/libntp/Makefile:1.2 src/external/bsd/ntp/lib/libntp/Makefile:1.3
--- src/external/bsd/ntp/lib/libntp/Makefile:1.2	Sun Aug 29 18:52:59 2010
+++ src/external/bsd/ntp/lib/libntp/Makefile	Thu Aug 25 16:29:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2010/08/29 18:52:59 kardel Exp $
+#	$NetBSD: Makefile,v 1.3 2011/08/25 16:29:39 joerg Exp $
 
 LIBISPRIVATE=yes
 
@@ -24,4 +24,6 @@
  statestr.c strdup.c strstr.c syssignal.c tsftomsu.c tstotv.c tvtots.c \
  uglydate.c uinttoa.c ymd2yd.c 
 
+COPTS.msyslog.c+= -Wno-format-nonliteral
+
 .include bsd.lib.mk



CVS commit: src/external/bsd/tmux/dist

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:41:51 UTC 2011

Modified Files:
src/external/bsd/tmux/dist: log.c

Log Message:
Avoid non-literal format strings by replacing asprintf with putc.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/tmux/dist/log.c

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/tmux/dist/log.c
diff -u src/external/bsd/tmux/dist/log.c:1.1.1.2 src/external/bsd/tmux/dist/log.c:1.2
--- src/external/bsd/tmux/dist/log.c:1.1.1.2	Wed Aug 17 18:40:04 2011
+++ src/external/bsd/tmux/dist/log.c	Thu Aug 25 16:41:51 2011
@@ -1,4 +1,4 @@
-/* $Id: log.c,v 1.1.1.2 2011/08/17 18:40:04 jmmv Exp $ */
+/* $Id: log.c,v 1.2 2011/08/25 16:41:51 joerg Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott n...@users.sourceforge.net
@@ -85,7 +85,6 @@
 void
 log_vwrite(int pri, const char *msg, va_list ap)
 {
-	char	*fmt;
 	FILE	*f = log_file;
 
 	switch (log_type) {
@@ -96,12 +95,11 @@
 			f = stderr;
 		/* FALLTHROUGH */
 	case LOG_TYPE_FILE:
-		if (asprintf(fmt, %s\n, msg) == -1)
+		if (vfprintf(f, msg, ap) == -1)
 			exit(1);
-		if (vfprintf(f, fmt, ap) == -1)
+		if (putc('\n', f) == -1)
 			exit(1);
 		fflush(f);
-		free(fmt);
 		break;
 	}
 }



CVS commit: src/distrib/utils/sysinst

2011-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 16:47:16 UTC 2011

Modified Files:
src/distrib/utils/sysinst: Makefile.inc

Log Message:
document non-literal format string use for many md files


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/distrib/utils/sysinst/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/distrib/utils/sysinst/Makefile.inc
diff -u src/distrib/utils/sysinst/Makefile.inc:1.54 src/distrib/utils/sysinst/Makefile.inc:1.55
--- src/distrib/utils/sysinst/Makefile.inc:1.54	Tue Aug 23 06:26:07 2011
+++ src/distrib/utils/sysinst/Makefile.inc	Thu Aug 25 12:47:16 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.54 2011/08/23 10:26:07 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.55 2011/08/25 16:47:16 christos Exp $
 #
 # Makefile for sysinst
 
@@ -56,6 +56,7 @@
 COPTS.target.c += -Wno-format-nonliteral
 COPTS.mbr.c += -Wno-format-nonliteral
 COPTS.bsddisklabel.c += -Wno-format-nonliteral
+COPTS.md.c += -Wno-format-nonliteral
 
 # Host to ftp from.  Default:
 #	ftp.NetBSD.org



CVS commit: src/usr.sbin/mopd/common

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:47:20 UTC 2011

Modified Files:
src/usr.sbin/mopd/common: Makefile

Log Message:
Use of non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/mopd/common/Makefile

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/mopd/common/Makefile
diff -u src/usr.sbin/mopd/common/Makefile:1.17 src/usr.sbin/mopd/common/Makefile:1.18
--- src/usr.sbin/mopd/common/Makefile:1.17	Tue Aug 16 16:45:20 2011
+++ src/usr.sbin/mopd/common/Makefile	Thu Aug 25 16:47:20 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2011/08/16 16:45:20 christos Exp $
+#	$NetBSD: Makefile,v 1.18 2011/08/25 16:47:20 joerg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -23,3 +23,5 @@
 .if defined(HAVE_GCC) || defined(HAVE_PCC)
 COPTS.print.c+=	-Wno-pointer-sign
 .endif
+
+COPTS.log.c+=	-Wno-format-nonliteral



CVS commit: src/dist/pdisk

2011-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 16:51:48 UTC 2011

Modified Files:
src/dist/pdisk: io.c

Log Message:
fix non-literal format string


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/dist/pdisk/io.c

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

Modified files:

Index: src/dist/pdisk/io.c
diff -u src/dist/pdisk/io.c:1.3 src/dist/pdisk/io.c:1.4
--- src/dist/pdisk/io.c:1.3	Sat Apr 18 02:37:35 2009
+++ src/dist/pdisk/io.c	Thu Aug 25 12:51:48 2011
@@ -92,7 +92,6 @@
 int my_getch(void);
 void my_ungetch(int c);
 
-
 //
 // Routines
 //
@@ -150,7 +149,7 @@
 int		c;
 
 flush_to_newline(0);
-printf(prompt);
+printf(%s, prompt);
 
 for (;;) {
 	c = my_getch();
@@ -168,7 +167,7 @@
 	return 0;
 	} else {
 	flush_to_newline(0);
-	printf(prompt);
+	printf(%s, prompt);
 	}
 }
 return -1;
@@ -181,7 +180,7 @@
 int		c;
 
 if (promptBeforeGet) {
-	printf(prompt);
+	printf(%s, prompt);
 }	
 for (;;) {
 	c = my_getch();
@@ -191,7 +190,7 @@
 	} else if (c == ' ' || c == '\t') {
 	// skip blanks and tabs
 	} else if (c == '\n') {
-	printf(prompt);
+	printf(%s, prompt);
 	} else {
 	*command = c;
 	return 1;
@@ -216,7 +215,7 @@
 	// skip blanks and tabs
 	} else if (c == '\n') {
 	if (default_value == kDefault) {
-		printf(prompt);
+		printf(%s, prompt);
 	} else {
 		my_ungetch(c);
 		*number = default_value;
@@ -295,7 +294,7 @@
 	// skip blanks and tabs
 	} else if (c == '\n') {
 	if (reprompt) {
-		printf(prompt);
+		printf(%s, prompt);
 	} else {
 		my_ungetch(c);
 		*string = NULL;



CVS commit: src/usr.sbin/pwd_mkdb

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 16:53:25 UTC 2011

Modified Files:
src/usr.sbin/pwd_mkdb: Makefile

Log Message:
Use of non-literal format string


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/pwd_mkdb/Makefile

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/pwd_mkdb/Makefile
diff -u src/usr.sbin/pwd_mkdb/Makefile:1.19 src/usr.sbin/pwd_mkdb/Makefile:1.20
--- src/usr.sbin/pwd_mkdb/Makefile:1.19	Wed Jan 14 23:18:57 2009
+++ src/usr.sbin/pwd_mkdb/Makefile	Thu Aug 25 16:53:25 2011
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.19 2009/01/14 23:18:57 christos Exp $
+#	$NetBSD: Makefile,v 1.20 2011/08/25 16:53:25 joerg Exp $
 
 .include bsd.own.mk
 
@@ -12,4 +12,6 @@
 DPADD+=	${LIBUTIL}
 .endif
 
+COPTS.pwd_mkdb.c+=	-Wno-format-nonliteral
+
 .include bsd.prog.mk



CVS commit: src/distrib/utils/ssh

2011-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 16:54:58 UTC 2011

Modified Files:
src/distrib/utils/ssh: ssh.c

Log Message:
fix non-literal format string


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/ssh/ssh.c

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

Modified files:

Index: src/distrib/utils/ssh/ssh.c
diff -u src/distrib/utils/ssh/ssh.c:1.4 src/distrib/utils/ssh/ssh.c:1.5
--- src/distrib/utils/ssh/ssh.c:1.4	Thu May 19 18:12:35 2011
+++ src/distrib/utils/ssh/ssh.c	Thu Aug 25 12:54:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssh.c,v 1.4 2011/05/19 22:12:35 tsutsui Exp $	*/
+/*	$NetBSD: ssh.c,v 1.5 2011/08/25 16:54:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1995 Gordon W. Ross
@@ -207,7 +207,7 @@
 	exitcode = 0;
 	for (;;) {
 		if (iflag) {
-			fprintf(stderr, prompt);
+			fprintf(stderr, %s, prompt);
 			fflush(stderr);
 		}
 



CVS commit: src/sys/arch/x68k/usr.bin/bellctrl

2011-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 17:00:55 UTC 2011

Modified Files:
src/sys/arch/x68k/usr.bin/bellctrl: bellctrl.c

Log Message:
fix non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x68k/usr.bin/bellctrl/bellctrl.c

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

Modified files:

Index: src/sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
diff -u src/sys/arch/x68k/usr.bin/bellctrl/bellctrl.c:1.12 src/sys/arch/x68k/usr.bin/bellctrl/bellctrl.c:1.13
--- src/sys/arch/x68k/usr.bin/bellctrl/bellctrl.c:1.12	Thu May 19 17:26:39 2011
+++ src/sys/arch/x68k/usr.bin/bellctrl/bellctrl.c	Thu Aug 25 13:00:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bellctrl.c,v 1.12 2011/05/19 21:26:39 tsutsui Exp $	*/
+/*	$NetBSD: bellctrl.c,v 1.13 2011/08/25 17:00:55 christos Exp $	*/
 
 /*
  * bellctrl - OPM bell controller (for NetBSD/X680x0)
@@ -6,7 +6,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: bellctrl.c,v 1.12 2011/05/19 21:26:39 tsutsui Exp $);
+__RCSID($NetBSD: bellctrl.c,v 1.13 2011/08/25 17:00:55 christos Exp $);
 
 #include err.h
 #include stdio.h
@@ -25,9 +25,8 @@
 	if (i = argc) \
 		break; \
 
-int bell_setting;
-char *progName;
-struct opm_voice voice;
+static int bell_setting;
+static struct opm_voice voice;
 
 static struct opm_voice bell_voice = DEFAULT_BELL_VOICE;
 
@@ -36,13 +35,13 @@
 };
 
 /* function prototype */
-int is_number(const char *, int);
-void set_bell_vol(int);
-void set_bell_pitch(int);
-void set_bell_dur(int);
-void set_voice_param(const char *, int);
-void set_bell_param(void);
-int usage(const char *, const char *);
+static int is_number(const char *, int);
+static void set_bell_vol(int);
+static void set_bell_pitch(int);
+static void set_bell_dur(int);
+static void set_voice_param(const char *, int);
+static void set_bell_param(void);
+static void usage(void) __dead;
 
 int
 main(int argc, char **argv)
@@ -51,11 +50,10 @@
 	int percent;
 	int i;
 
-	progName = argv[0];
 	bell_setting = 0;
 
 	if (argc  2)
-		usage(NULL, NULL);
+		usage();
 
 	for (i = 1; i  argc; ) {
 		arg = argv[i++];
@@ -137,13 +135,16 @@
 			/*
 			 * set voice parameter
 			 */
-			if (i = argc)
-usage(missing -v argument, NULL);
+			if (i = argc) {
+warnx(Missing -v argument);
+usage();
+			}
 			arg = nextarg(i, argv);
 			set_voice_param(arg, 0);
 			i++;
 		} else {
-			usage(unknown option %s, arg);
+			warnx(Unknown option %s, arg);
+			usage();
 		}
 	}
 
@@ -153,7 +154,7 @@
 	exit(0);
 }
 
-int
+static int
 is_number(const char *arg, int maximum)
 {
 	const char *p;
@@ -168,28 +169,28 @@
 	return 1;
 }
 
-void
+static void
 set_bell_vol(int percent)
 {
 	values.volume = percent;
 	bell_setting++;
 }
 
-void
+static void
 set_bell_pitch(int pitch)
 {
 	values.pitch = pitch;
 	bell_setting++;
 }
 
-void
+static void
 set_bell_dur(int duration)
 {
 	values.msec = duration;
 	bell_setting++;
 }
 
-void
+static void
 set_voice_param(const char *path, int flag)
 {
 	int fd;
@@ -214,7 +215,7 @@
 	close(fd);
 }
 
-void
+static void
 set_bell_param(void)
 {
 	int fd;
@@ -238,16 +239,10 @@
 	close(fd);
 }
 
-int
-usage(const char *fmt, const char *arg)
+static void
+usage(void)
 {
-	if (fmt) {
-		fprintf(stderr, %s:  , progName);
-		fprintf(stderr, fmt, arg);
-		fprintf(stderr, \n\n);
-	}
-
-	fprintf(stderr, usage:  %s option ...\n, progName);
+	fprintf(stderr, Usage: %s option ...\n, getprogname());
 	fprintf(stderr, 	To turn bell off:\n);
 	fprintf(stderr, \t-bb off
 				   b 0\n);



CVS commit: src/external/ibm-public/postfix

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 17:05:45 UTC 2011

Modified Files:
src/external/ibm-public/postfix: Makefile.inc

Log Message:
Move -Wno-comment for clang to CPPFLAGS, so that mkdep runs are silent.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/ibm-public/postfix/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/external/ibm-public/postfix/Makefile.inc
diff -u src/external/ibm-public/postfix/Makefile.inc:1.12 src/external/ibm-public/postfix/Makefile.inc:1.13
--- src/external/ibm-public/postfix/Makefile.inc:1.12	Thu May 26 12:56:27 2011
+++ src/external/ibm-public/postfix/Makefile.inc	Thu Aug 25 17:05:45 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.12 2011/05/26 12:56:27 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2011/08/25 17:05:45 joerg Exp $
 
 .include bsd.own.mk
 
 USE_FORT?= yes	# network client and server
-CWARNFLAGS.clang+=	-Wno-comment -Wno-empty-body -Wno-format-extra-args
+CWARNFLAGS.clang+=	-Wno-empty-body -Wno-format-extra-args
 
 WARNS?=	0
 
@@ -14,7 +14,8 @@
 	-I${PFIX_DISTDIR}/src/dns -I${PFIX_DISTDIR}/src/global \
 	-I${PFIX_DISTDIR}/src/master -I${PFIX_DISTDIR}/src/util \
 	-I${PFIX_DISTDIR}/src/tls -I${PFIX_DISTDIR}/src/milter \
-	-I${PFIX_DISTDIR}/src/xsasl
+	-I${PFIX_DISTDIR}/src/xsasl \
+	${${ACTIVE_CC} == clang:?-Wno-comment:}
 
 CPPFLAGS+= -DUSE_SASL_AUTH
 CPPFLAGS+= -DDEF_SERVER_SASL_TYPE=\dovecot\



CVS commit: src/distrib/utils/sysinst

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 17:39:58 UTC 2011

Modified Files:
src/distrib/utils/sysinst: Makefile.inc

Log Message:
-Wno-format-nonliteral for msg_defs.c


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/distrib/utils/sysinst/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/distrib/utils/sysinst/Makefile.inc
diff -u src/distrib/utils/sysinst/Makefile.inc:1.55 src/distrib/utils/sysinst/Makefile.inc:1.56
--- src/distrib/utils/sysinst/Makefile.inc:1.55	Thu Aug 25 16:47:16 2011
+++ src/distrib/utils/sysinst/Makefile.inc	Thu Aug 25 17:39:58 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.55 2011/08/25 16:47:16 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.56 2011/08/25 17:39:58 joerg Exp $
 #
 # Makefile for sysinst
 
@@ -55,6 +55,7 @@
 COPTS.label.c += -Wno-format-nonliteral
 COPTS.target.c += -Wno-format-nonliteral
 COPTS.mbr.c += -Wno-format-nonliteral
+COPTS.msg_defs.c += -Wno-format-nonliteral
 COPTS.bsddisklabel.c += -Wno-format-nonliteral
 COPTS.md.c += -Wno-format-nonliteral
 



CVS commit: src/lib/libc/gen

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 25 18:20:22 UTC 2011

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

Log Message:
Uses non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/lib/libc/gen/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/gen/Makefile.inc
diff -u src/lib/libc/gen/Makefile.inc:1.179 src/lib/libc/gen/Makefile.inc:1.180
--- src/lib/libc/gen/Makefile.inc:1.179	Wed Aug  3 04:11:16 2011
+++ src/lib/libc/gen/Makefile.inc	Thu Aug 25 18:20:22 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.179 2011/08/03 04:11:16 manu Exp $
+#	$NetBSD: Makefile.inc,v 1.180 2011/08/25 18:20:22 joerg Exp $
 #	from: @(#)Makefile.inc	8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -43,6 +43,7 @@
 COPTS.execl.c = -Wno-stack-protector
 COPTS.execle.c = -Wno-stack-protector
 COPTS.execlp.c = -Wno-stack-protector
+COPTS.syslog.c = -Wno-format-nonliteral
 
 # machine-dependent gen sources
 # m-d Makefile.inc must include sources for:



CVS commit: src/tests/lib/librumpclient

2011-08-25 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Aug 25 18:46:01 UTC 2011

Modified Files:
src/tests/lib/librumpclient: t_fd.c

Log Message:
t_fd/sigio: pass test if we receive at least one SIGIO signal.

While a real kernel collects these signals until the connect() returns and
then delivers one signal rump delivers every signal so we get more than one.

Ok: Antti Kantee po...@netbsd.org


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/librumpclient/t_fd.c

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

Modified files:

Index: src/tests/lib/librumpclient/t_fd.c
diff -u src/tests/lib/librumpclient/t_fd.c:1.3 src/tests/lib/librumpclient/t_fd.c:1.4
--- src/tests/lib/librumpclient/t_fd.c:1.3	Mon Aug 15 15:19:08 2011
+++ src/tests/lib/librumpclient/t_fd.c	Thu Aug 25 18:46:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fd.c,v 1.3 2011/08/15 15:19:08 gson Exp $	*/
+/*	$NetBSD: t_fd.c,v 1.4 2011/08/25 18:46:01 hannken Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -134,7 +134,7 @@
 	RL(rump_sys_connect(cs, (struct sockaddr *)sin, sizeof(sin)));
 	sc = sigcnt;
 	printf(sigcnt after connect: %d\n, sc);
-	ATF_REQUIRE_EQ(sc, 1);
+	ATF_REQUIRE(sc = 1);
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 19:06:03 UTC 2011

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

Log Message:
A trap is now allways asked for RW access... that needs to be fixed but thats
later care.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/usermode/usermode/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/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.5 src/sys/arch/usermode/usermode/trap.c:1.6
--- src/sys/arch/usermode/usermode/trap.c:1.5	Thu Aug 25 15:02:54 2011
+++ src/sys/arch/usermode/usermode/trap.c	Thu Aug 25 19:06:03 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.5 2011/08/25 15:02:54 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.6 2011/08/25 19:06:03 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.5 2011/08/25 15:02:54 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.6 2011/08/25 19:06:03 reinoud Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -84,7 +84,7 @@
 	vaddr_t onfault;
 	int kmem, rv;
 
-printf(trap\n);
+	aprint_debug(trap\n);
 	if ((info-si_signo == SIGSEGV) || (info-si_signo == SIGBUS)) {
 		l = curlwp;
 		p = l-l_proc;
@@ -130,8 +130,8 @@
 		}
 
 		pcb-pcb_onfault = NULL;
-		/* XXX atype?? */
-atype = PROT_WRITE;
+		/* XXX TODO determine atype?? */
+atype = PROT_READ | PROT_WRITE;
 		rv = uvm_fault(vm_map, (vaddr_t) va, atype);
 		pcb-pcb_onfault = (void *) onfault;
 		if (rv) {



CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 19:06:58 UTC 2011

Modified Files:
src/sys/arch/usermode/usermode: pmap.c

Log Message:
Implement pmap_deactivate() and most importantly, share changes! i.e. it
should map in the SAME page and not a COW clone of the origional.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/usermode/usermode/pmap.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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.35 src/sys/arch/usermode/usermode/pmap.c:1.36
--- src/sys/arch/usermode/usermode/pmap.c:1.35	Thu Aug 25 15:06:09 2011
+++ src/sys/arch/usermode/usermode/pmap.c	Thu Aug 25 19:06:58 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.35 2011/08/25 15:06:09 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.36 2011/08/25 19:06:58 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.35 2011/08/25 15:06:09 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.36 2011/08/25 19:06:58 reinoud Exp $);
 
 #include opt_memsize.h
 #include opt_kmempages.h
@@ -86,6 +86,7 @@
 /* forwards */
 void		pmap_bootstrap(void);
 static void	pmap_page_activate(struct pv_entry *pv);
+static void	pmap_page_deactivate(struct pv_entry *pv);
 static void	pv_update(struct pv_entry *pv);
 static void	pmap_update_page(uintptr_t ppn);
 
@@ -428,7 +429,7 @@
 	void *addr;
 
 	addr = thunk_mmap((void *) va, PAGE_SIZE, pv-pv_mmap_ppl,
-		MAP_FILE | MAP_FIXED,
+		MAP_FILE | MAP_FIXED | MAP_SHARED,
 		mem_fh, pa);
 	aprint_debug(page_activate: (va %p, pa %p, ppl %d) - %p\n,
 		(void *) va, (void *) pa, pv-pv_mmap_ppl, (void *) addr);
@@ -437,6 +438,22 @@
 }
 
 static void
+pmap_page_deactivate(struct pv_entry *pv)
+{
+	paddr_t pa = pv-pv_ppn * PAGE_SIZE;
+	vaddr_t va = pv-pv_lpn * PAGE_SIZE + VM_MIN_ADDRESS; /* L-V */
+	void *addr;
+
+	addr = thunk_mmap((void *) va, PAGE_SIZE, PROT_NONE,
+		MAP_FILE | MAP_FIXED | MAP_SHARED,
+		mem_fh, pa);
+	aprint_debug(page_deactivate: (va %p, pa %p, ppl %d) - %p\n,
+		(void *) va, (void *) pa, pv-pv_mmap_ppl, (void *) addr);
+	if (addr != (void *) va)
+		panic(pmap_page_deactivate: mmap failed);
+}
+
+static void
 pv_update(struct pv_entry *pv)
 {
 	int pflags;
@@ -605,7 +622,7 @@
 		pv = pmap-pm_entries[lpn];
 		if (pv != NULL) {
 			if (pmap-pm_flags  PM_ACTIVE) {
-aprint_debug(pmap_remove: haven't removed old mmap yet\n);
+pmap_page_deactivate(pv);
 //MEMC_WRITE(pv-pv_deactivate);
 //cpu_cache_flush();
 			}
@@ -722,7 +739,7 @@
 	pmap-pm_flags =~ PM_ACTIVE;
 	for (i = 0; i  1024; i++) {
 		if (pmap-pm_entries[i] != NULL) {
-			aprint_debug(pmap_deactivate: TODO unmap memory!\n);
+			pmap_page_deactivate(pmap-pm_entries[i]);
 //			MEMC_WRITE(pmap-pm_entries[i]-pv_deactivate);
 		}
 	}



CVS commit: src/sys/arch/usermode/usermode

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 19:07:45 UTC 2011

Modified Files:
src/sys/arch/usermode/usermode: copy.c

Log Message:
Cleanup debug messages in copy.c


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/usermode/copy.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/usermode/usermode/copy.c
diff -u src/sys/arch/usermode/usermode/copy.c:1.3 src/sys/arch/usermode/usermode/copy.c:1.4
--- src/sys/arch/usermode/usermode/copy.c:1.3	Wed Aug 24 20:03:19 2011
+++ src/sys/arch/usermode/usermode/copy.c	Thu Aug 25 19:07:45 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: copy.c,v 1.3 2011/08/24 20:03:19 reinoud Exp $ */
+/* $NetBSD: copy.c,v 1.4 2011/08/25 19:07:45 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: copy.c,v 1.3 2011/08/24 20:03:19 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: copy.c,v 1.4 2011/08/25 19:07:45 reinoud Exp $);
 
 #include sys/types.h
 #include sys/systm.h
@@ -38,7 +38,7 @@
 int
 copyin(const void *uaddr, void *kaddr, size_t len)
 {
-printf(copyin uaddr %p, kaddr %p, len %d\n, uaddr, kaddr, (int) len);
+	aprint_debug(copyin uaddr %p, kaddr %p, len %d\n, uaddr, kaddr, (int) len);
 	memcpy(kaddr, uaddr, len);
 	return 0;
 }
@@ -46,9 +46,7 @@
 int
 copyout(const void *kaddr, void *uaddr, size_t len)
 {
-printf(copyout kaddr %p, uaddr %p, len %d\n, kaddr, uaddr, (int) len);
-printf(curlwp pmap = %p\n, curlwp-l_proc-p_vmspace-vm_map.pmap);
-
+	aprint_debug(copyout kaddr %p, uaddr %p, len %d\n, kaddr, uaddr, (int) len);
 	memcpy(uaddr, kaddr, len);
 	return 0;
 }
@@ -84,6 +82,10 @@
 kcopy(const void *src, void *dst, size_t len)
 {
 	memcpy(dst, src, len);
+#ifdef DEBUG
+	if (memcmp(dst, src, len) != 0)
+		panic(kcopy not finished correctly\n);
+#endif
 	return 0;
 }
 



CVS commit: src/sys/arch/usermode/dev

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 19:08:35 UTC 2011

Modified Files:
src/sys/arch/usermode/dev: ld_thunkbus.c

Log Message:
When this debug printf is enabled, please also tell WHAT address one is using
for read/write.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/usermode/dev/ld_thunkbus.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/usermode/dev/ld_thunkbus.c
diff -u src/sys/arch/usermode/dev/ld_thunkbus.c:1.5 src/sys/arch/usermode/dev/ld_thunkbus.c:1.6
--- src/sys/arch/usermode/dev/ld_thunkbus.c:1.5	Tue Aug 23 17:12:32 2011
+++ src/sys/arch/usermode/dev/ld_thunkbus.c	Thu Aug 25 19:08:35 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ld_thunkbus.c,v 1.5 2011/08/23 17:12:32 jmcneill Exp $ */
+/* $NetBSD: ld_thunkbus.c,v 1.6 2011/08/25 19:08:35 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ld_thunkbus.c,v 1.5 2011/08/23 17:12:32 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ld_thunkbus.c,v 1.6 2011/08/25 19:08:35 reinoud Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -164,7 +164,7 @@
 	}
 
 	if (bp-b_error)
-		printf(errpr!\n);
+		printf(error!\n);
 
 	lddone(sc-sc_ld, bp);
 }
@@ -189,8 +189,9 @@
 	tt-tt_aio.aio_sigevent.sigev_value.sival_ptr = tt;
 
 #if 0
-	device_printf(sc-sc_ld.sc_dv, %s off=%lld count=%lld\n,
+	device_printf(sc-sc_ld.sc_dv, %s addr %p, off=%lld, count=%lld\n,
 	(bp-b_flags  B_READ) ? rd : wr,
+	bp-b_data,
 	(long long)bp-b_rawblkno,
 	(long long)bp-b_bcount);
 #endif



CVS commit: src/tests/lib/libppath

2011-08-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 25 19:09:46 UTC 2011

Added Files:
src/tests/lib/libppath: Makefile personnel.plist plist_to_c t_ppath.c

Log Message:
Add tests for ppath(3).

TBD: hook into build and update set lists.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/lib/libppath/Makefile \
src/tests/lib/libppath/personnel.plist src/tests/lib/libppath/plist_to_c \
src/tests/lib/libppath/t_ppath.c

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

Added files:

Index: src/tests/lib/libppath/Makefile
diff -u /dev/null src/tests/lib/libppath/Makefile:1.1
--- /dev/null	Thu Aug 25 19:09:46 2011
+++ src/tests/lib/libppath/Makefile	Thu Aug 25 19:09:46 2011
@@ -0,0 +1,26 @@
+# $Id: Makefile,v 1.1 2011/08/25 19:09:46 dyoung Exp $
+
+.include bsd.own.mk
+
+LIBPPATH != make -V .OBJDIR -C $(.CURDIR)/../lib
+
+TESTS_C=t_ppath t_proplib
+SRCS.t_proplib=t_proplib.c personnel.c personnel.h
+SRCS.t_ppath=t_ppath.c personnel.c personnel.h
+CPPFLAGS+=-I$(.OBJDIR)
+
+.SUFFIXES: .plist .h
+
+.plist.h:
+	echo extern const char  ${.TARGET:S,.h$,,} [];  ${.TARGET}
+
+.plist.c:
+	${.CURDIR}/plist_to_c ${.TARGET:S,.c$,,}  ${.IMPSRC}  ${.TARGET}
+
+CLEANFILES+=personnel.c personnel.h
+
+LDADD+=-L$(LIBPPATH) -lppath -lprop
+DPADD+=$(LIBPPATH)/libppath.a
+
+.include bsd.test.mk
+.include ../mk/tags.mk
Index: src/tests/lib/libppath/personnel.plist
diff -u /dev/null src/tests/lib/libppath/personnel.plist:1.1
--- /dev/null	Thu Aug 25 19:09:46 2011
+++ src/tests/lib/libppath/personnel.plist	Thu Aug 25 19:09:46 2011
@@ -0,0 +1,26 @@
+?xml version=1.0 encoding=UTF-8?
+!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd;
+plist version=1.0
+dict
+	keyJohn Doe/key
+	dict
+		keychildren/key
+		array
+			stringJane Doe/string
+			stringJohn Doe, Jr./string
+		/array
+
+		keypets/key
+		array
+			stringFido/string
+			stringSpot/string
+		/array
+
+		keyjob title/key
+		stringcomputer programmer/string
+
+		keyu.s. citizen/key
+		true/
+	/dict
+/dict
+/plist
Index: src/tests/lib/libppath/plist_to_c
diff -u /dev/null src/tests/lib/libppath/plist_to_c:1.1
--- /dev/null	Thu Aug 25 19:09:46 2011
+++ src/tests/lib/libppath/plist_to_c	Thu Aug 25 19:09:46 2011
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+prog=$(basename $0)
+usage()
+{
+	echo usage: ${prog} symbol 12
+	exit 1
+}
+
+if [ $# -ne 1 ]; then
+	usage
+fi
+
+sed 's/\([\]\)/\\\1/g' | \
+awk -v sym=$1 '
+BEGIN	{ printf const char  sym [] = \; }
+	{ printf $0 \\n; }
+END	{ print \;; }'
+
+exit 0
Index: src/tests/lib/libppath/t_ppath.c
diff -u /dev/null src/tests/lib/libppath/t_ppath.c:1.1
--- /dev/null	Thu Aug 25 19:09:46 2011
+++ src/tests/lib/libppath/t_ppath.c	Thu Aug 25 19:09:46 2011
@@ -0,0 +1,1548 @@
+/* $Id: t_ppath.c,v 1.1 2011/08/25 19:09:46 dyoung Exp $ */
+
+/* Copyright (c) 2010 David Young.  All rights reserved. */
+
+#include sys/cdefs.h
+__RCSID($Id: t_ppath.c,v 1.1 2011/08/25 19:09:46 dyoung Exp $);
+
+#include assert.h
+#include atf-c.h
+#include errno.h
+#include stdlib.h
+#include string.h
+
+#include ppath/ppath.h
+#include personnel.h
+
+void test_ppath_extant_inc(void);
+void test_ppath_extant_dec(void);
+void test_ppath_component_extant_inc(void);
+void test_ppath_component_extant_dec(void);
+
+__strong_alias(ppath_extant_inc, test_ppath_extant_inc);
+__strong_alias(ppath_extant_dec, test_ppath_extant_dec);
+__strong_alias(ppath_component_extant_inc, test_ppath_component_extant_inc);
+__strong_alias(ppath_component_extant_dec, test_ppath_component_extant_dec);
+
+static uint64_t nppath = 0, nppath_component = 0;
+
+static bool
+dictionary_equals(prop_dictionary_t ld, prop_dictionary_t rd)
+{
+	bool eq;
+	char *lt, *rt;
+
+	lt = prop_dictionary_externalize(ld);
+	rt = prop_dictionary_externalize(rd);
+
+	assert(lt != NULL  rt != NULL);
+
+	eq = (strcmp(lt, rt) == 0);
+
+	free(lt);
+	free(rt);
+
+	return eq;
+}
+
+static void
+assert_no_ppath_extant(void)
+{
+	ATF_CHECK_EQ(nppath, 0);
+}
+
+static void
+assert_no_ppath_component_extant(void)
+{
+	ATF_CHECK_EQ(nppath_component, 0);
+}
+
+void
+test_ppath_extant_inc(void)
+{
+	if (++nppath == 0)
+		atf_tc_fail(count of extant paths overflowed);
+}
+
+void
+test_ppath_extant_dec(void)
+{
+	if (nppath-- == 0)
+		atf_tc_fail(count of extant path underflowed);
+}
+
+void
+test_ppath_component_extant_inc(void)
+{
+	if (++nppath_component == 0)
+		atf_tc_fail(count of extant path components overflowed);
+}
+
+void
+test_ppath_component_extant_dec(void)
+{
+	if (nppath_component-- == 0)
+		atf_tc_fail(count of extant path components underflowed);
+}
+
+ATF_TC(push_until_full);
+
+ATF_TC_HEAD(push_until_full, tc)
+{
+	atf_tc_set_md_var(tc, descr, check ppath_push() returns error 
+	after ppath_t reaches maximum length);
+}
+
+ATF_TC_BODY(push_until_full, tc)
+{
+	ppath_t *p, *rp;
+	ppath_component_t *pc;
+	int i;
+
+	assert_no_ppath_extant();
+	

CVS commit: src/sys/kern

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 19:14:08 UTC 2011

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

Log Message:
On a verbose kernel boot show why executables are denied due to their start
adresses. This will hardly ever occure in real-life.


To generate a diff of this commit:
cvs rdiff -u -r1.317 -r1.318 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.317 src/sys/kern/kern_exec.c:1.318
--- src/sys/kern/kern_exec.c:1.317	Mon Aug  8 12:08:53 2011
+++ src/sys/kern/kern_exec.c	Thu Aug 25 19:14:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.317 2011/08/08 12:08:53 manu Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.318 2011/08/25 19:14:07 reinoud 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.317 2011/08/08 12:08:53 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.318 2011/08/25 19:14:07 reinoud Exp $);
 
 #include opt_ktrace.h
 #include opt_modular.h
@@ -370,8 +370,17 @@
 		newerror = (*execsw[i]-es_makecmds)(l, epp);
 
 		if (!newerror) {
-			/* Seems ok: check that entry point is sane */
+			/* Seems ok: check that entry point is not too high */
 			if (epp-ep_entry  VM_MAXUSER_ADDRESS) {
+aprint_verbose(check_exec: rejecting due to 
+	too high entry address\n);
+error = ENOEXEC;
+break;
+			}
+			/* Seems ok: check that entry point is not too low */
+			if (epp-ep_entry  VM_MIN_ADDRESS) {
+aprint_verbose(check_exec: rejecting due to 
+	too low entry address\n);
 error = ENOEXEC;
 break;
 			}
@@ -380,6 +389,8 @@
 			if ((epp-ep_tsize  MAXTSIZ) ||
 			(epp-ep_dsize  (u_quad_t)l-l_proc-p_rlimit
 		[RLIMIT_DATA].rlim_cur)) {
+aprint_debug(check_exec: rejecting due to 
+	limits\n);
 error = ENOMEM;
 break;
 			}



CVS commit: src/usr.sbin/puffs/mount_psshfs

2011-08-25 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Aug 25 19:49:05 UTC 2011

Modified Files:
src/usr.sbin/puffs/mount_psshfs: psshfs.c

Log Message:
Bring mount_psshfs user/host/path argument processing in line with sftp(1).


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.sbin/puffs/mount_psshfs/psshfs.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/puffs/mount_psshfs/psshfs.c
diff -u src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.63 src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.64
--- src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.63	Thu May 19 15:07:16 2011
+++ src/usr.sbin/puffs/mount_psshfs/psshfs.c	Thu Aug 25 19:49:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: psshfs.c,v 1.63 2011/05/19 15:07:16 riastradh Exp $	*/
+/*	$NetBSD: psshfs.c,v 1.64 2011/08/25 19:49:05 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2006-2009  Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: psshfs.c,v 1.63 2011/05/19 15:07:16 riastradh Exp $);
+__RCSID($NetBSD: psshfs.c,v 1.64 2011/08/25 19:49:05 jakllsch Exp $);
 #endif /* !lint */
 
 #include sys/types.h
@@ -64,6 +64,8 @@
 static int	pssh_connect(struct puffs_usermount *, int);
 static void	psshfs_loopfn(struct puffs_usermount *);
 static void	usage(void);
+static char *	cleanhostname(char *);
+static char *	colon(char *);
 static void	add_ssharg(char ***, int *, const char *);
 static void	psshfs_notify(struct puffs_usermount *, int, int);
 
@@ -72,6 +74,37 @@
 unsigned int max_reads;
 static int sighup;
 
+static char *
+cleanhostname(char *host)
+{
+	if (*host == '['  host[strlen(host) - 1] == ']') {
+		host[strlen(host) - 1] = '\0';
+		return (host + 1);
+	} else
+		return host;
+}
+
+static char *
+colon(char *cp)
+{
+	int flag = 0;
+
+	if (*cp == '[')
+		flag = 1;
+
+	for (; *cp; ++cp) {
+		if (*cp == '@'  *(cp+1) == '[')
+			flag = 1;
+		if (*cp == ']'  *(cp+1) == ':'  flag)
+			return (cp+1);
+		if (*cp == ':'  !flag)
+			return (cp);
+		if (*cp == '/')
+			return NULL;
+	}
+	return NULL;
+}
+
 static void
 add_ssharg(char ***sshargs, int *nargs, const char *arg)
 {
@@ -113,8 +146,9 @@
 	struct vattr *rva;
 	mntoptparse_t mp;
 	char **sshargs;
-	char *userhost;
-	char *hostpath;
+	char *user;
+	char *host;
+	char *path;
 	int mntflags, pflags, ch;
 	int detach;
 	int exportfs, refreshival, numconnections;
@@ -243,15 +277,33 @@
 	pctx.refreshival = refreshival;
 	pctx.numconnections = numconnections;
 
-	userhost = argv[0];
-	hostpath = strchr(userhost, ':');
-	if (hostpath) {
-		*hostpath++ = '\0';
-		pctx.mountpath = hostpath;
-	} else
+	user = strdup(argv[0]);
+	if ((host = strrchr(user, '@')) == NULL) {
+		host = user;
+	} else {
+		*host++ = '\0';		/* break at the '@' */
+		if (user[0] == '\0') {
+			fprintf(stderr, Missing username\n);
+			usage();
+		}
+		add_ssharg(sshargs, nargs, -l);
+		add_ssharg(sshargs, nargs, user);
+	}
+
+	if ((path = colon(host)) != NULL) {
+		*path++ = '\0';		/* break at the ':' */
+		pctx.mountpath = path;
+	} else {
 		pctx.mountpath = .;
+	}
+
+	host = cleanhostname(host);
+	if (host[0] == '\0') {
+		fprintf(stderr, Missing hostname\n);
+		usage();
+	}
 
-	add_ssharg(sshargs, nargs, argv[0]);
+	add_ssharg(sshargs, nargs, host);
 	add_ssharg(sshargs, nargs, sftp);
 	pctx.sshargs = sshargs;
 



CVS commit: src/sys/kern

2011-08-25 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Aug 25 19:54:30 UTC 2011

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

Log Message:
Move debug - verbose


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 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.318 src/sys/kern/kern_exec.c:1.319
--- src/sys/kern/kern_exec.c:1.318	Thu Aug 25 19:14:07 2011
+++ src/sys/kern/kern_exec.c	Thu Aug 25 19:54:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.318 2011/08/25 19:14:07 reinoud Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.319 2011/08/25 19:54:30 reinoud 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.318 2011/08/25 19:14:07 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.319 2011/08/25 19:54:30 reinoud Exp $);
 
 #include opt_ktrace.h
 #include opt_modular.h
@@ -389,7 +389,7 @@
 			if ((epp-ep_tsize  MAXTSIZ) ||
 			(epp-ep_dsize  (u_quad_t)l-l_proc-p_rlimit
 		[RLIMIT_DATA].rlim_cur)) {
-aprint_debug(check_exec: rejecting due to 
+aprint_verbose(check_exec: rejecting due to 
 	limits\n);
 error = ENOMEM;
 break;



CVS commit: src/include

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Aug 26 01:10:49 UTC 2011

Modified Files:
src/include: assert.h

Log Message:
__assert and __assert13 are dead


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/include/assert.h

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

Modified files:

Index: src/include/assert.h
diff -u src/include/assert.h:1.20 src/include/assert.h:1.21
--- src/include/assert.h:1.20	Sun Nov  2 14:27:44 2008
+++ src/include/assert.h	Fri Aug 26 01:10:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: assert.h,v 1.20 2008/11/02 14:27:44 christos Exp $	*/
+/*	$NetBSD: assert.h,v 1.21 2011/08/26 01:10:49 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -98,8 +98,8 @@
 #ifndef __ASSERT_DECLARED
 #define __ASSERT_DECLARED
 __BEGIN_DECLS
-void __assert(const char *, int, const char *);
-void __assert13(const char *, int, const char *, const char *);
+__dead void __assert(const char *, int, const char *);
+__dead void __assert13(const char *, int, const char *, const char *);
 void __diagassert(const char *, int, const char *);
 void __diagassert13(const char *, int, const char *, const char *);
 __END_DECLS



CVS commit: src/include

2011-08-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Aug 26 01:48:39 UTC 2011

Modified Files:
src/include: util.h

Log Message:
pw_error is documented to be dead


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/include/util.h

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

Modified files:

Index: src/include/util.h
diff -u src/include/util.h:1.56 src/include/util.h:1.57
--- src/include/util.h:1.56	Sun Jul 17 20:54:34 2011
+++ src/include/util.h	Fri Aug 26 01:48:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.h,v 1.56 2011/07/17 20:54:34 joerg Exp $	*/
+/*	$NetBSD: util.h,v 1.57 2011/08/26 01:48:39 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1995
@@ -99,7 +99,7 @@
 char *, size_t) __RENAME(__pw_copyx50);
 #endif
 void		pw_edit(int, const char *);
-void		pw_error(const char *, int, int);
+__dead void	pw_error(const char *, int, int);
 void		pw_getconf(char *, size_t, const char *, const char *);
 #ifndef __LIBC12_SOURCE__
 void		pw_getpwconf(char *, size_t, const struct passwd *,