CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2011-03-06 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Sun Mar  6 08:28:11 UTC 2011

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: privsep.c

Log Message:
Quiet a gcc warning when strict-aliasing checks are enabled. Reported by
Stephen Clark.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/crypto/dist/ipsec-tools/src/racoon/privsep.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/privsep.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/privsep.c:1.20 src/crypto/dist/ipsec-tools/src/racoon/privsep.c:1.21
--- src/crypto/dist/ipsec-tools/src/racoon/privsep.c:1.20	Fri Mar  5 06:47:58 2010
+++ src/crypto/dist/ipsec-tools/src/racoon/privsep.c	Sun Mar  6 08:28:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: privsep.c,v 1.20 2010/03/05 06:47:58 tteras Exp $	*/
+/*	$NetBSD: privsep.c,v 1.21 2011/03/06 08:28:10 tteras Exp $	*/
 
 /* Id: privsep.c,v 1.15 2005/08/08 11:23:44 vanhu Exp */
 
@@ -1544,6 +1544,7 @@
 {
 	struct msghdr msg;
 	struct cmsghdr *cmsg;
+	int *fdptr;
 	int fd;
 	char cmsbuf[1024];
 	struct iovec iov;
@@ -1569,7 +1570,8 @@
 		return -1;
 
 	cmsg = CMSG_FIRSTHDR(msg);
-	return *(int *)CMSG_DATA(cmsg);
+	fdptr = (int *) CMSG_DATA(cmsg);
+	return fdptr[0];
 }
 
 /* Send the file descriptor fd through the argument socket s */
@@ -1582,6 +1584,7 @@
 	struct cmsghdr *cmsg;
 	char cmsbuf[1024];
 	struct iovec iov;
+	int *fdptr;
 
 	iov.iov_base =  ;
 	iov.iov_len = 1;
@@ -1604,7 +1607,8 @@
 	cmsg-cmsg_level = SOL_SOCKET;
 	cmsg-cmsg_type = SCM_RIGHTS;
 	cmsg-cmsg_len = CMSG_LEN(sizeof(fd));
-	*(int *)CMSG_DATA(cmsg) = fd;
+	fdptr = (int *)CMSG_DATA(cmsg);
+	fdptr[0] = fd;
 	msg.msg_controllen = cmsg-cmsg_len;
 
 	if (sendmsg(s, msg, 0) == -1)



CVS commit: src/lib/libc/softfloat

2011-03-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  6 10:27:37 UTC 2011

Modified Files:
src/lib/libc/softfloat: softfloat-specialize

Log Message:
Apply local namespace protection equivalent to the weak alias done
in softfloat-for-gcc.h, which we can't include here, to move
float_exception_mask into implementation namespace.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/softfloat/softfloat-specialize

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

Modified files:

Index: src/lib/libc/softfloat/softfloat-specialize
diff -u src/lib/libc/softfloat/softfloat-specialize:1.5 src/lib/libc/softfloat/softfloat-specialize:1.6
--- src/lib/libc/softfloat/softfloat-specialize:1.5	Fri Mar  4 11:48:58 2011
+++ src/lib/libc/softfloat/softfloat-specialize	Sun Mar  6 10:27:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: softfloat-specialize,v 1.5 2011/03/04 11:48:58 martin Exp $	*/
+/*	$NetBSD: softfloat-specialize,v 1.6 2011/03/06 10:27:37 martin Exp $	*/
 
 /* This is a derivative work. */
 
