CVS commit: src/sbin/fdisk

2011-12-01 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Dec  2 04:05:20 UTC 2011

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

Log Message:
Add missing -F flag and -I flag in usage.  Sort the order to match
manpage.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sbin/fdisk/fdisk.c

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

Modified files:

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.136 src/sbin/fdisk/fdisk.c:1.137
--- src/sbin/fdisk/fdisk.c:1.136	Fri Dec  2 03:04:11 2011
+++ src/sbin/fdisk/fdisk.c	Fri Dec  2 04:05:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.136 2011/12/02 03:04:11 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.137 2011/12/02 04:05:20 enami Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.136 2011/12/02 03:04:11 christos Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.137 2011/12/02 04:05:20 enami Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -604,7 +604,7 @@ usage(void)
 {
 	int indent = 7 + (int)strlen(getprogname()) + 1;
 
-	(void)fprintf(stderr, "usage: %s [-afiluvBS] "
+	(void)fprintf(stderr, "usage: %s [-aBFfIilSuv] "
 		"[-A ptn_alignment[/ptn_0_offset]] \\\n"
 		"%*s[-b cylinders/heads/sectors] \\\n"
 		"%*s[-0123 | -E num "



CVS commit: src/sbin/fdisk

2011-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  2 03:04:11 UTC 2011

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

Log Message:
put the error check in the conditional where it belongs.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sbin/fdisk/fdisk.c

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

Modified files:

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.135 src/sbin/fdisk/fdisk.c:1.136
--- src/sbin/fdisk/fdisk.c:1.135	Thu Dec  1 17:24:29 2011
+++ src/sbin/fdisk/fdisk.c	Thu Dec  1 22:04:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.135 2011/12/01 22:24:29 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.136 2011/12/02 03:04:11 christos Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.135 2011/12/01 22:24:29 christos Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.136 2011/12/02 03:04:11 christos Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -2179,10 +2179,10 @@ change_part(int extended, int part, int 
 			errtext = check_ext_overlap(part, sysid, start, size, 1);
 		else
 			errtext = check_overlap(part, sysid, start, size, 1);
+		if (errtext)
+			errx(1, "%s\n", errtext);
 	}
 
-	if (errtext)
-		errx(1, "%s\n", errtext);
 
 	if (sysid == 0) {
 		/* delete this partition - save info though */



CVS commit: src/sys/arch/arm/arm

2011-12-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec  2 00:25:37 UTC 2011

Modified Files:
src/sys/arch/arm/arm: disksubr_mbr.c

Log Message:
Use xlat_mbr_fstype().


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/arm/disksubr_mbr.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/arm/arm/disksubr_mbr.c
diff -u src/sys/arch/arm/arm/disksubr_mbr.c:1.12 src/sys/arch/arm/arm/disksubr_mbr.c:1.13
--- src/sys/arch/arm/arm/disksubr_mbr.c:1.12	Sun Mar 15 22:23:16 2009
+++ src/sys/arch/arm/arm/disksubr_mbr.c	Fri Dec  2 00:25:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr_mbr.c,v 1.12 2009/03/15 22:23:16 cegger Exp $	*/
+/*	$NetBSD: disksubr_mbr.c,v 1.13 2011/12/02 00:25:37 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disksubr_mbr.c,v 1.12 2009/03/15 22:23:16 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr_mbr.c,v 1.13 2011/12/02 00:25:37 jakllsch Exp $");
 
 #include 
 #include 
@@ -80,13 +80,6 @@ __KERNEL_RCSID(0, "$NetBSD: disksubr_mbr
 #define MBRSIGOFS 0x1fe
 static char mbrsig[2] = {0x55, 0xaa};
 
-int fat_types[] = {
-	MBR_PTYPE_FAT12, MBR_PTYPE_FAT16S,
-	MBR_PTYPE_FAT16B, MBR_PTYPE_FAT32,
-	MBR_PTYPE_FAT32L, MBR_PTYPE_FAT16L,
-	-1
-};
-
 int
 mbr_label_read(dev_t dev,
 	void (*strat)(struct buf *),
@@ -97,7 +90,7 @@ mbr_label_read(dev_t dev,
 {
 	struct mbr_partition *mbrp;
 	struct partition *pp;
-	int cyl, mbrpartoff, i, *ip;
+	int cyl, mbrpartoff, i;
 	struct buf *bp;
 	int rv = 1;
 
@@ -160,12 +153,7 @@ mbr_label_read(dev_t dev,
 			pp = &lp->d_partitions['e' - 'a' + i];
 			pp->p_offset = mbrp->mbrp_start;
 			pp->p_size = mbrp->mbrp_size;
-			for (ip = fat_types; *ip != -1; ip++) {
-if (mbrp->mbrp_type == *ip)
-	pp->p_fstype = FS_MSDOS;
-			}
-			if (mbrp->mbrp_type == MBR_PTYPE_LNXEXT2)
-pp->p_fstype = FS_EX2FS;
+			pp->p_fstype = xlat_mbr_fstype(mbrp->mbrp_type);
 
 			/* is this ours? */
 			if (mbrp == ourmbrp) {



CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf

2011-12-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec  2 00:02:02 UTC 2011

Modified Files:
src/sys/arch/evbmips/conf [matt-nb5-mips64]: XLSATX32

Log Message:
Enable 8KB page support.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/evbmips/conf/XLSATX32

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/evbmips/conf/XLSATX32
diff -u src/sys/arch/evbmips/conf/XLSATX32:1.1.2.3 src/sys/arch/evbmips/conf/XLSATX32:1.1.2.4
--- src/sys/arch/evbmips/conf/XLSATX32:1.1.2.3	Tue Nov 29 07:48:32 2011
+++ src/sys/arch/evbmips/conf/XLSATX32	Fri Dec  2 00:02:01 2011
@@ -1,13 +1,12 @@
-# $NetBSD: XLSATX32,v 1.1.2.3 2011/11/29 07:48:32 matt Exp $
+# $NetBSD: XLSATX32,v 1.1.2.4 2011/12/02 00:02:01 matt Exp $
 #
 
-#ident  	"XLSATX32-$Revision: 1.1.2.3 $"
+#ident  	"XLSATX32-$Revision: 1.1.2.4 $"
 
 include "arch/evbmips/conf/XLSATX"
 
 #options 	MEMLIMIT=0x2000			# 512MB 
+options 	ENABLE_MIPS_8KB_PAGE
 options 	ENABLE_MIPS_KSEGX
-#no options 	NFS_BOOT_DHCP
-#options 	NFS_BOOT_BOOTP
 
 makeoptions	LP64="no"



CVS commit: [matt-nb5-mips64] src/sys/arch/mips

2011-12-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec  2 00:01:38 UTC 2011

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: files.mips
src/sys/arch/mips/include [matt-nb5-mips64]: mips3_pte.h mips_param.h
vmparam.h
src/sys/arch/mips/mips [matt-nb5-mips64]: genassym.cf mipsX_subr.S

Log Message:
Add support for 8KB pages.


To generate a diff of this commit:
cvs rdiff -u -r1.58.24.16 -r1.58.24.17 src/sys/arch/mips/conf/files.mips
cvs rdiff -u -r1.23.38.6 -r1.23.38.7 src/sys/arch/mips/include/mips3_pte.h
cvs rdiff -u -r1.23.78.6 -r1.23.78.7 src/sys/arch/mips/include/mips_param.h
cvs rdiff -u -r1.41.28.21 -r1.41.28.22 src/sys/arch/mips/include/vmparam.h
cvs rdiff -u -r1.44.12.28 -r1.44.12.29 src/sys/arch/mips/mips/genassym.cf
cvs rdiff -u -r1.26.36.1.2.48 -r1.26.36.1.2.49 \
src/sys/arch/mips/mips/mipsX_subr.S

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

Modified files:

Index: src/sys/arch/mips/conf/files.mips
diff -u src/sys/arch/mips/conf/files.mips:1.58.24.16 src/sys/arch/mips/conf/files.mips:1.58.24.17
--- src/sys/arch/mips/conf/files.mips:1.58.24.16	Tue Nov 29 07:48:31 2011
+++ src/sys/arch/mips/conf/files.mips	Fri Dec  2 00:01:37 2011
@@ -3,6 +3,8 @@
 
 defflag	opt_cputype.h		NOFPU FPEMUL
 MIPS64_SB1
+ENABLE_MIPS_16KB_PAGE
+ENABLE_MIPS_8KB_PAGE
 ENABLE_MIPS_KSEGX
 MIPS64_XLP MIPS64_XLR MIPS64_XLS
 	# and the rest...

Index: src/sys/arch/mips/include/mips3_pte.h
diff -u src/sys/arch/mips/include/mips3_pte.h:1.23.38.6 src/sys/arch/mips/include/mips3_pte.h:1.23.38.7
--- src/sys/arch/mips/include/mips3_pte.h:1.23.38.6	Tue Jan 26 21:19:25 2010
+++ src/sys/arch/mips/include/mips3_pte.h	Fri Dec  2 00:01:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips3_pte.h,v 1.23.38.6 2010/01/26 21:19:25 matt Exp $	*/
+/*	$NetBSD: mips3_pte.h,v 1.23.38.7 2011/12/02 00:01:37 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -106,9 +106,19 @@ unsigned int 	pg_g:1,			/* HW: ignore as
 #define MIPS3_PG_WIRED	0x8000	/* SW */
 #define MIPS3_PG_RO	0x4000	/* SW */
 
+#ifdef ENABLE_MIPS_16KB_PAGE
+#define	MIPS3_PG_SVPN	0xc000	/* Software page no mask */
+#define	MIPS3_PG_HVPN	0x8000	/* Hardware page no mask */
+#define	MIPS3_PG_ODDPG	0x4000	/* Odd even pte entry */
+#elif defined(ENABLE_MIPS_8KB_PAGE)
+#define	MIPS3_PG_SVPN	0xe000	/* Software page no mask */
+#define	MIPS3_PG_HVPN	0xe000	/* Hardware page no mask */
+#define	MIPS3_PG_NEXT	0x0040	/* next PFN */
+#elif defined(ENABLE_MIPS_4KB_PAGE) || 1
 #define	MIPS3_PG_SVPN	0xf000	/* Software page no mask */
 #define	MIPS3_PG_HVPN	0xe000	/* Hardware page no mask */
 #define	MIPS3_PG_ODDPG	0x1000	/* Odd even pte entry */
+#endif
 #define	MIPS3_PG_ASID	0x00ff	/* Address space ID */
 #define	MIPS3_PG_G	0x0001	/* Global; ignore ASID if in lo0 & lo1 */
 #define	MIPS3_PG_V	0x0002	/* Valid */
@@ -189,7 +199,10 @@ unsigned int 	pg_g:1,			/* HW: ignore as
 pg_mask) | 0x1fff) + 1) / 2)
 
 #define	MIPS3_PG_SIZE_TO_MASK(pg_size)		\
-pg_size) * 2) - 1) & ~0x1fff)
+pg_size) << (((pg_size) & 0x2) == 0)) - 1) & ~0x1fff)
+
+CTASSERT(MIPS3_PG_SIZE_TO_MASK(4096) == MIPS3_PG_SIZE_4K);
+CTASSERT(MIPS3_PG_SIZE_TO_MASK(8192) == MIPS3_PG_SIZE_4K);
 
 /* NEC Vr41xx uses different pagemask values. */
 #define	MIPS4100_PG_SIZE_1K	0x

Index: src/sys/arch/mips/include/mips_param.h
diff -u src/sys/arch/mips/include/mips_param.h:1.23.78.6 src/sys/arch/mips/include/mips_param.h:1.23.78.7
--- src/sys/arch/mips/include/mips_param.h:1.23.78.6	Mon Aug 16 18:01:13 2010
+++ src/sys/arch/mips/include/mips_param.h	Fri Dec  2 00:01:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_param.h,v 1.23.78.6 2010/08/16 18:01:13 matt Exp $	*/
+/*	$NetBSD: mips_param.h,v 1.23.78.7 2011/12/02 00:01:37 matt Exp $	*/
 
 #ifdef _KERNEL
 #include 
@@ -39,9 +39,16 @@
 #define	SSIZE		1		/* initial stack size/NBPG */
 #define	SINCR		1		/* increment of stack/NBPG */
 
+#if defined(ENABLE_MIPS_16KB_PAGE) || defined(ENABLE_MIPS_8KB_PAGE)
+#define	UPAGES		1		/* pages of u-area */
+#define	USPACE		(UPAGES*NBPG)	/* size of u-area in bytes */
+#elif defined(ENABLE_MIPS_4KB_PAGE) || 1
 #define	UPAGES		2		/* pages of u-area */
 #define	USPACE		(UPAGES*NBPG)	/* size of u-area in bytes */
 #define	USPACE_ALIGN	USPACE		/* make sure it starts on a even VA */
+#else
+#error ENABLE_MIPS_xKB_PAGE not defined
+#endif
 
 #ifndef MSGBUFSIZE
 #define MSGBUFSIZE	NBPG		/* default message buffer size */
@@ -62,9 +69,15 @@
 #define	ALIGN(p)	(((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES)
 #define ALIGNED_POINTER(p,t)	uintptr_t)(p)) & (sizeof(t)-1)) == 0)
 
-#define	NBPG		4096		/* bytes/page */
-#define	PGOFSET		(NBPG-1)	/* byte offset into page */
+#ifdef ENABLE_MIPS_16KB_PAGE
+#define	PGSHIFT		14		/* LOG2(NBPG) */
+#elif defined(ENABLE_MIPS_8KB_PAGE)
+#define	PGSHIFT		13		/* LOG2(NBPG) */
+#else
 #define	PGSHIFT		12		/* LOG

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2011-12-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  1 23:59:14 UTC 2011

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: vm_machdep.c

Log Message:
Add code to deal with direct mapped uareas.


To generate a diff of this commit:
cvs rdiff -u -r1.121.6.1.2.22 -r1.121.6.1.2.23 \
src/sys/arch/mips/mips/vm_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/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.22 src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.23
--- src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.22	Tue Nov 29 07:48:31 2011
+++ src/sys/arch/mips/mips/vm_machdep.c	Thu Dec  1 23:59:14 2011
@@ -122,6 +122,11 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 	l2->l_md.md_flags = l1->l_md.md_flags & MDP_FPUSED;
 
 	bool direct_mapped_p = MIPS_KSEG0_P(ua2);
+#ifdef ENABLE_MIPS_KSEGX
+	if (!direct_mapped_p)
+		direct_mapped_p = VM_KSEGX_ADDRESS <= ua2
+		&& ua2 < VM_KSEGX_ADDRESS + VM_KSEGX_SIZE;
+#endif
 #ifdef _LP64
 	direct_mapped_p = direct_mapped_p || MIPS_XKPHYS_P(ua2);
 #endif
@@ -195,6 +200,16 @@ cpu_uarea_remap(struct lwp *l)
 	 * Grab the starting physical address of the uarea.
 	 */
 	va = (vaddr_t)l->l_addr;
+	if (MIPS_KSEG0_P(va))
+		return;
+#ifdef _LP64
+	if (MIPS_XKPHYS_P(va))
+		return;
+#elif defined(ENABLE_MIPS_KSEGX)
+	if (VM_KSEGX_ADDRESS <= va && va < VM_KSEGX_ADDRESS + VM_KSEGX_SIZE)
+		return;
+#endif
+
 	if (!pmap_extract(pmap_kernel(), va, &pa))
 		panic("%s: pmap_extract(%#"PRIxVADDR") failed", __func__, va);
 
@@ -287,6 +302,20 @@ cpu_swapin(struct lwp *l)
 {
 	pt_entry_t *pte;
 	int i, x;
+	vaddr_t kva = (vaddr_t) lwp_getpcb(l);
+
+#ifdef _LP64
+	if (MIPS_XKPHYS_P(kva))
+		return;
+#else
+	if (MIPS_KSEG0_P(kva))
+		return;
+	
+#ifdef ENABLE_MIPS_KSEGX
+	if (VM_KSEGX_ADDRESS <= kva && kva < VM_KSEGX_ADDRESS + VM_KSEGX_SIZE)
+		return;
+#endif
+#endif
 
 	/*
 	 * Cache the PTEs for the user area in the machine dependent
@@ -296,7 +325,7 @@ cpu_swapin(struct lwp *l)
 	x = (MIPS_HAS_R4K_MMU) ?
 	(MIPS3_PG_G | MIPS3_PG_RO | MIPS3_PG_WIRED) :
 	MIPS1_PG_G;
-	pte = kvtopte(l->l_addr);
+	pte = kvtopte(kva);
 	for (i = 0; i < UPAGES; i++)
 		l->l_md.md_upte[i] = pte[i].pt_entry &~ x;
 }



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2011-12-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  1 23:53:54 UTC 2011

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap.c

Log Message:
don't compare pfn against phys_addr.


To generate a diff of this commit:
cvs rdiff -u -r1.179.16.32 -r1.179.16.33 src/sys/arch/mips/mips/pmap.c

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

Modified files:

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.32 src/sys/arch/mips/mips/pmap.c:1.179.16.33
--- src/sys/arch/mips/mips/pmap.c:1.179.16.32	Thu Dec  1 02:58:23 2011
+++ src/sys/arch/mips/mips/pmap.c	Thu Dec  1 23:53:54 2011
@@ -692,7 +692,7 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 		}
 
 #ifndef _LP64
-		if (seg->avail_start + npgs > MIPS_PHYS_MASK + 1) {
+		if (seg->avail_start + npgs > atop(MIPS_PHYS_MASK + 1)) {
 			aprint_debug("%s: seg %u: not enough in KSEG0 for %u pages\n",
 			__func__, bank, npgs);
 			continue;



CVS commit: src/sbin/fdisk

2011-12-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec  1 23:14:06 UTC 2011

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

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sbin/fdisk/fdisk.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/fdisk/fdisk.8
diff -u src/sbin/fdisk/fdisk.8:1.72 src/sbin/fdisk/fdisk.8:1.73
--- src/sbin/fdisk/fdisk.8:1.72	Thu Dec  1 22:24:29 2011
+++ src/sbin/fdisk/fdisk.8	Thu Dec  1 23:14:06 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fdisk.8,v 1.72 2011/12/01 22:24:29 christos Exp $
+.\"	$NetBSD: fdisk.8,v 1.73 2011/12/01 23:14:06 wiz Exp $
 .\"
 .Dd December 1, 2011
 .Dt FDISK 8
@@ -272,7 +272,7 @@ fields
 They will be automatically computed using the BIOS geometry.
 .It Fl I
 Ignore errors from overlapping partitions.
-Some devices (cameras CHDK) require overlapping partitions to support 
+Some devices (cameras CHDK) require overlapping partitions to support
 bigger than 4GB cards.
 The
 .Fl I



CVS commit: src/sys/dev/usb

2011-12-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec  1 22:42:41 UTC 2011

Modified Files:
src/sys/dev/usb: ugen.c

Log Message:
Don't double clfree() when closing an interrupt endpoint.
>From Geoff C. Wing in PR#37934.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/usb/ugen.c

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

Modified files:

Index: src/sys/dev/usb/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.113 src/sys/dev/usb/ugen.c:1.114
--- src/sys/dev/usb/ugen.c:1.113	Fri Nov 25 02:59:54 2011
+++ src/sys/dev/usb/ugen.c	Thu Dec  1 22:42:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugen.c,v 1.113 2011/11/25 02:59:54 jakllsch Exp $	*/
+/*	$NetBSD: ugen.c,v 1.114 2011/12/01 22:42:41 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.113 2011/11/25 02:59:54 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.114 2011/12/01 22:42:41 jakllsch Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -571,7 +571,6 @@ ugenclose(dev_t dev, int flag, int mode,
 		if (sce->ibuf != NULL) {
 			free(sce->ibuf, M_USBDEV);
 			sce->ibuf = NULL;
-			clfree(&sce->q);
 		}
 	}
 	sc->sc_is_open[endpt] = 0;



CVS commit: src/sbin/fdisk

2011-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  1 22:24:29 UTC 2011

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

Log Message:
Add a flag to support writing overlapping partitions and explain why.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sbin/fdisk/fdisk.8
cvs rdiff -u -r1.134 -r1.135 src/sbin/fdisk/fdisk.c

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

Modified files:

Index: src/sbin/fdisk/fdisk.8
diff -u src/sbin/fdisk/fdisk.8:1.71 src/sbin/fdisk/fdisk.8:1.72
--- src/sbin/fdisk/fdisk.8:1.71	Mon Apr 25 18:23:47 2011
+++ src/sbin/fdisk/fdisk.8	Thu Dec  1 17:24:29 2011
@@ -1,6 +1,6 @@
-.\"	$NetBSD: fdisk.8,v 1.71 2011/04/25 22:23:47 wiz Exp $
+.\"	$NetBSD: fdisk.8,v 1.72 2011/12/01 22:24:29 christos Exp $
 .\"
-.Dd April 6, 2010
+.Dd December 1, 2011
 .Dt FDISK 8
 .Os
 .Sh NAME
@@ -8,7 +8,7 @@
 .Nd MS-DOS partition maintenance program
 .Sh SYNOPSIS
 .Nm
-.Op Fl aBFfiSuv
+.Op Fl aBFfIiSuv
 .Bk -words
 .Oo
 .Fl 0 | 1 | 2 | 3 | E Ar number
@@ -270,6 +270,14 @@ and
 fields
 .Pq only Ar start No and Ar size No can be specified by Fl s No option .
 They will be automatically computed using the BIOS geometry.
+.It Fl I
+Ignore errors from overlapping partitions.
+Some devices (cameras CHDK) require overlapping partitions to support 
+bigger than 4GB cards.
+The
+.Fl I
+flag ignores overlapping error checks and does not fix them, allowing these
+incorrect configurations to be used.
 .It Fl i
 Explicitly request initialisation of the master boot code
 (similar to what

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.134 src/sbin/fdisk/fdisk.c:1.135
--- src/sbin/fdisk/fdisk.c:1.134	Sun Aug 28 11:46:26 2011
+++ src/sbin/fdisk/fdisk.c	Thu Dec  1 17:24:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.134 2011/08/28 15:46:26 gson Exp $ */
+/*	$NetBSD: fdisk.c,v 1.135 2011/12/01 22:24:29 christos Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.134 2011/08/28 15:46:26 gson Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.135 2011/12/01 22:24:29 christos Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -224,6 +224,7 @@ static char *disk_type = NULL;
 
 static int a_flag;		/* set active partition */
 static int i_flag;		/* init bootcode */
+static int I_flag;		/* ignore errors */
 static int u_flag;		/* update partition data */
 static int v_flag;		/* more verbose */
 static int sh_flag;		/* Output data as shell defines */
@@ -383,6 +384,9 @@ main(int argc, char *argv[])
 		case 'i':	/* Always update bootcode */
 			i_flag = 1;
 			break;
+		case 'I':	/* Ignore errors */
+			I_flag = 1;
+			break;
 		case 'l':	/* List known partition types */
 			for (len = 0; len < KNOWN_SYSIDS; len++)
 printf("%03d %s\n", mbr_ptypes[len].id,
@@ -2156,7 +2160,7 @@ change_part(int extended, int part, int 
 		errtext = check_ext_overlap(part, sysid, start, size, 0);
 	else
 		errtext = check_overlap(part, sysid, start, size, 0);
-	if (errtext != NULL) {
+	if (errtext != NULL && !I_flag) {
 		if (f_flag)
 			errx(2, "%s\n", errtext);
 		printf("%s\n", errtext);
@@ -2170,11 +2174,12 @@ change_part(int extended, int part, int 
 	 * This also fixes the base of each extended partition if the
 	 * partition itself has moved.
 	 */
-
-	if (extended)
-		errtext = check_ext_overlap(part, sysid, start, size, 1);
-	else
-		errtext = check_overlap(part, sysid, start, size, 1);
+	if (!I_flag) {
+		if (extended)
+			errtext = check_ext_overlap(part, sysid, start, size, 1);
+		else
+			errtext = check_overlap(part, sysid, start, size, 1);
+	}
 
 	if (errtext)
 		errx(1, "%s\n", errtext);



CVS commit: src/tests/lib/librumphijack

2011-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  1 21:54:10 UTC 2011

Modified Files:
src/tests/lib/librumphijack: t_vfs.sh

Log Message:
add missing dev_disk library for getdiskinfo.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/librumphijack/t_vfs.sh

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

Modified files:

Index: src/tests/lib/librumphijack/t_vfs.sh
diff -u src/tests/lib/librumphijack/t_vfs.sh:1.4 src/tests/lib/librumphijack/t_vfs.sh:1.5
--- src/tests/lib/librumphijack/t_vfs.sh:1.4	Tue Mar  8 17:21:52 2011
+++ src/tests/lib/librumphijack/t_vfs.sh	Thu Dec  1 16:54:10 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: t_vfs.sh,v 1.4 2011/03/08 22:21:52 pooka Exp $
+#   $NetBSD: t_vfs.sh,v 1.5 2011/12/01 21:54:10 christos Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,7 +27,7 @@
 
 img=ffs.img
 rumpsrv_ffs=\
-"rump_server -lrumpvfs -lrumpfs_ffs -d key=/img,hostpath=${img},size=host"
+"rump_server -lrumpvfs -lrumpfs_ffs -lrumpdev_disk -d key=/img,hostpath=${img},size=host"
 export RUMP_SERVER=unix://csock
 
 domount()



CVS commit: src/sys/rump/librump/rumpkern

2011-12-01 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Thu Dec  1 19:15:15 UTC 2011

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
Initialize the kern_cprng in rump startup.  Oops.

Should fix some "mysterious" rump test failures.  Thanks to Nicholas Joly
for pointing out exactly what was wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.236 src/sys/rump/librump/rumpkern/rump.c:1.237
--- src/sys/rump/librump/rumpkern/rump.c:1.236	Sat Nov 26 21:41:02 2011
+++ src/sys/rump/librump/rumpkern/rump.c	Thu Dec  1 19:15:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.236 2011/11/26 21:41:02 njoly Exp $	*/
+/*	$NetBSD: rump.c,v 1.237 2011/12/01 19:15:15 tls Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.236 2011/11/26 21:41:02 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.237 2011/12/01 19:15:15 tls Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -163,19 +163,6 @@ rump_proc_vfs_release_fn rump_proc_vfs_r
 
 static void add_linkedin_modules(const struct modinfo *const *, size_t);
 
-static void __noinline
-messthestack(void)
-{
-	volatile uint32_t mess[64];
-	uint64_t d1, d2;
-	int i, error;
-
-	for (i = 0; i < 64; i++) {
-		rumpuser_gettime(&d1, &d2, &error);
-		mess[i] = d2;
-	}
-}
-
 /*
  * Create kern.hostname.  why only this you ask.  well, init_sysctl
  * is a kitchen sink in need of some gardening.  but i want to use
@@ -328,12 +315,11 @@ rump__init(int rump_version)
 	kauth_init();
 
 	/*
-	 * Seed arc4random() with a "reasonable" amount of randomness.
-	 * Yes, this is a quick kludge which depends on the arc4random
-	 * implementation.
+	 * Create the kernel cprng.  Yes, it's currently stubbed out
+	 * to arc4random() for RUMP, but this won't always be so.
 	 */
-	messthestack();
-	cprng_fast32();
+	kern_cprng = cprng_strong_create("kernel", IPL_VM,
+	 CPRNG_INIT_ANY|CPRNG_REKEY_ANY);
 
 	procinit();
 	proc0_init();



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

2011-12-01 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Dec  1 14:18:02 UTC 2011

Modified Files:
src/sys/arch/algor/conf: P6032

Log Message:
Increase SYMTAB_SPACE for evbmips.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/algor/conf/P6032

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/algor/conf/P6032
diff -u src/sys/arch/algor/conf/P6032:1.61 src/sys/arch/algor/conf/P6032:1.62
--- src/sys/arch/algor/conf/P6032:1.61	Tue Nov 22 21:24:53 2011
+++ src/sys/arch/algor/conf/P6032	Thu Dec  1 14:18:02 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: P6032,v 1.61 2011/11/22 21:24:53 tls Exp $
+#	$NetBSD: P6032,v 1.62 2011/12/01 14:18:02 kiyohara Exp $
 #
 # Algorithmics P-6032 kernel.
 #
@@ -7,7 +7,7 @@ include	"arch/algor/conf/std.algor"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P6032-$Revision: 1.61 $"
+#ident 		"P6032-$Revision: 1.62 $"
 
 maxusers 32
 
@@ -25,7 +25,7 @@ options 	DIAGNOSTIC		# Cheap kernel cons
 options 	DDB			# kernel debugger
 makeoptions	DEBUG="-g"
 #makeoptions	DEBUGLIST="pattern1 pattern2 ..."
-options 	SYMTAB_SPACE=424000
+options 	SYMTAB_SPACE=425000
 
 # File systems
 file-system	FFS		# Fast file system



CVS commit: src/external/gpl3/gdb/dist/gdb

2011-12-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Dec  1 09:16:28 UTC 2011

Modified Files:
src/external/gpl3/gdb/dist/gdb: hppanbsd-tdep.c

Log Message:
Provide some more registers.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c:1.1.1.1	Sat Sep 24 20:10:38 2011
+++ src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c	Thu Dec  1 09:16:28 2011
@@ -60,6 +60,19 @@ static int hppanbsd_mc_reg_offset[] =
   38 * 4,	/* sr1 */
   39 * 4,	/* sr2 */
   40 * 4,	/* sr3 */
+  -1,		/* 48 */
+  -1,		/* 49 */
+  -1,		/* 50 */
+  -1,		/* 51 */
+  -1,		/* 52 */
+  -1,		/* 53 */
+  -1,		/* 54 */
+  -1,		/* 55 */
+  -1,		/* 56 */
+  -1,		/* 57 CR24 */
+  -1,		/* 58 CR25 */
+  -1,		/* 59 CR26 */
+  43 * 4,	/* HPPA_CR27_REGNUM */
 
   /* more tbd */
 };
@@ -133,7 +146,7 @@ hppanbsd_sigtramp_cache_init (const stru
 /* Core file support.  */
 
 /* Sizeof `struct reg' in .  */
-#define HPPANBSD_SIZEOF_GREGS	(44 * 4)
+#define HPPANBSD_SIZEOF_GREGS	(46 * 4)
 
 static int hppanbsd_reg_offset[] =
 {
@@ -157,6 +170,25 @@ static int hppanbsd_reg_offset[] =
   -1,		/* HPPA_ISR_REGNUM */
   -1,		/* HPPA_IOR_REGNUM */
   0 * 4,	/* HPPA_IPSW_REGNUM */
+  -1,		/* spare? */
+  41 * 4,	/* HPPA_SR4_REGNUM */
+  37 * 4,	/* sr0 */
+  38 * 4,	/* sr1 */
+  39 * 4,	/* sr2 */
+  40 * 4,	/* sr3 */
+  -1,		/* 48 */
+  -1,		/* 49 */
+  -1,		/* 50 */
+  -1,		/* 51 */
+  -1,		/* 52 */
+  -1,		/* 53 */
+  -1,		/* 54 */
+  -1,		/* 55 */
+  -1,		/* 56 */
+  -1,		/* 57 */
+  -1,		/* 58 */
+  -1,		/* 59 */
+  46 * 4,	/* HPPA_CR27_REGNUM */
 };
 
 /* Supply register REGNUM from the buffer specified by GREGS and LEN