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

2012-07-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul  5 10:56:52 UTC 2012

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Fix locking botch introduced in 1.36.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/dev/plcom.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/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.38 src/sys/arch/evbarm/dev/plcom.c:1.39
--- src/sys/arch/evbarm/dev/plcom.c:1.38	Sun May 20 10:28:44 2012
+++ src/sys/arch/evbarm/dev/plcom.c	Thu Jul  5 10:56:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.38 2012/05/20 10:28:44 skrll Exp $	*/
+/*	$NetBSD: plcom.c,v 1.39 2012/07/05 10:56:52 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.38 2012/05/20 10:28:44 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.39 2012/07/05 10:56:52 skrll Exp $);
 
 #include opt_plcom.h
 #include opt_ddb.h
@@ -640,7 +640,7 @@ plcomopen(dev_t dev, int flag, int mode,
 		sc-ppsparam.mode = 0;
 		mutex_spin_exit(timecounter_lock);
 
-		mutex_spin_enter(sc-sc_lock);
+		mutex_spin_exit(sc-sc_lock);
 
 		/*
 		 * Initialize the termios status to the defaults.  Add in the



CVS commit: src/sys/dev/pcmcia

2012-07-05 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jul  5 12:53:22 UTC 2012

Modified Files:
src/sys/dev/pcmcia: wdc_pcmcia.c

Log Message:
Fix use of uninitialized variable.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/pcmcia/wdc_pcmcia.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/pcmcia/wdc_pcmcia.c
diff -u src/sys/dev/pcmcia/wdc_pcmcia.c:1.118 src/sys/dev/pcmcia/wdc_pcmcia.c:1.119
--- src/sys/dev/pcmcia/wdc_pcmcia.c:1.118	Mon Jul  2 18:15:48 2012
+++ src/sys/dev/pcmcia/wdc_pcmcia.c	Thu Jul  5 12:53:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc_pcmcia.c,v 1.118 2012/07/02 18:15:48 bouyer Exp $ */
+/*	$NetBSD: wdc_pcmcia.c,v 1.119 2012/07/05 12:53:22 joerg Exp $ */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wdc_pcmcia.c,v 1.118 2012/07/02 18:15:48 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: wdc_pcmcia.c,v 1.119 2012/07/05 12:53:22 joerg Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -294,12 +294,12 @@ wdc_pcmcia_attach(device_t parent, devic
 	sc-wdc_chanlist[0] = sc-ata_channel;
 	sc-sc_wdcdev.sc_atac.atac_channels = sc-wdc_chanlist;
 	sc-sc_wdcdev.sc_atac.atac_nchannels = 1;
-	sc-sc_wdcdev.wdc_maxdrives = wdcp ? wdcp-wdc_ndrive : 2;
 	sc-ata_channel.ch_channel = 0;
 	sc-ata_channel.ch_atac = sc-sc_wdcdev.sc_atac;
 	sc-ata_channel.ch_queue = sc-wdc_chqueue;
 	wdcp = pcmcia_product_lookup(pa, wdc_pcmcia_products,
 	wdc_pcmcia_nproducts, sizeof(wdc_pcmcia_products[0]), NULL);
+	sc-sc_wdcdev.wdc_maxdrives = wdcp ? wdcp-wdc_ndrive : 2;
 	wdc_init_shadow_regs(sc-ata_channel);
 
 	error = wdc_pcmcia_enable(self, 1);



CVS commit: src/external/cddl/osnet/lib/libzfs

2012-07-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  5 13:55:58 UTC 2012

Modified Files:
src/external/cddl/osnet/lib/libzfs: deviceid.c

Log Message:
PR/46660: Henning Petersen: Fix typo in deviceid.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libzfs/deviceid.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/cddl/osnet/lib/libzfs/deviceid.c
diff -u src/external/cddl/osnet/lib/libzfs/deviceid.c:1.1 src/external/cddl/osnet/lib/libzfs/deviceid.c:1.2
--- src/external/cddl/osnet/lib/libzfs/deviceid.c:1.1	Fri Aug  7 16:57:56 2009
+++ src/external/cddl/osnet/lib/libzfs/deviceid.c	Thu Jul  5 09:55:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: deviceid.c,v 1.1 2009/08/07 20:57:56 haad Exp $	*/
+/*	$NetBSD: deviceid.c,v 1.2 2012/07/05 13:55:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include sys/cdefs.h
 /* __FBSDID($FreeBSD: src/compat/opensolaris/misc/deviceid.c,v 1.1 2007/05/06 01:39:38 pjd Exp $); */
-__RCSID($NetBSD: deviceid.c,v 1.1 2009/08/07 20:57:56 haad Exp $);
+__RCSID($NetBSD: deviceid.c,v 1.2 2012/07/05 13:55:58 christos Exp $);
 
 #include sys/param.h
 #include sys/ioctl.h
@@ -78,7 +78,7 @@ devid_str_decode(char *devidstr, ddi_dev
 		return (EINVAL);
 	}
 	*retminor_name = strdup();
-	if (*retminor_name == NULL);
+	if (*retminor_name == NULL)
 		return (ENOMEM);
 	return (0);
 }



CVS commit: src/sys/common/pmap/tlb

2012-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  5 16:55:11 UTC 2012

Modified Files:
src/sys/common/pmap/tlb: pmap.c pmap.h pmap_segtab.c

Log Message:
Add 3-level page table support (from MIPS).  Rename a few routines.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/common/pmap/tlb/pmap.c
cvs rdiff -u -r1.13 -r1.14 src/sys/common/pmap/tlb/pmap.h
cvs rdiff -u -r1.5 -r1.6 src/sys/common/pmap/tlb/pmap_segtab.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/common/pmap/tlb/pmap.c
diff -u src/sys/common/pmap/tlb/pmap.c:1.14 src/sys/common/pmap/tlb/pmap.c:1.15
--- src/sys/common/pmap/tlb/pmap.c:1.14	Wed Jul  4 11:39:42 2012
+++ src/sys/common/pmap/tlb/pmap.c	Thu Jul  5 16:55:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.14 2012/07/04 11:39:42 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.15 2012/07/05 16:55:11 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.14 2012/07/04 11:39:42 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.15 2012/07/05 16:55:11 matt Exp $);
 
 /*
  *	Manages physical address maps.
@@ -450,8 +450,8 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 void
 pmap_init(void)
 {
-UVMHIST_INIT_STATIC(pmapexechist, pmapexechistbuf);
-UVMHIST_INIT_STATIC(pmaphist, pmaphistbuf);
+	UVMHIST_INIT_STATIC(pmapexechist, pmapexechistbuf);
+	UVMHIST_INIT_STATIC(pmaphist, pmaphistbuf);
 
 	UVMHIST_FUNC(__func__); UVMHIST_CALLED(pmaphist);
 
@@ -504,7 +504,7 @@ pmap_create(void)
 	pmap-pm_minaddr = VM_MIN_ADDRESS;
 	pmap-pm_maxaddr = VM_MAXUSER_ADDRESS;
 
-	pmap_segtab_alloc(pmap);
+	pmap_segtab_init(pmap);
 
 	UVMHIST_LOG(pmaphist, - pmap %p, pmap,0,0,0);
 	return pmap;
@@ -530,7 +530,7 @@ pmap_destroy(pmap_t pmap)
 	PMAP_COUNT(destroy);
 	kpreempt_disable();
 	pmap_tlb_asid_release_all(pmap);
-	pmap_segtab_free(pmap);
+	pmap_segtab_destroy(pmap);
 
 	pool_put(pmap_pmap_pool, pmap);
 	kpreempt_enable();
@@ -1482,7 +1482,7 @@ pmap_enter_pv(pmap_t pmap, vaddr_t va, s
 	pmap, va, pg, VM_PAGE_TO_PHYS(pg));
 	UVMHIST_LOG(pmaphist, nptep=%p (%#x)), npte, *npte, 0, 0);
 
-KASSERT(kpreempt_disabled());
+	KASSERT(kpreempt_disabled());
 	KASSERT(pmap != pmap_kernel() || !pmap_md_direct_mapped_vaddr_p(va));
 
 	apv = NULL;

Index: src/sys/common/pmap/tlb/pmap.h
diff -u src/sys/common/pmap/tlb/pmap.h:1.13 src/sys/common/pmap/tlb/pmap.h:1.14
--- src/sys/common/pmap/tlb/pmap.h:1.13	Wed Jul  4 11:39:42 2012
+++ src/sys/common/pmap/tlb/pmap.h	Thu Jul  5 16:55:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.13 2012/07/04 11:39:42 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.14 2012/07/05 16:55:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,8 +107,8 @@ pt_entry_t *pmap_pte_reserve(struct pmap
 void pmap_pte_process(struct pmap *, vaddr_t, vaddr_t, pte_callback_t,
 	uintptr_t);
 void pmap_segtab_activate(struct pmap *, struct lwp *);
-void pmap_segtab_alloc(struct pmap *);
-void pmap_segtab_free(struct pmap *);
+void pmap_segtab_init(struct pmap *);
+void pmap_segtab_destroy(struct pmap *);
 extern kmutex_t pmap_segtab_lock;
 #endif /* _KERNEL */
 

