CVS commit: src/libexec/lfs_cleanerd

2012-04-12 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr 12 10:30:17 UTC 2012

Modified Files:
src/libexec/lfs_cleanerd: fdfs.c

Log Message:
Use the same loop order for freeing as for allocation. Simpler code and
easier to process for analyzers.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/libexec/lfs_cleanerd/fdfs.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/lfs_cleanerd/fdfs.c
diff -u src/libexec/lfs_cleanerd/fdfs.c:1.8 src/libexec/lfs_cleanerd/fdfs.c:1.9
--- src/libexec/lfs_cleanerd/fdfs.c:1.8	Fri Jul  1 02:48:48 2011
+++ src/libexec/lfs_cleanerd/fdfs.c	Thu Apr 12 10:30:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fdfs.c,v 1.8 2011/07/01 02:48:48 joerg Exp $	 */
+/* $NetBSD: fdfs.c,v 1.9 2012/04/12 10:30:17 joerg Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@ fd_vget(int fd, int bsize, int segsize, 
 	vp = (struct uvnode *) malloc(sizeof(*vp));
 	if (vp == NULL) {
 		if (fs-fd_bufp) {
-			for (i = nseg - 1; i = 0; i--)
+			for (i = 0; i  nseg; i++)
 free(fs-fd_bufp[i].buf);
 			free(fs-fd_bufp);
 		}



CVS commit: src

2012-04-12 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr 12 11:46:17 UTC 2012

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.c
src/usr.sbin/wiconfig: wiconfig.c

Log Message:
Don't assign non-integral constants to integral variables.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/libexec/lfs_cleanerd/lfs_cleanerd.c
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/wiconfig/wiconfig.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/lfs_cleanerd/lfs_cleanerd.c
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.29 src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.30
--- src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.29	Thu Feb  2 03:47:11 2012
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.c	Thu Apr 12 11:46:16 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.29 2012/02/02 03:47:11 perseant Exp $	 */
+/* $NetBSD: lfs_cleanerd.c,v 1.30 2012/04/12 11:46:16 joerg Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -1365,7 +1365,7 @@ lfs_cleaner_main(int argc, char **argv)
 	 */
 	atatime	 = 1;
 	segwait_timeout = 300; /* Five minutes */
-	load_threshold	= 0.2;
+	load_threshold	= 0;
 	stat_report	= 0;
 	inval_segment	= -1;
 	copylog_filename = NULL;

Index: src/usr.sbin/wiconfig/wiconfig.c
diff -u src/usr.sbin/wiconfig/wiconfig.c:1.43 src/usr.sbin/wiconfig/wiconfig.c:1.44
--- src/usr.sbin/wiconfig/wiconfig.c:1.43	Tue Aug 30 21:01:50 2011
+++ src/usr.sbin/wiconfig/wiconfig.c	Thu Apr 12 11:46:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: wiconfig.c,v 1.43 2011/08/30 21:01:50 joerg Exp $	*/
+/*	$NetBSD: wiconfig.c,v 1.44 2012/04/12 11:46:14 joerg Exp $	*/
 /*
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul wp...@ctr.columbia.edu.  All rights reserved.
@@ -68,7 +68,7 @@
 #if !defined(lint)
 __COPYRIGHT(@(#) Copyright (c) 1997, 1998, 1999\
  Bill Paul.  All rights reserved.);
-__RCSID($NetBSD: wiconfig.c,v 1.43 2011/08/30 21:01:50 joerg Exp $);
+__RCSID($NetBSD: wiconfig.c,v 1.44 2012/04/12 11:46:14 joerg Exp $);
 #endif
 
 struct wi_table {
@@ -261,7 +261,7 @@ wi_apscan(char *iface)
 			rate = 2;
 			break;
 		case WI_APRATE_5:
-			rate = 5.5;
+			rate = 5;
 			break;
 		case WI_APRATE_11:
 			rate = 11;



CVS commit: src/sys/dev

2012-04-12 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Thu Apr 12 12:52:58 UTC 2012

Modified Files:
src/sys/dev/cardbus: if_bwi_cardbus.c
src/sys/dev/ic: bwi.c bwivar.h

Log Message:
- Add pmf(9) suspend, resume to bwi(4) cardbus front end.
- Apply cardbus code cleanups.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/cardbus/if_bwi_cardbus.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/bwi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/bwivar.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/cardbus/if_bwi_cardbus.c
diff -u src/sys/dev/cardbus/if_bwi_cardbus.c:1.1 src/sys/dev/cardbus/if_bwi_cardbus.c:1.2
--- src/sys/dev/cardbus/if_bwi_cardbus.c:1.1	Sun Apr  8 20:49:29 2012
+++ src/sys/dev/cardbus/if_bwi_cardbus.c	Thu Apr 12 12:52:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bwi_cardbus.c,v 1.1 2012/04/08 20:49:29 christos Exp $ */
+/*	$NetBSD: if_bwi_cardbus.c,v 1.2 2012/04/12 12:52:58 nakayama Exp $ */
 /*	$OpenBSD: if_bwi_cardbus.c,v 1.13 2010/08/06 05:26:24 mglocker Exp $ */
 
 /*
@@ -19,11 +19,12 @@
  */
 
 /*
- * Cardbus front-end for the Broadcom AirForce
+ * Broadcom AirForce BCM43xx IEEE 802.11b/g wireless network driver
+ * CardBus front end
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0,$NetBSD: if_bwi_cardbus.c,v 1.1 2012/04/08 20:49:29 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bwi_cardbus.c,v 1.2 2012/04/12 12:52:58 nakayama Exp $);
 
 #include opt_inet.h
 
@@ -51,12 +52,12 @@ __KERNEL_RCSID(0,$NetBSD: if_bwi_cardbu
 
 #include dev/pci/pcireg.h
 #include dev/pci/pcivar.h
+#include dev/pci/pcidevs.h
 
 #include dev/cardbus/cardbusvar.h
 
 #include dev/ic/bwireg.h
 #include dev/ic/bwivar.h
-#include dev/pci/pcidevs.h
 
 struct bwi_cardbus_softc {
 	struct bwi_softc	 csc_bwi;
@@ -64,27 +65,24 @@ struct bwi_cardbus_softc {
 	/* cardbus specific goo */
 	cardbus_devfunc_t	 csc_ct;
 	pcitag_t		 csc_tag;
-	void			*csc_ih;
 
 	bus_size_t		 csc_mapsize;
 	pcireg_t		 csc_bar_val;
-	int			 csc_intrline;
-	pci_chipset_tag_t	 csc_pc;
 };
 
-int		bwi_cardbus_match(device_t, cfdata_t, void*);
-void		bwi_cardbus_attach(device_t, device_t, void *);
-int		bwi_cardbus_detach(device_t, int);
-void		bwi_cardbus_setup(struct bwi_cardbus_softc *);
-int		bwi_cardbus_enable(struct bwi_softc *);
-void		bwi_cardbus_disable(struct bwi_softc *);
-void		bwi_cardbus_conf_write(void *, uint32_t, uint32_t);
-uint32_t	bwi_cardbus_conf_read(void *, uint32_t);
+static int	bwi_cardbus_match(device_t, cfdata_t, void *);
+static void	bwi_cardbus_attach(device_t, device_t, void *);
+static int	bwi_cardbus_detach(device_t, int);
+static void	bwi_cardbus_setup(struct bwi_cardbus_softc *);
+static int	bwi_cardbus_enable(struct bwi_softc *, int);
+static void	bwi_cardbus_disable(struct bwi_softc *, int);
+static void	bwi_cardbus_conf_write(void *, uint32_t, uint32_t);
+static uint32_t	bwi_cardbus_conf_read(void *, uint32_t);
 
 CFATTACH_DECL_NEW(bwi_cardbus, sizeof (struct bwi_cardbus_softc),
 bwi_cardbus_match, bwi_cardbus_attach, bwi_cardbus_detach, NULL);
 
-int
+static int
 bwi_cardbus_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct cardbus_attach_args *ca = aux;
@@ -112,7 +110,7 @@ bwi_cardbus_match(device_t parent, cfdat
 	return (0);
 }
 
