CVS commit: src/share/mk

2013-08-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug  6 06:08:39 UTC 2013

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

Log Message:
Add -mlong-calls to hppa module builds.


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

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

Modified files:

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.37 src/share/mk/bsd.kmodule.mk:1.38
--- src/share/mk/bsd.kmodule.mk:1.37	Fri Aug 10 16:34:23 2012
+++ src/share/mk/bsd.kmodule.mk	Tue Aug  6 06:08:39 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.37 2012/08/10 16:34:23 joerg Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.38 2013/08/06 06:08:39 skrll Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -28,6 +28,8 @@ CFLAGS+=	-fno-strict-aliasing -Wno-point
 # resulting code would be much faster.
 .if ${MACHINE_CPU} == arm
 CFLAGS+=	-mlong-calls
+.elif ${MACHINE_CPU} == hppa
+CFLAGS+=	-mlong-calls
 .elif ${MACHINE_CPU} == powerpc
 CFLAGS+=	-mlongcall
 .elif ${MACHINE_CPU} == vax



CVS commit: src/sys/sys

2013-08-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug  6 06:10:57 UTC 2013

Modified Files:
src/sys/sys: pmf.h

Log Message:
Add PMFE_SPEED_CHANGED


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/pmf.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/sys/pmf.h
diff -u src/sys/sys/pmf.h:1.20 src/sys/sys/pmf.h:1.21
--- src/sys/sys/pmf.h:1.20	Sun Aug  4 00:21:56 2013
+++ src/sys/sys/pmf.h	Tue Aug  6 06:10:57 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: pmf.h,v 1.20 2013/08/04 00:21:56 rkujawa Exp $ */
+/* $NetBSD: pmf.h,v 1.21 2013/08/06 06:10:57 matt Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -50,7 +50,8 @@ typedef enum {
 	PMFE_RADIO_ON,
 	PMFE_RADIO_OFF,
 	PMFE_RADIO_TOGGLE,
-	PMFE_POWER_CHANGED
+	PMFE_POWER_CHANGED,
+	PMFE_SPEED_CHANGED
 } pmf_generic_event_t;
 
 struct pmf_qual {



CVS commit: src/sys/arch/hppa/hppa

2013-08-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug  6 06:40:43 UTC 2013

Modified Files:
src/sys/arch/hppa/hppa: kobj_machdep.c

Log Message:
Re-order relocation in switch statement. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hppa/hppa/kobj_machdep.c

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

Modified files:

Index: src/sys/arch/hppa/hppa/kobj_machdep.c
diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.7 src/sys/arch/hppa/hppa/kobj_machdep.c:1.8
--- src/sys/arch/hppa/hppa/kobj_machdep.c:1.7	Fri Jan  6 09:09:25 2012
+++ src/sys/arch/hppa/hppa/kobj_machdep.c	Tue Aug  6 06:40:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.7 2012/01/06 09:09:25 skrll Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.7 2012/01/06 09:09:25 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $);
 
 #define	ELFSIZE		ARCH_ELFSIZE
 
@@ -132,22 +132,6 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 			*where = value;
 		break;
 
-	case R_TYPE(PLABEL32):
-		/* fptr(symbol) */
-		addr = kobj_sym_lookup(ko, symidx);
-		if (*where != addr)
-			*where = addr;
-		break;
-
-	case R_TYPE(DIR14R):
-		/* RR(symbol, addend) */
-		addr = kobj_sym_lookup(ko, symidx);
-		value = RR(addr, value);
-		*where |=
-		 (((value   0)  0x1fff)  1) |
-		 (((value  13)  0x1)  0);
-		break;
-
 	case R_TYPE(DIR21L):
 		/* LR(symbol, addend) */
 		addr = kobj_sym_lookup(ko, symidx);
@@ -160,6 +144,15 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		(((value  11)  0x003)  12);
 		break;
 
+	case R_TYPE(DIR14R):
+		/* RR(symbol, addend) */
+		addr = kobj_sym_lookup(ko, symidx);
+		value = RR(addr, value);
+		*where |=
+		 (((value   0)  0x1fff)  1) |
+		 (((value  13)  0x1)  0);
+		break;
+
 	case R_TYPE(PCREL17F):
 		/* symbol - PC - 8 + addend */
 		addr = kobj_sym_lookup(ko, symidx);
@@ -173,6 +166,18 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		(((value  0x003ff)  1)  2);		/* w2 */
 		break;
 
+	case R_TYPE(DPREL21L):
+		/* LR(symbol - GP, addend) */
+		addr = kobj_sym_lookup(ko, symidx);
+		value = LR(addr - GP, value);
+		*where |=
+		(((value  31)  0x001)   0) |
+		(((value  20)  0x7ff)   1) |
+		(((value  18)  0x003)  14) |
+		(((value  13)  0x01f)  16) |
+		(((value  11)  0x003)  12);
+		break;
+
 	case R_TYPE(DPREL14R):
 		/* RR(symbol - GP, addend) */
 		addr = kobj_sym_lookup(ko, symidx);
@@ -183,16 +188,11 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		break;
 
 
-	case R_TYPE(DPREL21L):
-		/* LR(symbol - GP, addend) */
+	case R_TYPE(PLABEL32):
+		/* fptr(symbol) */
 		addr = kobj_sym_lookup(ko, symidx);
-		value = LR(addr - GP, value);
-		*where |=
-		(((value  31)  0x001)   0) |
-		(((value  20)  0x7ff)   1) |
-		(((value  18)  0x003)  14) |
-		(((value  13)  0x01f)  16) |
-		(((value  11)  0x003)  12);
+		if (*where != addr)
+			*where = addr;
 		break;
 
 	case R_TYPE(SEGREL32):



CVS commit: src/sys/arch/hppa/hppa

2013-08-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug  6 07:07:53 UTC 2013

Modified Files:
src/sys/arch/hppa/hppa: kobj_machdep.c

Log Message:
Split the reloc evaluation from the value encoding part.  Several relocs
can share the value encoding part.

Fixes the SEGREL32 relocs while here.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hppa/hppa/kobj_machdep.c

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

Modified files:

Index: src/sys/arch/hppa/hppa/kobj_machdep.c
diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.8 src/sys/arch/hppa/hppa/kobj_machdep.c:1.9
--- src/sys/arch/hppa/hppa/kobj_machdep.c:1.8	Tue Aug  6 06:40:43 2013
+++ src/sys/arch/hppa/hppa/kobj_machdep.c	Tue Aug  6 07:07:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $);
 
 #define	ELFSIZE		ARCH_ELFSIZE
 
@@ -128,29 +128,18 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		/* symbol + addend */
 		addr = kobj_sym_lookup(ko, symidx);
 		value += addr;
-		if (*where != value)
-			*where = value;
 		break;
 
 	case R_TYPE(DIR21L):
 		/* LR(symbol, addend) */
 		addr = kobj_sym_lookup(ko, symidx);
 		value = LR(addr, value);
-		*where |=
-		(((value  31)  0x001)   0) |
-		(((value  20)  0x7ff)   1) |
-		(((value  18)  0x003)  14) |
-		(((value  13)  0x01f)  16) |
-		(((value  11)  0x003)  12);
 		break;
 
 	case R_TYPE(DIR14R):
 		/* RR(symbol, addend) */
 		addr = kobj_sym_lookup(ko, symidx);
 		value = RR(addr, value);
-		*where |=
-		 (((value   0)  0x1fff)  1) |
-		 (((value  13)  0x1)  0);
 		break;
 
 	case R_TYPE(PCREL17F):
@@ -158,41 +147,24 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		addr = kobj_sym_lookup(ko, symidx);
 		value += addr - (Elf_Word)where - 8;
 		value = 2;		/* bottom two bits not needed */
-
-		*where |=
-		(((value  0x1)  16)  0) |		/* w */
-		(((value  0x0f800)  11)  16) |		/* w1 */
-		(((value  0x00400)  10)  2) |
-		(((value  0x003ff)  1)  2);		/* w2 */
 		break;
 
 	case R_TYPE(DPREL21L):
 		/* LR(symbol - GP, addend) */
 		addr = kobj_sym_lookup(ko, symidx);
 		value = LR(addr - GP, value);
-		*where |=
-		(((value  31)  0x001)   0) |
-		(((value  20)  0x7ff)   1) |
-		(((value  18)  0x003)  14) |
-		(((value  13)  0x01f)  16) |
-		(((value  11)  0x003)  12);
 		break;
 
 	case R_TYPE(DPREL14R):
 		/* RR(symbol - GP, addend) */
 		addr = kobj_sym_lookup(ko, symidx);
 		value = RR(addr - GP, value);
-		*where |=
-		 (((value   0)  0x1fff)  1) |
-		 (((value  13)  0x1)  0);
 		break;
 
-
 	case R_TYPE(PLABEL32):
 		/* fptr(symbol) */
 		addr = kobj_sym_lookup(ko, symidx);
-		if (*where != addr)
-			*where = addr;
+		value = addr;
 		break;
 
 	case R_TYPE(SEGREL32):
@@ -200,14 +172,48 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		/* XXX SB */
 		addr = kobj_sym_lookup(ko, symidx);
 		value += addr;
-		if (*where != addr)
-			*where = addr;
 		break;
 
 	default:
 		printf(%s: unexpected relocation type %d\n, __func__, rtype);
 		return -1;
 	}
+
+	switch (rtype) {
+	case R_TYPE(DIR32):
+	case R_TYPE(PLABEL32):
+	case R_TYPE(SEGREL32):
+		*where = value;
+		break;
+
+	case R_TYPE(DIR14R):
+	case R_TYPE(DPREL14R):
+		*where |=
+		 (((value   0)  0x1fff)  1) |
+		 (((value  13)  0x1)  0);
+		break;
+
+	case R_TYPE(PCREL17F):
+		*where |=
+		(((value  0x1)  16)  0) |		/* w */
+		(((value  0x0f800)  11)  16) |		/* w1 */
+		(((value  0x00400)  10)  2) |
+		(((value  0x003ff)  1)  2);		/* w2 */
+		break;
+
+	case R_TYPE(DIR21L):
+	case R_TYPE(DPREL21L):
+		*where |=
+		(((value  31)  0x001)   0) |
+		(((value  20)  0x7ff)   1) |
+		(((value  18)  0x003)  14) |
+		(((value  13)  0x01f)  16) |
+		(((value  11)  0x003)  12);
+		break;
+	}
+
+
+
 	return 0;
 }
 



CVS commit: src/sys/arch/hppa/hppa

2013-08-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug  6 07:10:04 UTC 2013

Modified Files:
src/sys/arch/hppa/hppa: kobj_machdep.c

Log Message:
Implement DIR17R. All the module tests pass now.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hppa/hppa/kobj_machdep.c

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

Modified files:

Index: src/sys/arch/hppa/hppa/kobj_machdep.c
diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.9 src/sys/arch/hppa/hppa/kobj_machdep.c:1.10
--- src/sys/arch/hppa/hppa/kobj_machdep.c:1.9	Tue Aug  6 07:07:53 2013
+++ src/sys/arch/hppa/hppa/kobj_machdep.c	Tue Aug  6 07:10:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $);
 
 #define	ELFSIZE		ARCH_ELFSIZE
 
@@ -136,6 +136,13 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		value = LR(addr, value);
 		break;
 
+	case R_TYPE(DIR17R):
+		/* RR(symbol, addend) */
+		addr = kobj_sym_lookup(ko, symidx);
+		value = RR(addr, value);
+		value = 2;		/* bottom two bits not needed */
+		break;
+
 	case R_TYPE(DIR14R):
 		/* RR(symbol, addend) */
 		addr = kobj_sym_lookup(ko, symidx);
@@ -193,6 +200,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		 (((value  13)  0x1)  0);
 		break;
 
+	case R_TYPE(DIR17R):
 	case R_TYPE(PCREL17F):
 		*where |=
 		(((value  0x1)  16)  0) |		/* w */



CVS commit: src/sys/arch/hppa/hppa

2013-08-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug  6 07:10:52 UTC 2013

Modified Files:
src/sys/arch/hppa/hppa: kobj_machdep.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hppa/hppa/kobj_machdep.c

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

Modified files:

Index: src/sys/arch/hppa/hppa/kobj_machdep.c
diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.10 src/sys/arch/hppa/hppa/kobj_machdep.c:1.11
--- src/sys/arch/hppa/hppa/kobj_machdep.c:1.10	Tue Aug  6 07:10:04 2013
+++ src/sys/arch/hppa/hppa/kobj_machdep.c	Tue Aug  6 07:10:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.11 2013/08/06 07:10:52 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.11 2013/08/06 07:10:52 skrll Exp $);
 
 #define	ELFSIZE		ARCH_ELFSIZE
 
@@ -220,8 +220,6 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		break;
 	}
 
-
-
 	return 0;
 }
 



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2013-08-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug  6 07:57:49 UTC 2013

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_shim.c

