CVS commit: src/sys/arch/x86

2011-08-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Aug 28 06:04:18 UTC 2011

Modified Files:
src/sys/arch/x86/include: pci_machdep_common.h
src/sys/arch/x86/pci: pci_machdep.c

Log Message:
Add some code for grovelling in the PCI configuration space for all
of the memory  I/O space reserved by the PCI BIOS for PCI devices
(including bridges) and recording that information for later use.

The code takes between 13k and 50k (depends on the architecture and,
bizarrely, the kernel configuration) so I am going to move it from
pci_machdep.c into its own module on Monday.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/include/pci_machdep_common.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/x86/pci/pci_machdep.c

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

Modified files:

Index: src/sys/arch/x86/include/pci_machdep_common.h
diff -u src/sys/arch/x86/include/pci_machdep_common.h:1.7 src/sys/arch/x86/include/pci_machdep_common.h:1.8
--- src/sys/arch/x86/include/pci_machdep_common.h:1.7	Mon Aug  1 11:08:03 2011
+++ src/sys/arch/x86/include/pci_machdep_common.h	Sun Aug 28 06:04:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep_common.h,v 1.7 2011/08/01 11:08:03 drochner Exp $	*/
+/*	$NetBSD: pci_machdep_common.h,v 1.8 2011/08/28 06:04:17 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -140,7 +140,11 @@
 void pci_bridge_foreach(pci_chipset_tag_t, int, int,
 	void (*) (pci_chipset_tag_t, pcitag_t, void *), void *);
 
-void pci_mmio_range_infer(pci_chipset_tag_t, int, int, bus_addr_t *,
-bus_size_t *);
+void pci_ranges_infer(pci_chipset_tag_t, int, int, bus_addr_t *,
+bus_size_t *, bus_addr_t *, bus_size_t *);
+
+extern prop_dictionary_t pci_rsrc_dict;
+prop_dictionary_t pci_rsrc_filter(prop_dictionary_t,
+bool (*)(void *, prop_dictionary_t), void *arg);
 
 #endif /* _X86_PCI_MACHDEP_COMMON_H_ */

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.47 src/sys/arch/x86/pci/pci_machdep.c:1.48
--- src/sys/arch/x86/pci/pci_machdep.c:1.47	Sun Aug 28 04:59:37 2011
+++ src/sys/arch/x86/pci/pci_machdep.c	Sun Aug 28 06:04:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.47 2011/08/28 04:59:37 dyoung Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.48 2011/08/28 06:04:18 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.47 2011/08/28 04:59:37 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.48 2011/08/28 06:04:18 dyoung Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -85,6 +85,9 @@
 #include sys/cpu.h
 #include sys/kmem.h
 
+#include prop/proplib.h
+#include ppath/ppath.h
+
 #include uvm/uvm_extern.h
 
 #include machine/bus_private.h
@@ -750,6 +753,918 @@
 		bridge_hook);  
 }
 
+typedef enum pci_alloc_regtype {
+	  PCI_ALLOC_REGTYPE_NONE = 0
+	, PCI_ALLOC_REGTYPE_BAR = 1
+	, PCI_ALLOC_REGTYPE_WIN = 2
+	, PCI_ALLOC_REGTYPE_CBWIN = 3
+	, PCI_ALLOC_REGTYPE_VGA_EN = 4
+} pci_alloc_regtype_t;
+
+typedef enum pci_alloc_space {
+	  PCI_ALLOC_SPACE_IO = 0
+	, PCI_ALLOC_SPACE_MEM = 1
+} pci_alloc_space_t;
+
+typedef enum pci_alloc_flags {
+	  PCI_ALLOC_F_PREFETCHABLE = 0x1
+} pci_alloc_flags_t;
+
+typedef struct pci_alloc {
+	TAILQ_ENTRY(pci_alloc)		pal_link;
+	pcitag_t			pal_tag;
+	uint64_t			pal_addr;
+	uint64_t			pal_size;
+	pci_alloc_regtype_t		pal_type;
+	struct pci_alloc_reg {
+		int			r_ofs;
+		pcireg_t		r_val;
+		pcireg_t		r_mask;
+	}pal_reg[3];
+	pci_alloc_space_t		pal_space;
+	pci_alloc_flags_t		pal_flags;
+} pci_alloc_t;
+
+typedef struct pci_alloc_reg pci_alloc_reg_t;
+
+TAILQ_HEAD(pci_alloc_list, pci_alloc);
+
+typedef struct pci_alloc_list pci_alloc_list_t;
+
+static pci_alloc_t *
+pci_alloc_dup(const pci_alloc_t *pal)
+{
+	pci_alloc_t *npal;
+
+	if ((npal = kmem_alloc(sizeof(*npal), KM_SLEEP)) == NULL)
+		return NULL;
+
+	*npal = *pal;
+
+	return npal;
+}
+
+static bool
+pci_alloc_linkdup(pci_alloc_list_t *pals, const pci_alloc_t *pal)
+{
+	pci_alloc_t *npal;
+
+	if ((npal = pci_alloc_dup(pal)) == NULL)
+		return false;
+	
+	TAILQ_INSERT_TAIL(pals, npal, pal_link);
+
+	return true;
+}
+ 
+struct range_infer_ctx {
+	pci_chipset_tag_t	ric_pc;
+	pci_alloc_list_t	ric_pals;
+	bus_addr_t		ric_mmio_bottom;
+	bus_addr_t		ric_mmio_top;
+	bus_addr_t		ric_io_bottom;
+	bus_addr_t		ric_io_top;
+};
+
+#if 1
+static bool
+io_range_extend(struct range_infer_ctx *ric, const pci_alloc_t *pal)
+{
+	if (ric-ric_io_bottom  pal-pal_addr)
+		ric-ric_io_bottom = pal-pal_addr;
+	if (ric-ric_io_top  pal-pal_addr + pal-pal_size)
+		ric-ric_io_top = pal-pal_addr + pal-pal_size;
+
+	return pci_alloc_linkdup(ric-ric_pals, pal);
+}
+
+static bool
+io_range_extend_by_bar(struct range_infer_ctx *ric, int bus, int dev, int fun,
+int ofs, pcireg_t curbar, pcireg_t sizebar)
+{
+	pci_alloc_reg_t 

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

2011-08-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Aug 28 06:08:15 UTC 2011

Modified Files:
src/sys/arch/x86/pci: pci_addr_fixup.c

Log Message:
Normalize whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/pci/pci_addr_fixup.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/pci/pci_addr_fixup.c
diff -u src/sys/arch/x86/pci/pci_addr_fixup.c:1.7 src/sys/arch/x86/pci/pci_addr_fixup.c:1.8
--- src/sys/arch/x86/pci/pci_addr_fixup.c:1.7	Sun Aug 28 05:32:41 2011
+++ src/sys/arch/x86/pci/pci_addr_fixup.c	Sun Aug 28 06:08:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_addr_fixup.c,v 1.7 2011/08/28 05:32:41 dyoung Exp $	*/
+/*	$NetBSD: pci_addr_fixup.c,v 1.8 2011/08/28 06:08:15 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2000 UCHIYAMA Yasushi.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_addr_fixup.c,v 1.7 2011/08/28 05:32:41 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_addr_fixup.c,v 1.8 2011/08/28 06:08:15 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -67,12 +67,12 @@
 pci_addr_fixup(pci_chipset_tag_t pc, int maxbus)
 {
 	extern paddr_t avail_end;
-	const char *verbose_header = 
+	const char *verbose_header =
 		[%s]---\n
 		  device vendor product\n
 		  register space addresssize\n
 		\n;
-	const char *verbose_footer = 
+	const char *verbose_footer =
 		--[%3d devices bogus]\n;
 	const struct {
 		bus_addr_t start;
@@ -88,7 +88,7 @@
 	int error;
 
 	pciaddr.extent_mem = extent_create(PCI I/O memory space,
-	   PCIADDR_MEM_START, 
+	   PCIADDR_MEM_START,
 	   PCIADDR_MEM_END,
 	   M_DEVBUF, 0, 0, EX_NOWAIT);
 	KASSERT(pciaddr.extent_mem);
@@ -98,28 +98,28 @@
 	M_DEVBUF, 0, 0, EX_NOWAIT);
 	KASSERT(pciaddr.extent_port);
 
-	/* 
+	/*
 	 * 1. check  reserve system BIOS setting.
 	 */
 	aprint_debug(verbose_header, System BIOS Setting);
 	pci_device_foreach(pc, maxbus, pciaddr_resource_reserve, NULL);
 	aprint_debug(verbose_footer, pciaddr.nbogus);
 
-	/* 
+	/*
 	 * 2. reserve non-PCI area.
 	 */
 	for (srp = system_reserve; srp-size; srp++) {
 		error = extent_alloc_region(pciaddr.extent_mem, srp-start,
-	srp-size, 
-	EX_NOWAIT| EX_MALLOCOK);	
+	srp-size,
+	EX_NOWAIT| EX_MALLOCOK);
 		if (error != 0) {
 			aprint_error(WARNING: can't reserve area for %s.\n,
 			   srp-name);
 		}
 	}
 
-	/* 
-	 * 3. determine allocation space 
+	/*
+	 * 3. determine allocation space
 	 */
 	start = x86_round_page(avail_end + 1);
 	if (start  PCIADDR_ISAMEM_RESERVE)
@@ -127,14 +127,14 @@
 	pciaddr.mem_alloc_start = (start + 0x10 + 1)  ~(0x10 - 1);
 	pciaddr.port_alloc_start = PCIADDR_ISAPORT_RESERVE;
 	aprint_debug( Physical memory end: 0x%08x\n PCI memory mapped I/O 
-			space start: 0x%08x\n, (unsigned)avail_end, 
+			space start: 0x%08x\n, (unsigned)avail_end,
 			(unsigned)pciaddr.mem_alloc_start);
 
 	if (pciaddr.nbogus == 0)
 		return; /* no need to fixup */
 
-	/* 
-	 * 4. do fixup 
+	/*
+	 * 4. do fixup
 	 */
 	aprint_debug(verbose_header, PCIBIOS fixup stage);
 	pciaddr.nbogus = 0;