-void
+static void
 bwi_cardbus_attach(device_t parent, device_t self, void *aux)
 {
 	struct bwi_cardbus_softc *csc = device_private(self);
@@ -123,6 +121,9 @@ bwi_cardbus_attach(device_t parent, devi
 	bus_addr_t base;
 	int error;
 
+	aprint_naive(\n);
+	aprint_normal(: Broadcom Wireless\n);
+
 	sc-sc_dev = self;
 	sc-sc_dmat = ca-ca_dmat;
 	csc-csc_ct = ct;
@@ -131,14 +132,13 @@ bwi_cardbus_attach(device_t parent, devi
 	/* power management hooks */
 	sc-sc_enable = bwi_cardbus_enable;
 	sc-sc_disable = bwi_cardbus_disable;
-	//sc-sc_power = bwi_cardbus_power;
 
 	/* map control/status registers */
 	error = Cardbus_mapreg_map(ct, BWI_PCIR_BAR,
 	PCI_MAPREG_TYPE_MEM, 0, sc-sc_mem_bt,
 	sc-sc_mem_bh, base, csc-csc_mapsize);
 	if (error != 0) {
-		printf(: can't map mem space\n);
+		aprint_error_dev(self, can't map mem space\n);
 		return;
 	}
 	csc-csc_bar_val = base | PCI_MAPREG_TYPE_MEM;
@@ -146,8 +146,6 @@ bwi_cardbus_attach(device_t parent, devi
 	/* set up the PCI configuration registers */
 	bwi_cardbus_setup(csc);
 
-	printf(: irq %d, csc-csc_intrline);
-
 	/* we need to access Cardbus config space from the driver */
 	sc-sc_conf_read = bwi_cardbus_conf_read;
 	sc-sc_conf_write = bwi_cardbus_conf_write;
@@ -159,34 +157,38 @@ bwi_cardbus_attach(device_t parent, devi
 	sc-sc_pci_subvid = PCI_VENDOR(reg);
 	sc-sc_pci_subdid = PCI_PRODUCT(reg);
 
+	if (pmf_device_register(self, bwi_suspend, bwi_resume))
+		pmf_class_network_register(self, sc-sc_if);
+	else
+		aprint_error_dev(self, couldn't establish power handler\n);
+
 	error = bwi_attach(sc);
 	if (error != 0)
-		bwi_cardbus_detach(sc-sc_dev, 0);
+		

CVS commit: src/sys

2012-04-12 Thread Tamas Toth
Module Name:src
Committed By:   ttoth
Date:   Thu Apr 12 15:31:01 UTC 2012

Modified Files:
src/sys/modules/chfs: Makefile
src/sys/ufs/chfs: chfs.h chfs_build.c chfs_inode.h chfs_subr.c
chfs_vfsops.c chfs_vnode.c chfs_vnops.c chfs_write.c debug.h
Removed Files:
src/sys/ufs/chfs: debug.c

Log Message:
using chtype on media instead of vtype
debug.c deleted


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/chfs/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/ufs/chfs/chfs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/ufs/chfs/chfs_build.c \
src/sys/ufs/chfs/chfs_inode.h src/sys/ufs/chfs/chfs_vfsops.c \
src/sys/ufs/chfs/chfs_write.c
cvs rdiff -u -r1.3 -r1.4 src/sys/ufs/chfs/chfs_subr.c \
src/sys/ufs/chfs/chfs_vnode.c src/sys/ufs/chfs/chfs_vnops.c
cvs rdiff -u -r1.1 -r0 src/sys/ufs/chfs/debug.c
cvs rdiff -u -r1.1 -r1.2 src/sys/ufs/chfs/debug.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/modules/chfs/Makefile
diff -u src/sys/modules/chfs/Makefile:1.2 src/sys/modules/chfs/Makefile:1.3
--- src/sys/modules/chfs/Makefile:1.2	Sat Feb  4 18:35:56 2012
+++ src/sys/modules/chfs/Makefile	Thu Apr 12 15:31:01 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2012/02/04 18:35:56 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2012/04/12 15:31:01 ttoth Exp $
 
 .include ../Makefile.inc
 
@@ -7,7 +7,7 @@
 CPPFLAGS+=	-DDIAGNOSTIC -DDEBUG -DLOCKDEBUG
 
 KMOD=	chfs
-SRCS=	ebh.c debug.c chfs_wbuf.c chfs_vnode_cache.c chfs_ihash.c
+SRCS=	ebh.c chfs_wbuf.c chfs_vnode_cache.c chfs_ihash.c
 SRCS+=  chfs_gc.c
 SRCS+=  chfs_vnode.c chfs_erase.c chfs_write.c chfs_readinode.c
 SRCS+=  chfs_build.c chfs_scan.c chfs_nodeops.c chfs_malloc.c

Index: src/sys/ufs/chfs/chfs.h
diff -u src/sys/ufs/chfs/chfs.h:1.4 src/sys/ufs/chfs/chfs.h:1.5
--- src/sys/ufs/chfs/chfs.h:1.4	Mon Nov 28 12:50:07 2011
+++ src/sys/ufs/chfs/chfs.h	Thu Apr 12 15:31:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs.h,v 1.4 2011/11/28 12:50:07 ahoka Exp $	*/
+/*	$NetBSD: chfs.h,v 1.5 2012/04/12 15:31:01 ttoth Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -79,8 +79,6 @@ TAILQ_HEAD(chfs_dirent_list, chfs_dirent
 #define MOUNT_CHFS chfs
 #endif
 
-#define CHFS_ROOTINO ROOTINO/* ROOTINO == 2 */
-
 enum {
 	VNO_STATE_UNCHECKED,	/* CRC checks not yet done */
 	VNO_STATE_CHECKING,	/* CRC checks in progress */
@@ -91,6 +89,7 @@ enum {
 	VNO_STATE_CLEARING	/* In clear_inode() */
 };
 
+
 #define VNODECACHE_SIZE 128
 
 #define MAX_READ_FREE(chmp) (((chmp)-chm_ebh)-eb_size / 8)
@@ -185,7 +184,7 @@ struct chfs_dirent
 	uint64_t version;
 	ino_t vno;
 	uint32_t nhash;
-	enum vtype type;
+	enum chtype type;
 	uint8_t  nsize;
 	uint8_t  name[0];
 
@@ -631,7 +630,7 @@ int chfs_readvnode(struct mount *, ino_t
 int chfs_readdirent(struct mount *, struct chfs_node_ref *,
 struct chfs_inode *);
 int chfs_makeinode(int, struct vnode *, struct vnode **,
-struct componentname *, int );
+struct componentname *, enum vtype );
 void chfs_set_vnode_size(struct vnode *, size_t);
 void chfs_change_size_free(struct chfs_mount *,
 	struct chfs_eraseblock *, int);
@@ -665,7 +664,7 @@ int chfs_write_flash_dirent(struct chfs_
 int chfs_write_flash_dnode(struct chfs_mount *, struct vnode *,
 struct buf *, struct chfs_full_dnode *);
 int chfs_do_link(struct chfs_inode *,
-struct chfs_inode *, const char *, int, enum vtype);
+struct chfs_inode *, const char *, int, enum chtype);
 int chfs_do_unlink(struct chfs_inode *,
 struct chfs_inode *, const char *, int);
 
@@ -673,7 +672,7 @@ int chfs_do_unlink(struct chfs_inode *,
 size_t chfs_mem_info(bool);
 struct chfs_dirent * chfs_dir_lookup(struct chfs_inode *,
 struct componentname *);
-int chfs_filldir (struct uio *, ino_t, const char *, int, enum vtype);
+int chfs_filldir (struct uio *, ino_t, const char *, int, enum chtype);
 int chfs_chsize(struct vnode *, u_quad_t, kauth_cred_t);
 int chfs_chflags(struct vnode *, int, kauth_cred_t);
 void chfs_itimes(struct chfs_inode *, const struct timespec *,

Index: src/sys/ufs/chfs/chfs_build.c
diff -u src/sys/ufs/chfs/chfs_build.c:1.2 src/sys/ufs/chfs/chfs_build.c:1.3
--- src/sys/ufs/chfs/chfs_build.c:1.2	Thu Nov 24 21:22:39 2011
+++ src/sys/ufs/chfs/chfs_build.c	Thu Apr 12 15:31:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_build.c,v 1.2 2011/11/24 21:22:39 agc Exp $	*/
+/*	$NetBSD: chfs_build.c,v 1.3 2012/04/12 15:31:01 ttoth Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -84,7 +84,7 @@ chfs_build_set_vnodecache_nlink(struct c
 			chfs_mark_node_obsolete(chmp, fd-nref);
 			continue;
 		}
-		if (fd-type == VDIR) {
+		if (fd-type == CHT_DIR) {
 			if (child_vc-nlink  1)
 child_vc-nlink = 1;
 
@@ -372,7 +372,7 @@ chfs_build_filesystem(struct chfs_mount 
 	nref = fd-nref;
 	*nref = fd-nref-nref_next;
 	//fd-nref-nref_next = NULL;
-} else if (fd-type == 

CVS commit: src/usr.bin/su

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 15:35:07 UTC 2012

Modified Files:
src/usr.bin/su: su.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/su/su.c

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

Modified files:

Index: src/usr.bin/su/su.c
diff -u src/usr.bin/su/su.c:1.69 src/usr.bin/su/su.c:1.70
--- src/usr.bin/su/su.c:1.69	Wed Aug 31 12:24:58 2011
+++ src/usr.bin/su/su.c	Thu Apr 12 11:35:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: su.c,v 1.69 2011/08/31 16:24:58 plunky Exp $	*/
+/*	$NetBSD: su.c,v 1.70 2012/04/12 15:35:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988\
 #if 0
 static char sccsid[] = @(#)su.c	8.3 (Berkeley) 4/2/94;*/
 #else
-__RCSID($NetBSD: su.c,v 1.69 2011/08/31 16:24:58 plunky Exp $);
+__RCSID($NetBSD: su.c,v 1.70 2012/04/12 15:35:07 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -462,7 +462,7 @@ kerberos5(char *username, const char *us
 		warnx(kerberos5: not in %s's ACL., user);
 		goto fail;
 	}
-	ret = krb5_cc_gen_new(context, krb5_mcc_ops, ccache);
+	ret = krb5_cc_new_unique(context, krb5_mcc_ops.prefix, NULL, ccache);
 	if (ret)
 		goto fail;
 	ret = krb5_verify_user_lrealm(context, princ, ccache, NULL, TRUE,
@@ -482,7 +482,7 @@ kerberos5(char *username, const char *us
 		}
 		goto fail;
 	}
-	ret = krb5_cc_gen_new(context, krb5_fcc_ops, ccache2);
+	ret = krb5_cc_new_unique(context, krb5_mcc_ops.prefix, NULL, ccache2);
 	if (ret) {
 		krb5_cc_destroy(context, ccache);
 		goto fail;



CVS commit: src/distrib/notes/common

2012-04-12 Thread Tamas Toth
Module Name:src
Committed By:   ttoth
Date:   Thu Apr 12 15:39:09 UTC 2012

Modified Files:
src/distrib/notes/common: main

Log Message:
Add myself.


To generate a diff of this commit:
cvs rdiff -u -r1.485 -r1.486 src/distrib/notes/common/main

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.485 src/distrib/notes/common/main:1.486
--- src/distrib/notes/common/main:1.485	Fri Mar 16 05:43:09 2012
+++ src/distrib/notes/common/main	Thu Apr 12 15:39:09 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: main,v 1.485 2012/03/16 05:43:09 jkoshy Exp $
+.\	$NetBSD: main,v 1.486 2012/04/12 15:39:09 ttoth Exp $
 .\
 .\ Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -1355,6 +1355,7 @@ If you're one of them, and would like to
 .It Ta Matt Thomas Ta Mt m...@netbsd.org
 .It Ta Jason Thorpe Ta Mt thor...@netbsd.org
 .It Ta Christoph Toshok Ta Mt tos...@netbsd.org
+.It Ta Tam\('as T\('oth Ta Mt tt...@netbsd.org
 .It Ta Greg Troxel Ta Mt g...@netbsd.org
 .It Ta Tsubai Masanari Ta Mt tsu...@netbsd.org
 .It Ta Izumi Tsutsui Ta Mt tsut...@netbsd.org



CVS commit: src/distrib/utils/sysinst

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 16:05:48 UTC 2012

Modified Files:
src/distrib/utils/sysinst: configmenu.c

Log Message:
Change the pkgin repository *before* running pkgin update.  Spotted
by imil@.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/sysinst/configmenu.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/configmenu.c
diff -u src/distrib/utils/sysinst/configmenu.c:1.1 src/distrib/utils/sysinst/configmenu.c:1.2
--- src/distrib/utils/sysinst/configmenu.c:1.1	Fri Apr  6 23:48:53 2012
+++ src/distrib/utils/sysinst/configmenu.c	Thu Apr 12 16:05:48 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.1 2012/04/06 23:48:53 riz Exp $ */
+/* $NetBSD: configmenu.c,v 1.2 2012/04/12 16:05:48 riz Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -258,12 +258,13 @@ set_binpkg(struct menudesc *menu, void *
 		return 0;
 	}
 
-	run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
-		/usr/pkg/bin/pkgin update);
-
 	/* configure pkgin to use $pkgpath as a repository */
 	snprintf(pattern, STRSIZE, s,^[^#].*$,%s,, pkgpath);
 	replace(/usr/pkg/etc/pkgin/repositories.conf, pattern);
+
+	run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
+		/usr/pkg/bin/pkgin update);
+
 	msg_display(MSG_binpkg_installed);
 	process_menu(MENU_ok, NULL);
 	



CVS commit: [netbsd-6] src

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 17:05:38 UTC 2012

Modified Files:
src/lib/libc/gen [netbsd-6]: posix_spawn_fileactions.c
src/sys/compat/netbsd32 [netbsd-6]: netbsd32.h netbsd32_execve.c
syscalls.master
src/sys/kern [netbsd-6]: exec_elf.c kern_exec.c kern_exit.c
src/sys/sys [netbsd-6]: exec.h spawn.h
src/sys/uvm [netbsd-6]: uvm_extern.h uvm_glue.c uvm_map.c
src/tests/lib/libc/gen/posix_spawn [netbsd-6]: t_fileactions.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #175):
sys/kern/kern_exit.c: revision 1.238
tests/lib/libc/gen/posix_spawn/t_fileactions.c: revision 1.4
tests/lib/libc/gen/posix_spawn/t_fileactions.c: revision 1.5
sys/uvm/uvm_extern.h: revision 1.183
lib/libc/gen/posix_spawn_fileactions.c: revision 1.2
sys/kern/kern_exec.c: revision 1.348
sys/kern/kern_exec.c: revision 1.349
sys/compat/netbsd32/syscalls.master: revision 1.95
sys/uvm/uvm_glue.c: revision 1.159
sys/uvm/uvm_map.c: revision 1.317
sys/compat/netbsd32/netbsd32.h: revision 1.95
sys/kern/exec_elf.c: revision 1.38
sys/sys/spawn.h: revision 1.2
sys/sys/exec.h: revision 1.135
sys/compat/netbsd32/netbsd32_execve.c: revision 1.34
Rework posix_spawn locking and memory management:
 - always provide a vmspace for the new proc, initially borrowing from proc0
   (this part fixes PR 46286)
 - increase parallelism between parent and child if arguments allow this,
   avoiding a potential deadlock on exec_lock
 - add a new flag for userland to request old (lockstepped) behaviour for
   better error reporting
 - adapt test cases to the previous two and add a new variant to test the
   diagnostics flag
 - fix a few memory (and lock) leaks
 - provide netbsd32 compat
Fix asynchronous posix_spawn child exit status (and test for it).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.2.1 src/lib/libc/gen/posix_spawn_fileactions.c
cvs rdiff -u -r1.92 -r1.92.2.1 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.33 -r1.33.2.1 src/sys/compat/netbsd32/netbsd32_execve.c
cvs rdiff -u -r1.91 -r1.91.2.1 src/sys/compat/netbsd32/syscalls.master
cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/kern/exec_elf.c
cvs rdiff -u -r1.339.2.3 -r1.339.2.4 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.236 -r1.236.2.1 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.134 -r1.134.2.1 src/sys/sys/exec.h
cvs rdiff -u -r1.1 -r1.1.2.1 src/sys/sys/spawn.h
cvs rdiff -u -r1.181 -r1.181.2.1 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.156.2.2 -r1.156.2.3 src/sys/uvm/uvm_glue.c
cvs rdiff -u -r1.313.2.1 -r1.313.2.2 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.2.2.1 -r1.2.2.2 \
src/tests/lib/libc/gen/posix_spawn/t_fileactions.c

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

Modified files:

Index: src/lib/libc/gen/posix_spawn_fileactions.c
diff -u src/lib/libc/gen/posix_spawn_fileactions.c:1.1 src/lib/libc/gen/posix_spawn_fileactions.c:1.1.2.1
--- src/lib/libc/gen/posix_spawn_fileactions.c:1.1	Sat Feb 11 23:31:24 2012
+++ src/lib/libc/gen/posix_spawn_fileactions.c	Thu Apr 12 17:05:37 2012
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: posix_spawn_fileactions.c,v 1.1 2012/02/11 23:31:24 martin Exp $);
+__RCSID($NetBSD: posix_spawn_fileactions.c,v 1.1.2.1 2012/04/12 17:05:37 riz Exp $);
 
 #include namespace.h
 
@@ -62,7 +62,7 @@ posix_spawn_file_actions_init(posix_spaw
 int
 posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *fa)
 {
-	int i;
+	unsigned int i;
 
 	if (fa == NULL)
 		return (-1);
@@ -80,7 +80,7 @@ static int
 posix_spawn_file_actions_getentry(posix_spawn_file_actions_t *fa)
 {
 	if (fa == NULL)
-		return (-1);
+		return -1;
 
 	if (fa-len  fa-size)
 		return fa-len;
@@ -89,7 +89,7 @@ posix_spawn_file_actions_getentry(posix_
 			sizeof(struct posix_spawn_file_actions_entry));
 
 	if (fa-fae == NULL)
-		return (-1);
+		return -1;
 
 	fa-size += MIN_SIZE;
 

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.92 src/sys/compat/netbsd32/netbsd32.h:1.92.2.1
--- src/sys/compat/netbsd32/netbsd32.h:1.92	Wed Feb  1 05:46:46 2012
+++ src/sys/compat/netbsd32/netbsd32.h	Thu Apr 12 17:05:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.92 2012/02/01 05:46:46 dholland Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.92.2.1 2012/04/12 17:05:37 riz Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -151,6 +151,10 @@ typedef netbsd32_pointer_t netbsd32_lwpi
 typedef netbsd32_pointer_t netbsd32_ucontextp;
 typedef netbsd32_pointer_t netbsd32_caddr_t;
 typedef netbsd32_pointer_t netbsd32_lwpctlp;
+typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actionsp;
+typedef netbsd32_pointer_t netbsd32_posix_spawnattrp;
+typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actions_entryp;
+typedef netbsd32_pointer_t netbsd32_pid_tp;
 
 /*
 

CVS commit: [netbsd-6] src/doc

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 17:06:58 UTC 2012

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

Log Message:
Ticket 175.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.67 -r1.1.2.68 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.67 src/doc/CHANGES-6.0:1.1.2.68
--- src/doc/CHANGES-6.0:1.1.2.67	Mon Apr  9 18:17:45 2012
+++ src/doc/CHANGES-6.0	Thu Apr 12 17:06:58 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0,v 1.1.2.67 2012/04/09 18:17:45 riz Exp $
+# $NetBSD: CHANGES-6.0,v 1.1.2.68 2012/04/12 17:06:58 riz Exp $
 
 A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012
 until the 6.0 release:
@@ -1769,3 +1769,20 @@ lib/libpthread/pthread_cancelstub.c		1.3
 	csup to run on NetBSD. PR#45131.
 	[agc, ticket #174]
 
+lib/libc/gen/posix_spawn_fileactions.c		1.2
+sys/compat/netbsd32/netbsd32.h			1.95
+sys/compat/netbsd32/netbsd32_execve.c		1.34
+sys/compat/netbsd32/syscalls.master		1.95
+sys/kern/exec_elf.c1.38
+sys/kern/kern_exec.c1.348-1.349 via patch
+sys/kern/kern_exit.c1.238
+sys/sys/exec.h	1.135
+sys/sys/spawn.h	1.2
+sys/uvm/uvm_extern.h1.183
+sys/uvm/uvm_glue.c1.159
+sys/uvm/uvm_map.c1.317
+tests/lib/libc/gen/posix_spawn/t_fileactions.c	1.4-1.5
+
+	Rework posix_spawn locking and memory management. PR#46286.
+	[martin, ticket #175]
+



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

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 17:09:02 UTC 2012

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

Log Message:
Pull up following revision(s) (requested by njoly in ticket #176):
sys/arch/x86/x86/ipmi.c: revision 1.53
For 1's and 2's complement sensor data, convert unsigned raw data to a
signed type before proceeding any computation. Fix handling of
negative temperatures that can be set for critmin/warnmin limits.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.2.1 src/sys/arch/x86/x86/ipmi.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/ipmi.c
diff -u src/sys/arch/x86/x86/ipmi.c:1.52 src/sys/arch/x86/x86/ipmi.c:1.52.2.1
--- src/sys/arch/x86/x86/ipmi.c:1.52	Thu Feb  2 19:43:01 2012
+++ src/sys/arch/x86/x86/ipmi.c	Thu Apr 12 17:09:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.52 2012/02/02 19:43:01 tls Exp $ */
+/*	$NetBSD: ipmi.c,v 1.52.2.1 2012/04/12 17:09:01 riz Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.52 2012/02/02 19:43:01 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.52.2.1 2012/04/12 17:09:01 riz Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -1439,7 +1439,12 @@ ipmi_convert(uint8_t v, struct sdrtype1 
 {
 	int64_t	M, B;
 	char	K1, K2;
-	int64_t	val, v1, v2;
+	int64_t	val, v1, v2, vs;
+	int sign = (s1-units1  6)  0x3;
+
+	vs = (sign == 0x1 || sign == 0x2) ? (int8_t)v : v;
+	if ((vs  0)  (sign == 0x1))
+		vs++;
 
 	/* Calculate linear reading variables */
 	M  = signextendshort)(s1-m_tolerance  0xC0))  2) + s1-m, 10);
@@ -1454,7 +1459,7 @@ ipmi_convert(uint8_t v, struct sdrtype1 
 	 *  y = L(M*v * 10^(K2+adj) + B * 10^(K1+K2+adj)); */
 	v1 = powx(FIX10, INT2FIX(K2 + adj));
 	v2 = powx(FIX10, INT2FIX(K1 + K2 + adj));
-	val = M * v * v1 + B * v2;
+	val = M * vs * v1 + B * v2;
 
 	/* Linearization function: y = f(x) 0 : y = x 1 : y = ln(x) 2 : y =
 	 * log10(x) 3 : y = log2(x) 4 : y = e^x 5 : y = 10^x 6 : y = 2^x 7 : y



CVS commit: [netbsd-6] src/etc/powerd/scripts

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 17:10:40 UTC 2012

Modified Files:
src/etc/powerd/scripts [netbsd-6]: sensor_temperature

Log Message:
Pull up following revision(s) (requested by jruoho in ticket #177):
etc/powerd/scripts/sensor_temperature: revision 1.4
Gracefully shutdown upon reaching critical temperature levels. Prevents few
laptops (ThinkPad T61 and x61s, among others) from hitting the in-CPU reset.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.32.1 src/etc/powerd/scripts/sensor_temperature

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

Modified files:

Index: src/etc/powerd/scripts/sensor_temperature
diff -u src/etc/powerd/scripts/sensor_temperature:1.3 src/etc/powerd/scripts/sensor_temperature:1.3.32.1
--- src/etc/powerd/scripts/sensor_temperature:1.3	Thu Oct 11 00:30:48 2007
+++ src/etc/powerd/scripts/sensor_temperature	Thu Apr 12 17:10:40 2012
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: sensor_temperature,v 1.3 2007/10/11 00:30:48 xtraeme Exp $
+#	$NetBSD: sensor_temperature,v 1.3.32.1 2012/04/12 17:10:40 riz Exp $
 #
 # Generic script for temperature sensors.
 #
@@ -15,6 +15,7 @@ normal)
 	;;
 critical)
 	logger -p warning ${0}: ($1) critical state entered [${3}] 1
+	/sbin/shutdown -p now ${0}: CRITICAL TEMPERATURE! SHUTTING DOWN.
 	exit 0
 	;;
 critical-under)
@@ -23,6 +24,7 @@ critical-under)
 	;;
 critical-over)
 	logger -p warning ${0}: ($1) critical limit exceeded [${3}] 1
+	/sbin/shutdown -p now ${0}: CRITICAL TEMPERATURE! SHUTTING DOWN.
 	exit 0
 	;;
 warning-under)



CVS commit: [netbsd-6] src/etc/skel

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 17:12:06 UTC 2012

Modified Files:
src/etc/skel [netbsd-6]: dot.profile

Log Message:
Pull up following revision(s) (requested by dholland in ticket #178):
etc/skel/dot.profile: revision 1.9
fix use of setenv in a comment, noted by stu314 on freenode.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.4.1 src/etc/skel/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/etc/skel/dot.profile
diff -u src/etc/skel/dot.profile:1.8 src/etc/skel/dot.profile:1.8.4.1
--- src/etc/skel/dot.profile:1.8	Wed Oct 19 14:42:37 2011
+++ src/etc/skel/dot.profile	Thu Apr 12 17:12:06 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: dot.profile,v 1.8 2011/10/19 14:42:37 christos Exp $
+#	$NetBSD: dot.profile,v 1.8.4.1 2012/04/12 17:12:06 riz Exp $
 #
 # This is the default .profile file.
 # Users are expected to edit it to meet their own needs.
@@ -29,7 +29,7 @@ export EDITOR=vi
 #export PAGER=more
 
 # Set your default printer, if desired.
-#setenv PRINTER change-this-to-a-printer
+#export PRINTER=change-this-to-a-printer
 
 # Set the search path for programs.
 PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R7/bin:/usr/X11R6/bin:/usr/pkg/bin



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

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 17:15:23 UTC 2012

Modified Files:
src/sys/kern [netbsd-6]: vfs_vnops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #179):
sys/kern/vfs_vnops.c: revision 1.184
Fix vn_lock() to return an invalid (dead, clean) vnode
only if the caller requested it by setting LK_RETRY.
Should fix PR #46221: Kernel panic in NFS server code


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.183.8.1 src/sys/kern/vfs_vnops.c

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

Modified files:

Index: src/sys/kern/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.183 src/sys/kern/vfs_vnops.c:1.183.8.1
--- src/sys/kern/vfs_vnops.c:1.183	Fri Oct 14 09:23:31 2011
+++ src/sys/kern/vfs_vnops.c	Thu Apr 12 17:15:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.183 2011/10/14 09:23:31 hannken Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.183.8.1 2012/04/12 17:15:23 riz Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.183 2011/10/14 09:23:31 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.183.8.1 2012/04/12 17:15:23 riz Exp $);
 
 #include veriexec.h
 
@@ -805,6 +805,15 @@ vn_lock(struct vnode *vp, int flags)
 		} else {
 			mutex_exit(vp-v_interlock);
 			error = VOP_LOCK(vp, (flags  ~LK_RETRY));
+			if (error == 0  (flags  LK_RETRY) == 0) {
+mutex_enter(vp-v_interlock);
+if ((vp-v_iflag  VI_CLEAN)) {
+	mutex_exit(vp-v_interlock);
+	VOP_UNLOCK(vp);
+	return ENOENT;
+}
+mutex_exit(vp-v_interlock);
+			}
 			if (error == 0 || error == EDEADLK || error == EBUSY)
 return (error);
 		}



CVS commit: [netbsd-6] src/doc

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 17:16:14 UTC 2012

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

Log Message:
Tickets 176-179.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.68 -r1.1.2.69 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.68 src/doc/CHANGES-6.0:1.1.2.69
--- src/doc/CHANGES-6.0:1.1.2.68	Thu Apr 12 17:06:58 2012
+++ src/doc/CHANGES-6.0	Thu Apr 12 17:16:14 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0,v 1.1.2.68 2012/04/12 17:06:58 riz Exp $
+# $NetBSD: CHANGES-6.0,v 1.1.2.69 2012/04/12 17:16:14 riz Exp $
 
 A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012
 until the 6.0 release:
@@ -1786,3 +1786,27 @@ tests/lib/libc/gen/posix_spawn/t_fileact
 	Rework posix_spawn locking and memory management. PR#46286.
 	[martin, ticket #175]
 
+sys/arch/x86/x86/ipmi.c1.53
+
+	Fix handling of negative temperatures that can be set for
+	critmin/warnmin limits.
+	[njoly, ticket #176]
+
+etc/powerd/scripts/sensor_temperature		1.4
+
+	Gracefully shutdown upon reaching critical temperature levels.
+	Prevents few laptops (ThinkPad T61 and x61s, among others) from
+	hitting the in-CPU reset.
+	[jruoho, ticket #177]
+
+etc/skel/dot.profile1.9
+
+	Fix use of setenv in a comment.
+	[dholland, ticket #178]
+
+sys/kern/vfs_vnops.c1.184
+
+	Fix vn_lock() to return an invalid (dead, clean) vnode
+	only if the caller requested it by setting LK_RETRY. PR#46221.
+	[hannken, ticket #179]
+



CVS commit: src/sys/dev/pci

2012-04-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 12 18:55:26 UTC 2012

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

Log Message:
- set colour channel info only in 32bit colour
- fix comment ( don't claim to run in some byte-swapped mode when we don't )


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/radeonfb.c

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

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.60 src/sys/dev/pci/radeonfb.c:1.61
--- src/sys/dev/pci/radeonfb.c:1.60	Mon Mar 26 21:59:01 2012
+++ src/sys/dev/pci/radeonfb.c	Thu Apr 12 18:55:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.60 2012/03/26 21:59:01 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.61 2012/04/12 18:55:26 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.60 2012/03/26 21:59:01 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.61 2012/04/12 18:55:26 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -2221,23 +2221,27 @@ radeonfb_init_screen(void *cookie, struc
 	if (ri-ri_depth == 32) {
 		ri-ri_flg |= RI_ENABLE_ALPHA;
 	}
-	if (ri-ri_depth == 8) {
-		ri-ri_flg |= RI_ENABLE_ALPHA | RI_8BIT_IS_RGB;
+	switch (ri-ri_depth) {
+		case 8:
+			ri-ri_flg |= RI_ENABLE_ALPHA | RI_8BIT_IS_RGB;
+			break;
+		case 32:
+			/* we run radeons in RGB even on SPARC hardware */
+			ri-ri_rnum = 8;
+			ri-ri_gnum = 8;
+			ri-ri_bnum = 8;
+			ri-ri_rpos = 16;
+			ri-ri_gpos = 8;
+			ri-ri_bpos = 0;
+			break;
 	}
+
 	ri-ri_bits = (void *)dp-rd_fbptr;
 
 #ifdef VCONS_DRAW_INTR
 	scr-scr_flags |= VCONS_DONT_READ;
 #endif
 
-	/* this is rgb in big-endian order... */
-	ri-ri_rnum = 8;
-	ri-ri_gnum = 8;
-	ri-ri_bnum = 8;
-	ri-ri_rpos = 16;
-	ri-ri_gpos = 8;
-	ri-ri_bpos = 0;
-
 	if (existing) {
 		ri-ri_flg |= RI_CLEAR;
 



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

2012-04-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 12 19:09:18 UTC 2012

Modified Files:
src/sys/arch/sparc64/dev: ffb.c

Log Message:
don't assume that wscons assumes BGR ordering and request it explicitly


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sparc64/dev/ffb.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/sparc64/dev/ffb.c
diff -u src/sys/arch/sparc64/dev/ffb.c:1.50 src/sys/arch/sparc64/dev/ffb.c:1.51
--- src/sys/arch/sparc64/dev/ffb.c:1.50	Wed Jan 11 15:53:32 2012
+++ src/sys/arch/sparc64/dev/ffb.c	Thu Apr 12 19:09:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffb.c,v 1.50 2012/01/11 15:53:32 macallan Exp $	*/
+/*	$NetBSD: ffb.c,v 1.51 2012/04/12 19:09:18 macallan Exp $	*/
 /*	$OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffb.c,v 1.50 2012/01/11 15:53:32 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffb.c,v 1.51 2012/04/12 19:09:18 macallan Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -1188,6 +1188,14 @@ ffb_init_screen(void *cookie, struct vco
 #endif
 	DPRINTF((ffb_init_screen: addr: %08lx\n,(ulong)ri-ri_bits));
 
+	/* explicitly request BGR in case the default changes */
+	ri-ri_rnum = 8;
+	ri-ri_gnum = 8;
+	ri-ri_bnum = 8;
+	ri-ri_rpos = 0;
+	ri-ri_gpos = 8;
+	ri-ri_bpos = 16;
+
 	rasops_init(ri, 0, 0);
 	ri-ri_caps = WSSCREEN_WSCOLORS;
 	rasops_reconfig(ri, sc-sc_height / ri-ri_font-fontheight,



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

2012-04-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 12 19:11:49 UTC 2012

Modified Files:
src/sys/arch/sparc64/dev: gfb.c

Log Message:
- don't mess with more than 256 colour map entries
- don't assume that wscons assumes BGR
- while there enable alpha


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/gfb.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/sparc64/dev/gfb.c
diff -u src/sys/arch/sparc64/dev/gfb.c:1.6 src/sys/arch/sparc64/dev/gfb.c:1.7
--- src/sys/arch/sparc64/dev/gfb.c:1.6	Tue Mar 13 18:40:29 2012
+++ src/sys/arch/sparc64/dev/gfb.c	Thu Apr 12 19:11:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gfb.c,v 1.6 2012/03/13 18:40:29 elad Exp $	*/
+/*	$NetBSD: gfb.c,v 1.7 2012/04/12 19:11:49 macallan Exp $	*/
 
 /*
  * Copyright (c) 2009 Michael Lorenz
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gfb.c,v 1.6 2012/03/13 18:40:29 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: gfb.c,v 1.7 2012/04/12 19:11:49 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -189,7 +189,7 @@ gfb_attach(device_t parent, device_t sel
 	ri = sc-sc_console_screen.scr_ri;
 
 	j = 0;
-	for (i = 0; i  (1  sc-sc_depth); i++) {
+	for (i = 0; i  256; i++) {
 
 		sc-sc_cmap_red[i] = rasops_cmap[j];
 		sc-sc_cmap_green[i] = rasops_cmap[j + 1];
@@ -348,7 +348,7 @@ gfb_init_screen(void *cookie, struct vco
 	ri-ri_width = sc-sc_width;
 	ri-ri_height = sc-sc_height;
 	ri-ri_stride = sc-sc_stride;
-	ri-ri_flg = RI_CENTER | RI_FULLCLEAR;
+	ri-ri_flg = RI_CENTER | RI_FULLCLEAR | RI_ENABLE_ALPHA;
 
 	ri-ri_bits = (char *)sc-sc_fbaddr;
 	scr-scr_flags |= VCONS_DONT_READ;
@@ -357,6 +357,14 @@ gfb_init_screen(void *cookie, struct vco
 		ri-ri_flg |= RI_CLEAR;
 	}
 
+	/* explicitly request BGR in case the default changes */
+	ri-ri_rnum = 8;
+	ri-ri_gnum = 8;
+	ri-ri_bnum = 8;
+	ri-ri_rpos = 0;
+	ri-ri_gpos = 8;
+	ri-ri_bpos = 16;
+
 	rasops_init(ri, 0, 0);
 	ri-ri_caps = WSSCREEN_WSCOLORS;
 



CVS commit: src/lib/libc

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 19:36:19 UTC 2012

Modified Files:
src/lib/libc/gen: Makefile.inc getpass.3 getpass.c
src/lib/libc/include: namespace.h

Log Message:
Add a new getpass implementation that does not mess with signals, and
include getpass_r


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/lib/libc/gen/Makefile.inc
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gen/getpass.3
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/getpass.c
cvs rdiff -u -r1.151 -r1.152 src/lib/libc/include/namespace.h

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

Modified files:

Index: src/lib/libc/gen/Makefile.inc
diff -u src/lib/libc/gen/Makefile.inc:1.182 src/lib/libc/gen/Makefile.inc:1.183
--- src/lib/libc/gen/Makefile.inc:1.182	Sat Feb 11 18:31:24 2012
+++ src/lib/libc/gen/Makefile.inc	Thu Apr 12 15:36:19 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.182 2012/02/11 23:31:24 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.183 2012/04/12 19:36:19 christos Exp $
 #	from: @(#)Makefile.inc	8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -117,6 +117,7 @@ MLINKS+=cgetcap.3 cgetclose.3 cgetcap.3 
 	cgetcap.3 cgetnum.3 cgetcap.3 cgetset.3 cgetcap.3 cgetstr.3 \
 	cgetcap.3 cgetustr.3
 MLINKS+=getcwd.3 getwd.3
+MLINKS+=getpass.3 getpass_r.3
 MLINKS+=getdiskbyname.3 setdisktab.3
 MLINKS+=getdomainname.3 setdomainname.3
 MLINKS+=getfsent.3 endfsent.3 getfsent.3 getfsfile.3 getfsent.3 getfsspec.3 \

Index: src/lib/libc/gen/getpass.3
diff -u src/lib/libc/gen/getpass.3:1.13 src/lib/libc/gen/getpass.3:1.14
--- src/lib/libc/gen/getpass.3:1.13	Thu May  6 07:09:39 2010
+++ src/lib/libc/gen/getpass.3	Thu Apr 12 15:36:19 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: getpass.3,v 1.13 2010/05/06 11:09:39 jruoho Exp $
+.\	$NetBSD: getpass.3,v 1.14 2012/04/12 19:36:19 christos Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)getpass.3	8.1 (Berkeley) 6/4/93
 .\
-.Dd May 6, 2010
+.Dd April 12, 2012
 .Dt GETPASS 3
 .Os
 .Sh NAME
@@ -38,10 +38,11 @@
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In pwd.h
 .In unistd.h
 .Ft char *
 .Fn getpass const char *prompt
+.Ft char *
+.Fn getpass_r const char *prompt char *buf size_t buflen
 .Sh DESCRIPTION
 The
 .Fn getpass
@@ -52,16 +53,34 @@ If this file is not accessible,
 displays the prompt on the standard error output and reads from the standard
 input.
 .Pp
-The password may be up to _PASSWORD_LEN (currently 128)
+The password may be up to 
+.Xr sysconf 3
+.Dv _SC_PASS_MAX
 characters in length.
 Any additional
 characters and the terminating newline character are discarded.
 .Pp
 .Fn getpass
 turns off character echoing while reading the password.
+.Pp
+.Fn getpass_r
+is similar to
+.Fn getpass
+only it puts its result in
+.Fa buf
+for up to
+.Fa buflen
+characters.
 .Sh RETURN VALUES
+The
 .Fn getpass
-returns a pointer to the null terminated password.
+function returns a pointer to the NUL terminated password, or an empty
+string on error.
+The
+.Fn getpass_r
+function returns a pointer to the NUL terminated password, or
+.Dv NULL
+on error.
 .Sh FILES
 .Bl -tag -width /dev/tty -compact
 .It Pa /dev/tty
@@ -82,6 +101,10 @@ A
 .Fn getpass
 function appeared in
 .At v7 .
+The
+.Fn getpass_r
+function appeared in
+.Nx 7.0 .
 .Sh BUGS
 The
 .Fn getpass
@@ -94,3 +117,9 @@ will modify the same object.
 The calling process should zero the password as soon as possible to
 avoid leaving the cleartext password visible in the process's address
 space.
+.Pp
+Historically
+.Nm
+accepted and returned a password if it could not modify the terminal
+settings to turn echo off (or if the input was not a terminal).
+In this implementation, only terminal input is accepted.

Index: src/lib/libc/gen/getpass.c
diff -u src/lib/libc/gen/getpass.c:1.16 src/lib/libc/gen/getpass.c:1.17
--- src/lib/libc/gen/getpass.c:1.16	Tue Jan  1 16:22:55 2008
+++ src/lib/libc/gen/getpass.c	Thu Apr 12 15:36:19 2012
@@ -1,8 +1,11 @@
-/*	$NetBSD: getpass.c,v 1.16 2008/01/01 21:22:55 christos Exp $	*/
+/*	$NetBSD: getpass.c,v 1.17 2012/04/12 19:36:19 christos Exp $	*/
 
-/*
- * Copyright (c) 1988, 1993
- *	The Regents of the University of California.  All rights reserved.
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -12,96 +15,220 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *may be used to 

CVS commit: src/include

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 19:36:34 UTC 2012

Modified Files:
src/include: unistd.h

Log Message:
add getpass_r


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/include/unistd.h

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

Modified files:

Index: src/include/unistd.h
diff -u src/include/unistd.h:1.128 src/include/unistd.h:1.129
--- src/include/unistd.h:1.128	Sat Nov  5 05:27:06 2011
+++ src/include/unistd.h	Thu Apr 12 15:36:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.128 2011/11/05 09:27:06 joerg Exp $	*/
+/*	$NetBSD: unistd.h,v 1.129 2012/04/12 19:36:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -327,6 +327,7 @@ int	 getdomainname(char *, size_t);
 int	 getgrouplist(const char *, gid_t, gid_t *, int *);
 int	 getgroupmembership(const char *, gid_t, gid_t *, int, int *);
 mode_t	 getmode(const void *, mode_t);
+char	*getpass_r(const char *, char *, size_t);
 int	 getpeereid(int, uid_t *, gid_t *);
 int	 getsubopt(char **, char * const *, char **);
 __aconst char *getusershell(void);



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

2012-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr 12 19:38:27 UTC 2012

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_fault.c uvm_km.c

Log Message:
Apply colormask to get a valid color.


To generate a diff of this commit:
cvs rdiff -u -r1.125.6.1.4.5 -r1.125.6.1.4.6 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.101.4.2.4.10 -r1.101.4.2.4.11 src/sys/uvm/uvm_km.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/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.125.6.1.4.5 src/sys/uvm/uvm_fault.c:1.125.6.1.4.6
--- src/sys/uvm/uvm_fault.c:1.125.6.1.4.5	Thu Apr 12 01:40:27 2012
+++ src/sys/uvm/uvm_fault.c	Thu Apr 12 19:38:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.125.6.1.4.5 2012/04/12 01:40:27 matt Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.125.6.1.4.6 2012/04/12 19:38:27 matt Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.125.6.1.4.5 2012/04/12 01:40:27 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.125.6.1.4.6 2012/04/12 19:38:27 matt Exp $);
 
 #include opt_uvmhist.h
 
@@ -369,7 +369,8 @@ uvmfault_anonget(struct uvm_faultinfo *u
 uvmexp.fltnoram++;
 UVMHIST_LOG(maphist,   noram -- UVM_WAIT,0,
 0,0,0);
-if (!uvm_reclaimable(atop(ufi-orig_rvaddr),
+if (!uvm_reclaimable(
+atop(ufi-orig_rvaddr)  uvmexp.colormask,
 false)) {
 	return ENOMEM;
 }
@@ -643,7 +644,8 @@ uvmfault_promote(struct uvm_faultinfo *u
 		uvm_page_unbusy(uobjpage, 1);
 		uvmfault_unlockall(ufi, amap, uobj, oanon);
 nomem:
-		if (!uvm_reclaimable(atop(ufi-orig_rvaddr), false)) {
+		if (!uvm_reclaimable(
+			atop(ufi-orig_rvaddr)  uvmexp.colormask, false)) {
 			UVMHIST_LOG(maphist, out of VM, 0,0,0,0);
 			uvmexp.fltnoanon++;
 			error = ENOMEM;
@@ -1406,7 +1408,8 @@ ReFault:
 		if (anon != oanon)
 			mutex_exit(anon-an_lock);
 		uvmfault_unlockall(ufi, amap, uobj, oanon);
-		if (!uvm_reclaimable(atop(ufi.orig_rvaddr), false)) {
+		if (!uvm_reclaimable(
+			atop(ufi.orig_rvaddr)  uvmexp.colormask, false)) {
 			UVMHIST_LOG(maphist,
 			- failed.  out of VM,0,0,0,0);
 			/* XXX instrumentation */
@@ -1791,7 +1794,8 @@ Case2:
 		pg-flags = ~(PG_BUSY|PG_FAKE|PG_WANTED);
 		UVM_PAGE_OWN(pg, NULL, NULL);
 		uvmfault_unlockall(ufi, amap, uobj, anon);
-		if (!uvm_reclaimable(atop(ufi.orig_rvaddr), false)) {
+		if (!uvm_reclaimable(
+			atop(ufi.orig_rvaddr)  uvmexp.colormask, false)) {
 			UVMHIST_LOG(maphist,
 			- failed.  out of VM,0,0,0,0);
 			/* XXX instrumentation */

Index: src/sys/uvm/uvm_km.c
diff -u src/sys/uvm/uvm_km.c:1.101.4.2.4.10 src/sys/uvm/uvm_km.c:1.101.4.2.4.11
--- src/sys/uvm/uvm_km.c:1.101.4.2.4.10	Thu Apr 12 01:40:27 2012
+++ src/sys/uvm/uvm_km.c	Thu Apr 12 19:38:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_km.c,v 1.101.4.2.4.10 2012/04/12 01:40:27 matt Exp $	*/
+/*	$NetBSD: uvm_km.c,v 1.101.4.2.4.11 2012/04/12 19:38:27 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -128,7 +128,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_km.c,v 1.101.4.2.4.10 2012/04/12 01:40:27 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_km.c,v 1.101.4.2.4.11 2012/04/12 19:38:27 matt Exp $);
 
 #include opt_uvmhist.h
 
@@ -617,9 +617,10 @@ uvm_km_alloc(struct vm_map *map, vsize_t
 		 */
 
 		if (__predict_false(pg == NULL)) {
-			if ((flags  UVM_KMF_NOWAIT) ||
-			((flags  UVM_KMF_CANFAIL)
-			 !uvm_reclaimable(atop(offset), true))) {
+			if ((flags  UVM_KMF_NOWAIT)
+			|| ((flags  UVM_KMF_CANFAIL)
+			 !uvm_reclaimable(
+atop(offset)  uvmexp.colormask, true))) {
 /* free everything! */
 uvm_km_free(map, kva, size,
 flags  UVM_KMF_TYPEMASK);



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

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 19:38:31 UTC 2012

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

Log Message:
add getpass_r


To generate a diff of this commit:
cvs rdiff -u -r1.1751 -r1.1752 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1751 src/distrib/sets/lists/comp/mi:1.1752
--- src/distrib/sets/lists/comp/mi:1.1751	Sat Apr  7 12:48:24 2012
+++ src/distrib/sets/lists/comp/mi	Thu Apr 12 15:38:30 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1751 2012/04/07 16:48:24 christos Exp $
+#	$NetBSD: mi,v 1.1752 2012/04/12 19:38:30 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -6738,6 +6738,7 @@
 ./usr/share/man/cat3/getpary.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getparyx.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getpass.0			comp-c-catman		.cat
+./usr/share/man/cat3/getpass_r.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getpeereid.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getprogname.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getprotobyname.0		comp-c-catman		.cat
@@ -13045,6 +13046,7 @@
 ./usr/share/man/html3/getpary.html		comp-c-htmlman		html
 ./usr/share/man/html3/getparyx.html		comp-c-htmlman		html
 ./usr/share/man/html3/getpass.html		comp-c-htmlman		html
+./usr/share/man/html3/getpass_r.html		comp-c-htmlman		html
 ./usr/share/man/html3/getpeereid.html		comp-c-htmlman		html
 ./usr/share/man/html3/getprogname.html		comp-c-htmlman		html
 ./usr/share/man/html3/getprotobyname.html	comp-c-htmlman		html
@@ -19268,6 +19270,7 @@
 ./usr/share/man/man3/getpary.3			comp-c-man		.man
 ./usr/share/man/man3/getparyx.3			comp-c-man		.man
 ./usr/share/man/man3/getpass.3			comp-c-man		.man
+./usr/share/man/man3/getpass_r.3		comp-c-man		.man
 ./usr/share/man/man3/getpeereid.3		comp-c-man		.man
 ./usr/share/man/man3/getprogname.3		comp-c-man		.man
 ./usr/share/man/man3/getprotobyname.3		comp-c-man		.man



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

2012-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr 12 19:39:55 UTC 2012

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pdpolicy_clock.c

Log Message:
Use PQ_SWAPBACKED to determine radioactiveness of page.
Make sure to add in number of radioactive pages to actives pages.


To generate a diff of this commit:
cvs rdiff -u -r1.12.16.5 -r1.12.16.6 src/sys/uvm/uvm_pdpolicy_clock.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/uvm/uvm_pdpolicy_clock.c
diff -u src/sys/uvm/uvm_pdpolicy_clock.c:1.12.16.5 src/sys/uvm/uvm_pdpolicy_clock.c:1.12.16.6
--- src/sys/uvm/uvm_pdpolicy_clock.c:1.12.16.5	Thu Apr 12 01:40:27 2012
+++ src/sys/uvm/uvm_pdpolicy_clock.c	Thu Apr 12 19:39:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.12.16.5 2012/04/12 01:40:27 matt Exp $	*/
+/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.12.16.6 2012/04/12 19:39:55 matt Exp $	*/
 /*	NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $	*/
 
 /*
@@ -74,7 +74,7 @@
 #else /* defined(PDSIM) */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_pdpolicy_clock.c,v 1.12.16.5 2012/04/12 01:40:27 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_pdpolicy_clock.c,v 1.12.16.6 2012/04/12 19:39:55 matt Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -348,7 +348,7 @@ uvmpdpol_pagedeactivate(struct vm_page *
 	 * a backing store, don't bother marking it INACTIVE since it would
 	 * only be a dirty reactivation.
 	 */
-	if (uvmexp.nswapdev  1  pg-uobject == NULL  pg-uanon != NULL) {
+	if (uvmexp.nswapdev  1  (pg-pqflags  PQ_SWAPBACKED) != 0) {
 		KASSERT(pg-pqflags  PQ_RADIOACTIVE);
 		return;
 	}
@@ -405,7 +405,7 @@ uvmpdpol_pageactivate(struct vm_page *pg
 	KASSERT(mutex_owned(uvm_pageqlock));
 
 	uvmpdpol_pagedequeue(pg);
-	if (uvmexp.nswapdev  1  pg-uanon != NULL  pg-uobject == NULL) {
+	if (uvmexp.nswapdev  1  (pg-pqflags  PQ_SWAPBACKED) != 0) {
 		TAILQ_INSERT_TAIL(gs-gs_radioactiveq, pg, pageq.queue);
 		pg-pqflags |= PQ_RADIOACTIVE;
 		gs-gs_radioactive++;
@@ -488,7 +488,7 @@ uvmpdpol_estimatepageable(const struct u
 	if (grp != NULL) {
 		struct uvmpdpol_groupstate * const gs = grp-pgrp_gs;
 		if (activep) {
-			*activep += gs-gs_active;
+			*activep += gs-gs_active + gs-gs_radioactive;
 		}
 		if (inactivep) {
 			*inactivep = gs-gs_inactive;
@@ -503,7 +503,7 @@ uvmpdpol_estimatepageable(const struct u
 		//KDASSERT(gs-gs_active == clock_pglist_count(gs-gs_activeq));
 		//KDASSERT(gs-gs_inactive == clock_pglist_count(gs-gs_inactiveq));
 
-		active += gs-gs_active;
+		active += gs-gs_active + gs-gs_radioactive;
 		inactive += gs-gs_inactive;
 	}
 



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

2012-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr 12 19:41:57 UTC 2012

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pdaemon.c

Log Message:
If after the pagedaemon is woken and it processes the queues and make no
progress (frees no pages), instead of immediately trying again, wait 2 seconds.


To generate a diff of this commit:
cvs rdiff -u -r1.93.4.2.4.9 -r1.93.4.2.4.10 src/sys/uvm/uvm_pdaemon.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/uvm/uvm_pdaemon.c
diff -u src/sys/uvm/uvm_pdaemon.c:1.93.4.2.4.9 src/sys/uvm/uvm_pdaemon.c:1.93.4.2.4.10
--- src/sys/uvm/uvm_pdaemon.c:1.93.4.2.4.9	Thu Apr 12 01:40:27 2012
+++ src/sys/uvm/uvm_pdaemon.c	Thu Apr 12 19:41:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.9 2012/04/12 01:40:27 matt Exp $	*/
+/*	$NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.10 2012/04/12 19:41:57 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.9 2012/04/12 01:40:27 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.10 2012/04/12 19:41:57 matt Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -102,7 +102,7 @@ __KERNEL_RCSID(0, $NetBSD: uvm_pdaemon.
  * local prototypes
  */
 
-static void	uvmpd_scan(struct uvm_pggroup *);
+static bool	uvmpd_scan(struct uvm_pggroup *);
 static void	uvmpd_scan_queue(struct uvm_pggroup *);
 static void	uvmpd_tune(void);
 
@@ -359,6 +359,7 @@ uvm_pageout(void *arg)
 	struct pool *pp;
 	uint64_t where;
 	struct uvm_pdinfo * const pdinfo = uvm_pdinfo;
+	bool progress = true;
 	UVMHIST_FUNC(uvm_pageout); UVMHIST_CALLED(pdhist);
 
 	UVMHIST_LOG(pdhist,starting uvm pagedaemon, 0, 0, 0, 0);
@@ -387,13 +388,18 @@ uvm_pageout(void *arg)
 		 * If we have no one waiting or all color requests have
 		 * active paging, then wait.
 		 */
-		if (pdinfo-pd_waiters == 0
-		 TAILQ_FIRST(pdinfo-pd_pendingq) == NULL) {
+		if (progress == false
+		|| (pdinfo-pd_waiters == 0
+		 TAILQ_FIRST(pdinfo-pd_pendingq) == NULL)) {
 			UVMHIST_LOG(pdhist,  SLEEPING,0,0,0,0);
+			int timo = 0;
+			if (!progress  pdinfo-pd_waiters  0)
+timo = 2 * hz;
 			UVM_UNLOCK_AND_WAIT(uvm.pagedaemon,
-			uvm_fpageqlock, false, pgdaemon, 0);
+			uvm_fpageqlock, false, pgdaemon, timo);
 			uvmexp.pdwoke++;
 			UVMHIST_LOG(pdhist,  WOKE UP,0,0,0,0);
+			progress = false;
 		} else if (TAILQ_FIRST(pdinfo-pd_pendingq) == NULL) {
 			/*
 			 * Someone is waiting but no group are pending.
@@ -462,7 +468,8 @@ uvm_pageout(void *arg)
 			if (grp-pgrp_paging  diff
 			|| uvmpdpol_needsscan_p(grp)) {
 mutex_spin_exit(uvm_fpageqlock);
-uvmpd_scan(grp);
+if (uvmpd_scan(grp))
+	progress = true;
 mutex_spin_enter(uvm_fpageqlock);
 			} else {
 UVMHIST_LOG(pdhist,
@@ -1157,7 +1164,7 @@ uvmpd_scan_queue(struct uvm_pggroup *grp
  * = called with pageq's locked
  */
 
-static void
+static bool
 uvmpd_scan(struct uvm_pggroup *grp)
 {
 	u_int swap_shortage, pages_freed;
@@ -1184,10 +1191,10 @@ uvmpd_scan(struct uvm_pggroup *grp)
 	 */
 
 	swap_shortage = 0;
-	if (grp-pgrp_free  grp-pgrp_freetarg 
-	uvmexp.swpginuse = uvmexp.swpgavail 
-	!uvm_swapisfull() 
-	pages_freed == 0) {
+	if (pages_freed == 0
+	 grp-pgrp_free  grp-pgrp_freetarg
+	 uvmexp.swpginuse = uvmexp.swpgavail
+	 !uvm_swapisfull()) {
 		swap_shortage = grp-pgrp_freetarg - grp-pgrp_free;
 	}
 
@@ -1198,6 +1205,7 @@ uvmpd_scan(struct uvm_pggroup *grp)
 	 * free target.  we need to unlock the page queues for this.
 	 */
 
+#ifdef VMSWAP
 	if (grp-pgrp_free  grp-pgrp_freemin
 	 uvmexp.nswapdev != 0  uvm.swapout_enabled) {
 		grp-pgrp_pdswout++;
@@ -1208,6 +1216,9 @@ uvmpd_scan(struct uvm_pggroup *grp)
 		mutex_enter(uvm_pageqlock);
 
 	}
+#endif /* VMSWAP */
+
+	return pages_freed != 0;
 }
 
 /*



CVS commit: src/lib/libc/gen

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 20:08:01 UTC 2012

Modified Files:
src/lib/libc/gen: getpass.c

Log Message:
raise signals for the tty characters that do.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/gen/getpass.c

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

Modified files:

Index: src/lib/libc/gen/getpass.c
diff -u src/lib/libc/gen/getpass.c:1.17 src/lib/libc/gen/getpass.c:1.18
--- src/lib/libc/gen/getpass.c:1.17	Thu Apr 12 15:36:19 2012
+++ src/lib/libc/gen/getpass.c	Thu Apr 12 16:08:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getpass.c,v 1.17 2012/04/12 19:36:19 christos Exp $	*/
+/*	$NetBSD: getpass.c,v 1.18 2012/04/12 20:08:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getpass.c,v 1.17 2012/04/12 19:36:19 christos Exp $);
+__RCSID($NetBSD: getpass.c,v 1.18 2012/04/12 20:08:01 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -40,6 +40,7 @@ __RCSID($NetBSD: getpass.c,v 1.17 2012/
 #include stdio.h
 #endif
 #include errno.h
+#include signal.h
 #include string.h
 #include paths.h
 #include stdbool.h
@@ -64,20 +65,21 @@ __weak_alias(getpass,_getpass)
  *	  off echo failed, we provide a tunable DONT_WORK_AND_ECHO to
  *	  disable this.
  *	- Some implementations say that on interrupt the program shall
- *	  receive an interrupt signal before the function returns. This
- *	  does not sound useful, but it could be easy to implement using
- *	  raise(3).
+ *	  receive an interrupt signal before the function returns. We
+ *	  send all the tty signals before we return, but we don't expect
+ *	  suspend to do something useful unless the caller calls us again.
  */
 char *
 getpass_r(const char *prompt, char *ret, size_t len)
 {
 	struct termios gt;
 	char c;
-	int infd, outfd;
+	int infd, outfd, sig;
 	bool lnext, havetty;
 
 	_DIAGASSERT(prompt != NULL);
 
+	sig = 0;
 	/*
 	 * Try to use /dev/tty if possible; otherwise read from stdin and
 	 * write to stderr.
@@ -156,24 +158,33 @@ getpass_r(const char *prompt, char *ret,
 			continue;
 		}
 
-		/* EOF or tty signal characters */
-		if (
+		/* tty signal characters */
+		if (c == C(VINTR, CTRL('c'))) {
+			sig = SIGINT;
+			goto out;
+		}
+		if (c == C(VQUIT, CTRL('\\'))) {
+			sig = SIGQUIT;
+			goto out;
+		}
+		if (c == C(VSUSP, CTRL('z')) || c == C(VDSUSP, CTRL('y'))) {
+			sig = SIGTSTP;
+			goto out;
+		}
+
+		/* EOF */
+		if (c == C(VEOF, CTRL('d')))  {
 #ifdef DONT_TREAT_EOF_AS_EOL
-		c == C(VEOF, CTRL('d')) ||
-#endif
-		c == C(VINTR, CTRL('c')) || 
-		c == C(VQUIT, CTRL('\\')) || c == C(VSUSP, CTRL('z')) || 
-		c == C(VDSUSP, CTRL('y'))) {
-			errno = EINTR;
+			errno = ENODATA;
 			goto out;
+#else
+			c = '\0';
+			goto add;
+#endif
 		}
 
 		/* End of line */
-		if (
-#ifndef DONT_TREAT_EOF_AS_EOL
-		c == C(VEOF, CTRL('d')) ||
-#endif
-		c == C(VEOL, CTRL('j')) || c == C(VEOL2, CTRL('l')))
+		if (c == C(VEOL, CTRL('j')) || c == C(VEOL2, CTRL('l')))
 			c = '\0';
 add:
 		if (l = len) {
@@ -199,6 +210,10 @@ restore:
 		(void)tcsetattr(infd, TCSAFLUSH|TCSASOFT, gt);
 	errno = c;
 out:
+	if (sig) {
+		(void)raise(sig);
+		errno = EINTR;
+	}
 	return NULL;
 }
 



CVS commit: [netbsd-6] src/sys/compat/netbsd32

2012-04-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Apr 12 20:13:09 UTC 2012

Modified Files:
src/sys/compat/netbsd32 [netbsd-6]: netbsd32_syscall.h
netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_sysent.c

Log Message:
Regen for ticket 175.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.99.2.1 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.98 -r1.98.2.1 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.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/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.99 src/sys/compat/netbsd32/netbsd32_syscall.h:1.99.2.1
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.99	Wed Feb  1 05:42:17 2012
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Thu Apr 12 20:13:08 2012
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.99 2012/02/01 05:42:17 dholland Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.99.2.1 2012/04/12 20:13:08 riz Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.91 2012/02/01 05:40:01 dholland Exp
+ * created from	NetBSD
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1260,6 +1260,9 @@
 /* syscall: netbsd32___quotactl ret: int args: const netbsd32_charp netbsd32_voidp */
 #define	NETBSD32_SYS_netbsd32___quotactl	473
 
-#define	NETBSD32_SYS_MAXSYSCALL	474
+/* syscall: netbsd32_posix_spawn ret: int args: netbsd32_pid_tp const netbsd32_charp const netbsd32_posix_spawn_file_actionsp const netbsd32_posix_spawnattrp netbsd32_charpp netbsd32_charpp */
+#define	NETBSD32_SYS_netbsd32_posix_spawn	474
+
+#define	NETBSD32_SYS_MAXSYSCALL	475
 #define	NETBSD32_SYS_NSYSENT	512
 #endif /* _NETBSD32_SYS_SYSCALL_H_ */
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.99 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.99.2.1
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.99	Wed Feb  1 05:42:17 2012
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Thu Apr 12 20:13:09 2012
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.99 2012/02/01 05:42:17 dholland Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.99.2.1 2012/04/12 20:13:09 riz Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.91 2012/02/01 05:40:01 dholland Exp
+ * created from	NetBSD
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2459,6 +2459,16 @@ struct netbsd32___quotactl_args {
 };
 check_syscall_args(netbsd32___quotactl)
 
+struct netbsd32_posix_spawn_args {
+	syscallarg(netbsd32_pid_tp) pid;
+	syscallarg(const netbsd32_charp) path;
+	syscallarg(const netbsd32_posix_spawn_file_actionsp) file_actions;
+	syscallarg(const netbsd32_posix_spawnattrp) attrp;
+	syscallarg(netbsd32_charpp) argv;
+	syscallarg(netbsd32_charpp) envp;
+};
+check_syscall_args(netbsd32_posix_spawn)
+
 /*
  * System call prototypes.
  */
@@ -3277,4 +3287,6 @@ int	netbsd32_futimens(struct lwp *, cons
 
 int	netbsd32___quotactl(struct lwp *, const struct netbsd32___quotactl_args *, register_t *);
 
+int	netbsd32_posix_spawn(struct lwp *, const struct netbsd32_posix_spawn_args *, register_t *);
+
 #endif /* _NETBSD32_SYS_SYSCALLARGS_H_ */

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.98 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.98.2.1
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.98	Wed Feb  1 05:42:17 2012
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Thu Apr 12 20:13:09 2012
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.98 2012/02/01 05:42:17 dholland Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.98.2.1 2012/04/12 20:13:09 riz Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.91 2012/02/01 05:40:01 dholland Exp
+ * created from	NetBSD
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.98 2012/02/01 05:42:17 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.98.2.1 2012/04/12 20:13:09 riz Exp $);
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -585,7 +585,7 @@ const char *const netbsd32_syscallnames[
 	/* 471 */	netbsd32_unlinkat,
 	/* 472 */	netbsd32_futimens,
 	/* 473 */	netbsd32___quotactl,
-	/* 474 */	# filler,
+	/* 474 */	netbsd32_posix_spawn,
 	/* 475 */	# filler,
 	/* 476 */	# filler,
 	/* 477 */	# filler,
Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.98 src/sys/compat/netbsd32/netbsd32_sysent.c:1.98.2.1
--- src/sys/compat/netbsd32/netbsd32_sysent.c:1.98	Wed Feb  1 05:42:17 2012
+++ 

CVS commit: src/lib/libc/gen

2012-04-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr 12 20:15:37 UTC 2012

Modified Files:
src/lib/libc/gen: getpass.3

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/gen/getpass.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/libc/gen/getpass.3
diff -u src/lib/libc/gen/getpass.3:1.14 src/lib/libc/gen/getpass.3:1.15
--- src/lib/libc/gen/getpass.3:1.14	Thu Apr 12 19:36:19 2012
+++ src/lib/libc/gen/getpass.3	Thu Apr 12 20:15:37 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: getpass.3,v 1.14 2012/04/12 19:36:19 christos Exp $
+.\	$NetBSD: getpass.3,v 1.15 2012/04/12 20:15:37 wiz Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -53,7 +53,7 @@ If this file is not accessible,
 displays the prompt on the standard error output and reads from the standard
 input.
 .Pp
-The password may be up to 
+The password may be up to
 .Xr sysconf 3
 .Dv _SC_PASS_MAX
 characters in length.



CVS commit: src/lib/libc/gen

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 22:07:44 UTC 2012

Modified Files:
src/lib/libc/gen: getpass.3 getpass.c

Log Message:
add getpassfd() that gives us even more fine grain control on how to get
the password.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/gen/getpass.3
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/gen/getpass.c

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

Modified files:

Index: src/lib/libc/gen/getpass.3
diff -u src/lib/libc/gen/getpass.3:1.15 src/lib/libc/gen/getpass.3:1.16
--- src/lib/libc/gen/getpass.3:1.15	Thu Apr 12 16:15:37 2012
+++ src/lib/libc/gen/getpass.3	Thu Apr 12 18:07:44 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: getpass.3,v 1.15 2012/04/12 20:15:37 wiz Exp $
+.\	$NetBSD: getpass.3,v 1.16 2012/04/12 22:07:44 christos Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -43,6 +43,8 @@
 .Fn getpass const char *prompt
 .Ft char *
 .Fn getpass_r const char *prompt char *buf size_t buflen
+.Ft char *
+.Fn getpassfd const char *prompt char *buf size_t buflen int fd[3] int flags
 .Sh DESCRIPTION
 The
 .Fn getpass
@@ -71,6 +73,34 @@ only it puts its result in
 for up to
 .Fa buflen
 characters.
+If the
+.Fa buf
+argument is
+.Dv NULL ,
+then a buffer will be dynamically allocated.
+.Pp
+The
+.Fn getpassfd
+function allows one to specify the file descriptors used to be specified in
+.Fa fd ,
+and provides an extra
+.Fa flags
+argument to control its behavior:
+.Bl -tag -width GETPASS_BUF_LIMIT
+.It Dv GETPASS_NEED_TTY
+Fail if we are unable to set the tty modes like we want.
+.It Dv GETPASS_FAIL_EOF
+Fail if we get the end-of-file character instead of returning the result so far.
+.It Dv GETPASS_BUF_LIMIT
+Beep when the buffer limit is reached, instead of silently absorbing it.
+.It Dv GETPASS_NO_SIGNAL
+Don't make ttychars send signals.
+.It Dv GETPASS_NO_BEEP
+Don't beep if we erase past the beginning of the buffer or we try to enter past
+the end.
+.It Dv GETPASS_ECHO
+Echo characters as they are typed.
+.El
 .Sh RETURN VALUES
 The
 .Fn getpass
@@ -78,7 +108,9 @@ function returns a pointer to the NUL te
 string on error.
 The
 .Fn getpass_r
-function returns a pointer to the NUL terminated password, or
+and
+.Fn getpassfd
+functions return a pointer to the NUL terminated password, or
 .Dv NULL
 on error.
 .Sh FILES
@@ -103,7 +135,9 @@ function appeared in
 .At v7 .
 The
 .Fn getpass_r
-function appeared in
+and
+.Fn getpassfd
+functions appeared in
 .Nx 7.0 .
 .Sh BUGS
 The

Index: src/lib/libc/gen/getpass.c
diff -u src/lib/libc/gen/getpass.c:1.18 src/lib/libc/gen/getpass.c:1.19
--- src/lib/libc/gen/getpass.c:1.18	Thu Apr 12 16:08:01 2012
+++ src/lib/libc/gen/getpass.c	Thu Apr 12 18:07:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getpass.c,v 1.18 2012/04/12 20:08:01 christos Exp $	*/
+/*	$NetBSD: getpass.c,v 1.19 2012/04/12 22:07:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getpass.c,v 1.18 2012/04/12 20:08:01 christos Exp $);
+__RCSID($NetBSD: getpass.c,v 1.19 2012/04/12 22:07:44 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -50,6 +50,7 @@ __RCSID($NetBSD: getpass.c,v 1.18 2012/
 #include fcntl.h
 
 #ifdef __weak_alias
+__weak_alias(getpassfd,_getpassfd)
 __weak_alias(getpass_r,_getpass_r)
 __weak_alias(getpass,_getpass)
 #endif
@@ -58,46 +59,40 @@ __weak_alias(getpass,_getpass)
  * Notes:
  *	- There is no getpass_r in POSIX
  *	- Historically EOF is documented to be treated as EOL, we provide a
- *	  tunable for that DONT_TREAT_EOF_AS_EOL to disable this.
+ *	  tunable for that GETPASS_FAIL_EOF to disable this.
  *	- Historically getpass ate extra characters silently, we provide
- *	  a tunable for that DONT_DISCARD_SILENTLY to disable this.
+ *	  a tunable for that GETPASS_BUF_LIMIT to disable this.
  *	- Historically getpass worked by echoing characters when turning
- *	  off echo failed, we provide a tunable DONT_WORK_AND_ECHO to
+ *	  off echo failed, we provide a tunable GETPASS_NEED_TTY to
  *	  disable this.
  *	- Some implementations say that on interrupt the program shall
  *	  receive an interrupt signal before the function returns. We
  *	  send all the tty signals before we return, but we don't expect
  *	  suspend to do something useful unless the caller calls us again.
+ *	  We also provide a tunable to disable signal delivery
+ *	  GETPASS_NO_SIGNAL.
+ *	- GETPASS_NO_BEEP disables beeping.
+ *	- GETPASS_ECHO will echo the password (as pam likes it)
  */
 char *
-getpass_r(const char *prompt, char *ret, size_t len)
+/*ARGSUSED*/
+getpassfd(const char *prompt, char *buf, size_t len, int fd[], int flags)
 {
 	struct termios gt;
 	char c;
-	int infd, outfd, sig;
-	bool lnext, havetty;
+	int sig;
+	bool lnext, 

CVS commit: src/include

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 22:08:02 UTC 2012

Modified Files:
src/include: unistd.h

Log Message:
add getpassfd


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/include/unistd.h

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

Modified files:

Index: src/include/unistd.h
diff -u src/include/unistd.h:1.129 src/include/unistd.h:1.130
--- src/include/unistd.h:1.129	Thu Apr 12 15:36:34 2012
+++ src/include/unistd.h	Thu Apr 12 18:08:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.129 2012/04/12 19:36:34 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.130 2012/04/12 22:08:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -327,6 +327,13 @@ int	 getdomainname(char *, size_t);
 int	 getgrouplist(const char *, gid_t, gid_t *, int *);
 int	 getgroupmembership(const char *, gid_t, gid_t *, int, int *);
 mode_t	 getmode(const void *, mode_t);
+char	*getpassfd(const char *, char *, size_t, int[], int);
+#define	GETPASS_NEED_TTY	0x01	/* Fail if we cannot set tty */
+#define	GETPASS_FAIL_EOF	0x02	/* Fail on EOF */
+#define	GETPASS_BUF_LIMIT	0x04	/* beep on buffer limit */
+#define	GETPASS_NO_SIGNAL	0x08	/* don't make ttychars send signals */
+#define	GETPASS_NO_BEEP		0x10	/* don't beep */
+#define	GETPASS_ECHO		0x20	/* don't turn echo off */
 char	*getpass_r(const char *, char *, size_t);
 int	 getpeereid(int, uid_t *, gid_t *);
 int	 getsubopt(char **, char * const *, char **);



CVS commit: src/lib/libc/gen

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 22:08:32 UTC 2012

Modified Files:
src/lib/libc/gen: Makefile.inc

Log Message:
man page for getpassfd


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/lib/libc/gen/Makefile.inc

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

Modified files:

Index: src/lib/libc/gen/Makefile.inc
diff -u src/lib/libc/gen/Makefile.inc:1.183 src/lib/libc/gen/Makefile.inc:1.184
--- src/lib/libc/gen/Makefile.inc:1.183	Thu Apr 12 15:36:19 2012
+++ src/lib/libc/gen/Makefile.inc	Thu Apr 12 18:08:32 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.183 2012/04/12 19:36:19 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.184 2012/04/12 22:08:32 christos Exp $
 #	from: @(#)Makefile.inc	8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -118,6 +118,7 @@ MLINKS+=cgetcap.3 cgetclose.3 cgetcap.3 
 	cgetcap.3 cgetustr.3
 MLINKS+=getcwd.3 getwd.3
 MLINKS+=getpass.3 getpass_r.3
+MLINKS+=getpass.3 getpassfd.3
 MLINKS+=getdiskbyname.3 setdisktab.3
 MLINKS+=getdomainname.3 setdomainname.3
 MLINKS+=getfsent.3 endfsent.3 getfsent.3 getfsfile.3 getfsent.3 getfsspec.3 \



CVS commit: src/lib/libc/include

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 22:08:46 UTC 2012

Modified Files:
src/lib/libc/include: namespace.h

Log Message:
name protection for getpassfd


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/lib/libc/include/namespace.h

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

Modified files:

Index: src/lib/libc/include/namespace.h
diff -u src/lib/libc/include/namespace.h:1.152 src/lib/libc/include/namespace.h:1.153
--- src/lib/libc/include/namespace.h:1.152	Thu Apr 12 15:36:19 2012
+++ src/lib/libc/include/namespace.h	Thu Apr 12 18:08:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.152 2012/04/12 19:36:19 christos Exp $	*/
+/*	$NetBSD: namespace.h,v 1.153 2012/04/12 22:08:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -326,6 +326,7 @@
 #define getopt_long		_getopt_long
 #define getpagesize		_getpagesize
 #define getpass			_getpass
+#define getpassfd		_getpassfd
 #define getpass_r		_getpass_r
 #define getprogname		_getprogname
 #define getprotobyname		_getprotobyname



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

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 22:10:06 UTC 2012

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

Log Message:
add getpassfd


To generate a diff of this commit:
cvs rdiff -u -r1.1752 -r1.1753 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1752 src/distrib/sets/lists/comp/mi:1.1753
--- src/distrib/sets/lists/comp/mi:1.1752	Thu Apr 12 15:38:30 2012
+++ src/distrib/sets/lists/comp/mi	Thu Apr 12 18:10:05 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1752 2012/04/12 19:38:30 christos Exp $
+#	$NetBSD: mi,v 1.1753 2012/04/12 22:10:05 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -6738,6 +6738,7 @@
 ./usr/share/man/cat3/getpary.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getparyx.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getpass.0			comp-c-catman		.cat
+./usr/share/man/cat3/getpassfd.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getpass_r.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getpeereid.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getprogname.0		comp-c-catman		.cat
@@ -13046,6 +13047,7 @@
 ./usr/share/man/html3/getpary.html		comp-c-htmlman		html
 ./usr/share/man/html3/getparyx.html		comp-c-htmlman		html
 ./usr/share/man/html3/getpass.html		comp-c-htmlman		html
+./usr/share/man/html3/getpassfd.html		comp-c-htmlman		html
 ./usr/share/man/html3/getpass_r.html		comp-c-htmlman		html
 ./usr/share/man/html3/getpeereid.html		comp-c-htmlman		html
 ./usr/share/man/html3/getprogname.html		comp-c-htmlman		html
@@ -19270,6 +19272,7 @@
 ./usr/share/man/man3/getpary.3			comp-c-man		.man
 ./usr/share/man/man3/getparyx.3			comp-c-man		.man
 ./usr/share/man/man3/getpass.3			comp-c-man		.man
+./usr/share/man/man3/getpassfd.3		comp-c-man		.man
 ./usr/share/man/man3/getpass_r.3		comp-c-man		.man
 ./usr/share/man/man3/getpeereid.3		comp-c-man		.man
 ./usr/share/man/man3/getprogname.3		comp-c-man		.man



CVS commit: src/lib/libc/gen

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 23:16:38 UTC 2012

Modified Files:
src/lib/libc/gen: getpass.3 getpass.c

Log Message:
add GETPASS_ECHO_STAR


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/getpass.3
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/gen/getpass.c

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

Modified files:

Index: src/lib/libc/gen/getpass.3
diff -u src/lib/libc/gen/getpass.3:1.16 src/lib/libc/gen/getpass.3:1.17
--- src/lib/libc/gen/getpass.3:1.16	Thu Apr 12 18:07:44 2012
+++ src/lib/libc/gen/getpass.3	Thu Apr 12 19:16:38 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: getpass.3,v 1.16 2012/04/12 22:07:44 christos Exp $
+.\	$NetBSD: getpass.3,v 1.17 2012/04/12 23:16:38 christos Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -98,6 +98,10 @@ Don't make ttychars send signals.
 .It Dv GETPASS_NO_BEEP
 Don't beep if we erase past the beginning of the buffer or we try to enter past
 the end.
+.It Dv GETPASS_ECHO_STAR
+Echo a
+.Sq * 
+for each character entered.
 .It Dv GETPASS_ECHO
 Echo characters as they are typed.
 .El

Index: src/lib/libc/gen/getpass.c
diff -u src/lib/libc/gen/getpass.c:1.19 src/lib/libc/gen/getpass.c:1.20
--- src/lib/libc/gen/getpass.c:1.19	Thu Apr 12 18:07:44 2012
+++ src/lib/libc/gen/getpass.c	Thu Apr 12 19:16:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getpass.c,v 1.19 2012/04/12 22:07:44 christos Exp $	*/
+/*	$NetBSD: getpass.c,v 1.20 2012/04/12 23:16:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getpass.c,v 1.19 2012/04/12 22:07:44 christos Exp $);
+__RCSID($NetBSD: getpass.c,v 1.20 2012/04/12 23:16:38 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -72,6 +72,7 @@ __weak_alias(getpass,_getpass)
  *	  We also provide a tunable to disable signal delivery
  *	  GETPASS_NO_SIGNAL.
  *	- GETPASS_NO_BEEP disables beeping.
+ *	- GETPASS_ECHO_STAR will echo '*' for each character of the password
  *	- GETPASS_ECHO will echo the password (as pam likes it)
  */
 char *
@@ -151,7 +152,7 @@ getpassfd(const char *prompt, char *buf,
 
 		/* Line or word kill, treat as reset */
 		if (c == C(VKILL, CTRL('u')) || c == C(VWERASE, CTRL('w'))) {
-			if (flags  GETPASS_ECHO) {
+			if (flags  (GETPASS_ECHO | GETPASS_ECHO_STAR)) {
 while (l--)
 	erase();
 			}
@@ -165,7 +166,7 @@ getpassfd(const char *prompt, char *buf,
 beep();
 			else {
 l--;
-if (flags  GETPASS_ECHO)
+if (flags  (GETPASS_ECHO | GETPASS_ECHO_STAR))
 	erase();
 			}
 			continue;
@@ -219,8 +220,12 @@ add:
 			}
 		}
 		buf[l++] = c;
-		if (c  (flags  GETPASS_ECHO))
-		(void)write(fd[1], c, 1);
+		if (c) {
+			if (flags  GETPASS_ECHO_STAR)
+(void)write(fd[1], *, 1);
+			else if (flags  GETPASS_ECHO)
+(void)write(fd[1], c, 1);
+		}
 	}
 
 	if (havetty)
@@ -304,7 +309,8 @@ main(int argc, char *argv[])
 {
 	char buf[28];
 	int fd[3] = { 0, 1, 2 };
-	printf([%s]\n, getpassfd(foo, buf, sizeof(buf), fd, GETPASS_ECHO));
+	printf([%s]\n, getpassfd(foo, buf, sizeof(buf), fd,
+	GETPASS_ECHO_STAR));
 	return 0;
 }
 #endif



CVS commit: src/include

2012-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 12 23:16:55 UTC 2012

Modified Files:
src/include: unistd.h

Log Message:
add GETPASS_ECHO_STAR


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/include/unistd.h

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

Modified files:

Index: src/include/unistd.h
diff -u src/include/unistd.h:1.130 src/include/unistd.h:1.131
--- src/include/unistd.h:1.130	Thu Apr 12 18:08:02 2012
+++ src/include/unistd.h	Thu Apr 12 19:16:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.130 2012/04/12 22:08:02 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.131 2012/04/12 23:16:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -333,7 +333,8 @@ char	*getpassfd(const char *, char *, si
 #define	GETPASS_BUF_LIMIT	0x04	/* beep on buffer limit */
 #define	GETPASS_NO_SIGNAL	0x08	/* don't make ttychars send signals */
 #define	GETPASS_NO_BEEP		0x10	/* don't beep */
-#define	GETPASS_ECHO		0x20	/* don't turn echo off */
+#define	GETPASS_ECHO		0x20	/* echo characters as they are typed */
+#define	GETPASS_ECHO_STAR	0x40	/* ech '*' for each character */
 char	*getpass_r(const char *, char *, size_t);
 int	 getpeereid(int, uid_t *, gid_t *);
 int	 getsubopt(char **, char * const *, char **);



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

2012-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Apr 13 00:34:54 UTC 2012

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pdaemon.c

Log Message:
Make sure color passed to uvm_reclaimable is valid.


To generate a diff of this commit:
cvs rdiff -u -r1.93.4.2.4.10 -r1.93.4.2.4.11 src/sys/uvm/uvm_pdaemon.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/uvm/uvm_pdaemon.c
diff -u src/sys/uvm/uvm_pdaemon.c:1.93.4.2.4.10 src/sys/uvm/uvm_pdaemon.c:1.93.4.2.4.11
--- src/sys/uvm/uvm_pdaemon.c:1.93.4.2.4.10	Thu Apr 12 19:41:57 2012
+++ src/sys/uvm/uvm_pdaemon.c	Fri Apr 13 00:34:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.10 2012/04/12 19:41:57 matt Exp $	*/
+/*	$NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.11 2012/04/13 00:34:54 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.10 2012/04/12 19:41:57 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_pdaemon.c,v 1.93.4.2.4.11 2012/04/13 00:34:54 matt Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -1236,6 +1236,8 @@ uvm_reclaimable(u_int color, bool kmem_p
 	u_int filepages, npages;
 	u_int active, inactive;
 
+	KASSERT(color  uvmexp.ncolors);
+
 	/*
 	 * if swap is not full, no problem.
 	 */



CVS commit: src/share/man/man4/man4.amiga

2012-04-12 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Fri Apr 13 01:12:33 UTC 2012

Modified Files:
src/share/man/man4/man4.amiga: efa.4

Log Message:
Mention that FastATA 1200 Mk-IV CF/SATA edition is also supported.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.amiga/efa.4

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

Modified files:

Index: src/share/man/man4/man4.amiga/efa.4
diff -u src/share/man/man4/man4.amiga/efa.4:1.4 src/share/man/man4/man4.amiga/efa.4:1.5
--- src/share/man/man4/man4.amiga/efa.4:1.4	Sun Oct 30 14:31:05 2011
+++ src/share/man/man4/man4.amiga/efa.4	Fri Apr 13 01:12:32 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: efa.4,v 1.4 2011/10/30 14:31:05 wiz Exp $
+.\ $NetBSD: efa.4,v 1.5 2012/04/13 01:12:32 rkujawa Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -60,6 +60,7 @@ driver supports the following hardware:
 .Bl -tag -width ELBOX FastATA 1200 Mk-IV -offset indent
 .It Em ELBOX FastATA 1200 Mk-III
 .It Em ELBOX FastATA 1200 Mk-IV
+.It Em ELBOX FastATA 1200 Mk-IV CF/SATA
 .El
 .Sh SEE ALSO
 .Xr ata 4 ,