Log Message:
Make a comment match the code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c

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

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c:1.1 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c:1.2
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c:1.1	Fri Mar  8 12:32:31 2013
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c	Tue Aug  6 07:57:49 2013
@@ -248,7 +248,7 @@ EXPORT_SYMBOL(vchi_bulk_queue_receive);
  * Name: vchi_bulk_queue_transmit
  *
  * Arguments:  VCHI_BULK_HANDLE_T handle,
- * const void *data_src,
+ * void *data_src,
  * uint32_t data_size,
  * VCHI_FLAGS_T flags,
  * void *bulk_handle



CVS commit: src

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 08:18:08 UTC 2013

Modified Files:
src/sbin/newfs_udf: udf_write.c
src/usr.sbin/makefs: udf.c

Log Message:
Fix memory leaks found by Coverity and fix memoryleaks in the new code


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/newfs_udf/udf_write.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/udf.c

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

Modified files:

Index: src/sbin/newfs_udf/udf_write.c
diff -u src/sbin/newfs_udf/udf_write.c:1.6 src/sbin/newfs_udf/udf_write.c:1.7
--- src/sbin/newfs_udf/udf_write.c:1.6	Mon Aug  5 20:52:08 2013
+++ src/sbin/newfs_udf/udf_write.c	Tue Aug  6 08:18:08 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_write.c,v 1.6 2013/08/05 20:52:08 reinoud Exp $ */
+/* $NetBSD: udf_write.c,v 1.7 2013/08/06 08:18:08 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf_write.c,v 1.6 2013/08/05 20:52:08 reinoud Exp $);
+__RCSID($NetBSD: udf_write.c,v 1.7 2013/08/06 08:18:08 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -783,6 +783,8 @@ udf_do_rootdir(void) {
 	error = udf_write_dscr_virt(root_dscr,
 		layout.rootdir, context.metadata_part, 1);
 
+	free(root_dscr);
+
 	return error;
 }
 
@@ -891,6 +893,7 @@ udf_do_newfs_postfix(void)
 		loc++;
 
 		error = udf_write_dscr_virt(vat_dscr, loc, metadata_part, 1);
+		free(vat_dscr);
 		if (error)
 			return error;
 	}

Index: src/usr.sbin/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.4 src/usr.sbin/makefs/udf.c:1.5
--- src/usr.sbin/makefs/udf.c:1.4	Mon Aug  5 18:44:16 2013
+++ src/usr.sbin/makefs/udf.c	Tue Aug  6 08:18:08 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.4 2013/08/05 18:44:16 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.5 2013/08/06 08:18:08 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf.c,v 1.4 2013/08/05 18:44:16 reinoud Exp $);
+__RCSID($NetBSD: udf.c,v 1.5 2013/08/06 08:18:08 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -880,6 +880,7 @@ udf_copy_file(struct stat *st, char *pat
 	uint8_t *data;
 	int nblk;
 	int i, f;
+	int error;
 
 	fnode = cur-inode;
 
@@ -901,13 +902,13 @@ udf_copy_file(struct stat *st, char *pat
 
 	printf(  );
 	i = 0;
+	error = 0;
 	while (chunk) {
 		rd = read(f, data, chunk);
 		if (rd != chunk) {
 			warn(Short read of file %s\n, cur-name);
-			close(f);
-			free(data);
-			return errno;
+			error = errno;
+			break;
 		}
 		printf(\b%c, \\|/-[i++ % 4]); fflush(stdout);fflush(stderr);
 
@@ -927,12 +928,13 @@ udf_copy_file(struct stat *st, char *pat
 	udf_set_link_cnt(dscr, fnode-nlink);
 	udf_write_dscr_virt(dscr, udf_rw32(icb-loc.lb_num),
 		udf_rw16(icb-loc.part_num), 1);
+	free(dscr);
 
 	/* remember our location for hardlinks */
 	cur-inode-fsuse = malloc(sizeof(struct long_ad));
 	memcpy(cur-inode-fsuse, icb, sizeof(struct long_ad));
 
-	return 0;
+	return error;
 }
 
 