Index: src/sys/common/pmap/tlb/pmap_segtab.c
diff -u src/sys/common/pmap/tlb/pmap_segtab.c:1.5 src/sys/common/pmap/tlb/pmap_segtab.c:1.6
--- src/sys/common/pmap/tlb/pmap_segtab.c:1.5	Wed Jul  4 11:39:42 2012
+++ src/sys/common/pmap/tlb/pmap_segtab.c	Thu Jul  5 16:55:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.5 2012/07/04 11:39:42 matt Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.6 2012/07/05 16:55:11 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.5 2012/07/04 11:39:42 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.6 2012/07/05 16:55:11 matt Exp $);
 
 /*
  *	Manages physical address maps.
@@ -134,7 +134,12 @@ pmap_segmap(struct pmap *pmap, vaddr_t v
 {
 	struct pmap_segtab *stp = pmap-pm_segtab;
 	KASSERT(pmap != pmap_kernel() || !pmap_md_direct_mapped_vaddr_p(va));
-	return stp-seg_tab[va  SEGSHIFT];
+#ifdef _LP64
+	stp = stp-seg_seg[(va  XSEGSHIFT)  (NSEGPG - 1)];
+	if (stp == NULL)
+		return NULL;
+#endif
+	return stp-seg_tab[(va  SEGSHIFT)  (PMAP_SEGTABSIZE - 1)];
 }
 
 pt_entry_t *
@@ -147,6 +152,55 @@ pmap_pte_lookup(pmap_t pmap, vaddr_t va)
 	return pte + ((va  PGSHIFT)  (NPTEPG - 1));
 }
 
+static void
+pmap_segtab_free(struct pmap_segtab *stp)
+{
+	/*
+	 * Insert the the segtab into the segtab freelist.
+	 */
+	mutex_spin_enter(pmap_segtab_lock);
+	stp-seg_tab[0] = (void *) pmap_segtab_info.free_segtab;
+	pmap_segtab_info.free_segtab = stp;
+	SEGTAB_ADD(nput, 1);
+	mutex_spin_exit(pmap_segtab_lock);
+}
+
+static void
+pmap_segtab_release(struct pmap_segtab *stp, u_int level)
+{
+
+	for (size_t i = 0; i  PMAP_SEGTABSIZE; i++) {
+		paddr_t pa;
+#ifdef 

CVS commit: [netbsd-6] src/tools/gcc

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:20:06 UTC 2012

Modified Files:
src/tools/gcc [netbsd-6]: Makefile

Log Message:
Pull up following revision(s) (requested by dogcow in ticket #390):
tools/gcc/Makefile: revision 1.51
Always use system zlib. Avoids the need for 32bit build environment when
bootstrapping on some Linux distros. We require zlib to be present anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.2.1 src/tools/gcc/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/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.50 src/tools/gcc/Makefile:1.50.2.1
--- src/tools/gcc/Makefile:1.50	Tue Jan 10 12:27:54 2012
+++ src/tools/gcc/Makefile	Thu Jul  5 17:20:06 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.50 2012/01/10 12:27:54 skrll Exp $
+#	$NetBSD: Makefile,v 1.50.2.1 2012/07/05 17:20:06 riz Exp $
 
 .include bsd.own.mk
 
@@ -38,6 +38,7 @@ COMMON_CONFIGURE_ARGS=	--target=${MACHIN
 			--enable-threads \
 			--with-bugurl=http://www.NetBSD.org/Misc/send-pr.html \
 			--with-pkgversion=NetBSD nb2 20111202 \
+			--with-system-zlib \
 			${VAX_CONFIGURE_ARGS} \
 			--enable-__cxa_atexit
 .if defined(GCC_CONFIG_ARCH.${MACHINE_ARCH})



CVS commit: src/sys/arch/mips

2012-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  5 17:21:02 UTC 2012

Modified Files:
src/sys/arch/mips/include: pmap.h
src/sys/arch/mips/mips: pmap.c pmap_segtab.c

Log Message:
Change lockless segtab management to use a mutex for protection.  Some minor
changes to make this closer to common/pmap/tlb/pmap_segtab.c


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.207 -r1.208 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/mips/pmap_segtab.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/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.61 src/sys/arch/mips/include/pmap.h:1.62
--- src/sys/arch/mips/include/pmap.h:1.61	Thu Sep 22 05:08:52 2011
+++ src/sys/arch/mips/include/pmap.h	Thu Jul  5 17:21:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.61 2011/09/22 05:08:52 macallan Exp $	*/
+/*	$NetBSD: pmap.h,v 1.62 2012/07/05 17:21:02 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -148,6 +148,7 @@ void pmap_pte_process(struct pmap *, vad
 void pmap_segtab_activate(struct pmap *, struct lwp *);
 void pmap_segtab_init(struct pmap *);
 void pmap_segtab_destroy(struct pmap *);
+extern kmutex_t pmap_segtab_lock;
 #endif /* _KERNEL */
 
 /*

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.207 src/sys/arch/mips/mips/pmap.c:1.208
--- src/sys/arch/mips/mips/pmap.c:1.207	Thu Feb  2 18:59:44 2012
+++ src/sys/arch/mips/mips/pmap.c	Thu Jul  5 17:21:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.207 2012/02/02 18:59:44 para Exp $	*/
+/*	$NetBSD: pmap.c,v 1.208 2012/07/05 17:21:02 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.207 2012/02/02 18:59:44 para Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.208 2012/07/05 17:21:02 matt Exp $);
 
 /*
  *	Manages physical address maps.
@@ -276,8 +276,8 @@ struct pmap * const kernel_pmap_ptr = k
 paddr_t mips_avail_start;	/* PA of first available physical page */
 paddr_t mips_avail_end;		/* PA of last available physical page */
 vaddr_t mips_virtual_end;	/* VA of last avail page (end of kernel AS) */
-vaddr_t iospace;/* VA of start of I/O space, if needed  */
-vsize_t iospace_size = 0; /* Size of (initial) range of I/O addresses */
+vaddr_t iospace;		/* VA of start of I/O space, if needed  */
+vsize_t iospace_size = 0;	/* Size of (initial) range of I/O addresses */
 
 pt_entry_t	*Sysmap;		/* kernel pte table */
 unsigned int	Sysmapsize;		/* number of pte's in Sysmap */
@@ -739,6 +739,11 @@ pmap_init(void)
 #endif
 
 	/*
+	 * Initialize the segtab lock.
+	 */
+	mutex_init(pmap_segtab_lock, MUTEX_DEFAULT, IPL_HIGH);
+
+	/*
 	 * Set a low water mark on the pv_entry pool, so that we are
 	 * more likely to have these around even in extreme memory
 	 * starvation.
@@ -2108,11 +2113,11 @@ pmap_enter_pv(pmap_t pmap, vaddr_t va, s
 	pv_entry_t pv, npv, apv;
 	int16_t gen;
 
-KASSERT(kpreempt_disabled());
-KASSERT(!MIPS_KSEG0_P(va));
-KASSERT(!MIPS_KSEG1_P(va));
+	KASSERT(kpreempt_disabled());
+	KASSERT(!MIPS_KSEG0_P(va));
+	KASSERT(!MIPS_KSEG1_P(va));
 #ifdef _LP64
-KASSERT(!MIPS_XKPHYS_P(va));
+	KASSERT(!MIPS_XKPHYS_P(va));
 #endif
 
 	apv = NULL;

Index: src/sys/arch/mips/mips/pmap_segtab.c
diff -u src/sys/arch/mips/mips/pmap_segtab.c:1.4 src/sys/arch/mips/mips/pmap_segtab.c:1.5
--- src/sys/arch/mips/mips/pmap_segtab.c:1.4	Thu Jan 26 02:14:08 2012
+++ src/sys/arch/mips/mips/pmap_segtab.c	Thu Jul  5 17:21:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.4 2012/01/26 02:14:08 matt Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.5 2012/07/05 17:21:02 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.4 2012/01/26 02:14:08 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.5 2012/07/05 17:21:02 matt Exp $);
 
 /*
  *	Manages physical address maps.
@@ -119,13 +119,8 @@ __KERNEL_RCSID(0, $NetBSD: pmap_segtab.
 #include sys/param.h
 #include sys/systm.h
 #include sys/proc.h
-#include sys/pool.h
 #include sys/mutex.h
 #include sys/atomic.h
-#ifdef SYSVSHM
-#include sys/shm.h
-#endif
-#include sys/socketvar.h	/* XXX: for sock_loan_thresh */
 
 #include uvm/uvm.h
 
@@ -136,15 +131,19 @@ __KERNEL_RCSID(0, $NetBSD: pmap_segtab.
 
 CTASSERT(NBPG = sizeof(union segtab));
 
-union segtab * volatile free_segtab;		/* free list kept locally */
+struct pmap_segtab_info {
+	union segtab *free_segtab;		/* free list kept locally */
 #ifdef DEBUG
-uint32_t nget_segtab;
-uint32_t nput_segtab;
-uint32_t npage_segtab;
-#define	SEGTAB_ADD(n, v)	(n ## _segtab += (v))
+	uint32_t nget_segtab;
+	uint32_t nput_segtab;
+	uint32_t npage_segtab;
+#define	SEGTAB_ADD(n, v)	

CVS commit: [netbsd-6] src/libexec/getty

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:22:03 UTC 2012

Modified Files:
src/libexec/getty [netbsd-6]: main.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #391):
libexec/getty/main.c: revision 1.59
Don't attempt to parse a termcap/terminfo string ourselves;
always use tputs(3).


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.58.8.1 src/libexec/getty/main.c

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

Modified files:

Index: src/libexec/getty/main.c
diff -u src/libexec/getty/main.c:1.58 src/libexec/getty/main.c:1.58.8.1
--- src/libexec/getty/main.c:1.58	Wed Feb  3 15:34:43 2010
+++ src/libexec/getty/main.c	Thu Jul  5 17:22:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.58 2010/02/03 15:34:43 roy Exp $	*/
+/*	$NetBSD: main.c,v 1.58.8.1 2012/07/05 17:22:02 riz Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = from: @(#)main.c	8.1 (Berkeley) 6/20/93;
 #else
-__RCSID($NetBSD: main.c,v 1.58 2010/02/03 15:34:43 roy Exp $);
+__RCSID($NetBSD: main.c,v 1.58.8.1 2012/07/05 17:22:02 riz Exp $);
 #endif
 #endif /* not lint */
 
@@ -173,11 +173,12 @@ timeoverrun(int signo)
 static int	getname(void);
 static void	oflush(void);
 static void	prompt(void);
-static void	putchr(int);
+static int	putchr(int);
 static void	putf(const char *);
-static void	putpad(const char *);
 static void	xputs(const char *);
 
+#define putpad(s) tputs(s, 1, putchr)
+
 int
 main(int argc, char *argv[], char *envp[])
 {
@@ -566,43 +567,6 @@ getname(void)
 }
 
 static void
-putpad(const char *s)
-{
-	int pad = 0;
-	speed_t ospd = cfgetospeed(tmode);
-
-	if (isdigit((unsigned char)*s)) {
-		while (isdigit((unsigned char)*s)) {
-			pad *= 10;
-			pad += *s++ - '0';
-		}
-		pad *= 10;
-		if (*s == '.'  isdigit((unsigned char)s[1])) {
-			pad += s[1] - '0';
-			s += 2;
-		}
-	}
-
-	xputs(s);
-	/*
-	 * If no delay needed, or output speed is
-	 * not comprehensible, then don't try to delay.
-	 */
-	if (pad == 0)
-		return;
-
-	/*
-	 * Round up by a half a character frame, and then do the delay.
-	 * Too bad there are no user program accessible programmed delays.
-	 * Transmitting pad characters slows many terminals down and also
-	 * loads the system.
-	 */
-	pad = (pad * ospd + 5) / 10;
-	while (pad--)
-		putchr(*PC);
-}
-
-static void
 xputs(const char *s)
 {
 	while (*s)
@@ -612,7 +576,7 @@ xputs(const char *s)
 char	outbuf[OBUFSIZ];
 size_t	obufcnt = 0;
 
-static void
+static int
 putchr(int cc)
 {
 	unsigned char c;
@@ -627,8 +591,9 @@ putchr(int cc)
 		outbuf[obufcnt++] = c;
 		if (obufcnt = OBUFSIZ)
 			oflush();
-	} else
-		(void)write(STDOUT_FILENO, c, 1);
+		return 1;
+	}
+	return write(STDOUT_FILENO, c, 1);
 }
 
 static void



CVS commit: src/sys/common/pmap/tlb

2012-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  5 17:24:54 UTC 2012

Modified Files:
src/sys/common/pmap/tlb: pmap.h pmap_segtab.c

Log Message:
Change seg_tab to seg_ptr and make it a void * from a pt_entry_t * since it
also needs to point to struct pmap_segtab * when used in a 3-level page table.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/common/pmap/tlb/pmap.h
cvs rdiff -u -r1.6 -r1.7 src/sys/common/pmap/tlb/pmap_segtab.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/common/pmap/tlb/pmap.h
diff -u src/sys/common/pmap/tlb/pmap.h:1.14 src/sys/common/pmap/tlb/pmap.h:1.15
--- src/sys/common/pmap/tlb/pmap.h:1.14	Thu Jul  5 16:55:11 2012
+++ src/sys/common/pmap/tlb/pmap.h	Thu Jul  5 17:24:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.14 2012/07/05 16:55:11 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.15 2012/07/05 17:24:54 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -95,7 +95,7 @@ UVMHIST_DECL(pmaphist);
  * Each seg_tab point an array of pt_entry [NPTEPG]
  */
 struct pmap_segtab {
-	pt_entry_t	*seg_tab[PMAP_SEGTABSIZE];
+	void	*seg_ptr[PMAP_SEGTABSIZE];
 };
 
 #ifdef _KERNEL

Index: src/sys/common/pmap/tlb/pmap_segtab.c
diff -u src/sys/common/pmap/tlb/pmap_segtab.c:1.6 src/sys/common/pmap/tlb/pmap_segtab.c:1.7
--- src/sys/common/pmap/tlb/pmap_segtab.c:1.6	Thu Jul  5 16:55:11 2012
+++ src/sys/common/pmap/tlb/pmap_segtab.c	Thu Jul  5 17:24:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.6 2012/07/05 16:55:11 matt Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.7 2012/07/05 17:24:54 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.6 2012/07/05 16:55:11 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.7 2012/07/05 17:24:54 matt Exp $);
 
 /*
  *	Manages physical address maps.
@@ -135,11 +135,11 @@ pmap_segmap(struct pmap *pmap, vaddr_t v
 	struct pmap_segtab *stp = pmap-pm_segtab;
 	KASSERT(pmap != pmap_kernel() || !pmap_md_direct_mapped_vaddr_p(va));
 #ifdef _LP64
-	stp = stp-seg_seg[(va  XSEGSHIFT)  (NSEGPG - 1)];
+	stp = stp-seg_ptr[(va  XSEGSHIFT)  (NSEGPG - 1)];
 	if (stp == NULL)
 		return NULL;
 #endif
-	return stp-seg_tab[(va  SEGSHIFT)  (PMAP_SEGTABSIZE - 1)];
+	return stp-seg_ptr[(va  SEGSHIFT)  (PMAP_SEGTABSIZE - 1)];
 }
 
 pt_entry_t *
@@ -159,7 +159,7 @@ pmap_segtab_free(struct pmap_segtab *stp
 	 * Insert the the segtab into the segtab freelist.
 	 */
 	mutex_spin_enter(pmap_segtab_lock);
-	stp-seg_tab[0] = (void *) pmap_segtab_info.free_segtab;
+	stp-seg_ptr[0] = pmap_segtab_info.free_segtab;
 	pmap_segtab_info.free_segtab = stp;
 	SEGTAB_ADD(nput, 1);
 	mutex_spin_exit(pmap_segtab_lock);
@@ -173,16 +173,16 @@ pmap_segtab_release(struct pmap_segtab *
 		paddr_t pa;
 #ifdef _LP64
 		if (level  0) {
-			if (stp-seg_seg[i] != NULL) {
-pmap_segtab_release(stp-seg_seg[i], level - 1);
-stp-seg_seg[i] = NULL;
+			if (stp-seg_ptr[i] != NULL) {
+pmap_segtab_release(stp-seg_ptr[i], level - 1);
+stp-seg_ptr[i] = NULL;
 			}
 			continue;
 		}
 #endif
 
 		/* get pointer to segment map */
-		pt_entry_t *pte = stp-seg_tab[i];
+		pt_entry_t *pte = stp-seg_ptr[i];
 		if (pte == NULL)
 			continue;
 #ifdef PARANOIADIAG
@@ -195,7 +195,7 @@ pmap_segtab_release(struct pmap_segtab *
 		pa = POOL_VTOPHYS(pte);
 		uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 
-		stp-seg_tab[i] = NULL;
+		stp-seg_ptr[i] = NULL;
 	}
 
 	pmap_segtab_free(stp);
@@ -221,9 +221,8 @@ pmap_segtab_alloc(void)
  again:
 	mutex_spin_enter(pmap_segtab_lock);
 	if (__predict_true((stp = pmap_segtab_info.free_segtab) != NULL)) {
-		pmap_segtab_info.free_segtab =
-		(struct pmap_segtab *)stp-seg_tab[0];
-		stp-seg_tab[0] = NULL;
+		pmap_segtab_info.free_segtab = stp-seg_ptr[0];
+		stp-seg_ptr[0] = NULL;
 		SEGTAB_ADD(nget, 1);
 	}
 	mutex_spin_exit(pmap_segtab_lock);
@@ -248,13 +247,13 @@ pmap_segtab_alloc(void)
 			 * link all the segtabs in this page together
 			 */
 			for (size_t i = 1; i  n - 1; i++) {
-stp[i].seg_tab[0] = (void *)stp[i+1];
+stp[i].seg_ptr[0] = (void *)stp[i+1];
 			}
 			/*
 			 * Now link the new segtabs into the free segtab list.
 			 */
 			mutex_spin_enter(pmap_segtab_lock);
-			stp[n-1].seg_tab[0] = (void *)pmap_segtab_info.free_segtab;
+			stp[n-1].seg_ptr[0] = pmap_segtab_info.free_segtab;
 			pmap_segtab_info.free_segtab = stp + 1;
 			SEGTAB_ADD(nput, n - 1);
 			mutex_spin_exit(pmap_segtab_lock);
@@ -263,8 +262,8 @@ pmap_segtab_alloc(void)
 
 #ifdef PARANOIADIAG
 	for (i = 0; i  PMAP_SEGTABSIZE; i++) {
-		if (stp-seg_tab[i] != 0)
-			panic(pmap_create: pm_segtab.seg_tab[%zu] != 0);
+		if (stp-seg_ptr[i] != 0)
+			panic(pmap_create: pm_segtab.seg_ptr[%zu] != 0);
 	}
 #endif
 	return stp;
@@ -313,7 +312,7 @@ pmap_segtab_activate(struct pmap *pm, st
 		} else {
 			l-l_cpu-ci_pmap_user_segtab = pm-pm_segtab;
 #ifdef 

CVS commit: src/sys/arch/powerpc/booke

2012-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  5 17:25:36 UTC 2012

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c trap.c

Log Message:
s/seg_tab/seg_ptr/


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/booke/booke_pmap.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/booke/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.13 src/sys/arch/powerpc/booke/booke_pmap.c:1.14
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.13	Thu Mar 29 15:48:20 2012
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Thu Jul  5 17:25:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.13 2012/03/29 15:48:20 matt Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.14 2012/07/05 17:25:36 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: booke_pmap.c,v 1.13 2012/03/29 15:48:20 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: booke_pmap.c,v 1.14 2012/07/05 17:25:36 matt Exp $);
 
 #include sys/param.h
 #include sys/kcore.h
@@ -126,7 +126,7 @@ pmap_md_direct_mapped_vaddr_to_paddr(vad
 static pt_entry_t *
 kvtopte(const struct pmap_segtab *stp, vaddr_t va)
 {
-	pt_entry_t * const ptep = stp-seg_tab[va  SEGSHIFT];
+	pt_entry_t * const ptep = stp-seg_ptr[va  SEGSHIFT];
 	if (ptep == NULL)
 		return NULL;
 	return ptep[(va  SEGOFSET)  PAGE_SHIFT];
@@ -226,7 +226,7 @@ pmap_bootstrap(vaddr_t startkernel, vadd
 	 * an extra page for the segment table and allows the user/kernel
 	 * access to be common.
 	 */
-	pt_entry_t **ptp = stp-seg_tab[VM_MIN_KERNEL_ADDRESS  SEGSHIFT];
+	void **ptp = stp-seg_ptr[VM_MIN_KERNEL_ADDRESS  SEGSHIFT];
 	pt_entry_t *ptep = (void *)kv_segtabs;
 	memset(ptep, 0, NBPG * kv_nsegtabs);
 	for (size_t i = 0; i  kv_nsegtabs; i++, ptep += NPTEPG) {
@@ -244,7 +244,7 @@ pmap_bootstrap(vaddr_t startkernel, vadd
 	avail[0].size -= NBPG * dm_nsegtabs;
 	endkernel += NBPG * dm_nsegtabs;
 
-	ptp = stp-seg_tab;
+	ptp = stp-seg_ptr;
 	ptep = (void *)dm_segtabs;
 	memset(ptep, 0, NBPG * dm_nsegtabs);
 	for (size_t i = 0; i  dm_nsegtabs; i++, ptp++, ptep += NPTEPG) {

Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.15 src/sys/arch/powerpc/booke/trap.c:1.16
--- src/sys/arch/powerpc/booke/trap.c:1.15	Thu May 17 16:22:38 2012
+++ src/sys/arch/powerpc/booke/trap.c	Thu Jul  5 17:25:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.15 2012/05/17 16:22:38 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.16 2012/07/05 17:25:36 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.15 2012/05/17 16:22:38 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.16 2012/07/05 17:25:36 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -148,7 +148,7 @@ trap_pte_lookup(struct trapframe *tf, va
 	struct pmap_segtab * const stp = stps[(tf-tf_srr1 / psl_mask)  1];
 	if (__predict_false(stp == NULL))
 		return NULL;
-	pt_entry_t *ptep = stp-seg_tab[va  SEGSHIFT];
+	pt_entry_t * const ptep = stp-seg_ptr[va  SEGSHIFT];
 	if (__predict_false(ptep == NULL))
 		return NULL;
 	return ptep + ((va  SEGOFSET)  PAGE_SHIFT);



CVS commit: [netbsd-6] src/lib

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:26:14 UTC 2012

Modified Files:
src/lib/libperfuse [netbsd-6]: ops.c perfuse_priv.h
src/lib/libpuffs [netbsd-6]: dispatcher.c puffs.h puffs_ops.3

Log Message:
Pull up following revision(s) (requested by manu in ticket #392):
lib/libpuffs/puffs_ops.3: revision 1.32
lib/libperfuse/ops.c: revision 1.58
lib/libpuffs/puffs.h: revision 1.122
lib/libpuffs/dispatcher.c: revision 1.41
lib/libperfuse/perfuse_priv.h: revision 1.30
Pass the FAF flag to handlers:
- setattr_ttl is updated to add a flag argument. Since it was not
present in
  a previous release, we can change its API
- write2 is introduced, this is write with an extra flag for FAF.
- fsync already has the FAF information in a flag and needs no change
- for other operations, FAF is unconditional
Fix the build by adding (unused) flags argument to
perfuse_node_setattr_ttl


To generate a diff of this commit:
cvs rdiff -u -r1.50.2.4 -r1.50.2.5 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.25.2.2 -r1.25.2.3 src/lib/libperfuse/perfuse_priv.h
cvs rdiff -u -r1.38.2.1 -r1.38.2.2 src/lib/libpuffs/dispatcher.c
cvs rdiff -u -r1.119.4.1 -r1.119.4.2 src/lib/libpuffs/puffs.h
cvs rdiff -u -r1.29.4.1 -r1.29.4.2 src/lib/libpuffs/puffs_ops.3

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.50.2.4 src/lib/libperfuse/ops.c:1.50.2.5
--- src/lib/libperfuse/ops.c:1.50.2.4	Sun Jun 24 16:07:12 2012
+++ src/lib/libperfuse/ops.c	Thu Jul  5 17:26:14 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.50.2.4 2012/06/24 16:07:12 jdc Exp $ */
+/*  $NetBSD: ops.c,v 1.50.2.5 2012/07/05 17:26:14 riz Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -1680,13 +1680,13 @@ perfuse_node_setattr(struct puffs_usermo
 	const struct vattr *vap, const struct puffs_cred *pcr)
 {
 	return perfuse_node_setattr_ttl(pu, opc, 
-	__UNCONST(vap), pcr, NULL);
+	__UNCONST(vap), pcr, NULL, 0);
 }
 
 int
 perfuse_node_setattr_ttl(struct puffs_usermount *pu, puffs_cookie_t opc,
 	struct vattr *vap, const struct puffs_cred *pcr,
-	struct timespec *va_ttl)
+	struct timespec *va_ttl, int flags)
 {
 	perfuse_msg_t *pm;
 	uint64_t fh;

Index: src/lib/libperfuse/perfuse_priv.h
diff -u src/lib/libperfuse/perfuse_priv.h:1.25.2.2 src/lib/libperfuse/perfuse_priv.h:1.25.2.3
--- src/lib/libperfuse/perfuse_priv.h:1.25.2.2	Mon Apr 23 16:48:59 2012
+++ src/lib/libperfuse/perfuse_priv.h	Thu Jul  5 17:26:14 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_priv.h,v 1.25.2.2 2012/04/23 16:48:59 riz Exp $ */
+/*  $NetBSD: perfuse_priv.h,v 1.25.2.3 2012/07/05 17:26:14 riz Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -259,7 +259,7 @@ int perfuse_node_getattr_ttl(struct puff
 struct timespec *);
 int perfuse_node_setattr_ttl(struct puffs_usermount *,
 puffs_cookie_t, struct vattr *, const struct puffs_cred *,
-struct timespec *);
+struct timespec *, int flags);
 
 struct perfuse_trace *perfuse_trace_begin(struct perfuse_state *, 
 puffs_cookie_t, perfuse_msg_t *);

Index: src/lib/libpuffs/dispatcher.c
diff -u src/lib/libpuffs/dispatcher.c:1.38.2.1 src/lib/libpuffs/dispatcher.c:1.38.2.2
--- src/lib/libpuffs/dispatcher.c:1.38.2.1	Mon Apr 23 16:48:57 2012
+++ src/lib/libpuffs/dispatcher.c	Thu Jul  5 17:26:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: dispatcher.c,v 1.38.2.1 2012/04/23 16:48:57 riz Exp $	*/
+/*	$NetBSD: dispatcher.c,v 1.38.2.2 2012/07/05 17:26:14 riz Exp $	*/
 
 /*
  * Copyright (c) 2006, 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #if !defined(lint)
-__RCSID($NetBSD: dispatcher.c,v 1.38.2.1 2012/04/23 16:48:57 riz Exp $);
+__RCSID($NetBSD: dispatcher.c,v 1.38.2.2 2012/07/05 17:26:14 riz Exp $);
 #endif /* !lint */
 
 #include sys/types.h
@@ -467,14 +467,19 @@ dispatch(struct puffs_cc *pcc)
 			PUFFS_MAKECRED(pcr, auxt-pvnr_cred);
 
 			if (PUFFS_USE_FS_TTL(pu)) {
+int xflag = 0;
+
 if (pops-puffs_node_setattr_ttl == NULL) {
 	error = EOPNOTSUPP;
 	break;
 }
 
+if (!PUFFSOP_WANTREPLY(preq-preq_opclass))
+	xflag |= PUFFS_SETATTR_FAF;
+
 error = pops-puffs_node_setattr_ttl(pu,
 opcookie, auxt-pvnr_va, pcr,
-auxt-pvnr_va_ttl);
+auxt-pvnr_va_ttl, xflag);
 			} else {
 if (pops-puffs_node_setattr == NULL) {
 	error = EOPNOTSUPP;
@@ -913,15 +918,27 @@ dispatch(struct puffs_cc *pcc)
 			struct puffs_vnmsg_write *auxt = auxbuf;
 			PUFFS_MAKECRED(pcr, auxt-pvnr_cred);
 
-			if (pops-puffs_node_write == NULL) {
+			if (pops-puffs_node_write2 != NULL) {
+int xflag = 0;
+
+if (!PUFFSOP_WANTREPLY(preq-preq_opclass))
+	xflag |= PUFFS_SETATTR_FAF;
+
+error = pops-puffs_node_write2(pu,
+opcookie, auxt-pvnr_data,
+auxt-pvnr_offset, 

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

2012-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  5 17:28:39 UTC 2012

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

Log Message:
Fix typo (assigned wrong variable).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/sys/arch/mips/mips/pmap_segtab.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_segtab.c
diff -u src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.15 src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.16
--- src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.15	Mon Feb 27 16:57:06 2012
+++ src/sys/arch/mips/mips/pmap_segtab.c	Thu Jul  5 17:28:39 2012
@@ -469,7 +469,7 @@ pmap_pte_reserve(pmap_t pmap, vaddr_t va
 			union segtab *ostp = atomic_cas_ptr(stp_p, NULL, nstp);
 			if (__predict_false(ostp != NULL)) {
 pmap_segtab_free(nstp);
-stp = ostp;
+nstp = ostp;
 			}
 #else
 			*stp_p = nstp;



CVS commit: [netbsd-6] src/distrib/utils/sysinst

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:29:16 UTC 2012

Modified Files:
src/distrib/utils/sysinst [netbsd-6]: disks.c msg.mi.de msg.mi.en
msg.mi.es msg.mi.fr msg.mi.pl

Log Message:
Pull up following revision(s) (requested by jdf in ticket #393):
distrib/utils/sysinst/msg.mi.de: revision 1.68
distrib/utils/sysinst/msg.mi.fr: revision 1.127
distrib/utils/sysinst/msg.mi.en: revision 1.173
distrib/utils/sysinst/disks.c: revision 1.124
distrib/utils/sysinst/msg.mi.pl: revision 1.84
distrib/utils/sysinst/msg.mi.es: revision 1.44
Changed returncodes to -1 of mount_disks in case of error (before, they were
inverted).
Add message mount_failed to be displayed when a mount fails, offering the
opportunity to go on anyway (fix for PR install/12020).


To generate a diff of this commit:
cvs rdiff -u -r1.123.2.1 -r1.123.2.2 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.61.2.1 -r1.61.2.2 src/distrib/utils/sysinst/msg.mi.de
cvs rdiff -u -r1.169.2.1 -r1.169.2.2 src/distrib/utils/sysinst/msg.mi.en
cvs rdiff -u -r1.39.2.1 -r1.39.2.2 src/distrib/utils/sysinst/msg.mi.es
cvs rdiff -u -r1.119.2.1 -r1.119.2.2 src/distrib/utils/sysinst/msg.mi.fr
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 src/distrib/utils/sysinst/msg.mi.pl

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

Modified files:

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.123.2.1 src/distrib/utils/sysinst/disks.c:1.123.2.2
--- src/distrib/utils/sysinst/disks.c:1.123.2.1	Wed Jul  4 20:48:55 2012
+++ src/distrib/utils/sysinst/disks.c	Thu Jul  5 17:29:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.123.2.1 2012/07/04 20:48:55 jdc Exp $ */
+/*	$NetBSD: disks.c,v 1.123.2.2 2012/07/05 17:29:15 riz Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -849,8 +849,12 @@ foundffs(struct data *list, size_t num)
 		return error;
 
 	error = target_mount(, list[0].u.s_val, ' '-'a', list[1].u.s_val);
-	if (error != 0)
-		return error;
+	if (error != 0) {
+		msg_display(MSG_mount_failed, list[0].u.s_val);
+		process_menu(MENU_noyes, NULL);
+		if (!yesno)
+			return error;
+	}
 	return 0;
 }
 
@@ -898,7 +902,9 @@ fsck_preen(const char *disk, int ptn, co
 	free(prog);
 	if (error != 0) {
 		msg_display(MSG_badfs, disk, ptn, error);
-		process_menu(MENU_ok, NULL);
+		process_menu(MENU_noyes, NULL);
+		if (yesno)
+			error = 0;
 		/* XXX at this point maybe we should run a full fsck? */
 	}
 	return error;
@@ -1010,7 +1016,7 @@ mount_disks(void)
 	else {
 		error = mount_root();
 		if (error != 0  error != EBUSY)
-			return 0;
+			return -1;
 	}
 
 	/* Check the target /etc/fstab exists before trying to parse it. */
@@ -1018,7 +1024,7 @@ mount_disks(void)
 	target_file_exists_p(/etc/fstab) == 0) {
 		msg_display(MSG_noetcfstab, diskdev);
 		process_menu(MENU_ok, NULL);
-		return 0;
+		return -1;
 	}
 
 
@@ -1028,7 +1034,7 @@ mount_disks(void)
 		/* error ! */
 		msg_display(MSG_badetcfstab, diskdev);
 		process_menu(MENU_ok, NULL);
-		return 0;
+		return -1;
 	}
 	error = walk(fstab, (size_t)fstabsize, fstabbuf, numfstabbuf);
 	free(fstab);

Index: src/distrib/utils/sysinst/msg.mi.de
diff -u src/distrib/utils/sysinst/msg.mi.de:1.61.2.1 src/distrib/utils/sysinst/msg.mi.de:1.61.2.2
--- src/distrib/utils/sysinst/msg.mi.de:1.61.2.1	Thu May 17 18:57:09 2012
+++ src/distrib/utils/sysinst/msg.mi.de	Thu Jul  5 17:29:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.61.2.1 2012/05/17 18:57:09 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.61.2.2 2012/07/05 17:29:15 riz Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -124,6 +124,9 @@ Wollen Sie die NetBSD Distributionssets 
 überschrieben werden!)
 }
 
+message mount_failed
+{Versuch, %s zu mounten ist fehlgeschlagen. Fortfahren?
+}
 
 message nodisk
 {Ich kann keine für NetBSD nutzbaren Festplatten finden.
@@ -711,9 +714,9 @@ message makedev
 
 message badfs
 {Das Dateisystem auf /dev/%s%c scheint kein BSD-Dateisystem zu sein,
-die Prüfung des Dateisystems (fsck) ist fehlgeschlagen.
+die Prüfung des Dateisystems (fsck) ist fehlgeschlagen (Fehler %d).
 
-Die Aktualisierung wird abgebrochen. (Fehlernummer %d.)
+Die Aktualisierung trotzdem fortsetzen?
 }
 
 message rootmissing

Index: src/distrib/utils/sysinst/msg.mi.en
diff -u src/distrib/utils/sysinst/msg.mi.en:1.169.2.1 src/distrib/utils/sysinst/msg.mi.en:1.169.2.2
--- src/distrib/utils/sysinst/msg.mi.en:1.169.2.1	Thu May 17 18:57:10 2012
+++ src/distrib/utils/sysinst/msg.mi.en	Thu Jul  5 17:29:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.169.2.1 2012/05/17 18:57:10 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.169.2.2 2012/07/05 17:29:15 riz Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -117,6 +117,9 @@ Do you really want to reinstall NetBSD d
 disks.)
 }
 
+message mount_failed
+{Mounting %s failed. Continue?
+}
 
 message 

CVS commit: [netbsd-6] src/distrib/atari/floppies/common

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:33:59 UTC 2012

Modified Files:
src/distrib/atari/floppies/common [netbsd-6]: dot.profile

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #394):
distrib/atari/floppies/common/dot.profile: revision 1.4
Simply use mount -u to (re)mount root file system read-write
rather than denoting it using temporary /tmp/.root_writable file,
because it will never be removed if root file system is on floppy.
Fixes PR port-atari/37470.
Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.10.1 src/distrib/atari/floppies/common/dot.profile

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

Modified files:

Index: src/distrib/atari/floppies/common/dot.profile
diff -u src/distrib/atari/floppies/common/dot.profile:1.3 src/distrib/atari/floppies/common/dot.profile:1.3.10.1
--- src/distrib/atari/floppies/common/dot.profile:1.3	Mon Nov 17 20:14:35 2008
+++ src/distrib/atari/floppies/common/dot.profile	Thu Jul  5 17:33:59 2012
@@ -1,4 +1,4 @@
-# $NetBSD: dot.profile,v 1.3 2008/11/17 20:14:35 abs Exp $
+# $NetBSD: dot.profile,v 1.3.10.1 2012/07/05 17:33:59 riz Exp $
 #
 # Copyright (c) 1995 Jason R. Thorpe
 # Copyright (c) 1994 Christopher G. Demetriou
@@ -47,16 +47,13 @@ export EDITOR
 umask 022
 
 makerootwritable() {
-	if [ ! -e /tmp/.root_writable ]; then
-		# note, only handles up to partition 'j'
-		rootdev=/dev/$(sysctl -n kern.root_device)$(sysctl -n kern.root_partition | sed y/0123456789/abcdefghij/)
-		if ! mount $rootdev / ; then
-		echo Unable to mount $rootdev read-write
-		exit 1
-		fi
-		cp /dev/null /tmp/.root_writable
-		echo Mounted $rootdev read-write
+	# note, only handles up to partition 'j'
+	rootdev=/dev/$(sysctl -n kern.root_device)$(sysctl -n kern.root_partition | sed y/0123456789/abcdefghij/)
+	if ! mount -u $rootdev / ; then
+	echo Unable to mount $rootdev read-write
+	exit 1
 	fi
+	echo Mounted $rootdev read-write
 }
 
 if [ X${DONEPROFILE} = X ]; then



CVS commit: [netbsd-6] src/sys

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:36:31 UTC 2012

Modified Files:
src/sys/arch/atari/atari [netbsd-6]: autoconf.c
src/sys/dev [netbsd-6]: md.c
src/sys/fs/msdosfs [netbsd-6]: msdosfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #395):
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.95
sys/arch/atari/atari/autoconf.c: revision 1.62
sys/dev/md.c: revision 1.67
Add a dirty hack for atari's ancient installation ramdisk:
 Forcibly configure md0, md1, and md2 devices before setroot()
 for atari's traditional auto-load from floppy on open md_root device
 which loads installation ramdisk image from floppy.
 md(4) has been changed dynamically configured at first open after 5.0
 and md devices won't appear in root device: prompt without this hack.
Tested on TT030.
Should be pulled up to netbsd-6.
Make sure that disklabel of md(4) device is initialized
in the case where it's configured in MD md_open_hook().
Without this, msdosfs_mountfs() (which is called from msdosfs_mountroot())
will be called with uninitialized disklabel (d_secsize == 0) and
it gets panic: buf mem pool index 23 later on atari.
This is because getdisksize() doesn't check returned d_secsize value
and msdosfs_mountfs() blindly calls bread(9) with size==0 in that case.
Should be pulled up to netbsd-6 (at least for atari).
Add a sanity check if secsize returned from getdisksize() isn't bogus.
This prevent possible panic panic: buf mem pool index 23 later in
vfs_bio.c:buf_mempoolidx().
(I'm not sure if it's okay for getdisksize() to assume that
 partinfo taken from DIOCGPART is properly initialized
 on all disk(9) devices or not)
See also:
http://mail-index.NetBSD.org/source-changes/2012/06/30/msg035298.html


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.8.1 src/sys/arch/atari/atari/autoconf.c
cvs rdiff -u -r1.66 -r1.66.14.1 src/sys/dev/md.c
cvs rdiff -u -r1.93 -r1.93.6.1 src/sys/fs/msdosfs/msdosfs_vfsops.c

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

Modified files:

Index: src/sys/arch/atari/atari/autoconf.c
diff -u src/sys/arch/atari/atari/autoconf.c:1.61 src/sys/arch/atari/atari/autoconf.c:1.61.8.1
--- src/sys/arch/atari/atari/autoconf.c:1.61	Sun Jun  5 17:09:18 2011
+++ src/sys/arch/atari/atari/autoconf.c	Thu Jul  5 17:36:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.61 2011/06/05 17:09:18 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.61.8.1 2012/07/05 17:36:31 riz Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.61 2011/06/05 17:09:18 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.61.8.1 2012/07/05 17:36:31 riz Exp $);
+
+#include opt_md.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -41,10 +43,17 @@ __KERNEL_RCSID(0, $NetBSD: autoconf.c,v
 #include sys/device.h
 #include sys/disklabel.h
 #include sys/disk.h
+#include sys/malloc.h
 #include machine/disklabel.h
 #include machine/cpu.h
 #include atari/atari/device.h
 
+#if defined(MEMORY_DISK_HOOKS)
+#include dev/md.h
+#endif
+
+#include ioconf.h
+
 static void findroot(void);
 int mbmatch(device_t, cfdata_t, void *);
 void mbattach(device_t, device_t, void *);
@@ -75,6 +84,41 @@ cpu_rootconf(void)
 {
 
 	findroot();
+#if defined(MEMORY_DISK_HOOKS)
+	/*
+	 * XXX
+	 * quick hacks for atari's traditional auto-load from floppy on open
+	 * installation md(4) ramdisk.
+	 * See sys/arch/atari/dev/md_root.c for details.
+	 */
+#define RAMD_NDEV	3	/* XXX */
+
+	if ((boothowto  RB_ASKNAME) != 0) {
+		int md_major, i;
+		dev_t md_dev;
+		cfdata_t cf;
+		struct md_softc *sc;
+
+		md_major = devsw_name2blk(md, NULL, 0);
+		if (md_major = 0) {
+			for (i = 0; i  RAMD_NDEV; i++) {
+md_dev = MAKEDISKDEV(md_major, i, RAW_PART);
+cf = malloc(sizeof(*cf), M_DEVBUF,
+M_ZERO|M_WAITOK);
+if (cf == NULL)
+	break;	/* XXX */
+cf-cf_name = md_cd.cd_name;
+cf-cf_atname = md_cd.cd_name;
+cf-cf_unit = i;
+cf-cf_fstate = FSTATE_STAR;
+/* XXX mutex */
+sc = device_private(config_attach_pseudo(cf));
+if (sc == NULL)
+	break;	/* XXX */
+			}
+		}
+	}
+#endif
 	setroot(booted_device, booted_partition);
 }
 

Index: src/sys/dev/md.c
diff -u src/sys/dev/md.c:1.66 src/sys/dev/md.c:1.66.14.1
--- src/sys/dev/md.c:1.66	Thu Nov 25 08:53:30 2010
+++ src/sys/dev/md.c	Thu Jul  5 17:36:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.66 2010/11/25 08:53:30 hannken Exp $	*/
+/*	$NetBSD: md.c,v 1.66.14.1 2012/07/05 17:36:31 riz Exp $	*/
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: md.c,v 1.66 2010/11/25 08:53:30 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: md.c,v 1.66.14.1 2012/07/05 17:36:31 riz Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_md.h
@@ -243,6 +243,9 @@ mdopen(dev_t dev, int flag, int 

CVS commit: [netbsd-6] src

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:38:27 UTC 2012

Modified Files:
src/distrib/utils/sysinst [netbsd-6]: label.c
src/sbin/newfs [netbsd-6]: newfs.8 newfs.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #396):
sbin/newfs/newfs.8: revision 1.83
sbin/newfs/newfs.c: revision 1.111
distrib/utils/sysinst/label.c: revision 1.62
Use 32KB/4KB for default block/fragment size on = 128 GB partitions
for modern AFT disks.  No particular comments against PR install/46629.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.2.1 src/distrib/utils/sysinst/label.c
cvs rdiff -u -r1.82 -r1.82.6.1 src/sbin/newfs/newfs.8
cvs rdiff -u -r1.110 -r1.110.2.1 src/sbin/newfs/newfs.c

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

Modified files:

Index: src/distrib/utils/sysinst/label.c
diff -u src/distrib/utils/sysinst/label.c:1.61 src/distrib/utils/sysinst/label.c:1.61.2.1
--- src/distrib/utils/sysinst/label.c:1.61	Thu Jan  5 22:18:36 2012
+++ src/distrib/utils/sysinst/label.c	Thu Jul  5 17:38:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.61 2012/01/05 22:18:36 christos Exp $	*/
+/*	$NetBSD: label.c,v 1.61.2.1 2012/07/05 17:38:27 riz Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: label.c,v 1.61 2012/01/05 22:18:36 christos Exp $);
+__RCSID($NetBSD: label.c,v 1.61.2.1 2012/07/05 17:38:27 riz Exp $);
 #endif
 
 #include sys/types.h
@@ -213,8 +213,23 @@ set_ptype(partinfo *p, int fstype, int f
 	p-pi_fstype = fstype;
 	if (fstype == FS_BSDFFS || fstype == FS_BSDLFS) {
 		p-pi_frag = 8;
-		/* match newfs defaults for fragments size (2k if = 1024MB) */
-		p-pi_fsize = p-pi_size  1024*1024*1024 / 512 ? 2048 : 1024;
+		/*
+		 * match newfs defaults for fragments size:
+		 * fs size	frag size
+		 *  20 MB	0.5 KB
+		 *  1000 MB	1 KB
+		 *  128 GB	2 KB
+		 * = 128 GB	4 KB
+		 */
+	 	/* note pi_size is uint32_t so we have to avoid overflow */
+		if (p-pi_size  (20 * 1024 * (1024 / 512)))
+			p-pi_fsize = 512;
+		else if (p-pi_size  (1000 * 1024 * (1024 / 512)))
+			p-pi_fsize = 1024;
+		else if (p-pi_size  (128 * 1024 * 1024 * (1024 / 512)))
+			p-pi_fsize = 2048;
+		else
+			p-pi_fsize = 4096;
 	} else {
 		/* zero - fields not used */
 		p-pi_frag = 0;

Index: src/sbin/newfs/newfs.8
diff -u src/sbin/newfs/newfs.8:1.82 src/sbin/newfs/newfs.8:1.82.6.1
--- src/sbin/newfs/newfs.8:1.82	Sat May 14 19:46:10 2011
+++ src/sbin/newfs/newfs.8	Thu Jul  5 17:38:26 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: newfs.8,v 1.82 2011/05/14 19:46:10 dholland Exp $
+.\	$NetBSD: newfs.8,v 1.82.6.1 2012/07/05 17:38:26 riz Exp $
 .\
 .\ Copyright (c) 1983, 1987, 1991, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)newfs.8	8.6 (Berkeley) 5/3/95
 .\
-.Dd May 14, 2011
+.Dd June 30, 2012
 .Dt NEWFS 8
 .Os
 .Sh NAME
@@ -111,10 +111,12 @@ The default size depends upon the size o
 .Ar block-size
 .It \*[Lt] 20 MB
 4 KB
-.It \*[Lt] 1024 MB
+.It \*[Lt] 1000 MB
 8 KB
-.It \*[Gt]= 1024 MB
+.It \*[Lt] 128 GB
 16 KB
+.It \*[Gt]= 128 GB
+32 KB
 .El
 .It Fl d Ar maxbsize
 Set the maximum extent size to
@@ -151,10 +153,12 @@ The default size depends upon the size o
 .Ar frag-size
 .It \*[Lt] 20 MB
 0.5 KB
-.It \*[Lt] 1024 MB
+.It \*[Lt] 1000 MB
 1 KB
-.It \*[Gt]= 1024 MB
+.It \*[Lt] 128 GB
 2 KB
+.It \*[Gt]= 128 GB
+4 KB
 .El
 .It Fl G
 Treat garbage parameters as non-fatal.
@@ -182,10 +186,12 @@ bytes of data space:
 .Ar bytes-per-inode
 .It \*[Lt] 20 MB
 2 KB
-.It \*[Lt] 1024 MB
+.It \*[Lt] 1000 MB
 4 KB
-.It \*[Gt]= 1024 MB
+.It \*[Lt] 128 GB
 8 KB
+.It \*[Gt]= 128 GB
+16 KB
 .El
 .It Fl m Ar free-space
 The percentage of space reserved from normal users; the minimum free

Index: src/sbin/newfs/newfs.c
diff -u src/sbin/newfs/newfs.c:1.110 src/sbin/newfs/newfs.c:1.110.2.1
--- src/sbin/newfs/newfs.c:1.110	Mon Feb 13 12:59:56 2012
+++ src/sbin/newfs/newfs.c	Thu Jul  5 17:38:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs.c,v 1.110 2012/02/13 12:59:56 wiz Exp $	*/
+/*	$NetBSD: newfs.c,v 1.110.2.1 2012/07/05 17:38:27 riz Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1993, 1994
@@ -78,7 +78,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)newfs.c	8.13 (Berkeley) 5/1/95;
 #else
-__RCSID($NetBSD: newfs.c,v 1.110 2012/02/13 12:59:56 wiz Exp $);
+__RCSID($NetBSD: newfs.c,v 1.110.2.1 2012/07/05 17:38:27 riz Exp $);
 #endif
 #endif /* not lint */
 
@@ -157,14 +157,17 @@ const char lmsg[] = %s: can't read disk
  */
 /*
  * For file systems smaller than SMALL_FSSIZE we use the S_DFL_* defaults,
- * otherwise if less than MEDIUM_FSSIZE use M_DFL_*, otherwise use
- * L_DFL_*.
+ * otherwise if less than MEDIUM_FSSIZE use M_DFL_*,
+ * otherwise if less than LARGE_FSSIZE use L_DFL_*,
+ * otherwise use LL_DFL_* especially for modern 

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

2012-07-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  5 17:40:11 UTC 2012

Modified Files:
src/external/ibm-public/postfix/dist/src/dns: dns_lookup.c

Log Message:
use the modern resolver functions if available.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/ibm-public/postfix/dist/src/dns/dns_lookup.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/ibm-public/postfix/dist/src/dns/dns_lookup.c
diff -u src/external/ibm-public/postfix/dist/src/dns/dns_lookup.c:1.1.1.2 src/external/ibm-public/postfix/dist/src/dns/dns_lookup.c:1.2
--- src/external/ibm-public/postfix/dist/src/dns/dns_lookup.c:1.1.1.2	Thu Jun 17 14:06:44 2010
+++ src/external/ibm-public/postfix/dist/src/dns/dns_lookup.c	Thu Jul  5 13:40:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: dns_lookup.c,v 1.1.1.2 2010/06/17 18:06:44 tron Exp $	*/
+/*	$NetBSD: dns_lookup.c,v 1.2 2012/07/05 17:40:11 christos Exp $	*/
 
 /*++
 /* NAME
@@ -176,12 +176,37 @@ typedef struct DNS_REPLY {
 
 /* dns_query - query name server and pre-parse the reply */
 
+#if __RES  20030124
+
+static int
+res_ninit(res_state res)
+{
+	int error;
+
+	if ((error = res_init())  0)
+		return error;
+
+	*res = _res;
+	return error;
+}
+
+static int
+res_nsearch(res_state statp, const char *dname, int class, int type,
+u_char *answer, int anslen)
+{
+	return res_search(dname, class, type, answer, anslen);
+}
+
+#endif
+
 static int dns_query(const char *name, int type, int flags,
 		 DNS_REPLY *reply, VSTRING *why)
 {
 HEADER *reply_header;
 int len;
 unsigned long saved_options;
+/* For efficiency, we are not called from multiple threads */
+static struct __res_state res;
 
 /*
  * Initialize the reply buffer.
@@ -194,7 +219,7 @@ static int dns_query(const char *name, i
 /*
  * Initialize the name service.
  */
-if ((_res.options  RES_INIT) == 0  res_init()  0) {
+if ((res.options  RES_INIT) == 0  res_ninit(res)  0) {
 	if (why)
 	vstring_strcpy(why, Name service initialization failure);
 	return (DNS_FAIL);
@@ -208,18 +233,18 @@ static int dns_query(const char *name, i
 
 if ((flags  USER_FLAGS) != flags)
 	msg_panic(dns_query: bad flags: %d, flags);
-saved_options = (_res.options  USER_FLAGS);
+saved_options = (res.options  USER_FLAGS);
 
 /*
  * Perform the lookup. Claim that the information cannot be found if and
  * only if the name server told us so.
  */
 for (;;) {
-	_res.options = ~saved_options;
-	_res.options |= flags;
-	len = res_search((char *) name, C_IN, type, reply-buf, reply-buf_len);
-	_res.options = ~flags;
-	_res.options |= saved_options;
+	res.options = ~saved_options;
+	res.options |= flags;
+	len = res_nsearch(res, name, C_IN, type, reply-buf, reply-buf_len);
+	res.options = ~flags;
+	res.options |= saved_options;
 	if (len  0) {
 	if (why)
 		vstring_sprintf(why, Host or domain name not found. 



CVS commit: [netbsd-6] src/sys/netinet6

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:43:49 UTC 2012

Modified Files:
src/sys/netinet6 [netbsd-6]: frag6.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #398):
sys/netinet6/frag6.c: revision 1.53
Remove the wrapper of frag6_input(), restore the behaviour changed in r1.50.
Fix ip6_reass_packet() wrapper used by NPF.  Remove #if 0 code for handling
overlaping fragments - IPv6 desupported them anyway.  Convert to kmem(9).


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.2.1 src/sys/netinet6/frag6.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/netinet6/frag6.c
diff -u src/sys/netinet6/frag6.c:1.52 src/sys/netinet6/frag6.c:1.52.2.1
--- src/sys/netinet6/frag6.c:1.52	Sat Dec 31 20:41:59 2011
+++ src/sys/netinet6/frag6.c	Thu Jul  5 17:43:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.52 2011/12/31 20:41:59 christos Exp $	*/
+/*	$NetBSD: frag6.c,v 1.52.2.1 2012/07/05 17:43:49 riz Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,11 +31,10 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: frag6.c,v 1.52 2011/12/31 20:41:59 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: frag6.c,v 1.52.2.1 2012/07/05 17:43:49 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
-#include sys/malloc.h
 #include sys/mbuf.h
 #include sys/domain.h
 #include sys/protosw.h
@@ -43,6 +42,7 @@ __KERNEL_RCSID(0, $NetBSD: frag6.c,v 1.
 #include sys/socketvar.h
 #include sys/errno.h
 #include sys/time.h
+#include sys/kmem.h
 #include sys/kernel.h
 #include sys/syslog.h
 
@@ -84,6 +84,8 @@ frag6_init(void)
 }
 
 /*
+ * IPv6 fragment input.
+ *
  * In RFC2460, fragment and reassembly rule do not agree with each other,
  * in terms of next header field handling in fragment header.
  * While the sender will use the same value for all of the fragmented packets,
@@ -112,11 +114,8 @@ frag6_init(void)
  *
  * There is no explicit reason given in the RFC.  Historical reason maybe?
  */
-/*
- * Fragment input
- */
-static int
-frag6_in(struct mbuf **mp, int *offp)
+int
+frag6_input(struct mbuf **mp, int *offp, int proto)
 {
 	struct rtentry *rt;
 	struct mbuf *m = *mp, *t;
@@ -137,7 +136,7 @@ frag6_in(struct mbuf **mp, int *offp)
 	ip6 = mtod(m, struct ip6_hdr *);
 	IP6_EXTHDR_GET(ip6f, struct ip6_frag *, m, offset, sizeof(*ip6f));
 	if (ip6f == NULL)
-		return -1;
+		return IPPROTO_DONE;
 
 	dstifp = NULL;
 	/* find the destination interface of the packet. */
@@ -149,7 +148,7 @@ frag6_in(struct mbuf **mp, int *offp)
 	if (ip6-ip6_plen == 0) {
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset);
 		in6_ifstat_inc(dstifp, ifs6_reass_fail);
-		return -1;
+		return IPPROTO_DONE;
 	}
 
 	/*
@@ -163,7 +162,7 @@ frag6_in(struct mbuf **mp, int *offp)
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
 		offsetof(struct ip6_hdr, ip6_plen));
 		in6_ifstat_inc(dstifp, ifs6_reass_fail);
-		return -1;
+		return IPPROTO_DONE;
 	}
 
 	IP6_STATINC(IP6_STAT_FRAGMENTS);
@@ -208,11 +207,11 @@ frag6_in(struct mbuf **mp, int *offp)
 		else if (frag6_nfragpackets = (u_int)ip6_maxfragpackets)
 			goto dropfrag;
 		frag6_nfragpackets++;
-		q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FTABLE,
-		M_DONTWAIT);
-		if (q6 == NULL)
+
+		q6 = kmem_intr_zalloc(sizeof(struct ip6q), KM_NOSLEEP);
+		if (q6 == NULL) {
 			goto dropfrag;
-		memset(q6, 0, sizeof(*q6));
+		}
 		frag6_insque(q6, ip6q);
 
 		/* ip6q_nxt will be filled afterwards, from 1st fragment */
@@ -254,14 +253,14 @@ frag6_in(struct mbuf **mp, int *offp)
 			icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
 			offset - sizeof(struct ip6_frag) +
 			offsetof(struct ip6_frag, ip6f_offlg));
-			return -1;
+			return IPPROTO_DONE;
 		}
 	} else if (fragoff + frgpartlen  IPV6_MAXPACKET) {
 		mutex_exit(frag6_lock);
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
 			offset - sizeof(struct ip6_frag) +
 offsetof(struct ip6_frag, ip6f_offlg));
-		return -1;
+		return IPPROTO_DONE;
 	}
 	/*
 	 * If it's the first fragment, do the above check for each
@@ -280,7 +279,7 @@ frag6_in(struct mbuf **mp, int *offp)
 
 /* dequeue the fragment. */
 frag6_deq(af6);
-free(af6, M_FTABLE);
+kmem_intr_free(af6, sizeof(struct ip6asfrag));
 
 /* adjust pointer. */
 ip6err = mtod(merr, struct ip6_hdr *);
@@ -300,11 +299,10 @@ frag6_in(struct mbuf **mp, int *offp)
 		}
 	}
 
-	ip6af = (struct ip6asfrag *)malloc(sizeof(struct ip6asfrag), M_FTABLE,
-	M_DONTWAIT);
-	if (ip6af == NULL)
+	ip6af = kmem_intr_zalloc(sizeof(struct ip6asfrag), KM_NOSLEEP);
+	if (ip6af == NULL) {
 		goto dropfrag;
-	memset(ip6af, 0, sizeof(*ip6af));
+	}
 	ip6af-ip6af_head = ip6-ip6_flow;
 	ip6af-ip6af_len = ip6-ip6_plen;
 	ip6af-ip6af_nxt = ip6-ip6_nxt;
@@ -328,75 +326,25 @@ frag6_in(struct mbuf **mp, int *offp)
 		if (af6-ip6af_off  

CVS commit: [netbsd-6] src/sys/arch/x86/x86

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:52:54 UTC 2012

Modified Files:
src/sys/arch/x86/x86 [netbsd-6]: cpu.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #400):
sys/arch/x86/x86/cpu.c: revision 1.100
in cpu_boot_secondary_processors(), wait until all the other CPUs
have registered themselves in kcpuset_running before returning.
recent changes to the TLB invalidation xcall code assume that
any CPU which will receive a broadcast IPI is registered in
kcpuset_running, so ensure that is true by waiting here.


To generate a diff of this commit:
cvs rdiff -u -r1.96.8.2 -r1.96.8.3 src/sys/arch/x86/x86/cpu.c

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

Modified files:

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.96.8.2 src/sys/arch/x86/x86/cpu.c:1.96.8.3
--- src/sys/arch/x86/x86/cpu.c:1.96.8.2	Wed May  9 03:22:53 2012
+++ src/sys/arch/x86/x86/cpu.c	Thu Jul  5 17:52:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.96.8.2 2012/05/09 03:22:53 riz Exp $	*/
+/*	$NetBSD: cpu.c,v 1.96.8.3 2012/07/05 17:52:54 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.96.8.2 2012/05/09 03:22:53 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.96.8.3 2012/07/05 17:52:54 riz Exp $);
 
 #include opt_ddb.h
 #include opt_mpbios.h		/* for MPDEBUG */
@@ -589,12 +589,15 @@ void
 cpu_boot_secondary_processors(void)
 {
 	struct cpu_info *ci;
+	kcpuset_t *cpus;
 	u_long i;
 
 	/* Now that we know the number of CPUs, patch the text segment. */
 	x86_patch(false);
 
-	for (i=0; i  maxcpus; i++) {
+	kcpuset_create(cpus, true);
+	kcpuset_set(cpus, cpu_index(curcpu()));
+	for (i = 0; i  maxcpus; i++) {
 		ci = cpu_lookup(i);
 		if (ci == NULL)
 			continue;
@@ -605,7 +608,11 @@ cpu_boot_secondary_processors(void)
 		if (ci-ci_flags  (CPUF_BSP|CPUF_SP|CPUF_PRIMARY))
 			continue;
 		cpu_boot_secondary(ci);
+		kcpuset_set(cpus, cpu_index(ci));
 	}
+	while (!kcpuset_match(cpus, kcpuset_running))
+		;
+	kcpuset_destroy(cpus);
 
 	x86_mp_online = true;
 



CVS commit: [netbsd-6] src/sys/dev/ic

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 17:59:13 UTC 2012

Modified Files:
src/sys/dev/ic [netbsd-6]: gem.c gemreg.h gemvar.h

Log Message:
Pull up following revision(s) (requested by jdc in ticket #401):
sys/dev/ic/gem.c: revision 1.99
sys/dev/ic/gemvar.h: revision 1.24
sys/dev/ic/gemreg.h: revision 1.15
Apply lockup fixes from Havard Eidnes/OpenBSD in PR port-sparc64/46260:
- add an additional watchdog for RX overflow
- re-initialise the chip on device timeout
Also alter the interrupt blanking rate to 8 packets, as per OpenSolaris.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.98.2.1 src/sys/dev/ic/gem.c
cvs rdiff -u -r1.14 -r1.14.34.1 src/sys/dev/ic/gemreg.h
cvs rdiff -u -r1.23 -r1.23.2.1 src/sys/dev/ic/gemvar.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/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.98 src/sys/dev/ic/gem.c:1.98.2.1
--- src/sys/dev/ic/gem.c:1.98	Thu Feb  2 19:43:03 2012
+++ src/sys/dev/ic/gem.c	Thu Jul  5 17:59:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.98 2012/02/02 19:43:03 tls Exp $ */
+/*	$NetBSD: gem.c,v 1.98.2.1 2012/07/05 17:59:12 riz Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.98 2012/02/02 19:43:03 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.98.2.1 2012/07/05 17:59:12 riz Exp $);
 
 #include opt_inet.h
 
@@ -89,6 +89,7 @@ static void	gem_stop(struct ifnet *, int
 int		gem_ioctl(struct ifnet *, u_long, void *);
 void		gem_tick(void *);
 void		gem_watchdog(struct ifnet *);
+void		gem_rx_watchdog(void *);
 void		gem_pcs_start(struct gem_softc *sc);
 void		gem_pcs_stop(struct gem_softc *sc, int);
 int		gem_init(struct ifnet *);
@@ -177,6 +178,7 @@ gem_detach(struct gem_softc *sc, int fla
 		ifmedia_delete_instance(sc-sc_mii.mii_media, IFM_INST_ANY);
 
 		callout_destroy(sc-sc_tick_ch);
+		callout_destroy(sc-sc_rx_watchdog);
 
 		/*FALLTHROUGH*/
 	case GEM_ATT_MII:
@@ -613,6 +615,8 @@ gem_attach(struct gem_softc *sc, const u
 #endif
 
 	callout_init(sc-sc_tick_ch, 0);
+	callout_init(sc-sc_rx_watchdog, 0);
+	callout_setfunc(sc-sc_rx_watchdog, gem_rx_watchdog, sc);
 
 	sc-sc_att_stage = GEM_ATT_FINISHED;
 
@@ -764,6 +768,8 @@ gem_reset_rx(struct gem_softc *sc)
 	/* Wait till it finishes */
 	if (!gem_bitwait(sc, h, GEM_RX_CONFIG, 1, 0))
 		aprint_error_dev(sc-sc_dev, cannot disable read dma\n);
+	/* Wait 5ms extra. */
+	delay(5000);
 
 	/* Finally, reset the ERX */
 	bus_space_write_4(t, h2, GEM_RESET, GEM_RESET_RX);
@@ -848,7 +854,7 @@ gem_rx_common(struct gem_softc *sc)
 	(3 * sc-sc_rxfifosize / 256) |
 	((sc-sc_rxfifosize / 256)  12));
 	bus_space_write_4(t, h, GEM_RX_BLANKING,
-	(6  GEM_RX_BLANKING_TIME_SHIFT) | 6);
+	(6  GEM_RX_BLANKING_TIME_SHIFT) | 8);
 }
 
 /*
@@ -1824,6 +1830,8 @@ gem_rint(struct gem_softc *sc)
 		if (gem_add_rxbuf(sc, i) != 0) {
 			GEM_COUNTER_INCR(sc, sc_ev_rxnobuf);
 			ifp-if_ierrors++;
+			aprint_error_dev(sc-sc_dev,
+			receive error: RX no buffer space\n);
 			GEM_INIT_RXDESC(sc, i);
 			bus_dmamap_sync(sc-sc_dmatag, rxs-rxs_dmamap, 0,
 			rxs-rxs_dmamap-dm_mapsize, BUS_DMASYNC_PREREAD);
@@ -2204,12 +2212,20 @@ gem_intr(void *v)
 		/*
 		 * At least with GEM_SUN_GEM and some GEM_SUN_ERI
 		 * revisions GEM_MAC_RX_OVERFLOW happen often due to a
-		 * silicon bug so handle them silently. Moreover, it's
-		 * likely that the receiver has hung so we reset it.
+		 * silicon bug so handle them silently.  So if we detect
+		 * an RX FIFO overflow, we fire off a timer, and check
+		 * whether we're still making progress by looking at the
+		 * RX FIFO write and read pointers.
 		 */
 		if (rxstat  GEM_MAC_RX_OVERFLOW) {
 			ifp-if_ierrors++;
-			gem_reset_rxdma(sc);
+			aprint_error_dev(sc-sc_dev,
+			receive error: RX overflow sc-rxptr %d, complete %d\n, sc-sc_rxptr, bus_space_read_4(t, h, GEM_RX_COMPLETION));
+			sc-sc_rx_fifo_wr_ptr =
+bus_space_read_4(t, h, GEM_RX_FIFO_WR_PTR);
+			sc-sc_rx_fifo_rd_ptr =
+bus_space_read_4(t, h, GEM_RX_FIFO_RD_PTR);
+			callout_schedule(sc-sc_rx_watchdog, 400);
 		} else if (rxstat  ~(GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT))
 			printf(%s: MAC rx fault, status 0x%02x\n,
 			device_xname(sc-sc_dev), rxstat);
@@ -2236,6 +2252,61 @@ gem_intr(void *v)
 	return (r);
 }
 
+void
+gem_rx_watchdog(void *arg)
+{
+	struct gem_softc *sc = arg;
+	struct ifnet *ifp = sc-sc_ethercom.ec_if;
+	bus_space_tag_t t = sc-sc_bustag;
+	bus_space_handle_t h = sc-sc_h1;
+	u_int32_t rx_fifo_wr_ptr;
+	u_int32_t rx_fifo_rd_ptr;
+	u_int32_t state;
+
+	if ((ifp-if_flags  IFF_RUNNING) == 0) {
+		aprint_error_dev(sc-sc_dev, receiver not running\n);
+		return;
+	}
+
+	rx_fifo_wr_ptr = bus_space_read_4(t, h, GEM_RX_FIFO_WR_PTR);
+	rx_fifo_rd_ptr = bus_space_read_4(t, h, GEM_RX_FIFO_RD_PTR);
+	state = bus_space_read_4(t, h, GEM_MAC_MAC_STATE);
+	if ((state  

CVS commit: [netbsd-6] src/sys

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 18:12:49 UTC 2012

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6]: autoconf.c
src/sys/arch/x86/x86 [netbsd-6]: x86_autoconf.c
src/sys/arch/xen/x86 [netbsd-6]: autoconf.c
src/sys/arch/zaurus/zaurus [netbsd-6]: autoconf.c
src/sys/dev [netbsd-6]: vnd.c
src/sys/dev/dkwedge [netbsd-6]: dk.c dkwedge_bsdlabel.c
src/sys/kern [netbsd-6]: init_main.c kern_subr.c
src/sys/sys [netbsd-6]: device.h disk.h

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #402):
sys/dev/vnd.c: revision 1.221
sys/kern/init_main.c: revision 1.443
sys/kern/init_main.c: revision 1.444
sys/dev/dkwedge/dk.c: revision 1.64
sys/arch/x86/x86/x86_autoconf.c: revision 1.63
sys/arch/sparc64/sparc64/autoconf.c: revision 1.187
sys/sys/device.h: revision 1.141
sys/dev/dkwedge/dkwedge_bsdlabel.c: revision 1.17
sys/kern/kern_subr.c: revision 1.213
sys/arch/zaurus/zaurus/autoconf.c: revision 1.11
sys/arch/xen/x86/autoconf.c: revision 1.14
sys/sys/disk.h: revision 1.57
Use the label's packname to create wedge names instead of the classic
device names. Fall back to classic device names when the label has an
empty name or the default name 'fictitious'.
autodiscover wedges
Make detection of root on wedges (dk(4)) machine independent. Remove
MD code for x86, xen, sparc64.
Make detection of root on wedges (dk(4)) machine independent. Remove
MD code for zaurus.
Do not try to find the wedge we booted from if opendisk(booted_device)
failed.


To generate a diff of this commit:
cvs rdiff -u -r1.185.2.1 -r1.185.2.2 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r1.62 -r1.62.8.1 src/sys/arch/x86/x86/x86_autoconf.c
cvs rdiff -u -r1.13 -r1.13.18.1 src/sys/arch/xen/x86/autoconf.c
cvs rdiff -u -r1.10 -r1.10.10.1 src/sys/arch/zaurus/zaurus/autoconf.c
cvs rdiff -u -r1.219.8.1 -r1.219.8.2 src/sys/dev/vnd.c
cvs rdiff -u -r1.62 -r1.62.8.1 src/sys/dev/dkwedge/dk.c
cvs rdiff -u -r1.16 -r1.16.18.1 src/sys/dev/dkwedge/dkwedge_bsdlabel.c
cvs rdiff -u -r1.441 -r1.441.2.1 src/sys/kern/init_main.c
cvs rdiff -u -r1.212 -r1.212.8.1 src/sys/kern/kern_subr.c
cvs rdiff -u -r1.140 -r1.140.6.1 src/sys/sys/device.h
cvs rdiff -u -r1.56 -r1.56.2.1 src/sys/sys/disk.h

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.185.2.1 src/sys/arch/sparc64/sparc64/autoconf.c:1.185.2.2
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.185.2.1	Tue Jun  5 16:22:24 2012
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Thu Jul  5 18:12:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.185.2.1 2012/06/05 16:22:24 jdc Exp $ */
+/*	$NetBSD: autoconf.c,v 1.185.2.2 2012/07/05 18:12:48 riz Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.185.2.1 2012/06/05 16:22:24 jdc Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.185.2.2 2012/07/05 18:12:48 riz Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -508,10 +508,7 @@ cpu_rootconf(void)
 		return;
 	}
 
-	if (config_handle_wedges(booted_device, booted_partition) == 0)
-		setroot(booted_wedge, 0);
-	else
-		setroot(booted_device, booted_partition);
+	setroot(booted_device, booted_partition);
 }
 
 char *

Index: src/sys/arch/x86/x86/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.62 src/sys/arch/x86/x86/x86_autoconf.c:1.62.8.1
--- src/sys/arch/x86/x86/x86_autoconf.c:1.62	Tue Oct 18 23:43:36 2011
+++ src/sys/arch/x86/x86/x86_autoconf.c	Thu Jul  5 18:12:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.62 2011/10/18 23:43:36 dyoung Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.62.8.1 2012/07/05 18:12:47 riz Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.62 2011/10/18 23:43:36 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.62.8.1 2012/07/05 18:12:47 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -64,15 +64,6 @@ __KERNEL_RCSID(0, $NetBSD: x86_autoconf
 struct disklist *x86_alldisks;
 int x86_ndisks;
 
-static void
-handle_wedges(device_t dv, int par)
-{
-	if (config_handle_wedges(dv, par) == 0)
-		return;
-	booted_device = dv;
-	booted_partition = par;
-}
-
 static int
 is_valid_disk(device_t dv)
 {
@@ -344,7 +335,9 @@ findroot(void)
 
 			if (strncmp(cd-cf_name, biv-devname, len) == 0 
 			biv-devname[len] - '0' == device_unit(dv)) {
-handle_wedges(dv, biv-devname[len + 1] - 'a');
+booted_device = dv;
+booted_partition = biv-devname[len + 1] - 'a';
+booted_nblks = 0;
 break;
 			}
 		}
@@ -388,11 +381,14 @@ findroot(void)
 device_xname(dv));
 continue;
 

CVS commit: [netbsd-6] src

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 18:16:15 UTC 2012

Modified Files:
src/distrib/vax/miniroot [netbsd-6]: Makefile.inc
src/sys/arch/vax/include [netbsd-6]: disklabel.h types.h
src/sys/sys [netbsd-6]: bootblock.h

Log Message:
Pull up following revision(s) (requested by abs in ticket #403):
sys/arch/vax/include/disklabel.h: revision 1.6
sys/sys/bootblock.h: revision 1.54
sys/arch/vax/include/types.h: revision 1.46
distrib/vax/miniroot/Makefile.inc: revision 1.21
- Increase MAXPARTITIONS for vax from 8 to 16, using the standard NetBSD
  mechanism to ensure all existing /dev nodes continue to work
- Adjust boot block layout to fit additional partitions
- Adjust number of inodes on install media


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.8.1 src/distrib/vax/miniroot/Makefile.inc
cvs rdiff -u -r1.5 -r1.5.8.1 src/sys/arch/vax/include/disklabel.h
cvs rdiff -u -r1.44 -r1.44.2.1 src/sys/arch/vax/include/types.h
cvs rdiff -u -r1.52 -r1.52.14.1 src/sys/sys/bootblock.h

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

Modified files:

Index: src/distrib/vax/miniroot/Makefile.inc
diff -u src/distrib/vax/miniroot/Makefile.inc:1.20 src/distrib/vax/miniroot/Makefile.inc:1.20.8.1
--- src/distrib/vax/miniroot/Makefile.inc:1.20	Thu Feb 11 09:06:51 2010
+++ src/distrib/vax/miniroot/Makefile.inc	Thu Jul  5 18:16:15 2012
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.20 2010/02/11 09:06:51 roy Exp $
+# $NetBSD: Makefile.inc,v 1.20.8.1 2012/07/05 18:16:15 riz Exp $
 
 IMAGESIZE=	7m
-MAKEFS_FLAGS=	-o density=4k
+MAKEFS_FLAGS=	-o density=3k
 IMAGEENDIAN=	le
 MAKEDEVTARGETS=	all
 LISTS+=		${DISTRIBDIR}/common/list.sysinst

Index: src/sys/arch/vax/include/disklabel.h
diff -u src/sys/arch/vax/include/disklabel.h:1.5 src/sys/arch/vax/include/disklabel.h:1.5.8.1
--- src/sys/arch/vax/include/disklabel.h:1.5	Tue Aug 30 12:39:59 2011
+++ src/sys/arch/vax/include/disklabel.h	Thu Jul  5 18:16:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.h,v 1.5 2011/08/30 12:39:59 bouyer Exp $	*/
+/*	$NetBSD: disklabel.h,v 1.5.8.1 2012/07/05 18:16:14 riz Exp $	*/
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -33,11 +33,25 @@
 #ifndef _MACHINE_DISKLABEL_H_
 #define _MACHINE_DISKLABEL_H_
 
-#define LABELUSESMBR	0			/* no MBR partitionning */
-#define	LABELSECTOR	0			/* sector containing label */
-#define	LABELOFFSET	64			/* offset of label in sector */
-#define	MAXPARTITIONS	8			/* number of partitions */
-#define	RAW_PART	2			/* raw partition: xx?c */
+#define LABELUSESMBR		0	/* no MBR partitionning */
+#define	LABELSECTOR		0	/* sector containing label */
+#define	LABELOFFSET		64	/* offset of label in sector */
+#define	MAXPARTITIONS		16	/* number of partitions */
+#define	OLDMAXPARTITIONS 	8	/* number of partitions before nb-6 */
+#define	RAW_PART		2	/* raw partition: xx?c */
+
+/*
+ * We use the highest bit of the minor number for the partition number.
+ * This maintains backward compatibility with device nodes created before
+ * MAXPARTITIONS was increased.
+ */
+#define __VAX_MAXDISKS	((1  20) / MAXPARTITIONS)
+#define DISKUNIT(dev)	((minor(dev) / OLDMAXPARTITIONS) % __VAX_MAXDISKS)
+#define DISKPART(dev)	((minor(dev) % OLDMAXPARTITIONS) + \
+((minor(dev) / (__VAX_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
+#define	DISKMINOR(unit, part) \
+(((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
+ ((part) / OLDMAXPARTITIONS) * (__VAX_MAXDISKS * OLDMAXPARTITIONS))
 
 /* Just a dummy */
 #ifndef _LOCORE

Index: src/sys/arch/vax/include/types.h
diff -u src/sys/arch/vax/include/types.h:1.44 src/sys/arch/vax/include/types.h:1.44.2.1
--- src/sys/arch/vax/include/types.h:1.44	Tue Jan 17 20:34:57 2012
+++ src/sys/arch/vax/include/types.h	Thu Jul  5 18:16:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.44 2012/01/17 20:34:57 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.44.2.1 2012/07/05 18:16:14 riz Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -78,6 +78,7 @@ typedef volatile char	__cpu_simple_lock_
 #define	__HAVE_CPU_DATA_FIRST
 #define	__HAVE_MM_MD_READWRITE
 #define	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
+#define	__HAVE_OLD_DISKLABEL
 
 #define	__HAVE___LWP_GETPRIVATE_FAST
 #define	__HAVE_NO___THREAD

Index: src/sys/sys/bootblock.h
diff -u src/sys/sys/bootblock.h:1.52 src/sys/sys/bootblock.h:1.52.14.1
--- src/sys/sys/bootblock.h:1.52	Thu Jan  6 01:08:48 2011
+++ src/sys/sys/bootblock.h	Thu Jul  5 18:16:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootblock.h,v 1.52 2011/01/06 01:08:48 jakllsch Exp $	*/
+/*	$NetBSD: bootblock.h,v 1.52.14.1 2012/07/05 18:16:15 riz Exp $	*/
 
 /*-
  * Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
@@ -1389,7 +1389,8 @@ struct vax_boot_block {
 	uint8_t		bb_mbone;	/* must be one */
 	uint16_t	bb_lbn_hi;	/* lbn (hi word) of bootstrap */
 	uint16_t	bb_lbn_low;	/* lbn (low word) of bootstrap */
-	

CVS commit: [netbsd-6] src

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 18:22:50 UTC 2012

Modified Files:
src/distrib/vax/miniroot [netbsd-6]: Makefile.inc list
src/distrib/vax/ramdisk [netbsd-6]: Makefile dot.profile list
src/etc/etc.vax [netbsd-6]: MAKEDEV.conf
src/sys/arch/vax/conf [netbsd-6]: INSTALL
Removed Files:
src/distrib/vax [netbsd-6]: install.md

Log Message:
Pull up following revision(s) (requested by abs in ticket #405):
etc/etc.vax/MAKEDEV.conf: revision 1.15
etc/etc.vax/MAKEDEV.conf: revision 1.16
sys/arch/vax/conf/INSTALL: revision 1.61
sys/arch/vax/conf/INSTALL: revision 1.62
distrib/vax/install.md: file removal
distrib/vax/ramdisk/list: revision 1.30
distrib/vax/miniroot/list: revision 1.15
distrib/vax/miniroot/Makefile.inc: revision 1.22
distrib/vax/ramdisk/Makefile: revision 1.30
distrib/vax/ramdisk/dot.profile: revision 1.9
All apply to vax only:
- Drop KERNFS from INSTALL kernel
- Add dmesg to sysinst ramdisk
- Add 'ramdisk' target to MAKEDEV and use
- Add dhcpcd to sysinst ramdisk
- Drop old install.md script
- Misc install image cleanup (reduce diff to zaurus of all things)
Sync devices with GENERIC, and include bpfilter to allow dhcpcd to work
Ensure the ramdisk has bpf for dhcpcd


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r0 src/distrib/vax/install.md
cvs rdiff -u -r1.20.8.1 -r1.20.8.2 src/distrib/vax/miniroot/Makefile.inc
cvs rdiff -u -r1.14 -r1.14.4.1 src/distrib/vax/miniroot/list
cvs rdiff -u -r1.26.8.1 -r1.26.8.2 src/distrib/vax/ramdisk/Makefile
cvs rdiff -u -r1.8 -r1.8.58.1 src/distrib/vax/ramdisk/dot.profile
cvs rdiff -u -r1.28 -r1.28.4.1 src/distrib/vax/ramdisk/list
cvs rdiff -u -r1.13.4.1 -r1.13.4.2 src/etc/etc.vax/MAKEDEV.conf
cvs rdiff -u -r1.58.2.1 -r1.58.2.2 src/sys/arch/vax/conf/INSTALL

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

Modified files:

Index: src/distrib/vax/miniroot/Makefile.inc
diff -u src/distrib/vax/miniroot/Makefile.inc:1.20.8.1 src/distrib/vax/miniroot/Makefile.inc:1.20.8.2
--- src/distrib/vax/miniroot/Makefile.inc:1.20.8.1	Thu Jul  5 18:16:15 2012
+++ src/distrib/vax/miniroot/Makefile.inc	Thu Jul  5 18:22:50 2012
@@ -1,12 +1,11 @@
-# $NetBSD: Makefile.inc,v 1.20.8.1 2012/07/05 18:16:15 riz Exp $
+# $NetBSD: Makefile.inc,v 1.20.8.2 2012/07/05 18:22:50 riz Exp $
 
 IMAGESIZE=	7m
 MAKEFS_FLAGS=	-o density=3k
 IMAGEENDIAN=	le
 MAKEDEVTARGETS=	all
 LISTS+=		${DISTRIBDIR}/common/list.sysinst
-IMAGEDEPENDS+=	${ARCHDIR}/../install.md \
-		${ARCHDIR}/dot.profile \
+IMAGEDEPENDS+=	${ARCHDIR}/dot.profile \
 		${DESTDIR}/usr/mdec/boot \
 		${KERNOBJDIR}/GENERIC/netbsd
 

Index: src/distrib/vax/miniroot/list
diff -u src/distrib/vax/miniroot/list:1.14 src/distrib/vax/miniroot/list:1.14.4.1
--- src/distrib/vax/miniroot/list:1.14	Sun Jul  3 23:11:34 2011
+++ src/distrib/vax/miniroot/list	Thu Jul  5 18:22:50 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.14 2011/07/03 23:11:34 tron Exp $
+#	$NetBSD: list,v 1.14.4.1 2012/07/05 18:22:50 riz Exp $
 
 # Vax extras
 PROG	sbin/disklabel
@@ -36,5 +36,4 @@ SYMLINK	/tmp/hosts			etc/hosts
 
 # and the installation tools
 COPY	${ARCHDIR}/dot.profile		.profile
-COPY	${ARCHDIR}/../install.md	install.md
 COPY	${DESTDIR}/usr/mdec/boot	boot

Index: src/distrib/vax/ramdisk/Makefile
diff -u src/distrib/vax/ramdisk/Makefile:1.26.8.1 src/distrib/vax/ramdisk/Makefile:1.26.8.2
--- src/distrib/vax/ramdisk/Makefile:1.26.8.1	Wed Jul  4 20:41:47 2012
+++ src/distrib/vax/ramdisk/Makefile	Thu Jul  5 18:22:49 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.26.8.1 2012/07/04 20:41:47 jdc Exp $
+#	$NetBSD: Makefile,v 1.26.8.2 2012/07/05 18:22:49 riz Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -11,11 +11,10 @@ WARNS=		1
 DBG=		-Os
 
 CRUNCHBIN=	ramdiskbin
-LISTS=		${.CURDIR}/list  ${DISTRIBDIR}/common/list.sysinst
+LISTS=		${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst
 MTREECONF=	${DISTRIBDIR}/common/mtree.common
 IMAGEENDIAN=	le
-MAKEDEVTARGETS=	std mt0 st0 rd0 rd1 dz0 dl0 dhu0 rx0 ra0 ra1 ra2 ra3 hp0 hp1 \
-		sd0 sd1 sd2 md0 pty0 cd0 cd1 racd0 racd1
+MAKEDEVTARGETS=	ramdisk
 IMAGEDEPENDS=	${CRUNCHBIN} \
 		dot.profile \
 		${DESTDIR}/boot ${DESTDIR}/usr/mdec/xxboot \
@@ -29,6 +28,7 @@ HACKSRC=	${DISTRIBDIR}/utils/libhack
 ${CRUNCHBIN}:	libhack.o
 
 .include ${DISTRIBDIR}/common/Makefile.crunch
+.include ${DISTRIBDIR}/common/Makefile.dhcpcd
 .include ${DISTRIBDIR}/common/Makefile.makedev
 .include ${DISTRIBDIR}/common/Makefile.image
 

Index: src/distrib/vax/ramdisk/dot.profile
diff -u src/distrib/vax/ramdisk/dot.profile:1.8 src/distrib/vax/ramdisk/dot.profile:1.8.58.1
--- src/distrib/vax/ramdisk/dot.profile:1.8	Sat Jul 26 17:07:43 2003
+++ src/distrib/vax/ramdisk/dot.profile	Thu Jul  5 18:22:49 2012
@@ -1,4 +1,4 @@
-# $NetBSD: dot.profile,v 1.8 2003/07/26 17:07:43 salo Exp $
+# $NetBSD: dot.profile,v 

CVS commit: [netbsd-6] src/sys/arch/mips

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 18:39:42 UTC 2012

Modified Files:
src/sys/arch/mips/include [netbsd-6]: pmap.h
src/sys/arch/mips/mips [netbsd-6]: pmap.c pmap_segtab.c

Log Message:
Pull up following revision(s) (requested by matt in ticket #406):
sys/arch/mips/include/pmap.h: revision 1.62
sys/arch/mips/mips/pmap.c: revision 1.208
sys/arch/mips/mips/pmap_segtab.c: revision 1.5
Change lockless segtab management to use a mutex for protection.  Some =
minor
changes to make this closer to common/pmap/tlb/pmap_segtab.c
=20
=20


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.8.1 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.207 -r1.207.2.1 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/mips/mips/pmap_segtab.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/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.61 src/sys/arch/mips/include/pmap.h:1.61.8.1
--- src/sys/arch/mips/include/pmap.h:1.61	Thu Sep 22 05:08:52 2011
+++ src/sys/arch/mips/include/pmap.h	Thu Jul  5 18:39:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.61 2011/09/22 05:08:52 macallan Exp $	*/
+/*	$NetBSD: pmap.h,v 1.61.8.1 2012/07/05 18:39:42 riz Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -148,6 +148,7 @@ void pmap_pte_process(struct pmap *, vad
 void pmap_segtab_activate(struct pmap *, struct lwp *);
 void pmap_segtab_init(struct pmap *);
 void pmap_segtab_destroy(struct pmap *);
+extern kmutex_t pmap_segtab_lock;
 #endif /* _KERNEL */
 
 /*

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.207 src/sys/arch/mips/mips/pmap.c:1.207.2.1
--- src/sys/arch/mips/mips/pmap.c:1.207	Thu Feb  2 18:59:44 2012
+++ src/sys/arch/mips/mips/pmap.c	Thu Jul  5 18:39:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.207 2012/02/02 18:59:44 para Exp $	*/
+/*	$NetBSD: pmap.c,v 1.207.2.1 2012/07/05 18:39:42 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.207 2012/02/02 18:59:44 para Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.207.2.1 2012/07/05 18:39:42 riz Exp $);
 
 /*
  *	Manages physical address maps.
@@ -276,8 +276,8 @@ struct pmap * const kernel_pmap_ptr = k
 paddr_t mips_avail_start;	/* PA of first available physical page */
 paddr_t mips_avail_end;		/* PA of last available physical page */
 vaddr_t mips_virtual_end;	/* VA of last avail page (end of kernel AS) */
-vaddr_t iospace;/* VA of start of I/O space, if needed  */
-vsize_t iospace_size = 0; /* Size of (initial) range of I/O addresses */
+vaddr_t iospace;		/* VA of start of I/O space, if needed  */
+vsize_t iospace_size = 0;	/* Size of (initial) range of I/O addresses */
 
 pt_entry_t	*Sysmap;		/* kernel pte table */
 unsigned int	Sysmapsize;		/* number of pte's in Sysmap */
@@ -739,6 +739,11 @@ pmap_init(void)
 #endif
 
 	/*
+	 * Initialize the segtab lock.
+	 */
+	mutex_init(pmap_segtab_lock, MUTEX_DEFAULT, IPL_HIGH);
+
+	/*
 	 * Set a low water mark on the pv_entry pool, so that we are
 	 * more likely to have these around even in extreme memory
 	 * starvation.
@@ -2108,11 +2113,11 @@ pmap_enter_pv(pmap_t pmap, vaddr_t va, s
 	pv_entry_t pv, npv, apv;
 	int16_t gen;
 
-KASSERT(kpreempt_disabled());
-KASSERT(!MIPS_KSEG0_P(va));
-KASSERT(!MIPS_KSEG1_P(va));
+	KASSERT(kpreempt_disabled());
+	KASSERT(!MIPS_KSEG0_P(va));
+	KASSERT(!MIPS_KSEG1_P(va));
 #ifdef _LP64
-KASSERT(!MIPS_XKPHYS_P(va));
+	KASSERT(!MIPS_XKPHYS_P(va));
 #endif
 
 	apv = NULL;

Index: src/sys/arch/mips/mips/pmap_segtab.c
diff -u src/sys/arch/mips/mips/pmap_segtab.c:1.4 src/sys/arch/mips/mips/pmap_segtab.c:1.4.2.1
--- src/sys/arch/mips/mips/pmap_segtab.c:1.4	Thu Jan 26 02:14:08 2012
+++ src/sys/arch/mips/mips/pmap_segtab.c	Thu Jul  5 18:39:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.4 2012/01/26 02:14:08 matt Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.4.2.1 2012/07/05 18:39:42 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.4 2012/01/26 02:14:08 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.4.2.1 2012/07/05 18:39:42 riz Exp $);
 
 /*
  *	Manages physical address maps.
@@ -119,13 +119,8 @@ __KERNEL_RCSID(0, $NetBSD: pmap_segtab.
 #include sys/param.h
 #include sys/systm.h
 #include sys/proc.h
-#include sys/pool.h
 #include sys/mutex.h
 #include sys/atomic.h
-#ifdef SYSVSHM
-#include sys/shm.h
-#endif
-#include sys/socketvar.h	/* XXX: for sock_loan_thresh */
 
 #include uvm/uvm.h
 
@@ -136,15 +131,19 @@ __KERNEL_RCSID(0, $NetBSD: pmap_segtab.
 
 CTASSERT(NBPG = sizeof(union segtab));
 
-union segtab * volatile free_segtab;		/* free list kept locally */
+struct pmap_segtab_info {
+	union 

CVS commit: [netbsd-6] src/doc

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 18:49:04 UTC 2012

Modified Files:
src/doc [netbsd-6]: CHANGES-6.0

Log Message:
Tickets 401-406


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.150 -r1.1.2.151 src/doc/CHANGES-6.0

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

Modified files:

Index: src/doc/CHANGES-6.0
diff -u src/doc/CHANGES-6.0:1.1.2.150 src/doc/CHANGES-6.0:1.1.2.151
--- src/doc/CHANGES-6.0:1.1.2.150	Thu Jul  5 17:54:15 2012
+++ src/doc/CHANGES-6.0	Thu Jul  5 18:49:03 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0,v 1.1.2.150 2012/07/05 17:54:15 riz Exp $
+# $NetBSD: CHANGES-6.0,v 1.1.2.151 2012/07/05 18:49:03 riz Exp $
 
 A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012
 until the 6.0 release:
@@ -6205,3 +6205,60 @@ sys/arch/x86/x86/cpu.c1.100
 	have registered themselves in kcpuset_running before returning.
 	[chs, ticket #400]
 
+sys/dev/ic/gem.c1.99
+sys/dev/ic/gemreg.h1.15
+sys/dev/ic/gemvar.h1.24
+
+	Apply lockup fixes to gem(4).  Also alter the interrupt
+	blanking rate to 8 packets, as per OpenSolaris. PR#46260.
+	[jdc, ticket #401]
+
+sys/arch/sparc64/sparc64/autoconf.c		1.187
+sys/arch/x86/x86/x86_autoconf.c			1.63
+sys/arch/xen/x86/autoconf.c			1.14
+sys/arch/zaurus/zaurus/autoconf.c		1.11
+sys/dev/dkwedge/dk.c1.64
+sys/dev/dkwedge/dkwedge_bsdlabel.c		1.17
+sys/dev/vnd.c	1.221
+sys/kern/init_main.c1.443-1.444
+sys/kern/kern_subr.c1.213
+sys/sys/device.h1.141
+sys/sys/disk.h	1.57
+
+	Improve support for disk wedges.
+	[mlelstv, ticket #402]
+
+distrib/vax/miniroot/Makefile.inc		1.21
+sys/arch/vax/include/disklabel.h		1.6
+sys/arch/vax/include/types.h			1.46 via patch
+sys/sys/bootblock.h1.54
+
+	Increase MAXPARTITIONS for vax from 8 to 16.
+	[abs, ticket #403]
+
+sys/common/pmap/tlb/pmap.c			1.14
+sys/common/pmap/tlb/pmap.h			1.13
+sys/common/pmap/tlb/pmap_segtab.c		1.5
+
+	Avoid corruption of the free segtab list.
+	[matt, ticket #404]
+
+distrib/vax/install.mddelete
+distrib/vax/miniroot/Makefile.inc		1.22
+distrib/vax/miniroot/list			1.15
+distrib/vax/ramdisk/Makefile			1.30
+distrib/vax/ramdisk/dot.profile			1.9
+distrib/vax/ramdisk/list			1.30
+etc/etc.vax/MAKEDEV.conf			1.15-1.16
+sys/arch/vax/conf/INSTALL			1.61-1.62
+
+	Add dmesg and dhcpcd to vax install, and enable dhcpcd.
+	[abs, ticket #405]
+
+sys/arch/mips/include/pmap.h			1.62
+sys/arch/mips/mips/pmap.c			1.208
+sys/arch/mips/mips/pmap_segtab.c		1.5
+
+	Change MIPS segtab management to look more like the common pmap.
+	[matt, ticket #406]
+



CVS commit: [netbsd-6] src/sys/common/pmap/tlb

2012-07-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jul  5 18:50:52 UTC 2012

Modified Files:
src/sys/common/pmap/tlb [netbsd-6]: pmap.c pmap.h pmap_segtab.c

Log Message:
Pull up following revision(s) (requested by matt in ticket #404):
sys/common/pmap/tlb/pmap.c: revision 1.14
sys/common/pmap/tlb/pmap.h: revision 1.13
sys/common/pmap/tlb/pmap_segtab.c: revision 1.5
The lockless list can lead to corruption.  Instead use a spinlock to =
control
access to the head of the free segtab list.
=20
=20


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.2.1 src/sys/common/pmap/tlb/pmap.c
cvs rdiff -u -r1.11 -r1.11.8.1 src/sys/common/pmap/tlb/pmap.h
cvs rdiff -u -r1.4 -r1.4.8.1 src/sys/common/pmap/tlb/pmap_segtab.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/common/pmap/tlb/pmap.c
diff -u src/sys/common/pmap/tlb/pmap.c:1.12 src/sys/common/pmap/tlb/pmap.c:1.12.2.1
--- src/sys/common/pmap/tlb/pmap.c:1.12	Wed Jan 18 07:17:09 2012
+++ src/sys/common/pmap/tlb/pmap.c	Thu Jul  5 18:50:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.12 2012/01/18 07:17:09 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.12.2.1 2012/07/05 18:50:52 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.12 2012/01/18 07:17:09 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.12.2.1 2012/07/05 18:50:52 riz Exp $);
 
 /*
  *	Manages physical address maps.
@@ -439,6 +439,11 @@ pmap_init(void)
 	UVMHIST_FUNC(__func__); UVMHIST_CALLED(pmaphist);
 
 	/*
+	 * Initialize the segtab lock.
+	 */
+	mutex_init(pmap_segtab_lock, MUTEX_DEFAULT, IPL_HIGH);
+
+	/*
 	 * Set a low water mark on the pv_entry pool, so that we are
 	 * more likely to have these around even in extreme memory
 	 * starvation.

Index: src/sys/common/pmap/tlb/pmap.h
diff -u src/sys/common/pmap/tlb/pmap.h:1.11 src/sys/common/pmap/tlb/pmap.h:1.11.8.1
--- src/sys/common/pmap/tlb/pmap.h:1.11	Thu Oct 13 19:50:39 2011
+++ src/sys/common/pmap/tlb/pmap.h	Thu Jul  5 18:50:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.11 2011/10/13 19:50:39 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.11.8.1 2012/07/05 18:50:52 riz Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -109,6 +109,7 @@ void pmap_pte_process(struct pmap *, vad
 void pmap_segtab_activate(struct pmap *, struct lwp *);
 void pmap_segtab_alloc(struct pmap *);
 void pmap_segtab_free(struct pmap *);
+extern kmutex_t pmap_segtab_lock;
 #endif /* _KERNEL */
 
 /*

Index: src/sys/common/pmap/tlb/pmap_segtab.c
diff -u src/sys/common/pmap/tlb/pmap_segtab.c:1.4 src/sys/common/pmap/tlb/pmap_segtab.c:1.4.8.1
--- src/sys/common/pmap/tlb/pmap_segtab.c:1.4	Thu Jun 23 08:11:56 2011
+++ src/sys/common/pmap/tlb/pmap_segtab.c	Thu Jul  5 18:50:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.4 2011/06/23 08:11:56 matt Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.4.8.1 2012/07/05 18:50:52 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.4 2011/06/23 08:11:56 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_segtab.c,v 1.4.8.1 2012/07/05 18:50:52 riz Exp $);
 
 /*
  *	Manages physical address maps.
@@ -110,7 +110,7 @@ __KERNEL_RCSID(0, $NetBSD: pmap_segtab.
 CTASSERT(NBPG = sizeof(struct pmap_segtab));
 
 struct pmap_segtab_info {
-	struct pmap_segtab * volatile free_segtab;		/* free list kept locally */
+	struct pmap_segtab *free_segtab;	/* free list kept locally */
 #ifdef DEBUG
 	uint32_t nget_segtab;
 	uint32_t nput_segtab;
@@ -121,6 +121,8 @@ struct pmap_segtab_info {
 #endif
 } pmap_segtab_info;
 
+kmutex_t pmap_segtab_lock __cacheline_aligned;
+
 static inline struct vm_page *
 pmap_pte_pagealloc(void)
 {
@@ -162,20 +164,16 @@ pmap_segtab_alloc(pmap_t pmap)
 {
 	struct pmap_segtab *stp;
  again:
-	stp = NULL;
-	while (__predict_true(pmap_segtab_info.free_segtab != NULL)) {
-		struct pmap_segtab *next_stp;
-		stp = pmap_segtab_info.free_segtab;
-		next_stp = (struct pmap_segtab *)stp-seg_tab[0];
-		if (stp == atomic_cas_ptr(pmap_segtab_info.free_segtab, stp, next_stp)) {
-			SEGTAB_ADD(nget, 1);
-			break;
-		}
+	mutex_spin_enter(pmap_segtab_lock);
+	if (__predict_true((stp = pmap_segtab_info.free_segtab) != NULL)) {
+		pmap_segtab_info.free_segtab =
+		(struct pmap_segtab *)stp-seg_tab[0];
+		stp-seg_tab[0] = NULL;
+		SEGTAB_ADD(nget, 1);
 	}
+	mutex_spin_exit(pmap_segtab_lock);
 	
-	if (__predict_true(stp != NULL)) {
-		stp-seg_tab[0] = NULL;
-	} else {
+	if (__predict_false(stp == NULL)) {
 		struct vm_page * const stp_pg = pmap_pte_pagealloc();
 
 		if (__predict_false(stp_pg == NULL)) {
@@ -200,13 +198,11 @@ pmap_segtab_alloc(pmap_t pmap)
 			/*
 			 * Now link the new segtabs into the free segtab list.
 			 */
-			for (;;) {
-void *tmp = pmap_segtab_info.free_segtab;
-