@@ -147,7 +147,7 @@
 pciaddr_resource_reserve(pci_chipset_tag_t pc, pcitag_t tag,
 void *context)
 {
-		pciaddr_print_devid(pc, tag);
+	pciaddr_print_devid(pc, tag);
 	pciaddr_resource_manage(pc, tag,
 pciaddr_do_resource_reserve,
 pciaddr);
@@ -157,7 +157,7 @@
 pciaddr_resource_allocate(pci_chipset_tag_t pc, pcitag_t tag,
 void *context)
 {
-		pciaddr_print_devid(pc, tag);
+	pciaddr_print_devid(pc, tag);
 	pciaddr_resource_manage(pc, tag,
 pciaddr_do_resource_allocate,
 pciaddr);
@@ -192,7 +192,7 @@
 		break;
 	}
 	error = useport = usemem = 0;
-
+
 	for (mapreg = reg_start; mapreg  reg_end; mapreg += width) {
 		/* inquire PCI device bus space requirement */
 		val = pci_conf_read(pc, tag, mapreg);
@@ -200,20 +200,20 @@
 
 		mask = pci_conf_read(pc, tag, mapreg);
 		pci_conf_write(pc, tag, mapreg, val);
-	
+
 		type = PCI_MAPREG_TYPE(val);
 		width = 4;
 		if (type == PCI_MAPREG_TYPE_MEM) {
-			if (PCI_MAPREG_MEM_TYPE(val) == 
+			if (PCI_MAPREG_MEM_TYPE(val) ==
 			PCI_MAPREG_MEM_TYPE_64BIT) {
 /* XXX We could examine the upper 32 bits
- * XXX of the BAR here, but we are totally 
- * XXX unprepared to handle a non-zero value, 
- * XXX either here or anywhere else in 
- * XXX i386-land. 
+ * XXX of the BAR here, but we are totally
+ * XXX unprepared to handle a non-zero value,
+ * XXX either here or anywhere else in
+ * XXX i386-land.
  * XXX So just arrange to not look at the
  * XXX upper 32 bits, lest we misinterpret
- * XXX it as a 32-bit BAR set to zero. 
+ * XXX it as a 32-bit BAR set to zero.
  */
 			width = 8;
 			}
@@ -222,7 +222,7 @@
 			size = 

CVS commit: src/sys/dev/dm

2011-08-28 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Sun Aug 28 07:22:48 UTC 2011

Modified Files:
src/sys/dev/dm: dm_target.c

Log Message:
readd assertions noew with the correct struct
im wondering why the module cflags didnt warn about this obvious typo


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/dm_target.c

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

Modified files:

Index: src/sys/dev/dm/dm_target.c
diff -u src/sys/dev/dm/dm_target.c:1.17 src/sys/dev/dm/dm_target.c:1.18
--- src/sys/dev/dm/dm_target.c:1.17	Sat Aug 27 23:31:12 2011
+++ src/sys/dev/dm/dm_target.c	Sun Aug 28 07:22:48 2011
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target.c,v 1.17 2011/08/27 23:31:12 joerg Exp $  */
+/*$NetBSD: dm_target.c,v 1.18 2011/08/28 07:22:48 ahoka Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -150,6 +150,16 @@
 {
 	dm_target_t *dmt;
 
+	/* Sanity check for any missing function */
+	KASSERT(dm_target-init != NULL);
+	KASSERT(dm_target-status != NULL);
+	KASSERT(dm_target-strategy != NULL);
+	KASSERT(dm_target-deps != NULL);
+	KASSERT(dm_target-destroy != NULL);
+	KASSERT(dm_target-upcall != NULL);
+	KASSERT(dm_target-sync != NULL);
+	KASSERT(dm_target-secsize != NULL);
+
 	mutex_enter(dm_target_mutex);
 
 	dmt = dm_target_lookup_name(dm_target-name);



CVS commit: src/lib/libutil

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 07:45:14 UTC 2011

Modified Files:
src/lib/libutil: Makefile shlib_version
Added Files:
src/lib/libutil: strpct.3 strpct.c

Log Message:
add strpct, requested by joerg


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libutil/Makefile
cvs rdiff -u -r1.47 -r1.48 src/lib/libutil/shlib_version
cvs rdiff -u -r0 -r1.1 src/lib/libutil/strpct.3 src/lib/libutil/strpct.c

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

Modified files:

Index: src/lib/libutil/Makefile
diff -u src/lib/libutil/Makefile:1.63 src/lib/libutil/Makefile:1.64
--- src/lib/libutil/Makefile:1.63	Wed Jan 27 14:10:31 2010
+++ src/lib/libutil/Makefile	Sun Aug 28 03:45:13 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.63 2010/01/27 19:10:31 drochner Exp $
+#	$NetBSD: Makefile,v 1.64 2011/08/28 07:45:13 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=	yes
@@ -19,7 +19,7 @@
 	passwd.c pw_scan.c pidfile.c pidlock.c pty.c \
 	raise_default_signal.c \
 	secure_path.c snprintb.c sockaddr_snprintf.c stat_flags.c \
-	ttyaction.c ttymsg.c
+	strpct.c ttyaction.c ttymsg.c
 
 MAN=	efun.3 getbootfile.3 getlabelsector.3 getmaxpartitions.3 \
 	getmntopts.3 \
@@ -29,7 +29,7 @@
 	opendisk.3 openpty.3 parsedate.3 pidfile.3 pidlock.3 \
 	pw_getconf.3 pw_init.3 pw_lock.3 secure_path.3 \
 	raise_default_signal.3 \
-	snprintb.3 sockaddr_snprintf.3 stat_flags.3 ttyaction.3 \
+	snprintb.3 sockaddr_snprintf.3 stat_flags.3 strpct.3 ttyaction.3 \
 	ttymsg.3 util.3
 
 YPREFIX=__pd

Index: src/lib/libutil/shlib_version
diff -u src/lib/libutil/shlib_version:1.47 src/lib/libutil/shlib_version:1.48
--- src/lib/libutil/shlib_version:1.47	Tue May 12 22:50:32 2009
+++ src/lib/libutil/shlib_version	Sun Aug 28 03:45:14 2011
@@ -1,5 +1,5 @@
-#	$NetBSD: shlib_version,v 1.47 2009/05/13 02:50:32 pgoyette Exp $
+#	$NetBSD: shlib_version,v 1.48 2011/08/28 07:45:14 christos Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 major=7
-minor=17
+minor=18

Added files:

Index: src/lib/libutil/strpct.3
diff -u /dev/null src/lib/libutil/strpct.3:1.1
--- /dev/null	Sun Aug 28 03:45:14 2011
+++ src/lib/libutil/strpct.3	Sun Aug 28 03:45:14 2011
@@ -0,0 +1,83 @@
+.\ $NetBSD: strpct.3,v 1.1 2011/08/28 07:45:14 christos Exp $
+.\
+.\ Copyright (c) 2011 The NetBSD Foundation, Inc.
+.\ All rights reserved.
+.\
+.\ This file was contributed to The NetBSD Foundation by Christos Zoulas.
+.\
+.\ 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.
+.\
+.Dd August 28, 2011
+.Dt STRPCT 3
+.Os
+.Sh NAME
+.Nm strpct
+.Nd decimal percent formatter
+.Sh LIBRARY
+.Lb libutil
+.Sh SYNOPSIS
+.In util.h
+.Ft char *
+.Fn strpct char *buf size_t bufsiz uintmax_t numerator uintmax_t denominator size_t precision
+.Sh DESCRIPTION
+The
+.Fn strpct
+function formats the fraction represented by
+.Fa numerator
+and
+.Fa denominator
+into a percentage representation with given number of digits of
+.Fa precision .
+.Sh RETURN VALUES
+.Fn strpct
+always returns a pointer to a NUL terminated formatted string which
+is placed in
+.Fa buf
+and it is up to
+.Fa buflen
+characters.
+If there was an overflow, the formatted string will reflect that precision
+loss.
+.Sh EXAMPLES
+.Bd -literal -offset indent
+strpct(buf, buflen, 1, 16, 3);
+\(rA 6.250
+strpct(buf, buflen, 1, 2, 0);
+\(rA 50
+.Ed
+.Sh HISTORY
+.Fn strpct
+was originally implemented in
+.Xr csh 1 .
+It printed into a static buffer, was not locale aware, handled 
+.Ft unsigned long
+numbers, and printed a
+.Dq % 
+at the end of the number.
+Other programs such as
+.Xr df 1
+and
+.Xr time 1
+started using it.
+.Fn 

CVS commit: src/include

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 07:46:13 UTC 2011

Modified Files:
src/include: util.h

Log Message:
prototype for strpct


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 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.57 src/include/util.h:1.58
--- src/include/util.h:1.57	Thu Aug 25 21:48:39 2011
+++ src/include/util.h	Sun Aug 28 03:46:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.h,v 1.57 2011/08/26 01:48:39 joerg Exp $	*/
+/*	$NetBSD: util.h,v 1.58 2011/08/28 07:46:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995
@@ -41,6 +41,7 @@
 #include termios.h
 #include utmp.h
 #include utmpx.h
+#include stdint.h
 #include machine/ansi.h
 
 #ifdef  _BSD_TIME_T_
@@ -117,6 +118,7 @@
 int		snprintb(char *, size_t, const char *, uint64_t);
 int		sockaddr_snprintf(char *, size_t, const char *,
 const struct sockaddr *);
+char 	   *strpct(char *, size_t, uintmax_t, uintmax_t, size_t);
 int		string_to_flags(char **, unsigned long *, unsigned long *);
 int		ttyaction(const char *, const char *, const char *);
 int		ttylock(const char *, int, pid_t *);



CVS commit: src/distrib/sets/lists

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 07:48:18 UTC 2011

Modified Files:
src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64
md.sparc64 shl.mi
src/distrib/sets/lists/comp: ad.mips64eb ad.mips64el md.amd64
md.sparc64 shl.mi

Log Message:
bump libutil for strpct


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/distrib/sets/lists/base/ad.mips64eb
cvs rdiff -u -r1.60 -r1.61 src/distrib/sets/lists/base/ad.mips64el
cvs rdiff -u -r1.134 -r1.135 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.127 -r1.128 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.596 -r1.597 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.48 -r1.49 src/distrib/sets/lists/comp/ad.mips64eb \
src/distrib/sets/lists/comp/ad.mips64el
cvs rdiff -u -r1.130 -r1.131 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.115 -r1.116 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.185 -r1.186 src/distrib/sets/lists/comp/shl.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/ad.mips64eb
diff -u src/distrib/sets/lists/base/ad.mips64eb:1.63 src/distrib/sets/lists/base/ad.mips64eb:1.64
--- src/distrib/sets/lists/base/ad.mips64eb:1.63	Sat Aug 27 14:54:15 2011
+++ src/distrib/sets/lists/base/ad.mips64eb	Sun Aug 28 03:48:18 2011
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.63 2011/08/27 18:54:15 dyoung Exp $
+# $NetBSD: ad.mips64eb,v 1.64 2011/08/28 07:48:18 christos Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -257,7 +257,7 @@
 ./usr/lib/64/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/64/libutil.so.7.17			base-compat-shlib	compat,pic
+./usr/lib/64/libutil.so.7.18			base-compat-shlib	compat,pic
 ./usr/lib/64/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwrap.so.1			base-compat-shlib	compat,pic
@@ -543,7 +543,7 @@
 ./usr/lib/o32/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/o32/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/o32/libutil.so.7.17			base-compat-shlib	compat,pic
+./usr/lib/o32/libutil.so.7.18			base-compat-shlib	compat,pic
 ./usr/lib/o32/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwrap.so.1			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/ad.mips64el
diff -u src/distrib/sets/lists/base/ad.mips64el:1.60 src/distrib/sets/lists/base/ad.mips64el:1.61
--- src/distrib/sets/lists/base/ad.mips64el:1.60	Sat Aug 27 14:54:15 2011
+++ src/distrib/sets/lists/base/ad.mips64el	Sun Aug 28 03:48:18 2011
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64el,v 1.60 2011/08/27 18:54:15 dyoung Exp $
+# $NetBSD: ad.mips64el,v 1.61 2011/08/28 07:48:18 christos Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -257,7 +257,7 @@
 ./usr/lib/64/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/64/libutil.so.7.17			base-compat-shlib	compat,pic
+./usr/lib/64/libutil.so.7.18			base-compat-shlib	compat,pic
 ./usr/lib/64/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwrap.so.1			base-compat-shlib	compat,pic
@@ -543,7 +543,7 @@
 ./usr/lib/o32/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/o32/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/o32/libutil.so.7.17			base-compat-shlib	compat,pic
+./usr/lib/o32/libutil.so.7.18			base-compat-shlib	compat,pic
 ./usr/lib/o32/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwrap.so.1			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.134 src/distrib/sets/lists/base/md.amd64:1.135
--- src/distrib/sets/lists/base/md.amd64:1.134	Fri Aug 26 17:22:07 2011
+++ src/distrib/sets/lists/base/md.amd64	Sun Aug 28 03:48:18 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.134 2011/08/26 21:22:07 dyoung Exp $
+# $NetBSD: md.amd64,v 1.135 2011/08/28 07:48:18 christos Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
@@ -260,7 +260,7 @@
 

CVS commit: src

2011-08-28 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Aug 28 07:48:51 UTC 2011

Modified Files:
src/share/man/man4: gpio.4
src/sys/dev/gpio: gpio.c gpiovar.h
src/sys/sys: gpio.h
src/usr.sbin/gpioctl: gpioctl.8 gpioctl.c

Log Message:
Add a new ioctl, GPIOPULSE to gpio(4) to allow for pulsing a pin.
If a pin can pulse in hardware, that will be used, else it will
be pulsed in software.  There is no way yet to set the pulse frequency
for pins that pulse in hardware.  While here, make the code mpsafe and
allow more than one thread in the driver (access to ioctl is serialized).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/gpio.4
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/gpio/gpiovar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/gpio.h
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/gpioctl/gpioctl.8
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/gpioctl/gpioctl.c

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

Modified files:

Index: src/share/man/man4/gpio.4
diff -u src/share/man/man4/gpio.4:1.18 src/share/man/man4/gpio.4:1.19
--- src/share/man/man4/gpio.4:1.18	Mon Mar 22 18:58:31 2010
+++ src/share/man/man4/gpio.4	Sun Aug 28 07:48:50 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: gpio.4,v 1.18 2010/03/22 18:58:31 joerg Exp $
+.\ $NetBSD: gpio.4,v 1.19 2011/08/28 07:48:50 mbalmer Exp $
 .\	$OpenBSD: gpio.4,v 1.5 2004/11/23 09:39:29 reyk Exp $
 .\
 .\ Copyright (c) 2004 Alexander Yurchenko gra...@openbsd.org
@@ -15,7 +15,7 @@
 .\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\
-.Dd September 27, 2009
+.Dd August 21, 2011
 .Dt GPIO 4
 .Os
 .Sh NAME
@@ -123,6 +123,31 @@
 .Fa gp_value
 field is ignored and on return contains the old pin state.
 .Pp
+.It Dv GPIOPULSE (struct gpio_pulse)
+Starts pulsing the pin:
+.Bd -literal
+/* GPIO pulse request */
+struct gpio_pulse {
+	char		gp_name[GPIOMAXNAME];	/* pin name */
+	int		gp_pin;			/* pin number */
+	struct timeval	gp_pulse_on;		/* on period */
+	struct timeval	gp_pulse_off;		/* off period */
+};
+.Ed
+.Pp
+The
+.Fa gp_name
+or
+.Fa gp_pin
+field must be set before calling.
+If
+.Fa gp_pulse_on
+or
+.Fa gp_pulse_off
+is set to zero, a default of
+.Xr hz 9 / 2
+is assumed for both periods.
+.Pp
 .It Dv GPIOSET (struct gpio_set)
 Changes pin configuration flags with the new ones provided in the
 .Fa gpio_set

Index: src/sys/dev/gpio/gpio.c
diff -u src/sys/dev/gpio/gpio.c:1.35 src/sys/dev/gpio/gpio.c:1.36
--- src/sys/dev/gpio/gpio.c:1.35	Fri Aug 12 08:00:52 2011
+++ src/sys/dev/gpio/gpio.c	Sun Aug 28 07:48:50 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.35 2011/08/12 08:00:52 mbalmer Exp $ */
+/* $NetBSD: gpio.c,v 1.36 2011/08/28 07:48:50 mbalmer Exp $ */
 /*	$OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $	*/
 
 /*
@@ -19,21 +19,25 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gpio.c,v 1.35 2011/08/12 08:00:52 mbalmer Exp $);
+__KERNEL_RCSID(0, $NetBSD: gpio.c,v 1.36 2011/08/28 07:48:50 mbalmer Exp $);
 
 /*
  * General Purpose Input/Output framework.
  */
 
 #include sys/param.h
+#include sys/callout.h
 #include sys/systm.h
 #include sys/conf.h
 #include sys/device.h
 #include sys/fcntl.h
 #include sys/ioctl.h
 #include sys/gpio.h
+#include sys/kernel.h
 #include sys/vnode.h
 #include sys/kmem.h
+#include sys/mutex.h
+#include sys/condvar.h
 #include sys/queue.h
 #include sys/kauth.h
 #ifdef _MODULE
@@ -58,7 +62,9 @@
 	gpio_pin_t		*sc_pins;	/* pins array */
 	int			 sc_npins;	/* number of pins */
 
-	int			 sc_opened;
+	kmutex_t		 sc_mtx;
+	kcondvar_t		 sc_ioctl;	/* ioctl in progress */
+	int			 sc_ioctl_busy;	/* ioctl is busy */
 	LIST_HEAD(, gpio_dev)	 sc_devs;	/* devices */
 	LIST_HEAD(, gpio_name)	 sc_names;	/* named pins */
 };
@@ -73,6 +79,9 @@
 static int	gpio_search(device_t, cfdata_t, const int *, void *);
 static int	gpio_print(void *, const char *);
 static int	gpio_pinbyname(struct gpio_softc *, char *);
+static void	gpio_pulse(void *);
+static int	gpio_ioctl(struct gpio_softc *, u_long, void *, int,
+struct lwp *);
 
 /* Old API */
 static int	gpio_ioctl_oapi(struct gpio_softc *, u_long, void *, int,
@@ -85,10 +94,11 @@
 dev_type_open(gpioopen);
 dev_type_close(gpioclose);
 dev_type_ioctl(gpioioctl);
+dev_type_ioctl(gpioioctl_locked);
 
 const struct cdevsw gpio_cdevsw = {
 	gpioopen, gpioclose, noread, nowrite, gpioioctl,
-	nostop, notty, nopoll, nommap, nokqfilter, D_OTHER,
+	nostop, notty, nopoll, nommap, nokqfilter, D_OTHER | D_MPSAFE
 };
 
 extern struct cfdriver gpio_cd;
@@ -144,7 +154,7 @@
 {
 	struct gpio_softc *sc = device_private(self);
 	struct gpiobus_attach_args *gba = aux;
-
+	int pin;
 	sc-sc_dev = self;
 	sc-sc_gc = gba-gba_gc;
 	sc-sc_pins = gba-gba_pins;
@@ -152,8 +162,15 @@
 
 	printf(: %d pins\n, sc-sc_npins);
 
+	for (pin = 0; pin  sc-sc_npins; pin++) {
+		

CVS commit: src/bin/csh

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 07:49:16 UTC 2011

Modified Files:
src/bin/csh: Makefile time.c
Removed Files:
src/bin/csh: strpct.c

Log Message:
use strpct(3) from libutil.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/bin/csh/Makefile
cvs rdiff -u -r1.8 -r0 src/bin/csh/strpct.c
cvs rdiff -u -r1.17 -r1.18 src/bin/csh/time.c

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.32 src/bin/csh/Makefile:1.33
--- src/bin/csh/Makefile:1.32	Thu Aug 25 11:44:51 2011
+++ src/bin/csh/Makefile	Sun Aug 28 03:49:16 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2011/08/25 15:44:51 joerg Exp $
+#	$NetBSD: Makefile,v 1.33 2011/08/28 07:49:16 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 #
 # C Shell with process control; VM/UNIX VAX Makefile
@@ -13,7 +13,7 @@
 CPPFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
 SRCS=	alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
 	func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
-	sem.c set.c str.c strpct.c time.c
+	sem.c set.c str.c time.c
 .PATH:	${NETBSDSRCDIR}/usr.bin/printf
 
 MLINKS=	csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
@@ -55,7 +55,9 @@
 COPTS.err.c = -Wno-format-nonliteral
 COPTS.printf.c = -Wno-format-nonliteral
 COPTS.proc.c = -Wno-format-nonliteral
-COPTS.strpct.c = -Wno-format-nonliteral
+
+LDADD+=-lutil
+DPADD+=${LIBUTIL}
 
 .include bsd.prog.mk
 .include bsd.subdir.mk

Index: src/bin/csh/time.c
diff -u src/bin/csh/time.c:1.17 src/bin/csh/time.c:1.18
--- src/bin/csh/time.c:1.17	Sun Feb 24 00:20:17 2008
+++ src/bin/csh/time.c	Sun Aug 28 03:49:16 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: time.c,v 1.17 2008/02/24 05:20:17 dholland Exp $ */
+/* $NetBSD: time.c,v 1.18 2011/08/28 07:49:16 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)time.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: time.c,v 1.17 2008/02/24 05:20:17 dholland Exp $);
+__RCSID($NetBSD: time.c,v 1.18 2011/08/28 07:49:16 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -44,13 +44,13 @@
 #include csh.h
 #include extern.h
 #endif
+#include util.h
 
 /*
  * C Shell - routines handling process timing and niceing
  */
 static void pdeltat(FILE *, struct timeval *, struct timeval *);
 static void pcsecs(FILE *, long);
-extern char *strpct(u_long, u_long, u_int);
 
 #ifndef NOT_CSH
 void
@@ -186,7 +186,9 @@
 		if (ms == 0) {
 			(void)fputs(0.0%, fp);
 		} else {
-			(void)fputs(strpct((ulong)t, (ulong)ms, 1), fp);
+			char pb[32];
+			(void)fputs(strpct(pb, sizeof(pb), t, ms, 1), fp);
+			(void)fputc('%', fp);
 		}
 		break;
 	case 'R':		/* page reclaims */



CVS commit: src/sys/arch/sparc/stand/boot

2011-08-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 28 08:03:50 UTC 2011

Modified Files:
src/sys/arch/sparc/stand/boot: Makefile

Log Message:
emit some linker -Map files so that we can figure out what symbols
in the boot loaders are.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sparc/stand/boot/Makefile

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

Modified files:

Index: src/sys/arch/sparc/stand/boot/Makefile
diff -u src/sys/arch/sparc/stand/boot/Makefile:1.37 src/sys/arch/sparc/stand/boot/Makefile:1.38
--- src/sys/arch/sparc/stand/boot/Makefile:1.37	Sat Jan 22 19:19:23 2011
+++ src/sys/arch/sparc/stand/boot/Makefile	Sun Aug 28 08:03:49 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37 2011/01/22 19:19:23 joerg Exp $
+#	$NetBSD: Makefile,v 1.38 2011/08/28 08:03:49 mrg Exp $
 
 STRIPFLAG=
 PROGSOURCE=	boot.c net.c netif_sun.c conf.c openfirm.c bootinfo.c \
@@ -26,7 +26,7 @@
 
 OBJS=${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
 
-LINKFLAGS=-N -e start
+LINKFLAGS=-N -e start -Map $@.map
 
 .MAIN: all
 realall: ${FILES}
@@ -43,6 +43,7 @@
 	${SIZE} ${.TARGET}.tmp
 	${OBJCOPY} -O binary ${.TARGET}.tmp ${.TARGET}
 	rm -f ${.TARGET}.tmp
+CLEANFILES+=	boot.${RELOC}.map
 .endfor
 
 # conjure up a magic header that is accepted by all Sun PROMS;
@@ -57,5 +58,6 @@
 	${LD} -o ${.TARGET} ${LINKFLAGS} -Ttext 30 ${OBJS} \
 	${LIBSA} ${LIBZ} ${LIBKERN}
 	${SIZE} ${.TARGET}
+CLEANFILES+=	bootjs.net.map
 
 .include bsd.prog.mk



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

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 08:20:31 UTC 2011

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

Log Message:
add strpct man mage


To generate a diff of this commit:
cvs rdiff -u -r1.1664 -r1.1665 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1664 src/distrib/sets/lists/comp/mi:1.1665
--- src/distrib/sets/lists/comp/mi:1.1664	Fri Aug 26 17:22:08 2011
+++ src/distrib/sets/lists/comp/mi	Sun Aug 28 04:20:29 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1664 2011/08/26 21:22:08 dyoung Exp $
+#	$NetBSD: mi,v 1.1665 2011/08/28 08:20:29 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -8872,6 +8872,7 @@
 ./usr/share/man/cat3/strnvis.0			comp-c-catman		.cat
 ./usr/share/man/cat3/strnvisx.0			comp-c-catman		.cat
 ./usr/share/man/cat3/strpbrk.0			comp-c-catman		.cat
+./usr/share/man/cat3/strpct.0			comp-c-catman		.cat
 ./usr/share/man/cat3/strptime.0			comp-c-catman		.cat
 ./usr/share/man/cat3/strrchr.0			comp-c-catman		.cat
 ./usr/share/man/cat3/strsep.0			comp-c-catman		.cat
@@ -14968,6 +14969,7 @@
 ./usr/share/man/html3/strnvis.html		comp-c-htmlman		html
 ./usr/share/man/html3/strnvisx.html		comp-c-htmlman		html
 ./usr/share/man/html3/strpbrk.html		comp-c-htmlman		html
+./usr/share/man/html3/strpct.html		comp-c-htmlman		html
 ./usr/share/man/html3/strptime.html		comp-c-htmlman		html
 ./usr/share/man/html3/strrchr.html		comp-c-htmlman		html
 ./usr/share/man/html3/strsep.html		comp-c-htmlman		html
@@ -21100,6 +21102,7 @@
 ./usr/share/man/man3/strnvis.3			comp-c-man		.man
 ./usr/share/man/man3/strnvisx.3			comp-c-man		.man
 ./usr/share/man/man3/strpbrk.3			comp-c-man		.man
+./usr/share/man/man3/strpct.3			comp-c-man		.man
 ./usr/share/man/man3/strptime.3			comp-c-man		.man
 ./usr/share/man/man3/strrchr.3			comp-c-man		.man
 ./usr/share/man/man3/strsep.3			comp-c-man		.man



CVS commit: src/bin/df

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 08:20:58 UTC 2011

Modified Files:
src/bin/df: Makefile df.c

Log Message:
- static/__dead
- use strpct from libutil
- fix off by one in format


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/bin/df/Makefile
cvs rdiff -u -r1.86 -r1.87 src/bin/df/df.c

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

Modified files:

Index: src/bin/df/Makefile
diff -u src/bin/df/Makefile:1.18 src/bin/df/Makefile:1.19
--- src/bin/df/Makefile:1.18	Sun Aug 14 06:53:17 2011
+++ src/bin/df/Makefile	Sun Aug 28 04:20:58 2011
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.18 2011/08/14 10:53:17 christos Exp $
+#	$NetBSD: Makefile,v 1.19 2011/08/28 08:20:58 christos Exp $
 #	@(#)Makefile	8.3 (Berkeley) 5/8/95
 
 .include bsd.own.mk
 
 PROG=	df
-.PATH:  ${NETBSDSRCDIR}/bin/csh
-SRCS=	df.c strpct.c
-COPTS.strpct.c = -Wno-format-nonliteral
+
+LDADD+=-lutil
+DPADD+=${LIBUTIL}
 
 .include bsd.prog.mk

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.86 src/bin/df/df.c:1.87
--- src/bin/df/df.c:1.86	Sat Jun  6 05:30:45 2009
+++ src/bin/df/df.c	Sun Aug 28 04:20:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.86 2009/06/06 09:30:45 mlelstv Exp $ */
+/*	$NetBSD: df.c,v 1.87 2011/08/28 08:20:58 christos Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@
 #if 0
 static char sccsid[] = @(#)df.c	8.7 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: df.c,v 1.86 2009/06/06 09:30:45 mlelstv Exp $);
+__RCSID($NetBSD: df.c,v 1.87 2011/08/28 08:20:58 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -63,25 +63,20 @@
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include util.h
 
-extern char *strpct(u_long, u_long, u_int);
-
-int	 main(int, char *[]);
-int	 bread(off_t, void *, int);
-char	*getmntpt(char *);
-void	 prtstat(struct statvfs *, int);
-int	 selected(const char *, size_t);
-void	 maketypelist(char *);
-long	 regetmntinfo(struct statvfs **, long);
-void	 usage(void);
-void	 prthumanval(int64_t, const char *);
-void	 prthuman(struct statvfs *, int64_t, int64_t);
-const char *
-	strpct64(uint64_t, uint64_t, u_int);
-
-int	aflag, gflag, hflag, iflag, lflag, nflag, Pflag;
-long	usize = 0;
-char	**typelist = NULL;
+static char	*getmntpt(const char *);
+static void	 prtstat(struct statvfs *, int);
+static int	 selected(const char *, size_t);
+static void	 maketypelist(char *);
+static size_t	 regetmntinfo(struct statvfs **, size_t);
+__dead static void usage(void);
+static void	 prthumanval(int64_t, const char *);
+static void	 prthuman(struct statvfs *, int64_t, int64_t);
+
+static int	 aflag, gflag, hflag, iflag, lflag, nflag, Pflag;
+static long	 usize;
+static char	**typelist;
 
 int
 main(int argc, char *argv[])
@@ -212,44 +207,45 @@
 	}
 	for (i = 0; i  mntsize; i++)
 		prtstat(mntbuf[i], maxwidth);
-	exit(0);
-	/* NOTREACHED */
+	return 0;
 }
 
-char *
-getmntpt(char *name)
+static char *
+getmntpt(const char *name)
 {
-	long mntsize, i;
+	size_t mntsize, i;
 	struct statvfs *mntbuf;
 
 	mntsize = getmntinfo(mntbuf, MNT_NOWAIT);
+	if (mntsize == 0)
+		err(EXIT_FAILURE, Can't get mount information);
 	for (i = 0; i  mntsize; i++) {
 		if (!strcmp(mntbuf[i].f_mntfromname, name))
-			return (mntbuf[i].f_mntonname);
+			return mntbuf[i].f_mntonname;
 	}
-	return (0);
+	return 0;
 }
 
 static enum { IN_LIST, NOT_IN_LIST } which;
 
-int
+static int
 selected(const char *type, size_t len)
 {
 	char **av;
 
 	/* If no type specified, it's always selected. */
 	if (typelist == NULL)
-		return (1);
+		return 1;
 	for (av = typelist; *av != NULL; ++av)
 		if (!strncmp(type, *av, len))
-			return (which == IN_LIST ? 1 : 0);
-	return (which == IN_LIST ? 0 : 1);
+			return which == IN_LIST ? 1 : 0;
+	return which == IN_LIST ? 0 : 1;
 }
 
-void
+static void
 maketypelist(char *fslist)
 {
-	int i;
+	size_t i;
 	char *nextcp, **av;
 
 	if ((fslist == NULL) || (fslist[0] == '\0'))
@@ -272,7 +268,7 @@
 		++nextcp;
 
 	/* Build an array of that many types. */
-	if ((av = typelist = malloc((i + 1) * sizeof(char *))) == NULL)
+	if ((av = typelist = malloc((i + 1) * sizeof(*av))) == NULL)
 		err(EXIT_FAILURE, can't allocate type array);
 	av[0] = fslist;
 	for (i = 1, nextcp = fslist;
@@ -289,14 +285,14 @@
  * filesystem types not in ``fsmask'' and possibly re-stating to get
  * current (not cached) info.  Returns the new count of valid statvfs bufs.
  */
-long
-regetmntinfo(struct statvfs **mntbufp, long mntsize)
+static size_t
+regetmntinfo(struct statvfs **mntbufp, size_t mntsize)
 {
-	int i, j;
+	size_t i, j;
 	struct statvfs *mntbuf;
 
 	if (!lflag  typelist == NULL  aflag)
-		return (nflag ? mntsize : getmntinfo(mntbufp, MNT_WAIT));
+		return nflag ? mntsize : (size_t)getmntinfo(mntbufp, MNT_WAIT);
 
 	mntbuf = *mntbufp;
 	j = 0;
@@ -323,10 +319,10 @@
 		}
 		j++;
 	}
-	return (j);
+	return j;
 }
 
-void
+static void
 prthumanval(int64_t bytes, const char *pad)
 {
 	char 

CVS commit: src/usr.bin/time

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 08:24:42 UTC 2011

Modified Files:
src/usr.bin/time: Makefile time.c

Log Message:
use strpct from libutil.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/time/Makefile
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/time/time.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/time/Makefile
diff -u src/usr.bin/time/Makefile:1.8 src/usr.bin/time/Makefile:1.9
--- src/usr.bin/time/Makefile:1.8	Wed Aug 17 09:29:39 2011
+++ src/usr.bin/time/Makefile	Sun Aug 28 04:24:42 2011
@@ -1,15 +1,16 @@
-#	$NetBSD: Makefile,v 1.8 2011/08/17 13:29:39 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2011/08/28 08:24:42 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include bsd.own.mk
 
 CPPFLAGS+=	-DNOT_CSH
 CPPFLAGS+=	-I. -I${NETBSDSRCDIR}/bin
-SRCS=	time.c strpct.c xtime.c
+SRCS=	time.c xtime.c
 PROG=	time
 
-COPTS.strpct.c += -Wno-format-nonliteral
-
 .PATH: ${NETBSDSRCDIR}/bin/csh
 
+LDADD+=-lutil
+DPADD+=${LIBUTIL}
+
 .include bsd.prog.mk

Index: src/usr.bin/time/time.c
diff -u src/usr.bin/time/time.c:1.19 src/usr.bin/time/time.c:1.20
--- src/usr.bin/time/time.c:1.19	Mon Jul 21 10:19:26 2008
+++ src/usr.bin/time/time.c	Sun Aug 28 04:24:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.c,v 1.19 2008/07/21 14:19:26 lukem Exp $	*/
+/*	$NetBSD: time.c,v 1.20 2011/08/28 08:24:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)time.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: time.c,v 1.19 2008/07/21 14:19:26 lukem Exp $);
+__RCSID($NetBSD: time.c,v 1.20 2011/08/28 08:24:42 christos Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -56,8 +56,7 @@
 
 #include ext.h
 
-int		main(int, char **);
-static void	usage(void);
+__dead static void	usage(void);
 static void	prl(long, const char *);
 static void	prtv(const char *, const char *, const struct timeval *,
 const char *);
@@ -174,7 +173,7 @@
 }
 
 static void
-usage()
+usage(void)
 {
 
 	(void)fprintf(stderr, usage: %s [-clp] utility [argument ...]\n,



CVS commit: src/sys/fs/union

2011-08-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Aug 28 08:27:57 UTC 2011

Modified Files:
src/sys/fs/union: union_vfsops.c

Log Message:
Print the warning message on mount once.

Should fix PR #42795 (patch to make mounting union filesystems less obnoxious)


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/fs/union/union_vfsops.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/fs/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.63 src/sys/fs/union/union_vfsops.c:1.64
--- src/sys/fs/union/union_vfsops.c:1.63	Mon Jul  5 21:27:08 2010
+++ src/sys/fs/union/union_vfsops.c	Sun Aug 28 08:27:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.63 2010/07/05 21:27:08 pooka Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.64 2011/08/28 08:27:57 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_vfsops.c,v 1.63 2010/07/05 21:27:08 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_vfsops.c,v 1.64 2011/08/28 08:27:57 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -101,6 +101,9 @@
 VFS_PROTOS(union);
 
 static struct sysctllog *union_sysctl_log;
+static const char *warn_user =
+WARNING: the union file system is experimental\n
+WARNING: it can cause crashes and file system corruption\n;
 
 /*
  * Mount union filesystem
@@ -148,8 +151,10 @@
 		goto bad;
 	}
 
-	printf(WARNING: the union file system is experimental\n
-	WARNING: it can cause crashes and file system corruption\n);
+	if (warn_user != NULL) {
+		printf(%s, warn_user);
+		warn_user = NULL;
+	}
 
 	lowerrootvp = mp-mnt_vnodecovered;
 	vref(lowerrootvp);



CVS commit: src/usr.sbin/chroot

2011-08-28 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Aug 28 08:32:47 UTC 2011

Modified Files:
src/usr.sbin/chroot: chroot.c

Log Message:
Initialize local variables that previously were global (user, group).


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/chroot/chroot.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/chroot/chroot.c
diff -u src/usr.sbin/chroot/chroot.c:1.17 src/usr.sbin/chroot/chroot.c:1.18
--- src/usr.sbin/chroot/chroot.c:1.17	Sat Aug 27 22:32:44 2011
+++ src/usr.sbin/chroot/chroot.c	Sun Aug 28 08:32:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: chroot.c,v 1.17 2011/08/27 22:32:44 joerg Exp $	*/
+/*	$NetBSD: chroot.c,v 1.18 2011/08/28 08:32:47 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)chroot.c	8.1 (Berkeley) 6/9/93;
 #else
-__RCSID($NetBSD: chroot.c,v 1.17 2011/08/27 22:32:44 joerg Exp $);
+__RCSID($NetBSD: chroot.c,v 1.18 2011/08/28 08:32:47 mbalmer Exp $);
 #endif
 #endif /* not lint */
 
@@ -72,6 +72,8 @@
 	uid_t		uid;
 	int		ch, gids;
 
+	user = NULL;
+	group = NULL;
 	gid = 0;
 	uid = 0;
 	while ((ch = getopt(argc, argv, G:g:u:)) != -1) {



CVS commit: src/share/misc

2011-08-28 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sun Aug 28 08:41:01 UTC 2011

Modified Files:
src/share/misc: acronyms

Log Message:
add TINLA - this is not legal advice


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.206 src/share/misc/acronyms:1.207
--- src/share/misc/acronyms:1.206	Sat Mar 26 12:39:16 2011
+++ src/share/misc/acronyms	Sun Aug 28 08:41:01 2011
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.206 2011/03/26 12:39:16 dholland Exp $
+$NetBSD: acronyms,v 1.207 2011/08/28 08:41:01 jnemeth Exp $
 10Q	thank you
 10X	thanks
 1337	elite (leet)
@@ -454,6 +454,7 @@
 TIC	tonque in cheek
 TIL	today I learned
 TINC	there is no cabal
+TINLA	this is not legal advice
 TINWIS	this is not what I said
 TJM	that's just me
 TLA	three letter acronym



CVS commit: src/sbin/pppoectl

2011-08-28 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Aug 28 08:43:02 UTC 2011

Modified Files:
src/sbin/pppoectl: pppoectl.c

Log Message:
Remove duplicate static.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/pppoectl/pppoectl.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/pppoectl/pppoectl.c
diff -u src/sbin/pppoectl/pppoectl.c:1.23 src/sbin/pppoectl/pppoectl.c:1.24
--- src/sbin/pppoectl/pppoectl.c:1.23	Sat Aug 27 18:44:44 2011
+++ src/sbin/pppoectl/pppoectl.c	Sun Aug 28 08:43:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pppoectl.c,v 1.23 2011/08/27 18:44:44 joerg Exp $	*/
+/*	$NetBSD: pppoectl.c,v 1.24 2011/08/28 08:43:02 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 1997 Joerg Wunsch
@@ -31,7 +31,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: pppoectl.c,v 1.23 2011/08/27 18:44:44 joerg Exp $);
+__RCSID($NetBSD: pppoectl.c,v 1.24 2011/08/28 08:43:02 mbalmer Exp $);
 #endif
 
 
@@ -60,7 +60,7 @@
 static const char *phase_name(int phase);
 static const char *proto_name(int proto);
 static const char *authflags(int flags);
-static static void pppoectl_argument(char *arg);
+static void pppoectl_argument(char *arg);
 
 static int hz = 0;
 



CVS commit: src/tests/util/df

2011-08-28 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Aug 28 09:02:51 UTC 2011

Modified Files:
src/tests/util/df: Makefile

Log Message:
Fix build (strcpt fallout).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/util/df/Makefile

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

Modified files:

Index: src/tests/util/df/Makefile
diff -u src/tests/util/df/Makefile:1.3 src/tests/util/df/Makefile:1.4
--- src/tests/util/df/Makefile:1.3	Wed Aug 17 17:08:59 2011
+++ src/tests/util/df/Makefile	Sun Aug 28 09:02:51 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/08/17 17:08:59 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2011/08/28 09:02:51 mbalmer Exp $
 
 NOMAN=  	# defined
 
@@ -11,8 +11,10 @@
 BINDIR=		${TESTSDIR}
 PROG=		h_df
 .PATH:  	${NETBSDSRCDIR}/bin/df
-.PATH:  	${NETBSDSRCDIR}/bin/csh
-SRCS=		df.c strpct.c getmntinfo.c
+SRCS=		df.c getmntinfo.c
+
+LDADD+=		-lutil
+DPADD+=		${LIBUTIL}
 
 # Pass -DINTREE to make to test using humanize_number.c in source tree
 # directly instead of the one in libc.



CVS commit: src/sys/dev/ic

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 09:32:21 UTC 2011

Modified Files:
src/sys/dev/ic: wdc.c

Log Message:
Make this compile again without WDC_NO_IDS.


To generate a diff of this commit:
cvs rdiff -u -r1.263 -r1.264 src/sys/dev/ic/wdc.c

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

Modified files:

Index: src/sys/dev/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.263 src/sys/dev/ic/wdc.c:1.264
--- src/sys/dev/ic/wdc.c:1.263	Sat Aug 27 13:05:58 2011
+++ src/sys/dev/ic/wdc.c	Sun Aug 28 05:32:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.263 2011/08/27 17:05:58 bouyer Exp $ */
+/*	$NetBSD: wdc.c,v 1.264 2011/08/28 09:32:21 christos Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wdc.c,v 1.263 2011/08/27 17:05:58 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: wdc.c,v 1.264 2011/08/28 09:32:21 christos Exp $);
 
 #include opt_ata.h
 #include opt_wdc.h
@@ -299,7 +299,9 @@
 		return;
 	}
 
+#ifndef WDC_NO_IDS
 	s = splbio();
+#endif
 	/* for ATA/OLD drives, wait for DRDY, 3s timeout */
 	for (i = 0; i  mstohz(3000); i++) {
 		/*
@@ -338,11 +340,12 @@
 		 * delay instead
 		 */
 		delay(100 / hz);
+	}
 #else
-#error NEED WDC_NO_IDS
 		tsleep(params, PRIBIO, atadrdy, 1);
-#endif
 	}
+	s = splbio();
+#endif
 	if ((st0  WDCS_DRDY) == 0)
 		chp-ch_drive[0].drive_flags = ~(DRIVE_ATA|DRIVE_OLD);
 	if ((st1  WDCS_DRDY) == 0)
@@ -1096,7 +1099,7 @@
 	u_int8_t sc0 = 0, sn0 = 0, cl0 = 0, ch0 = 0;
 	u_int8_t sc1 = 0, sn1 = 0, cl1 = 0, ch1 = 0;
 #endif
-	KASSERT(poll == 1);
+	KASSERT(poll == RESET_POLL);
 	if (poll)
 		nloop = WDCNDELAY_RST;
 	else
@@ -1505,16 +1508,13 @@
 		drive_flags = chp-ch_drive[xfer-c_drive].drive_flags;
 	}
 
-#ifdef WDC_NO_IDS
-	wflags = AT_POLL;
-#else
+#ifndef WDC_NO_IDS
 	if ((ata_c-flags  (AT_WAIT | AT_POLL)) == (AT_WAIT | AT_POLL)) {
 		/* both wait and poll, we can tsleep here */
 		wflags = AT_WAIT | AT_POLL;
-	} else {
-		wflags = AT_POLL;
-	}
+	} else
 #endif
+		wflags = AT_POLL;
 
  again:
 	ATADEBUG_PRINT((__wdccommand_intr %s:%d:%d\n,



CVS commit: src/tests/util/df

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 09:39:44 UTC 2011

Modified Files:
src/tests/util/df: Makefile

Log Message:
remove strpct copts


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/util/df/Makefile

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

Modified files:

Index: src/tests/util/df/Makefile
diff -u src/tests/util/df/Makefile:1.4 src/tests/util/df/Makefile:1.5
--- src/tests/util/df/Makefile:1.4	Sun Aug 28 05:02:51 2011
+++ src/tests/util/df/Makefile	Sun Aug 28 05:39:44 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2011/08/28 09:02:51 mbalmer Exp $
+#	$NetBSD: Makefile,v 1.5 2011/08/28 09:39:44 christos Exp $
 
 NOMAN=  	# defined
 
@@ -24,6 +24,4 @@
 SRCS+=		humanize_number.c
 .endif
 
-COPTS.strpct.c += -Wno-format-nonliteral
-
 .include bsd.test.mk



CVS commit: src/sys/dev/ata

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 09:43:25 UTC 2011

Modified Files:
src/sys/dev/ata: ata_wdc.c

Log Message:
make this compile.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/ata/ata_wdc.c

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

Modified files:

Index: src/sys/dev/ata/ata_wdc.c
diff -u src/sys/dev/ata/ata_wdc.c:1.94 src/sys/dev/ata/ata_wdc.c:1.95
--- src/sys/dev/ata/ata_wdc.c:1.94	Sat Aug 27 13:05:57 2011
+++ src/sys/dev/ata/ata_wdc.c	Sun Aug 28 05:43:25 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_wdc.c,v 1.94 2011/08/27 17:05:57 bouyer Exp $	*/
+/*	$NetBSD: ata_wdc.c,v 1.95 2011/08/28 09:43:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata_wdc.c,v 1.94 2011/08/27 17:05:57 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata_wdc.c,v 1.95 2011/08/28 09:43:25 christos Exp $);
 
 #include opt_ata.h
 #include opt_wdc.h
@@ -179,12 +179,12 @@
 	struct wdc_regs *wdr = wdc-regs[chp-ch_channel];
 	struct ata_bio *ata_bio = xfer-c_cmd;
 	struct ata_drive_datas *drvp = chp-ch_drive[xfer-c_drive];
-	int wait_flags = (xfer-c_flags  C_POLL) ? AT_POLL : 0;
+	int wait_flags;
 	const char *errstring;
 #ifdef WDC_NO_IDS
 	wait_flags = AT_POLL;
 #else
-#error NEED WDC_NO_IDS
+	wait_flags = (xfer-c_flags  C_POLL) ? AT_POLL : 0;
 #endif
 
 	ATADEBUG_PRINT((wdc_ata_bio_start %s:%d:%d\n,



CVS commit: src/sbin/init

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 10:13:03 UTC 2011

Modified Files:
src/sbin/init: init.c

Log Message:
make it compile with SMALLPROG


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sbin/init/init.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/init/init.c
diff -u src/sbin/init/init.c:1.101 src/sbin/init/init.c:1.102
--- src/sbin/init/init.c:1.101	Sat Aug 27 13:43:42 2011
+++ src/sbin/init/init.c	Sun Aug 28 06:13:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.101 2011/08/27 17:43:42 joerg Exp $	*/
+/*	$NetBSD: init.c,v 1.102 2011/08/28 10:13:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)init.c	8.2 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: init.c,v 1.101 2011/08/27 17:43:42 joerg Exp $);
+__RCSID($NetBSD: init.c,v 1.102 2011/08/28 10:13:03 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -127,12 +127,14 @@
 #define	CATATONIA	'c'
 
 static state_func_t single_user(void);
+#ifndef LETS_GET_SMALL
 static state_func_t runcom(void);
 static state_func_t read_ttys(void);
 static state_func_t multi_user(void);
 static state_func_t clean_ttys(void);
 static state_func_t catatonia(void);
 static state_func_t death(void);
+#endif
 
 static enum { AUTOBOOT, FASTBOOT } runcom_mode = AUTOBOOT;
 
@@ -155,32 +157,29 @@
 	struct	init_session *se_next;
 } session_t;
 
-static void free_session(session_t *);
-static session_t *new_session(session_t *, int, struct ttyent *);
-static session_t *sessions;
-
-static char **construct_argv(char *);
-static void start_window_system(session_t *);
 static void collect_child(pid_t, int);
-static pid_t start_getty(session_t *);
+static int clang;
 static void transition_handler(int);
 static void alrm_handler(int);
 static int has_securelevel(void);
-static void setsecuritylevel(int);
-static int getsecuritylevel(void);
 static int securelevel_present;
-static int setupargv(session_t *, struct ttyent *);
-static int clang;
 
+#ifndef LETS_GET_SMALL
+static int do_setttyent(void);
+static void start_window_system(session_t *);
+static char **construct_argv(char *);
+static int setupargv(session_t *, struct ttyent *);
+static pid_t start_getty(session_t *);
+static void free_session(session_t *);
+static session_t *new_session(session_t *, int, struct ttyent *);
+static session_t *sessions;
+static void setsecuritylevel(int);
+static int getsecuritylevel(void);
 static int start_session_db(void);
 static void add_session(session_t *);
 static void del_session(session_t *);
 static session_t *find_session(pid_t);
 static DB *session_db;
-
-static int do_setttyent(void);
-
-#ifndef LETS_GET_SMALL
 static state_t requested_transition = runcom;
 
 static void clear_session_logs(session_t *, int);
@@ -1727,6 +1726,7 @@
 }
 #endif
 
+#ifndef LETS_GET_SMALL
 static int
 do_setttyent(void)
 {
@@ -1742,6 +1742,7 @@
 #endif /* CHROOT */
 		return setttyent();
 }
+#endif
 
 #if !defined(LETS_GET_SMALL)  defined(CHROOT)
 



CVS commit: src/sys/dev/ic

2011-08-28 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Aug 28 10:21:41 UTC 2011

Modified Files:
src/sys/dev/ic: wdc.c

Log Message:
Revert previous and fix properly by just removing the #error and a bogus
KASSERT() (these 2 are leftover from the experiments on the fuloong
and were not intended to be commited).


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/dev/ic/wdc.c

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

Modified files:

Index: src/sys/dev/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.264 src/sys/dev/ic/wdc.c:1.265
--- src/sys/dev/ic/wdc.c:1.264	Sun Aug 28 09:32:21 2011
+++ src/sys/dev/ic/wdc.c	Sun Aug 28 10:21:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.264 2011/08/28 09:32:21 christos Exp $ */
+/*	$NetBSD: wdc.c,v 1.265 2011/08/28 10:21:41 bouyer Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wdc.c,v 1.264 2011/08/28 09:32:21 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: wdc.c,v 1.265 2011/08/28 10:21:41 bouyer Exp $);
 
 #include opt_ata.h
 #include opt_wdc.h
@@ -299,9 +299,7 @@
 		return;
 	}
 
-#ifndef WDC_NO_IDS
 	s = splbio();
-#endif
 	/* for ATA/OLD drives, wait for DRDY, 3s timeout */
 	for (i = 0; i  mstohz(3000); i++) {
 		/*
@@ -340,12 +338,10 @@
 		 * delay instead
 		 */
 		delay(100 / hz);
-	}
 #else
 		tsleep(params, PRIBIO, atadrdy, 1);
-	}
-	s = splbio();
 #endif
+	}
 	if ((st0  WDCS_DRDY) == 0)
 		chp-ch_drive[0].drive_flags = ~(DRIVE_ATA|DRIVE_OLD);
 	if ((st1  WDCS_DRDY) == 0)
@@ -1099,7 +1095,6 @@
 	u_int8_t sc0 = 0, sn0 = 0, cl0 = 0, ch0 = 0;
 	u_int8_t sc1 = 0, sn1 = 0, cl1 = 0, ch1 = 0;
 #endif
-	KASSERT(poll == RESET_POLL);
 	if (poll)
 		nloop = WDCNDELAY_RST;
 	else
@@ -1508,13 +1503,16 @@
 		drive_flags = chp-ch_drive[xfer-c_drive].drive_flags;
 	}
 
-#ifndef WDC_NO_IDS
+#ifdef WDC_NO_IDS
+	wflags = AT_POLL;
+#else
 	if ((ata_c-flags  (AT_WAIT | AT_POLL)) == (AT_WAIT | AT_POLL)) {
 		/* both wait and poll, we can tsleep here */
 		wflags = AT_WAIT | AT_POLL;
-	} else
-#endif
+	} else {
 		wflags = AT_POLL;
+	}
+#endif
 
  again:
 	ATADEBUG_PRINT((__wdccommand_intr %s:%d:%d\n,



CVS commit: src/sys/arch/sparc/sparc

2011-08-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 28 10:26:15 UTC 2011

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

Log Message:
fix sparc UP kernels with GCC 4.5, with special thanks to help from
mlelstv@ tracking down the real issue.

sp_tlb_flush() makes various assumptions about the ABI and what GCC
will do with the rest of this function.  the inputs were not referenced
by name but only as %o0 etc inside the asm.  the result was that GCC
was not filling in the function parameters before calling it because
they were not used in the function.  so, sp_tlb_flush() was getting
random data for it's inputs.  oops.

for now, convert 2 asm() calls to pure C, and mark the inputs for
the sta calls.  this makes GCC generate the right code, but it still
isn't entirely optimal.

ideally a pure C version would exist, but that adds non-trivial
overhead (15 instructions vs 23 or so.)

one more enhancement to make here would be to assign the %o3, %o4 and
%o5 usage into explicit temp variables, instead of assuming that they
are going to be free to use.


To generate a diff of this commit:
cvs rdiff -u -r1.344 -r1.345 src/sys/arch/sparc/sparc/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/sparc/sparc/pmap.c
diff -u src/sys/arch/sparc/sparc/pmap.c:1.344 src/sys/arch/sparc/sparc/pmap.c:1.345
--- src/sys/arch/sparc/sparc/pmap.c:1.344	Wed Aug 24 02:51:13 2011
+++ src/sys/arch/sparc/sparc/pmap.c	Sun Aug 28 10:26:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.344 2011/08/24 02:51:13 mrg Exp $ */
+/*	$NetBSD: pmap.c,v 1.345 2011/08/28 10:26:15 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.344 2011/08/24 02:51:13 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.345 2011/08/28 10:26:15 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -614,12 +614,12 @@
 	__asm(lda	[%%o4]%0, %%o5 :: n(ASI_SRMMU));
 
 	/* Set new context and flush type bits */
-	__asm(andn	%o0, 0xfff, %o0);
-	__asm(sta	%%o1, [%%o4]%0 :: n(ASI_SRMMU));
-	__asm(or	%o0, %o2, %o0);
+	va = ~0xfff;
+	__asm(sta	%1, [%%o4]%0 :: n(ASI_SRMMU), r(ctx));
+	va |= lvl;
 
 	/* Do the TLB flush */
-	__asm(sta	%%g0, [%%o0]%0 :: n(ASI_SRMMUFP));
+	__asm(sta	%%g0, [%1]%0 :: n(ASI_SRMMUFP), r(va));
 
 	/* Restore context */
 	__asm(sta	%%o5, [%%o4]%0 :: n(ASI_SRMMU));
@@ -689,7 +689,7 @@
 {
 
 	if (CPU_ISSUN4D) {
-		sp_tlb_flush(ctx, 0, ASI_SRMMUFP_L0);
+		sp_tlb_flush(0, ctx, ASI_SRMMUFP_L0);
 	} else
 		FXCALL3(sp_tlb_flush, ft_tlb_flush, 0, ctx, ASI_SRMMUFP_L0, cpuset);
 }
@@ -715,7 +715,7 @@
 #define tlb_flush_page(va,ctx,s)	sp_tlb_flush(va,ctx,ASI_SRMMUFP_L3)
 #define tlb_flush_segment(va,ctx,s)	sp_tlb_flush(va,ctx,ASI_SRMMUFP_L2)
 #define tlb_flush_region(va,ctx,s)	sp_tlb_flush(va,ctx,ASI_SRMMUFP_L1)
-#define tlb_flush_context(ctx,s)	sp_tlb_flush(ctx,0,ASI_SRMMUFP_L0)
+#define tlb_flush_context(ctx,s)	sp_tlb_flush(0,ctx,ASI_SRMMUFP_L0)
 #define tlb_flush_all()			sp_tlb_flush_all()
 #endif /* MULTIPROCESSOR */
 



CVS commit: src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et

2011-08-28 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Aug 28 10:28:36 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et: Makefile

Log Message:
Change the location of version.h from the old Heimdal srcs to the
new srcs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/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/heimdal/lib/libcom_err/compile_et/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.2 src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.3
--- src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.2	Fri Apr 15 19:41:11 2011
+++ src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile	Sun Aug 28 10:28:35 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2011/04/15 19:41:11 elric Exp $
+# $NetBSD: Makefile,v 1.3 2011/08/28 10:28:35 elric Exp $
 
 NOMAN=		# defined
 
@@ -37,7 +37,7 @@
 
 DPSRCS=		print_version.h
 
-make-print-version.lo: ${NETBSDSRCDIR}/include/heimdal/version.h
+make-print-version.lo: ${HEIMBASE}/include/version.h
 
 make-print-version: make-print-version.lo
 	${HOST_CC} ${HOST_LDFLAGS} -o ${.TARGET} ${.ALLSRC}



CVS commit: src/crypto/external/bsd/heimdal/lib/libvers

2011-08-28 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Aug 28 11:20:16 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/lib/libvers: Makefile

Log Message:
Change the location of version.h from the old Heimdal srcs to the
new srcs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/lib/libvers/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/heimdal/lib/libvers/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libvers/Makefile:1.1 src/crypto/external/bsd/heimdal/lib/libvers/Makefile:1.2
--- src/crypto/external/bsd/heimdal/lib/libvers/Makefile:1.1	Wed Apr 13 19:16:56 2011
+++ src/crypto/external/bsd/heimdal/lib/libvers/Makefile	Sun Aug 28 11:20:16 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:56 elric Exp $
+# $NetBSD: Makefile,v 1.2 2011/08/28 11:20:16 elric Exp $
 
 NOLINKLIB=	# defined
 NOPIC=		# defined
@@ -16,9 +16,9 @@
 SRCS=		print_version.c
 DPSRCS=		print_version.h
  
-HOST_CPPFLAGS+=	-I${NETBSDSRCDIR}/include/heimdal -DHAVE_CONFIG_H
+HOST_CPPFLAGS+=	-I${HEIMBASE}/include -DHAVE_CONFIG_H
 
-make-print-version.lo: ${NETBSDSRCDIR}/include/heimdal/version.h
+make-print-version.lo: ${HEIMBASE}/include/version.h
 
 make-print-version: make-print-version.lo
 	${HOST_CC} ${HOST_LDFLAGS} -o ${.TARGET} ${.ALLSRC}



CVS commit: src/sys/dev/gpio

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 11:36:17 UTC 2011

Modified Files:
src/sys/dev/gpio: gpiosim.c

Log Message:
build with WARNS=3


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/gpio/gpiosim.c

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

Modified files:

Index: src/sys/dev/gpio/gpiosim.c
diff -u src/sys/dev/gpio/gpiosim.c:1.10 src/sys/dev/gpio/gpiosim.c:1.11
--- src/sys/dev/gpio/gpiosim.c:1.10	Fri Aug 26 15:00:07 2011
+++ src/sys/dev/gpio/gpiosim.c	Sun Aug 28 11:36:17 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiosim.c,v 1.10 2011/08/26 15:00:07 mbalmer Exp $ */
+/* $NetBSD: gpiosim.c,v 1.11 2011/08/28 11:36:17 jmcneill Exp $ */
 /*  $OpenBSD: gpiosim.c,v 1.1 2008/11/23 18:46:49 mbalmer Exp $	*/
 
 /*
@@ -245,7 +245,7 @@
 		.cf_flags = 0,
 		.cf_pspec = NULL,
 	},
-	{ NULL }
+	{ NULL, NULL, 0, FSTATE_NOTFOUND, NULL, 0, NULL }
 };
 
 static int



CVS commit: src/sys

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 15:40:50 UTC 2011

Modified Files:
src/sys/dev/pci: azalia.c
src/sys/external/bsd/drm/dist/bsd-core: i915_drv.c radeon_drv.c
src/sys/modules: Makefile.inc
src/sys/modules/azalia: Makefile
src/sys/modules/i915drm: Makefile
src/sys/modules/pf: Makefile
src/sys/modules/radeondrm: Makefile
Added Files:
src/sys/modules/azalia: azalia.ioconf
src/sys/modules/i915drm: i915drm.ioconf
src/sys/modules/radeondrm: radeondrm.ioconf

Log Message:
set default WARNS for modules to 3 -- the only one that needs  3 now is pf


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/azalia.c
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/azalia/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/azalia/azalia.ioconf
cvs rdiff -u -r1.5 -r1.6 src/sys/modules/i915drm/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/i915drm/i915drm.ioconf
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/pf/Makefile
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/radeondrm/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/radeondrm/radeondrm.ioconf

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

Modified files:

Index: src/sys/dev/pci/azalia.c
diff -u src/sys/dev/pci/azalia.c:1.75 src/sys/dev/pci/azalia.c:1.76
--- src/sys/dev/pci/azalia.c:1.75	Tue May 25 08:37:10 2010
+++ src/sys/dev/pci/azalia.c	Sun Aug 28 15:40:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: azalia.c,v 1.75 2010/05/25 08:37:10 pgoyette Exp $	*/
+/*	$NetBSD: azalia.c,v 1.76 2011/08/28 15:40:49 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: azalia.c,v 1.75 2010/05/25 08:37:10 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: azalia.c,v 1.76 2011/08/28 15:40:49 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -2406,69 +2406,33 @@
 	return 0;
 }
 
-#ifdef _MODULE
-
 MODULE(MODULE_CLASS_DRIVER, azalia, NULL);
 
-static const struct cfiattrdata audiobuscf_iattrdata = {
-	audiobus, 0, { { NULL, NULL, 0 }, }
-};
-static const struct cfiattrdata * const azalia_attrs[] = {
-	audiobuscf_iattrdata, NULL
-};
-CFDRIVER_DECL(azalia, DV_DULL, azalia_attrs);
-extern struct cfattach azalia_ca;
-static int azalialoc[] = { -1, -1 };
-static struct cfparent pciparent = {
-	pci, pci, DVUNIT_ANY
-};
-static struct cfdata azalia_cfdata[] = {
-	{
-		.cf_name = azalia,
-		.cf_atname = azalia,
-		.cf_unit = 0,
-		.cf_fstate = FSTATE_STAR,
-		.cf_loc = azalialoc,
-		.cf_flags = 0,
-		.cf_pspec = pciparent,
-	},
-	{ NULL }
-};
+#ifdef _MODULE
+#include ioconf.c
+#endif
 
 static int
 azalia_modcmd(modcmd_t cmd, void *arg)
 {
-	int err, s;
+	int error = 0;
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
-		err = config_cfdriver_attach(azalia_cd);
-		if (err)
-			return err;
-		err = config_cfattach_attach(azalia, azalia_ca);
-		if (err) {
-			config_cfdriver_detach(azalia_cd);
-			return err;
-		}
-		s = splaudio();
-		err = config_cfdata_attach(azalia_cfdata, 1);
-		splx(s);
-		if (err) {
-			config_cfattach_detach(azalia, azalia_ca);
-			config_cfdriver_detach(azalia_cd);
-			return err;
-		}
-		return 0;
+#ifdef _MODULE
+		error = config_init_component(cfdriver_ioconf_azalia,
+		cfattach_ioconf_azalia, cfdata_ioconf_azalia);
+#endif
+		break;
 	case MODULE_CMD_FINI:
-		err = config_cfdata_detach(azalia_cfdata);
-		if (err)
-			return err;
-		config_cfattach_detach(azalia, azalia_ca);
-		config_cfdriver_detach(azalia_cd);
-		return 0;
+#ifdef _MODULE
+		error = config_fini_component(cfdriver_ioconf_azalia,
+		cfattach_ioconf_azalia, cfdata_ioconf_azalia);
+#endif
+		break;
 	default:
 		return ENOTTY;
 	}
-}
 
-#endif
+	return error;
+}

Index: src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.8 src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.9
--- src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.8	Wed Feb 24 22:38:09 2010
+++ src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c	Sun Aug 28 15:40:50 2011
@@ -214,62 +214,35 @@
 CFATTACH_DECL_NEW(i915drm, sizeof(struct drm_device), i915drm_probe,
 i915drm_attach, i915drm_detach, NULL);
 
-#ifdef _MODULE
-
 MODULE(MODULE_CLASS_DRIVER, i915drm, drm);
 
-CFDRIVER_DECL(i915drm, DV_DULL, NULL);
-extern struct cfattach i915drm_ca;
-static int drmloc[] = { -1 };
-static struct cfparent drmparent = {
-	drm, vga, DVUNIT_ANY
-};
-static struct cfdata i915drm_cfdata[] = {
-	{
-		.cf_name = i915drm,
-		.cf_atname = i915drm,
-		.cf_unit = 0,
-		.cf_fstate = FSTATE_STAR,
-		.cf_loc = drmloc,
-		.cf_flags = 0,
-		.cf_pspec = drmparent,
-	},
-	{ NULL }
-};
+#ifdef _MODULE
+#include 

CVS commit: src/sbin/fdisk

2011-08-28 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Aug 28 15:46:26 UTC 2011

Modified Files:
src/sbin/fdisk: fdisk.c

Log Message:
fix the sparc build


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sbin/fdisk/fdisk.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/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.133 src/sbin/fdisk/fdisk.c:1.134
--- src/sbin/fdisk/fdisk.c:1.133	Sat Aug 27 20:49:03 2011
+++ src/sbin/fdisk/fdisk.c	Sun Aug 28 15:46:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.133 2011/08/27 20:49:03 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.134 2011/08/28 15:46:26 gson Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: fdisk.c,v 1.133 2011/08/27 20:49:03 christos Exp $);
+__RCSID($NetBSD: fdisk.c,v 1.134 2011/08/28 15:46:26 gson Exp $);
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -292,7 +292,6 @@
 #define	DEC_RND_0	4		/* convert 0 to size of a track */
 #define DEC_RND_DOWN	8		/* subtract 1 track */
 #define DEC_RND_DOWN_2	16		/* subtract 2 tracks */
-static void	string(const char *, int, char *);
 static int	ptn_id(const char *, int *);
 static int	type_match(const void *, const void *);
 static const char *get_type(int);
@@ -302,6 +301,7 @@
 static void	install_bootsel(int);
 static daddr_t	get_default_boot(void);
 static void	set_default_boot(daddr_t);
+static void	string(const char *, int, char *);
 #endif
 
 static void



CVS commit: src/sys/modules

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 15:48:20 UTC 2011

Modified Files:
src/sys/modules/aps: Makefile
src/sys/modules/ath: Makefile
src/sys/modules/ath_hal: Makefile
src/sys/modules/coram: Makefile
src/sys/modules/dbcool: Makefile
src/sys/modules/est: Makefile
src/sys/modules/hdafg: Makefile
src/sys/modules/hdaudio: Makefile
src/sys/modules/if_alc: Makefile
src/sys/modules/if_ath_pci: Makefile
src/sys/modules/if_cas: Makefile
src/sys/modules/nsclpcsio: Makefile
src/sys/modules/powernow: Makefile

Log Message:
WARNS=3 is the default


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/aps/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/ath/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/ath_hal/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/coram/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/dbcool/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/est/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/hdafg/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/hdaudio/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/if_alc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/if_ath_pci/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/if_cas/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/nsclpcsio/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/powernow/Makefile

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

Modified files:

Index: src/sys/modules/aps/Makefile
diff -u src/sys/modules/aps/Makefile:1.1 src/sys/modules/aps/Makefile:1.2
--- src/sys/modules/aps/Makefile:1.1	Sun Jan 16 01:07:32 2011
+++ src/sys/modules/aps/Makefile	Sun Aug 28 15:48:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/01/16 01:07:32 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.2 2011/08/28 15:48:19 jmcneill Exp $
 
 .include ../Makefile.inc
 
@@ -8,6 +8,4 @@
 IOCONF=	aps.ioconf
 SRCS=	aps.c
 
-WARNS=	3
-
 .include bsd.kmodule.mk

Index: src/sys/modules/ath/Makefile
diff -u src/sys/modules/ath/Makefile:1.1 src/sys/modules/ath/Makefile:1.2
--- src/sys/modules/ath/Makefile:1.1	Sun Feb 20 03:58:33 2011
+++ src/sys/modules/ath/Makefile	Sun Aug 28 15:48:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/02/20 03:58:33 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.2 2011/08/28 15:48:19 jmcneill Exp $
 
 .include ../Makefile.inc
 
@@ -10,7 +10,6 @@
 	ath_netbsd.c \
 	athrate-sample.c
 
-WARNS=		3
 CPPFLAGS+=	-DINET
 
 .include ../ath_hal/Makefile.inc

Index: src/sys/modules/ath_hal/Makefile
diff -u src/sys/modules/ath_hal/Makefile:1.3 src/sys/modules/ath_hal/Makefile:1.4
--- src/sys/modules/ath_hal/Makefile:1.3	Mon Feb 21 11:16:47 2011
+++ src/sys/modules/ath_hal/Makefile	Sun Aug 28 15:48:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/02/21 11:16:47 cegger Exp $
+#	$NetBSD: Makefile,v 1.4 2011/08/28 15:48:19 jmcneill Exp $
 
 .include ../Makefile.inc
 
@@ -94,8 +94,6 @@
 	ar9285_attach.c \
 	ar9285_reset.c
 
-WARNS=		3
-
 .include Makefile.inc
 
 .include bsd.kmodule.mk

Index: src/sys/modules/coram/Makefile
diff -u src/sys/modules/coram/Makefile:1.1 src/sys/modules/coram/Makefile:1.2
--- src/sys/modules/coram/Makefile:1.1	Thu Aug  4 22:26:07 2011
+++ src/sys/modules/coram/Makefile	Sun Aug 28 15:48:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/08/04 22:26:07 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.2 2011/08/28 15:48:19 jmcneill Exp $
 
 .include ../Makefile.inc
 
@@ -8,6 +8,4 @@
 IOCONF=	coram.ioconf
 SRCS=	coram.c
 
-WARNS=	3
-
 .include bsd.kmodule.mk

Index: src/sys/modules/dbcool/Makefile
diff -u src/sys/modules/dbcool/Makefile:1.1 src/sys/modules/dbcool/Makefile:1.2
--- src/sys/modules/dbcool/Makefile:1.1	Sun Jul 31 16:05:28 2011
+++ src/sys/modules/dbcool/Makefile	Sun Aug 28 15:48:19 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/07/31 16:05:28 jmcneill Exp $
+# $NetBSD: Makefile,v 1.2 2011/08/28 15:48:19 jmcneill Exp $
 
 .include ../Makefile.inc
 
@@ -8,6 +8,4 @@
 IOCONF=	dbcool.ioconf
 SRCS=	dbcool.c
 
-WARNS=	3
-
 .include bsd.kmodule.mk

Index: src/sys/modules/est/Makefile
diff -u src/sys/modules/est/Makefile:1.1 src/sys/modules/est/Makefile:1.2
--- src/sys/modules/est/Makefile:1.1	Wed Feb 23 11:55:36 2011
+++ src/sys/modules/est/Makefile	Sun Aug 28 15:48:19 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/02/23 11:55:36 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2011/08/28 15:48:19 jmcneill Exp $
 
 .include ../Makefile.inc
 
@@ -8,6 +8,4 @@
 IOCONF=	est.ioconf
 SRCS=	est.c intel_busclock.c
 
-WARNS=	3
-
 .include bsd.kmodule.mk

Index: src/sys/modules/hdafg/Makefile
diff -u src/sys/modules/hdafg/Makefile:1.3 src/sys/modules/hdafg/Makefile:1.4
--- src/sys/modules/hdafg/Makefile:1.3	Sat Feb 12 15:15:56 2011
+++ src/sys/modules/hdafg/Makefile	Sun Aug 28 15:48:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/02/12 15:15:56 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.4 

CVS commit: src

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 15:56:22 UTC 2011

Modified Files:
src/distrib/sets/lists/modules: md.i386
src/sys/external/bsd/drm/dist/bsd-core: ati_pcigart.c radeon_drv.c
src/sys/modules/radeondrm: Makefile
Added Files:
src/sys/modules/ati_pcigart: Makefile

Log Message:
Split out ati_pcigart into a separate module so it can be shared with r128drm


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm/dist/bsd-core/ati_pcigart.c
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c
cvs rdiff -u -r0 -r1.1 src/sys/modules/ati_pcigart/Makefile
cvs rdiff -u -r1.9 -r1.10 src/sys/modules/radeondrm/Makefile

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

Modified files:

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.33 src/distrib/sets/lists/modules/md.i386:1.34
--- src/distrib/sets/lists/modules/md.i386:1.33	Thu Aug 11 12:03:58 2011
+++ src/distrib/sets/lists/modules/md.i386	Sun Aug 28 15:56:21 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.33 2011/08/11 12:03:58 mbalmer Exp $
+# $NetBSD: md.i386,v 1.34 2011/08/28 15:56:21 jmcneill Exp $
 ./@MODULEDIR@/acpiacadbase-kernel-modules	kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/acpibatbase-kernel-modules	kmod
@@ -33,6 +33,8 @@
 ./@MODULEDIR@/aps/aps.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/asusbase-kernel-modules	kmod
 ./@MODULEDIR@/asus/asus.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/ati_pcigart			base-kernel-modules	kmod
+./@MODULEDIR@/ati_pcigart/ati_pcigart.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/au8522base-kernel-modules	kmod
 ./@MODULEDIR@/au8522/au8522.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/auvitekbase-kernel-modules	kmod

Index: src/sys/external/bsd/drm/dist/bsd-core/ati_pcigart.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/ati_pcigart.c:1.5 src/sys/external/bsd/drm/dist/bsd-core/ati_pcigart.c:1.6
--- src/sys/external/bsd/drm/dist/bsd-core/ati_pcigart.c:1.5	Wed Sep  2 01:34:34 2009
+++ src/sys/external/bsd/drm/dist/bsd-core/ati_pcigart.c	Sun Aug 28 15:56:21 2011
@@ -302,3 +302,13 @@
 	gart_info-bus_addr = bus_address;
 	return ret;
 }
+
+MODULE(MODULE_CLASS_MISC, ati_pcigart, drm);
+
+static int
+ati_pcigart_modcmd(modcmd_t cmd, void *priv)
+{
+	if (cmd == MODULE_CMD_INIT || cmd == MODULE_CMD_FINI)
+		return 0;
+	return ENOTTY;
+}

Index: src/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c:1.11 src/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c:1.12
--- src/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c:1.11	Sun Aug 28 15:40:50 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c	Sun Aug 28 15:56:21 2011
@@ -201,7 +201,7 @@
 CFATTACH_DECL_NEW(radeondrm, sizeof(struct drm_device),
 radeondrm_probe, radeondrm_attach, radeondrm_detach, NULL);
 
-MODULE(MODULE_CLASS_DRIVER, radeondrm, drm);
+MODULE(MODULE_CLASS_DRIVER, radeondrm, drm,ati_pcigart);
 
 #ifdef _MODULE
 #include ioconf.c

Index: src/sys/modules/radeondrm/Makefile
diff -u src/sys/modules/radeondrm/Makefile:1.9 src/sys/modules/radeondrm/Makefile:1.10
--- src/sys/modules/radeondrm/Makefile:1.9	Sun Aug 28 15:40:50 2011
+++ src/sys/modules/radeondrm/Makefile	Sun Aug 28 15:56:22 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2011/08/28 15:40:50 jmcneill Exp $
+# $NetBSD: Makefile,v 1.10 2011/08/28 15:56:22 jmcneill Exp $
 
 .include ../Makefile.inc
 
@@ -9,8 +9,6 @@
 IOCONF=	radeondrm.ioconf
 
 SRCS=	radeon_drv.c
-# XXX this one should be in a sub-driver to share with r128drm
-SRCS+=	ati_pcigart.c
 SRCS+=	r300_cmdbuf.c
 SRCS+=	r600_cp.c
 SRCS+=	r600_blit.c

Added files:

Index: src/sys/modules/ati_pcigart/Makefile
diff -u /dev/null src/sys/modules/ati_pcigart/Makefile:1.1
--- /dev/null	Sun Aug 28 15:56:22 2011
+++ src/sys/modules/ati_pcigart/Makefile	Sun Aug 28 15:56:21 2011
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2011/08/28 15:56:21 jmcneill Exp $
+
+.include ../Makefile.inc
+
+.PATH:	${S}/external/bsd/drm/dist/bsd-core
+
+KMOD=   ati_pcigart
+
+SRCS=	ati_pcigart.c
+
+CPPFLAGS+=	-I${S}/external/bsd/drm/dist/shared-core
+
+.include bsd.kmodule.mk



CVS commit: src

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 16:19:08 UTC 2011

Modified Files:
src/distrib/sets/lists/modules: md.i386
src/sys/external/bsd/drm/dist/bsd-core: mach64_drv.c mga_drv.c
r128_drv.c savage_drv.c sis_drv.c tdfx_drv.c
src/sys/modules: Makefile
Added Files:
src/sys/modules/mach64drm: Makefile mach64drm.ioconf
src/sys/modules/mgadrm: Makefile mgadrm.ioconf
src/sys/modules/r128drm: Makefile r128drm.ioconf
src/sys/modules/savagedrm: Makefile savagedrm.ioconf
src/sys/modules/sisdrm: Makefile sisdrm.ioconf
src/sys/modules/tdfxdrm: Makefile tdfxdrm.ioconf

Log Message:
add mach64drm, mgadrm, r128drm, savagedrm, sisdrm, and tdfxdrm modules


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c \
src/sys/external/bsd/drm/dist/bsd-core/r128_drv.c \
src/sys/external/bsd/drm/dist/bsd-core/savage_drv.c \
src/sys/external/bsd/drm/dist/bsd-core/sis_drv.c \
src/sys/external/bsd/drm/dist/bsd-core/tdfx_drv.c
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm/dist/bsd-core/mga_drv.c
cvs rdiff -u -r1.89 -r1.90 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/mach64drm/Makefile \
src/sys/modules/mach64drm/mach64drm.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/mgadrm/Makefile \
src/sys/modules/mgadrm/mgadrm.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/r128drm/Makefile \
src/sys/modules/r128drm/r128drm.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/savagedrm/Makefile \
src/sys/modules/savagedrm/savagedrm.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/sisdrm/Makefile \
src/sys/modules/sisdrm/sisdrm.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/tdfxdrm/Makefile \
src/sys/modules/tdfxdrm/tdfxdrm.ioconf

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/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.34 src/distrib/sets/lists/modules/md.i386:1.35
--- src/distrib/sets/lists/modules/md.i386:1.34	Sun Aug 28 15:56:21 2011
+++ src/distrib/sets/lists/modules/md.i386	Sun Aug 28 16:19:08 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.34 2011/08/28 15:56:21 jmcneill Exp $
+# $NetBSD: md.i386,v 1.35 2011/08/28 16:19:08 jmcneill Exp $
 ./@MODULEDIR@/acpiacadbase-kernel-modules	kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/acpibatbase-kernel-modules	kmod
@@ -85,14 +85,16 @@
 ./@MODULEDIR@/itesio/itesio.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/lg3303base-kernel-modules	kmod
 ./@MODULEDIR@/lg3303/lg3303.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/mach64drmbase-kernel-modules	kmod
+./@MODULEDIR@/mach64drm/mach64drm.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/mgadrmbase-kernel-modules	kmod
+./@MODULEDIR@/mgadrm/mgadrm.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/mt2131base-kernel-modules	kmod
 ./@MODULEDIR@/mt2131/mt2131.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/nsclpcsiobase-kernel-modules	kmod
 ./@MODULEDIR@/nsclpcsio/nsclpcsio.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/nxt2kbase-kernel-modules	kmod
 ./@MODULEDIR@/nxt2k/nxt2k.kmod			base-kernel-modules	kmod
-./@MODULEDIR@/radeondrmbase-kernel-modules	kmod
-./@MODULEDIR@/radeondrm/radeondrm.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/odcmbase-kernel-modules	kmod
 ./@MODULEDIR@/odcm/odcm.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/padbase-kernel-modules	kmod
@@ -103,6 +105,16 @@
 ./@MODULEDIR@/powernow/powernow.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/pwdogbase-kernel-modules	kmod
 ./@MODULEDIR@/pwdog/pwdog.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/r128drmbase-kernel-modules	kmod
+./@MODULEDIR@/r128drm/r128drm.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/radeondrmbase-kernel-modules	kmod
+./@MODULEDIR@/radeondrm/radeondrm.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/savagedrmbase-kernel-modules	kmod
+./@MODULEDIR@/savagedrm/savagedrm.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/sisdrmbase-kernel-modules	kmod
+./@MODULEDIR@/sisdrm/sisdrm.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/tdfxdrmbase-kernel-modules	kmod
+./@MODULEDIR@/tdfxdrm/tdfxdrm.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/thinkpadbase-kernel-modules	kmod
 ./@MODULEDIR@/thinkpad/thinkpad.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/tprof_amdpmi			base-kernel-modules	kmod

Index: src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c:1.5 src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c:1.6
--- src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c:1.5	Sun Dec  6 22:51:25 2009
+++ src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c	Sun Aug 28 16:19:08 2011
@@ -163,62 +163,35 @@
 CFATTACH_DECL_NEW(mach64drm, 

CVS commit: src/sys/dev/pci

2011-08-28 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Aug 28 16:33:52 UTC 2011

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

Log Message:
Revert prior inadvertent checkin.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/if_iwn.c

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.57 src/sys/dev/pci/if_iwn.c:1.58
--- src/sys/dev/pci/if_iwn.c:1.57	Sun Aug 28 16:26:29 2011
+++ src/sys/dev/pci/if_iwn.c	Sun Aug 28 16:33:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.57 2011/08/28 16:26:29 elric Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.58 2011/08/28 16:33:51 elric Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.57 2011/08/28 16:26:29 elric Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.58 2011/08/28 16:33:51 elric Exp $);
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -305,7 +305,7 @@
 #ifdef IWN_DEBUG
 #define DPRINTF(x)	do { if (iwn_debug  0) printf x; } while (0)
 #define DPRINTFN(n, x)	do { if (iwn_debug = (n)) printf x; } while (0)
-int iwn_debug = 100;
+int iwn_debug = 0;
 #else
 #define DPRINTF(x)
 #define DPRINTFN(n, x)



CVS commit: src/usr.sbin/gpioctl

2011-08-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 28 17:10:38 UTC 2011

Modified Files:
src/usr.sbin/gpioctl: gpioctl.8

Log Message:
Use Cm to mark up command arguments. Use An -nosplit to avoid linebreak in 
sentence.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/gpioctl/gpioctl.8

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/gpioctl/gpioctl.8
diff -u src/usr.sbin/gpioctl/gpioctl.8:1.9 src/usr.sbin/gpioctl/gpioctl.8:1.10
--- src/usr.sbin/gpioctl/gpioctl.8:1.9	Sun Aug 28 07:48:50 2011
+++ src/usr.sbin/gpioctl/gpioctl.8	Sun Aug 28 17:10:37 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: gpioctl.8,v 1.9 2011/08/28 07:48:50 mbalmer Exp $
+.\ $NetBSD: gpioctl.8,v 1.10 2011/08/28 17:10:37 wiz Exp $
 .\
 .\ Copyright (c) 2009, 2010, 2011 Marc Balmer m...@msys.ch
 .\ Copyright (c) 2004 Alexander Yurchenko gra...@openbsd.org
@@ -25,14 +25,14 @@
 .Nm gpioctl
 .Op Fl q
 .Ar device
-attach
+.Cm attach
 .Ar device
 .Ar offset
 .Ar mask
 .Nm gpioctl
 .Op Fl q
 .Ar device
-detach
+.Cm detach
 .Ar device
 .Nm gpioctl
 .Op Fl q
@@ -48,20 +48,20 @@
 .Op Fl q
 .Ar device
 .Ar pin
-pulse
+.Cm pulse
 .Op Ar frequency Op Ar duty cycle
 .Nm gpioctl
 .Op Fl q
 .Ar device
 .Ar pin
-set
+.Cm set
 .Op Ar flags
 .Op Ar name
 .Nm gpioctl
 .Op Fl q
 .Ar device
 .Ar pin
-unset
+.Cm unset
 .Sh DESCRIPTION
 The
 .Nm
@@ -222,6 +222,7 @@
 and
 .Nx 4.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Nm
 program was written by



CVS commit: src/sbin/resize_ffs

2011-08-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 28 17:15:17 UTC 2011

Modified Files:
src/sbin/resize_ffs: resize_ffs.8

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sbin/resize_ffs/resize_ffs.8

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

Modified files:

Index: src/sbin/resize_ffs/resize_ffs.8
diff -u src/sbin/resize_ffs/resize_ffs.8:1.11 src/sbin/resize_ffs/resize_ffs.8:1.12
--- src/sbin/resize_ffs/resize_ffs.8:1.11	Sat Aug 27 16:34:57 2011
+++ src/sbin/resize_ffs/resize_ffs.8	Sun Aug 28 17:15:16 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: resize_ffs.8,v 1.11 2011/08/27 16:34:57 christos Exp $
+.\ $NetBSD: resize_ffs.8,v 1.12 2011/08/28 17:15:16 wiz Exp $
 .\
 .\ As its sole author, I explicitly place this man page in the public
 .\ domain.  Anyone may use it in any way for any purpose (though I would
@@ -59,7 +59,8 @@
 .It Fl s
 Specify the file system size to which the file system should be
 resized.
-The size is given as the count of disk sectors, usually 512 bytes. To see the 
+The size is given as the count of disk sectors, usually 512 bytes.
+To see the
 exact value, have a look at the disk specification or the disklabel.
 Mostly used to shrink file systems.
 .It Fl y



CVS commit: src/sys/dev/drm

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 17:18:31 UTC 2011

Modified Files:
src/sys/dev/drm: vbox_drv.c

Log Message:
add dependency on drm module


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/drm/vbox_drv.c

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

Modified files:

Index: src/sys/dev/drm/vbox_drv.c
diff -u src/sys/dev/drm/vbox_drv.c:1.1 src/sys/dev/drm/vbox_drv.c:1.2
--- src/sys/dev/drm/vbox_drv.c:1.1	Sun Feb 20 15:40:21 2011
+++ src/sys/dev/drm/vbox_drv.c	Sun Aug 28 17:18:31 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vbox_drv.c,v 1.1 2011/02/20 15:40:21 jmcneill Exp $ */
+/* $NetBSD: vbox_drv.c,v 1.2 2011/08/28 17:18:31 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vbox_drv.c,v 1.1 2011/02/20 15:40:21 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: vbox_drv.c,v 1.2 2011/08/28 17:18:31 jmcneill Exp $);
 
 #include drmP.h
 #include drm.h
@@ -104,7 +104,7 @@
 NULL
 );
 
-MODULE(MODULE_CLASS_DRIVER, vboxdrm, NULL);
+MODULE(MODULE_CLASS_DRIVER, vboxdrm, drm);
 
 #ifdef _MODULE
 #include ioconf.c



CVS commit: src/lib/libutil

2011-08-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 28 17:21:28 UTC 2011

Modified Files:
src/lib/libutil: strpct.3

Log Message:
Minor cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libutil/strpct.3

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

Modified files:

Index: src/lib/libutil/strpct.3
diff -u src/lib/libutil/strpct.3:1.1 src/lib/libutil/strpct.3:1.2
--- src/lib/libutil/strpct.3:1.1	Sun Aug 28 07:45:14 2011
+++ src/lib/libutil/strpct.3	Sun Aug 28 17:21:28 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: strpct.3,v 1.1 2011/08/28 07:45:14 christos Exp $
+.\ $NetBSD: strpct.3,v 1.2 2011/08/28 17:21:28 wiz Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -49,10 +49,10 @@
 .Fa precision .
 .Sh RETURN VALUES
 .Fn strpct
-always returns a pointer to a NUL terminated formatted string which
+always returns a pointer to a NUL-terminated formatted string which
 is placed in
 .Fa buf
-and it is up to
+and is up to
 .Fa buflen
 characters.
 If there was an overflow, the formatted string will reflect that precision
@@ -68,10 +68,10 @@
 .Fn strpct
 was originally implemented in
 .Xr csh 1 .
-It printed into a static buffer, was not locale aware, handled 
+It printed into a static buffer, was not locale aware, handled
 .Ft unsigned long
 numbers, and printed a
-.Dq % 
+.Dq %
 at the end of the number.
 Other programs such as
 .Xr df 1
@@ -80,4 +80,4 @@
 started using it.
 .Fn strpct
 appeared in
-.Nx 6 .
+.Nx 6.0 .



CVS commit: src/sys/miscfs/procfs

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 18:48:14 UTC 2011

Modified Files:
src/sys/miscfs/procfs: procfs_linux.c

Log Message:
both LINUX_USRSTACK32 and USRSTACK32 need to be defined for linux32


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/miscfs/procfs/procfs_linux.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/miscfs/procfs/procfs_linux.c
diff -u src/sys/miscfs/procfs/procfs_linux.c:1.59 src/sys/miscfs/procfs/procfs_linux.c:1.60
--- src/sys/miscfs/procfs/procfs_linux.c:1.59	Mon Dec 20 00:25:47 2010
+++ src/sys/miscfs/procfs/procfs_linux.c	Sun Aug 28 18:48:14 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: procfs_linux.c,v 1.59 2010/12/20 00:25:47 matt Exp $  */
+/*  $NetBSD: procfs_linux.c,v 1.60 2011/08/28 18:48:14 jmcneill Exp $  */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: procfs_linux.c,v 1.59 2010/12/20 00:25:47 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: procfs_linux.c,v 1.60 2011/08/28 18:48:14 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -96,7 +96,7 @@
 			break;
 		}
 	}
-#ifdef LINUX_USRSTACK32
+#if defined(LINUX_USRSTACK32)  defined(USRSTACK32)
 	if (strcmp(p-p_emul-e_name, linux32) == 0 
 	LINUX_USRSTACK32  USRSTACK32)
 		*sstack = (unsigned long)LINUX_USRSTACK32;



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

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 18:48:46 UTC 2011

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

Log Message:
pull in sys/mount.h; build fix for amd64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/usermode/usermode/procfs_machdep.c

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

Modified files:

Index: src/sys/arch/usermode/usermode/procfs_machdep.c
diff -u src/sys/arch/usermode/usermode/procfs_machdep.c:1.1 src/sys/arch/usermode/usermode/procfs_machdep.c:1.2
--- src/sys/arch/usermode/usermode/procfs_machdep.c:1.1	Wed Aug 24 10:59:37 2011
+++ src/sys/arch/usermode/usermode/procfs_machdep.c	Sun Aug 28 18:48:46 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_machdep.c,v 1.1 2011/08/24 10:59:37 jmcneill Exp $ */
+/* $NetBSD: procfs_machdep.c,v 1.2 2011/08/28 18:48:46 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -27,10 +27,11 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: procfs_machdep.c,v 1.1 2011/08/24 10:59:37 jmcneill Exp $);
+__RCSID($NetBSD: procfs_machdep.c,v 1.2 2011/08/28 18:48:46 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
+#include sys/mount.h
 
 #include miscfs/procfs/procfs.h
 



CVS commit: src/tests/util/df

2011-08-28 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Aug 28 19:09:34 UTC 2011

Modified Files:
src/tests/util/df: t_df.sh

Log Message:
Golden output was not so golden after all


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/util/df/t_df.sh

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

Modified files:

Index: src/tests/util/df/t_df.sh
diff -u src/tests/util/df/t_df.sh:1.7 src/tests/util/df/t_df.sh:1.8
--- src/tests/util/df/t_df.sh:1.7	Sun Nov  7 17:51:23 2010
+++ src/tests/util/df/t_df.sh	Sun Aug 28 19:09:34 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_df.sh,v 1.7 2010/11/07 17:51:23 jmmv Exp $
+# $NetBSD: t_df.sh,v 1.8 2011/08/28 19:09:34 gson Exp $
 #
 # Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,7 +33,7 @@
 }
 normal_body() {
 	cat expout EOF
-Filesystem   1K-blocks   Used  Avail %Cap Mounted on
+Filesystem   1K-blocks   Used  Avail  %Cap Mounted on
 filer:/  1202716672 135168 1202581504   0% /filer
 filer:/  1202716672  0 1202716672   0% /filer
 filer:/  1202716672  240543334  962173337  20% /filer



CVS commit: src/sys/arch/usermode

2011-08-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sun Aug 28 19:37:16 UTC 2011

Modified Files:
src/sys/arch/usermode/include: thunk.h
src/sys/arch/usermode/usermode: thunk.c

Log Message:
Add thunk_makecontext_trapframe2go()


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/usermode/include/thunk.h
cvs rdiff -u -r1.20 -r1.21 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/include/thunk.h
diff -u src/sys/arch/usermode/include/thunk.h:1.18 src/sys/arch/usermode/include/thunk.h:1.19
--- src/sys/arch/usermode/include/thunk.h:1.18	Sat Aug 27 21:14:15 2011
+++ src/sys/arch/usermode/include/thunk.h	Sun Aug 28 19:37:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.h,v 1.18 2011/08/27 21:14:15 reinoud Exp $ */
+/* $NetBSD: thunk.h,v 1.19 2011/08/28 19:37:15 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -60,6 +60,7 @@
 int	thunk_getcontext(ucontext_t *);
 int	thunk_setcontext(const ucontext_t *);
 void	thunk_makecontext(ucontext_t *, void (*)(void), int, void (*)(void *), void *); 
+void	thunk_makecontext_trapframe2go(ucontext_t *, void *func, void *trapframe);
 int	thunk_swapcontext(ucontext_t *, ucontext_t *);
 
 int	thunk_getchar(void);

Index: src/sys/arch/usermode/usermode/thunk.c
diff -u src/sys/arch/usermode/usermode/thunk.c:1.20 src/sys/arch/usermode/usermode/thunk.c:1.21
--- src/sys/arch/usermode/usermode/thunk.c:1.20	Sat Aug 27 21:14:15 2011
+++ src/sys/arch/usermode/usermode/thunk.c	Sun Aug 28 19:37:16 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.20 2011/08/27 21:14:15 reinoud Exp $ */
+/* $NetBSD: thunk.c,v 1.21 2011/08/28 19:37:16 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: thunk.c,v 1.20 2011/08/27 21:14:15 reinoud Exp $);
+__RCSID($NetBSD: thunk.c,v 1.21 2011/08/28 19:37:16 reinoud Exp $);
 
 #include sys/types.h
 #include sys/ansi.h
@@ -173,6 +173,12 @@
 	makecontext(ucp, func, argc, arg1, arg2);
 }
 
+void
+thunk_makecontext_trapframe2go(ucontext_t *ucp, void *func, void *trapframe)
+{
+	makecontext(ucp, func, 1, trapframe);
+}
+
 int
 thunk_swapcontext(ucontext_t *oucp, ucontext_t *ucp)
 {



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

2011-08-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sun Aug 28 19:38:20 UTC 2011

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

Log Message:
Don't use the content of trapframe yet until we know how to use fill it


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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.9 src/sys/arch/usermode/usermode/trap.c:1.10
--- src/sys/arch/usermode/usermode/trap.c:1.9	Sun Aug 28 00:40:10 2011
+++ src/sys/arch/usermode/usermode/trap.c	Sun Aug 28 19:38:20 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.9 2011/08/28 00:40:10 jmcneill Exp $ */
+/* $NetBSD: trap.c,v 1.10 2011/08/28 19:38:20 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.9 2011/08/28 00:40:10 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.10 2011/08/28 19:38:20 reinoud Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -146,12 +146,12 @@
 /* copyin / copyout */
 if (!onfault)
 	panic(kernel fault);
-
+panic(%s: can't call onfault yet\n, __func__);
 /* jump to given onfault */
 tf = kernel_tf;
 memset(tf, 0, sizeof(struct trapframe));
-tf-tf_pc = onfault;
-tf-tf_out[0] = (rv == EACCES) ? EFAULT : rv;
+// tf-tf_pc = onfault;
+// tf-tf_io[0] = (rv == EACCES) ? EFAULT : rv;
 recurse--;
 return;
 			}



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

2011-08-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sun Aug 28 19:39:05 UTC 2011

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

Log Message:
Clean child_return()


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/usermode/syscall.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/syscall.c
diff -u src/sys/arch/usermode/usermode/syscall.c:1.3 src/sys/arch/usermode/usermode/syscall.c:1.4
--- src/sys/arch/usermode/usermode/syscall.c:1.3	Sat Aug 27 21:17:26 2011
+++ src/sys/arch/usermode/usermode/syscall.c	Sun Aug 28 19:39:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.3 2011/08/27 21:17:26 reinoud Exp $ */
+/* $NetBSD: syscall.c,v 1.4 2011/08/28 19:39:05 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.3 2011/08/27 21:17:26 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.4 2011/08/28 19:39:05 reinoud Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -36,24 +36,26 @@
 #include sys/lwp.h
 #include sys/sched.h
 #include sys/userret.h
+#include sys/ktrace.h
+#include sys/syscall.h
 #include machine/pcb.h
+#include machine/thunk.h
 
 void	syscall(void);
 
 void
 child_return(void *arg)
 {
-printf(child returned! arg %p\n, arg);
-printf(xxx now what? switch to `userland' i.e. new code?\n);
 	lwp_t *l = arg;
 //	struct pcb *pcb = lwp_getpcb(l);
 //	struct trapframe *frame = pcb-pcb_tf;
 
-/* XXX? */
-	//frame-tf_r0 = 0;
+	/* XXX? */
+//	frame-registers[0] = 0;
 
+printf(child returned! arg %p\n, arg);
 	mi_userret(l);
-//	ktrsysret(SYS_fork, 0, 0);
+	ktrsysret(SYS_fork, 0, 0);
 }
 
 void



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

2011-08-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sun Aug 28 19:39:42 UTC 2011

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

Log Message:
Implement redementary setregs()


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/usermode/usermode/machdep.c

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

Modified files:

Index: src/sys/arch/usermode/usermode/machdep.c
diff -u src/sys/arch/usermode/usermode/machdep.c:1.16 src/sys/arch/usermode/usermode/machdep.c:1.17
--- src/sys/arch/usermode/usermode/machdep.c:1.16	Sat Aug 27 21:16:15 2011
+++ src/sys/arch/usermode/usermode/machdep.c	Sun Aug 28 19:39:42 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.16 2011/08/27 21:16:15 reinoud Exp $ */
+/* $NetBSD: machdep.c,v 1.17 2011/08/28 19:39:42 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.16 2011/08/27 21:16:15 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.17 2011/08/28 19:39:42 reinoud Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -35,6 +35,8 @@
 #include sys/exec.h
 #include sys/buf.h
 #include sys/boot_flag.h
+#include sys/ucontext.h
+#include machine/pcb.h
 
 #include uvm/uvm_extern.h
 #include uvm/uvm_page.h
@@ -134,7 +136,22 @@
 void
 setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
 {
+	struct pcb *pcb = lwp_getpcb(l);
+
 printf(setregs called: lwp %p, exec package %p, stack %p\n, l, pack, (void *) stack);
+printf(cur pcb %p\n, pcb);
+printf(\tpcb-pcb_ucp.uc_stack.ss_sp   = %p\n, pcb-pcb_ucp.uc_stack.ss_sp);
+printf(\tpcb-pcb_ucp.uc_stack.ss_size = %d\n, (int) pcb-pcb_ucp.uc_stack.ss_size);
+
+	pcb-pcb_ucp.uc_stack.ss_sp = (void *) stack;
+	pcb-pcb_ucp.uc_stack.ss_size = pack-ep_ssize;
+	thunk_makecontext_trapframe2go(pcb-pcb_ucp, (void *) pack-ep_entry, pcb-pcb_tf);
+
+printf(new pcb %p\n, pcb);
+printf(\tpcb-pcb_ucp.uc_stack.ss_sp   = %p\n, pcb-pcb_ucp.uc_stack.ss_sp);
+printf(\tpcb-pcb_ucp.uc_stack.ss_size = %d\n, (int) pcb-pcb_ucp.uc_stack.ss_size);
+printf(\tpack-ep_entry= %p\n, (void *) pack-ep_entry);
+printf(\targument  = %p\n, pcb-pcb_tf);
 }
 
 void



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

2011-08-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sun Aug 28 19:40:26 UTC 2011

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

Log Message:
Update trapframe and pcb


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/sys/arch/usermode/include/pcb.h:1.5
--- src/sys/arch/usermode/include/pcb.h:1.4	Thu Aug 25 14:24:48 2011
+++ src/sys/arch/usermode/include/pcb.h	Sun Aug 28 19:40:26 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pcb.h,v 1.4 2011/08/25 14:24:48 reinoud Exp $ */
+/* $NetBSD: pcb.h,v 1.5 2011/08/28 19:40:26 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -38,17 +38,17 @@
  */
 
 typedef struct trapframe {
-	int		tf_reason;	/* XXX unused */
-	vaddr_t		tf_pc;		/* return address */
-	uintptr_t	tf_out[8];	/* to transport info */
+	int		(*tf_syscall)(void *);	/* address to call for syscalls */
+	int		 tf_reason;		/* XXX unused */
+	uintptr_t	 tf_io[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 */
+	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/dev

2011-08-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sun Aug 28 19:41:35 UTC 2011

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

Log Message:
Jump to `userland' or the other function specified in the pcb's ucontext


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/usermode/dev/cpu.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/cpu.c
diff -u src/sys/arch/usermode/dev/cpu.c:1.20 src/sys/arch/usermode/dev/cpu.c:1.21
--- src/sys/arch/usermode/dev/cpu.c:1.20	Sun Aug 28 00:40:10 2011
+++ src/sys/arch/usermode/dev/cpu.c	Sun Aug 28 19:41:34 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.20 2011/08/28 00:40:10 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.21 2011/08/28 19:41:34 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include opt_cpu.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.20 2011/08/28 00:40:10 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.21 2011/08/28 19:41:34 reinoud Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -269,6 +269,8 @@
 static void
 cpu_lwp_trampoline(void (*func)(void *), void *arg)
 {
+	struct pcb *pcb;
+
 #ifdef CPU_DEBUG
 	printf(cpu_lwp_trampoline called with func %p, arg %p\n, (void *) func, arg);
 #endif
@@ -276,6 +278,15 @@
 
 	func(arg);
 
+printf(%s: setting ucontext on lwp %p\n, __func__, curlwp);
+pcb = lwp_getpcb(curlwp);
+printf(pcb %p\n, pcb);
+printf(\tpcb-pcb_ucp.uc_stack.ss_sp   = %p\n, pcb-pcb_ucp.uc_stack.ss_sp);
+printf(\tpcb-pcb_ucp.uc_stack.ss_size = %d\n, (int) pcb-pcb_ucp.uc_stack.ss_size);
+
+	/* switch to userland */
+	thunk_setcontext(pcb-pcb_ucp);
+
 	panic(%s: shouldn't return, __func__);
 }
 



CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 20:22:42 UTC 2011

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core: i915_drv.c

Log Message:
return 'error' not 0, fixes non-module build


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm/dist/bsd-core/i915_drv.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/external/bsd/drm/dist/bsd-core/i915_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.9 src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.10
--- src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.9	Sun Aug 28 15:40:50 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c	Sun Aug 28 20:22:42 2011
@@ -242,7 +242,7 @@
 		return ENOTTY;
 	}
 
-	return 0;
+	return error;
 }
 
 #endif



CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 20:32:35 UTC 2011

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core: mach64_drv.c

Log Message:
return 'error' not 0, fixes non-module build


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.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/external/bsd/drm/dist/bsd-core/mach64_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c:1.6 src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c:1.7
--- src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c:1.6	Sun Aug 28 16:19:08 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/mach64_drv.c	Sun Aug 28 20:32:35 2011
@@ -191,7 +191,7 @@
 		return ENOTTY;
 	}
 
-	return 0;
+	return error;
 }
 
 #endif



CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 20:37:06 UTC 2011

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core: savage_drv.c sis_drv.c
tdfx_drv.c

Log Message:
return 'error' not 0, fixes non-module build


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm/dist/bsd-core/savage_drv.c \
src/sys/external/bsd/drm/dist/bsd-core/sis_drv.c \
src/sys/external/bsd/drm/dist/bsd-core/tdfx_drv.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/external/bsd/drm/dist/bsd-core/savage_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/savage_drv.c:1.6 src/sys/external/bsd/drm/dist/bsd-core/savage_drv.c:1.7
--- src/sys/external/bsd/drm/dist/bsd-core/savage_drv.c:1.6	Sun Aug 28 16:19:08 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/savage_drv.c	Sun Aug 28 20:37:06 2011
@@ -174,7 +174,7 @@
 		return ENOTTY;
 	}
 
-	return 0;
+	return error;
 }
 
 #endif
Index: src/sys/external/bsd/drm/dist/bsd-core/sis_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/sis_drv.c:1.6 src/sys/external/bsd/drm/dist/bsd-core/sis_drv.c:1.7
--- src/sys/external/bsd/drm/dist/bsd-core/sis_drv.c:1.6	Sun Aug 28 16:19:08 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/sis_drv.c	Sun Aug 28 20:37:06 2011
@@ -168,7 +168,7 @@
 		return ENOTTY;
 	}
 
-	return 0;
+	return error;
 }
 
 #endif
Index: src/sys/external/bsd/drm/dist/bsd-core/tdfx_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/tdfx_drv.c:1.6 src/sys/external/bsd/drm/dist/bsd-core/tdfx_drv.c:1.7
--- src/sys/external/bsd/drm/dist/bsd-core/tdfx_drv.c:1.6	Sun Aug 28 16:19:08 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/tdfx_drv.c	Sun Aug 28 20:37:06 2011
@@ -170,7 +170,7 @@
 		return ENOTTY;
 	}
 
-	return 0;
+	return error;
 }
 
 #endif



CVS commit: src/sys/dev/nand

2011-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 28 20:49:31 UTC 2011

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

Log Message:
Rename isbad argument to is_bad - stupid namespace pollution and ancient
bad sector routines interfere on some archs and cause global shadowing
warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/nand/nand.c

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

Modified files:

Index: src/sys/dev/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.15 src/sys/dev/nand/nand.c:1.16
--- src/sys/dev/nand/nand.c:1.15	Fri Jul 15 19:19:57 2011
+++ src/sys/dev/nand/nand.c	Sun Aug 28 20:49:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.15 2011/07/15 19:19:57 cliff Exp $	*/
+/*	$NetBSD: nand.c,v 1.16 2011/08/28 20:49:30 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.15 2011/07/15 19:19:57 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.16 2011/08/28 20:49:30 martin Exp $);
 
 #include locators.h
 
@@ -1372,7 +1372,7 @@
 }
 
 int
-nand_flash_isbad(device_t self, flash_off_t ofs, bool *isbad)
+nand_flash_isbad(device_t self, flash_off_t ofs, bool *is_bad)
 {
 	struct nand_softc *sc = device_private(self);
 	struct nand_chip *chip = sc-sc_chip;
@@ -1396,7 +1396,7 @@
 	result = nand_isbad(self, ofs);
 	mutex_exit(sc-sc_device_lock);
 
-	*isbad = result;
+	*is_bad = result;
 
 	return 0;
 }



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

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 21:21:05 UTC 2011

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

Log Message:
turn off input echo and buffering


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/usermode/dev/ttycons.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/ttycons.c
diff -u src/sys/arch/usermode/dev/ttycons.c:1.4 src/sys/arch/usermode/dev/ttycons.c:1.5
--- src/sys/arch/usermode/dev/ttycons.c:1.4	Fri Aug 12 00:57:24 2011
+++ src/sys/arch/usermode/dev/ttycons.c	Sun Aug 28 21:21:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ttycons.c,v 1.4 2011/08/12 00:57:24 jmcneill Exp $ */
+/* $NetBSD: ttycons.c,v 1.5 2011/08/28 21:21:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -27,12 +27,13 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ttycons.c,v 1.4 2011/08/12 00:57:24 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ttycons.c,v 1.5 2011/08/28 21:21:05 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/proc.h
 #include sys/systm.h
 #include sys/device.h
+#include sys/termios.h
 
 #include dev/cons.h
 
@@ -87,9 +88,19 @@
 void
 ttycons_consinit(void)
 {
+	struct thunk_termios t;
+
+	thunk_tcgetattr(0, t);
+	t.c_lflag = ~(ECHO|ICANON);
+	t.c_cc[VTIME] = 0;
+	t.c_cc[VMIN] = 1;
+	thunk_tcsetattr(0, TCSANOW, t);
+
 	cn_tab = ttycons_consdev;
 	cn_init_magic(ttycons_cnm_state);
 	cn_set_magic(\047\001);
+
+
 }
 
 int



CVS commit: src/sbin/resize_ffs

2011-08-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 28 21:25:11 UTC 2011

Modified Files:
src/sbin/resize_ffs: resize_ffs.8

Log Message:
Move a sentence to where it makes more sense.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sbin/resize_ffs/resize_ffs.8

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

Modified files:

Index: src/sbin/resize_ffs/resize_ffs.8
diff -u src/sbin/resize_ffs/resize_ffs.8:1.12 src/sbin/resize_ffs/resize_ffs.8:1.13
--- src/sbin/resize_ffs/resize_ffs.8:1.12	Sun Aug 28 17:15:16 2011
+++ src/sbin/resize_ffs/resize_ffs.8	Sun Aug 28 21:25:11 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: resize_ffs.8,v 1.12 2011/08/28 17:15:16 wiz Exp $
+.\ $NetBSD: resize_ffs.8,v 1.13 2011/08/28 21:25:11 wiz Exp $
 .\
 .\ As its sole author, I explicitly place this man page in the public
 .\ domain.  Anyone may use it in any way for any purpose (though I would
@@ -34,7 +34,6 @@
 When shrinking,
 .Nm
 assumes this.
-It will not work correctly for file systems with other sector sizes.)
 .Nm
 has to copy anything that currently resides in the space being shrunk
 away; there must be enough space free on the file system for this to
@@ -60,6 +59,7 @@
 Specify the file system size to which the file system should be
 resized.
 The size is given as the count of disk sectors, usually 512 bytes.
+It will not work correctly for file systems with other sector sizes.
 To see the
 exact value, have a look at the disk specification or the disklabel.
 Mostly used to shrink file systems.



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

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 21:31:41 UTC 2011

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

Log Message:
cpu_reboot: only call thunk_abort if RB_DUMP is set


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/usermode/dev/cpu.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/cpu.c
diff -u src/sys/arch/usermode/dev/cpu.c:1.21 src/sys/arch/usermode/dev/cpu.c:1.22
--- src/sys/arch/usermode/dev/cpu.c:1.21	Sun Aug 28 19:41:34 2011
+++ src/sys/arch/usermode/dev/cpu.c	Sun Aug 28 21:31:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.21 2011/08/28 19:41:34 reinoud Exp $ */
+/* $NetBSD: cpu.c,v 1.22 2011/08/28 21:31:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include opt_cpu.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.21 2011/08/28 19:41:34 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.22 2011/08/28 21:31:41 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -116,6 +116,9 @@
 	if ((howto  RB_POWERDOWN) == RB_POWERDOWN)
 		thunk_exit(0);
 
+	if (howto  RB_DUMP)
+		thunk_abort();
+
 	if (howto  RB_HALT) {
 		printf(\n);
 		printf(The operating system has halted.\n);
@@ -127,10 +130,6 @@
 
 	printf(rebooting...\n);
 
-#if defined(DIAGNOSTIC) || defined(DEBUG)
-	thunk_abort();
-#endif
-
 	usermode_reboot();
 
 	/* NOTREACHED */



CVS commit: src/share/man/man4

2011-08-28 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Aug 28 22:09:37 UTC 2011

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

Log Message:
Be more precise for Xen: + is only valid for Xen domUs. dom0 uses
the same key sequences as i386/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/share/man/man4/ddb.4

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

Modified files:

Index: src/share/man/man4/ddb.4
diff -u src/share/man/man4/ddb.4:1.143 src/share/man/man4/ddb.4:1.144
--- src/share/man/man4/ddb.4:1.143	Thu Jun 23 20:54:24 2011
+++ src/share/man/man4/ddb.4	Sun Aug 28 22:09:36 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: ddb.4,v 1.143 2011/06/23 20:54:24 wiz Exp $
+.\	$NetBSD: ddb.4,v 1.144 2011/08/28 22:09:36 jym Exp $
 .\
 .\ Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -56,7 +56,7 @@
 .\ any improvements or extensions that they make and grant Carnegie Mellon
 .\ the rights to redistribute these changes.
 .\
-.Dd June 9, 2010
+.Dd August 29, 2011
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -106,7 +106,7 @@
 There are also key sequences for each port that will activate
 .Nm
 from the keyboard:
-.Bl -tag -offset indent -width mvme68k -compact
+.Bl -tag -offset indent -width xen domU -compact
 .It alpha
 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt] on PC style keyboards.
 .It amd64
@@ -169,7 +169,7 @@
 \*[Lt]Esc\*[Gt]-\*[Lt]Shift\*[Gt]-D on serial console.
 .It x68k
 Interrupt switch on the body.
-.It xen
+.It xen domU
 +
 (five plus signs)
 .It zaurus



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

2011-08-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 28 22:30:09 UTC 2011

Modified Files:
src/sys/arch/sparc/include: psl.h

Log Message:
apply some always_inline attribute to setpsr and spl*.  while i am
not yet sure exactly why this is necessary, but does avoid crashes
seen on sparc INSTALL with gcc 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc/include/psl.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/sparc/include/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.47 src/sys/arch/sparc/include/psl.h:1.48
--- src/sys/arch/sparc/include/psl.h:1.47	Sat Jul 16 11:15:52 2011
+++ src/sys/arch/sparc/include/psl.h	Sun Aug 28 22:30:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.47 2011/07/16 11:15:52 nakayama Exp $ */
+/*	$NetBSD: psl.h,v 1.48 2011/08/28 22:30:09 mrg Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -232,7 +232,7 @@
 /*
  * GCC pseudo-functions for manipulating PSR (primarily PIL field).
  */
-static __inline int
+static __inline __attribute__((__always_inline__)) int
 getpsr(void)
 {
 	int psr;
@@ -241,7 +241,7 @@
 	return (psr);
 }
 
-static __inline int
+static __inline __attribute__((__always_inline__)) int
 getmid(void)
 {
 	int mid;
@@ -250,14 +250,14 @@
 	return ((mid  20)  0x3);
 }
 
-static __inline void
+static __inline __attribute__((__always_inline__)) void
 setpsr(int newpsr)
 {
 	__asm volatile(wr %0,0,%%psr : : r (newpsr) : memory);
 	__asm volatile(nop; nop; nop);
 }
 
-static __inline void
+static __inline __attribute__((__always_inline__)) void
 spl0(void)
 {
 	int psr, oldipl;
@@ -284,7 +284,7 @@
  * into the ipl field.)
  */
 #define	_SPLSET(name, newipl) \
-static __inline void name(void) \
+static __inline __attribute__((__always_inline__)) void name(void) \
 { \
 	int psr; \
 	__asm volatile(rd %%psr,%0 : =r (psr)); \
@@ -341,7 +341,7 @@
 #define	splzs()		splraiseipl(makeiplcookie(IPL_ZS))
 
 /* splx does not have a return value */
-static __inline void
+static __inline __attribute__((__always_inline__)) void
 splx(int newipl)
 {
 	int psr;



CVS commit: [jym-xensuspend] src/sys/arch/xen/xen

2011-08-28 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Aug 28 22:34:26 UTC 2011

Modified Files:
src/sys/arch/xen/xen [jym-xensuspend]: clock.c evtchn.c

Log Message:
Put some assertions to check values of the VIRQ  event channels mappings.

Fix the VIRQ_TIMER per-cpu translations, so that save/restore does not
choke on event channel being -1 anymore (ends badly 99,9% of the time
when used as an index...)

Some KNF and white space fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.49.2.6 -r1.49.2.7 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.42.2.8 -r1.42.2.9 src/sys/arch/xen/xen/evtchn.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/xen/xen/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.49.2.6 src/sys/arch/xen/xen/clock.c:1.49.2.7
--- src/sys/arch/xen/xen/clock.c:1.49.2.6	Sat Aug 27 15:37:32 2011
+++ src/sys/arch/xen/xen/clock.c	Sun Aug 28 22:34:25 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.49.2.6 2011/08/27 15:37:32 jym Exp $	*/
+/*	$NetBSD: clock.c,v 1.49.2.7 2011/08/28 22:34:25 jym Exp $	*/
 
 /*
  *
@@ -29,7 +29,7 @@
 #include opt_xen.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.49.2.6 2011/08/27 15:37:32 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.49.2.7 2011/08/28 22:34:25 jym Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -433,11 +433,13 @@
 }
 
 void
-xen_suspendclocks(void) {
-
+xen_suspendclocks(void)
+{
 	int evtch;
 
 	evtch = unbind_virq_from_evtch(VIRQ_TIMER);
+	KASSERT(evtch != -1);
+
 	hypervisor_mask_event(evtch);
 	event_remove_handler(evtch, (int (*)(void *))xen_timer_handler, NULL);
 
@@ -445,11 +447,13 @@
 }
 
 void
-xen_resumeclocks(void) {
-
+xen_resumeclocks(void)
+{
 	int evtch;
-
+   
 	evtch = bind_virq_to_evtch(VIRQ_TIMER);
+	KASSERT(evtch != -1);
+
 	event_set_handler(evtch, (int (*)(void *))xen_timer_handler,
 	NULL, IPL_CLOCK, clock);
 	hypervisor_enable_event(evtch);

Index: src/sys/arch/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.42.2.8 src/sys/arch/xen/xen/evtchn.c:1.42.2.9
--- src/sys/arch/xen/xen/evtchn.c:1.42.2.8	Sat Aug 27 15:37:32 2011
+++ src/sys/arch/xen/xen/evtchn.c	Sun Aug 28 22:34:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.42.2.8 2011/08/27 15:37:32 jym Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.42.2.9 2011/08/28 22:34:26 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.42.2.8 2011/08/27 15:37:32 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.42.2.9 2011/08/28 22:34:26 jym Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -197,7 +197,7 @@
 }
 
 bool
-events_suspend (void)
+events_suspend(void)
 {
 	int evtch;
 
@@ -205,6 +205,9 @@
 
 	/* VIRQ_DEBUG is the last interrupt to remove */
 	evtch = unbind_virq_from_evtch(VIRQ_DEBUG);
+
+	KASSERT(evtch != -1);
+
 	hypervisor_mask_event(evtch);
 	/* Remove the non-NULL value set in events_init() */
 	evtsource[evtch] = NULL;
@@ -277,7 +280,7 @@
 	evtch  LONG_SHIFT,
 	evtch  LONG_MASK);
 
-		if (evtsource[evtch]-ev_cpu != ci) { 
+		if (evtsource[evtch]-ev_cpu != ci) {
 			/* facilitate spllower() on remote cpu */
 			struct cpu_info *rci = evtsource[evtch]-ev_cpu;
 			if (xen_send_ipi(rci, XEN_IPI_KICK) != 0) {
@@ -285,7 +288,7 @@
 			}
 		}
 
-		/* leave masked */ 
+		/* leave masked */
 		return 0;
 	}
 	ci-ci_ilevel = evtsource[evtch]-ev_maxlevel;
@@ -381,7 +384,7 @@
 	evtch_bindcount[evtchn]++;
 
 	mutex_spin_exit(evtchn_lock);
-
+
 	return evtchn;
 }
 
@@ -393,9 +396,9 @@
 
 	mutex_spin_enter(evtchn_lock);
 
-	/* 
-	 * XXX: The only per-cpu VIRQ we currently use is VIRQ_TIMER. 
-	 * Please re-visit this implementation when others are used. 
+	/*
+	 * XXX: The only per-cpu VIRQ we currently use is VIRQ_TIMER.
+	 * Please re-visit this implementation when others are used.
 	 * Note: VIRQ_DEBUG is special-cased, and not used or bound on APs.
 	 * XXX: event-virq/ipi can be unified in a linked-list
 	 * implementation.
@@ -407,12 +410,14 @@
 		return -1;
 	}
 
+	/* Get event channel from VIRQ */
 	if (virq == VIRQ_TIMER) {
 		evtchn = virq_timer_to_evtch[ci-ci_cpuid];
-	}
-	else {
+	} else {
 		evtchn = virq_to_evtch[virq];
 	}
+
+	/* Allocate a channel if there is none already allocated */
 	if (evtchn == -1) {
 		op.cmd = EVTCHNOP_bind_virq;
 		op.u.bind_virq.virq = virq;
@@ -420,14 +425,20 @@
 		if (HYPERVISOR_event_channel_op(op) != 0)
 			panic(Failed to bind virtual IRQ %d\n, virq);
 		evtchn = op.u.bind_virq.port;
+	}
 
+	/* Set event channel */
+	if (virq == VIRQ_TIMER) {
+		virq_timer_to_evtch[ci-ci_cpuid] = evtchn;
+	} else {
 		virq_to_evtch[virq] = evtchn;
 	}
 
+	/* Increase ref counter */
 	evtch_bindcount[evtchn]++;
 
 	mutex_spin_exit(evtchn_lock);
-
+
 	return evtchn;
 }
 
@@ -498,7 +509,7 @@
 	evtch_bindcount[evtchn]++;
 
 	mutex_spin_exit(evtchn_lock);
-
+
 	return evtchn;
 }
 
@@ -658,13 

CVS commit: src/sys/arch/xen/xen

2011-08-28 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Aug 28 22:36:17 UTC 2011

Modified Files:
src/sys/arch/xen/xen: evtchn.c xennetback_xenbus.c

Log Message:
KNF, white spaces and comment typo fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/xen/xen/evtchn.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.51 src/sys/arch/xen/xen/evtchn.c:1.52
--- src/sys/arch/xen/xen/evtchn.c:1.51	Sat Aug 13 17:23:42 2011
+++ src/sys/arch/xen/xen/evtchn.c	Sun Aug 28 22:36:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.51 2011/08/13 17:23:42 cherry Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.52 2011/08/28 22:36:17 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.51 2011/08/13 17:23:42 cherry Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.52 2011/08/28 22:36:17 jym Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -249,7 +249,7 @@
 	evtch  LONG_SHIFT,
 	evtch  LONG_MASK);
 
-		if (evtsource[evtch]-ev_cpu != ci) { 
+		if (evtsource[evtch]-ev_cpu != ci) {
 			/* facilitate spllower() on remote cpu */
 			struct cpu_info *rci = evtsource[evtch]-ev_cpu;
 			if (xen_send_ipi(rci, XEN_IPI_KICK) != 0) {
@@ -257,7 +257,7 @@
 			}
 		}
 
-		/* leave masked */ 
+		/* leave masked */
 		return 0;
 	}
 	ci-ci_ilevel = evtsource[evtch]-ev_maxlevel;
@@ -353,7 +353,7 @@
 	evtch_bindcount[evtchn]++;
 
 	mutex_spin_exit(evtchn_lock);
-
+
 	return evtchn;
 }
 
@@ -365,9 +365,9 @@
 
 	mutex_spin_enter(evtchn_lock);
 
-	/* 
-	 * XXX: The only per-cpu VIRQ we currently use is VIRQ_TIMER. 
-	 * Please re-visit this implementation when others are used. 
+	/*
+	 * XXX: The only per-cpu VIRQ we currently use is VIRQ_TIMER.
+	 * Please re-visit this implementation when others are used.
 	 * Note: VIRQ_DEBUG is special-cased, and not used or bound on APs.
 	 * XXX: event-virq/ipi can be unified in a linked-list
 	 * implementation.
@@ -381,10 +381,11 @@
 
 	if (virq == VIRQ_TIMER) {
 		evtchn = virq_timer_to_evtch[ci-ci_cpuid];
-	}
-	else {
+	} else {
 		evtchn = virq_to_evtch[virq];
 	}
+
+	/* Allocate a channel if there is none already allocated */
 	if (evtchn == -1) {
 		op.cmd = EVTCHNOP_bind_virq;
 		op.u.bind_virq.virq = virq;
@@ -399,7 +400,7 @@
 	evtch_bindcount[evtchn]++;
 
 	mutex_spin_exit(evtchn_lock);
-
+
 	return evtchn;
 }
 
@@ -470,7 +471,7 @@
 	evtch_bindcount[evtchn]++;
 
 	mutex_spin_exit(evtchn_lock);
-
+
 	return evtchn;
 }
 
@@ -632,13 +633,13 @@
 			panic(can't allocate fixed interrupt source);
 
 		evts-ev_handlers = ih;
-		/* 
+		/*
 		 * XXX: We're assuming here that ci is the same cpu as
 		 * the one on which this event/port is bound on. The
 		 * api needs to be reshuffled so that this assumption
 		 * is more explicitly implemented.
 		 */
-		evts-ev_cpu = ci; 
+		evts-ev_cpu = ci;
 		mutex_init(evtlock[evtch], MUTEX_DEFAULT, IPL_HIGH);
 		evtsource[evtch] = evts;
 		if (evname)

Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.46 src/sys/arch/xen/xen/xennetback_xenbus.c:1.47
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.46	Mon May 30 14:34:58 2011
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sun Aug 28 22:36:17 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.46 2011/05/30 14:34:58 joerg Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.47 2011/08/28 22:36:17 jym Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xennetback_xenbus.c,v 1.46 2011/05/30 14:34:58 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: xennetback_xenbus.c,v 1.47 2011/08/28 22:36:17 jym Exp $);
 
 #include opt_xen.h
 
@@ -933,7 +933,7 @@
 	 * schedule batch of packets for the domain. To achieve this, we
 	 * schedule a soft interrupt, and just return. This way, the network
 	 * stack will enqueue all pending mbufs in the interface's send queue
-	 * before it is processed by the soft inetrrupt handler().
+	 * before it is processed by the soft interrupt handler().
 	 */
 	softint_schedule(xneti-xni_softintr);
 }



CVS commit: src/sys/arch/xen/xen

2011-08-28 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Aug 28 22:55:52 UTC 2011

Modified Files:
src/sys/arch/xen/xen: evtchn.c

Log Message:
VIRQ_TIMER virqs are allocated and tracked in a array
(virq_timer_to_evtch, indexed by cpuid) different from the
VIRQ  event channel one (virq_to_evtch, indexed by event channel ID).

This is fine: fix a harmless bug that resulted in the event
channel of VIRQ_TIMER getting lost during bind as it was not stored
in the proper array.

Harmless because it is not critical for -current, however in the Xen
save/restore branch this completely cripples restore. Xen clock gets
suspended, but never comes back (fetched channel ID being invalid). Oops.

Add a small comment so we can better see the get = allocate? = set
chain of actions when binding/unbinding event channels.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/xen/xen/evtchn.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/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.52 src/sys/arch/xen/xen/evtchn.c:1.53
--- src/sys/arch/xen/xen/evtchn.c:1.52	Sun Aug 28 22:36:17 2011
+++ src/sys/arch/xen/xen/evtchn.c	Sun Aug 28 22:55:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.52 2011/08/28 22:36:17 jym Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.53 2011/08/28 22:55:52 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.52 2011/08/28 22:36:17 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.53 2011/08/28 22:55:52 jym Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -379,6 +379,7 @@
 		return -1;
 	}
 
+	/* Get event channel from VIRQ */
 	if (virq == VIRQ_TIMER) {
 		evtchn = virq_timer_to_evtch[ci-ci_cpuid];
 	} else {
@@ -393,7 +394,12 @@
 		if (HYPERVISOR_event_channel_op(op) != 0)
 			panic(Failed to bind virtual IRQ %d\n, virq);
 		evtchn = op.u.bind_virq.port;
+	}
 
+	/* Set event channel */
+	if (virq == VIRQ_TIMER) {
+		virq_timer_to_evtch[ci-ci_cpuid] = evtchn;
+	} else {
 		virq_to_evtch[virq] = evtchn;
 	}
 



CVS commit: src/sys/conf

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 23:15:53 UTC 2011

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
let kernel makefile override *.d targets


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.146 src/sys/conf/Makefile.kern.inc:1.147
--- src/sys/conf/Makefile.kern.inc:1.146	Thu Aug 18 02:19:20 2011
+++ src/sys/conf/Makefile.kern.inc	Sun Aug 28 23:15:53 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.146 2011/08/18 02:19:20 christos Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.147 2011/08/28 23:15:53 jmcneill Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -358,16 +358,20 @@
 DEPS=	${SRCS:T:O:u:R:S/$/.d/g}
 
 .for _s in ${SSRCS}
+.if !target(${_s:T:R}.d)
 ${_s:T:R}.d: ${_s} assym.h
 	${_MKTARGET_CREATE}
 	${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
 	${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
+.endif
 .endfor
 .for _s in ${CSRCS}
+.if !target(${_s:T:R}.d)
 ${_s:T:R}.d: ${_s}
 	${_MKTARGET_CREATE}
 	${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
 	${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
+.endif
 .endfor
 
 assym.d: assym.h



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

2011-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 28 23:16:19 UTC 2011

Modified Files:
src/sys/arch/usermode/conf: Makefile.usermode

Log Message:
override thunk.d and thunk_sdl.d targets


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/usermode/conf/Makefile.usermode

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.14 src/sys/arch/usermode/conf/Makefile.usermode:1.15
--- src/sys/arch/usermode/conf/Makefile.usermode:1.14	Thu Aug 25 11:06:29 2011
+++ src/sys/arch/usermode/conf/Makefile.usermode	Sun Aug 28 23:16:18 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.usermode,v 1.14 2011/08/25 11:06:29 jmcneill Exp $
+# $NetBSD: Makefile.usermode,v 1.15 2011/08/28 23:16:18 jmcneill Exp $
 
 MACHINE_ARCH=			usermode
 USETOOLS?=			no
@@ -68,9 +68,17 @@
 		ln -s $S/arch/i386/include i386
 .endif
 
+thunk.d: ${USERMODE}/usermode/thunk.c
+	${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
+	${CPPFLAGS.thunk.c} ${USERMODE}/usermode/thunk.c
+
 thunk.o: ${USERMODE}/usermode/thunk.c
 	${CC} ${CPPFLAGS.thunk.c} -c -o $@ ${USERMODE}/usermode/thunk.c
 
+thunk_sdl.d: ${USERMODE}/usermode/thunk.c
+	${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
+	${CPPFLAGS.thunk_sdl.c} ${USERMODE}/usermode/thunk_sdl.c
+
 thunk_sdl.o: ${USERMODE}/usermode/thunk_sdl.c
 	${CC} ${CPPFLAGS.thunk_sdl.c} -c -o $@ ${USERMODE}/usermode/thunk_sdl.c
 



CVS commit: src/bin/df

2011-08-28 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Aug 29 00:36:20 UTC 2011

Modified Files:
src/bin/df: df.c

Log Message:
No need to print internal state once debug is done.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/bin/df/df.c

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

Modified files:

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.87 src/bin/df/df.c:1.88
--- src/bin/df/df.c:1.87	Sun Aug 28 08:20:58 2011
+++ src/bin/df/df.c	Mon Aug 29 00:36:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.87 2011/08/28 08:20:58 christos Exp $ */
+/*	$NetBSD: df.c,v 1.88 2011/08/29 00:36:20 enami Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@
 #if 0
 static char sccsid[] = @(#)df.c	8.7 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: df.c,v 1.87 2011/08/28 08:20:58 christos Exp $);
+__RCSID($NetBSD: df.c,v 1.88 2011/08/29 00:36:20 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -448,7 +448,6 @@
 			(void)printf(Filesystem %s Used Available Capacity 
 			Mounted on\n, header);
 		} else {
-			printf(%d %d\n, maxwidth, headerlen);
 			(void)printf(%-*.*s %s   Used  Avail %%Cap,
 			maxwidth - (headerlen - 10),
 			maxwidth - (headerlen - 10),



CVS commit: src/sys/kern

2011-08-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Aug 29 00:39:16 UTC 2011

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

Log Message:
Add kern.direct_select sysctl.  Default to 0 for now.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/sys_select.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/sys_select.c
diff -u src/sys/kern/sys_select.c:1.35 src/sys/kern/sys_select.c:1.36
--- src/sys/kern/sys_select.c:1.35	Tue Aug  9 06:36:51 2011
+++ src/sys/kern/sys_select.c	Mon Aug 29 00:39:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_select.c,v 1.35 2011/08/09 06:36:51 hannken Exp $	*/
+/*	$NetBSD: sys_select.c,v 1.36 2011/08/29 00:39:16 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sys_select.c,v 1.35 2011/08/09 06:36:51 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: sys_select.c,v 1.36 2011/08/29 00:39:16 rmind Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -103,6 +103,7 @@
 #include sys/atomic.h
 #include sys/socketvar.h
 #include sys/sleepq.h
+#include sys/sysctl.h
 
 /* Flags for lwp::l_selflag. */
 #define	SEL_RESET	0	/* awoken, interrupted, or not yet polling */
@@ -147,6 +148,7 @@
 };
 
 static selcluster_t	*selcluster[SELCLUSTERS] __read_mostly;
+static int		direct_select __read_mostly = 0;
 
 /*
  * Select system call.
@@ -378,9 +380,7 @@
 	fd_mask *ibitp, *obitp;
 	int msk, i, j, fd, n;
 	file_t *fp;
-	kmutex_t *lock;
 
-	lock = curlwp-l_selcluster-sc_lock;
 	ibitp = (fd_mask *)(bits + ni * 0);
 	obitp = (fd_mask *)(bits + ni * 3);
 	n = 0;
@@ -408,15 +408,15 @@
 fd_putfile(fd);
 			}
 			if (obits != 0) {
-#ifndef NO_DIRECT_SELECT
-if (obits != *ibitp)
+if (direct_select) {
+	kmutex_t *lock;
+	lock = curlwp-l_selcluster-sc_lock;
 	mutex_spin_enter(lock);
-*obitp |= obits;
-if (obits != *ibitp)
+	*obitp |= obits;
 	mutex_spin_exit(lock);
-#else
-*obitp |= obits;
-#endif
+} else {
+	*obitp |= obits;
+}
 			}
 			ibitp++;
 			obitp++;
@@ -715,15 +715,15 @@
 			 */
 			l = sip-sel_lwp;
 			oflag = l-l_selflag;
-#ifndef NO_DIRECT_SELECT
-			if (!sel_setevents(l, sip, events)) {
+
+			if (!direct_select) {
+l-l_selflag = SEL_RESET;
+			} else if (!sel_setevents(l, sip, events)) {
 /* No events to return. */
 mutex_spin_exit(lock);
 return;
 			}
-#else
-			l-l_selflag = SEL_RESET;
-#endif
+
 			/*
 			 * If thread is sleeping, wake it up.  If it's not
 			 * yet asleep, it will notice the change in state
@@ -932,3 +932,23 @@
 		error = 0;
 	return (error);
 }
+
+/*
+ * System control nodes.
+ */
+SYSCTL_SETUP(sysctl_select_setup, sysctl select setup)
+{
+	const struct sysctlnode *node = NULL;
+
+	sysctl_createv(clog, 0, NULL, node,
+		CTLFLAG_PERMANENT,
+		CTLTYPE_NODE, kern, NULL,
+		NULL, 0, NULL, 0,
+		CTL_KERN, CTL_EOL);
+	sysctl_createv(clog, 0, node, NULL,
+		CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
+		CTLTYPE_INT, direct_select,
+		SYSCTL_DESCR(Enable/disable direct select (for testing)),
+		NULL, 0, direct_select, 0,
+		CTL_CREATE, CTL_EOL);
+}



CVS commit: src/sys/fs/puffs

2011-08-28 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Aug 29 04:12:46 UTC 2011

Modified Files:
src/sys/fs/puffs: puffs_node.c puffs_sys.h puffs_vnops.c

Log Message:
Add a mutex for operations that touch size (setattr, getattr, write, fsync).

This is required to avoid data corruption bugs, where a getattr slices
itself within a setattr operation, and sets the size to the stall value
it got from the filesystem. That value is smaller than the one set by
setattr, and the call to uvm_vnp_setsize() trigged a spurious truncate.
The result is a chunk of zeroed data in the file.

Such a situation can easily happen when the ioflush thread issue a
VOP_FSYNC/puffs_vnop_sync/flushvncache/dosetattrn while andother process
do a sys_stat/VOP_GETATTR/puffs_vnop_getattr.

This mutex on size operation can be removed the day we decide VOP_GETATTR
has to operated on a locked vnode, since the other operations that touch
size already require that.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/fs/puffs/puffs_node.c
cvs rdiff -u -r1.77 -r1.78 src/sys/fs/puffs/puffs_sys.h
cvs rdiff -u -r1.154 -r1.155 src/sys/fs/puffs/puffs_vnops.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/fs/puffs/puffs_node.c
diff -u src/sys/fs/puffs/puffs_node.c:1.19 src/sys/fs/puffs/puffs_node.c:1.20
--- src/sys/fs/puffs/puffs_node.c:1.19	Thu Jun 30 20:09:41 2011
+++ src/sys/fs/puffs/puffs_node.c	Mon Aug 29 04:12:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_node.c,v 1.19 2011/06/30 20:09:41 wiz Exp $	*/
+/*	$NetBSD: puffs_node.c,v 1.20 2011/08/29 04:12:45 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.19 2011/06/30 20:09:41 wiz Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.20 2011/08/29 04:12:45 manu Exp $);
 
 #include sys/param.h
 #include sys/hash.h
@@ -155,6 +155,7 @@
 		}
 		KASSERT(pnc != NULL);
 	}
+	mutex_init(pnode-pn_sizemtx, MUTEX_DEFAULT, IPL_NONE);
 	mutex_exit(pmp-pmp_lock);
 
 	vp-v_data = pnode;
@@ -463,6 +464,7 @@
 	if (--pn-pn_refcount == 0) {
 		mutex_exit(pn-pn_mtx);
 		mutex_destroy(pn-pn_mtx);
+		mutex_destroy(pn-pn_sizemtx);
 		seldestroy(pn-pn_sel);
 		pool_put(puffs_pnpool, pn);
 	} else {

Index: src/sys/fs/puffs/puffs_sys.h
diff -u src/sys/fs/puffs/puffs_sys.h:1.77 src/sys/fs/puffs/puffs_sys.h:1.78
--- src/sys/fs/puffs/puffs_sys.h:1.77	Tue Jan 11 14:04:54 2011
+++ src/sys/fs/puffs/puffs_sys.h	Mon Aug 29 04:12:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_sys.h,v 1.77 2011/01/11 14:04:54 kefren Exp $	*/
+/*	$NetBSD: puffs_sys.h,v 1.78 2011/08/29 04:12:45 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -209,6 +209,8 @@
 
 	struct lockf *	pn_lockf;
 
+	kmutex_t	pn_sizemtx;	/* size modification mutex	*/
+
 	LIST_ENTRY(puffs_node) pn_hashent;
 };
 

Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.154 src/sys/fs/puffs/puffs_vnops.c:1.155
--- src/sys/fs/puffs/puffs_vnops.c:1.154	Mon Jul  4 08:07:30 2011
+++ src/sys/fs/puffs/puffs_vnops.c	Mon Aug 29 04:12:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.154 2011/07/04 08:07:30 manu Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.155 2011/08/29 04:12:45 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.154 2011/07/04 08:07:30 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.155 2011/08/29 04:12:45 manu Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -839,6 +839,18 @@
 	struct puffs_node *pn = VPTOPP(vp);
 	int error = 0;
 
+	/*
+	 * A lock is required so that we do not race with 
+	 * setattr, write and fsync when changing vp-v_size.
+	 * This is critical, since setting a stall smaler value
+	 * triggers a file truncate in uvm_vnp_setsize(), which
+	 * most of the time means data corruption (a chunk of
+	 * data is replaced by zeroes). This can be removed if
+	 * we decide one day that VOP_GETATTR must operate on 
+	 * a locked vnode.
+	 */
+	mutex_enter(pn-pn_sizemtx);
+
 	REFPN(pn);
 	vap = ap-a_vap;
 
@@ -889,6 +901,9 @@
  out:
 	puffs_releasenode(pn);
 	PUFFS_MSG_RELEASE(getattr);
+	
+	mutex_exit(pn-pn_sizemtx);
+
 	return error;
 }
 
@@ -902,6 +917,8 @@
 	struct puffs_node *pn = vp-v_data;
 	int error = 0;
 
+	KASSERT(!(flags  SETATTR_CHSIZE) || mutex_owned(pn-pn_sizemtx));
+
 	if ((vp-v_mount-mnt_flag  MNT_RDONLY) 
 	(vap-va_uid != (uid_t)VNOVAL || vap-va_gid != (gid_t)VNOVAL
 	|| vap-va_atime.tv_sec != VNOVAL || vap-va_mtime.tv_sec != VNOVAL
@@ -972,8 +989,14 @@
 		struct vattr *a_vap;
 		kauth_cred_t a_cred;
 	} */ *ap = v;
+	struct puffs_node *pn = ap-a_vp-v_data;
+	int error;
 
-	return dosetattr(ap-a_vp, ap-a_vap, ap-a_cred, SETATTR_CHSIZE);
+	mutex_enter(pn-pn_sizemtx);
+	

CVS commit: src/tests/util/df

2011-08-28 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Mon Aug 29 04:55:58 UTC 2011

Modified Files:
src/tests/util/df: t_df.sh

Log Message:
Fix remaining misaligned columns in golden output, missed in previous commit


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/util/df/t_df.sh

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

Modified files:

Index: src/tests/util/df/t_df.sh
diff -u src/tests/util/df/t_df.sh:1.8 src/tests/util/df/t_df.sh:1.9
--- src/tests/util/df/t_df.sh:1.8	Sun Aug 28 19:09:34 2011
+++ src/tests/util/df/t_df.sh	Mon Aug 29 04:55:58 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_df.sh,v 1.8 2011/08/28 19:09:34 gson Exp $
+# $NetBSD: t_df.sh,v 1.9 2011/08/29 04:55:58 gson Exp $
 #
 # Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,7 +33,7 @@
 }
 normal_body() {
 	cat expout EOF
-Filesystem   1K-blocks   Used  Avail  %Cap Mounted on
+Filesystem1K-blocks   Used  Avail %Cap Mounted on
 filer:/  1202716672 135168 1202581504   0% /filer
 filer:/  1202716672  0 1202716672   0% /filer
 filer:/  1202716672  240543334  962173337  20% /filer