@@ -1069,6 +1071,7 @@ udf_populate_walk(fsinfo_t *fsopts, fsno
 			udf_write_dscr_virt(dscr, udf_rw32(icb.loc.lb_num),
 udf_rw16(icb.loc.part_num), 1);
 
+			free(dscr);
 			free(softlink_buf);
 
 			udf_create_fid(ddoff, fid, cur-name, 0, icb);
@@ -1088,6 +1091,8 @@ udf_populate_walk(fsinfo_t *fsopts, fsno
 	udf_write_dscr_virt(dir_dscr, udf_rw32(dir_icb-loc.lb_num),
 			udf_rw16(dir_icb-loc.part_num), 1);
 
+	free(dirdata);
+	free(dir_dscr);
 	return retval;
 }
 
@@ -1122,10 +1127,11 @@ udf_enumerate_and_estimate(const char *d
 
 	/* calculate strict minimal size */
 	udf_estimate_walk(fsopts, root, path, stats);
-	printf(ndirs\t\t%d\n, stats-ndirs);
-	printf(nfiles\t\t%d\n, stats-nfiles);
-	printf(ndata_blocks\t%d\n, stats-ndatablocks);
-	printf(nmetadata_blocks\t%d\n, stats-nmetadatablocks);
+	printf(ndirs%d\n, stats-ndirs);
+	printf(nfiles   %d\n, stats-nfiles);
+	printf(ndata_blocks %d\n, stats-ndatablocks);
+	printf(nmetadata_blocks %d\n, stats-nmetadatablocks);
+	printf(\n);
 
 	/* adjust for options : free file nodes */
 	if (fsopts-freefiles) {



CVS commit: src/usr.sbin/makefs

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 08:24:56 UTC 2013

Modified Files:
src/usr.sbin/makefs: udf.c

Log Message:
Fix assert() on allocation type by masking it with the flag allocation bit
mask. Fixes internal allocation writing in nodes with suid/sgid/sticky
accessnode.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/udf.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/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.5 src/usr.sbin/makefs/udf.c:1.6
--- src/usr.sbin/makefs/udf.c:1.5	Tue Aug  6 08:18:08 2013
+++ src/usr.sbin/makefs/udf.c	Tue Aug  6 08:24:56 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.5 2013/08/06 08:18:08 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.6 2013/08/06 08:24:56 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf.c,v 1.5 2013/08/06 08:18:08 reinoud Exp $);
+__RCSID($NetBSD: udf.c,v 1.6 2013/08/06 08:24:56 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -517,7 +517,8 @@ udf_file_inject_blob(union dscrptr *dscr
 
 	/* going internal */
 	assert(l_ad == 0);
-	assert(udf_rw16(icb-flags) == UDF_ICB_INTERN_ALLOC);
+	assert((udf_rw16(icb-flags)  UDF_ICB_TAG_FLAGS_ALLOC_MASK) ==
+			UDF_ICB_INTERN_ALLOC);
 
 	// assert(free_space = size);
 	pos = data + l_ea + l_ad;



CVS commit: src/usr.sbin/makefs

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 09:32:23 UTC 2013

Modified Files:
src/usr.sbin/makefs: udf.c

Log Message:
Implement auto-setting of sector size and disc size when specifying
-oT=devtype to one of the supported disk types.

While here, also fix where the -s size argument would be overriden by the
calculated size.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/makefs/udf.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/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.6 src/usr.sbin/makefs/udf.c:1.7
--- src/usr.sbin/makefs/udf.c:1.6	Tue Aug  6 08:24:56 2013
+++ src/usr.sbin/makefs/udf.c	Tue Aug  6 09:32:23 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.6 2013/08/06 08:24:56 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.7 2013/08/06 09:32:23 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf.c,v 1.6 2013/08/06 08:24:56 reinoud Exp $);
+__RCSID($NetBSD: udf.c,v 1.7 2013/08/06 09:32:23 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -133,7 +133,8 @@ udf_dump_discinfo(struct mmc_discinfo *d
 	printf(\tfst on last ses%d\n, di-first_track_last_session);
 	printf(\tlst on last ses%d\n, di-last_track_last_session);
 	printf(\tlink block penalty %d\n, di-link_block_penalty);
-	snprintb(bits, sizeof(bits), MMC_DFLAGS_FLAGBITS, (uint64_t) di-disc_flags);
+	snprintb(bits, sizeof(bits), MMC_DFLAGS_FLAGBITS,
+			(uint64_t) di-disc_flags);
 	printf(\tdisc flags %s\n, bits);
 	printf(\tdisc id%x\n, di-disc_id);
 	printf(\tdisc barcode   %PRIx64\n, di-disc_barcode);
@@ -191,7 +192,8 @@ udf_emulate_discinfo(fsinfo_t *fsopts, s
 	switch (mmc_emuprofile) {
 	case 0x00:	/* unknown, treat as CDROM */
 	case 0x08:	/* CDROM */
-	case 0x10:	/* DVD-ROM */
+	case 0x10:	/* DVDROM */
+	case 0x40:	/* BDROM */
 		req_enable |= FORMAT_READONLY;
 		/* FALLTROUGH */
 	case 0x01:	/* disc */
@@ -286,7 +288,7 @@ udf_prep_opts(fsinfo_t *fsopts)
 	time_t now;
 
 	const option_t udf_options[] = {
-		OPT_STR('T', disctype, disc type (cdrom,dvdrom,dvdram,bdre,disk,cdr,dvdr,cdrw,dvdrw)),
+		OPT_STR('T', disctype, disc type (cdrom,dvdrom,bdrom,dvdram,bdre,disk,cdr,dvdr,bdr,cdrw,dvdrw)),
 //		{ 'P', progress, display_progressbar, OPT_INT32, false, true,
 //		  display progress bar },
 		{ .name = NULL }
@@ -330,10 +332,20 @@ udf_cleanup_opts(fsinfo_t *fsopts)
 }
 
 
+#define CDRSIZE((uint64_t)   700*1024*1024)	/* small approx */
+#define CDRWSIZE   ((uint64_t)   576*1024*1024)	/* small approx */
+#define DVDRSIZE   ((uint64_t)  4488*1024*1024)	/* small approx */
+#define DVDRAMSIZE ((uint64_t)  4330*1024*1024)	/* small approx with spare */
+#define DVDRWSIZE  ((uint64_t)  4482*1024*1024)	/* small approx */
+#define BDRSIZE((uint64_t) 23866*1024*1024)	/* small approx */
+#define BDRESIZE   ((uint64_t) 23098*1024*1024)	/* small approx */
+
 int
 udf_parse_opts(const char *option, fsinfo_t *fsopts)
 {
 	option_t *udf_options = fsopts-fs_options;
+	uint64_t stdsize;
+	uint32_t set_sectorsize;
 	const char *name, *desc;
 	char buf[1024];
 	int i;
@@ -350,6 +362,9 @@ udf_parse_opts(const char *option, fsinf
 	if (udf_options[i].name == NULL)
 		abort();
 
+	set_sectorsize = 0;
+	stdsize = 0;
+
 	name = udf_options[i].name;
 	desc = udf_options[i].desc;
 	switch (udf_options[i].letter) {
@@ -358,25 +373,42 @@ udf_parse_opts(const char *option, fsinf
 			mmc_profile = 0x00;
 		} else if (strcmp(buf, dvdrom) == 0) {
 			mmc_profile = 0x10;
+		} else if (strcmp(buf, bdrom) == 0) {
+			mmc_profile = 0x40;
 		} else if (strcmp(buf, dvdram) == 0) {
 			mmc_profile = 0x12;
+			stdsize = DVDRAMSIZE;
 		} else if (strcmp(buf, bdre) == 0) {
 			mmc_profile = 0x43;
+			stdsize = BDRESIZE;
 		} else if (strcmp(buf, disk) == 0) {
 			mmc_profile = 0x01;
 		} else if (strcmp(buf, cdr) == 0) {
 			mmc_profile = 0x09;
+			stdsize = CDRSIZE;
 		} else if (strcmp(buf, dvdr) == 0) {
 			mmc_profile = 0x1b;
+			stdsize = DVDRSIZE;
+		} else if (strcmp(buf, bdr) == 0) {
+			mmc_profile = 0x41;
+			stdsize = BDRSIZE;
 		} else if (strcmp(buf, cdrw) == 0) {
 			mmc_profile = 0x0a;
+			stdsize = CDRWSIZE;
 		} else if (strcmp(buf, dvdrw) == 0) {
 			mmc_profile = 0x13;
+			stdsize = DVDRWSIZE;
 		} else {
 			errx(EINVAL, Unknown or unimplemented disc format);
 			return 0;
 		}
+		if (mmc_profile != 0x01)
+			set_sectorsize = 2048;
 	}
+	if (set_sectorsize)
+		fsopts-sectorsize = set_sectorsize;
+	if (stdsize)
+		fsopts-size = stdsize;
 	return 1;
 }
 
@@ -1122,6 +1154,7 @@ udf_enumerate_and_estimate(const char *d
 		struct udf_stats *stats)
 {
 	char path[MAXPATHLEN + 1];
+	off_t proposed_size;
 	uint32_t n, nblk;
 
 	strncpy(path, dir, sizeof(path));
@@ -1162,11 +1195,17 @@ udf_enumerate_and_estimate(const char *d
 		stats-ndatablocks += (n - nblk);
 		nblk += n - nblk;

CVS commit: src/usr.sbin/makefs

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 09:43:41 UTC 2013

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

Log Message:
Update makefs(8) man page to reflect the selection of default sector and disc
sizes based on the disc type.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/makefs/makefs.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/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.48 src/usr.sbin/makefs/makefs.8:1.49
--- src/usr.sbin/makefs/makefs.8:1.48	Mon Aug  5 18:49:58 2013
+++ src/usr.sbin/makefs/makefs.8	Tue Aug  6 09:43:41 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: makefs.8,v 1.48 2013/08/05 18:49:58 reinoud Exp $
+.\	$NetBSD: makefs.8,v 1.49 2013/08/06 09:43:41 reinoud Exp $
 .\
 .\ Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -33,7 +33,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd August 5, 2013
+.Dd August 6, 2013
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -401,15 +401,18 @@ The following keywords are supported:
 .It Sy disctype
 This can have the following values:
 .Bl -tag -width dvdramXbdreXdiskXXX -compact
-.It Sy cdrom , Sy dvdrom
+.It Sy cdrom , Sy dvdrom , Sy bdrom
 create a read-only fs
 .It Sy dvdram , Sy bdre , Sy disk
 create a rewritable fs without sparing for defective sectors
-.It Sy cdr , Sy dvdr
+.It Sy cdr , Sy dvdr , Sy bdr
 create a rewritable fs on once recordable media using a VAT
 .It Sy cdrw , Sy dvdrw
 create a rewritable fs with sparing for defective sectors
 .El
+When an optical media is selected here, the sectorsize and the default disc
+size is assumed unless given explicitly. For rom images the disc size is the
+minimum needed.
 .El
 .Sh SEE ALSO
 .Xr strsuftoll 3 ,



CVS commit: src/sbin/newfs_udf

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 11:38:51 UTC 2013

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

Log Message:
Fix misplaced BUGS section and fix layout


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/newfs_udf/newfs_udf.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_udf/newfs_udf.8
diff -u src/sbin/newfs_udf/newfs_udf.8:1.14 src/sbin/newfs_udf/newfs_udf.8:1.15
--- src/sbin/newfs_udf/newfs_udf.8:1.14	Mon Aug  5 14:28:48 2013
+++ src/sbin/newfs_udf/newfs_udf.8	Tue Aug  6 11:38:51 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: newfs_udf.8,v 1.14 2013/08/05 14:28:48 wiz Exp $
+.\ $NetBSD: newfs_udf.8,v 1.15 2013/08/06 11:38:51 reinoud Exp $
 .\
 .\ Copyright (c) 2008 Reinoud Zandijk
 .\ All rights reserved.
@@ -163,18 +163,6 @@ native sectorsize of 512 :
 .Bd -literal -offset indent
 newfs_udf -L My USB stick /dev/rsd0d
 .Ed
-.Sh SEE ALSO
-.Xr disktab 5 ,
-.Xr disklabel 8 ,
-.Xr mmcformat 8 ,
-.Xr newfs 8
-.Sh HISTORY
-The
-.Nm
-command first appeared in
-.Nx 5.0 .
-.Sh AUTHORS
-.An Reinoud Zandijk Aq Mt rein...@netbsd.org
 .Sh BUGS
 The
 .Ar P
@@ -187,3 +175,16 @@ has been merged into
 .Ar P
 since
 .Nx 6.1 .
+.Ed
+.Sh SEE ALSO
+.Xr disktab 5 ,
+.Xr disklabel 8 ,
+.Xr mmcformat 8 ,
+.Xr newfs 8
+.Sh HISTORY
+The
+.Nm
+command first appeared in
+.Nx 5.0 .
+.Sh AUTHORS
+.An Reinoud Zandijk Aq Mt rein...@netbsd.org



CVS commit: src/sbin/newfs_udf

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 11:57:25 UTC 2013

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

Log Message:
Clarify volumeset name restrictions when specifying it in newfs_udf(8)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/newfs_udf/newfs_udf.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_udf/newfs_udf.8
diff -u src/sbin/newfs_udf/newfs_udf.8:1.15 src/sbin/newfs_udf/newfs_udf.8:1.16
--- src/sbin/newfs_udf/newfs_udf.8:1.15	Tue Aug  6 11:38:51 2013
+++ src/sbin/newfs_udf/newfs_udf.8	Tue Aug  6 11:57:25 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: newfs_udf.8,v 1.15 2013/08/06 11:38:51 reinoud Exp $
+.\ $NetBSD: newfs_udf.8,v 1.16 2013/08/06 11:57:25 reinoud Exp $
 .\
 .\ Copyright (c) 2008 Reinoud Zandijk
 .\ All rights reserved.
@@ -75,10 +75,12 @@ its causing problems.
 .It Fl P Ar discid
 Set the physical disc label to the specified
 .Ar discid .
+.Pp
 Prepend
 .Ar discid
 with volsetname separated with a ':' if wanted.
-For strict conformance and interchange, don't set this manually.
+For strict conformance and interchange, don't set this manually unless it has
+an unique hex number in the first 8 character positions.
 .It Fl p Ar percentage
 Percentage of partition to be initially reserved for metadata on the Metadata
 partition.



CVS commit: src/usr.sbin/makefs

2013-08-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  6 12:12:51 UTC 2013

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/makefs/makefs.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/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.49 src/usr.sbin/makefs/makefs.8:1.50
--- src/usr.sbin/makefs/makefs.8:1.49	Tue Aug  6 09:43:41 2013
+++ src/usr.sbin/makefs/makefs.8	Tue Aug  6 12:12:51 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: makefs.8,v 1.49 2013/08/06 09:43:41 reinoud Exp $
+.\	$NetBSD: makefs.8,v 1.50 2013/08/06 12:12:51 wiz Exp $
 .\
 .\ Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -411,7 +411,8 @@ create a rewritable fs on once recordabl
 create a rewritable fs with sparing for defective sectors
 .El
 When an optical media is selected here, the sectorsize and the default disc
-size is assumed unless given explicitly. For rom images the disc size is the
+size is assumed unless given explicitly.
+For rom images the disc size is the
 minimum needed.
 .El
 .Sh SEE ALSO



CVS commit: src/sbin/newfs_udf

2013-08-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  6 12:14:43 UTC 2013

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

Log Message:
Sort sections. Remove superfluous Ed.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sbin/newfs_udf/newfs_udf.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_udf/newfs_udf.8
diff -u src/sbin/newfs_udf/newfs_udf.8:1.16 src/sbin/newfs_udf/newfs_udf.8:1.17
--- src/sbin/newfs_udf/newfs_udf.8:1.16	Tue Aug  6 11:57:25 2013
+++ src/sbin/newfs_udf/newfs_udf.8	Tue Aug  6 12:14:43 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: newfs_udf.8,v 1.16 2013/08/06 11:57:25 reinoud Exp $
+.\ $NetBSD: newfs_udf.8,v 1.17 2013/08/06 12:14:43 wiz Exp $
 .\
 .\ Copyright (c) 2008 Reinoud Zandijk
 .\ All rights reserved.
@@ -165,19 +165,6 @@ native sectorsize of 512 :
 .Bd -literal -offset indent
 newfs_udf -L My USB stick /dev/rsd0d
 .Ed
-.Sh BUGS
-The
-.Ar P
-and the
-.Ar S
-arguments have changed meaning.
-The meaning of
-.Ar S
-has been merged into
-.Ar P
-since
-.Nx 6.1 .
-.Ed
 .Sh SEE ALSO
 .Xr disktab 5 ,
 .Xr disklabel 8 ,
@@ -190,3 +177,15 @@ command first appeared in
 .Nx 5.0 .
 .Sh AUTHORS
 .An Reinoud Zandijk Aq Mt rein...@netbsd.org
+.Sh BUGS
+The
+.Ar P
+and the
+.Ar S
+arguments have changed meaning.
+The meaning of
+.Ar S
+has been merged into
+.Ar P
+since
+.Nx 6.1 .



CVS commit: src/sbin/newfs_udf

2013-08-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  6 12:15:21 UTC 2013

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

Log Message:
Fix article.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sbin/newfs_udf/newfs_udf.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_udf/newfs_udf.8
diff -u src/sbin/newfs_udf/newfs_udf.8:1.17 src/sbin/newfs_udf/newfs_udf.8:1.18
--- src/sbin/newfs_udf/newfs_udf.8:1.17	Tue Aug  6 12:14:43 2013
+++ src/sbin/newfs_udf/newfs_udf.8	Tue Aug  6 12:15:20 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: newfs_udf.8,v 1.17 2013/08/06 12:14:43 wiz Exp $
+.\ $NetBSD: newfs_udf.8,v 1.18 2013/08/06 12:15:20 wiz Exp $
 .\
 .\ Copyright (c) 2008 Reinoud Zandijk
 .\ All rights reserved.
@@ -80,7 +80,7 @@ Prepend
 .Ar discid
 with volsetname separated with a ':' if wanted.
 For strict conformance and interchange, don't set this manually unless it has
-an unique hex number in the first 8 character positions.
+a unique hex number in the first 8 character positions.
 .It Fl p Ar percentage
 Percentage of partition to be initially reserved for metadata on the Metadata
 partition.



CVS commit: src/usr.sbin/makefs

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 12:19:34 UTC 2013

Modified Files:
src/usr.sbin/makefs: makefs.8 udf.c

Log Message:
Allow for the logical volume label to be specified as well as the physical
volume label. Also allow the volumeset name to be specified if desired. The
syntax follows the newfs_udf(8) syntax.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/makefs/udf.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/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.50 src/usr.sbin/makefs/makefs.8:1.51
--- src/usr.sbin/makefs/makefs.8:1.50	Tue Aug  6 12:12:51 2013
+++ src/usr.sbin/makefs/makefs.8	Tue Aug  6 12:19:34 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: makefs.8,v 1.50 2013/08/06 12:12:51 wiz Exp $
+.\	$NetBSD: makefs.8,v 1.51 2013/08/06 12:19:34 reinoud Exp $
 .\
 .\ Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -397,10 +397,11 @@ Each of the options consists of a keywor
 .Pq Ql = ,
 and a value.
 The following keywords are supported:
+.Pp
 .Bl -tag -width optimization -compact
 .It Sy disctype
 This can have the following values:
-.Bl -tag -width dvdramXbdreXdiskXXX -compact
+.Bl -tag -width cdromXdvdromXbdromXXX -compact
 .It Sy cdrom , Sy dvdrom , Sy bdrom
 create a read-only fs
 .It Sy dvdram , Sy bdre , Sy disk
@@ -412,9 +413,17 @@ create a rewritable fs with sparing for 
 .El
 When an optical media is selected here, the sectorsize and the default disc
 size is assumed unless given explicitly.
-For rom images the disc size is the
-minimum needed.
+For rom images the disc size is the minimum needed.
 .El
+.Bl -tag -width optimization -compact
+.It Sy loglabel
+Set the logical volume label of the disc to the specified argument.
+.It Sy discid
+Set the physical volume label of the disc to the specified argument. Prepend
+the physical volume label with a volumeset label separated with a ':' if
+wanted. For strict conformance and interchange, don't set the volumeset label
+manually unless it has an unique hex number in the first 8 character
+positions.
 .Sh SEE ALSO
 .Xr strsuftoll 3 ,
 .Xr installboot 8 ,

Index: src/usr.sbin/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.7 src/usr.sbin/makefs/udf.c:1.8
--- src/usr.sbin/makefs/udf.c:1.7	Tue Aug  6 09:32:23 2013
+++ src/usr.sbin/makefs/udf.c	Tue Aug  6 12:19:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.7 2013/08/06 09:32:23 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.8 2013/08/06 12:19:34 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf.c,v 1.7 2013/08/06 09:32:23 reinoud Exp $);
+__RCSID($NetBSD: udf.c,v 1.8 2013/08/06 12:19:34 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -288,9 +288,11 @@ udf_prep_opts(fsinfo_t *fsopts)
 	time_t now;
 
 	const option_t udf_options[] = {
-		OPT_STR('T', disctype, disc type (cdrom,dvdrom,bdrom,dvdram,bdre,disk,cdr,dvdr,bdr,cdrw,dvdrw)),
-//		{ 'P', progress, display_progressbar, OPT_INT32, false, true,
-//		  display progress bar },
+		OPT_STR('T', disctype, disc type (cdrom,dvdrom,bdrom,
+			dvdram,bdre,disk,cdr,dvdr,bdr,cdrw,dvdrw)),
+		OPT_STR('L', loglabel, \logical volume name\),
+		OPT_STR('P', discid,   [\volset name\':']
+			\physical volume name\),
 		{ .name = NULL }
 	};
 
@@ -347,7 +349,7 @@ udf_parse_opts(const char *option, fsinf
 	uint64_t stdsize;
 	uint32_t set_sectorsize;
 	const char *name, *desc;
-	char buf[1024];
+	char buffer[1024], *buf, *colon;
 	int i;
 
 	assert(option != NULL);
@@ -355,7 +357,7 @@ udf_parse_opts(const char *option, fsinf
 	if (debug  DEBUG_FS_PARSE_OPTS)
 		printf(udf_parse_opts: got `%s'\n, option);
 
-	i = set_option(udf_options, option, buf, sizeof(buf));
+	i = set_option(udf_options, option, buffer, sizeof(buffer));
 	if (i == -1)
 		return 0;
 
@@ -365,6 +367,7 @@ udf_parse_opts(const char *option, fsinf
 	set_sectorsize = 0;
 	stdsize = 0;
 
+	buf = buffer;
 	name = udf_options[i].name;
 	desc = udf_options[i].desc;
 	switch (udf_options[i].letter) {
@@ -404,6 +407,27 @@ udf_parse_opts(const char *option, fsinf
 		}
 		if (mmc_profile != 0x01)
 			set_sectorsize = 2048;
+		break;
+	case 'L':
+		if (context.logvol_name) free(context.logvol_name);
+		context.logvol_name = strdup(buf);
+		break;
+	case 'P':
+		if ((colon = strstr(buf, :))) {
+			if (context.volset_name)
+free(context.volset_name);
+			*colon = 0;
+			context.volset_name = strdup(buf);
+			buf = colon+1;
+		}
+		if (context.primary_name)
+			free(context.primary_name);
+		if ((strstr(buf, :))) {
+			perror(primary name can't have ':' in its name);
+			return 0;
+		}
+		context.primary_name = strdup(buf);
+		break;
 	}
 	if (set_sectorsize)
 		fsopts-sectorsize = set_sectorsize;



CVS commit: src/usr.sbin/makefs

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 12:47:21 UTC 2013

Modified Files:
src/usr.sbin/makefs: makefs.8 udf.c

Log Message:
Add minimum UDF version specification to makefs(8) -t udf.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/makefs/udf.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/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.51 src/usr.sbin/makefs/makefs.8:1.52
--- src/usr.sbin/makefs/makefs.8:1.51	Tue Aug  6 12:19:34 2013
+++ src/usr.sbin/makefs/makefs.8	Tue Aug  6 12:47:21 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: makefs.8,v 1.51 2013/08/06 12:19:34 reinoud Exp $
+.\	$NetBSD: makefs.8,v 1.52 2013/08/06 12:47:21 reinoud Exp $
 .\
 .\ Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -424,6 +424,11 @@ the physical volume label with a volumes
 wanted. For strict conformance and interchange, don't set the volumeset label
 manually unless it has an unique hex number in the first 8 character
 positions.
+.It Sy minver
+Set the minimum UDF version to be used. Choose UDF version numbers from 0x102,
+0x150, 0x200, and 0x201. Versions 0x250 and 0x260 are currently not supported
+in
+.Nm .
 .Sh SEE ALSO
 .Xr strsuftoll 3 ,
 .Xr installboot 8 ,

Index: src/usr.sbin/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.8 src/usr.sbin/makefs/udf.c:1.9
--- src/usr.sbin/makefs/udf.c:1.8	Tue Aug  6 12:19:34 2013
+++ src/usr.sbin/makefs/udf.c	Tue Aug  6 12:47:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.8 2013/08/06 12:19:34 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.9 2013/08/06 12:47:21 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf.c,v 1.8 2013/08/06 12:19:34 reinoud Exp $);
+__RCSID($NetBSD: udf.c,v 1.9 2013/08/06 12:47:21 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -97,7 +97,7 @@ udf_write_sector(void *sector, uint32_t 
 	ret = pwrite(fd, sector, context.sector_size, wpos);
 	if (ret == -1)
 		return errno;
-	if (ret  context.sector_size)
+	if (ret  (int) context.sector_size)
 		return EIO;
 	return 0;
 }
@@ -272,10 +272,10 @@ udf_update_trackinfo(struct mmc_discinfo
 	{ letter, name, NULL, OPT_STRBUF, 0, 0, desc }
 
 #define OPT_NUM(letter, name, field, min, max, desc) \
-	{ letter, name, diskStructure-field, \
-	  sizeof(diskStructure-field) == 8 ? OPT_INT64 : \
-	  (sizeof(diskStructure-field) == 4 ? OPT_INT32 : \
-	  (sizeof(diskStructure-field) == 2 ? OPT_INT16 : OPT_INT8)), \
+	{ letter, name, context.field, \
+	  sizeof(context.field) == 8 ? OPT_INT64 : \
+	  (sizeof(context.field) == 4 ? OPT_INT32 : \
+	  (sizeof(context.field) == 2 ? OPT_INT16 : OPT_INT8)), \
 	  min, max, desc }
 
 #define OPT_BOOL(letter, name, field, desc) \
@@ -291,8 +291,15 @@ udf_prep_opts(fsinfo_t *fsopts)
 		OPT_STR('T', disctype, disc type (cdrom,dvdrom,bdrom,
 			dvdram,bdre,disk,cdr,dvdr,bdr,cdrw,dvdrw)),
 		OPT_STR('L', loglabel, \logical volume name\),
-		OPT_STR('P', discid,   [\volset name\':']
-			\physical volume name\),
+		OPT_STR('P', discid,   \[volset name ':']
+			physical volume name\),
+		OPT_NUM('t', tz, gmtoff, -24, 24, timezone),
+		OPT_STR('v', minver, minimum UDF version in either 
+			``0x201'' or ``2.01'' format),
+#if notyet
+		OPT_STR('V', maxver, maximum UDF version in either 
+			``0x201'' or ``2.01'' format),
+#endif
 		{ .name = NULL }
 	};
 
@@ -314,7 +321,7 @@ udf_prep_opts(fsinfo_t *fsopts)
 
 	/* minimum and maximum UDF versions we advise */
 	context.min_udf = 0x102;
-	context.max_udf = 0x201;
+	context.max_udf = 0x201;	/* 0x250 and 0x260 are not ready */
 
 	/* use user's time zone as default */
 	(void)time(now);
@@ -334,6 +341,10 @@ udf_cleanup_opts(fsinfo_t *fsopts)
 }
 
 
+/* - included from newfs_udf.c -- */
+/* - */
+
+
 #define CDRSIZE((uint64_t)   700*1024*1024)	/* small approx */
 #define CDRWSIZE   ((uint64_t)   576*1024*1024)	/* small approx */
 #define DVDRSIZE   ((uint64_t)  4488*1024*1024)	/* small approx */
@@ -341,7 +352,6 @@ udf_cleanup_opts(fsinfo_t *fsopts)
 #define DVDRWSIZE  ((uint64_t)  4482*1024*1024)	/* small approx */
 #define BDRSIZE((uint64_t) 23866*1024*1024)	/* small approx */
 #define BDRESIZE   ((uint64_t) 23098*1024*1024)	/* small approx */
-
 int
 udf_parse_opts(const char *option, fsinfo_t *fsopts)
 {
@@ -423,11 +433,20 @@ udf_parse_opts(const char *option, fsinf
 		if (context.primary_name)
 			free(context.primary_name);
 		if ((strstr(buf, :))) {
-			perror(primary name can't have ':' in its name);
+			errx(EINVAL, primary name can't have ':' in its name);
 			return 0;
 		}
 		context.primary_name = strdup(buf);
 		break;
+	case 'v':
+		context.min_udf = a_udf_version(buf, min_udf);
+		if (context.min_udf  0x201) {
+			errx(EINVAL, maximum supported version is UDF 2.01);
+			return 

CVS commit: src/sbin/newfs_udf

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 12:49:13 UTC 2013

Modified Files:
src/sbin/newfs_udf: newfs_udf.c udf_create.c udf_create.h

Log Message:
Oops, forgot to export a_udf_version() that checks if the input string is a
valid UDF version notation.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/newfs_udf/newfs_udf.c
cvs rdiff -u -r1.20 -r1.21 src/sbin/newfs_udf/udf_create.c
cvs rdiff -u -r1.5 -r1.6 src/sbin/newfs_udf/udf_create.h

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_udf/newfs_udf.c
diff -u src/sbin/newfs_udf/newfs_udf.c:1.15 src/sbin/newfs_udf/newfs_udf.c:1.16
--- src/sbin/newfs_udf/newfs_udf.c:1.15	Mon Aug  5 14:11:30 2013
+++ src/sbin/newfs_udf/newfs_udf.c	Tue Aug  6 12:49:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs_udf.c,v 1.15 2013/08/05 14:11:30 reinoud Exp $ */
+/* $NetBSD: newfs_udf.c,v 1.16 2013/08/06 12:49:13 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -635,62 +635,7 @@ udf_do_newfs(void)
 	return error;
 }
 
-/* - */
-
-
-/* version can be specified as 0xabc or a.bc */
-static int
-parse_udfversion(const char *pos, uint32_t *version) {
-	int hex = 0;
-	char c1, c2, c3, c4;
-
-	*version = 0;
-	if (*pos == '0') {
-		pos++;
-		/* expect hex format */
-		hex = 1;
-		if (*pos++ != 'x')
-			return 1;
-	}
-
-	c1 = *pos++;
-	if (c1  '0' || c1  '9')
-		return 1;
-	c1 -= '0';
-
-	c2 = *pos++;
-	if (!hex) {
-		if (c2 != '.')
-			return 1;
-		c2 = *pos++;
-	}
-	if (c2  '0' || c2  '9')
-		return 1;
-	c2 -= '0';
-
-	c3 = *pos++;
-	if (c3  '0' || c3  '9')
-		return 1;
-	c3 -= '0';
-
-	c4 = *pos++;
-	if (c4 != 0)
-		return 1;
-
-	*version = c1 * 0x100 + c2 * 0x10 + c3;
-	return 0;
-}
-
-
-static int
-a_udf_version(const char *s, const char *id_type)
-{
-	uint32_t version;
 
-	if (parse_udfversion(s, version))
-		errx(1, unknown %s id %s; specify as hex or float, id_type, s);
-	return version;
-}
 
 /* - */
 

Index: src/sbin/newfs_udf/udf_create.c
diff -u src/sbin/newfs_udf/udf_create.c:1.20 src/sbin/newfs_udf/udf_create.c:1.21
--- src/sbin/newfs_udf/udf_create.c:1.20	Mon Aug  5 17:12:04 2013
+++ src/sbin/newfs_udf/udf_create.c	Tue Aug  6 12:49:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_create.c,v 1.20 2013/08/05 17:12:04 joerg Exp $ */
+/* $NetBSD: udf_create.c,v 1.21 2013/08/06 12:49:13 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf_create.c,v 1.20 2013/08/05 17:12:04 joerg Exp $);
+__RCSID($NetBSD: udf_create.c,v 1.21 2013/08/06 12:49:13 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -103,6 +103,62 @@ udf_init_create_context(void)
 }
 
 
+/* version can be specified as 0xabc or a.bc */
+static int
+parse_udfversion(const char *pos, uint32_t *version) {
+	int hex = 0;
+	char c1, c2, c3, c4;
+
+	*version = 0;
+	if (*pos == '0') {
+		pos++;
+		/* expect hex format */
+		hex = 1;
+		if (*pos++ != 'x')
+			return 1;
+	}
+
+	c1 = *pos++;
+	if (c1  '0' || c1  '9')
+		return 1;
+	c1 -= '0';
+
+	c2 = *pos++;
+	if (!hex) {
+		if (c2 != '.')
+			return 1;
+		c2 = *pos++;
+	}
+	if (c2  '0' || c2  '9')
+		return 1;
+	c2 -= '0';
+
+	c3 = *pos++;
+	if (c3  '0' || c3  '9')
+		return 1;
+	c3 -= '0';
+
+	c4 = *pos++;
+	if (c4 != 0)
+		return 1;
+
+	*version = c1 * 0x100 + c2 * 0x10 + c3;
+	return 0;
+}
+
+
+/* parse a given string for an udf version */
+int
+a_udf_version(const char *s, const char *id_type)
+{
+	uint32_t version;
+
+	if (parse_udfversion(s, version))
+		errx(1, unknown %s id %s; specify as hex or float, id_type, s);
+	return version;
+}
+
+
 static uint32_t
 udf_space_bitmap_len(uint32_t part_size)
 {

Index: src/sbin/newfs_udf/udf_create.h
diff -u src/sbin/newfs_udf/udf_create.h:1.5 src/sbin/newfs_udf/udf_create.h:1.6
--- src/sbin/newfs_udf/udf_create.h:1.5	Mon Aug  5 17:12:04 2013
+++ src/sbin/newfs_udf/udf_create.h	Tue Aug  6 12:49:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_create.h,v 1.5 2013/08/05 17:12:04 joerg Exp $ */
+/* $NetBSD: udf_create.h,v 1.6 2013/08/06 12:49:13 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -216,6 +216,8 @@ extern struct udf_disclayout layout;
 
 /* prototypes */
 void udf_init_create_context(void);
+int a_udf_version(const char *s, const char *id_type);
+
 int udf_calculate_disc_layout(int format_flags, int min_udf,
 	uint32_t wrtrack_skew,
 	uint32_t first_lba, uint32_t last_lba,



CVS commit: src

2013-08-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Aug  6 13:15:30 UTC 2013

Modified Files:
src/sbin/newfs_udf: newfs_udf.c newfs_udf.h udf_create.c
src/usr.sbin/makefs: udf.c

Log Message:
Switch back program version to the version of the newfs_udf/makefs code.

While here, visit the 80 columns police :)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sbin/newfs_udf/newfs_udf.c
cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_udf/newfs_udf.h
cvs rdiff -u -r1.21 -r1.22 src/sbin/newfs_udf/udf_create.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/makefs/udf.c

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

Modified files:

Index: src/sbin/newfs_udf/newfs_udf.c
diff -u src/sbin/newfs_udf/newfs_udf.c:1.16 src/sbin/newfs_udf/newfs_udf.c:1.17
--- src/sbin/newfs_udf/newfs_udf.c:1.16	Tue Aug  6 12:49:13 2013
+++ src/sbin/newfs_udf/newfs_udf.c	Tue Aug  6 13:15:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs_udf.c,v 1.16 2013/08/06 12:49:13 reinoud Exp $ */
+/* $NetBSD: newfs_udf.c,v 1.17 2013/08/06 13:15:30 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -674,10 +674,10 @@ main(int argc, char **argv)
 
 	srandom((unsigned long) time(NULL));
 	udf_init_create_context();
-	context.app_name  = APP_NAME;
-	context.impl_name = IMPL_NAME;
+	context.app_name = *NetBSD newfs;
 	context.app_version_main = APP_VERSION_MAIN;
 	context.app_version_sub  = APP_VERSION_SUB;
+	context.impl_name= IMPL_NAME;
 
 	/* minimum and maximum UDF versions we advise */
 	context.min_udf = 0x201;

Index: src/sbin/newfs_udf/newfs_udf.h
diff -u src/sbin/newfs_udf/newfs_udf.h:1.3 src/sbin/newfs_udf/newfs_udf.h:1.4
--- src/sbin/newfs_udf/newfs_udf.h:1.3	Mon Aug  5 20:52:08 2013
+++ src/sbin/newfs_udf/newfs_udf.h	Tue Aug  6 13:15:30 2013
@@ -32,21 +32,20 @@
 #define UDF_META_PERC  20	/* picked */
 
 /* Identifying myself */
-#define APP_NAME		*NetBSD newfs
 #define APP_VERSION_MAIN	0
-#define APP_VERSION_SUB		4
+#define APP_VERSION_SUB		5
 #define IMPL_NAME		*NetBSD userland UDF
 
 
 /* global variables describing disc and format requests */
-extern int	 fd;/* device: file descriptor */
-extern char	*dev;/* device: name		   */
-extern struct mmc_discinfo mmc_discinfo;	/* device: disc info	   */
-
-extern char	*format_str;			/* format: string representation */
-extern int	 format_flags;			/* format: attribute flags	 */
-extern int	 media_accesstype;		/* derived from current mmc cap  */
-extern int	 check_surface;			/* for rewritables   */
+extern int	 fd;			/* device: file descriptor */
+extern char	*dev;			/* device: name		   */
+extern struct mmc_discinfo mmc_discinfo;/* device: disc info	   */
+
+extern char	*format_str;		/* format: string representation */
+extern int	 format_flags;		/* format: attribute flags	 */
+extern int	 media_accesstype;	/* derived from current mmc cap  */
+extern int	 check_surface;		/* for rewritables   */
 
 extern int	 wrtrack_skew;
 extern int	 meta_perc;

Index: src/sbin/newfs_udf/udf_create.c
diff -u src/sbin/newfs_udf/udf_create.c:1.21 src/sbin/newfs_udf/udf_create.c:1.22
--- src/sbin/newfs_udf/udf_create.c:1.21	Tue Aug  6 12:49:13 2013
+++ src/sbin/newfs_udf/udf_create.c	Tue Aug  6 13:15:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_create.c,v 1.21 2013/08/06 12:49:13 reinoud Exp $ */
+/* $NetBSD: udf_create.c,v 1.22 2013/08/06 13:15:30 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf_create.c,v 1.21 2013/08/06 12:49:13 reinoud Exp $);
+__RCSID($NetBSD: udf_create.c,v 1.22 2013/08/06 13:15:30 reinoud Exp $);
 
 #include stdio.h
 #include stdlib.h
@@ -77,16 +77,11 @@ udf_init_create_context(void)
 	context.volset_name  = NULL;
 	context.fileset_name = NULL;
 
-#ifdef __NetBSD_Version__
-	context.app_name	  = *NetBSD newfs;
-	context.app_version_main =  __NetBSD_Version__ / 1;
-	context.app_version_sub  = (__NetBSD_Version__ / 100) % 100;
-#else
-	context.app_name	  = *NetBSD makefs;
+	/* most basic identification */
+	context.app_name	 = *NetBSD;
 	context.app_version_main = 0;
 	context.app_version_sub  = 0;
-#endif
-	context.impl_name= *NetBSD kernel UDF;
+	context.impl_name= *NetBSD;
 
 	context.vds_seq = 0;		/* first one starts with zero */
 

Index: src/usr.sbin/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.9 src/usr.sbin/makefs/udf.c:1.10
--- src/usr.sbin/makefs/udf.c:1.9	Tue Aug  6 12:47:21 2013
+++ src/usr.sbin/makefs/udf.c	Tue Aug  6 13:15:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.9 2013/08/06 12:47:21 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.10 2013/08/06 13:15:30 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: udf.c,v 1.9 2013/08/06 12:47:21 reinoud Exp $);
+__RCSID($NetBSD: udf.c,v 1.10 2013/08/06 13:15:30 reinoud Exp 

CVS commit: src/sys/dev/i2c

2013-08-06 Thread Soren S. Jorvang
Module Name:src
Committed By:   soren
Date:   Tue Aug  6 15:58:25 UTC 2013

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: w83795g.c w83795greg.h

Log Message:
Add driver for Nuvoton W83795G voltage/temp/fan/gpio monitoring device.

As used in the HP Microserver N36L/N40L/N54L:

w83795g* at iic? addr 0x2f
gpio* at gpiobus?

Note that the gpio and watchdog functionality appears to be useless on
the Microserver, as the gpio pins don't affect the LED's and a watchdog
trigger does not cause a reset. Perhaps the reset pin just isn't wired.

There are quite flexible fan control options as well as just monitoring,
but it is not clear to me how best to export that function to userspace.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/w83795g.c src/sys/dev/i2c/w83795greg.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/dev/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.49 src/sys/dev/i2c/files.i2c:1.50
--- src/sys/dev/i2c/files.i2c:1.49	Mon May  6 22:04:12 2013
+++ src/sys/dev/i2c/files.i2c	Tue Aug  6 15:58:25 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.49 2013/05/06 22:04:12 rkujawa Exp $
+#	$NetBSD: files.i2c,v 1.50 2013/08/06 15:58:25 soren Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -187,3 +187,7 @@ device	mcp980x: sysmon_envsys
 attach	mcp980x at iic
 file	dev/i2c/mcp980x.c 		mcp980x
 
+# Nuvoton W83795G/ADG Hardware Monitor
+device	w83795g: gpiobus, sysmon_envsys, sysmon_wdog
+attach	w83795g at iic
+file	dev/i2c/w83795g.c 		w83795g

Added files:

Index: src/sys/dev/i2c/w83795g.c
diff -u /dev/null src/sys/dev/i2c/w83795g.c:1.1
--- /dev/null	Tue Aug  6 15:58:25 2013
+++ src/sys/dev/i2c/w83795g.c	Tue Aug  6 15:58:25 2013
@@ -0,0 +1,452 @@
+/*	$NetBSD: w83795g.c,v 1.1 2013/08/06 15:58:25 soren Exp $	*/
+
+/*
+ * Copyright (c) 2013 Soren S. Jorvang.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions, and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: w83795g.c,v 1.1 2013/08/06 15:58:25 soren Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/device.h
+#include sys/conf.h
+#include sys/gpio.h
+#include sys/wdog.h
+
+#include dev/i2c/i2cvar.h
+#include dev/gpio/gpiovar.h
+#include dev/sysmon/sysmonvar.h
+
+#include dev/i2c/w83795greg.h
+
+#define NUM_SENSORS 53
+static const struct w83795g_sensor {
+	const char *desc;
+	enum envsys_units type;
+	uint8_t en_reg;
+	uint8_t en_mask;
+	uint8_t en_bits;
+	uint8_t msb;
+} sensors[NUM_SENSORS] = {
+#define _VOLT ENVSYS_SVOLTS_DC
+	{ VSEN1,   _VOLT, W83795G_V_CTRL1, 0x01, 0x01, W83795G_VSEN1 },
+	{ VSEN2,   _VOLT, W83795G_V_CTRL1, 0x02, 0x02, W83795G_VSEN2 },
+	{ VSEN3,   _VOLT, W83795G_V_CTRL1, 0x04, 0x04, W83795G_VSEN3 },
+	{ VSEN4,   _VOLT, W83795G_V_CTRL1, 0x08, 0x08, W83795G_VSEN4 },
+	{ VSEN5,   _VOLT, W83795G_V_CTRL1, 0x10, 0x10, W83795G_VSEN5 },
+	{ VSEN6,   _VOLT, W83795G_V_CTRL1, 0x20, 0x20, W83795G_VSEN6 },
+	{ VSEN7,   _VOLT, W83795G_V_CTRL1, 0x40, 0x40, W83795G_VSEN7 },
+	{ VSEN8,   _VOLT, W83795G_V_CTRL1, 0x80, 0x80, W83795G_VSEN8 },
+	{ VSEN9,   _VOLT, W83795G_V_CTRL2, 0x01, 0x01, W83795G_VSEN9 },
+	{ VSEN10,  _VOLT, W83795G_V_CTRL2, 0x02, 0x02, W83795G_VSEN10 },
+	{ VSEN11,  _VOLT, W83795G_V_CTRL2, 0x04, 0x04, W83795G_VSEN11 },
+	{ VTT, _VOLT, W83795G_V_CTRL2, 0x08, 0x08, W83795G_VTT },
+	{ 3VDD,_VOLT, W83795G_V_CTRL2, 0x10, 0x10, W83795G_3VDD },
+	{ 3VSB,_VOLT, W83795G_V_CTRL2, 0x20, 0x20, W83795G_3VSB },
+	{ VBAT,_VOLT, W83795G_V_CTRL2, 0x40, 0x40, W83795G_VBAT },
+	{ VSEN12,  _VOLT, 

CVS commit: src/share/man/man4

2013-08-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  6 16:54:46 UTC 2013

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

Log Message:
Improve wording.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/share/man/man4/hdaudio.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/hdaudio.4
diff -u src/share/man/man4/hdaudio.4:1.12 src/share/man/man4/hdaudio.4:1.13
--- src/share/man/man4/hdaudio.4:1.12	Sat Jul 20 21:39:58 2013
+++ src/share/man/man4/hdaudio.4	Tue Aug  6 16:54:46 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: hdaudio.4,v 1.12 2013/07/20 21:39:58 wiz Exp $
+.\	$NetBSD: hdaudio.4,v 1.13 2013/08/06 16:54:46 snj Exp $
 .\
 .\ Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -89,7 +89,7 @@ By following the published mechanisms fo
 parsing, it is expected that nearly all High Definition Audio devices will
 be supported without requiring per-device quirks.
 .Sh HARDWARE
-Except for very many on-board sound cards included in mainboards, the following
+In addition to many on-board sound cards included in mainboards, the following
 add-on card is supported:
 .Bl -tag
 .It TerraTec Aureon 7.1 PCIe



CVS commit: src/share/man/man4

2013-08-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  6 17:32:30 UTC 2013

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

Log Message:
non-existant is a nonexistent word.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/adb.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/adb.4
diff -u src/share/man/man4/adb.4:1.2 src/share/man/man4/adb.4:1.3
--- src/share/man/man4/adb.4:1.2	Sun Dec 14 18:08:43 2003
+++ src/share/man/man4/adb.4	Tue Aug  6 17:32:30 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: adb.4,v 1.2 2003/12/14 18:08:43 wiz Exp $
+.\	$NetBSD: adb.4,v 1.3 2013/08/06 17:32:30 snj Exp $
 .\
 .\ Copyright (c) 2003 Alex Zepeda zipzi...@sonic.net
 .\ Copyright (c) 1997 Colin Wood
@@ -255,7 +255,7 @@ An extended keyboard is attached to the 
 On (some) machines with dirty ROM, the ROM indicates the presence of a
 .Dq ghost
 keyboard or mouse.
-When this non-existant device is probed for, the result is an infinite
+When this nonexistent device is probed for, the result is an infinite
 loop.
 This is believed to be triggered by the
 .Nm



CVS commit: src/share/man/man4

2013-08-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  6 17:33:29 UTC 2013

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

Log Message:
Add a comma and fix a spelling error.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/ataraid.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/ataraid.4
diff -u src/share/man/man4/ataraid.4:1.14 src/share/man/man4/ataraid.4:1.15
--- src/share/man/man4/ataraid.4:1.14	Tue Sep 16 11:45:30 2008
+++ src/share/man/man4/ataraid.4	Tue Aug  6 17:33:29 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: ataraid.4,v 1.14 2008/09/16 11:45:30 tron Exp $
+.\	$NetBSD: ataraid.4,v 1.15 2013/08/06 17:33:29 snj Exp $
 .\
 .\ Copyright (c) 2005 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -62,7 +62,7 @@ Promise FastTrak
 Via V-RAID (found in many VIA-based motherboards)
 .El
 .Pp
-Status of the logical disk as well as the disks associated with it,
+Status of the logical disk, as well as the disks associated with it,
 can be viewed through the
 .Xr bioctl 8
 utility.
@@ -90,5 +90,5 @@ should be in a
 .Dq building
 state, and it does not do the right thing.
 .Pp
-At least part of the reason for this is that the publically-available
+At least part of the reason for this is that the publicly-available
 information on these formats is quite limited.



CVS commit: src/etc/etc.evbarm

2013-08-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug  6 17:53:55 UTC 2013

Modified Files:
src/etc/etc.evbarm: Makefile.inc

Log Message:
Need to separate BE MACHINE_ARCH so that armv7 can be excluded.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/etc/etc.evbarm/Makefile.inc

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

Modified files:

Index: src/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.53 src/etc/etc.evbarm/Makefile.inc:1.54
--- src/etc/etc.evbarm/Makefile.inc:1.53	Tue Aug  6 05:57:37 2013
+++ src/etc/etc.evbarm/Makefile.inc	Tue Aug  6 17:53:55 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.53 2013/08/06 05:57:37 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.54 2013/08/06 17:53:55 matt Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -97,14 +97,24 @@ __mkimage: .USE
 	${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz
 
 ARCHES.arm=		armv4 xscale armv5t armv6 armv7
+ARCHES.armeb=		armv4 xscale armv5t armv6
 ARCHES.earm=		xscale armv5t armv6 armv7
+ARCHES.earmeb=		xscale armv5t armv6
 ARCHES.earmhf=		armv6hf armv7hf
+ARCHES.earmhfeb=	armv6hf
 ARCHES.earmv4=		armv4
+ARCHES.earmv4eb=	armv4
+ARCHES.earmv5=		xscale armv5t
+ARCHES.earmv5eb=	xscale armv5t
 ARCHES.earmv6=		armv6
 ARCHES.earmv6hf=	armv6hf
+ARCHES.earmv6eb=	armv6
+ARCHES.earmv6hfeb=	armv6hf
 ARCHES.earmv7=		armv7
 ARCHES.earmv7hf=	armv7hf
-.for arch in ${ARCHES.${MACHINE_ARCH:S/eb//}}
+ARCHES.earmv7eb=	armv7
+ARCHES.earmv7hfeb=	armv7hf
+.for arch in ${ARCHES.${MACHINE_ARCH}}
 .for board in ${EVBARM_BOARDS.${arch}}
 KERNEL_SETS+=		${board}
 BUILD_KERNELS+=		${board}_INSTALL



CVS commit: src/share/man/man4

2013-08-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  6 19:02:57 UTC 2013

Modified Files:
src/share/man/man4: bge.4 flash.4 g760a.4 iee.4 malo.4 uyurex.4

Log Message:
Fix spelling.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/bge.4
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/flash.4 src/share/man/man4/malo.4 \
src/share/man/man4/uyurex.4
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/g760a.4
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/iee.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/bge.4
diff -u src/share/man/man4/bge.4:1.14 src/share/man/man4/bge.4:1.15
--- src/share/man/man4/bge.4:1.14	Thu Jul  4 09:39:48 2013
+++ src/share/man/man4/bge.4	Tue Aug  6 19:02:57 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: bge.4,v 1.14 2013/07/04 09:39:48 wiz Exp $
+.\	$NetBSD: bge.4,v 1.15 2013/08/06 19:02:57 snj Exp $
 .\
 .\ Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -146,7 +146,7 @@ with the
 control.
 A value of 1 yields a
 .Nm
-interrrupt for every two full-sized Ethernet frames.
+interrupt for every two full-sized Ethernet frames.
 Each increment of the value will, roughly, halve receive interrupt rate,
 up to a maximum of 5, which interrupts about every 30 to 40 full-sized
 TCP segments.

Index: src/share/man/man4/flash.4
diff -u src/share/man/man4/flash.4:1.4 src/share/man/man4/flash.4:1.5
--- src/share/man/man4/flash.4:1.4	Sat Jul 20 21:39:58 2013
+++ src/share/man/man4/flash.4	Tue Aug  6 19:02:57 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: flash.4,v 1.4 2013/07/20 21:39:58 wiz Exp $
+.\	$NetBSD: flash.4,v 1.5 2013/08/06 19:02:57 snj Exp $
 .\
 .\ Copyright (c) 2010 Department of Software Engineering,
 .\		  University of Szeged, Hungary
@@ -56,7 +56,7 @@ This command dumps a block.
 .It Dv FLASH_ERASE_BLOCK (struct flash_erase_params)
 This command erases one or more blocks.
 .It Dv FLASH_GET_INFO (struct flash_info_params)
-This command aquires information aboout the flash device.
+This command acquires information about the flash device.
 .El
 .Sh FILES
 .Bl -tag -width /dev/flash -compact
Index: src/share/man/man4/malo.4
diff -u src/share/man/man4/malo.4:1.4 src/share/man/man4/malo.4:1.5
--- src/share/man/man4/malo.4:1.4	Sat Jul 20 21:39:58 2013
+++ src/share/man/man4/malo.4	Tue Aug  6 19:02:57 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: malo.4,v 1.4 2013/07/20 21:39:58 wiz Exp $
+.\ $NetBSD: malo.4,v 1.5 2013/08/06 19:02:57 snj Exp $
 .\	$OpenBSD: malo.4,v 1.35 2010/11/01 17:59:09 jmc Exp $
 .\
 .\ Copyright (c) 2006 Theo de Raadt.
@@ -173,7 +173,7 @@ driver was first written by
 .An Claudio Jeker Aq Mt clau...@openbsd.org
 and
 .An Marcus Glocker Aq Mt mgloc...@openbsd.org
-and apparead first in
+and appearead first in
 .Ox 4.1 .
 .Nx
 porting was done by
Index: src/share/man/man4/uyurex.4
diff -u src/share/man/man4/uyurex.4:1.4 src/share/man/man4/uyurex.4:1.5
--- src/share/man/man4/uyurex.4:1.4	Sat Jul 20 21:39:58 2013
+++ src/share/man/man4/uyurex.4	Tue Aug  6 19:02:57 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: uyurex.4,v 1.4 2013/07/20 21:39:58 wiz Exp $
+.\	$NetBSD: uyurex.4,v 1.5 2013/08/06 19:02:57 snj Exp $
 .\	$OpenBSD: uyurex.4,v 1.2 2010/03/01 09:36:24 jmc Exp $
 .\
 .\ Copyright (c) 2010 Yojiro UO y...@nui.org
@@ -33,7 +33,7 @@ made available through the
 .Xr envstat 8
 command.
 The counter unit for twitch is BBU (BinBo-YUsuri or
-Bounding Body from Unconciousness) and the unit for BBU speed
+Bounding Body from Unconsciousness) and the unit for BBU speed
 is mBBU/sec (milli BBU per second).
 .Sh SEE ALSO
 .Xr envsys 4 ,

Index: src/share/man/man4/g760a.4
diff -u src/share/man/man4/g760a.4:1.2 src/share/man/man4/g760a.4:1.3
--- src/share/man/man4/g760a.4:1.2	Sat Oct  2 09:18:57 2010
+++ src/share/man/man4/g760a.4	Tue Aug  6 19:02:57 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: g760a.4,v 1.2 2010/10/02 09:18:57 wiz Exp $
+.\ $NetBSD: g760a.4,v 1.3 2013/08/06 19:02:57 snj Exp $
 .\
 .\ Copyright (c) 2008 A.Leo.
 .\ All rights reserved.
@@ -59,7 +59,7 @@ Valid range is 2000..2 or 0 (the fan
 The default value is 0.
 .Pp
 When setting the desired speed the RPM number will be converted
-to the internal represenation and truncated.
+to the internal representation and truncated.
 For example when you are setting 2000 it will be truncated to 2006,
 and 8000 will be changed to 8057.
 .El

Index: src/share/man/man4/iee.4
diff -u src/share/man/man4/iee.4:1.5 src/share/man/man4/iee.4:1.6
--- src/share/man/man4/iee.4:1.5	Wed May 27 19:23:59 2009
+++ src/share/man/man4/iee.4	Tue Aug  6 19:02:57 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: iee.4,v 1.5 2009/05/27 19:23:59 snj Exp $
+.\	$NetBSD: iee.4,v 1.6 2013/08/06 19:02:57 snj Exp $
 .\ Copyright (c) 2002 Jochen Kunz.
 .\ All rights reserved.
 .\
@@ -95,7 +95,7 @@ Many frames where received under high lo
 was to small to store them all.
 Frame reception was restarted from scratch.
 Most likely there where 

CVS commit: src

2013-08-06 Thread Soren S. Jorvang
Module Name:src
Committed By:   soren
Date:   Tue Aug  6 19:13:13 UTC 2013

Modified Files:
src/sbin/atactl: atactl.c
src/sys/dev/ata: wd.c

Log Message:
TRIM showed up sometime between ATA-7 and ATA-8.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sbin/atactl/atactl.c
cvs rdiff -u -r1.403 -r1.404 src/sys/dev/ata/wd.c

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

Modified files:

Index: src/sbin/atactl/atactl.c
diff -u src/sbin/atactl/atactl.c:1.70 src/sbin/atactl/atactl.c:1.71
--- src/sbin/atactl/atactl.c:1.70	Sat Aug  3 18:35:31 2013
+++ src/sbin/atactl/atactl.c	Tue Aug  6 19:13:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: atactl.c,v 1.70 2013/08/03 18:35:31 soren Exp $	*/
+/*	$NetBSD: atactl.c,v 1.71 2013/08/06 19:13:13 soren Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: atactl.c,v 1.70 2013/08/03 18:35:31 soren Exp $);
+__RCSID($NetBSD: atactl.c,v 1.71 2013/08/06 19:13:13 soren Exp $);
 #endif
 
 
@@ -1067,7 +1067,7 @@ device_identify(int argc, char *argv[])
 			inqbuf-atap_sata_features_supp, ata_sata_feat);
 	}
 
-	if ((inqbuf-atap_ata_major  WDC_VER_ATA8) 
+	if ((inqbuf-atap_ata_major  WDC_VER_ATA7) 
 	(inqbuf-support_dsm  ATA_SUPPORT_DSM_TRIM))
 		printf(TRIM supported\n);
 

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.403 src/sys/dev/ata/wd.c:1.404
--- src/sys/dev/ata/wd.c:1.403	Wed May 29 00:47:48 2013
+++ src/sys/dev/ata/wd.c	Tue Aug  6 19:13:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.403 2013/05/29 00:47:48 christos Exp $ */
+/*	$NetBSD: wd.c,v 1.404 2013/08/06 19:13:13 soren Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wd.c,v 1.403 2013/05/29 00:47:48 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: wd.c,v 1.404 2013/08/06 19:13:13 soren Exp $);
 
 #include opt_ata.h
 
@@ -1530,12 +1530,12 @@ wdioctl(dev_t dev, u_long xfer, void *ad
 	case DIOCGDISCARDPARAMS: {
 		struct disk_discard_params * tp;
 
-		if (!(wd-sc_params.atap_ata_major  WDC_VER_ATA8)
+		if (!(wd-sc_params.atap_ata_major  WDC_VER_ATA7)
 		|| !(wd-sc_params.support_dsm  ATA_SUPPORT_DSM_TRIM))
 			return ENOTTY;
 		tp = (struct disk_discard_params *)addr;
 		tp-maxsize = 0x; /*wd-sc_params.max_dsm_blocks*/
-		printf(wd: maxtrimsize %ld\n, tp-maxsize);
+		aprint_debug_dev(wd-sc_dev, TRIM maxsize %ld\n, tp-maxsize);
 		return 0;
 	}
 	case DIOCDISCARD:



CVS commit: src/usr.sbin/makefs

2013-08-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  6 20:16:54 UTC 2013

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

Log Message:
New sentence, new line.
Use one list instead of two consecutive ones.
Add .El to end list.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/makefs/makefs.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/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.52 src/usr.sbin/makefs/makefs.8:1.53
--- src/usr.sbin/makefs/makefs.8:1.52	Tue Aug  6 12:47:21 2013
+++ src/usr.sbin/makefs/makefs.8	Tue Aug  6 20:16:54 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: makefs.8,v 1.52 2013/08/06 12:47:21 reinoud Exp $
+.\	$NetBSD: makefs.8,v 1.53 2013/08/06 20:16:54 wiz Exp $
 .\
 .\ Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -414,21 +414,22 @@ create a rewritable fs with sparing for 
 When an optical media is selected here, the sectorsize and the default disc
 size is assumed unless given explicitly.
 For rom images the disc size is the minimum needed.
-.El
-.Bl -tag -width optimization -compact
 .It Sy loglabel
 Set the logical volume label of the disc to the specified argument.
 .It Sy discid
-Set the physical volume label of the disc to the specified argument. Prepend
-the physical volume label with a volumeset label separated with a ':' if
-wanted. For strict conformance and interchange, don't set the volumeset label
+Set the physical volume label of the disc to the specified argument.
+Prepend the physical volume label with a volumeset label separated
+with a ':' if wanted.
+For strict conformance and interchange, don't set the volumeset label
 manually unless it has an unique hex number in the first 8 character
 positions.
 .It Sy minver
-Set the minimum UDF version to be used. Choose UDF version numbers from 0x102,
-0x150, 0x200, and 0x201. Versions 0x250 and 0x260 are currently not supported
+Set the minimum UDF version to be used.
+Choose UDF version numbers from 0x102, 0x150, 0x200, and 0x201.
+Versions 0x250 and 0x260 are currently not supported
 in
 .Nm .
+.El
 .Sh SEE ALSO
 .Xr strsuftoll 3 ,
 .Xr installboot 8 ,



CVS commit: src/share/man/man4

2013-08-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  6 20:18:31 UTC 2013

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

Log Message:
Fix another typo.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/malo.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/malo.4
diff -u src/share/man/man4/malo.4:1.5 src/share/man/man4/malo.4:1.6
--- src/share/man/man4/malo.4:1.5	Tue Aug  6 19:02:57 2013
+++ src/share/man/man4/malo.4	Tue Aug  6 20:18:31 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: malo.4,v 1.5 2013/08/06 19:02:57 snj Exp $
+.\ $NetBSD: malo.4,v 1.6 2013/08/06 20:18:31 wiz Exp $
 .\	$OpenBSD: malo.4,v 1.35 2010/11/01 17:59:09 jmc Exp $
 .\
 .\ Copyright (c) 2006 Theo de Raadt.
@@ -173,7 +173,7 @@ driver was first written by
 .An Claudio Jeker Aq Mt clau...@openbsd.org
 and
 .An Marcus Glocker Aq Mt mgloc...@openbsd.org
-and appearead first in
+and appeared first in
 .Ox 4.1 .
 .Nx
 porting was done by



CVS commit: src/common/lib/libc/arch/arm/atomic

2013-08-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug  6 20:37:22 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/atomic: Makefile.inc

Log Message:
Select ldrex/strex if ${MACHINE_ARCH:Mearmv[67]*}


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/arm/atomic/Makefile.inc

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

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/Makefile.inc
diff -u src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.10 src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.11
--- src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.10	Tue Sep 11 20:51:25 2012
+++ src/common/lib/libc/arch/arm/atomic/Makefile.inc	Tue Aug  6 20:37:22 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.10 2012/09/11 20:51:25 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2013/08/06 20:37:22 matt Exp $
 
 ARMV6= ${CPUFLAGS:M-march=armv7*} ${CPUFLAGS:M-mcpu=cortex*}
 ARMV6+= ${CPUFLAGS:M-march=armv6*} ${CPUFLAGS:M-mcpu=arm11*}
@@ -6,6 +6,7 @@ ARMV6+= ${CFLAGS:M-march=armv7*:} ${CFLA
 ARMV6+= ${CFLAGS:M-march=armv6*:} ${CFLAGS:M-mcpu=arm11*}
 ARMV6+= ${CPPFLAGS:M-march=armv7*:} ${CPPFLAGS:M-mcpu=cortex*}
 ARMV6+= ${CPPFLAGS:M-march=armv6*:} ${CPPFLAGS:M-mcpu=arm11*}
+ARMV6+= ${MACHINE_ARCH:Mearmv[67]*}
 
 .if defined(LIB)  (${LIB} == kern || ${LIB} == c || ${LIB} == pthread \
 	|| ${LIB} == rump)



CVS commit: src/common/lib/libc/arch/arm/atomic

2013-08-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug  6 20:49:15 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/atomic: Makefile.inc

Log Message:
Only use MACHINE_ARCH if !_STANDALONE and CPPFLAGS/CFLAGS/CPUFLAGS don't
contain -mcpu or -march


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/arm/atomic/Makefile.inc

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

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/Makefile.inc
diff -u src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.11 src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.12
--- src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.11	Tue Aug  6 20:37:22 2013
+++ src/common/lib/libc/arch/arm/atomic/Makefile.inc	Tue Aug  6 20:49:15 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.11 2013/08/06 20:37:22 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.12 2013/08/06 20:49:15 matt Exp $
 
 ARMV6= ${CPUFLAGS:M-march=armv7*} ${CPUFLAGS:M-mcpu=cortex*}
 ARMV6+= ${CPUFLAGS:M-march=armv6*} ${CPUFLAGS:M-mcpu=arm11*}
@@ -6,7 +6,12 @@ ARMV6+= ${CFLAGS:M-march=armv7*:} ${CFLA
 ARMV6+= ${CFLAGS:M-march=armv6*:} ${CFLAGS:M-mcpu=arm11*}
 ARMV6+= ${CPPFLAGS:M-march=armv7*:} ${CPPFLAGS:M-mcpu=cortex*}
 ARMV6+= ${CPPFLAGS:M-march=armv6*:} ${CPPFLAGS:M-mcpu=arm11*}
+.if empty(CPPFLAGS:M-D_STANDALONE) \
+ empty(CFLAGS:M-march=*)  empty(CFLAGS:M-mcpu=*) \
+ empty(CPPFLAGS:M-march=*)  empty(CPPFLAGS:M-mcpu=*) \
+ empty(CPUFLAGS:M-march=*)  empty(CPUFLAGS:M-mcpu=*)
 ARMV6+= ${MACHINE_ARCH:Mearmv[67]*}
+.endif
 
 .if defined(LIB)  (${LIB} == kern || ${LIB} == c || ${LIB} == pthread \
 	|| ${LIB} == rump)



CVS commit: src/sys/arch/sh3/sh3

2013-08-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug  6 21:41:01 UTC 2013

Modified Files:
src/sys/arch/sh3/sh3: db_trace.c

Log Message:
db_stack_trace_print: support trace/[at], starting trace from switchframe.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sh3/sh3/db_trace.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/sh3/sh3/db_trace.c
diff -u src/sys/arch/sh3/sh3/db_trace.c:1.23 src/sys/arch/sh3/sh3/db_trace.c:1.24
--- src/sys/arch/sh3/sh3/db_trace.c:1.23	Sun Jun  8 22:02:08 2008
+++ src/sys/arch/sh3/sh3/db_trace.c	Tue Aug  6 21:41:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.23 2008/06/08 22:02:08 uwe Exp $	*/
+/*	$NetBSD: db_trace.c,v 1.24 2013/08/06 21:41:01 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.23 2008/06/08 22:02:08 uwe Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.24 2013/08/06 21:41:01 uwe Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -82,17 +82,76 @@ db_stack_trace_print(db_expr_t addr, boo
 	struct trapframe *tf;
 	db_addr_t callpc, frame, lastframe;
 	uint32_t vbr;
+	bool kernel_only = true;
+	bool lwpid = false;
+	bool lwpaddr = false;
+	const char *cp;
+	char c;
 
 	__asm volatile(stc vbr, %0 : =r(vbr));
 
-	tf = ddb_regs;
+	cp = modif;
+	while ((c = *cp++) != 0) {
+		if (c == 'a')
+			lwpaddr = true;
+		else if (c == 't')
+			lwpid = true;
+		else if (c == 'u')
+			kernel_only = false;
+	}
 
-	frame = tf-tf_r14;
-	callpc = tf-tf_spc;
+	if (lwpaddr  lwpid) {
+		db_printf(only one of /a or /t can be specified\n);
+		return;
+	}
+	if ((lwpaddr || lwpid)  !have_addr) {
+		db_printf(%s required\n, lwpaddr ? address : pid);
+		return;
+	}
 
-	if (callpc == 0) {
-		(*print)(calling through null pointer?\n);
-		callpc = tf-tf_pr;
+
+	if (!have_addr) {
+		tf = ddb_regs;
+		frame = tf-tf_r14;
+		callpc = tf-tf_spc;
+		if (callpc == 0) {
+			(*print)(calling through null pointer?\n);
+			callpc = tf-tf_pr;
+		}
+	}
+	else if (lwpaddr || lwpid) {
+		struct proc *p;
+		struct lwp *l;
+		struct pcb *pcb;
+
+		if (lwpaddr) {
+			l = (struct lwp *)addr;
+			p = l-l_proc;
+			(*print)(trace: lwp addr %p pid %d ,
+ (void *)addr, p-p_pid);
+		}
+		else {
+			pid_t pid = (pid_t)addr;
+			(*print)(trace: pid %d , pid);
+			p = proc_find_raw(pid);
+			if (p == NULL) {
+(*print)(not found\n);
+return;
+			}
+			l = LIST_FIRST(p-p_lwps);
+		}
+		KASSERT(l != NULL);
+		(*print)(lid %d , l-l_lid);
+		pcb = lwp_getpcb(l);
+		tf = (struct trapframe *)pcb-pcb_sf.sf_r6_bank;
+		frame = pcb-pcb_sf.sf_r14;
+		callpc = pcb-pcb_sf.sf_pr;
+		(*print)(at %p\n, frame);
+	}
+	else {
+		/* XXX */
+		db_printf(trace by frame address is not supported\n);
+		return;
 	}
 
 	lastframe = 0;



CVS commit: src/tools

2013-08-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Aug  6 21:47:01 UTC 2013

Modified Files:
src/tools: Makefile.gnuhost
src/tools/autoconf: Makefile

Log Message:
Add the -g -D__gnu__ flags when invoking M4 via CONFIGURE_ARGS
in tools/Makefile.gnuhost.  This makes the tools version of m4
behave like GNU m4.

Remove similar code from tools/autoconf/Makefile, where it didn't
work because Makefile.gnuhost would previously have overridden it.

This fixes a problem in which the tools version of autoconf complained
M4sugar requires GNU M4.
Install it before installing M4sugar or set the M4 environment variable to its 
path name.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/tools/Makefile.gnuhost
cvs rdiff -u -r1.4 -r1.5 src/tools/autoconf/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/Makefile.gnuhost
diff -u src/tools/Makefile.gnuhost:1.39 src/tools/Makefile.gnuhost:1.40
--- src/tools/Makefile.gnuhost:1.39	Tue Jun 19 21:48:33 2012
+++ src/tools/Makefile.gnuhost	Tue Aug  6 21:47:01 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gnuhost,v 1.39 2012/06/19 21:48:33 hans Exp $
+#	$NetBSD: Makefile.gnuhost,v 1.40 2013/08/06 21:47:01 apb Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -56,7 +56,7 @@ CONFIGURE_ENV+= \
 		INSTALL=${HOST_INSTALL_FILE:Q} \
 		LDFLAGS=${HOST_LDFLAGS:Q} \
 		LEX=${LEX:Q} \
-		M4=${TOOL_M4:Q} \
+		M4=${TOOL_M4:Q} -g -D__gnu__ \
 		MAKE=${MAKE_PROGRAM:Q} \
 		PATH=${TOOLDIR}/bin:$$PATH \
 		RANLIB=${HOST_RANLIB:Q} \

Index: src/tools/autoconf/Makefile
diff -u src/tools/autoconf/Makefile:1.4 src/tools/autoconf/Makefile:1.5
--- src/tools/autoconf/Makefile:1.4	Sun Dec  8 20:19:57 2002
+++ src/tools/autoconf/Makefile	Tue Aug  6 21:47:01 2013
@@ -1,8 +1,7 @@
-#	$NetBSD: Makefile,v 1.4 2002/12/08 20:19:57 thorpej Exp $
+#	$NetBSD: Makefile,v 1.5 2013/08/06 21:47:01 apb Exp $
 
 MODULE=		autoconf
 
 CONFIGURE_ARGS=	--program-prefix=${_TOOL_PREFIX}
-CONFIGURE_ENV=	M4=${TOOLDIR}/bin/${_TOOL_PREFIX}m4 -g -D__gnu__
 
 .include ${.CURDIR}/../Makefile.gnuhost



CVS commit: src/tools/compat

2013-08-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Aug  6 21:50:19 UTC 2013

Modified Files:
src/tools/compat: configure.ac

Log Message:
Add a configure test for snprintb_m.  We will assume that
the rpesence of snprintb_m implies the presence of snprintb.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/tools/compat/configure.ac

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

Modified files:

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.77 src/tools/compat/configure.ac:1.78
--- src/tools/compat/configure.ac:1.77	Fri Jul 19 10:53:20 2013
+++ src/tools/compat/configure.ac	Tue Aug  6 21:50:19 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.77 2013/07/19 10:53:20 pooka Exp $
+#	$NetBSD: configure.ac,v 1.78 2013/08/06 21:50:19 apb Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -157,7 +157,8 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf 
 	heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
 	mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
 	pwrite raise_default_signal random setenv \
-	setgroupent setprogname setpassent snprintf strlcat strlcpy strmode \
+	setgroupent setprogname setpassent \
+	snprintb_m snprintf strlcat strlcpy strmode \
 	strndup strsep strsuftoll strtoll \
 	user_from_uid uid_from_user vasprintf vasnprintf vsnprintf)
 



CVS commit: src/tools/compat

2013-08-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Aug  6 21:58:46 UTC 2013

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
declare snptintb_m() and snprintb() if HAVE_SNPRINTB is not defined.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/tools/compat/compat_defs.h

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

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.90 src/tools/compat/compat_defs.h:1.91
--- src/tools/compat/compat_defs.h:1.90	Sat Jul 20 10:31:19 2013
+++ src/tools/compat/compat_defs.h	Tue Aug  6 21:58:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.90 2013/07/20 10:31:19 christos Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.91 2013/08/06 21:58:46 apb Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -446,6 +446,11 @@ const char *getprogname(void);
 void setprogname(const char *);
 #endif
 
+#if !HAVE_SNPRINTB_M
+int snprintb(char *, size_t, const char *, uint64_t);
+int snprintb_m(char *, size_t, const char *, uint64_t, size_t);
+#endif
+
 #if !HAVE_SNPRINTF
 int snprintf(char *, size_t, const char *, ...);
 #endif



CVS commit: src/common/lib/libutil

2013-08-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Aug  6 22:02:50 UTC 2013

Modified Files:
src/common/lib/libutil: snprintb.c

Log Message:
If HAVE_SNPRINTB_M is defined, then do not define the snprintb() and
snprintb_m() functions.  This should allow this file to be compiled
from a tools build regardless of whether or not the host defines these
functions.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libutil/snprintb.c

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

Modified files:

Index: src/common/lib/libutil/snprintb.c
diff -u src/common/lib/libutil/snprintb.c:1.8 src/common/lib/libutil/snprintb.c:1.9
--- src/common/lib/libutil/snprintb.c:1.8	Tue Jul  9 16:10:17 2013
+++ src/common/lib/libutil/snprintb.c	Tue Aug  6 22:02:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: snprintb.c,v 1.8 2013/07/09 16:10:17 uwe Exp $	*/
+/*	$NetBSD: snprintb.c,v 1.9 2013/08/06 22:02:50 apb Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #  include sys/cdefs.h
 #  if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: snprintb.c,v 1.8 2013/07/09 16:10:17 uwe Exp $);
+__RCSID($NetBSD: snprintb.c,v 1.9 2013/08/06 22:02:50 apb Exp $);
 #  endif
 
 #  include sys/types.h
@@ -49,15 +49,16 @@ __RCSID($NetBSD: snprintb.c,v 1.8 2013/
 #  include stdio.h
 #  include util.h
 #  include errno.h
-# else
+# else /* ! _KERNEL */
 #  include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: snprintb.c,v 1.8 2013/07/09 16:10:17 uwe Exp $);
+__KERNEL_RCSID(0, $NetBSD: snprintb.c,v 1.9 2013/08/06 22:02:50 apb Exp $);
 #  include sys/param.h
 #  include sys/inttypes.h
 #  include sys/systm.h
 #  include lib/libkern/libkern.h
-# endif
+# endif /* ! _KERNEL */
 
+# ifndef HAVE_SNPRINTB_M
 int
 snprintb_m(char *buf, size_t buflen, const char *bitfmt, uint64_t val,
 	   size_t l_max)
@@ -278,4 +279,5 @@ snprintb(char *buf, size_t buflen, const
 {
 	return snprintb_m(buf, buflen, bitfmt, val, 0);
 }
-#endif
+# endif /* ! HAVE_SNPRINTB_M */
+#endif /* ! _STANDALONE */



CVS commit: src/tools/compat

2013-08-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Aug  6 22:04:25 UTC 2013

Modified Files:
src/tools/compat: Makefile

Log Message:
Compile snprintb.c into libnbcompat.  The source file is found in the
common/lib/libutil directory.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/tools/compat/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/compat/Makefile
diff -u src/tools/compat/Makefile:1.68 src/tools/compat/Makefile:1.69
--- src/tools/compat/Makefile:1.68	Tue Mar  5 16:27:29 2013
+++ src/tools/compat/Makefile	Tue Aug  6 22:04:25 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.68 2013/03/05 16:27:29 christos Exp $
+#	$NetBSD: Makefile,v 1.69 2013/08/06 22:04:25 apb Exp $
 
 HOSTLIB=	nbcompat
 
@@ -16,9 +16,10 @@ SRCS=		atoll.c basename.c cdbr.c cdbw.c 
 		raise_default_signal.c rmd160.c rmd160hl.c \
 		setenv.c setgroupent.c \
 		setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
-		sha256hl.c sha384hl.c sha512hl.c snprintf.c stat_flags.c \
-		strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \
-		strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \
+		sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
+		stat_flags.c strlcat.c strlcpy.c strmode.c strndup.c \
+		strsep.c strsuftoll.c strtoll.c \
+		unvis.c vis.c err.c errx.c verr.c verrx.c \
 		vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c
 
 BUILD_OSTYPE!=  uname -s
@@ -53,6 +54,7 @@ CPPFLAGS+=	-I. -I./include -I${.CURDIR} 
 		${.CURDIR}/../../common/lib/libc/hash/sha2 \
 		${.CURDIR}/../../common/lib/libc/md \
 		${.CURDIR}/../../common/lib/libc/stdlib \
+		${.CURDIR}/../../common/lib/libutil \
 		${.CURDIR}/../../external/bsd/flex/dist
 
 DPSRCS+=	defs.mk



CVS commit: src

2013-08-06 Thread Soren S. Jorvang
Module Name:src
Committed By:   soren
Date:   Tue Aug  6 22:33:59 UTC 2013

Modified Files:
src/distrib/sets: README
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
src/share/man/man4/man4.vax: Makefile
src/share/man/man9: Makefile
Removed Files:
src/share/man/man7: mdoc.7 mdoc.samples.7

Log Message:
Build orphaned man pages.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/sets/README
cvs rdiff -u -r1.1829 -r1.1830 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1432 -r1.1433 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.600 -r1.601 src/share/man/man4/Makefile
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/man4.vax/Makefile
cvs rdiff -u -r1.29 -r0 src/share/man/man7/mdoc.7
cvs rdiff -u -r1.45 -r0 src/share/man/man7/mdoc.samples.7
cvs rdiff -u -r1.372 -r1.373 src/share/man/man9/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/README
diff -u src/distrib/sets/README:1.12 src/distrib/sets/README:1.13
--- src/distrib/sets/README:1.12	Wed Jan 16 21:11:05 2013
+++ src/distrib/sets/README	Tue Aug  6 22:33:59 2013
@@ -1,4 +1,4 @@
-# $NetBSD: README,v 1.12 2013/01/16 21:11:05 christos Exp $
+# $NetBSD: README,v 1.13 2013/08/06 22:33:59 soren Exp $
 
 the scripts should be run from the directory where they reside.
 
@@ -68,15 +68,5 @@ the sets are as follows:
 	text:	text processing tools.  groff and all of its friends.
 		includes man pages for all bins contained within.
 
-
-as noted, in addition to the standard files in each dir, there's
-a file called 'md_share' in lists/man.  it's the list of man pages
-that are installed from /usr/src/share, which are machine-dependent.
-(note that ones that are installed from elsewhere, and thus are
-installed on only one architecture, are listed in the md.${ARCH}
-file.)  basically, it's grepped through, to see which of the
-machine-dependent man pages that are always installed should go
-in the 'man' set, and which should go into the 'misc' set.
-
 Each set must contain ./etc/mtree/set.set name within the mi
 list.  Failure to add this will break unprivileged builds.

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1829 src/distrib/sets/lists/comp/mi:1.1830
--- src/distrib/sets/lists/comp/mi:1.1829	Thu Jul 18 16:01:41 2013
+++ src/distrib/sets/lists/comp/mi	Tue Aug  6 22:33:59 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1829 2013/07/18 16:01:41 kefren Exp $
+#	$NetBSD: mi,v 1.1830 2013/08/06 22:33:59 soren Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -9275,6 +9275,7 @@
 ./usr/share/man/cat9/fusword.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/fuword.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/genfs.0			comp-sys-catman		.cat
+./usr/share/man/cat9/genfs_rename.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/getbintime.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/getbinuptime.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/getblk.0			comp-sys-catman		.cat
@@ -9527,6 +9528,7 @@
 ./usr/share/man/cat9/memoryallocators.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/memset.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/mi_switch.0		comp-sys-catman		.cat
+./usr/share/man/cat9/microseq.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/microtime.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/microuptime.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/module.0			comp-sys-catman		.cat
@@ -9731,6 +9733,7 @@
 ./usr/share/man/cat9/powerhook_disestablish.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/powerhook_establish.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/powerof2.0			comp-sys-catman		.cat
+./usr/share/man/cat9/ppi.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/ppsratecheck.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/preempt.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/printf.0			comp-sys-catman		.cat
@@ -9782,6 +9785,7 @@
 ./usr/share/man/cat9/rnd_attach_source.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/rnd_detach_source.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/rnd_extract_data.0		comp-sys-catman		.cat
+./usr/share/man/cat9/rndsink.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/rootconf.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/round_page.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/rounddown.0		comp-sys-catman		.cat
@@ -15696,6 +15700,7 @@
 ./usr/share/man/html9/fusword.html		comp-sys-htmlman	html
 ./usr/share/man/html9/fuword.html		comp-sys-htmlman	html
 ./usr/share/man/html9/genfs.html		comp-sys-htmlman	html
+./usr/share/man/html9/genfs_rename.html		comp-sys-htmlman	html
 ./usr/share/man/html9/getbintime.html		comp-sys-htmlman	html
 ./usr/share/man/html9/getbinuptime.html		comp-sys-htmlman	html
 ./usr/share/man/html9/getblk.html		comp-sys-htmlman	html
@@ -15944,6 +15949,7 @@
 ./usr/share/man/html9/memoryallocators.html	

CVS commit: src/share/misc

2013-08-06 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Wed Aug  7 05:19:40 UTC 2013

Modified Files:
src/share/misc: acronyms.comp

Log Message:
Add some more (cryptography-related) acronyms


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.138 src/share/misc/acronyms.comp:1.139
--- src/share/misc/acronyms.comp:1.138	Sat Jun 29 12:22:48 2013
+++ src/share/misc/acronyms.comp	Wed Aug  7 05:19:40 2013
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.138 2013/06/29 12:22:48 jdf Exp $
+$NetBSD: acronyms.comp,v 1.139 2013/08/07 05:19:40 agc Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -307,9 +307,11 @@ DIFS	distributed inter-frame space
 DIMM	dual inline memory module
 DIRT	design in real time
 DL	diode logic
+DL	discrete logarithm
 DL	download
 DLE	data link escape
 DLL	dynamic link library
+DLP	discrete logarithm problem
 DMA	direct memory access
 DMI	desktop management interface
 DMS	document management system
@@ -334,6 +336,7 @@ DRI	direct rendering infrastructure
 DRM	digital rights management
 DRRS	display refresh rate switching
 DS	debug store
+DSA	digital signature algorithm
 DSB	double-sideband modulation
 DSDT	differentiated system descriptor table
 DSL	digital subscriber line
@@ -360,7 +363,10 @@ E-XER	extended XML encoding rules
 EABI	embedded-application binary interface
 EAP	Extensible Authentication Protocol
 EBR	extended boot record
+EC	elliptical curve
 ECC	error correction code
+ECDL	elliptical curve discrete logarithm
+ECDSA	elliptical curve digital signature algorithm
 ECL	emitter-coupled logic
 ECN	explicit congestion notification
 ECP	enhanced capability port
@@ -693,12 +699,14 @@ MIB	management information base
 MID	mobile Internet device
 MIDI	musical instrument digital interface
 MIF	management information format
+MIM	man in the middle
 MIMD	multiple instruction, multiple data
 MIME	Multipurpose Internet Mail Extensions
 MIMO	multiple input multiple output
 MIPS	million instructions per second
 MISD	multiple instruction, single data
 MIT	Massachusetts Institute of Technology
+MITM	man in the middle
 ML	machine language
 ML	machine learning
 ML	mailing list