@@ -55,6 +55,9 @@
 should be simply `float_exception_flags |= flags;'.
 ---
 */
+#ifdef SOFTFLOAT_FOR_GCC
+#define float_exception_mask	_softfloat_float_exception_mask
+#endif
 fp_except float_exception_mask = 0;
 void float_raise( fp_except flags )
 {
@@ -80,6 +83,7 @@
 	sigqueueinfo(getpid(), info);
 }
 }
+#undef float_exception_mask
 
 /*
 ---



CVS commit: src/lib/libc/arch/sparc64

2011-03-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  6 10:32:48 UTC 2011

Modified Files:
src/lib/libc/arch/sparc64: Makefile.inc
src/lib/libc/arch/sparc64/gen: fpgetsticky.c fpsetmask.c fpsetsticky.c

Log Message:
While we use hardware (for float and double), but cooperate with softfloat
(to do long double), we need to not only handle the hardware exception
mask and cummulated flags, but also update/query the softfloat variables.
Since this may go away sometime (to make us psABI compliant), ifdef it
properly.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/sparc64/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sparc64/gen/fpgetsticky.c \
src/lib/libc/arch/sparc64/gen/fpsetmask.c \
src/lib/libc/arch/sparc64/gen/fpsetsticky.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/libc/arch/sparc64/Makefile.inc
diff -u src/lib/libc/arch/sparc64/Makefile.inc:1.13 src/lib/libc/arch/sparc64/Makefile.inc:1.14
--- src/lib/libc/arch/sparc64/Makefile.inc:1.13	Sun Dec  6 07:05:50 2009
+++ src/lib/libc/arch/sparc64/Makefile.inc	Sun Mar  6 10:32:47 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2009/12/06 07:05:50 uebayasi Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2011/03/06 10:32:47 martin Exp $
 
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
 
@@ -36,7 +36,7 @@
 
 .PATH: ${ARCHDIR}/softfloat
 SRCS+= qp.c
-CPPFLAGS+=	-DSOFTFLOATSPARC64_FOR_GCC
+CPPFLAGS+=	-DSOFTFLOATSPARC64_FOR_GCC -DEXCEPTIONS_WITH_SOFTFLOAT
 .if ${MKSOFTFLOAT} != no
 .include softfloat/Makefile.inc
 .else

Index: src/lib/libc/arch/sparc64/gen/fpgetsticky.c
diff -u src/lib/libc/arch/sparc64/gen/fpgetsticky.c:1.4 src/lib/libc/arch/sparc64/gen/fpgetsticky.c:1.5
--- src/lib/libc/arch/sparc64/gen/fpgetsticky.c:1.4	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/sparc64/gen/fpgetsticky.c	Sun Mar  6 10:32:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.5 2011/03/06 10:32:47 martin Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpgetsticky.c,v 1.5 2011/03/06 10:32:47 martin Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -18,11 +18,22 @@
 __weak_alias(fpgetsticky,_fpgetsticky)
 #endif
 
+#ifdef EXCEPTIONS_WITH_SOFTFLOAT
+extern fp_except _softfloat_float_exception_flags;
+#endif
+
 fp_except
 fpgetsticky()
 {
 	int x;
+	fp_except res;
 
 	__asm(st %%fsr,%0 : =m (*x));
-	return (x  5)  0x1f;
+	res = (x  5)  0x1f;
+
+#ifdef EXCEPTIONS_WITH_SOFTFLOAT
+	res |= _softfloat_float_exception_flags;
+#endif
+
+	return res;
 }
Index: src/lib/libc/arch/sparc64/gen/fpsetmask.c
diff -u src/lib/libc/arch/sparc64/gen/fpsetmask.c:1.4 src/lib/libc/arch/sparc64/gen/fpsetmask.c:1.5
--- src/lib/libc/arch/sparc64/gen/fpsetmask.c:1.4	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/sparc64/gen/fpsetmask.c	Sun Mar  6 10:32:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.4 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.5 2011/03/06 10:32:47 martin Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetmask.c,v 1.4 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpsetmask.c,v 1.5 2011/03/06 10:32:47 martin Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -18,6 +18,10 @@
 __weak_alias(fpsetmask,_fpsetmask)
 #endif
 
+#ifdef EXCEPTIONS_WITH_SOFTFLOAT
+extern fp_except _softfloat_float_exception_mask;
+#endif
+
 fp_except
 fpsetmask(mask)
 	fp_except mask;
@@ -33,5 +37,13 @@
 
 	__asm(ld %0,%%fsr : : m (*new));
 
-	return (old  23)  0x1f;
+	old = (old  23)  0x1f;
+
+#ifdef EXCEPTIONS_WITH_SOFTFLOAT
+	/* update softfloat mask as well */
+	old |= _softfloat_float_exception_mask;
+	_softfloat_float_exception_mask = mask;
+#endif
+
+	return old;
 }
Index: src/lib/libc/arch/sparc64/gen/fpsetsticky.c
diff -u src/lib/libc/arch/sparc64/gen/fpsetsticky.c:1.4 src/lib/libc/arch/sparc64/gen/fpsetsticky.c:1.5
--- src/lib/libc/arch/sparc64/gen/fpsetsticky.c:1.4	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/sparc64/gen/fpsetsticky.c	Sun Mar  6 10:32:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.5 2011/03/06 10:32:47 martin Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpsetsticky.c,v 1.5 2011/03/06 10:32:47 martin Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -18,6 +18,10 @@
 __weak_alias(fpsetsticky,_fpsetsticky)
 #endif
 

CVS commit: src/tests/fs/vfs

2011-03-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Mar  6 10:33:40 UTC 2011

Modified Files:
src/tests/fs/vfs: t_full.c

Log Message:
Add a kludge to prevent a test run from completely hanging.
Some analysis:

1) p2k_ffs test program opens a socketpair and forks off rump_ffs
2) after mounting the file system, test program decides it
   wants to skip the test and exits
3) somehow, the puffs event thread of rump_ffs stays in kqueue
   waiting for activity.  fstat+gdb suggests it's waiting for the
   now-orphaned socketpair (but I didn't fully verify.  is there
   an easy way to dump the state of a kqueue descriptor?).
4) test program is a zombie
5) atf-run waits forever

Note: this doesn't trigger always.

So, it seems there are at least two bugs: 1) test case doesn't
timeout 2) the kevent call in rump_ffs never returns even though
the sockerpair is orphaned

So, explicitly unmount the file system before skipping the test.
Obviously the above bugs needs to be properly fixed, since other
skipping test cases can unbeknowingly trigger the issue.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/vfs/t_full.c

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

Modified files:

Index: src/tests/fs/vfs/t_full.c
diff -u src/tests/fs/vfs/t_full.c:1.5 src/tests/fs/vfs/t_full.c:1.6
--- src/tests/fs/vfs/t_full.c:1.5	Fri Jan  7 11:41:54 2011
+++ src/tests/fs/vfs/t_full.c	Sun Mar  6 10:33:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_full.c,v 1.5 2011/01/07 11:41:54 pooka Exp $	*/
+/*	$NetBSD: t_full.c,v 1.6 2011/03/06 10:33:40 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -57,6 +57,13 @@
 	int fd, i = 0;
 
 	if (FSTYPE_P2K_FFS(tc) || FSTYPE_PUFFS(tc) || FSTYPE_RUMPFS(tc)) {
+		/*
+		 * XXX: explicitly unmount to prevent some race.
+		 * temporary hack, fix properly
+		 */
+		if (FSTYPE_P2K_FFS(tc)) {
+			puffs_fstest_unmount(tc, mp, MNT_FORCE);
+		}
 		atf_tc_skip(fs does not support explicit block allocation 
 		(GOP_ALLOC));
 	}



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

2011-03-06 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Mar  6 13:55:12 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: Makefile brdsetup.c dsk.c
globals.h main.c nif.c pciide.c siisata.c
Added Files:
src/sys/arch/sandpoint/stand/altboot: stg.c

Log Message:
New experimental driver for SundanceIT ST1023 / IP1000+ NICs.
PHY initialization, media select and MAC address are working, but I found no
way to make the chip transmit any frame yet (although it clears the DONE flag).

Moved DSK_DECL to globals.h, where NIF_DECL already was.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/stand/altboot/Makefile
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/stand/altboot/dsk.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/stand/altboot/globals.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sandpoint/stand/altboot/main.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/nif.c \
src/sys/arch/sandpoint/stand/altboot/pciide.c \
src/sys/arch/sandpoint/stand/altboot/siisata.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/sandpoint/stand/altboot/stg.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/sandpoint/stand/altboot/Makefile
diff -u src/sys/arch/sandpoint/stand/altboot/Makefile:1.8 src/sys/arch/sandpoint/stand/altboot/Makefile:1.9
--- src/sys/arch/sandpoint/stand/altboot/Makefile:1.8	Sat Feb 26 20:11:24 2011
+++ src/sys/arch/sandpoint/stand/altboot/Makefile	Sun Mar  6 13:55:12 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2011/02/26 20:11:24 phx Exp $
+#	$NetBSD: Makefile,v 1.9 2011/03/06 13:55:12 phx Exp $
 
 S=		${.CURDIR}/../../../..
 
@@ -6,8 +6,8 @@
 FILES+=		${PROG}.bin ${PROG}.img
 NOMAN=		# defined
 SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c nif.c
-SRCS+=		fxp.c tlp.c rge.c skg.c dsk.c pciide.c siisata.c printf.c
-SRCS+=		vers.c
+SRCS+=		fxp.c tlp.c rge.c skg.c stg.c dsk.c pciide.c siisata.c
+SRCS+=		printf.c vers.c
 CLEANFILES+=	vers.c ${PROG} ${PROG}.bin ${PROG}.img
 CFLAGS+=	-Wall -Wno-main -ffreestanding -msoft-float -mmultiple
 CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith

Index: src/sys/arch/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.5 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.6
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.5	Mon Feb 14 06:21:29 2011
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Sun Mar  6 13:55:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.5 2011/02/14 06:21:29 nisimura Exp $ */
+/* $NetBSD: brdsetup.c,v 1.6 2011/03/06 13:55:12 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -959,6 +959,22 @@
 	return NULL;
 }
 
+static uint8_t hex2nibble(char c)
+{
+	if (c = 'a')
+		c = ~0x20;
+	return c  '9' ? c - 'A' + 10 : c - '0';
+}
+
+static void
+read_mac_string(uint8_t *mac, char *p)
+{
+	int i;
+
+	for (i = 0; i  6; i++, p += 3)
+		*mac++ = (hex2nibble(p[0])  4) | hex2nibble(p[1]);
+}
+
 /*
  * For cost saving reasons some NAS boxes are missing the ROM for the
  * NIC's ethernet address and keep it in their Flash memory.
@@ -974,7 +990,11 @@
 			memcpy(mac, p, 6);
 			return;
 		}
-	} else
+	} else if (brdtype == BRD_DLINKDSM) {
+		read_mac_string(mac, (char *)0xfff0ff80);
+		return;
+	}
+	else
 		printf(Warning: This board has no known method defined 
 		to determine its MAC address!\n);
 

Index: src/sys/arch/sandpoint/stand/altboot/dsk.c
diff -u src/sys/arch/sandpoint/stand/altboot/dsk.c:1.4 src/sys/arch/sandpoint/stand/altboot/dsk.c:1.5
--- src/sys/arch/sandpoint/stand/altboot/dsk.c:1.4	Thu Feb 10 13:38:08 2011
+++ src/sys/arch/sandpoint/stand/altboot/dsk.c	Sun Mar  6 13:55:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.4 2011/02/10 13:38:08 nisimura Exp $ */
+/* $NetBSD: dsk.c,v 1.5 2011/03/06 13:55:12 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -57,13 +57,6 @@
 #define CSR_READ_1(r)		*(volatile uint8_t *)(r)
 #define CSR_WRITE_1(r,v)	*(volatile uint8_t *)(r)=(v)
 
-#define DSK_DECL(xxx) \
-int xxx ## _match(unsigned, void *); \
-void * xxx ## _init(unsigned, void *)
-
-DSK_DECL(pciide);
-DSK_DECL(siisata);
-
 struct dskdv {
 	char *name;
 	int (*match)(unsigned, void *);

Index: src/sys/arch/sandpoint/stand/altboot/globals.h
diff -u src/sys/arch/sandpoint/stand/altboot/globals.h:1.6 src/sys/arch/sandpoint/stand/altboot/globals.h:1.7
--- src/sys/arch/sandpoint/stand/altboot/globals.h:1.6	Mon Feb 14 06:21:29 2011
+++ src/sys/arch/sandpoint/stand/altboot/globals.h	Sun Mar  6 13:55:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.h,v 1.6 2011/02/14 06:21:29 nisimura Exp $ */
+/* $NetBSD: globals.h,v 1.7 2011/03/06 13:55:12 phx Exp $ */
 
 #ifdef DEBUG
 #define	DPRINTF(x)	printf x
@@ -88,6 +88,7 @@
 #define PCI_CLASS_REG			0x08
 #define  PCI_CLASS_PPB			

CVS commit: src/sys/arch/hp300

2011-03-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Mar  6 14:51:22 UTC 2011

Modified Files:
src/sys/arch/hp300/conf: majors.hp300
src/sys/arch/hp300/dev: dio.c dioreg.h mtreg.h
src/sys/arch/hp300/hp300: locore.s
src/sys/arch/hp300/include: intr.h

Log Message:
Remove trailing spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp300/conf/majors.hp300
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hp300/dev/dio.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/dev/dioreg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp300/dev/mtreg.h
cvs rdiff -u -r1.158 -r1.159 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/hp300/include/intr.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/hp300/conf/majors.hp300
diff -u src/sys/arch/hp300/conf/majors.hp300:1.23 src/sys/arch/hp300/conf/majors.hp300:1.24
--- src/sys/arch/hp300/conf/majors.hp300:1.23	Sun Feb  6 18:26:53 2011
+++ src/sys/arch/hp300/conf/majors.hp300	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.hp300,v 1.23 2011/02/06 18:26:53 tsutsui Exp $
+#	$NetBSD: majors.hp300,v 1.24 2011/03/06 14:51:21 tsutsui Exp $
 #
 # Device majors for hp300
 #
@@ -52,5 +52,5 @@
 device-major	nsmb		char 98			nsmb
 
 # Majors up to 143 are reserved for machine-dependant drivers.
-# New machine-independent driver majors are assigned in 
+# New machine-independent driver majors are assigned in
 # sys/conf/majors.

Index: src/sys/arch/hp300/dev/dio.c
diff -u src/sys/arch/hp300/dev/dio.c:1.37 src/sys/arch/hp300/dev/dio.c:1.38
--- src/sys/arch/hp300/dev/dio.c:1.37	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/dev/dio.c	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dio.c,v 1.37 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dio.c,v 1.37 2008/04/28 20:23:19 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $);
 
 #define	_HP300_INTR_H_PRIVATE
 
@@ -365,7 +365,7 @@
 	return *(volatile uint8_t *)(bsh + (offset  1) + 1);
 }
 
-static void 
+static void
 dio_bus_space_write_oddbyte_1(bus_space_tag_t bst, bus_space_handle_t bsh,
 bus_size_t offset, uint8_t val)
 {

Index: src/sys/arch/hp300/dev/dioreg.h
diff -u src/sys/arch/hp300/dev/dioreg.h:1.7 src/sys/arch/hp300/dev/dioreg.h:1.8
--- src/sys/arch/hp300/dev/dioreg.h:1.7	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/dev/dioreg.h	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dioreg.h,v 1.7 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: dioreg.h,v 1.8 2011/03/06 14:51:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -23,7 +23,7 @@
  * 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 
+ * 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
@@ -60,9 +60,9 @@
  * e.g. a display framebuffer.
  *
  * DIO-II ranges from select codes 132-255 at physical addresses given by:
- *	0x100 + (sc - 132) * 0x40 
+ *	0x100 + (sc - 132) * 0x40
  * The address range of DIO-II space is thus [0x100-0x2000).
- * 
+ *
  * DIO/DIO-II space is too large to map in its entirety, instead devices
  * are mapped into kernel virtual address space allocated from a range
  * of EIOMAPSIZE pages (vmparam.h) starting at ``extiobase''.

Index: src/sys/arch/hp300/dev/mtreg.h
diff -u src/sys/arch/hp300/dev/mtreg.h:1.4 src/sys/arch/hp300/dev/mtreg.h:1.5
--- src/sys/arch/hp300/dev/mtreg.h:1.4	Sun Dec 11 12:17:14 2005
+++ src/sys/arch/hp300/dev/mtreg.h	Sun Mar  6 14:51:21 2011
@@ -1,6 +1,6 @@
-/*	$NetBSD: mtreg.h,v 1.4 2005/12/11 12:17:14 christos Exp $	*/
+/*	$NetBSD: mtreg.h,v 1.5 2011/03/06 14:51:21 tsutsui Exp $	*/
 
-/* 
+/*
  * Copyright (c) 1992, The University of Utah and
  * the Computer Systems Laboratory at the University of Utah (CSL).
  * All rights reserved.

Index: src/sys/arch/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.158 src/sys/arch/hp300/hp300/locore.s:1.159
--- src/sys/arch/hp300/hp300/locore.s:1.158	Thu Jan  6 13:03:47 2011
+++ src/sys/arch/hp300/hp300/locore.s	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.158 2011/01/06 13:03:47 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.159 2011/03/06 14:51:21 tsutsui Exp $	

CVS commit: src/sys/arch/ews4800mips/ews4800mips

2011-03-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Mar  6 14:52:37 UTC 2011

Modified Files:
src/sys/arch/ews4800mips/ews4800mips: bus_dma.c

Log Message:
Remove extra TAB.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/ews4800mips/ews4800mips/bus_dma.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/ews4800mips/ews4800mips/bus_dma.c
diff -u src/sys/arch/ews4800mips/ews4800mips/bus_dma.c:1.11 src/sys/arch/ews4800mips/ews4800mips/bus_dma.c:1.12
--- src/sys/arch/ews4800mips/ews4800mips/bus_dma.c:1.11	Sun Feb 20 07:55:20 2011
+++ src/sys/arch/ews4800mips/ews4800mips/bus_dma.c	Sun Mar  6 14:52:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.11 2011/02/20 07:55:20 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.12 2011/03/06 14:52:37 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.11 2011/02/20 07:55:20 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.12 2011/03/06 14:52:37 tsutsui Exp $);
 
 /* #define	BUS_DMA_DEBUG */
 #include sys/param.h
@@ -617,6 +617,6 @@
 	rv = _bus_dmamem_mmap_common(t, segs, nsegs, off, prot, flags);
 	if (rv == (bus_addr_t)-1)
 		return (-1);
-	
+
 	return (mips_btop((char *)rv));
 }



CVS commit: src/sys/arch/news68k

2011-03-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Mar  6 14:54:47 UTC 2011

Modified Files:
src/sys/arch/news68k/conf: GENERIC majors.news68k
src/sys/arch/news68k/include: intr.h
src/sys/arch/news68k/news68k: machdep.c mainbus.c vectors.s

Log Message:
Remove trailing spaces and TABs.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/news68k/conf/GENERIC
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/news68k/conf/majors.news68k
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/news68k/include/intr.h
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/news68k/news68k/mainbus.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/news68k/news68k/vectors.s

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

Modified files:

Index: src/sys/arch/news68k/conf/GENERIC
diff -u src/sys/arch/news68k/conf/GENERIC:1.104 src/sys/arch/news68k/conf/GENERIC:1.105
--- src/sys/arch/news68k/conf/GENERIC:1.104	Mon Jan  3 06:07:44 2011
+++ src/sys/arch/news68k/conf/GENERIC	Sun Mar  6 14:54:46 2011
@@ -1,7 +1,7 @@
-# $NetBSD: GENERIC,v 1.104 2011/01/03 06:07:44 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.105 2011/03/06 14:54:46 tsutsui Exp $
 #
 # GENERIC machine description file
-# 
+#
 # This machine description file is used to generate the default NetBSD
 # kernel.  The generic kernel does not include all options, subsystems
 # and device drivers, but should be useful for most applications.
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.104 $
+#ident 		GENERIC-$Revision: 1.105 $
 
 maxusers	8
 

Index: src/sys/arch/news68k/conf/majors.news68k
diff -u src/sys/arch/news68k/conf/majors.news68k:1.20 src/sys/arch/news68k/conf/majors.news68k:1.21
--- src/sys/arch/news68k/conf/majors.news68k:1.20	Wed Nov 12 12:36:04 2008
+++ src/sys/arch/news68k/conf/majors.news68k	Sun Mar  6 14:54:47 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.news68k,v 1.20 2008/11/12 12:36:04 ad Exp $
+#	$NetBSD: majors.news68k,v 1.21 2011/03/06 14:54:47 tsutsui Exp $
 #
 # Device majors for news68k
 #
@@ -48,5 +48,5 @@
 device-major	nsmb		char 98			nsmb
 
 # Majors up to 143 are reserved for machine-dependant drivers.
-# New machine-independent driver majors are assigned in 
+# New machine-independent driver majors are assigned in
 # sys/conf/majors.

Index: src/sys/arch/news68k/include/intr.h
diff -u src/sys/arch/news68k/include/intr.h:1.25 src/sys/arch/news68k/include/intr.h:1.26
--- src/sys/arch/news68k/include/intr.h:1.25	Thu Apr  9 10:48:22 2009
+++ src/sys/arch/news68k/include/intr.h	Sun Mar  6 14:54:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.25 2009/04/09 10:48:22 tsutsui Exp $	*/
+/*	$NetBSD: intr.h,v 1.26 2011/03/06 14:54:47 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -49,13 +49,13 @@
 
 extern int idepth;
 
-static inline bool
+static inline bool
 cpu_intr_p(void)
 {
 
 	return idepth != 0;
-}   
-
+}
+
 extern const uint16_t ipl2psl_table[NIPL];
 
 typedef int ipl_t;

Index: src/sys/arch/news68k/news68k/machdep.c
diff -u src/sys/arch/news68k/news68k/machdep.c:1.90 src/sys/arch/news68k/news68k/machdep.c:1.91
--- src/sys/arch/news68k/news68k/machdep.c:1.90	Fri Mar  4 22:25:28 2011
+++ src/sys/arch/news68k/news68k/machdep.c	Sun Mar  6 14:54:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.90 2011/03/04 22:25:28 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.91 2011/03/06 14:54:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.90 2011/03/04 22:25:28 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.91 2011/03/06 14:54:47 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -716,7 +716,7 @@
 /*
  * cpu_exec_aout_makecmds():
  *	CPU-dependent a.out format hook for execve().
- * 
+ *
  * Determine of the given exec package refers to something which we
  * understand and, if so, set up the vmcmds for it.
  *

Index: src/sys/arch/news68k/news68k/mainbus.c
diff -u src/sys/arch/news68k/news68k/mainbus.c:1.15 src/sys/arch/news68k/news68k/mainbus.c:1.16
--- src/sys/arch/news68k/news68k/mainbus.c:1.15	Fri Mar 28 17:51:51 2008
+++ src/sys/arch/news68k/news68k/mainbus.c	Sun Mar  6 14:54:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.15 2008/03/28 17:51:51 tsutsui Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.16 2011/03/06 14:54:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -6,17 +6,17 @@
  *
  * Author: Chris G. Demetriou
  * DECstation port: Jonathan Stone
- * 
+ *
  * Permission to use, copy, modify and distribute this software and
  * its documentation is hereby granted, provided that both the copyright
  * notice and this permission notice appear in all copies of the
  * software, derivative works or modified versions, and any portions
  

CVS commit: src/sys/arch/arc

2011-03-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Mar  6 14:58:44 UTC 2011

Modified Files:
src/sys/arch/arc/arc: c_isa.c cpu.c mainbus.c p_acer_pica_61.c
p_ms_jazz.c timervar.h
src/sys/arch/arc/conf: GENERIC RPC44 majors.arc
src/sys/arch/arc/dti: desktech.h
src/sys/arch/arc/include: autoconf.h isa_machdep.h
src/sys/arch/arc/isa: isabus.c isadma.c opms_isa.c pccons_isa.c
pccons_isavar.h
src/sys/arch/arc/jazz: jazzio.c lpt_jazzio.c opms_jazzio.c
pccons_jazzio.c pccons_jazziovar.h pica.h rd94.h vga_jazzio.c
vga_jazziovar.h

Log Message:
Remove trailing spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arc/arc/c_isa.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arc/arc/cpu.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arc/arc/mainbus.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arc/arc/p_acer_pica_61.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arc/arc/p_ms_jazz.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arc/arc/timervar.h
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/arc/conf/GENERIC
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arc/conf/RPC44
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arc/conf/majors.arc
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arc/dti/desktech.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arc/include/autoconf.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arc/include/isa_machdep.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/arc/isa/isabus.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arc/isa/isadma.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arc/isa/opms_isa.c \
src/sys/arch/arc/isa/pccons_isa.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arc/isa/pccons_isavar.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arc/jazz/jazzio.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arc/jazz/lpt_jazzio.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arc/jazz/opms_jazzio.c \
src/sys/arch/arc/jazz/pccons_jazzio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arc/jazz/pccons_jazziovar.h \
src/sys/arch/arc/jazz/pica.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arc/jazz/rd94.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arc/jazz/vga_jazzio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arc/jazz/vga_jazziovar.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/arc/arc/c_isa.c
diff -u src/sys/arch/arc/arc/c_isa.c:1.9 src/sys/arch/arc/arc/c_isa.c:1.10
--- src/sys/arch/arc/arc/c_isa.c:1.9	Sun Nov 20 04:38:11 2005
+++ src/sys/arch/arc/arc/c_isa.c	Sun Mar  6 14:58:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_isa.c,v 1.9 2005/11/20 04:38:11 tsutsui Exp $	*/
+/*	$NetBSD: c_isa.c,v 1.10 2011/03/06 14:58:42 tsutsui Exp $	*/
 /*	$OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $	*/
 
 /*-
@@ -71,28 +71,28 @@
  *
  *	@(#)isa.c	7.2 (Berkeley) 5/12/91
  */
-/* 
+/*
  * Mach Operating System
  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
  * All Rights Reserved.
- * 
+ *
  * Permission to use, copy, modify and distribute this software and its
  * documentation is hereby granted, provided that both the copyright
  * notice and this permission notice appear in all copies of the
  * software, derivative works or modified versions, and any portions
  * thereof, and that both notices appear in supporting documentation.
- * 
+ *
  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS AS IS
  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- * 
+ *
  * Carnegie Mellon requests users of this software to return to
- * 
+ *
  *  Software Distribution Coordinator  or  software.distribut...@cs.cmu.edu
  *  School of Computer Science
  *  Carnegie Mellon University
  *  Pittsburgh PA 15213-3890
- * 
+ *
  * any improvements or extensions that they make and grant Carnegie Mellon
  * the rights to redistribute these changes.
  */
@@ -123,7 +123,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: c_isa.c,v 1.9 2005/11/20 04:38:11 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: c_isa.c,v 1.10 2011/03/06 14:58:42 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h

Index: src/sys/arch/arc/arc/cpu.c
diff -u src/sys/arch/arc/arc/cpu.c:1.18 src/sys/arch/arc/arc/cpu.c:1.19
--- src/sys/arch/arc/arc/cpu.c:1.18	Sun Feb 20 07:52:42 2011
+++ src/sys/arch/arc/arc/cpu.c	Sun Mar  6 14:58:42 2011
@@ -1,9 +1,9 @@
-/*	$NetBSD: cpu.c,v 1.18 2011/02/20 07:52:42 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.19 2011/03/06 14:58:42 tsutsui Exp $	*/
 /*	$OpenBSD: cpu.c,v 1.8 1997/04/19 17:19:41 pefo Exp $ */
 
 /*
  * Copyright (c) 1997 Per Fogelstrom
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.18 2011/02/20 07:52:42 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.19 2011/03/06 14:58:42 tsutsui 

CVS commit: src/tests/fs/vfs

2011-03-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Mar  6 16:00:17 UTC 2011

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
Add a race catcher for p2k_ffs renamerace -- it seems like the
problem doesn't trigger always especially in a qemu env (but triggers
100% of the time on my desktop).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/tests/fs/vfs/t_renamerace.c

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

Modified files:

Index: src/tests/fs/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.20 src/tests/fs/vfs/t_renamerace.c:1.21
--- src/tests/fs/vfs/t_renamerace.c:1.20	Thu Mar  3 11:01:27 2011
+++ src/tests/fs/vfs/t_renamerace.c	Sun Mar  6 16:00:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.20 2011/03/03 11:01:27 pooka Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.21 2011/03/06 16:00:16 pooka Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -158,6 +158,12 @@
 	if (FSTYPE_FFS(tc) || FSTYPE_EXT2FS(tc) || FSTYPE_LFS(tc) ||
 	FSTYPE_MSDOS(tc) || FSTYPE_FFSLOG(tc))
 		abort();
+
+	if (FSTYPE_P2K_FFS(tc)) {
+		/* XXX: some races may hang test run if we don't unmount */
+		puffs_fstest_unmount(tc, mp, MNT_FORCE);
+		atf_tc_fail(problem did not trigger);
+	}
 }
 
 ATF_TC_FSAPPLY(renamerace, rename(2) race with file unlinked mid-operation);



CVS commit: src/sys/dev/marvell

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 17:00:16 UTC 2011

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
don't abuse cf_unit, requested by phone.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/marvell/if_mvgbe.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/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.6 src/sys/dev/marvell/if_mvgbe.c:1.7
--- src/sys/dev/marvell/if_mvgbe.c:1.6	Sat Mar  5 13:28:13 2011
+++ src/sys/dev/marvell/if_mvgbe.c	Sun Mar  6 12:00:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvgbe.c,v 1.6 2011/03/05 18:28:13 christos Exp $	*/
+/*	$NetBSD: if_mvgbe.c,v 1.7 2011/03/06 17:00:16 christos Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mvgbe.c,v 1.6 2011/03/05 18:28:13 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mvgbe.c,v 1.7 2011/03/06 17:00:16 christos Exp $);
 
 #include rnd.h
 
@@ -184,7 +184,6 @@
 
 struct mvgbec_softc {
 	device_t sc_dev;
-	int sc_unit;
 
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_ioh;
@@ -355,16 +354,14 @@
 
 	sc-sc_dev = self;
 	sc-sc_iot = mva-mva_iot;
-	sc-sc_unit = mva-mva_unit;
 	if (bus_space_subregion(mva-mva_iot, mva-mva_ioh, mva-mva_offset,
 	mva-mva_size, sc-sc_ioh)) {
 		aprint_error_dev(self, Cannot map registers\n);
 		return;
 	}
 
-	if (sc-sc_unit == 0) {
+	if (mvgbec0 == NULL)
 		mvgbec0 = self;
-	}
 		
 	phyaddr = 0;
 	MVGBE_WRITE(sc, MVGBE_PHYADDR, phyaddr);
@@ -770,7 +767,7 @@
 	ifmedia_init(sc-sc_mii.mii_media, 0,
 	mvgbe_mediachange, mvgbe_mediastatus);
 	mii_attach(self, sc-sc_mii, 0x,
-	csc-sc_unit, MII_OFFSET_ANY, 0);
+	parent == mvgebc0 ? 0 : 1, MII_OFFSET_ANY, 0);
 	if (LIST_FIRST(sc-sc_mii.mii_phys) == NULL) {
 		aprint_error_dev(self, no PHY found!\n);
 		ifmedia_add(sc-sc_mii.mii_media,



CVS commit: src/share/man/man4

2011-03-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar  6 17:11:20 UTC 2011

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

Log Message:
Docucment QUOTA2


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

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.399 src/share/man/man4/options.4:1.400
--- src/share/man/man4/options.4:1.399	Tue Dec 21 08:11:21 2010
+++ src/share/man/man4/options.4	Sun Mar  6 17:11:19 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: options.4,v 1.399 2010/12/21 08:11:21 jruoho Exp $
+.\	$NetBSD: options.4,v 1.400 2011/03/06 17:11:19 bouyer Exp $
 .\
 .\ Copyright (c) 1996
 .\ 	Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
 .\
-.Dd December 21, 2010
+.Dd March 6, 2011
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -952,6 +952,21 @@
 .Xr rpc.rquotad 8
 permits them to be accessed over
 .Em NFS .
+.It Cd options QUOTA2
+Enables kernel support for the new file system quotas format.
+See
+.Xr tunefs 8 ,
+.Xr newfs 8 ,
+.Xr mount_mfs 8 ,
+.Xr edquota 8 ,
+and
+.Xr quota 1
+for details.
+Note that quota2 is only supported by
+.Dq ffs
+and
+.Dq mfs
+file system at this time.
 .It Cd options FFS_EI
 Enable ``Endian-Independent'' FFS support.
 This allows a system to mount an FFS file system created for another



CVS commit: src/doc

2011-03-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar  6 17:12:36 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
Add a note about a possible way to migrate limits from QUOTA to QUOTA2


To generate a diff of this commit:
cvs rdiff -u -r1.1517 -r1.1518 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1517 src/doc/CHANGES:1.1518
--- src/doc/CHANGES:1.1517	Sun Mar  6 17:08:12 2011
+++ src/doc/CHANGES	Sun Mar  6 17:12:36 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1517 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1518 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -881,4 +881,6 @@
 		and is covered by the WAPBL journal. Enabled with kernel
 		option QUOTA2, turned on with tunefs(8) on a per-filesystem
 		basis. mount_mfs(8) can also turn quotas on.
+		See repquota(8) and quotactl(8) for a way to migrate
+		limits from QUOTA to QUOTA2.
 		[bouyer 20110306]



CVS commit: src/lib/libc/sys

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:19:25 UTC 2011

Modified Files:
src/lib/libc/sys: quotactl.2

Log Message:
Various fixes:
Remove trailing whitespace.
Sort sections.
Sort errors.
Fix typos.
Use more markup.
Probably something else I forgot.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/sys/quotactl.2

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

Modified files:

Index: src/lib/libc/sys/quotactl.2
diff -u src/lib/libc/sys/quotactl.2:1.27 src/lib/libc/sys/quotactl.2:1.28
--- src/lib/libc/sys/quotactl.2:1.27	Sun Mar  6 17:08:15 2011
+++ src/lib/libc/sys/quotactl.2	Sun Mar  6 17:19:25 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: quotactl.2,v 1.27 2011/03/06 17:08:15 bouyer Exp $
+.\	$NetBSD: quotactl.2,v 1.28 2011/03/06 17:19:25 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1990, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -37,7 +37,7 @@
 .Os
 .Sh NAME
 .Nm quotactl
-.Nd manipulate filesystem quotas
+.Nd manipulate file system quotas
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
@@ -48,32 +48,33 @@
 .Sh DESCRIPTION
 The
 .Fn quotactl
-call manipulates filesystem quotas.
-A quota control command described by 
+call manipulates file system quotas.
+A quota control command described by
 .Fa struct plistref *
 operates on the given filename
 .Fa path .
 .Pp
 The top-level object of the property list sent to the kernel is a dictionary.
-It holds an integer with key interface version, which must be 1 at this 
+It holds an integer with key interface version, which must be 1 at this
 time.
 The key commands holds an array of dictionaries, each dictionary
 describe a command.
 .Pp
 A command dictionary has the following keys:
 .Bl -tag -width command
-.It Dv command 
+.It Dv command
 A string describing the command to execute.
 .It Dv data
 An array of arguments to the command.
 .It Dv type
-A string describing the type of quota to address. At this time this can
+A string describing the type of quota to address.
+At this time this can
 be either user or group.
 .El
 .Pp
 The data array is an array of dictionaries, the dictionary structure
 depends on the command.
-If the comman takes no arguments, the array must be present and empty.
+If the command takes no arguments, the array must be present and empty.
 A dictionary describing a quota entry is common to many commands arguments
 or replies.
 It has the following keys:
@@ -83,11 +84,11 @@
 .It Dv file
 A dictionary describing quota values and limits for inode usage.
 .It Dv id
-either an unigned integer, or the string default.
+either an unsigned integer, or the string default.
 If this key is an integer, the value is the user or group id this quota entry
 belongs to.
 If this key is the string default, this quota entry describe the
-default quotas for this filesystem.
+default quotas for this file system.
 .El
 .Pp
 The block or file dictionaries have the following structures:
@@ -96,10 +97,14 @@
 an unsigned integer which contains the current usage.
 .It Dv soft
 unsigned integer containing the soft limit.
-The value defined by the macro UQUAD_MAX means there is no limit.
+The value defined by the macro
+.Dv UQUAD_MAX
+means there is no limit.
 .It Dv hard
 unsigned integer containing the hard limit.
-The value defined by the macro UQUAD_MAX means there is no limit.
+The value defined by the macro
+.Dv UQUAD_MAX
+means there is no limit.
 .It Dv grace time
 integer, the grace delay in seconds which should be applied when usage
 goes over the soft limit.
@@ -110,20 +115,20 @@
 .Pp
 On return the struct plistref * contains an updated plist.
 It has the same structure as the plist sent to the kernel.
-The command dictionary gains an additionnal key return, and integer holding
-an errno which is the status of the comamnd.
+The command dictionary gains an additional key return, and integer holding
+an errno which is the status of the command.
 The data array is updated with replies from the command.
 .Pp
 Commands are:
 .Bl -tag -width get version
 .It Dv get version
-get the kernel quota version implementation for the specified filesystem and
+get the kernel quota version implementation for the specified file system and
 type.
 The data array in the reply has a single dictionary, which has a single
 integer key version.
 At this time version can be 1 (the legacy quota implementation, with usages
 and limits stored in an external file) or 2 (the new quota implementation,
-where usages and limits are integrated in the filesystem metadatas).
+where usages and limits are integrated in the file system metadata).
 .It Dv get
 Get a quota entry for the specified id.
 The command argument is one or more id keys.
@@ -131,7 +136,7 @@
 .It Dv getall
 Get all quota entries (kernel quota version 2 only).
 This command takes no arguments, the reply is all the existing quota entries
-for this filesystem and type.
+for this file 

CVS commit: src/sbin/newfs

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:20:28 UTC 2011

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sbin/newfs/newfs.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/newfs/newfs.8
diff -u src/sbin/newfs/newfs.8:1.80 src/sbin/newfs/newfs.8:1.81
--- src/sbin/newfs/newfs.8:1.80	Sun Mar  6 17:08:17 2011
+++ src/sbin/newfs/newfs.8	Sun Mar  6 17:20:28 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: newfs.8,v 1.80 2011/03/06 17:08:17 bouyer Exp $
+.\	$NetBSD: newfs.8,v 1.81 2011/03/06 17:20:28 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1987, 1991, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -250,7 +250,8 @@
 .Li user
 or
 .Li group
-to enable the specified quota type. Multiple
+to enable the specified quota type.
+Multiple
 .Fl q
 can be used to enable all types at once.
 .It Fl s Ar size



CVS commit: src/sbin/tunefs

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:21:08 UTC 2011

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

Log Message:
Fix punctuation markup; new sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sbin/tunefs/tunefs.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/tunefs/tunefs.8
diff -u src/sbin/tunefs/tunefs.8:1.39 src/sbin/tunefs/tunefs.8:1.40
--- src/sbin/tunefs/tunefs.8:1.39	Sun Mar  6 17:08:17 2011
+++ src/sbin/tunefs/tunefs.8	Sun Mar  6 17:21:08 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: tunefs.8,v 1.39 2011/03/06 17:08:17 bouyer Exp $
+.\	$NetBSD: tunefs.8,v 1.40 2011/03/06 17:21:08 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -136,12 +136,13 @@
 enable or disable a quota.
 .Ar quota
 can be one of
-.Li user,
-.Li group,
+.Li user ,
+.Li group ,
 .Li nouser
 or
 .Li nogroup
-to enable or disable the specified quota type. Multiple
+to enable or disable the specified quota type.
+Multiple
 .Fl q
 can be used to enable/disable all types at once.
 .Pp



CVS commit: src/share/man/man5

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:22:51 UTC 2011

Modified Files:
src/share/man/man5: fstab.5

Log Message:
Bump date for new quota.
Split file system like customary.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/share/man/man5/fstab.5

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/man5/fstab.5
diff -u src/share/man/man5/fstab.5:1.37 src/share/man/man5/fstab.5:1.38
--- src/share/man/man5/fstab.5:1.37	Sun Mar  6 17:08:17 2011
+++ src/share/man/man5/fstab.5	Sun Mar  6 17:22:50 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: fstab.5,v 1.37 2011/03/06 17:08:17 bouyer Exp $
+.\	$NetBSD: fstab.5,v 1.38 2011/03/06 17:22:50 wiz Exp $
 .\
 .\ Copyright (c) 1980, 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,12 +29,12 @@
 .\
 .\ @(#)fstab.5	8.1 (Berkeley) 6/5/93
 .\
-.Dd January 11, 2009
+.Dd March 6, 2011
 .Dt FSTAB 5
 .Os
 .Sh NAME
 .Nm fstab
-.Nd filesystem table for devices, types, and mount points
+.Nd file system table for devices, types, and mount points
 .Sh SYNOPSIS
 .In fstab.h
 .Sh DESCRIPTION
@@ -45,7 +45,7 @@
 is only read by programs, and not written;
 it is the duty of the system administrator to properly create
 and maintain this file.
-Each filesystem is described on a separate line;
+Each file system is described on a separate line;
 fields on each line are separated by tabs or spaces.
 Lines beginning
 with
@@ -70,8 +70,8 @@
 The first field,
 .Pq Fa fs_spec ,
 describes the block special device or
-remote filesystem to be mounted.
-For filesystems of type
+remote file system to be mounted.
+For file systems of type
 .Em ffs ,
 the special file name is the block special file name,
 and not the character special file name.
@@ -85,23 +85,23 @@
 .Pp
 The second field,
 .Pq Fa fs_file ,
-describes the mount point for the filesystem.
+describes the mount point for the file system.
 For swap and dump partitions, this field should be specified as
 .Dq none .
 .Pp
 The third field,
 .Pq Fa fs_vfstype ,
-describes the type of the filesystem.
-The system currently supports these filesystems:
+describes the type of the file system.
+The system currently supports these file systems:
 .Bl -tag -width filecore -offset indent
 .It Em adosfs
 an
 .Tn AmigaDOS
-filesystem.
+file system.
 .It Em cd9660
 an
 .Tn ISO
-9660 CD-ROM filesystem.
+9660 CD-ROM file system.
 .It Em ext2fs
 an implementation of the Linux
 .Dq Second Extended File-system .
@@ -111,9 +111,9 @@
 .It Em ffs
 a local
 .Ux
-filesystem.
+file system.
 .It Em filecore
-a filesystem for
+a file system for
 .Tn RISC\ OS .
 .It Em kernfs
 various and sundry kernel statistics.
@@ -122,27 +122,27 @@
 .It Em mfs
 a local memory-based
 .Ux
-filesystem.
+file system.
 .It Em msdos
 an
 .Tn MS-DOS
-.Dq FAT filesystem .
+.Dq FAT file system .
 .It Em nfs
 a Sun Microsystems compatible
 .Dq Network File System .
 .It Em ntfs
-a filesystem used by
+a file system used by
 .Tn Windows NT .
 Still experimental.
 .It Em null
-a loop-back filesystem, allowing parts of the system to be viewed
+a loop-back file system, allowing parts of the system to be viewed
 elsewhere.
 .It Em overlay
-a demonstration of layered filesystems.
+a demonstration of layered file systems.
 .It Em portal
-a general filesystem interface, currently supports TCP and FS mounts.
+a general file system interface, currently supports TCP and FS mounts.
 .It Em procfs
-a local filesystem of process information.
+a local file system of process information.
 .It Em ptyfs
 a pseudo-terminal device file system.
 .It Em smbfs
@@ -152,19 +152,19 @@
 .It Em tmpfs
 an efficient memory file system.
 .It Em umap
-a user and group re-mapping filesystem.
+a user and group re-mapping file system.
 .It Em union
-a translucent filesystem.
+a translucent file system.
 .El
 .Pp
 The fourth field,
 .Pq Fa fs_mntops ,
-describes the mount options associated with the filesystem.
+describes the mount options associated with the file system.
 It is formatted as a comma separated list of options.
 It contains at least the type of mount (see
 .Fa fs_type
 below) plus any additional options
-appropriate to the filesystem type.
+appropriate to the file system type.
 .Pp
 The option
 .Dq auto
@@ -181,16 +181,16 @@
 and/or
 .Dq groupquota
 are specified,
-the filesystem is automatically processed by the
+the file system is automatically processed by the
 .Xr quotacheck 8
 command, and legacy user and/or group disk quotas are enabled with
 .Xr quotaon 8 .
 By default,
-filesystem quotas are maintained in files named
+file system quotas are maintained in files named
 .Pa quota.user
 and
 .Pa quota.group
-which are located at the root of the associated filesystem.
+which are located at the root of the associated file system.
 These defaults may be overridden by putting an equal sign
 and an alternative absolute pathname 

CVS commit: src/usr.bin/quota

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:25:32 UTC 2011

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

Log Message:
Sort options. Split file system like usual. Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/quota/quota.1

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

Modified files:

Index: src/usr.bin/quota/quota.1
diff -u src/usr.bin/quota/quota.1:1.15 src/usr.bin/quota/quota.1:1.16
--- src/usr.bin/quota/quota.1:1.15	Sun Mar  6 17:08:42 2011
+++ src/usr.bin/quota/quota.1	Sun Mar  6 17:25:32 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: quota.1,v 1.15 2011/03/06 17:08:42 bouyer Exp $
+.\	$NetBSD: quota.1,v 1.16 2011/03/06 17:25:32 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\	from: @(#)quota.1	8.1 (Berkeley) 6/6/93
 .\
-.Dd June 6, 1993
+.Dd March 6, 2011
 .Dt QUOTA 1
 .Os
 .Sh NAME
@@ -40,28 +40,19 @@
 .Nd display disk usage and limits
 .Sh SYNOPSIS
 .Nm
-.Op Fl D
-.Op Fl h
-.Op Fl g
-.Op Fl u
+.Op Fl Dghu
 .Op Fl v | Fl q
 .Nm
-.Op Fl D
-.Op Fl h
-.Op Fl u
+.Op Fl Dhu
 .Op Fl v | Fl q
 .Ar user
 .Nm
-.Op Fl D
-.Op Fl h
-.Op Fl g
+.Op Fl Dgh
 .Op Fl v | Fl q
 .Ar group
 .Nm
 .Fl d
-.Op Fl D
-.Op Fl h
-.Op Fl g
+.Op Fl Dgh
 .Op Fl v | Fl q
 .Sh DESCRIPTION
 .Nm
@@ -71,27 +62,24 @@
 Options:
 .Pp
 .Bl -tag -width Ds
-.It Fl h
-Numbers are displayed in a human readable format.
+.It Fl D
+Debug: print plist sent to and received from kernel.
+.It Fl d
+Query the kernel for default user or group quota instead of a specific
+user or group.
 .It Fl g
-Print group quotas for the group
-of which the user is a member.
+Print group quotas for the group of which the user is a member.
 The optional
 .Fl u
 flag is equivalent to the default.
+.It Fl h
+Numbers are displayed in a human readable format.
+.It Fl q
+Print a more terse message, containing only information
+on file systems where usage is over quota.
 .It Fl v
 .Nm
-will display quotas on filesystems
-where no storage is allocated.
-.It Fl q
-Print a more terse message,
-containing only information
-on filesystems where usage is over quota.
-.It Fl d
-Query the kernel for default user or group quota instead of a specific
-user or group
-.It Fl D
-Debug: print plist sent to and received from kernel.
+will display quotas on file systems where no storage is allocated.
 .El
 .Pp
 Specifying both
@@ -123,8 +111,8 @@
 flag.
 .Pp
 .Nm
-tries to report the quotas of all mounted filesystems.
-If the filesystem is mounted via
+tries to report the quotas of all mounted file systems.
+If the file system is mounted via
 .Em NFS
 it will attempt to contact the
 .Xr rpc.rquotad 8
@@ -133,7 +121,7 @@
 server.
 If
 .Nm
-exits with a non-zero status, one or more filesystems
+exits with a non-zero status, one or more file systems
 are over quota.
 .Sh SEE ALSO
 .Xr quotactl 2 ,



CVS commit: src/usr.sbin/edquota

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:32:38 UTC 2011

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

Log Message:
Split file system like usual. Improve SYNOPSIS. Various other fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/edquota/edquota.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/edquota/edquota.8
diff -u src/usr.sbin/edquota/edquota.8:1.13 src/usr.sbin/edquota/edquota.8:1.14
--- src/usr.sbin/edquota/edquota.8:1.13	Sun Mar  6 17:08:42 2011
+++ src/usr.sbin/edquota/edquota.8	Sun Mar  6 17:32:38 2011
@@ -29,7 +29,7 @@
 .\ SUCH DAMAGE.
 .\
 .\	from: @(#)edquota.8	8.2 (Berkeley) 4/27/95
-.\	$NetBSD: edquota.8,v 1.13 2011/03/06 17:08:42 bouyer Exp $
+.\	$NetBSD: edquota.8,v 1.14 2011/03/06 17:32:38 wiz Exp $
 .\
 .Dd February 6, 2011
 .Dt EDQUOTA 8
@@ -39,54 +39,45 @@
 .Nd edit user quotas
 .Sh SYNOPSIS
 .Nm
-.Op Fl D
-.Op Fl H
-.Op Fl u
-.Op Fl f Ar filesystem
+.Op Fl DHu
+.Op Fl f Ar file-system
 .Op Fl p Ar proto-username
 .Ar -d |
 .Ar username ...
 .Nm
-.Op Fl D
-.Op Fl H
+.Op Fl DH
 .Fl g
-.Op Fl f Ar filesystem
+.Op Fl f Ar file-system
 .Op Fl p Ar proto-groupname
 .Ar -d |
 .Ar groupname ...
 .Nm
-.Op Fl D
-.Op Fl H
-.Op Fl u
-.Op Fl f Ar filesystem
+.Op Fl DHu
+.Op Fl f Ar file-system
 .Op Fl h Ar block#/inode#
 .Op Fl s Ar block#/inode#
 .Op Fl t Ar block grace time/inode grace time
 .Ar -d |
 .Ar username ...
 .Nm
-.Op Fl D
-.Op Fl H
+.Op Fl DH
 .Fl g
-.Op Fl f Ar filesystem
+.Op Fl f Ar file-system
 .Op Fl h Ar block#/inode#
 .Op Fl s Ar block#/inode#
 .Op Fl t Ar block grace time/inode grace time
 .Ar -d |
 .Ar groupname ...
 .Nm
-.Op Fl D
-.Op Fl H
-.Op Fl u
+.Op Fl DHu
 .Fl c
-.Op Fl f Ar filesystem
+.Op Fl f Ar file-system
 .Ar username ...
 .Nm
-.Op Fl D
-.Op Fl H
+.Op Fl DH
 .Fl g
 .Fl c
-.Op Fl f Ar filesystem
+.Op Fl f Ar file-system
 .Ar groupname ...
 .Sh DESCRIPTION
 .Nm
@@ -96,15 +87,15 @@
 flag is specified,
 one or more users may be specified on the command line.
 Unless
-.Fl h,
-.Fl s
+.Fl h ,
+.Fl s ,
 or
 .Fl t
 are used, a temporary file is created for each user with an ASCII
 representation of the current disk quotas and grace time for that user.
-By default, quota for all quota-enabled filesystems are edited; the
+By default, quota for all quota-enabled file systems are edited; the
 .Fl f
-option can be used to restrict it to a single filesystem.
+option can be used to restrict it to a single file system.
 An editor is invoked on the ASCII file.
 The editor invoked is
 .Xr vi 1
@@ -113,7 +104,7 @@
 specifies otherwise.
 .Pp
 The quotas may then be modified, new quotas added, etc.
-Setting a quota to - or unlimited indicates that no quota should be imposed.
+Setting a quota to \- or unlimited indicates that no quota should be imposed.
 Setting a quota to zero indicates that no allocation is permited.
 Setting a soft limit to zero  with a unlimited hard limit
 indicates that allocations should be permitted on only a temporary basis.
@@ -121,7 +112,7 @@
 only the hard and soft limits, and grace time can be changed.
 .Pp
 Users are permitted to exceed their soft limits
-for a grace period that may be specified per user (or per-filesystem
+for a grace period that may be specified per user (or per-file system
 for quota version 1).
 Once the grace period has expired,
 the soft limit is enforced as a hard limit.
@@ -132,7 +123,10 @@
 .Xr humanize_number 9
 suffix (K for kilo, M for mega, G for giga, T for tera).
 Time can be entered with Y (year), W (week), D (day), H (hour) and M (minute)
-suffixes. Suffixes can be mixed (see EXAMPLES below).
+suffixes.
+Suffixes can be mixed (see
+.Sx EXAMPLES
+below).
 If the
 .Fl H
 option if used, current quota, disk usage and time are displayed in
@@ -152,14 +146,14 @@
 .Pp
 The
 .Fl h ,
-.Fl s
+.Fl s ,
 and
 .Fl t
 flags can be used to change quota limits (hard, soft and grace time,
 respectively) without user interaction, for usage in e.g. batch scripts.
 The arguments are the new block and inode number limit or grace time,
-separated by a slash. Units suffix may be used, as in the editor
-above.
+separated by a slash.
+Units suffix may be used, as in the editor above.
 .Pp
 If the
 .Fl g
@@ -168,7 +162,7 @@
 is invoked to edit the quotas of
 one or more groups specified on the command line.
 .Pp
-With quota version 2, there is a per-filesystem user or group
+With quota version 2, there is a per-file system user or group
 default quota to be copied to a user or group quota on the first
 allocation.
 The
@@ -176,13 +170,14 @@
 flag adds the default quota to the list of users or groups to edit.
 .Pp
 For quota version 1, there is no default block/inode quota, and no
-per-user/group grace time. To edit the filesystem-wide grace time, use
+per-user/group grace time.
+To edit the file system-wide grace time, use
 .Fl d .
 .Pp
-On quota2-enabled filesystems, the

CVS commit: src/usr.sbin/quotactl

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:34:57 UTC 2011

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

Log Message:
Remove trailing whitespace; remove dot at end of SEE ALSO; new sentence, new 
line;
split file system; more markup.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/quotactl/quotactl.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/quotactl/quotactl.8
diff -u src/usr.sbin/quotactl/quotactl.8:1.2 src/usr.sbin/quotactl/quotactl.8:1.3
--- src/usr.sbin/quotactl/quotactl.8:1.2	Sun Mar  6 17:08:43 2011
+++ src/usr.sbin/quotactl/quotactl.8	Sun Mar  6 17:34:57 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: quotactl.8,v 1.2 2011/03/06 17:08:43 bouyer Exp $
+.\	$NetBSD: quotactl.8,v 1.3 2011/03/06 17:34:57 wiz Exp $
 .\
 .\ Copyright (c) 2011 Manuel Bouyer
 .\ All rights reserved.
@@ -32,43 +32,44 @@
 .Nd send commands to the kernel disk quota subsystem
 .Sh SYNOPSIS
 .Nm
-.Op Fl D
-.Op Fl x
-.Ar filesystem 
+.Op Fl Dx
+.Ar file-system
 .Op Ar plist
 .Sh DESCRIPTION
 .Nm
 reads a property list of commands from the specified file or stdin,
-and sends it to the kernel for the specified filesystem through the
+and sends it to the kernel for the specified file system through the
 .Xr quotactl 2
 system call.
 .Pp
 Available options:
 .Bl -tag -width Ds
-.It Fl x
-Do not parse reply from kernel for errors and print it to stdout
 .It Fl D
-Debug: print plist sent to and received from kernel to stderr
+Debug: print plist sent to and received from kernel to stderr.
+.It Fl x
+Do not parse reply from kernel for errors and print it to stdout.
 .El
 .Pp
 If
 .Fl x
-is not specified, 
+is not specified,
 .Nm
 parses the reply from the kernel, looking at each command return value
 and reporting errors.
 .Sh EXIT STATUS
 .Nm
-exists with 0 on success. If there was problems parsing the command plist,
+exists with 0 on success.
+If there was problems parsing the command plist,
 or the reply from the kernel, or if the
 .Xr quotactl 2
-system call returned an error, the exist status will be 1.
+system call returned an error, the exit status will be 1.
 Unless
 .Fl x
 is present, a message is printed to stderr for each failed command,
 and the exit status will be 2 if any comand failed.
 .Sh EXAMPLES
-This will set the quota limits for user id 100 on the filesystem /home:
+This will set the quota limits for user id 100 on the file system
+.Pa /home :
 .Bd -literal
 quotactl /home  EOF
 ?xml version=1.0 encoding=UTF-8?
@@ -128,7 +129,7 @@
 .Xr quotactl 2 ,
 .Xr proplib 3 ,
 .Xr edquota 8 ,
-.Xr repquota 8 .
+.Xr repquota 8
 .Sh HISTORY
 The
 .Nm



CVS commit: src/usr.sbin/repquota

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:36:32 UTC 2011

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

Log Message:
Sort options, split file system.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/repquota/repquota.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/repquota/repquota.8
diff -u src/usr.sbin/repquota/repquota.8:1.10 src/usr.sbin/repquota/repquota.8:1.11
--- src/usr.sbin/repquota/repquota.8:1.10	Sun Mar  6 17:08:43 2011
+++ src/usr.sbin/repquota/repquota.8	Sun Mar  6 17:36:32 2011
@@ -29,7 +29,7 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)repquota.8	8.1 (Berkeley) 6/6/93
-.\	$NetBSD: repquota.8,v 1.10 2011/03/06 17:08:43 bouyer Exp $
+.\	$NetBSD: repquota.8,v 1.11 2011/03/06 17:36:32 wiz Exp $
 .\
 .Dd February 10, 2011
 .Dt REPQUOTA 8
@@ -39,25 +39,15 @@
 .Nd summarize quotas for a file system
 .Sh SYNOPSIS
 .Nm
-.Op Fl h
-.Op Fl D
-.Op Fl g
-.Op Fl u
-.Op Fl v
-.Ar filesystem Ar ...
+.Op Fl Dghuv
+.Ar file-system Ar ...
 .Nm
-.Op Fl h
-.Op Fl D
-.Op Fl g
-.Op Fl u
-.Op Fl v
+.Op Fl Dghuv
 .Fl a
 .Nm
 .Fl x
-.Op Fl D
-.Op Fl g
-.Op Fl u
-.Ar filesystem
+.Op Fl Dgu
+.Ar file-system
 .Sh DESCRIPTION
 .Nm
 prints a summary of the disk usage and quotas for the
@@ -66,24 +56,24 @@
 Available options:
 .Bl -tag -width Ds
 .It Fl a
-Print the quotas of all the mounted filesystems.
+Print the quotas of all the mounted file systems.
+.It Fl D
+Debug: print plist sent to and received from kernel.
 .It Fl g
 Print only group quotas (the default is to print both
 group and user quotas if they exist).
+.It Fl h
+Numbers are displayed in a human readable format.
 .It Fl u
 Print only user quotas (the default is to print both
 group and user quotas if they exist).
 .It Fl v
-Print a header line before printing each filesystem quotas.
+Print a header line before printing each file system quotas.
 Print all exiting quotas, including those whose current usage is 0.
-.It Fl D
-Debug: print plist sent to and received from kernel.
-.It Fl h
-Numbers are displayed in a human readable format.
 .It Fl x
-export filesystem quota in a plist format suitable for
+export file system quota in a plist format suitable for
 .Xr quotactl 8 .
-A single filesystem should be specified.
+A single file system should be specified.
 .El
 .Pp
 For each user or group, the current



CVS commit: src/share/man/man4

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:39:06 UTC 2011

Modified Files:
src/share/man/man4: wscons.4 wskbd.4 wsmux.4 wss.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/man/man4/wscons.4
cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/wskbd.4
cvs rdiff -u -r1.11 -r1.12 src/share/man/man4/wsmux.4
cvs rdiff -u -r1.19 -r1.20 src/share/man/man4/wss.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/wscons.4
diff -u src/share/man/man4/wscons.4:1.28 src/share/man/man4/wscons.4:1.29
--- src/share/man/man4/wscons.4:1.28	Wed Apr 30 13:10:55 2008
+++ src/share/man/man4/wscons.4	Sun Mar  6 17:39:05 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: wscons.4,v 1.28 2008/04/30 13:10:55 martin Exp $
+.\ $NetBSD: wscons.4,v 1.29 2011/03/06 17:39:05 wiz Exp $
 .\
 .\ Copyright (c) 1999, 2004 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -85,7 +85,8 @@
 .Xr termcap 5 .
 Instead a
 .Dq terminal emulation
-is assigned to each virtual screen when the screen is created. (See
+is assigned to each virtual screen when the screen is created.
+(See
 .Xr wsconscfg 8 . )
 Different terminal emulations can be active at the same time on one display.
 The following choices are available:
@@ -93,15 +94,18 @@
 .It dumb
 This minimal terminal support is available unless the kernel option
 .Cd options WSEMUL_NO_DUMB
-was specified at build time. No control sequences are supported besides
-the ASCII control characters. The cursor is not addressable. Only ASCII
+was specified at build time.
+No control sequences are supported besides the ASCII control characters.
+The cursor is not addressable.
+Only ASCII
 keyboard codes will be delivered, cursor and functions keys do not work.
 .It sun
 The
 .Dq sun
 console emulation is available if
 .Cd options WSEMUL_SUN
-was specified at kernel build time. It supports the control sequences of
+was specified at kernel build time.
+It supports the control sequences of
 .Tn SUN
 machine consoles and delivers its keyboard codes for function and
 keypad keys in use.
@@ -115,7 +119,8 @@
 .Tn DEC VT220
 and
 .Tn DEC VT320
-models. The features of the original
+models.
+The features of the original
 .Tn VT100
 which are not or not completely implemented are:
 .Bl -bullet
@@ -139,7 +144,8 @@
 subtle differences.
 .It
 The actual rendering quality depends on the underlying graphics hardware
-driver. Characters might be missing in the available fonts and be
+driver.
+Characters might be missing in the available fonts and be
 substituted by more or less fitting replacements.
 .Pp
 Depending on the keyboard used, not all function keys might be available.
@@ -168,9 +174,9 @@
 The
 .Va WSEMUL_DEFAULT
 kernel option is used to select one of the described terminal options
-as the default choice. The default takes effect at kernel startup, i.e.
-for the operating system console or additional screens allocated
-through the
+as the default choice.
+The default takes effect at kernel startup, i.e. for the operating
+system console or additional screens allocated through the
 .Va WSDISPLAY_DEFAULTSCREENS
 option (see
 .Xr wsdisplay 4 ) ,
@@ -182,7 +188,8 @@
 console driver functions which were written specifically for other
 console drivers to run on
 .Nx
-systems. The options are in particular:
+systems.
+The options are in particular:
 .Bl -tag -width 
 .It Cd WSDISPLAY_COMPAT_USL
 Support the protocol for switches between multiple virtual screens on
@@ -199,7 +206,8 @@
 Emulates enough of the
 .Fx
 .Dq syscons
-driver to make X servers work. Useful with
+driver to make X servers work.
+Useful with
 .Fx
 binary emulation.
 .El
@@ -225,7 +233,8 @@
 .Dq WS_DEFAULT_FG
 and
 .Dq WS_DEFAULT_BG
-set the foreground / background used on color displays. The
+set the foreground / background used on color displays.
+The
 .Dq WSCOL_XXX
 arguments are colors as defined in
 .Pa src/sys/dev/wscons/wsdisplayvar.h .
@@ -258,8 +267,8 @@
 The virtual screen switching protocol enabled by
 .Dq WSDISPLAY_COMPAT_USL
 uses a somewhat complex handshake protocol to pass control to user programs
-such as X servers controlling a virtual screen. In order
-to prevent a non-responsive
+such as X servers controlling a virtual screen.
+In order to prevent a non-responsive
 application from locking the whole console system,
 a screen switch will be rolled
 back after a 5 second timeout if the application does not respond.

Index: src/share/man/man4/wskbd.4
diff -u src/share/man/man4/wskbd.4:1.13 src/share/man/man4/wskbd.4:1.14
--- src/share/man/man4/wskbd.4:1.13	Mon Mar  9 19:24:28 2009
+++ src/share/man/man4/wskbd.4	Sun Mar  6 17:39:05 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: wskbd.4,v 1.13 2009/03/09 19:24:28 joerg Exp $
+.\ $NetBSD: wskbd.4,v 1.14 2011/03/06 17:39:05 wiz Exp $
 .\
 .\ Copyright (c) 1999
 .\ 	Matthias Drochner.  All rights reserved.
@@ 

CVS commit: src/share/man/man4

2011-03-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar  6 17:39:34 UTC 2011

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

Log Message:
Fix typo.


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

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.400 src/share/man/man4/options.4:1.401
--- src/share/man/man4/options.4:1.400	Sun Mar  6 17:11:19 2011
+++ src/share/man/man4/options.4	Sun Mar  6 17:39:34 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: options.4,v 1.400 2011/03/06 17:11:19 bouyer Exp $
+.\	$NetBSD: options.4,v 1.401 2011/03/06 17:39:34 wiz Exp $
 .\
 .\ Copyright (c) 1996
 .\ 	Perry E. Metzger.  All rights reserved.
@@ -966,7 +966,7 @@
 .Dq ffs
 and
 .Dq mfs
-file system at this time.
+file systems at this time.
 .It Cd options FFS_EI
 Enable ``Endian-Independent'' FFS support.
 This allows a system to mount an FFS file system created for another



CVS commit: src/usr.bin/make

2011-03-06 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Mar  6 17:41:11 UTC 2011

Modified Files:
src/usr.bin/make: meta.c

Log Message:
Only need to getcwd() once


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/meta.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/make/meta.c
diff -u src/usr.bin/make/meta.c:1.10 src/usr.bin/make/meta.c:1.11
--- src/usr.bin/make/meta.c:1.10	Sun Mar  6 04:34:25 2011
+++ src/usr.bin/make/meta.c	Sun Mar  6 17:41:11 2011
@@ -763,15 +763,15 @@
 meta_oodate(GNode *gn, Boolean oodate)
 {
 static char *tmpdir = NULL;
+static char cwd[MAXPATHLEN];
 char ldir_vname[64];
-char cwd[MAXPATHLEN];
 char latestdir[MAXPATHLEN];
 char fname[MAXPATHLEN];
 char fname1[MAXPATHLEN];
 char fname2[MAXPATHLEN];
 char *p;
 char *cp;
-size_t cwdlen;
+static size_t cwdlen = 0;
 static size_t tmplen = 0;
 FILE *fp;
 Boolean ignoreOODATE = FALSE;
@@ -787,9 +787,6 @@
  */
 Make_DoAllVar(gn);
 
-if (getcwd(cwd, sizeof(cwd)) == NULL)
-	err(1, Could not get current working directory);
-
 meta_name(gn, fname, sizeof(fname), NULL, NULL);
 
 #ifdef DEBUG_META_MODE
@@ -813,6 +810,12 @@
 	buf = bmake_malloc(bufsz);
 	}
 
+	if (!cwdlen) {
+	if (getcwd(cwd, sizeof(cwd)) == NULL)
+		err(1, Could not get current working directory);
+	cwdlen = strlen(cwd);
+	}
+
 	if (!tmpdir) {
 	tmpdir = getTmpdir();
 	tmplen = strlen(tmpdir);
@@ -821,8 +824,6 @@
 	/* we want to track all the .meta we read */
 	Var_Append(.MAKE.META.FILES, fname, VAR_GLOBAL);
 
-	cwdlen = strlen(cwd);
-
 	ln = Lst_First(gn-commands);
 	while (!oodate  (x = fgetLine(buf, bufsz, 0, fp))  0) {
 	lineno++;
@@ -1091,7 +1092,7 @@
 		ln = Lst_Succ(ln);
 		}
 	} else if (strcmp(buf, CWD) == 0) {
-		if (strcmp(p, cwd) != 0) {
+		if (strcmp(p, cwd) != 0) {
 		if (DEBUG(META))
 			fprintf(debug_file, %s: %d: the current working directory has changed from '%s' to '%s'\n, fname, lineno, p, curdir);
 		oodate = TRUE;



CVS commit: src/tools

2011-03-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar  6 18:15:31 UTC 2011

Modified Files:
src/tools/installboot: Makefile
src/tools/makefs: Makefile

Log Message:
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tools/installboot/Makefile
cvs rdiff -u -r1.7 -r1.8 src/tools/makefs/Makefile

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

Modified files:

Index: src/tools/installboot/Makefile
diff -u src/tools/installboot/Makefile:1.10 src/tools/installboot/Makefile:1.11
--- src/tools/installboot/Makefile:1.10	Sat Jun 19 23:11:10 2010
+++ src/tools/installboot/Makefile	Sun Mar  6 18:15:30 2011
@@ -1,9 +1,10 @@
-#	$NetBSD: Makefile,v 1.10 2010/06/19 23:11:10 riz Exp $
+#	$NetBSD: Makefile,v 1.11 2011/03/06 18:15:30 bouyer Exp $
 
 HOSTPROGNAME=	${_TOOL_PREFIX}installboot
 HOST_SRCDIR=	usr.sbin/installboot
 
 HOST_CPPFLAGS+=	-I. -I${.CURDIR} -I${.CURDIR}/../mips-elf2ecoff
+HOST_CPPFLAGS+=	-I${TOOLDIR}/include/nbinclude
 
 .include ${.CURDIR}/../Makefile.nbincludes
 .include ${.CURDIR}/../Makefile.host

Index: src/tools/makefs/Makefile
diff -u src/tools/makefs/Makefile:1.7 src/tools/makefs/Makefile:1.8
--- src/tools/makefs/Makefile:1.7	Wed May 14 00:30:27 2003
+++ src/tools/makefs/Makefile	Sun Mar  6 18:15:30 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.7 2003/05/14 00:30:27 dbj Exp $
+#	$NetBSD: Makefile,v 1.8 2011/03/06 18:15:30 bouyer Exp $
 
 HOSTPROGNAME=	${_TOOL_PREFIX}makefs
 HOST_SRCDIR=	usr.sbin/makefs
 
-HOST_CPPFLAGS+=	-I.
+HOST_CPPFLAGS+=	-I. -I${TOOLDIR}/include/nbinclude
 
 .include ${.CURDIR}/../Makefile.host
 



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

2011-03-06 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Mar  6 18:22:13 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: Makefile brdsetup.c devopen.c
globals.h main.c
Added Files:
src/sys/arch/sandpoint/stand/altboot: memfs.c memfs.h

Log Message:
Suport for loading a kernel from memory (RAM, ROM or Flash).
The boot file path should look like mem:address, where address is
the start address, in hex notation, of the file in memory.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sandpoint/stand/altboot/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sandpoint/stand/altboot/devopen.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sandpoint/stand/altboot/globals.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/stand/altboot/main.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/sandpoint/stand/altboot/memfs.c \
src/sys/arch/sandpoint/stand/altboot/memfs.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/sandpoint/stand/altboot/Makefile
diff -u src/sys/arch/sandpoint/stand/altboot/Makefile:1.9 src/sys/arch/sandpoint/stand/altboot/Makefile:1.10
--- src/sys/arch/sandpoint/stand/altboot/Makefile:1.9	Sun Mar  6 13:55:12 2011
+++ src/sys/arch/sandpoint/stand/altboot/Makefile	Sun Mar  6 18:22:13 2011
@@ -1,12 +1,13 @@
-#	$NetBSD: Makefile,v 1.9 2011/03/06 13:55:12 phx Exp $
+#	$NetBSD: Makefile,v 1.10 2011/03/06 18:22:13 phx Exp $
 
 S=		${.CURDIR}/../../../..
 
 PROG=		altboot
 FILES+=		${PROG}.bin ${PROG}.img
 NOMAN=		# defined
-SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c nif.c
-SRCS+=		fxp.c tlp.c rge.c skg.c stg.c dsk.c pciide.c siisata.c
+SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c memfs.c
+SRCS+=		nif.c fxp.c tlp.c rge.c skg.c stg.c
+SRCS+=		dsk.c pciide.c siisata.c
 SRCS+=		printf.c vers.c
 CLEANFILES+=	vers.c ${PROG} ${PROG}.bin ${PROG}.img
 CFLAGS+=	-Wall -Wno-main -ffreestanding -msoft-float -mmultiple

Index: src/sys/arch/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.6 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.7
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.6	Sun Mar  6 13:55:12 2011
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Sun Mar  6 18:22:13 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.6 2011/03/06 13:55:12 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.7 2011/03/06 18:22:13 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -959,20 +959,13 @@
 	return NULL;
 }
 
-static uint8_t hex2nibble(char c)
-{
-	if (c = 'a')
-		c = ~0x20;
-	return c  '9' ? c - 'A' + 10 : c - '0';
-}
-
 static void
 read_mac_string(uint8_t *mac, char *p)
 {
 	int i;
 
 	for (i = 0; i  6; i++, p += 3)
-		*mac++ = (hex2nibble(p[0])  4) | hex2nibble(p[1]);
+		*mac++ = read_hex(p);
 }
 
 /*

Index: src/sys/arch/sandpoint/stand/altboot/devopen.c
diff -u src/sys/arch/sandpoint/stand/altboot/devopen.c:1.1 src/sys/arch/sandpoint/stand/altboot/devopen.c:1.2
--- src/sys/arch/sandpoint/stand/altboot/devopen.c:1.1	Sun Jan 23 01:05:30 2011
+++ src/sys/arch/sandpoint/stand/altboot/devopen.c	Sun Mar  6 18:22:13 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: devopen.c,v 1.1 2011/01/23 01:05:30 nisimura Exp $ */
+/* $NetBSD: devopen.c,v 1.2 2011/03/06 18:22:13 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 #include lib/libkern/libkern.h
 
 #include globals.h
+#include memfs.h
 
 struct devsw devnet = { net, net_strategy, net_open, net_close, noioctl };
 struct devsw devdsk = { dsk, dsk_strategy, dsk_open, dsk_close, noioctl };
@@ -50,6 +51,7 @@
 struct fs_ops fs_tftp  = FS_OPS(tftp);
 struct fs_ops fs_ffsv2 = FS_OPS(ffsv2);
 struct fs_ops fs_ffsv1 = FS_OPS(ffsv1);
+struct fs_ops fs_mem   = FS_OPS(mem);
 extern char *fsmod;
 
 static void parseunit(const char *, int *, int *, char **);
@@ -64,6 +66,13 @@
 	if (of-f_flags != F_READ)
 		return EPERM;
 
+	if (strncmp(mem:, name, 4) == 0) {
+		of-f_dev = NULL;
+		of-f_flags |= F_NODEV;
+		file_system[0] = fs_mem;
+		*file = (char *)name[4];
+		return 0;		/* MEM */
+	}
 	if (strncmp(net:, name, 4) == 0 || strncmp(nfs:, name, 4) == 0) {
 		of-f_dev = devnet;
 		if ((error = net_open(of, name[4], nfs)) != 0)

Index: src/sys/arch/sandpoint/stand/altboot/globals.h
diff -u src/sys/arch/sandpoint/stand/altboot/globals.h:1.7 src/sys/arch/sandpoint/stand/altboot/globals.h:1.8
--- src/sys/arch/sandpoint/stand/altboot/globals.h:1.7	Sun Mar  6 13:55:12 2011
+++ src/sys/arch/sandpoint/stand/altboot/globals.h	Sun Mar  6 18:22:13 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.h,v 1.7 2011/03/06 13:55:12 phx Exp $ */
+/* $NetBSD: globals.h,v 1.8 2011/03/06 18:22:13 phx Exp $ */
 
 #ifdef DEBUG
 #define	DPRINTF(x)	printf x
@@ -117,6 +117,9 @@
 void _wbinv(uint32_t, uint32_t);
 void _inv(uint32_t, uint32_t);
 
+/* parsing */
+uint32_t 

CVS commit: src/sys/arch

2011-03-06 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Mar  6 20:34:58 UTC 2011

Modified Files:
src/sys/arch/arc/include: param.h
src/sys/arch/bebox/include: param.h
src/sys/arch/cobalt/include: param.h
src/sys/arch/newsmips/include: param.h
src/sys/arch/pmax/include: param.h
src/sys/arch/sbmips/include: param.h
src/sys/arch/sgimips/include: param.h

Log Message:
Now that MACHINE is defined in user-land in either
mips/include/mips_param.h or powerpc/include/param.h, stop
trying to re-define it in the port-specific param.h files
when _KERNEL isn't defined.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arc/include/param.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/bebox/include/param.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/cobalt/include/param.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/include/param.h
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/pmax/include/param.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sbmips/include/param.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sgimips/include/param.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/arc/include/param.h
diff -u src/sys/arch/arc/include/param.h:1.27 src/sys/arch/arc/include/param.h:1.28
--- src/sys/arch/arc/include/param.h:1.27	Tue Feb  8 20:20:09 2011
+++ src/sys/arch/arc/include/param.h	Sun Mar  6 20:34:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.27 2011/02/08 20:20:09 rmind Exp $	*/
+/*	$NetBSD: param.h,v 1.28 2011/03/06 20:34:57 he Exp $	*/
 /*  $OpenBSD: param.h,v 1.9 1997/04/30 09:54:15 niklas Exp $ */
 
 /*
@@ -56,7 +56,9 @@
 #define	_MACHINE_ARCH	mipsel
 #define	MACHINE_ARCH	mipsel
 #define	_MACHINE	arc
+#ifdef _KERNEL
 #define	MACHINE		arc
+#endif
 
 #define	KERNBASE	0x8000	/* start of kernel virtual */
 #define	BTOPKERNBASE	((u_long)KERNBASE  PGSHIFT)

Index: src/sys/arch/bebox/include/param.h
diff -u src/sys/arch/bebox/include/param.h:1.11 src/sys/arch/bebox/include/param.h:1.12
--- src/sys/arch/bebox/include/param.h:1.11	Sun Aug  1 06:13:19 2010
+++ src/sys/arch/bebox/include/param.h	Sun Mar  6 20:34:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.11 2010/08/01 06:13:19 kiyohara Exp $	*/
+/*	$NetBSD: param.h,v 1.12 2011/03/06 20:34:57 he Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -42,7 +42,9 @@
 /*
  * Machine dependent constants for PowerPC (32-bit only currently)
  */
+#ifdef _KERNEL
 #define	MACHINE		bebox
+#endif
 
 #define	__NO_FIXED_MSGBUF
 

Index: src/sys/arch/cobalt/include/param.h
diff -u src/sys/arch/cobalt/include/param.h:1.17 src/sys/arch/cobalt/include/param.h:1.18
--- src/sys/arch/cobalt/include/param.h:1.17	Tue Feb  8 20:20:11 2011
+++ src/sys/arch/cobalt/include/param.h	Sun Mar  6 20:34:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.17 2011/02/08 20:20:11 rmind Exp $	*/
+/*	$NetBSD: param.h,v 1.18 2011/03/06 20:34:57 he Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -40,7 +40,9 @@
 #include mips/mips_param.h
 
 #define	_MACHINE	cobalt
+#ifdef _KERNEL
 #define	MACHINE		cobalt
+#endif
 
 #define	DEV_BSIZE	512
 #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */

Index: src/sys/arch/newsmips/include/param.h
diff -u src/sys/arch/newsmips/include/param.h:1.19 src/sys/arch/newsmips/include/param.h:1.20
--- src/sys/arch/newsmips/include/param.h:1.19	Tue Feb  8 20:20:21 2011
+++ src/sys/arch/newsmips/include/param.h	Sun Mar  6 20:34:57 2011
@@ -1,4 +1,4 @@
-/*	from $NetBSD: param.h,v 1.19 2011/02/08 20:20:21 rmind Exp $	*/
+/*	from $NetBSD: param.h,v 1.20 2011/03/06 20:34:57 he Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -52,7 +52,9 @@
  */
 
 #define	_MACHINE	newsmips
+#ifdef _KERNEL
 #define	MACHINE		newsmips
+#endif
 
 #define	KERNBASE	0x8000	/* start of kernel virtual */
 #define KERNTEXTOFF	0x80001000	/* start of kernel text for kvm_mkdb */

Index: src/sys/arch/pmax/include/param.h
diff -u src/sys/arch/pmax/include/param.h:1.43 src/sys/arch/pmax/include/param.h:1.44
--- src/sys/arch/pmax/include/param.h:1.43	Sun Feb 20 07:50:25 2011
+++ src/sys/arch/pmax/include/param.h	Sun Mar  6 20:34:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.43 2011/02/20 07:50:25 matt Exp $	*/
+/*	$NetBSD: param.h,v 1.44 2011/03/06 20:34:56 he Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -52,7 +52,9 @@
  */
 
 #define	_MACHINE	pmax
+#ifdef _KERNEL
 #define	MACHINE		pmax
+#endif
 
 #define	DEV_BSIZE	512
 #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */

Index: src/sys/arch/sbmips/include/param.h
diff -u src/sys/arch/sbmips/include/param.h:1.8 src/sys/arch/sbmips/include/param.h:1.9
--- src/sys/arch/sbmips/include/param.h:1.8	Tue Feb  8 20:20:23 2011
+++ src/sys/arch/sbmips/include/param.h	Sun Mar  6 20:34:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.8 2011/02/08 20:20:23 rmind Exp $	*/
+/*	$NetBSD: param.h,v 1.9 2011/03/06 20:34:56 he Exp $	*/
 
 /*
  * Copyright (c) 1988 

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

2011-03-06 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Mar  6 20:36:29 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: nif.c

Log Message:
Renamed stg to stge as in the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/nif.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/sandpoint/stand/altboot/nif.c
diff -u src/sys/arch/sandpoint/stand/altboot/nif.c:1.3 src/sys/arch/sandpoint/stand/altboot/nif.c:1.4
--- src/sys/arch/sandpoint/stand/altboot/nif.c:1.3	Sun Mar  6 13:55:12 2011
+++ src/sys/arch/sandpoint/stand/altboot/nif.c	Sun Mar  6 20:36:29 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: nif.c,v 1.3 2011/03/06 13:55:12 phx Exp $ */
+/* $NetBSD: nif.c,v 1.4 2011/03/06 20:36:29 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -54,11 +54,11 @@
 static struct iodesc netdesc;
 
 static struct nifdv lnifdv[] = {
-	{ fxp, fxp_match, fxp_init, fxp_send, fxp_recv },
-	{ tlp, tlp_match, tlp_init, tlp_send, tlp_recv },
-	{ re,  rge_match, rge_init, rge_send, rge_recv },
-	{ sk,  skg_match, skg_init, skg_send, skg_recv },
-	{ stg, stg_match, stg_init, stg_send, stg_recv },
+	{ fxp,  fxp_match, fxp_init, fxp_send, fxp_recv },
+	{ tlp,  tlp_match, tlp_init, tlp_send, tlp_recv },
+	{ re,   rge_match, rge_init, rge_send, rge_recv },
+	{ sk,   skg_match, skg_init, skg_send, skg_recv },
+	{ stge, stg_match, stg_init, stg_send, stg_recv },
 };
 static int nnifdv = sizeof(lnifdv)/sizeof(lnifdv[0]);
 



CVS commit: src/usr.bin/quota

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 20:47:59 UTC 2011

Modified Files:
src/usr.bin/quota: Makefile getvfsquota.c getvfsquota.h printquota.c
printquota.h quota.c

Log Message:
- WARNS=4
- KNF
- don't cast malloc
- don't use static buffers
- fix types
- remove extra \n's from errors
- fix prototypes


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/quota/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/quota/getvfsquota.c \
src/usr.bin/quota/getvfsquota.h src/usr.bin/quota/printquota.c \
src/usr.bin/quota/printquota.h
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/quota/quota.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/quota/Makefile
diff -u src/usr.bin/quota/Makefile:1.7 src/usr.bin/quota/Makefile:1.8
--- src/usr.bin/quota/Makefile:1.7	Sun Mar  6 12:08:42 2011
+++ src/usr.bin/quota/Makefile	Sun Mar  6 15:47:59 2011
@@ -1,6 +1,7 @@
-#	$NetBSD: Makefile,v 1.7 2011/03/06 17:08:42 bouyer Exp $	
+#	$NetBSD: Makefile,v 1.8 2011/03/06 20:47:59 christos Exp $	
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 
+WARNS ?= 4
 .include bsd.own.mk
 PROG=	quota
 SRCS=	quota.c printquota.c getvfsquota.c

Index: src/usr.bin/quota/getvfsquota.c
diff -u src/usr.bin/quota/getvfsquota.c:1.2 src/usr.bin/quota/getvfsquota.c:1.3
--- src/usr.bin/quota/getvfsquota.c:1.2	Sun Mar  6 12:08:42 2011
+++ src/usr.bin/quota/getvfsquota.c	Sun Mar  6 15:47:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getvfsquota.c,v 1.2 2011/03/06 17:08:42 bouyer Exp $ */
+/*	$NetBSD: getvfsquota.c,v 1.3 2011/03/06 20:47:59 christos Exp $ */
 
 /*-
   * Copyright (c) 2011 Manuel Bouyer
@@ -29,7 +29,7 @@
   */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: getvfsquota.c,v 1.2 2011/03/06 17:08:42 bouyer Exp $);
+__RCSID($NetBSD: getvfsquota.c,v 1.3 2011/03/06 20:47:59 christos Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -49,13 +49,12 @@
 /* retrieve quotas from vfs, for the given user id */
 int
 getvfsquota(const char *mp, struct quota2_entry *q2e, int8_t *versp,
-long id, int type, int defaultq, int debug)
+uint32_t id, int type, int defaultq, int debug)
 {
 	prop_dictionary_t dict, data, cmd;
 	prop_array_t cmds, datas;
 	prop_object_iterator_t iter;
 	struct plistref pref;
-	int error;
 	int8_t error8;
 	bool ret;
 	int retval = 0;
@@ -95,17 +94,14 @@
 	if (quotactl(mp, pref) != 0)
 		err(1, quotactl);
 	
-	if ((error = prop_dictionary_recv_syscall(pref, dict)) != 0) {
-		errx(1, prop_dictionary_recv_syscall: %s\n,
-		strerror(error));
-	}
+	if ((errno = prop_dictionary_recv_syscall(pref, dict)) != 0)
+		err(1, prop_dictionary_recv_syscall);
 	if (debug)
 		printf(reply from kernel:\n%s\n,
 		prop_dictionary_externalize(dict));
-	if ((error = quota2_get_cmds(dict, cmds)) != 0) {
-		errx(1, quota2_get_cmds: %s\n,
-		strerror(error));
-	}
+	if ((errno = quota2_get_cmds(dict, cmds)) != 0)
+		err(1, quota2_get_cmds);
+
 	iter = prop_array_iterator(cmds);
 	if (iter == NULL)
 		err(1, prop_array_iterator(cmds));
@@ -120,20 +116,17 @@
 
 		if (error8) {
 			if (error8 != ENOENT  error8 != ENODEV) {
+errno = error8;
 if (defaultq) {
-	fprintf(stderr,
-	get default %s quota: %s\n,
-	qfextension[type],
-	strerror(error8));
+	warn(get default %s quota,
+	qfextension[type]);
 } else {
-	fprintf(stderr,
-	get %s quota for %ld: %s\n,
-	qfextension[type], id,
-	strerror(error8));
+	warn(get %s quota for %u,
+	qfextension[type], id);
 }
 			}
 			prop_object_release(dict);
-			return (0);
+			return 0;
 		}
 		datas = prop_dictionary_get(cmd, data);
 		if (datas == NULL)
@@ -156,11 +149,9 @@
 			if (data == NULL)
 err(1, prop_array_get(data));
 
-			error = quota2_dict_get_q2e_usage(data, q2e);
-			if (error) {
-errx(1, quota2_dict_get_q2e_usage: %s\n,
-strerror(error));
-			}
+			errno = quota2_dict_get_q2e_usage(data, q2e);
+			if (errno)
+err(1, quota2_dict_get_q2e_usage);
 			retval = 1;
 		}
 	}
Index: src/usr.bin/quota/getvfsquota.h
diff -u src/usr.bin/quota/getvfsquota.h:1.2 src/usr.bin/quota/getvfsquota.h:1.3
--- src/usr.bin/quota/getvfsquota.h:1.2	Sun Mar  6 12:08:42 2011
+++ src/usr.bin/quota/getvfsquota.h	Sun Mar  6 15:47:59 2011
@@ -1,6 +1,6 @@
-/*	$NetBSD: getvfsquota.h,v 1.2 2011/03/06 17:08:42 bouyer Exp $ */
+/*	$NetBSD: getvfsquota.h,v 1.3 2011/03/06 20:47:59 christos Exp $ */
 
 int getvfsquota(const char *, struct quota2_entry *, int8_t *,
-long, int, int, int);
+uint32_t, int, int, int);
 
 extern const char *qfextension[];
Index: src/usr.bin/quota/printquota.c
diff -u src/usr.bin/quota/printquota.c:1.2 src/usr.bin/quota/printquota.c:1.3
--- src/usr.bin/quota/printquota.c:1.2	Sun Mar  6 12:08:42 2011
+++ src/usr.bin/quota/printquota.c	Sun Mar  6 15:47:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: printquota.c,v 1.2 2011/03/06 17:08:42 bouyer Exp $ 

CVS commit: src

2011-03-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Mar  6 22:15:31 UTC 2011

Modified Files:
src/distrib/sets/lists/xbase: mi
src/distrib/sets/lists/xcomp: mi
src/etc/mtree: NetBSD.dist.Xorg
src/external/mit/xorg/server/xorg-server/hw/xfree86: Makefile

Log Message:
install xorg-server.m4 at the request of jmcneill.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/distrib/sets/lists/xbase/mi
cvs rdiff -u -r1.124 -r1.125 src/distrib/sets/lists/xcomp/mi
cvs rdiff -u -r1.9 -r1.10 src/etc/mtree/NetBSD.dist.Xorg
cvs rdiff -u -r1.30 -r1.31 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/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/xbase/mi
diff -u src/distrib/sets/lists/xbase/mi:1.106 src/distrib/sets/lists/xbase/mi:1.107
--- src/distrib/sets/lists/xbase/mi:1.106	Mon Feb 21 05:10:46 2011
+++ src/distrib/sets/lists/xbase/mi	Sun Mar  6 22:15:29 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.106 2011/02/21 05:10:46 mrg Exp $
+# $NetBSD: mi,v 1.107 2011/03/06 22:15:29 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -2880,6 +2880,7 @@
 ./usr/X11R7/man/man7/Xsecurity.7			-unknown-	.man,xorg
 ./usr/X11R7/man/whatis.db-unknown-	man,xorg
 ./usr/X11R7/share	base-x11-root	xorg
+./usr/X11R7/share/aclocalbase-x11-root	xorg
 ./usr/X11R7/share/examplesbase-x11-root	xorg
 ./usr/X11R7/share/examples/ssh-askpass			base-x11-root	xorg
 ./usr/X11R7/share/examples/ssh-askpass/SshAskpass-1337.ad	-unknown-	xorg

Index: src/distrib/sets/lists/xcomp/mi
diff -u src/distrib/sets/lists/xcomp/mi:1.124 src/distrib/sets/lists/xcomp/mi:1.125
--- src/distrib/sets/lists/xcomp/mi:1.124	Sat Feb 26 09:27:20 2011
+++ src/distrib/sets/lists/xcomp/mi	Sun Mar  6 22:15:30 2011
@@ -1,4 +1,4 @@
-#	 $NetBSD: mi,v 1.124 2011/02/26 09:27:20 mrg Exp $
+#	 $NetBSD: mi,v 1.125 2011/03/06 22:15:30 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -9225,6 +9225,7 @@
 ./usr/X11R7/man/man3/XvUngrabPort.3			-unknown-	.man,xorg
 ./usr/X11R7/man/man3/XvVideoNotify.3			-unknown-	.man,xorg
 ./usr/X11R7/man/man3/libXp.3-obsolete-	obsolete
+./usr/X11R7/share/aclocal/xorg-server.m4		-unknown-	xorg
 ./usr/X11R7/share/xcb/bigreq.xml			-unknown-	xorg
 ./usr/X11R7/share/xcb/composite.xml			-unknown-	xorg
 ./usr/X11R7/share/xcb/damage.xml			-unknown-	xorg

Index: src/etc/mtree/NetBSD.dist.Xorg
diff -u src/etc/mtree/NetBSD.dist.Xorg:1.9 src/etc/mtree/NetBSD.dist.Xorg:1.10
--- src/etc/mtree/NetBSD.dist.Xorg:1.9	Sun Jul 18 07:07:09 2010
+++ src/etc/mtree/NetBSD.dist.Xorg	Sun Mar  6 22:15:30 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.Xorg,v 1.9 2010/07/18 07:07:09 mrg Exp $
+#	$NetBSD: NetBSD.dist.Xorg,v 1.10 2011/03/06 22:15:30 mrg Exp $
 
 ./usr/X11R7
 ./usr/X11R7/bin
@@ -171,6 +171,7 @@
 ./usr/X11R7/man/man5
 ./usr/X11R7/man/man7
 ./usr/X11R7/share
+./usr/X11R7/share/aclocal
 ./usr/X11R7/share/examples
 ./usr/X11R7/share/examples/ssh-askpass
 ./usr/X11R7/share/pciids

Index: src/external/mit/xorg/server/xorg-server/hw/xfree86/Makefile
diff -u src/external/mit/xorg/server/xorg-server/hw/xfree86/Makefile:1.30 src/external/mit/xorg/server/xorg-server/hw/xfree86/Makefile:1.31
--- src/external/mit/xorg/server/xorg-server/hw/xfree86/Makefile:1.30	Tue Nov 23 08:22:30 2010
+++ src/external/mit/xorg/server/xorg-server/hw/xfree86/Makefile	Sun Mar  6 22:15:30 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2010/11/23 08:22:30 mrg Exp $
+#	$NetBSD: Makefile,v 1.31 2011/03/06 22:15:30 mrg Exp $
 
 SUBDIR=		common init ddc dixmods doc dri dri2 i2c loader \
 		xf86modes exa \
@@ -130,6 +130,12 @@
 #	cp ${.ALLSRC} ${.TARGET}
 MKMAN=	no
 
+FILES=		xorg-server.m4
+FILESDIR=	${X11ROOTDIR}/share/aclocal
+
+.PATH:		${X11SRCDIR.xorg-server}
+
 .include bsd.x11.mk
 .include bsd.prog.mk
 .include bsd.subdir.mk
+.include bsd.files.mk



CVS commit: src/usr.sbin/repquota

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 22:33:55 UTC 2011

Modified Files:
src/usr.sbin/repquota: Makefile repquota.c

Log Message:
- KNF
- merge code
- fix error printing
- don't use static buffers


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/repquota/Makefile
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/repquota/repquota.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/repquota/Makefile
diff -u src/usr.sbin/repquota/Makefile:1.6 src/usr.sbin/repquota/Makefile:1.7
--- src/usr.sbin/repquota/Makefile:1.6	Sun Mar  6 12:08:43 2011
+++ src/usr.sbin/repquota/Makefile	Sun Mar  6 17:33:55 2011
@@ -1,6 +1,7 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.6 2011/03/06 17:08:43 bouyer Exp $
+#	$NetBSD: Makefile,v 1.7 2011/03/06 22:33:55 christos Exp $
 
+WARNS ?= 4
 .include bsd.own.mk
 PROG=	repquota
 SRCS=	repquota.c 
@@ -11,7 +12,7 @@
 LDADD=	-lprop
 
 .PATH:	${NETBSDSRCDIR}/usr.bin/quota
-SRCS+=	printquota.c
+SRCS+=	printquota.c quotautil.c
 .PATH:	${NETBSDSRCDIR}/sys/ufs/ufs 
 SRCS+=	quota2_prop.c quota2_subr.c quota1_subr.c
 

Index: src/usr.sbin/repquota/repquota.c
diff -u src/usr.sbin/repquota/repquota.c:1.26 src/usr.sbin/repquota/repquota.c:1.27
--- src/usr.sbin/repquota/repquota.c:1.26	Sun Mar  6 12:08:43 2011
+++ src/usr.sbin/repquota/repquota.c	Sun Mar  6 17:33:55 2011
@@ -1,3 +1,5 @@
+/*	$NetBSD: repquota.c,v 1.27 2011/03/06 22:33:55 christos Exp $	*/
+
 /*
  * Copyright (c) 1980, 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -40,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)repquota.c	8.2 (Berkeley) 11/22/94;
 #else
-__RCSID($NetBSD: repquota.c,v 1.26 2011/03/06 17:08:43 bouyer Exp $);
+__RCSID($NetBSD: repquota.c,v 1.27 2011/03/06 22:33:55 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -67,49 +69,42 @@
 #include ufs/ufs/quota2_prop.h
 #include ufs/ufs/quota1.h
 
-#include printquota.h
-
-const char *qfextension[] = INITQFNAMES;
-const char *qfname = QUOTAFILENAME;
+#include printquota.h
+#include quotautil.h
 
 struct fileusage {
 	struct	fileusage *fu_next;
 	struct	quota2_entry fu_q2e;
-	u_long	fu_id;
+	uint32_t	fu_id;
 	char	fu_name[1];
 	/* actually bigger */
 };
 #define FUHASH 1024	/* must be power of two */
-struct fileusage *fuhead[MAXQUOTAS][FUHASH];
-u_long highid[MAXQUOTAS];	/* highest addid()'ed identifier per type */
+static struct fileusage *fuhead[MAXQUOTAS][FUHASH];
+static uint32_t highid[MAXQUOTAS];	/* highest addid()'ed identifier per type */
 int valid[MAXQUOTAS];
-struct quota2_entry defaultq2e[MAXQUOTAS];
+static struct quota2_entry defaultq2e[MAXQUOTAS];
 
-int	vflag = 0;		/* verbose */
-int	aflag = 0;		/* all file systems */
-int	Dflag = 0;		/* debug */
-int	hflag = 0;		/* humanize */
-int	xflag = 0;		/* export */
-
-
-struct fileusage *addid(u_long, int, const char *);
-int	hasquota(struct fstab *, int, char **);
-struct fileusage *lookup(u_long, int);
-struct fileusage *qremove(u_long, int);
-int	main(int, char **);
-int	oneof(const char *, char **, int);
-int	repquota(const struct statvfs *, int);
-int	repquota2(const struct statvfs *, int);
-int	repquota1(const struct statvfs *, int);
-void	usage(void);
-void	printquotas(int, const struct statvfs *, int);
-void	exportquotas(void);
-void	dqblk2q2e(const struct dqblk *, struct quota2_entry *);
+static int	vflag = 0;		/* verbose */
+static int	aflag = 0;		/* all file systems */
+static int	Dflag = 0;		/* debug */
+static int	hflag = 0;		/* humanize */
+static int	xflag = 0;		/* export */
+
+
+static struct fileusage *addid(uint32_t, int, const char *);
+static struct fileusage *lookup(uint32_t, int);
+static struct fileusage *qremove(uint32_t, int);
+static int	oneof(const char *, char **, int);
+static int	repquota(const struct statvfs *, int);
+static int	repquota2(const struct statvfs *, int);
+static int	repquota1(const struct statvfs *, int);
+static void	usage(void) __attribute__((__noreturn__));
+static void	printquotas(int, const struct statvfs *, int);
+static void	exportquotas(void);
 
 int
-main(argc, argv)
-	int argc;
-	char **argv;
+main(int argc, char **argv)
 {
 	int gflag = 0, uflag = 0, errs = 0;
 	long i, argnum, done = 0;
@@ -158,7 +153,7 @@
 
 	nfst = getmntinfo(fst, MNT_WAIT);
 	if (nfst == 0)
-		errx(2, no filesystems mounted!);
+		errx(1, no filesystems mounted!);
 	for (i = 0; i  nfst; i++) {
 		if ((fst[i].f_flag  ST_QUOTA) == 0)
 			continue;
@@ -171,7 +166,7 @@
 		}
 		if ((argnum = oneof(fst[i].f_mntonname, argv, argc)) = 0 ||
 		(argnum = oneof(fst[i].f_mntfromname, argv, argc)) = 0) {
-			done |= 1  argnum;
+			done |= 1U  argnum;
 			if (gflag)
 errs += repquota(fst[i], GRPQUOTA);
 			if (uflag)
@@ -181,36 +176,35 @@
 	if (xflag)
 		exportquotas();
 	for (i = 0; i  argc; i++)
-		if ((done  (1  i)) == 0)
-			fprintf(stderr, %s not mounted\n, argv[i]);
-	

CVS commit: src/usr.sbin/edquota

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 22:34:58 UTC 2011

Modified Files:
src/usr.sbin/edquota: Makefile edquota.c

Log Message:
- KNF
- merge code
- fix error printing
- don't use static buffers


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/edquota/Makefile
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/edquota/edquota.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/edquota/Makefile
diff -u src/usr.sbin/edquota/Makefile:1.6 src/usr.sbin/edquota/Makefile:1.7
--- src/usr.sbin/edquota/Makefile:1.6	Sun Mar  6 12:08:42 2011
+++ src/usr.sbin/edquota/Makefile	Sun Mar  6 17:34:57 2011
@@ -1,7 +1,9 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.6 2011/03/06 17:08:42 bouyer Exp $
+#	$NetBSD: Makefile,v 1.7 2011/03/06 22:34:57 christos Exp $
 
 .include bsd.own.mk
+
+WARNS ?= 4
 PROG=	edquota
 SRCS=	edquota.c
 MAN=	edquota.8
@@ -11,7 +13,7 @@
 LDADD=	-lprop
 
 .PATH:	${NETBSDSRCDIR}/usr.bin/quota
-SRCS+=	getvfsquota.c printquota.c
+SRCS+=	getvfsquota.c printquota.c quotautil.c
 .PATH:	${NETBSDSRCDIR}/sys/ufs/ufs 
 SRCS+=	quota2_prop.c quota1_subr.c
 

Index: src/usr.sbin/edquota/edquota.c
diff -u src/usr.sbin/edquota/edquota.c:1.30 src/usr.sbin/edquota/edquota.c:1.31
--- src/usr.sbin/edquota/edquota.c:1.30	Sun Mar  6 12:08:42 2011
+++ src/usr.sbin/edquota/edquota.c	Sun Mar  6 17:34:57 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: edquota.c,v 1.30 2011/03/06 17:08:42 bouyer Exp $ */
+/*  $NetBSD: edquota.c,v 1.31 2011/03/06 22:34:57 christos Exp $ */
 /*
  * Copyright (c) 1980, 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = from: @(#)edquota.c	8.3 (Berkeley) 4/27/95;
 #else
-__RCSID($NetBSD: edquota.c,v 1.30 2011/03/06 17:08:42 bouyer Exp $);
+__RCSID($NetBSD: edquota.c,v 1.31 2011/03/06 22:34:57 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -73,14 +73,14 @@
 #include string.h
 #include unistd.h
 
-#include printquota.h
-#include getvfsquota.h
+#include printquota.h
+#include getvfsquota.h
+#include quotautil.h
 
 #include pathnames.h
 
-const char *qfname = QUOTAFILENAME;
-const char *quotagroup = QUOTAGROUP;
-char tmpfil[] = _PATH_TMP;
+static const char *quotagroup = QUOTAGROUP;
+static char tmpfil[] = _PATH_TMP;
 
 struct quotause {
 	struct	quotause *next;
@@ -95,34 +95,27 @@
 
 #define MAX_TMPSTR	(100+MAXPATHLEN)
 
-int	main(int, char **);
-void	usage(void);
-int	getentry(const char *, int);
-struct quotause * getprivs(long, int, const char *, int);
-struct quotause * getprivs2(long, int, const char *, int);
-struct quotause * getprivs1(long, int, const char *);
-void	putprivs(long, int, struct quotause *);
-void	putprivs2(long, int, struct quotause *);
-void	putprivs1(long, int, struct quotause *);
-int	editit(char *);
-int	writeprivs(struct quotause *, int, char *, int);
-int	readprivs(struct quotause *, int);
-int	writetimes(struct quotause *, int, int);
-int	readtimes(struct quotause *, int);
-void	freeq(struct quotause *);
-void	freeprivs(struct quotause *);
-int	alldigits(const char *);
-int	hasquota(struct fstab *, int, char **);
+static void	usage(void) __attribute__((__noreturn__));
+static int	getentry(const char *, int);
+static struct quotause * getprivs(long, int, const char *, int);
+static struct quotause * getprivs2(long, int, const char *, int);
+static struct quotause * getprivs1(long, int, const char *);
+static void	putprivs(uint32_t, int, struct quotause *);
+static void	putprivs2(uint32_t, int, struct quotause *);
+static void	putprivs1(uint32_t, int, struct quotause *);
+static int	editit(const char *);
+static int	writeprivs(struct quotause *, int, const char *, int);
+static int	readprivs(struct quotause *, int);
+static void	freeq(struct quotause *);
+static void	freeprivs(struct quotause *);
 static void clearpriv(int, char **, const char *, int);
 
-int Hflag = 0;
-int Dflag = 0;
-int dflag = 0;
+static int Hflag = 0;
+static int Dflag = 0;
+static int dflag = 0;
 
 int
-main(argc, argv)
-	int argc;
-	char **argv;
+main(int argc, char *argv[])
 {
 	struct quotause *qup, *protoprivs, *curprivs;
 	long id, protoid;
@@ -187,7 +180,7 @@
 		if (soft || hard || grace || dflag || cflag)
 			usage();
 		if ((protoid = getentry(protoname, quotatype)) == -1)
-			exit(1);
+			return 1;
 		protoprivs = getprivs(protoid, quotatype, fs, 0);
 		for (qup = protoprivs; qup; qup = qup-next) {
 			qup-q2e.q2e_val[QL_BLOCK].q2v_time = 0;
@@ -198,7 +191,7 @@
 continue;
 			putprivs(id, quotatype, protoprivs);
 		}
-		exit(0);
+		return 0;
 	}
 	if (soft || hard || grace) {
 		struct quotause *lqup;
@@ -241,61 +234,65 @@
 		if (dflag) {
 			curprivs = getprivs(0, quotatype, fs, 1);
 			for (lqup = curprivs; lqup; lqup = lqup-next) {
+struct quota2_val *q = lqup-q2e.q2e_val;
 if (soft) {
-	

CVS commit: src/usr.bin/quota

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 22:36:07 UTC 2011

Modified Files:
src/usr.bin/quota: Makefile getvfsquota.c printquota.c printquota.h
quota.c
Added Files:
src/usr.bin/quota: quotautil.c quotautil.h

Log Message:
- merge more code.
- simplify struct access.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/quota/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/quota/getvfsquota.c \
src/usr.bin/quota/printquota.c src/usr.bin/quota/printquota.h
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/quota/quota.c
cvs rdiff -u -r0 -r1.1 src/usr.bin/quota/quotautil.c \
src/usr.bin/quota/quotautil.h

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/quota/Makefile
diff -u src/usr.bin/quota/Makefile:1.8 src/usr.bin/quota/Makefile:1.9
--- src/usr.bin/quota/Makefile:1.8	Sun Mar  6 15:47:59 2011
+++ src/usr.bin/quota/Makefile	Sun Mar  6 17:36:07 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.8 2011/03/06 20:47:59 christos Exp $	
+#	$NetBSD: Makefile,v 1.9 2011/03/06 22:36:07 christos Exp $	
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 
 WARNS ?= 4
 .include bsd.own.mk
 PROG=	quota
-SRCS=	quota.c printquota.c getvfsquota.c
+SRCS=	quota.c printquota.c getvfsquota.c quotautil.c
 
 CPPFLAGS+=-I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/usr.bin/quota
 DPADD=	${LIBRPCSVC} ${LIBPROP}

Index: src/usr.bin/quota/getvfsquota.c
diff -u src/usr.bin/quota/getvfsquota.c:1.3 src/usr.bin/quota/getvfsquota.c:1.4
--- src/usr.bin/quota/getvfsquota.c:1.3	Sun Mar  6 15:47:59 2011
+++ src/usr.bin/quota/getvfsquota.c	Sun Mar  6 17:36:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getvfsquota.c,v 1.3 2011/03/06 20:47:59 christos Exp $ */
+/*	$NetBSD: getvfsquota.c,v 1.4 2011/03/06 22:36:07 christos Exp $ */
 
 /*-
   * Copyright (c) 2011 Manuel Bouyer
@@ -29,7 +29,7 @@
   */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: getvfsquota.c,v 1.3 2011/03/06 20:47:59 christos Exp $);
+__RCSID($NetBSD: getvfsquota.c,v 1.4 2011/03/06 22:36:07 christos Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -42,9 +42,8 @@
 #include ufs/ufs/quota2_prop.h
 #include sys/quota.h
 
-#include getvfsquota.h
-
-const char *qfextension[] = INITQFNAMES;
+#include getvfsquota.h
+#include quotautil.h
 
 /* retrieve quotas from vfs, for the given user id */
 int
Index: src/usr.bin/quota/printquota.c
diff -u src/usr.bin/quota/printquota.c:1.3 src/usr.bin/quota/printquota.c:1.4
--- src/usr.bin/quota/printquota.c:1.3	Sun Mar  6 15:47:59 2011
+++ src/usr.bin/quota/printquota.c	Sun Mar  6 17:36:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: printquota.c,v 1.3 2011/03/06 20:47:59 christos Exp $ */
+/*	$NetBSD: printquota.c,v 1.4 2011/03/06 22:36:07 christos Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)quota.c	8.4 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: printquota.c,v 1.3 2011/03/06 20:47:59 christos Exp $);
+__RCSID($NetBSD: printquota.c,v 1.4 2011/03/06 22:36:07 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -59,7 +59,7 @@
 #include limits.h
 #include inttypes.h
 
-#include printquota.h
+#include printquota.h
 
 /*
  * convert 64bit value to a printable string
@@ -138,13 +138,12 @@
 	return buf;
 }
 
-#if 0
 /*
  * Calculate the grace period and return a precise string for it,
  * either in seconds or in format xWyDzHtMuS
  */
 const char *
-timepprt(char *buf, size_t len, time_t seconds, int hflag, int space)
+timepprt(char *buf, size_t len, time_t seconds, int hflag)
 {
 	ssize_t i = 0;
 
@@ -158,7 +157,7 @@
 		seconds = seconds % WEEK;
 	}
 
-	if (remain  3 || seconds == 0)
+	if (len - i  3 || seconds == 0)
 		return buf;
 
 	if ((seconds / DAY)  0) {
@@ -166,7 +165,7 @@
 		seconds = seconds % DAY;
 	}
 
-	if (remain  4 || seconds == 0)
+	if (len - i  4 || seconds == 0)
 		return buf;
 
 	if ((seconds / HOUR)  0) {
@@ -174,7 +173,7 @@
 		seconds = seconds % HOUR;
 	}
 
-	if (remain  4 || seconds == 0)
+	if (len - i  4 || seconds == 0)
 		return buf;
 
 	if ((seconds / MINUTE)  0) {
@@ -183,7 +182,7 @@
 		seconds = seconds % MINUTE;
 	}
 
-	if (remain  4 || seconds == 0)
+	if (len - i  4 || seconds == 0)
 		return buf;
 
 	(void)snprintf(buf + i, len - i, % PRId64 S, seconds);
@@ -272,4 +271,3 @@
 		*val = btodb(*val);
 	return ret;
 }
-#endif
Index: src/usr.bin/quota/printquota.h
diff -u src/usr.bin/quota/printquota.h:1.3 src/usr.bin/quota/printquota.h:1.4
--- src/usr.bin/quota/printquota.h:1.3	Sun Mar  6 15:47:59 2011
+++ src/usr.bin/quota/printquota.h	Sun Mar  6 17:36:07 2011
@@ -1,10 +1,7 @@
-/*	$NetBSD: printquota.h,v 1.3 2011/03/06 20:47:59 christos Exp $ */
+/*	$NetBSD: printquota.h,v 1.4 2011/03/06 22:36:07 christos Exp $ */
 
 const char *intprt(char *, size_t, uint64_t, int, int);
 const char *timeprt(char *, size_t, time_t, time_t);
-#if 0
-const char *timepprt(time_t, int, int);
+const char *timepprt(char *, size_t, time_t, int);
 int 

CVS commit: src/usr.sbin/quotacheck

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 23:07:23 UTC 2011

Modified Files:
src/usr.sbin/quotacheck: Makefile quotacheck.c

Log Message:
use merged out code.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/quotacheck/Makefile
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/quotacheck/quotacheck.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/quotacheck/Makefile
diff -u src/usr.sbin/quotacheck/Makefile:1.18 src/usr.sbin/quotacheck/Makefile:1.19
--- src/usr.sbin/quotacheck/Makefile:1.18	Wed Apr 22 11:23:07 2009
+++ src/usr.sbin/quotacheck/Makefile	Sun Mar  6 18:07:23 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2009/04/22 15:23:07 lukem Exp $
+#	$NetBSD: Makefile,v 1.19 2011/03/06 23:07:23 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
 
 .include bsd.own.mk
@@ -8,7 +8,9 @@
 MAN=	quotacheck.8
 DPADD=	${LIBUTIL}
 LDADD+=	-lutil
-CPPFLAGS+=-I${NETBSDSRCDIR}/sbin/fsck
-.PATH:	${NETBSDSRCDIR}/sbin/fsck ${NETBSDSRCDIR}/sys/ufs/ffs
+CPPFLAGS+=-I${NETBSDSRCDIR}/sbin/fsck -I${NETBSDSRCDIR}/usr.bin/quota
+.PATH:	${NETBSDSRCDIR}/sbin/fsck ${NETBSDSRCDIR}/sys/ufs/ffs ${NETBSDSRCDIR}/usr.bin/quota
+SRCS+=  quotautil.c
+
 
 .include bsd.prog.mk

Index: src/usr.sbin/quotacheck/quotacheck.c
diff -u src/usr.sbin/quotacheck/quotacheck.c:1.41 src/usr.sbin/quotacheck/quotacheck.c:1.42
--- src/usr.sbin/quotacheck/quotacheck.c:1.41	Sun Mar  6 12:08:43 2011
+++ src/usr.sbin/quotacheck/quotacheck.c	Sun Mar  6 18:07:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: quotacheck.c,v 1.41 2011/03/06 17:08:43 bouyer Exp $	*/
+/*	$NetBSD: quotacheck.c,v 1.42 2011/03/06 23:07:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)quotacheck.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: quotacheck.c,v 1.41 2011/03/06 17:08:43 bouyer Exp $);
+__RCSID($NetBSD: quotacheck.c,v 1.42 2011/03/06 23:07:23 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -72,6 +72,7 @@
 #include string.h
 
 #include fsutil.h
+#include quotautil.h
 
 #ifndef FS_UFS1_MAGIC
 # define FS_UFS1_MAGIC		FS_MAGIC /* 0x011954 */
@@ -89,8 +90,6 @@
 # define SBLOCKSEARCH	{ SBSIZE, -1 }
 #endif
 
-static const char *qfname = QUOTAFILENAME;
-static const char *qfextension[] = INITQFNAMES;
 static const char *quotagroup = QUOTAGROUP;
 
 static union {
@@ -113,7 +112,7 @@
 	struct	fileusage *fu_next;
 	u_long	fu_curinodes;
 	u_long	fu_curblocks;
-	u_int32_t fu_id;		/* uid_t, gid_t */
+	uint32_t fu_id;		/* uid_t, gid_t */
 	char	fu_name[1];
 	/* actually bigger */
 };
@@ -143,39 +142,34 @@
 static int	vflag;		/* verbose */
 static int	qflag;		/* quick but untidy mode */
 static int	fi;		/* open disk file descriptor */
-static u_int32_t highid[MAXQUOTAS];/* highest addid()'ed identifier per type */
+static uint32_t highid[MAXQUOTAS];/* highest addid()'ed identifier per type */
 static int needswap;	/* FS is in swapped order */
 static int got_siginfo = 0; /* got a siginfo signal */
 static int is_ufs2;
 
 
-int main __P((int, char *[]));
-static void usage __P((void));
-static void *needchk __P((struct fstab *));
-static int chkquota __P((const char *, const char *, const char *, void *,
-pid_t *));
-static int update __P((const char *, const char *, int));
-static u_int32_t skipforward __P((u_int32_t, u_int32_t, FILE *));
-static int oneof __P((const char *, char *[], int));
-static int getquotagid __P((void));
-static int hasquota __P((struct fstab *, int, char **));
-static struct fileusage *lookup __P((u_int32_t, int));
-static struct fileusage *addid __P((u_int32_t, int, const char *));
-static u_int32_t subsequent __P((u_int32_t, int)); 
-static union comb_dinode *getnextinode __P((ino_t));
-static void setinodebuf __P((ino_t));
-static void freeinodebuf __P((void));
-static void bread __P((daddr_t, char *, long));
-static void infohandler __P((int sig));
+static void usage(void) __attribute__((__noreturn__));
+static void *needchk(struct fstab *);
+static int chkquota(const char *, const char *, const char *, void *, pid_t *);
+static int update(const char *, const char *, int);
+static uint32_t skipforward(uint32_t, uint32_t, FILE *);
+static int oneof(const char *, char *[], int);
+static int getquotagid(void);
+static struct fileusage *lookup(uint32_t, int);
+static struct fileusage *addid(uint32_t, int, const char *);
+static uint32_t subsequent(uint32_t, int) ;
+static union comb_dinode *getnextinode(ino_t);
+static void setinodebuf(ino_t);
+static void freeinodebuf(void);
+static void bread(daddr_t, char *, long);
+static void infohandler(int sig);
 static void swap_dinode1(union comb_dinode *, int);
 #ifdef HAVE_UFSv2
 static void swap_dinode2(union comb_dinode *, int);
 #endif
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	struct fstab *fs;
 	struct passwd *pw;
@@ -241,13 +235,13 @@
 	if (gflag) {

CVS commit: src/usr.sbin/quotacheck

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 23:13:22 UTC 2011

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

Log Message:
more KNF


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/quotacheck/quotacheck.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/quotacheck/quotacheck.c
diff -u src/usr.sbin/quotacheck/quotacheck.c:1.42 src/usr.sbin/quotacheck/quotacheck.c:1.43
--- src/usr.sbin/quotacheck/quotacheck.c:1.42	Sun Mar  6 18:07:23 2011
+++ src/usr.sbin/quotacheck/quotacheck.c	Sun Mar  6 18:13:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: quotacheck.c,v 1.42 2011/03/06 23:07:23 christos Exp $	*/
+/*	$NetBSD: quotacheck.c,v 1.43 2011/03/06 23:13:22 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)quotacheck.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: quotacheck.c,v 1.42 2011/03/06 23:07:23 christos Exp $);
+__RCSID($NetBSD: quotacheck.c,v 1.43 2011/03/06 23:13:22 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -225,11 +225,11 @@
 		i = 0;
 		while ((fs = getfsent()) != NULL) {
 			if (needchk(fs))
-i=1;
+i = 1;
 		}
 		endfsent();
 		if (!i)	/* No filesystems with quotas */
-			exit(0);
+			return 0;
 	}
 
 	if (gflag) {
@@ -261,24 +261,21 @@
 	endfsent();
 	for (i = 0; i  argc; i++)
 		if ((done  (1  i)) == 0)
-			fprintf(stderr, %s not found in %s\n,
-argv[i], FSTAB);
-	exit(errs);
+			warnx(%s not found in %s\n, argv[i], FSTAB);
+	return errs;
 }
 
 static void
-usage()
+usage(void)
 {
-
-	(void)fprintf(stderr,
-	usage:\t%s -a [-gquv] [-l maxparallel]\n\t%s [-gquv] filesys ...\n, getprogname(),
-	getprogname());
+	const char *p = getprogname();
+	(void)fprintf(stderr, Usage: %s -a [-gquv] [-l maxparallel]\n
+	\t%s [-gquv] filesys ...\n, p, p);
 	exit(1);
 }
 
 static void *
-needchk(fs)
-	struct fstab *fs;
+needchk(struct fstab *fs)
 {
 	struct quotaname *qnp;
 	char qfnp[MAXPATHLEN];
@@ -303,16 +300,14 @@
 	return (NULL);
 }
 
-off_t sblock_try[] = SBLOCKSEARCH;
+static off_t sblock_try[] = SBLOCKSEARCH;
 
 /*
  * Scan the specified filesystem to check quota(s) present on it.
  */
 static int
-chkquota(type, fsname, mntpt, v, pid)
-	const char *type, *fsname, *mntpt;
-	void *v;
-	pid_t *pid;
+chkquota(const char *type, const char *fsname, const char *mntpt, void *v,
+pid_t *pid)
 {
 	struct quotaname *qnp = v;
 	struct fileusage *fup;
@@ -468,9 +463,7 @@
  * Update a specified quota file.
  */
 static int
-update(fsname, quotafile, type)
-	const char *fsname, *quotafile;
-	int type;
+update(const char *fsname, const char *quotafile, int type)
 {
 	struct fileusage *fup;
 	FILE *qfi, *qfo;
@@ -526,13 +519,17 @@
 			fup = zerofileusage;
 
 		nextid = subsequent(id, type);
-		if (nextid  0  nextid != id + 1) /* watch out for id == UINT32_MAX */
+		/* watch out for id == UINT32_MAX */
+		if (nextid  0  nextid != id + 1)
 			nextid = skipforward(id, nextid, qfi);
 
 		if (got_siginfo) {
-			/* XXX this could try to show percentage through the ID list */
-			fprintf(stderr,
-			%s: updating %s quotas for id=% PRIu32  (%s)\n, fsname,
+			/*
+			 * XXX this could try to show percentage through
+			 * the ID list
+			 */
+			fprintf(stderr, %s: updating %s quotas for id=%
+			PRIu32  (%s)\n, fsname,
 			qfextension[type  MAXQUOTAS ? type : MAXQUOTAS],
 			id, fup-fu_name);
 			got_siginfo = 0;
@@ -543,7 +540,8 @@
 			fup-fu_curblocks = 0;	/* for next filesystem */
 
 			need_seek = 1;
-			if (id == UINT32_MAX || nextid == 0) {	/* infinite loop avoidance (OR do as nextid  id?) */
+			/* infinite loop avoidance (OR do as nextid  id?) */
+			if (id == UINT32_MAX || nextid == 0) {
 break;
 			}
 			continue;
@@ -580,33 +578,32 @@
 			SEEK_SET);
 			need_seek = nextid != id + 1;
 		}
-		(void) fwrite((char *)dqbuf, sizeof(struct dqblk), 1, qfo);
+		(void) fwrite(dqbuf, sizeof(struct dqblk), 1, qfo);
 
 		fup-fu_curinodes = 0;
 		fup-fu_curblocks = 0;
-		if (id == UINT32_MAX || nextid == 0) {	/* infinite loop avoidance (OR do as nextid  id?) */
+		/* infinite loop avoidance (OR do as nextid  id?) */
+		if (id == UINT32_MAX || nextid == 0) {
 			break;
 		}
 	}
-	(void) fclose(qfi);
-	(void) fflush(qfo);
+	(void)fclose(qfi);
+	(void)fflush(qfo);
 	if (highid[type] != UINT32_MAX)
-		(void) ftruncate(fileno(qfo),
+		(void)ftruncate(fileno(qfo),
 		(off_t)((highid[type] + 1) * sizeof(struct dqblk)));
-	(void) fclose(qfo);
-	return (0);
+	(void)fclose(qfo);
+	return 0;
 }
 
-uint32_t
-skipforward(cur, to, qfi)
-	uint32_t cur, to;
-	FILE *qfi;
+static uint32_t
+skipforward(uint32_t cur, uint32_t to, FILE *qfi)
 {
 	struct dqblk dqbuf;
 
 	if (qflag) {
-		(void) fseeko(qfi, (off_t)to * sizeof(struct dqblk), SEEK_SET);
-		return (to);
+		(void)fseeko(qfi, (off_t)to * sizeof(struct dqblk), SEEK_SET);
+		return to;
 	}
 
 	while (++cur  

CVS commit: src/usr.sbin/quotaon

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 23:24:33 UTC 2011

Modified Files:
src/usr.sbin/quotaon: Makefile quotaon.c

Log Message:
use common utils


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/quotaon/Makefile
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/quotaon/quotaon.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/quotaon/Makefile
diff -u src/usr.sbin/quotaon/Makefile:1.6 src/usr.sbin/quotaon/Makefile:1.7
--- src/usr.sbin/quotaon/Makefile:1.6	Sun Mar  6 12:08:43 2011
+++ src/usr.sbin/quotaon/Makefile	Sun Mar  6 18:24:33 2011
@@ -1,13 +1,19 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.6 2011/03/06 17:08:43 bouyer Exp $
+#	$NetBSD: Makefile,v 1.7 2011/03/06 23:24:33 christos Exp $
 
 .include bsd.own.mk
+WARNS	?= 4
+
 PROG=	quotaon
 SRCS=	quotaon.c
 MAN=	quotaon.8
 MLINKS=	quotaon.8 quotaoff.8
 LINKS=	${BINDIR}/quotaon ${BINDIR}/quotaoff
 
+.PATH:  ${NETBSDSRCDIR}/usr.bin/quota
+SRCS+=  quotautil.c
+CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/quota
+
 CPPFLAGS+=-I${NETBSDSRCDIR}/sys
 DPADD=	${LIBPROP}
 LDADD=	-lprop

Index: src/usr.sbin/quotaon/quotaon.c
diff -u src/usr.sbin/quotaon/quotaon.c:1.24 src/usr.sbin/quotaon/quotaon.c:1.25
--- src/usr.sbin/quotaon/quotaon.c:1.24	Sun Mar  6 12:08:43 2011
+++ src/usr.sbin/quotaon/quotaon.c	Sun Mar  6 18:24:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: quotaon.c,v 1.24 2011/03/06 17:08:43 bouyer Exp $	*/
+/*	$NetBSD: quotaon.c,v 1.25 2011/03/06 23:24:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)quotaon.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: quotaon.c,v 1.24 2011/03/06 17:08:43 bouyer Exp $);
+__RCSID($NetBSD: quotaon.c,v 1.25 2011/03/06 23:24:33 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -61,33 +61,27 @@
 #include err.h
 #include fstab.h
 #include stdio.h
+#include errno.h
 #include stdlib.h
 #include string.h
 #include unistd.h
 
-const char *qfname = QUOTAFILENAME;
-const char *qfextension[] = INITQFNAMES;
+#include quotautil.h
 
-int	aflag;		/* all file systems */
-int	gflag;		/* operate on group quotas */
-int	uflag;		/* operate on user quotas */
-int	vflag;		/* verbose */
-
-int main __P((int, char *[]));
-
-static void usage __P((void));
-static int quotaonoff __P((struct fstab *, int, int, char *));
-static int oneof __P((const char *, char *[], int));
-static int hasquota __P((struct fstab *, int, char **));
-static int readonly __P((struct fstab *));
+static int	aflag;		/* all file systems */
+static int	gflag;		/* operate on group quotas */
+static int	uflag;		/* operate on user quotas */
+static int	vflag;		/* verbose */
+
+static void usage(void) __attribute__((__noreturn__));
+static int quotaonoff(struct fstab *, int, int, const char *);
+static int readonly(struct fstab *);
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	struct fstab *fs;
-	char *qfnp;
+	char qfnp[MAXPATHLEN];
 	long argnum, done = 0;
 	int i, offmode = 0, errs = 0;
 	int ch;
@@ -133,50 +127,44 @@
 		strcmp(fs-fs_type, FSTAB_RW))
 			continue;
 		if (aflag) {
-			if (gflag  hasquota(fs, GRPQUOTA, qfnp))
+			if (gflag  hasquota(qfnp, sizeof(qfnp), fs, GRPQUOTA))
 errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
-			if (uflag  hasquota(fs, USRQUOTA, qfnp))
+			if (uflag  hasquota(qfnp, sizeof(qfnp), fs, USRQUOTA))
 errs += quotaonoff(fs, offmode, USRQUOTA, qfnp);
 			continue;
 		}
 		if ((argnum = oneof(fs-fs_file, argv, argc)) = 0 ||
 		(argnum = oneof(fs-fs_spec, argv, argc)) = 0) {
-			done |= 1  argnum;
-			if (gflag  hasquota(fs, GRPQUOTA, qfnp))
+			done |= 1U  argnum;
+			if (gflag  hasquota(qfnp, sizeof(qfnp), fs, GRPQUOTA))
 errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
-			if (uflag  hasquota(fs, USRQUOTA, qfnp))
+			if (uflag  hasquota(qfnp, sizeof(qfnp), fs, USRQUOTA))
 errs += quotaonoff(fs, offmode, USRQUOTA, qfnp);
 		}
 	}
 	endfsent();
 	for (i = 0; i  argc; i++)
-		if ((done  (1  i)) == 0)
+		if ((done  (1U  i)) == 0)
 			warnx(%s not found in fstab, argv[i]);
-	exit(errs);
+	return errs;
 }
 
 static void
-usage()
+usage(void)
 {
-
-	(void) fprintf(stderr, usage:\n\t%s [-g] [-u] [-v] -a\n,
-	getprogname());
-	(void) fprintf(stderr, \t%s [-g] [-u] [-v] filesys ...\n,
-	getprogname());
+	const char *p = getprogname();
+	(void) fprintf(stderr, Usage: %s [-g] [-u] [-v] -a\n
+	\t%s [-g] [-u] [-v] filesys ...\n, p, p);
 	exit(1);
 }
 
 static int
-quotaonoff(fs, offmode, type, qfpathname)
-	struct fstab *fs;
-	int offmode, type;
-	char *qfpathname;
+quotaonoff( struct fstab *fs, int offmode, int type, const char *qfpathname)
 {
 	const char *mode = (offmode == 1) ? off : on;
 	prop_dictionary_t dict, data, cmd;
 	prop_array_t cmds, datas;
 	struct plistref pref;
-	int error;
 	int8_t error8;
 
 	dict = quota2_prop_create();
@@ 

CVS commit: src/usr.sbin

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 23:25:43 UTC 2011

Modified Files:
src/usr.sbin/quotacheck: quotacheck.c
src/usr.sbin/repquota: repquota.c

Log Message:
more code deduplication


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/quotacheck/quotacheck.c
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/repquota/repquota.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/quotacheck/quotacheck.c
diff -u src/usr.sbin/quotacheck/quotacheck.c:1.43 src/usr.sbin/quotacheck/quotacheck.c:1.44
--- src/usr.sbin/quotacheck/quotacheck.c:1.43	Sun Mar  6 18:13:22 2011
+++ src/usr.sbin/quotacheck/quotacheck.c	Sun Mar  6 18:25:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: quotacheck.c,v 1.43 2011/03/06 23:13:22 christos Exp $	*/
+/*	$NetBSD: quotacheck.c,v 1.44 2011/03/06 23:25:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)quotacheck.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: quotacheck.c,v 1.43 2011/03/06 23:13:22 christos Exp $);
+__RCSID($NetBSD: quotacheck.c,v 1.44 2011/03/06 23:25:42 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -153,7 +153,6 @@
 static int chkquota(const char *, const char *, const char *, void *, pid_t *);
 static int update(const char *, const char *, int);
 static uint32_t skipforward(uint32_t, uint32_t, FILE *);
-static int oneof(const char *, char *[], int);
 static int getquotagid(void);
 static struct fileusage *lookup(uint32_t, int);
 static struct fileusage *addid(uint32_t, int, const char *);
@@ -627,20 +626,6 @@
 }
 
 /*
- * Check to see if target appears in list of size cnt.
- */
-static int
-oneof(const char *target, char *list[], int cnt)
-{
-	int i;
-
-	for (i = 0; i  cnt; i++)
-		if (strcmp(target, list[i]) == 0)
-			return (i);
-	return (-1);
-}
-
-/*
  * Determine the group identifier for quota files.
  */
 static int

Index: src/usr.sbin/repquota/repquota.c
diff -u src/usr.sbin/repquota/repquota.c:1.27 src/usr.sbin/repquota/repquota.c:1.28
--- src/usr.sbin/repquota/repquota.c:1.27	Sun Mar  6 17:33:55 2011
+++ src/usr.sbin/repquota/repquota.c	Sun Mar  6 18:25:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: repquota.c,v 1.27 2011/03/06 22:33:55 christos Exp $	*/
+/*	$NetBSD: repquota.c,v 1.28 2011/03/06 23:25:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)repquota.c	8.2 (Berkeley) 11/22/94;
 #else
-__RCSID($NetBSD: repquota.c,v 1.27 2011/03/06 22:33:55 christos Exp $);
+__RCSID($NetBSD: repquota.c,v 1.28 2011/03/06 23:25:42 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -95,7 +95,6 @@
 static struct fileusage *addid(uint32_t, int, const char *);
 static struct fileusage *lookup(uint32_t, int);
 static struct fileusage *qremove(uint32_t, int);
-static int	oneof(const char *, char **, int);
 static int	repquota(const struct statvfs *, int);
 static int	repquota2(const struct statvfs *, int);
 static int	repquota1(const struct statvfs *, int);
@@ -525,20 +524,6 @@
 }
 
 /*
- * Check to see if target appears in list of size cnt.
- */
-static int
-oneof(const char *target, char *list[], int cnt)
-{
-	int i;
-
-	for (i = 0; i  cnt; i++)
-		if (strcmp(target, list[i]) == 0)
-			return i;
-	return -1;
-}
-
-/*
  * Routines to manage the file usage table.
  *
  * Lookup an id of a specific type.
@@ -619,7 +604,7 @@
 	if (name) {
 		memmove(fup-fu_name, name, len + 1);
 	} else {
-		snprintf(fup-fu_name, sizeof(fup-fu_name), %u, id);
+		snprintf(fup-fu_name, len + 1, %u, id);
 	}
 	fup-fu_q2e = defaultq2e[type];
 	return fup;



CVS commit: src/usr.bin/quota

2011-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  6 23:26:17 UTC 2011

Modified Files:
src/usr.bin/quota: quotautil.c quotautil.h

Log Message:
merge one more triplicated function


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/quota/quotautil.c \
src/usr.bin/quota/quotautil.h

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/quota/quotautil.c
diff -u src/usr.bin/quota/quotautil.c:1.1 src/usr.bin/quota/quotautil.c:1.2
--- src/usr.bin/quota/quotautil.c:1.1	Sun Mar  6 17:36:07 2011
+++ src/usr.bin/quota/quotautil.c	Sun Mar  6 18:26:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: quotautil.c,v 1.1 2011/03/06 22:36:07 christos Exp $ */
+/*	$NetBSD: quotautil.c,v 1.2 2011/03/06 23:26:05 christos Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)quota.c	8.4 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: quotautil.c,v 1.1 2011/03/06 22:36:07 christos Exp $);
+__RCSID($NetBSD: quotautil.c,v 1.2 2011/03/06 23:26:05 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -117,3 +117,17 @@
 	} while ((c = *s++) != 0);
 	return 1;
 }
+
+/*
+ * Check to see if target appears in list of size cnt.
+ */
+int
+oneof(const char *target, char *list[], int cnt)
+{
+	int i;
+
+	for (i = 0; i  cnt; i++)
+		if (strcmp(target, list[i]) == 0)
+			return i;
+	return -1;
+}
Index: src/usr.bin/quota/quotautil.h
diff -u src/usr.bin/quota/quotautil.h:1.1 src/usr.bin/quota/quotautil.h:1.2
--- src/usr.bin/quota/quotautil.h:1.1	Sun Mar  6 17:36:07 2011
+++ src/usr.bin/quota/quotautil.h	Sun Mar  6 18:26:16 2011
@@ -1,7 +1,8 @@
-/*	$NetBSD: quotautil.h,v 1.1 2011/03/06 22:36:07 christos Exp $ */
+/*	$NetBSD: quotautil.h,v 1.2 2011/03/06 23:26:16 christos Exp $ */
 
 const char *qfextension[MAXQUOTAS];
 const char *qfname;
 struct fstab;
 int hasquota(char *, size_t, struct fstab *, int);
 int alldigits(const char *);
+int oneof(const char *, char *[], int);



CVS commit: src/sys/arch/amd64/amd64

2011-03-06 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Mar  7 02:24:57 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: fpu.c

Log Message:
Use macros clts/stts instead of directly manipulating CR0 flags.
Expose fpuinit to XEN build. (remove #ifdef XEN)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/amd64/fpu.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/amd64/amd64/fpu.c
diff -u src/sys/arch/amd64/amd64/fpu.c:1.33 src/sys/arch/amd64/amd64/fpu.c:1.34
--- src/sys/arch/amd64/amd64/fpu.c:1.33	Mon Dec 20 00:25:24 2010
+++ src/sys/arch/amd64/amd64/fpu.c	Mon Mar  7 02:24:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.33 2010/12/20 00:25:24 matt Exp $	*/
+/*	$NetBSD: fpu.c,v 1.34 2011/03/07 02:24:57 cherry Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -100,7 +100,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.33 2010/12/20 00:25:24 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.34 2011/03/07 02:24:57 cherry Exp $);
 
 #include opt_multiprocessor.h
 
@@ -155,18 +155,16 @@
 void fpudna(struct cpu_info *);
 static int x86fpflags_to_ksiginfo(uint32_t);
 
-#ifndef XEN
 /*
  * Init the FPU.
  */
 void
 fpuinit(struct cpu_info *ci)
 {
-	lcr0(rcr0()  ~(CR0_EM|CR0_TS));
+	clts();
 	fninit();
-	lcr0(rcr0() | (CR0_TS));
+	stts();
 }
-#endif
 
 /*
  * Record the FPU state and reinitialize it all except for the control word.



CVS commit: src/tests/fs/ffs/clients

2011-03-06 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Mar  7 03:29:26 UTC 2011

Modified Files:
src/tests/fs/ffs/clients: Makefile

Log Message:
Fix link error.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/ffs/clients/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/fs/ffs/clients/Makefile
diff -u src/tests/fs/ffs/clients/Makefile:1.2 src/tests/fs/ffs/clients/Makefile:1.3
--- src/tests/fs/ffs/clients/Makefile:1.2	Sun Mar  6 17:08:41 2011
+++ src/tests/fs/ffs/clients/Makefile	Mon Mar  7 03:29:26 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/03/06 17:08:41 bouyer Exp $
+#	$NetBSD: Makefile,v 1.3 2011/03/07 03:29:26 enami Exp $
 #
 
 .include bsd.own.mk
@@ -9,8 +9,9 @@
 PROGS=			rump_quota rump_repquota rump_edquota rump_quotactl
 
 .PATH: ${NETBSDSRCDIR}/usr.bin/quota
-SRCS.rump_quota=	quota.c printquota.c getvfsquota.c quota_rumpops.c 
-SRCS.rump_repquota=	printquota.c quota_rumpops.c
+SRCS.rump_quota=	quota.c printquota.c getvfsquota.c quota_rumpops.c \
+			quotautil.c
+SRCS.rump_repquota=	printquota.c quota_rumpops.c quotautil.c
 SRCS.rump_edquota=	printquota.c getvfsquota.c quota_rumpops.c
 CPPFLAGS.quota.c+=	-I${NETBSDSRCDIR}/usr.bin/quota
 CPPFLAGS.printquota.c+=	-I${NETBSDSRCDIR}/usr.bin/quota
@@ -21,7 +22,7 @@
 CPPFLAGS.repquota.c+=	-I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/usr.bin/quota
 
 .PATH: ${NETBSDSRCDIR}/usr.sbin/edquota
-SRCS.rump_edquota+=	edquota.c
+SRCS.rump_edquota+=	edquota.c quotautil.c
 CPPFLAGS.edquota.c+=	-I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/usr.bin/quota
 
 .PATH: ${NETBSDSRCDIR}/usr.sbin/quotactl



CVS commit: [netbsd-5] src/sys/kern

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:09:28 UTC 2011

Modified Files:
src/sys/kern [netbsd-5]: vfs_wapbl.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1543):
sys/kern/vfs_wapbl.c: revision 1.27
sys/kern/vfs_wapbl.c: revision 1.28
Turn a KASSERT into a panic.  I don't want us to be randomly
overwriting memory on non-DIAGNOSTIC kernels if resource estimation
fails.
Add dealloccnt to list of things to be considered in the stetson-harrison
decision making algorithm for flushing a wapbl transation.


To generate a diff of this commit:
cvs rdiff -u -r1.3.8.4 -r1.3.8.5 src/sys/kern/vfs_wapbl.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/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.3.8.4 src/sys/kern/vfs_wapbl.c:1.3.8.5
--- src/sys/kern/vfs_wapbl.c:1.3.8.4	Wed Feb 16 19:31:44 2011
+++ src/sys/kern/vfs_wapbl.c	Mon Mar  7 04:09:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.3.8.4 2011/02/16 19:31:44 bouyer Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.3.8.5 2011/03/07 04:09:28 riz Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * This implements file system independent write ahead filesystem logging.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.3.8.4 2011/02/16 19:31:44 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.3.8.5 2011/03/07 04:09:28 riz Exp $);
 
 #include sys/param.h
 
@@ -829,16 +829,20 @@
 		   wl-wl_bufbytes_max / 2) ||
 		  ((wl-wl_bufcount + (lockcount * 10)) 
 		   wl-wl_bufcount_max / 2) ||
-		  (wapbl_transaction_len(wl)  wl-wl_circ_size / 2);
+		  (wapbl_transaction_len(wl)  wl-wl_circ_size / 2) ||
+		  (wl-wl_dealloccnt =
+		   (wl-wl_dealloclim - (wl-wl_dealloclim  8)));
 	mutex_exit(wl-wl_mtx);
 
 	if (doflush) {
 		WAPBL_PRINTF(WAPBL_PRINT_FLUSH,
 		(force flush lockcnt=%d bufbytes=%zu 
-		(max=%zu) bufcount=%zu (max=%zu)\n,
+		(max=%zu) bufcount=%zu (max=%zu) 
+		dealloccnt %d (lim=%d)\n,
 		lockcount, wl-wl_bufbytes,
 		wl-wl_bufbytes_max, wl-wl_bufcount,
-		wl-wl_bufcount_max));
+		wl-wl_bufcount_max,
+		wl-wl_dealloccnt, wl-wl_dealloclim));
 	}
 
 	if (doflush) {
@@ -1720,8 +1724,14 @@
 
 	mutex_enter(wl-wl_mtx);
 	/* XXX should eventually instead tie this into resource estimation */
-	/* XXX this KASSERT needs locking/mutex analysis */
-	KASSERT(wl-wl_dealloccnt  wl-wl_dealloclim);
+	/*
+	 * XXX this panic needs locking/mutex analysis and the
+	 * ability to cope with the failure.
+	 */
+	/* XXX this XXX doesn't have enough XXX */
+	if (__predict_false(wl-wl_dealloccnt = wl-wl_dealloclim))
+		panic(wapbl_register_deallocation: out of resources);
+
 	wl-wl_deallocblks[wl-wl_dealloccnt] = blk;
 	wl-wl_dealloclens[wl-wl_dealloccnt] = len;
 	wl-wl_dealloccnt++;



CVS commit: [netbsd-5-1] src/sys/kern

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:09:55 UTC 2011

Modified Files:
src/sys/kern [netbsd-5-1]: vfs_wapbl.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1543):
sys/kern/vfs_wapbl.c: revision 1.27
sys/kern/vfs_wapbl.c: revision 1.28
Turn a KASSERT into a panic.  I don't want us to be randomly
overwriting memory on non-DIAGNOSTIC kernels if resource estimation
fails.
Add dealloccnt to list of things to be considered in the stetson-harrison
decision making algorithm for flushing a wapbl transation.


To generate a diff of this commit:
cvs rdiff -u -r1.3.8.2.2.1 -r1.3.8.2.2.2 src/sys/kern/vfs_wapbl.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/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.3.8.2.2.1 src/sys/kern/vfs_wapbl.c:1.3.8.2.2.2
--- src/sys/kern/vfs_wapbl.c:1.3.8.2.2.1	Mon Nov 22 02:53:19 2010
+++ src/sys/kern/vfs_wapbl.c	Mon Mar  7 04:09:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.3.8.2.2.1 2010/11/22 02:53:19 riz Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.3.8.2.2.2 2011/03/07 04:09:55 riz Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * This implements file system independent write ahead filesystem logging.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.3.8.2.2.1 2010/11/22 02:53:19 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.3.8.2.2.2 2011/03/07 04:09:55 riz Exp $);
 
 #include sys/param.h
 
@@ -787,16 +787,20 @@
 		   wl-wl_bufbytes_max / 2) ||
 		  ((wl-wl_bufcount + (lockcount * 10)) 
 		   wl-wl_bufcount_max / 2) ||
-		  (wapbl_transaction_len(wl)  wl-wl_circ_size / 2);
+		  (wapbl_transaction_len(wl)  wl-wl_circ_size / 2) ||
+		  (wl-wl_dealloccnt =
+		   (wl-wl_dealloclim - (wl-wl_dealloclim  8)));
 	mutex_exit(wl-wl_mtx);
 
 	if (doflush) {
 		WAPBL_PRINTF(WAPBL_PRINT_FLUSH,
 		(force flush lockcnt=%d bufbytes=%zu 
-		(max=%zu) bufcount=%zu (max=%zu)\n,
+		(max=%zu) bufcount=%zu (max=%zu) 
+		dealloccnt %d (lim=%d)\n,
 		lockcount, wl-wl_bufbytes,
 		wl-wl_bufbytes_max, wl-wl_bufcount,
-		wl-wl_bufcount_max));
+		wl-wl_bufcount_max,
+		wl-wl_dealloccnt, wl-wl_dealloclim));
 	}
 
 	if (doflush) {
@@ -1671,8 +1675,14 @@
 
 	mutex_enter(wl-wl_mtx);
 	/* XXX should eventually instead tie this into resource estimation */
-	/* XXX this KASSERT needs locking/mutex analysis */
-	KASSERT(wl-wl_dealloccnt  wl-wl_dealloclim);
+	/*
+	 * XXX this panic needs locking/mutex analysis and the
+	 * ability to cope with the failure.
+	 */
+	/* XXX this XXX doesn't have enough XXX */
+	if (__predict_false(wl-wl_dealloccnt = wl-wl_dealloclim))
+		panic(wapbl_register_deallocation: out of resources);
+
 	wl-wl_deallocblks[wl-wl_dealloccnt] = blk;
 	wl-wl_dealloclens[wl-wl_dealloccnt] = len;
 	wl-wl_dealloccnt++;



CVS commit: [netbsd-5-1] src/doc

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:10:15 UTC 2011

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.1

Log Message:
ticket 1543.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/doc/CHANGES-5.1.1

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

Modified files:

Index: src/doc/CHANGES-5.1.1
diff -u src/doc/CHANGES-5.1.1:1.1.2.10 src/doc/CHANGES-5.1.1:1.1.2.11
--- src/doc/CHANGES-5.1.1:1.1.2.10	Wed Feb 16 21:24:31 2011
+++ src/doc/CHANGES-5.1.1	Mon Mar  7 04:10:14 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.1,v 1.1.2.10 2011/02/16 21:24:31 bouyer Exp $
+# $NetBSD: CHANGES-5.1.1,v 1.1.2.11 2011/03/07 04:10:14 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.1.1
 release:
@@ -17,7 +17,7 @@
 sys/kern/vfs_wapbl.c1.38 via patch
 
 	Fix an error that can lead to file system corruption and 
-	freeing free block panics.
+	freeing free block panics.
 	[hannken, ticket #1477]
 
 crypto/external/bsd/openssl/dist/ssl/s3_clnt.c	1.3 via patch
@@ -2252,3 +2252,9 @@
 	patch taken from http://www.openssl.org/news/secadv_20110208.txt
 	[spz, ticket #1545]
 
+sys/kern/vfs_wapbl.c1.27-1.28 via patch
+
+	Fix WAPBL-related panic in DIAGNOSTIC kernels, and possible
+	corruption elsewhere. 
+	[bouyer, ticket #1543]
+



CVS commit: [netbsd-5] src/sys/dev/pci

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:14:20 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1544):
sys/dev/pci/if_wm.c: revision 1.219
wm_gmii_reset(): restore generic reset delays to what they were before
rev 1.186. This makes the following hardware find its PHY again, and I can't
see how these larger delays could be a problem for other hardware:
wm0 at pci6 dev 7 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm0: interrupting at ioapic2 pin 0, event channel 5
wm0: 32-bit 66MHz PCI bus
wm0: 65536 word (16 address bits) SPI EEPROM
wm0: Ethernet address 00:13:72:54:ee:13
igphy0 at wm0 phy 1: Intel IGP01E1000 Gigabit PHY, rev. 0
igphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.14 -r1.162.4.15 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.14 src/sys/dev/pci/if_wm.c:1.162.4.15
--- src/sys/dev/pci/if_wm.c:1.162.4.14	Fri Nov 19 23:40:28 2010
+++ src/sys/dev/pci/if_wm.c	Mon Mar  7 04:14:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.14 2010/11/19 23:40:28 riz Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.15 2011/03/07 04:14:19 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.14 2010/11/19 23:40:28 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.15 2011/03/07 04:14:19 riz Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -5147,9 +5147,9 @@
 	case WM_T_80003:
 		/* generic reset */
 		CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl | CTRL_PHY_RESET);
-		delay((sc-sc_type = WM_T_82571) ? 100 : 10*1000);
+		delay(2);
 		CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl);
-		delay(150);
+		delay(2);
 
 		if ((sc-sc_type == WM_T_82541)
 		|| (sc-sc_type == WM_T_82541_2)



CVS commit: [netbsd-5-1] src/sys/dev/pci

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:15:02 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5-1]: if_wm.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1544):
sys/dev/pci/if_wm.c: revision 1.219
wm_gmii_reset(): restore generic reset delays to what they were before
rev 1.186. This makes the following hardware find its PHY again, and I can't
see how these larger delays could be a problem for other hardware:
wm0 at pci6 dev 7 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm0: interrupting at ioapic2 pin 0, event channel 5
wm0: 32-bit 66MHz PCI bus
wm0: 65536 word (16 address bits) SPI EEPROM
wm0: Ethernet address 00:13:72:54:ee:13
igphy0 at wm0 phy 1: Intel IGP01E1000 Gigabit PHY, rev. 0
igphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.13 -r1.162.4.13.2.1 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.13 src/sys/dev/pci/if_wm.c:1.162.4.13.2.1
--- src/sys/dev/pci/if_wm.c:1.162.4.13	Thu Feb 25 10:59:58 2010
+++ src/sys/dev/pci/if_wm.c	Mon Mar  7 04:15:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.13 2010/02/25 10:59:58 sborrill Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.13.2.1 2011/03/07 04:15:01 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.13 2010/02/25 10:59:58 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.13.2.1 2011/03/07 04:15:01 riz Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -4914,9 +4914,9 @@
 	case WM_T_80003:
 		/* generic reset */
 		CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl | CTRL_PHY_RESET);
-		delay((sc-sc_type = WM_T_82571) ? 100 : 10*1000);
+		delay(2);
 		CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl);
-		delay(150);
+		delay(2);
 
 		if ((sc-sc_type == WM_T_82541)
 		|| (sc-sc_type == WM_T_82541_2)



CVS commit: [netbsd-5-1] src/doc

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:15:22 UTC 2011

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.1

Log Message:
Ticket 1544.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/doc/CHANGES-5.1.1

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

Modified files:

Index: src/doc/CHANGES-5.1.1
diff -u src/doc/CHANGES-5.1.1:1.1.2.11 src/doc/CHANGES-5.1.1:1.1.2.12
--- src/doc/CHANGES-5.1.1:1.1.2.11	Mon Mar  7 04:10:14 2011
+++ src/doc/CHANGES-5.1.1	Mon Mar  7 04:15:21 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.1,v 1.1.2.11 2011/03/07 04:10:14 riz Exp $
+# $NetBSD: CHANGES-5.1.1,v 1.1.2.12 2011/03/07 04:15:21 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.1.1
 release:
@@ -2258,3 +2258,9 @@
 	corruption elsewhere. 
 	[bouyer, ticket #1543]
 
+sys/dev/pci/if_wm.c1.219
+
+	Allow Intel i82541GI to properly find its PHY, fixing a regression
+	from NetBSD 5.0.
+	[bouyer, ticket #1544]
+



CVS commit: [netbsd-5] src/doc

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:15:35 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Tickets 1543, 1544.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.59 -r1.1.2.60 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.59 src/doc/CHANGES-5.2:1.1.2.60
--- src/doc/CHANGES-5.2:1.1.2.59	Wed Feb 16 21:36:01 2011
+++ src/doc/CHANGES-5.2	Mon Mar  7 04:15:34 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.59 2011/02/16 21:36:01 bouyer Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.60 2011/03/07 04:15:34 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -812,7 +812,7 @@
 sys/kern/vfs_wapbl.c1.38 via patch
 
 	Fix an error that can lead to file system corruption and 
-	freeing free block panics.
+	freeing free block panics.
 	[hannken, ticket #1477]
 
 sys/dev/usb/if_kuereg.h1.12
@@ -4748,3 +4748,15 @@
 	for sun4 and sun4c, not only for sun4m. Okay'ed by mrg@.
 	[mrg, ticket 1553]
 
+sys/kern/vfs_wapbl.c1.27-1.28 via patch
+
+	Fix WAPBL-related panic in DIAGNOSTIC kernels, and possible
+	corruption elsewhere. 
+	[bouyer, ticket #1543]
+
+sys/dev/pci/if_wm.c1.219
+
+	Allow Intel i82541GI to properly find its PHY, fixing a regression
+	from NetBSD 5.0.
+	[bouyer, ticket #1544]
+



CVS commit: [netbsd-5] src/doc

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:20:09 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket 1573.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.60 -r1.1.2.61 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.60 src/doc/CHANGES-5.2:1.1.2.61
--- src/doc/CHANGES-5.2:1.1.2.60	Mon Mar  7 04:15:34 2011
+++ src/doc/CHANGES-5.2	Mon Mar  7 04:20:09 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.60 2011/03/07 04:15:34 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.61 2011/03/07 04:20:09 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -4760,3 +4760,8 @@
 	from NetBSD 5.0.
 	[bouyer, ticket #1544]
 
+sys/arch/xen/xen/xbdback_xenbus.c		1.33
+
+	Prevent dom0 pool corruption.
+	[bouyer, ticket #1573]
+



CVS commit: src

2011-03-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Mar  7 05:09:12 UTC 2011

Modified Files:
src/lib/csu/alpha: crt0.c
src/lib/csu/arm_elf: crt0.c
src/lib/csu/common: crt0-common.c
src/lib/csu/common_elf: common.h
src/lib/csu/hppa: crt0.c
src/lib/csu/ia64: crt0.c
src/lib/csu/m68k_elf: crt0.c
src/lib/csu/powerpc: crt0.c
src/lib/csu/powerpc64: crt0.c
src/lib/csu/sh3_elf: crt0.c
src/lib/csu/sparc64: crt0.c
src/lib/csu/sparc_elf: crt0.c
src/lib/csu/vax_elf: crt0.c
src/lib/libc/dlfcn: dlfcn_elf.c
src/lib/libc/misc: initfini.c
src/lib/libc/stdlib: exit.c
src/sys/compat/netbsd32: netbsd32_exec_elf32.c
src/sys/kern: exec_elf.c

Log Message:
Pass down ELF Auxillary Vectors for static NetBSD binaries too.
Rename __libc_init to _libc_init and call it explicitly from CSU code.
This enforces the constructor run order for newly linked programs.
Keep it as constructor with run-once semantic for binary compatibility.
Implement dl_iterate_phdr for statically linked programs.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/csu/alpha/crt0.c
cvs rdiff -u -r1.8 -r1.9 src/lib/csu/arm_elf/crt0.c
cvs rdiff -u -r1.4 -r1.5 src/lib/csu/common/crt0-common.c
cvs rdiff -u -r1.14 -r1.15 src/lib/csu/common_elf/common.h
cvs rdiff -u -r1.9 -r1.10 src/lib/csu/hppa/crt0.c
cvs rdiff -u -r1.3 -r1.4 src/lib/csu/ia64/crt0.c
cvs rdiff -u -r1.12 -r1.13 src/lib/csu/m68k_elf/crt0.c
cvs rdiff -u -r1.28 -r1.29 src/lib/csu/powerpc/crt0.c
cvs rdiff -u -r1.3 -r1.4 src/lib/csu/powerpc64/crt0.c
cvs rdiff -u -r1.11 -r1.12 src/lib/csu/sh3_elf/crt0.c
cvs rdiff -u -r1.25 -r1.26 src/lib/csu/sparc64/crt0.c
cvs rdiff -u -r1.13 -r1.14 src/lib/csu/sparc_elf/crt0.c
cvs rdiff -u -r1.11 -r1.12 src/lib/csu/vax_elf/crt0.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/dlfcn/dlfcn_elf.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/misc/initfini.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/stdlib/exit.c
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/netbsd32/netbsd32_exec_elf32.c
cvs rdiff -u -r1.28 -r1.29 src/sys/kern/exec_elf.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/csu/alpha/crt0.c
diff -u src/lib/csu/alpha/crt0.c:1.25 src/lib/csu/alpha/crt0.c:1.26
--- src/lib/csu/alpha/crt0.c:1.25	Tue Feb 22 05:45:05 2011
+++ src/lib/csu/alpha/crt0.c	Mon Mar  7 05:09:09 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.25 2011/02/22 05:45:05 joerg Exp $ */
+/* $NetBSD: crt0.c,v 1.26 2011/03/07 05:09:09 joerg Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -69,6 +69,8 @@
 		_rtld_setup(cleanup, obj);
 #endif
 
+	_libc_init();
+
 #ifdef MCRT0
 	atexit(_mcleanup);
 	monstartup((u_long)_eprol, (u_long)_etext);
@@ -84,7 +86,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: crt0.c,v 1.25 2011/02/22 05:45:05 joerg Exp $);
+__RCSID($NetBSD: crt0.c,v 1.26 2011/03/07 05:09:09 joerg Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include common.c

Index: src/lib/csu/arm_elf/crt0.c
diff -u src/lib/csu/arm_elf/crt0.c:1.8 src/lib/csu/arm_elf/crt0.c:1.9
--- src/lib/csu/arm_elf/crt0.c:1.8	Tue Feb 22 05:45:05 2011
+++ src/lib/csu/arm_elf/crt0.c	Mon Mar  7 05:09:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: crt0.c,v 1.8 2011/02/22 05:45:05 joerg Exp $	*/
+/*	$NetBSD: crt0.c,v 1.9 2011/03/07 05:09:09 joerg Exp $	*/
 
 /*
  * Copyright (C) 1997 Mark Brinicombe
@@ -68,7 +68,7 @@
 	b	 ___STRING(_C_LABEL(___start))  );
 
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: crt0.c,v 1.8 2011/02/22 05:45:05 joerg Exp $);
+__RCSID($NetBSD: crt0.c,v 1.9 2011/03/07 05:09:09 joerg Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 void
@@ -93,6 +93,8 @@
 _rtld_setup(cleanup, obj);
 #endif	/* DYNAMIC */
 
+	_libc_init();
+
 #ifdef MCRT0
 	atexit(_mcleanup);
 	monstartup((u_long)_eprol, (u_long)_etext);

Index: src/lib/csu/common/crt0-common.c
diff -u src/lib/csu/common/crt0-common.c:1.4 src/lib/csu/common/crt0-common.c:1.5
--- src/lib/csu/common/crt0-common.c:1.4	Tue Feb 22 05:45:06 2011
+++ src/lib/csu/common/crt0-common.c	Mon Mar  7 05:09:09 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0-common.c,v 1.4 2011/02/22 05:45:06 joerg Exp $ */
+/* $NetBSD: crt0-common.c,v 1.5 2011/03/07 05:09:09 joerg Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: crt0-common.c,v 1.4 2011/02/22 05:45:06 joerg Exp $);
+__RCSID($NetBSD: crt0-common.c,v 1.5 2011/03/07 05:09:09 joerg Exp $);
 
 #include sys/types.h
 #include sys/syscall.h
@@ -50,6 +50,7 @@
 
 extern void	_init(void);
 extern void	_fini(void);
+extern void	_libc_init(void);
 
 /*
  * Arrange for _DYNAMIC to be weak