CVS commit: src/sys/arch/i386/i386

2010-02-14 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Sun Feb 14 11:09:54 UTC 2010

Modified Files:
src/sys/arch/i386/i386: ibcs2_machdep.c svr4_machdep.c

Log Message:
fix confused CS selector, fixes the panic reported by Mark Davis
per PR port-i386/42787 (the panic happens due to a GPF when a
privileged descriptor is tried to be loaded with the UPL bit set)
The original bug is very old (pre-2.0, i386/svr4_machdep.c rev. 1.69),
but it was relatively harmless until the order of GDT entries was
shuffled (pre-5.0, i386/segments.h rev. 1.42). Before, it caused
a userlevel data selector to be used for CS which broke the emulation
(likely the reason of PR port-i386/32424). The shuffle made that
a privileged selector was used, causing the GPF.
(recent -current doesn't panic on that GPF which seems to be a
side effect of another change)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/i386/i386/ibcs2_machdep.c
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/i386/i386/svr4_machdep.c

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

Modified files:

Index: src/sys/arch/i386/i386/ibcs2_machdep.c
diff -u src/sys/arch/i386/i386/ibcs2_machdep.c:1.39 src/sys/arch/i386/i386/ibcs2_machdep.c:1.40
--- src/sys/arch/i386/i386/ibcs2_machdep.c:1.39	Thu Dec 10 14:13:50 2009
+++ src/sys/arch/i386/i386/ibcs2_machdep.c	Sun Feb 14 11:09:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_machdep.c,v 1.39 2009/12/10 14:13:50 matt Exp $	*/
+/*	$NetBSD: ibcs2_machdep.c,v 1.40 2010/02/14 11:09:54 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ibcs2_machdep.c,v 1.39 2009/12/10 14:13:50 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ibcs2_machdep.c,v 1.40 2010/02/14 11:09:54 drochner Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_vm86.h
@@ -74,7 +74,7 @@
 		pcb-pcb_savefpu.sv_87.sv_env.en_cw = __iBCS2_NPXCW__;
 	tf = l-l_md.md_regs;
 	tf-tf_eax = 0x200;		/* XXX base of heap */
-	tf-tf_cs = GSEL(LUCODEBIG_SEL, SEL_UPL);
+	tf-tf_cs = GSEL(GUCODEBIG_SEL, SEL_UPL);
 }
 
 /*

Index: src/sys/arch/i386/i386/svr4_machdep.c
diff -u src/sys/arch/i386/i386/svr4_machdep.c:1.95 src/sys/arch/i386/i386/svr4_machdep.c:1.96
--- src/sys/arch/i386/i386/svr4_machdep.c:1.95	Thu Dec 10 14:13:50 2009
+++ src/sys/arch/i386/i386/svr4_machdep.c	Sun Feb 14 11:09:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_machdep.c,v 1.95 2009/12/10 14:13:50 matt Exp $	 */
+/*	$NetBSD: svr4_machdep.c,v 1.96 2010/02/14 11:09:54 drochner Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: svr4_machdep.c,v 1.95 2009/12/10 14:13:50 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: svr4_machdep.c,v 1.96 2010/02/14 11:09:54 drochner Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_vm86.h
@@ -119,7 +119,7 @@
 		pcb-pcb_savefpu.sv_xmm.sv_env.en_cw = __SVR4_NPXCW__;
 	else
 		pcb-pcb_savefpu.sv_87.sv_env.en_cw = __SVR4_NPXCW__;
-	tf-tf_cs = GSEL(LUCODEBIG_SEL, SEL_UPL);
+	tf-tf_cs = GSEL(GUCODEBIG_SEL, SEL_UPL);
 }
 
 void *



CVS commit: src/sys/compat/svr4

2010-02-14 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Sun Feb 14 11:54:03 UTC 2010

Modified Files:
src/sys/compat/svr4: files.svr4

Log Message:
add missing glue file, otherwise the emulation will not work if
compiled into the kernel (and the module loader will load another
instance, causing symbol duplication)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/compat/svr4/files.svr4

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/svr4/files.svr4
diff -u src/sys/compat/svr4/files.svr4:1.16 src/sys/compat/svr4/files.svr4:1.17
--- src/sys/compat/svr4/files.svr4:1.16	Sun Apr  2 06:34:18 2006
+++ src/sys/compat/svr4/files.svr4	Sun Feb 14 11:54:03 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.svr4,v 1.16 2006/04/02 06:34:18 macallan Exp $
+#	$NetBSD: files.svr4,v 1.17 2010/02/14 11:54:03 drochner Exp $
 #
 # Config file description for machine-independent SVR4 compat code.
 # Included by ports that need it.
@@ -16,6 +16,7 @@
 file	compat/svr4/svr4_ipc.c		compat_svr4
 file	compat/svr4/svr4_lwp.c		compat_svr4
 file	compat/svr4/svr4_misc.c		compat_svr4
+file	compat/svr4/svr4_mod.c		compat_svr4
 file	compat/svr4/svr4_net.c		compat_svr4
 file	compat/svr4/svr4_resource.c	compat_svr4
 file	compat/svr4/svr4_schedctl.c	compat_svr4



CVS commit: [netbsd-5] src/sys

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:27:45 UTC 2010

Modified Files:
src/sys/kern [netbsd-5]: vfs_syscalls.c
src/sys/nfs [netbsd-5]: nfs_serv.c
src/sys/sys [netbsd-5]: namei.src

Log Message:
Pull up following revision(s) (requested by pooka in ticket #1289):
sys/sys/namei.src: revision 1.14
sys/kern/vfs_syscalls.c: revision 1.401
sys/nfs/nfs_serv.c: revision 1.149
sys/sys/namei.h: regen
Define namei flag INRENAME and set it if a lookup operation is part
of rename.  This helps with building better asserts for rename in
the DELETE lookup ... the RENAME lookup is quite obviously a part
of rename.


To generate a diff of this commit:
cvs rdiff -u -r1.376.4.4 -r1.376.4.5 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.138.16.1 -r1.138.16.2 src/sys/nfs/nfs_serv.c
cvs rdiff -u -r1.8.14.1 -r1.8.14.2 src/sys/sys/namei.src

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_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.376.4.4 src/sys/kern/vfs_syscalls.c:1.376.4.5
--- src/sys/kern/vfs_syscalls.c:1.376.4.4	Mon Dec 21 09:19:16 2009
+++ src/sys/kern/vfs_syscalls.c	Sun Feb 14 13:27:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.376.4.4 2009/12/21 09:19:16 sborrill Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.376.4.5 2010/02/14 13:27:45 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.376.4.4 2009/12/21 09:19:16 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.376.4.5 2010/02/14 13:27:45 bouyer Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_compat_43.h
@@ -3317,7 +3317,7 @@
 	uint32_t saveflag;
 	int error;
 
-	NDINIT(fromnd, DELETE, LOCKPARENT | SAVESTART | TRYEMULROOT,
+	NDINIT(fromnd, DELETE, LOCKPARENT | SAVESTART | TRYEMULROOT | INRENAME,
 	seg, from);
 	if ((error = namei(fromnd)) != 0)
 		return (error);
@@ -3382,7 +3382,7 @@
 
 	NDINIT(tond, RENAME,
 	LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | TRYEMULROOT
-	  | (fvp-v_type == VDIR ? CREATEDIR : 0),
+	  | INRENAME | (fvp-v_type == VDIR ? CREATEDIR : 0),
 	seg, to);
 	if ((error = namei(tond)) != 0) {
 		VFS_RENAMELOCK_EXIT(fs);

Index: src/sys/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.138.16.1 src/sys/nfs/nfs_serv.c:1.138.16.2
--- src/sys/nfs/nfs_serv.c:1.138.16.1	Mon Apr 13 21:06:50 2009
+++ src/sys/nfs/nfs_serv.c	Sun Feb 14 13:27:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.138.16.1 2009/04/13 21:06:50 snj Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.138.16.2 2010/02/14 13:27:45 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.138.16.1 2009/04/13 21:06:50 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.138.16.2 2010/02/14 13:27:45 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1859,7 +1859,7 @@
 	saved_uid = kauth_cred_geteuid(cred);
 	fromnd.ni_cnd.cn_cred = cred;
 	fromnd.ni_cnd.cn_nameiop = DELETE;
-	fromnd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART;
+	fromnd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART | INRENAME;
 	error = nfs_namei(fromnd, fnsfh, len, slp, nam, md,
 		dpos, fdirp, lwp, (nfsd-nd_flag  ND_KERBAUTH), false);
 	if (fdirp  v3) {
@@ -1930,7 +1930,8 @@
 	kauth_cred_seteuid(cred, saved_uid);
 	tond.ni_cnd.cn_cred = cred;
 	tond.ni_cnd.cn_nameiop = RENAME;
-	tond.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART;
+	tond.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | NOCACHE |
+	SAVESTART | INRENAME;
 	error = nfs_namei(tond, tnsfh, len2, slp, nam, md,
 		dpos, tdirp, lwp, (nfsd-nd_flag  ND_KERBAUTH), false);
 	if (tdirp  v3) {

Index: src/sys/sys/namei.src
diff -u src/sys/sys/namei.src:1.8.14.1 src/sys/sys/namei.src:1.8.14.2
--- src/sys/sys/namei.src:1.8.14.1	Wed Dec 10 21:26:56 2008
+++ src/sys/sys/namei.src	Sun Feb 14 13:27:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.src,v 1.8.14.1 2008/12/10 21:26:56 snj Exp $	*/
+/*	$NetBSD: namei.src,v 1.8.14.2 2010/02/14 13:27:45 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -136,7 +136,8 @@
 NAMEIFL	DOWHITEOUT	0x004	/* do whiteouts */
 NAMEIFL	REQUIREDIR	0x008	/* must be a directory */
 NAMEIFL	CREATEDIR	0x020	/* trailing slashes are ok */
-NAMEIFL	PARAMASK	0x02fff00	/* mask of parameter descriptors */
+NAMEIFL	INRENAME	0x040	/* operation is a part of ``rename'' */
+NAMEIFL	PARAMASK	0x06fff00	/* mask of parameter descriptors */
 
 /*
  * Initialization of an nameidata structure.



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

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:30:04 UTC 2010

Modified Files:
src/sys/sys [netbsd-5]: namei.h

Log Message:
Regen for ticket 1289


To generate a diff of this commit:
cvs rdiff -u -r1.60.14.2 -r1.60.14.3 src/sys/sys/namei.h

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

Modified files:

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.60.14.2 src/sys/sys/namei.h:1.60.14.3
--- src/sys/sys/namei.h:1.60.14.2	Wed Dec 10 21:28:50 2008
+++ src/sys/sys/namei.h	Sun Feb 14 13:30:04 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: namei.h,v 1.60.14.2 2008/12/10 21:28:50 snj Exp $	*/
+/*	$NetBSD: namei.h,v 1.60.14.3 2010/02/14 13:30:04 bouyer Exp $	*/
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei)
  *   by:   NetBSD: gennameih.awk,v 1.2 2008/04/30 13:11:00 martin Exp 
- *   from: NetBSD: namei.src,v 1.8.14.1 2008/12/10 21:26:56 snj Exp 
+ *   from: NetBSD: namei.src,v 1.8.14.2 2010/02/14 13:27:45 bouyer Exp 
  */
 
 /*
@@ -143,7 +143,8 @@
 #define	DOWHITEOUT	0x004	/* do whiteouts */
 #define	REQUIREDIR	0x008	/* must be a directory */
 #define	CREATEDIR	0x020	/* trailing slashes are ok */
-#define	PARAMASK	0x02fff00	/* mask of parameter descriptors */
+#define	INRENAME	0x040	/* operation is a part of ``rename'' */
+#define	PARAMASK	0x06fff00	/* mask of parameter descriptors */
 
 /*
  * Initialization of an nameidata structure.
@@ -271,6 +272,7 @@
 #define NAMEI_DOWHITEOUT	0x004
 #define NAMEI_REQUIREDIR	0x008
 #define NAMEI_CREATEDIR	0x020
-#define NAMEI_PARAMASK	0x02fff00
+#define NAMEI_INRENAME	0x040
+#define NAMEI_PARAMASK	0x06fff00
 
 #endif /* !_SYS_NAMEI_H_ */



CVS commit: [netbsd-5] src/sys

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:35:44 UTC 2010

Modified Files:
src/sys/arch/x86/x86 [netbsd-5]: pmap.c x86_autoconf.c
src/sys/dev/pci [netbsd-5]: agp_via.c
src/sys/kern [netbsd-5]: cnmagic.c init_main.c kern_ksyms.c
src/sys/netipsec [netbsd-5]: ipsec.c key.c
src/sys/netkey [netbsd-5]: key.c

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1290):
sys/kern/kern_ksyms.c: revision 1.53
sys/dev/pci/agp_via.c: revision 1.18
sys/netipsec/key.c: revision 1.63
sys/arch/x86/x86/x86_autoconf.c: revision 1.49
sys/kern/init_main.c: revision 1.415
sys/kern/cnmagic.c: revision 1.11
sys/netipsec/ipsec.c: revision 1.47
sys/arch/x86/x86/pmap.c: revision 1.100
sys/netkey/key.c: revision 1.176
Replace more printfs with aprint_normal / aprint_verbose
Makes boot -z go mostly silent for me.


To generate a diff of this commit:
cvs rdiff -u -r1.74.4.1 -r1.74.4.2 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.35 -r1.35.4.1 src/sys/arch/x86/x86/x86_autoconf.c
cvs rdiff -u -r1.17 -r1.17.8.1 src/sys/dev/pci/agp_via.c
cvs rdiff -u -r1.9 -r1.9.64.1 src/sys/kern/cnmagic.c
cvs rdiff -u -r1.371.2.3 -r1.371.2.4 src/sys/kern/init_main.c
cvs rdiff -u -r1.41.4.1 -r1.41.4.2 src/sys/kern/kern_ksyms.c
cvs rdiff -u -r1.39.6.1 -r1.39.6.2 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.57 -r1.57.4.1 src/sys/netipsec/key.c
cvs rdiff -u -r1.163 -r1.163.4.1 src/sys/netkey/key.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/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.74.4.1 src/sys/arch/x86/x86/pmap.c:1.74.4.2
--- src/sys/arch/x86/x86/pmap.c:1.74.4.1	Sat Apr  4 17:39:09 2009
+++ src/sys/arch/x86/x86/pmap.c	Sun Feb 14 13:35:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.74.4.1 2009/04/04 17:39:09 snj Exp $	*/
+/*	$NetBSD: pmap.c,v 1.74.4.2 2010/02/14 13:35:44 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -154,7 +154,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.74.4.1 2009/04/04 17:39:09 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.74.4.2 2010/02/14 13:35:44 bouyer Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -1323,7 +1323,7 @@
 			tlbflush();
 		}
 #if defined(DEBUG)
-		printf(kernel text is mapped with 
+		aprint_normal(kernel text is mapped with 
 		%lu large pages and %lu normal pages\n,
 		(unsigned long)howmany(kva - KERNBASE, NBPD_L2),
 		(unsigned long)howmany((vaddr_t)__data_start - kva,

Index: src/sys/arch/x86/x86/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.35 src/sys/arch/x86/x86/x86_autoconf.c:1.35.4.1
--- src/sys/arch/x86/x86/x86_autoconf.c:1.35	Tue Oct 14 15:48:44 2008
+++ src/sys/arch/x86/x86/x86_autoconf.c	Sun Feb 14 13:35:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.35 2008/10/14 15:48:44 tsutsui Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.35.4.1 2010/02/14 13:35:44 bouyer 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.35 2008/10/14 15:48:44 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.35.4.1 2010/02/14 13:35:44 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -473,11 +473,11 @@
 
 	if (booted_wedge) {
 		KASSERT(booted_device != NULL);
-		printf(boot device: %s (%s)\n,
+		aprint_normal(boot device: %s (%s)\n,
 		device_xname(booted_wedge), device_xname(booted_device));
 		setroot(booted_wedge, 0);
 	} else {
-		printf(boot device: %s\n,
+		aprint_normal(boot device: %s\n,
 		booted_device ? device_xname(booted_device) : unknown);
 		setroot(booted_device, booted_partition);
 	}

Index: src/sys/dev/pci/agp_via.c
diff -u src/sys/dev/pci/agp_via.c:1.17 src/sys/dev/pci/agp_via.c:1.17.8.1
--- src/sys/dev/pci/agp_via.c:1.17	Mon Jun  9 06:49:54 2008
+++ src/sys/dev/pci/agp_via.c	Sun Feb 14 13:35:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp_via.c,v 1.17 2008/06/09 06:49:54 freza Exp $	*/
+/*	$NetBSD: agp_via.c,v 1.17.8.1 2010/02/14 13:35:44 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: agp_via.c,v 1.17 2008/06/09 06:49:54 freza Exp $);
+__KERNEL_RCSID(0, $NetBSD: agp_via.c,v 1.17.8.1 2010/02/14 13:35:44 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -107,14 +107,14 @@
 		agpsel = pci_conf_read(pa-pa_pc, pa-pa_tag, AGP_VIA_AGPSEL);
 		if ((agpsel  (1  9)) == 0) {
 			asc-regs = via_v3_regs;
-			printf( (v3));
+			aprint_normal( (v3));
 		} else {
 			asc-regs = via_v2_regs;
-			printf( (v2 compat mode));
+			aprint_normal( (v2 compat mode));
 		}
 	} else {
 		asc-regs = via_v2_regs;
-		printf( (v2));
+		aprint_normal( (v2));
 	}
 
 	if (agp_map_aperture(pa, sc, AGP_APBASE) != 0) {

Index: 

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

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:36:57 UTC 2010

Modified Files:
src/sys/opencrypto [netbsd-5]: cryptodev.c

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1291):
sys/opencrypto/cryptodev.c: revision 1.52
Add missing break for CRYPTO_CAST_CBC, and some assorted comment fixes.
openssl(1) checks for CAST (and others) on ~every startup.


To generate a diff of this commit:
cvs rdiff -u -r1.44.8.3 -r1.44.8.4 src/sys/opencrypto/cryptodev.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/opencrypto/cryptodev.c
diff -u src/sys/opencrypto/cryptodev.c:1.44.8.3 src/sys/opencrypto/cryptodev.c:1.44.8.4
--- src/sys/opencrypto/cryptodev.c:1.44.8.3	Sun May  3 17:24:45 2009
+++ src/sys/opencrypto/cryptodev.c	Sun Feb 14 13:36:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.c,v 1.44.8.3 2009/05/03 17:24:45 snj Exp $ */
+/*	$NetBSD: cryptodev.c,v 1.44.8.4 2010/02/14 13:36:57 bouyer Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $	*/
 /*	$OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $	*/
 
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.44.8.3 2009/05/03 17:24:45 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.44.8.4 2010/02/14 13:36:57 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -572,7 +572,6 @@
 	 * XXX disabled on NetBSD since 1.6O due to a race condition.
 	 * XXX But crypto_dispatch went to splcrypto() itself!  (And
 	 * XXX now takes the crypto_mtx mutex itself).  We do, however,
-	 *
 	 * XXX need to hold the mutex across the call to cv_wait().
 	 * XXX (should we arrange for crypto_dispatch to return to
 	 * XXX  us with it held?  it seems quite ugly to do so.)
@@ -586,7 +585,7 @@
 	/* 
 	 * If the request was going to be completed by the
 	 * ioctl thread then it would have been done by now.
-	 * Remove the F_USER flag it so crypto_done() is not confused
+	 * Remove the F_USER flag so crypto_done() is not confused
 	 * if the crypto device calls it after this point.
 	 */
 	crp-crp_flags = ~(CRYPTO_F_USER);
@@ -1470,6 +1469,7 @@
 		break;
 	case CRYPTO_CAST_CBC:
 		txform = enc_xform_cast5;
+		break;
 	case CRYPTO_SKIPJACK_CBC:
 		txform = enc_xform_skipjack;
 		break;



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

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:37:42 UTC 2010

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

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1292):
sys/kern/kern_malloc.c: revision 1.128
Let kernel build when MALLOCLOG is defined but DIAGNOSTIC is not.
Else, hitmlog() is defined but not used, which triggers a warning.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.121.4.1 src/sys/kern/kern_malloc.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/kern_malloc.c
diff -u src/sys/kern/kern_malloc.c:1.121 src/sys/kern/kern_malloc.c:1.121.4.1
--- src/sys/kern/kern_malloc.c:1.121	Sun Oct 26 12:23:28 2008
+++ src/sys/kern/kern_malloc.c	Sun Feb 14 13:37:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_malloc.c,v 1.121 2008/10/26 12:23:28 blymn Exp $	*/
+/*	$NetBSD: kern_malloc.c,v 1.121.4.1 2010/02/14 13:37:42 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_malloc.c,v 1.121 2008/10/26 12:23:28 blymn Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_malloc.c,v 1.121.4.1 2010/02/14 13:37:42 bouyer Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -215,6 +215,7 @@
 		malloclogptr = 0;
 }
 
+#ifdef DIAGNOSTIC
 static void
 hitmlog(void *a)
 {
@@ -271,6 +272,7 @@
 
 #undef PRT
 }
+#endif /* DIAGNOSTIC */
 #endif /* MALLOCLOG */
 
 #ifdef DIAGNOSTIC



CVS commit: [netbsd-5] src/share/man/man9

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:38:28 UTC 2010

Modified Files:
src/share/man/man9 [netbsd-5]: opencrypto.9

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1293):
share/man/man9/opencrypto.9: revision 1.9
Document sysctls


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.18.1 src/share/man/man9/opencrypto.9

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/man9/opencrypto.9
diff -u src/share/man/man9/opencrypto.9:1.5 src/share/man/man9/opencrypto.9:1.5.18.1
--- src/share/man/man9/opencrypto.9:1.5	Sat Jul 14 10:52:49 2007
+++ src/share/man/man9/opencrypto.9	Sun Feb 14 13:38:28 2010
@@ -1,5 +1,5 @@
 .\	$OpenBSD: crypto.9,v 1.25 2003/07/11 13:47:41 jmc Exp $
-.\	$NetBSD: opencrypto.9,v 1.5 2007/07/14 10:52:49 ad Exp $
+.\	$NetBSD: opencrypto.9,v 1.5.18.1 2010/02/14 13:38:28 bouyer Exp $
 .\
 .\ The author of this man page is Angelos D. Keromytis (ange...@cis.upenn.edu)
 .\
@@ -16,7 +16,7 @@
 .\ MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
 .\ PURPOSE.
 .\
-.Dd December 20, 2003
+.Dd January 1, 2010
 .Dt OPENCRYPTO 9
 .Os
 .Sh NAME
@@ -324,7 +324,8 @@
 For MAC algorithms, this is where the result of the keyed hash will be
 inserted.
 .It Fa crd_flags
-The following flags are defined:
+For adjusting general operation from userland,
+the following flags are defined:
 .Bl -tag -width CRD_F_IV_EXPLICIT
 .It Dv CRD_F_ENCRYPT
 For encryption algorithms, this bit is set when encryption is required
@@ -429,6 +430,28 @@
 .It Fa krp_callback
 Callback called on completion of a keying operation.
 .El
+.Pp
+The following sysctl entries exist to adjust 
+the behaviour of the system from userland:
+.Bl -tag -width kern.cryptodevallowsoft
+.It kern.usercrypto
+Allow (1) or forbid (0) userland acces to 
+.Pa /dev/crypto .
+.It kern.userasymcrypto
+Allow (1) or forbid (0) userland acces to 
+do asymmetric crypto requests.
+.It kern.cryptodevallowsoft
+Enable/disable access to hardware versus software operations:
+.Bl -tag -width xxx
+.It  0
+Force userlevel requests to use software operations, always.
+.It = 0
+Use hardware if present, grant userlevel requests for non-accelerated
+operations (handling the latter in software).
+.It  0
+Allow user requests only for operations which are hardware-accelerated.
+.El
+.El
 .Sh DRIVER-SIDE API
 The
 .Fn crypto_get_driverid ,
@@ -559,9 +582,11 @@
 .Fa crp_etype
 field.
 .Sh FILES
-.Bl -tag -width sys/crypto/crypto.c
-.It Pa sys/crypto/crypto.c
+.Bl -tag -width sys/opencrypto/crypto.c
+.It Pa sys/opencrypto/crypto.c
 most of the framework code
+.It Pa sys/crypto
+crypto algorithm implementations
 .El
 .Sh SEE ALSO
 .Xr condvar 9 ,



CVS commit: [netbsd-5] src

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:41:51 UTC 2010

Modified Files:
src/etc/etc.sparc64 [netbsd-5]: MAKEDEV.conf
src/share/man/man4/man4.sparc64 [netbsd-5]: sab.4
src/sys/arch/sparc64/dev [netbsd-5]: sab.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #1297):
etc/etc.sparc64/MAKEDEV.conf: revision 1.14
sys/arch/sparc64/dev/sab.c: revision 1.43, 1.44
share/man/man4/man4.sparc64/sab.4: revision 1.4
Allow the RSC to be the console on an E250, by checking for RSC-specific
properties, and by not changing the port baud rate.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.2.1 src/etc/etc.sparc64/MAKEDEV.conf
cvs rdiff -u -r1.3 -r1.3.4.1 src/share/man/man4/man4.sparc64/sab.4
cvs rdiff -u -r1.42 -r1.42.6.1 src/sys/arch/sparc64/dev/sab.c

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

Modified files:

Index: src/etc/etc.sparc64/MAKEDEV.conf
diff -u src/etc/etc.sparc64/MAKEDEV.conf:1.13 src/etc/etc.sparc64/MAKEDEV.conf:1.13.2.1
--- src/etc/etc.sparc64/MAKEDEV.conf:1.13	Sat Sep 13 11:46:18 2008
+++ src/etc/etc.sparc64/MAKEDEV.conf	Sun Feb 14 13:41:50 2010
@@ -1,7 +1,8 @@
-# $NetBSD: MAKEDEV.conf,v 1.13 2008/09/13 11:46:18 tsutsui Exp $
+# $NetBSD: MAKEDEV.conf,v 1.13.2.1 2010/02/14 13:41:50 bouyer Exp $
 
 all_md)
-	makedev std_sparc64 ttya ttyb ttyc ttyd ttyC00 ttyC01 ttyh0 ttyh1
+	makedev std_sparc64 ttya ttyb ttyc ttyd ttyC00 ttyC01
+	makedev ttyh0 ttyh1 ttyh2 ttyh3
 	makedev sd0 sd1 sd2 sd3 sd4 ss0 ch0 uk0 uk1
 	makedev wd0 wd1 wd2 wd3 cd0 st0 st1 fd0
 	makedev audio

Index: src/share/man/man4/man4.sparc64/sab.4
diff -u src/share/man/man4/man4.sparc64/sab.4:1.3 src/share/man/man4/man4.sparc64/sab.4:1.3.4.1
--- src/share/man/man4/man4.sparc64/sab.4:1.3	Wed Apr 30 13:10:56 2008
+++ src/share/man/man4/man4.sparc64/sab.4	Sun Feb 14 13:41:50 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: sab.4,v 1.3 2008/04/30 13:10:56 martin Exp $
+.\	$NetBSD: sab.4,v 1.3.4.1 2010/02/14 13:41:50 bouyer Exp $
 .\
 .\ Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd October 29, 2003
+.Dd January 18, 2010
 .Dt SAB 4 sparc64
 .Os
 .Sh NAME
@@ -45,16 +45,24 @@
 .Tn Infineon
 (previously
 .Tn Siemens )
-82532 serial communications interface found in Sun Ultra 5/10
-workstations.
+82532 serial communications interface found in many
+.Tn Sun Ultra
+workstations and servers.
 .Pp
 Input and output speeds for each line may be set to any baud rate in the
-following list: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 
-4800, 9600, 19200, 38400, 57600, 76800, 115200, 153600, 230400, 307200, 
+following list: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400,
+4800, 9600, 19200, 38400, 57600, 76800, 115200, 153600, 230400, 307200,
 460800, 614400, 921600.
+.Sh NOTES
+The speed cannot be changed on the ports connected the
+.Tn Remote System Control
+(RSC) on a
+.Tn Sun Enterprise[tm] 250 Server
+(ttyh2 and ttyh3).
+These ports are fixed at 115200 baud.
 .Sh FILES
 .Bl -tag -width XdevXttyh0X
-.It Pa /dev/ttyh[01]
+.It Pa /dev/ttyh[0123]
 serial ports
 .El
 .Sh DIAGNOSTICS

Index: src/sys/arch/sparc64/dev/sab.c
diff -u src/sys/arch/sparc64/dev/sab.c:1.42 src/sys/arch/sparc64/dev/sab.c:1.42.6.1
--- src/sys/arch/sparc64/dev/sab.c:1.42	Wed Jun 11 18:52:32 2008
+++ src/sys/arch/sparc64/dev/sab.c	Sun Feb 14 13:41:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sab.c,v 1.42 2008/06/11 18:52:32 cegger Exp $	*/
+/*	$NetBSD: sab.c,v 1.42.6.1 2010/02/14 13:41:50 bouyer Exp $	*/
 /*	$OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sab.c,v 1.42 2008/06/11 18:52:32 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: sab.c,v 1.42.6.1 2010/02/14 13:41:50 bouyer Exp $);
 
 #include opt_kgdb.h
 #include sys/types.h
@@ -104,14 +104,15 @@
 	u_char *		sc_txp;
 	int			sc_txc;
 	int			sc_flags;
-#define SABTTYF_STOP		0x01
-#define	SABTTYF_DONE		0x02
-#define	SABTTYF_RINGOVERFLOW	0x04
-#define	SABTTYF_CDCHG		0x08
-#define	SABTTYF_CONS_IN		0x10
-#define	SABTTYF_CONS_OUT	0x20
-#define	SABTTYF_TXDRAIN		0x40
-#define	SABTTYF_DONTDDB		0x80
+#define SABTTYF_STOP		0x0001
+#define	SABTTYF_DONE		0x0002
+#define	SABTTYF_RINGOVERFLOW	0x0004
+#define	SABTTYF_CDCHG		0x0008
+#define	SABTTYF_CONS_IN		0x0010
+#define	SABTTYF_CONS_OUT	0x0020
+#define	SABTTYF_TXDRAIN		0x0040
+#define	SABTTYF_DONTDDB		0x0080
+#define SABTTYF_IS_RSC		0x0100
 	uint8_t			sc_rbuf[SABTTY_RBUF_SIZE];
 	uint8_t			*sc_rend, *sc_rput, *sc_rget;
 	uint8_t			sc_polling, sc_pollrfc;
@@ -442,7 +443,10 @@
 		}
 
 		t.c_ispeed= 0;
-		t.c_ospeed = 9600;
+		if (sc-sc_flags  SABTTYF_IS_RSC)
+			t.c_ospeed = 115200;
+		else
+			t.c_ospeed = 9600;
 		t.c_cflag = CREAD | CS8 | HUPCL;
 		sc-sc_tty-t_ospeed = 0;
 

CVS commit: [netbsd-5] src/doc

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:42:54 UTC 2010

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

Log Message:
Tickets 1289, 1290, 1292, 1292, 1293, 1297


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.194 -r1.1.2.195 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.194 src/doc/CHANGES-5.1:1.1.2.195
--- src/doc/CHANGES-5.1:1.1.2.194	Thu Feb  4 06:49:53 2010
+++ src/doc/CHANGES-5.1	Sun Feb 14 13:42:53 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.194 2010/02/04 06:49:53 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.195 2010/02/14 13:42:53 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -16670,3 +16670,53 @@
 	  as the version used to build the package
 	[joerg, ticket #1298]
 
+sys/kern/vfs_syscalls.c1.401
+sys/nfs/nfs_serv.c1.149
+sys/sys/namei.src1.14
+sys/sys/namei.h	regen
+
+	Define namei flag INRENAME and set it if a lookup operation is part
+	of rename.  This helps with building better asserts for rename in
+	the DELETE lookup ... the RENAME lookup is quite obviously a part
+	of rename.
+	[pooka, ticket #1289]
+
+sys/arch/x86/x86/pmap.c1.100
+sys/arch/x86/x86/x86_autoconf.c			1.49
+sys/dev/pci/agp_via.c1.18
+sys/kern/cnmagic.c1.11
+sys/kern/init_main.c1.415
+sys/kern/kern_ksyms.c1.53
+sys/netipsec/ipsec.c1.47
+sys/netipsec/key.c1.63
+sys/netkey/key.c1.176
+
+	Replace more printfs with aprint_normal / aprint_verbose
+	Makes boot -z go mostly silent for me.
+	[hubertf, ticket #1290]
+
+sys/opencrypto/cryptodev.c			1.52
+
+	Add missing break for CRYPTO_CAST_CBC, and some assorted comment
+	fixes.  openssl(1) checks for CAST (and others) on ~every startup.
+	[hubertf, ticket #1291]
+
+sys/kern/kern_malloc.c1.128
+
+	Let kernel build when MALLOCLOG is defined but DIAGNOSTIC is not.
+	Else, hitmlog() is defined but not used, which triggers a warning.
+	[hubertf, ticket #1292]
+
+share/man/man9/opencrypto.9			1.9
+
+	Document sysctls
+	[hubertf, ticket #1293]
+
+etc/etc.sparc64/MAKEDEV.conf			1.14
+share/man/man4/man4.sparc64/sab.4		1.4
+sys/arch/sparc64/dev/sab.c			1.43, 1.44
+
+	Allow the RSC to be the console on an E250, by checking for
+	RSC-specific properties, and by not changing the port baud rate.
+	[jdc, ticket #1297]
+



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

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:55:29 UTC 2010

Modified Files:
src/sys/ufs/ufs [netbsd-5]: ufs_lookup.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1300):
sys/ufs/ufs/ufs_lookup.c: revision 1.102
Avoid nasal demons. Code of the form
   vput(vp);
   error = VFS_VGET(vp-v_mount, ...);
just isn't right. Because of vnode caching this *probably* never bit
anyone, except maybe under very heavy load, but still.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.99.4.1 src/sys/ufs/ufs/ufs_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/sys/ufs/ufs/ufs_lookup.c
diff -u src/sys/ufs/ufs/ufs_lookup.c:1.99 src/sys/ufs/ufs/ufs_lookup.c:1.99.4.1
--- src/sys/ufs/ufs/ufs_lookup.c:1.99	Thu Jul 31 05:38:06 2008
+++ src/sys/ufs/ufs/ufs_lookup.c	Sun Feb 14 13:55:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_lookup.c,v 1.99 2008/07/31 05:38:06 simonb Exp $	*/
+/*	$NetBSD: ufs_lookup.c,v 1.99.4.1 2010/02/14 13:55:29 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ufs_lookup.c,v 1.99 2008/07/31 05:38:06 simonb Exp $);
+__KERNEL_RCSID(0, $NetBSD: ufs_lookup.c,v 1.99.4.1 2010/02/14 13:55:29 bouyer Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_ffs.h
@@ -1256,7 +1256,7 @@
 int
 ufs_checkpath(struct inode *source, struct inode *target, kauth_cred_t cred)
 {
-	struct vnode *vp = ITOV(target);
+	struct vnode *nextvp, *vp;
 	int error, rootino, namlen;
 	struct dirtemplate dirbuf;
 	const int needswap = UFS_MPNEEDSWAP(target-i_ump);
@@ -1304,13 +1304,15 @@
 		}
 		if (ufs_rw32(dirbuf.dotdot_ino, needswap) == rootino)
 			break;
-		vput(vp);
+		VOP_UNLOCK(vp, 0);
 		error = VFS_VGET(vp-v_mount,
-		ufs_rw32(dirbuf.dotdot_ino, needswap), vp);
+		ufs_rw32(dirbuf.dotdot_ino, needswap), nextvp);
+		vrele(vp);
 		if (error) {
 			vp = NULL;
 			break;
 		}
+		vp = nextvp;
 	}
 
 out:



CVS commit: [netbsd-5] src/sys/arch/hp700/conf

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:57:11 UTC 2010

Modified Files:
src/sys/arch/hp700/conf [netbsd-5]: GENERIC

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1301):
sys/arch/hp700/conf/GENERIC: revision 1.92
Add USERCONF as per all other GENERIC kernels


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.83.4.1 src/sys/arch/hp700/conf/GENERIC

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/hp700/conf/GENERIC
diff -u src/sys/arch/hp700/conf/GENERIC:1.83 src/sys/arch/hp700/conf/GENERIC:1.83.4.1
--- src/sys/arch/hp700/conf/GENERIC:1.83	Sun Aug 10 15:31:21 2008
+++ src/sys/arch/hp700/conf/GENERIC	Sun Feb 14 13:57:11 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.83 2008/08/10 15:31:21 tls Exp $
+# $NetBSD: GENERIC,v 1.83.4.1 2010/02/14 13:57:11 bouyer Exp $
 #
 # GENERIC machine description file
 # 
@@ -23,7 +23,7 @@
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
-#ident 		GENERIC-$Revision: 1.83 $
+#ident 		GENERIC-$Revision: 1.83.4.1 $
 
 maxusers	32		# estimated number of users
 
@@ -60,6 +60,7 @@
 options 	P1003_1B_SEMAPHORE # p1003.1b semaphore support
 
 options 	LKM		# loadable kernel modules
+options 	USERCONF	# userconf(4) support
 
 # Enable experimental buffer queue strategy for better responsiveness under 
 # high disk I/O load. Use it with caution - it's not proven to be stable yet.



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

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 13:58:32 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: ukbd.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1303):
sys/dev/usb/ukbd.c: revision 1.104
sys/dev/usb/ukbd.c: revision 1.107
Fix WSKBD_RAW mode ukbd - pckbd translation for Pause/Break and
Print Screen/Sys Req keys so xf86-input-keyboard can figure out
what we want.
Additionally, fix dead URL, and add a note that this emulation
is not completely identical to a real pckbd.
Tweak comment about keyboard mapping.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.101.4.1 src/sys/dev/usb/ukbd.c

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

Modified files:

Index: src/sys/dev/usb/ukbd.c
diff -u src/sys/dev/usb/ukbd.c:1.101 src/sys/dev/usb/ukbd.c:1.101.4.1
--- src/sys/dev/usb/ukbd.c:1.101	Tue Sep  9 17:40:40 2008
+++ src/sys/dev/usb/ukbd.c	Sun Feb 14 13:58:32 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: ukbd.c,v 1.101 2008/09/09 17:40:40 jmcneill Exp $*/
+/*  $NetBSD: ukbd.c,v 1.101.4.1 2010/02/14 13:58:32 bouyer Exp $*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ukbd.c,v 1.101 2008/09/09 17:40:40 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ukbd.c,v 1.101.4.1 2010/02/14 13:58:32 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -97,7 +97,12 @@
  * Translate USB keycodes to US keyboard XT scancodes.
  * Scancodes = 0x80 represent EXTENDED keycodes.
  *
- * See http://www.microsoft.com/whdc/device/input/Scancode.mspx
+ * See http://www.microsoft.com/whdc/archive/scancode.mspx
+ *
+ * Note: a real pckbd(4) has more complexity in its
+ * protocol for some keys than this translation implements.
+ * For example, some keys generate Fake ShiftL events (e0 2a)
+ * before the actual key sequence.
  */
 Static const u_int8_t ukbd_trtab[256] = {
   NN,   NN,   NN,   NN, 0x1e, 0x30, 0x2e, 0x20, /* 00 - 07 */
@@ -108,7 +113,7 @@
 0x1c, 0x01, 0x0e, 0x0f, 0x39, 0x0c, 0x0d, 0x1a, /* 28 - 2f */
 0x1b, 0x2b, 0x2b, 0x27, 0x28, 0x29, 0x33, 0x34, /* 30 - 37 */
 0x35, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, /* 38 - 3f */
-0x41, 0x42, 0x43, 0x44, 0x57, 0x58, 0xaa, 0x46, /* 40 - 47 */
+0x41, 0x42, 0x43, 0x44, 0x57, 0x58, 0xb7, 0x46, /* 40 - 47 */
 0x7f, 0xd2, 0xc7, 0xc9, 0xd3, 0xcf, 0xd1, 0xcd, /* 48 - 4f */
 0xcb, 0xd0, 0xc8, 0x45, 0xb5, 0x37, 0x4a, 0x4e, /* 50 - 57 */
 0x9c, 0x4f, 0x50, 0x51, 0x4b, 0x4c, 0x4d, 0x47, /* 58 - 5f */
@@ -630,9 +635,17 @@
 			c = ukbd_trtab[key  CODEMASK];
 			if (c == NN)
 continue;
-			if (c  0x80)
-cbuf[j++] = 0xe0;
-			cbuf[j] = c  0x7f;
+			if (c == 0x7f) {
+/* pause key */
+cbuf[j++] = 0xe1;
+cbuf[j++] = 0x1d;
+cbuf[j-1] |= (key  RELEASE) ? 0x80 : 0;
+cbuf[j] = 0x45;
+			} else {
+if (c  0x80)
+	cbuf[j++] = 0xe0;
+cbuf[j] = c  0x7f;
+			}
 			if (key  RELEASE)
 cbuf[j] |= 0x80;
 #if defined(UKBD_REPEAT)



CVS commit: [netbsd-5] src/sys/arch/i386/stand/boot

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 14:01:08 UTC 2010

Modified Files:
src/sys/arch/i386/stand/boot [netbsd-5]: boot2.c

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1304):
sys/arch/i386/stand/boot/boot2.c: revision 1.48
When a password is set for the bootloader (installboot -o password=...),
it currently complains about an unknown command and prints a usage if the
password is entered wrong:
 ...
 Choose an option; RETURN for default; SPACE to stop countdown.
 Option 1 will be chosen in 0 seconds.
 Password: *
 Password: *
 Password: *
 unknown command
 commands are:
 boot [xdNx:][filename] [-12acdqsvxz]
  (ex. hd0a:netbsd.old -s
 ls [path]
 dev xd[N[x]]:
 consdev {pc|com[0123]|com[0123]kbd|auto}
 modules {enabled|disabled}
 load {path_to_module}
 multiboot [xdNx:][filename] [args]
 help|?
 quit
 Choose an option; RETURN for default; SPACE to stop countdown.
 Option 1 will be chosen in 0 seconds.
 ...
This is confusing, plus someone may use it to determine bits of
information about the system. What should happen instead is that the user
is informed that the password is wrong:
 ...
 Choose an option; RETURN for default; SPACE to stop countdown.
 Option 1 will be chosen in 0 seconds.
 Password: 
 Password: 
 Password: 
 Wrong password.
 Choose an option; RETURN for default; SPACE to stop countdown.
 ...
Implement the latter behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.38.4.1 -r1.38.4.2 src/sys/arch/i386/stand/boot/boot2.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/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.38.4.1 src/sys/arch/i386/stand/boot/boot2.c:1.38.4.2
--- src/sys/arch/i386/stand/boot/boot2.c:1.38.4.1	Sun Oct 18 16:41:28 2009
+++ src/sys/arch/i386/stand/boot/boot2.c	Sun Feb 14 14:01:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.38.4.1 2009/10/18 16:41:28 bouyer Exp $	*/
+/*	$NetBSD: boot2.c,v 1.38.4.2 2010/02/14 14:01:08 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -664,11 +664,23 @@
 #else
 		c = awaitkey((bootconf.timeout  0) ? 0 : bootconf.timeout, 1);
 #endif
-		if ((c != '\r')  (c != '\n')  (c != '\0') 
-		((boot_params.bp_flags  X86_BP_FLAGS_PASSWORD) == 0
-		 || check_password(boot_params.bp_password))) {
-			printf(type \?\ or \help\ for help.\n);
+		if ((c != '\r')  (c != '\n')  (c != '\0')) {
+		if ((boot_params.bp_flags  X86_BP_FLAGS_PASSWORD) == 0) {
+			/* do NOT ask for password */
 			bootmenu(); /* does not return */
+		} else {
+			/* DO ask for password */
+			if (check_password(boot_params.bp_password)) {
+			/* password ok */
+			printf(type \?\ or \help\ for help.\n);
+			bootmenu(); /* does not return */
+			} else {
+			/* bad password */
+			printf(Wrong password.\n);
+			currname = 0;
+			continue;
+			}
+		}
 		}
 
 		/*



CVS commit: [netbsd-5-0] src/distrib/pmax/instkernel

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 14:04:48 UTC 2010

Modified Files:
src/distrib/pmax/instkernel [netbsd-5-0]: Makefile

Log Message:
Apply patch, requested by snj in ticket 1305:
distrib/pmax/instkernel/Makefile: patch
Bump the size of the pmax instkernel ramdisk to 2200k.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.30.1 src/distrib/pmax/instkernel/Makefile

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

Modified files:

Index: src/distrib/pmax/instkernel/Makefile
diff -u src/distrib/pmax/instkernel/Makefile:1.36 src/distrib/pmax/instkernel/Makefile:1.36.30.1
--- src/distrib/pmax/instkernel/Makefile:1.36	Mon Jan 16 00:16:44 2006
+++ src/distrib/pmax/instkernel/Makefile	Sun Feb 14 14:04:48 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2006/01/16 00:16:44 he Exp $
+#	$NetBSD: Makefile,v 1.36.30.1 2010/02/14 14:04:48 bouyer Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -6,7 +6,7 @@
 .include bsd.kernobj.mk
 
 IMAGE=		diskimage
-IMAGESIZE=	2100k
+IMAGESIZE=	2200k
 LISTS=		${.CURDIR}/list
 MTREECONF=	${DISTRIBDIR}/common/mtree.dot
 IMAGEENDIAN=	le



CVS commit: [netbsd-5] src/distrib/pmax/instkernel

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 14:04:53 UTC 2010

Modified Files:
src/distrib/pmax/instkernel [netbsd-5]: Makefile

Log Message:
Apply patch, requested by snj in ticket 1305:
distrib/pmax/instkernel/Makefile: patch
Bump the size of the pmax instkernel ramdisk to 2200k.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.28.1 src/distrib/pmax/instkernel/Makefile

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

Modified files:

Index: src/distrib/pmax/instkernel/Makefile
diff -u src/distrib/pmax/instkernel/Makefile:1.36 src/distrib/pmax/instkernel/Makefile:1.36.28.1
--- src/distrib/pmax/instkernel/Makefile:1.36	Mon Jan 16 00:16:44 2006
+++ src/distrib/pmax/instkernel/Makefile	Sun Feb 14 14:04:53 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2006/01/16 00:16:44 he Exp $
+#	$NetBSD: Makefile,v 1.36.28.1 2010/02/14 14:04:53 bouyer Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -6,7 +6,7 @@
 .include bsd.kernobj.mk
 
 IMAGE=		diskimage
-IMAGESIZE=	2100k
+IMAGESIZE=	2200k
 LISTS=		${.CURDIR}/list
 MTREECONF=	${DISTRIBDIR}/common/mtree.dot
 IMAGEENDIAN=	le



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

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 14:05:07 UTC 2010

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

Log Message:
Ticket 1305


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/doc/CHANGES-5.0.3

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

Modified files:

Index: src/doc/CHANGES-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.1 src/doc/CHANGES-5.0.3:1.1.2.2
--- src/doc/CHANGES-5.0.3:1.1.2.1	Sat Feb 13 08:17:17 2010
+++ src/doc/CHANGES-5.0.3	Sun Feb 14 14:05:07 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.1 2010/02/13 08:17:17 snj Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.2 2010/02/14 14:05:07 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -9,3 +9,7 @@
 	Welcome to 5.0.2_PATCH.
 	[snj]
 
+distrib/pmax/instkernel/Makefile		patch
+
+	Bump the size of the pmax instkernel ramdisk to 2200k.
+	[snj, ticket #1305]



CVS commit: [netbsd-5] src/doc

2010-02-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 14 14:05:54 UTC 2010

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

Log Message:
Tickets 1300, 1301, 1303, 1304 and 1305


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.195 -r1.1.2.196 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.195 src/doc/CHANGES-5.1:1.1.2.196
--- src/doc/CHANGES-5.1:1.1.2.195	Sun Feb 14 13:42:53 2010
+++ src/doc/CHANGES-5.1	Sun Feb 14 14:05:54 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.195 2010/02/14 13:42:53 bouyer Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.196 2010/02/14 14:05:54 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -16720,3 +16720,39 @@
 	RSC-specific properties, and by not changing the port baud rate.
 	[jdc, ticket #1297]
 
+sys/ufs/ufs/ufs_lookup.c			1.102
+
+	Avoid undefined behavior. Code of the form
+
+	   vput(vp);
+	   error = VFS_VGET(vp-v_mount, ...);
+
+	just isn't right. Because of vnode caching this *probably* never bit
+	anyone, except maybe under very heavy load, but still.
+	[dholland, ticket #1300]
+
+sys/arch/hp700/conf/GENERIC			1.92
+
+	Add USERCONF as per all other GENERIC kernels
+	[skrll, ticket #1301]
+
+sys/dev/usb/ukbd.c1.104, 1.107
+
+	Fix WSKBD_RAW mode ukbd - pckbd translation for Pause/Break and
+	Print Screen/Sys Req keys so xf86-input-keyboard can figure out
+	what we want.
+	Additionally, fix dead URL, and add a note that this emulation
+	is not completely identical to a real pckbd.
+	[sborrill, ticket #1303]
+
+sys/arch/i386/stand/boot/boot2.c		1.48
+
+	When a password is set for the bootloader, make it actually inform
+	the user that the password is wrong when the password is entered wrong.
+	[hubertf, ticket #1304]
+
+distrib/pmax/instkernel/Makefile		patch
+
+	Bump the size of the pmax instkernel ramdisk to 2200k.
+	[snj, ticket #1305]
+



CVS commit: src/sys/dev/sysmon

2010-02-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 14 16:22:09 UTC 2010

Modified Files:
src/sys/dev/sysmon: sysmon_envsys_events.c

Log Message:
Correct one more instance of checking flags in the wrong place.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/sysmon/sysmon_envsys_events.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/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.80 src/sys/dev/sysmon/sysmon_envsys_events.c:1.81
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.80	Sat Feb 13 19:34:14 2010
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Sun Feb 14 16:22:09 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.80 2010/02/13 19:34:14 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.81 2010/02/14 16:22:09 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.80 2010/02/13 19:34:14 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.81 2010/02/14 16:22:09 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -699,7 +699,7 @@
 		((edata-upropset  (valid))  \
 		 (edata-value_cur rel (edata-limits.lim)))
 
-		if ((edata-limits.sel_flags  PROP_DRIVER_LIMITS) == 0) {
+		if ((edata-upropset  PROP_DRIVER_LIMITS) == 0) {
 			if __EXCEED_LIM(PROP_CRITMIN | PROP_BATTCAP,
 	sel_critmin, )
 edata-state = ENVSYS_SCRITUNDER;



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

2010-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Feb 14 21:50:38 UTC 2010

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: Makefile.mips

Log Message:
We use ntrad* and so make objcopy use them too.


To generate a diff of this commit:
cvs rdiff -u -r1.50.24.5 -r1.50.24.6 src/sys/arch/mips/conf/Makefile.mips

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

Modified files:

Index: src/sys/arch/mips/conf/Makefile.mips
diff -u src/sys/arch/mips/conf/Makefile.mips:1.50.24.5 src/sys/arch/mips/conf/Makefile.mips:1.50.24.6
--- src/sys/arch/mips/conf/Makefile.mips:1.50.24.5	Sat Jan 30 23:49:31 2010
+++ src/sys/arch/mips/conf/Makefile.mips	Sun Feb 14 21:50:38 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mips,v 1.50.24.5 2010/01/30 23:49:31 matt Exp $
+#	$NetBSD: Makefile.mips,v 1.50.24.6 2010/02/14 21:50:38 matt Exp $
 
 # Makefile for NetBSD
 #
@@ -56,15 +56,15 @@
 LDFLAGS+=	-m elf64btsmip
 LINKFORMAT+=	-m elf64btsmip
 SYSTEM_LD_TAIL_EXTRA+= \
-		;echo ${OBJCOPY} -O elf32-nbigmips $@ $...@.elf32; \
-		${OBJCOPY} -O elf32-nbigmips $@ $...@.elf32
+		;echo ${OBJCOPY} -O elf32-ntradbigmips $@ $...@.elf32; \
+		${OBJCOPY} -O elf32-ntradbigmips $@ $...@.elf32
 .endif
 .if ${MACHINE_ARCH} == mips64el
 LDFLAGS+=	-m elf64ltsmip
 LINKFORMAT+=	-m elf64ltsmip
 SYSTEM_LD_TAIL_EXTRA+= \
-	;echo ${OBJCOPY} -O elf32-nlittlemips $@ $...@.elf32; \
-	${OBJCOPY} -O elf32-nlittlemips $@ $...@.elf32
+	;echo ${OBJCOPY} -O elf32-ntradlittlemips $@ $...@.elf32; \
+	${OBJCOPY} -O elf32-ntradlittlemips $@ $...@.elf32
 .endif
 .endif # LP64=yes
 AFLAGS+=	-mno-abicalls -x assembler-with-cpp -traditional-cpp ${AOPTS}



CVS commit: src/sys

2010-02-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 14 23:06:02 UTC 2010

Modified Files:
src/sys/dev/sysmon: sysmon_envsys.c sysmon_envsys_events.c
sysmon_envsysvar.h sysmonvar.h
src/sys/sys: envsys.h

Log Message:
Remove the flags member of the limits structure.  Its value was only
meaningful for a few limited function calls;  all persitent storage
of limit-present flags is maintained in the edata-upropset member.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/sysmon/sysmon_envsys.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/sysmon/sysmon_envsys_events.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sysmon/sysmon_envsysvar.h \
src/sys/dev/sysmon/sysmonvar.h
cvs rdiff -u -r1.28 -r1.29 src/sys/sys/envsys.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/sysmon/sysmon_envsys.c
diff -u src/sys/dev/sysmon/sysmon_envsys.c:1.94 src/sys/dev/sysmon/sysmon_envsys.c:1.95
--- src/sys/dev/sysmon/sysmon_envsys.c:1.94	Fri Feb  5 17:44:27 2010
+++ src/sys/dev/sysmon/sysmon_envsys.c	Sun Feb 14 23:06:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_envsys.c,v 1.94 2010/02/05 17:44:27 pgoyette Exp $	*/
+/*	$NetBSD: sysmon_envsys.c,v 1.95 2010/02/14 23:06:01 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys.c,v 1.94 2010/02/05 17:44:27 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys.c,v 1.95 2010/02/14 23:06:01 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -1720,6 +1720,7 @@
 	envsys_data_t *edata;
 	prop_dictionary_t dict, tdict = NULL;
 	prop_object_t obj, obj1, obj2, tobj = NULL;
+	uint32_t props;
 	uint64_t refresh_timo = 0;
 	sysmon_envsys_lim_t lims;
 	int i, error = 0;
@@ -1785,7 +1786,7 @@
 		if (!prop_string_equals(obj1, obj))
 			continue;
 
-		lims.sel_flags = 0;
+		props = 0;
 
 		/*
 		 * Check if a new description operation was
@@ -1860,7 +1861,7 @@
 		if (obj2  prop_object_type(obj2) == PROP_TYPE_NUMBER) {
 			targetfound = true;
 			lims.sel_critmin = prop_number_integer_value(obj2);
-			lims.sel_flags |= PROP_BATTCAP;
+			props |= PROP_BATTCAP;
 		}
 
 		/* 
@@ -1870,7 +1871,7 @@
 		if (obj2  prop_object_type(obj2) == PROP_TYPE_NUMBER) {
 			targetfound = true;
 			lims.sel_warnmin = prop_number_integer_value(obj2);
-			lims.sel_flags |= PROP_BATTWARN;
+			props |= PROP_BATTWARN;
 		}
 
 		/* 
@@ -1880,7 +1881,7 @@
 		if (obj2  prop_object_type(obj2) == PROP_TYPE_NUMBER) {
 			targetfound = true;
 			lims.sel_critmax = prop_number_integer_value(obj2);
-			lims.sel_flags |= PROP_CRITMAX;
+			props |= PROP_CRITMAX;
 		}
 
 		/* 
@@ -1890,7 +1891,7 @@
 		if (obj2  prop_object_type(obj2) == PROP_TYPE_NUMBER) {
 			targetfound = true;
 			lims.sel_warnmax = prop_number_integer_value(obj2);
-			lims.sel_flags |= PROP_WARNMAX;
+			props |= PROP_WARNMAX;
 		}
 
 		/* 
@@ -1900,7 +1901,7 @@
 		if (obj2  prop_object_type(obj2) == PROP_TYPE_NUMBER) {
 			targetfound = true;
 			lims.sel_critmin = prop_number_integer_value(obj2);
-			lims.sel_flags |= PROP_CRITMIN;
+			props |= PROP_CRITMIN;
 		}
 
 		/* 
@@ -1910,27 +1911,24 @@
 		if (obj2  prop_object_type(obj2) == PROP_TYPE_NUMBER) {
 			targetfound = true;
 			lims.sel_warnmin = prop_number_integer_value(obj2);
-			lims.sel_flags |= PROP_WARNMIN;
+			props |= PROP_WARNMIN;
 		}
 
-		if (lims.sel_flags) {
+		if (props) {
 			if (edata-flags  ENVSYS_FMONNOTSUPP) {
 error = ENOTSUP;
 goto out;
 			}
 			error = sme_event_register(dict, edata, sme, lims,
-	  (edata-flags  ENVSYS_FPERCENT)?
+	props,
+	(edata-flags  ENVSYS_FPERCENT)?
 		PENVSYS_EVENT_CAPACITY:
 		PENVSYS_EVENT_LIMITS,
-	  sdt[i].crittype);
+	sdt[i].crittype);
 			if (error == EEXIST)
 error = 0;
 			if (error) 
 goto out;
-
-			mutex_enter(sme-sme_mtx);
-			edata-upropset |= lims.sel_flags;
-			mutex_exit(sme-sme_mtx);
 		}
 
 		/*

Index: src/sys/dev/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.81 src/sys/dev/sysmon/sysmon_envsys_events.c:1.82
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.81	Sun Feb 14 16:22:09 2010
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Sun Feb 14 23:06:02 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.81 2010/02/14 16:22:09 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.82 2010/02/14 23:06:02 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.81 2010/02/14 16:22:09 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.82 2010/02/14 23:06:02 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -44,6 +44,7 @@
 #include sys/callout.h
 
 /* #define ENVSYS_DEBUG */
+/* #define ENVSYS_OBJECTS_DEBUG */
 
 

CVS commit: src/sys/dev/acpi

2010-02-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 14 23:06:58 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_tz.c atk0110.c

Log Message:
Adapt to changes in sysmon's limit structure.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/acpi/acpi_tz.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/atk0110.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/acpi/acpi_tz.c
diff -u src/sys/dev/acpi/acpi_tz.c:1.57 src/sys/dev/acpi/acpi_tz.c:1.58
--- src/sys/dev/acpi/acpi_tz.c:1.57	Mon Feb  1 09:45:04 2010
+++ src/sys/dev/acpi/acpi_tz.c	Sun Feb 14 23:06:58 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_tz.c,v 1.57 2010/02/01 09:45:04 jruoho Exp $ */
+/* $NetBSD: acpi_tz.c,v 1.58 2010/02/14 23:06:58 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2003 Jared D. McNeill jmcne...@invisible.ca
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_tz.c,v 1.57 2010/02/01 09:45:04 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_tz.c,v 1.58 2010/02/14 23:06:58 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -144,7 +144,7 @@
 static void	acpitz_tick(void *);
 static void	acpitz_init_envsys(device_t);
 static void	acpitz_get_limits(struct sysmon_envsys *, envsys_data_t *,
-  sysmon_envsys_lim_t *);
+  sysmon_envsys_lim_t *, uint32_t *);
 static int	acpitz_get_fanspeed(device_t, UINT32 *, UINT32 *, UINT32 *);
 #ifdef notyet
 static ACPI_STATUS
@@ -712,40 +712,40 @@
 
 static void
 acpitz_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
-		  sysmon_envsys_lim_t *limits)
+		  sysmon_envsys_lim_t *limits, uint32_t *props)
 {
 	struct acpitz_softc *sc = sme-sme_cookie;
 	int i;
 
 	switch (edata-units) {
 	case ENVSYS_STEMP:
-		limits-sel_flags = 0;
+		*props = 0;
 		if (sc-sc_zone.hot != ATZ_TMP_INVALID) {
-			limits-sel_flags |= PROP_CRITMAX;
+			*props |= PROP_CRITMAX;
 			limits-sel_critmax = ATZ2UKELVIN(sc-sc_zone.hot);
 		} else if (sc-sc_zone.crt != ATZ_TMP_INVALID) {
-			limits-sel_flags |= PROP_CRITMAX;
+			*props |= PROP_CRITMAX;
 			limits-sel_critmax = ATZ2UKELVIN(sc-sc_zone.crt);
 		}
 		for (i = 0; i  ATZ_NLEVELS; i++) {
 			if (sc-sc_zone.ac[i] != ATZ_TMP_INVALID) {
 limits-sel_warnmax =
 ATZ2UKELVIN(sc-sc_zone.ac[i]);
-limits-sel_flags |= PROP_WARNMAX;
+*props |= PROP_WARNMAX;
 break;
 			}
 		}
 		break;
 
 	case ENVSYS_SFANRPM:
-		limits-sel_flags = 0;
+		*props = 0;
 		if (sc-sc_zone.fanmin != ATZ_TMP_INVALID) {
-			limits-sel_flags |= PROP_WARNMIN;
+			*props |= PROP_WARNMIN;
 			limits-sel_warnmin = sc-sc_zone.fanmin;
 			sc-sc_fan_sensor.flags |= ENVSYS_FVALID_MIN;
 		}
 		if (sc-sc_zone.fanmax != ATZ_TMP_INVALID) {
-			limits-sel_flags |= PROP_WARNMAX;
+			*props |= PROP_WARNMAX;
 			limits-sel_warnmax = sc-sc_zone.fanmax;
 			sc-sc_fan_sensor.flags |= ENVSYS_FVALID_MAX;
 		}

Index: src/sys/dev/acpi/atk0110.c
diff -u src/sys/dev/acpi/atk0110.c:1.4 src/sys/dev/acpi/atk0110.c:1.5
--- src/sys/dev/acpi/atk0110.c:1.4	Thu Feb 11 06:54:57 2010
+++ src/sys/dev/acpi/atk0110.c	Sun Feb 14 23:06:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: atk0110.c,v 1.4 2010/02/11 06:54:57 cnst Exp $	*/
+/*	$NetBSD: atk0110.c,v 1.5 2010/02/14 23:06:58 pgoyette Exp $	*/
 /*	$OpenBSD: atk0110.c,v 1.1 2009/07/23 01:38:16 cnst Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: atk0110.c,v 1.4 2010/02/11 06:54:57 cnst Exp $);
+__KERNEL_RCSID(0, $NetBSD: atk0110.c,v 1.5 2010/02/14 23:06:58 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,7 +66,7 @@
 static int aibs_detach(device_t, int);
 static void aibs_refresh(struct sysmon_envsys *, envsys_data_t *);
 static void aibs_get_limits(struct sysmon_envsys *, envsys_data_t *,
-sysmon_envsys_lim_t *);
+sysmon_envsys_lim_t *, uint32_t *);
 
 static void aibs_attach_sif(device_t, enum envsys_units);
 
@@ -355,7 +355,7 @@
 
 static void
 aibs_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
-sysmon_envsys_lim_t *limits)
+sysmon_envsys_lim_t *limits, uint32_t *props)
 {
 	struct aibs_softc	*sc = sme-sme_cookie;
 	envsys_data_t		*s = edata;
@@ -389,23 +389,23 @@
 	case ENVSYS_STEMP:
 		li-sel_critmax = h * 100 * 1000 + 27315;
 		li-sel_warnmax = l * 100 * 1000 + 27315;
-		li-sel_flags = PROP_CRITMAX | PROP_WARNMAX;
+		*props = PROP_CRITMAX | PROP_WARNMAX;
 		break;
 	case ENVSYS_SFANRPM:
 		/* some boards have strange limits for fans */
 		if (l == 0) {
 			li-sel_warnmin = h;
-			li-sel_flags = PROP_WARNMIN;
+			*props = PROP_WARNMIN;
 		} else {
 			li-sel_warnmin = l;
 			li-sel_warnmax = h;
-			li-sel_flags = PROP_WARNMIN | PROP_WARNMAX;
+			*props = PROP_WARNMIN | PROP_WARNMAX;
 		}
 		break;
 	case ENVSYS_SVOLTS_DC:
 		li-sel_critmin = l * 1000;
 		li-sel_critmax = h * 1000;
-		li-sel_flags = PROP_CRITMIN | PROP_CRITMAX;
+		*props = PROP_CRITMIN | PROP_CRITMAX;
 		break;
 	default:
 		/* 

CVS commit: src/sys/dev/i2c

2010-02-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 14 23:07:22 UTC 2010

Modified Files:
src/sys/dev/i2c: sdtemp.c

Log Message:
Adapt to changes in sysmon's limit structure


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/sdtemp.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/i2c/sdtemp.c
diff -u src/sys/dev/i2c/sdtemp.c:1.9 src/sys/dev/i2c/sdtemp.c:1.10
--- src/sys/dev/i2c/sdtemp.c:1.9	Fri Jan  8 20:04:31 2010
+++ src/sys/dev/i2c/sdtemp.c	Sun Feb 14 23:07:22 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: sdtemp.c,v 1.9 2010/01/08 20:04:31 dyoung Exp $*/
+/*  $NetBSD: sdtemp.c,v 1.10 2010/02/14 23:07:22 pgoyette Exp $*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sdtemp.c,v 1.9 2010/01/08 20:04:31 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: sdtemp.c,v 1.10 2010/02/14 23:07:22 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -63,9 +63,9 @@
 
 static void	sdtemp_refresh(struct sysmon_envsys *, envsys_data_t *);
 static void	sdtemp_get_limits(struct sysmon_envsys *, envsys_data_t *,
-  sysmon_envsys_lim_t *);
+  sysmon_envsys_lim_t *, uint32_t *);
 static void	sdtemp_set_limits(struct sysmon_envsys *, envsys_data_t *,
-  sysmon_envsys_lim_t *);
+  sysmon_envsys_lim_t *, uint32_t *);
 #ifdef NOT_YET
 static int	sdtemp_read_8(struct sdtemp_softc *, uint8_t, uint8_t *);
 static int	sdtemp_write_8(struct sdtemp_softc *, uint8_t, uint8_t);
@@ -172,6 +172,7 @@
 	struct sdtemp_softc *sc = device_private(self);
 	struct i2c_attach_args *ia = aux;
 	sysmon_envsys_lim_t limits;
+	uint32_t props;
 	uint16_t mfgid, devid;
 	int i, error;
 
@@ -272,19 +273,19 @@
 		aprint_error_dev(self, couldn't establish power handler\n);
 
 	/* Retrieve and display hardware monitor limits */
-	sdtemp_get_limits(sc-sc_sme, sc-sc_sensor, limits);
+	sdtemp_get_limits(sc-sc_sme, sc-sc_sensor, limits, props);
 	aprint_normal_dev(self, );
 	i = 0;
-	if (limits.sel_flags  PROP_WARNMIN) {
+	if (props  PROP_WARNMIN) {
 		aprint_normal(low limit %dC, __UK2C(limits.sel_warnmin));
 		i++;
 	}
-	if (limits.sel_flags  PROP_WARNMAX) {
+	if (props  PROP_WARNMAX) {
 		aprint_normal(%shigh limit %dC , (i)?, :,
 			  __UK2C(limits.sel_warnmax));
 		i++;
 	}
-	if (limits.sel_flags  PROP_CRITMAX) {
+	if (props  PROP_CRITMAX) {
 		aprint_normal(%scritical limit %dC , (i)?, :,
 			  __UK2C(limits.sel_critmax));
 		i++;
@@ -305,50 +306,50 @@
 /* Retrieve current limits from device, and encode in uKelvins */
 static void
 sdtemp_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
-		  sysmon_envsys_lim_t *limits)
+		  sysmon_envsys_lim_t *limits, uint32_t *props)
 {
 	struct sdtemp_softc *sc = sme-sme_cookie;
 	uint16_t lim;
 
-	limits-sel_flags = 0;
+	*props = 0;
 	iic_acquire_bus(sc-sc_tag, 0);
 	if (sdtemp_read_16(sc, SDTEMP_REG_LOWER_LIM, lim) == 0  lim != 0) {
 		limits-sel_warnmin = sdtemp_decode_temp(sc, lim);
-		limits-sel_flags |= PROP_WARNMIN;
+		*props |= PROP_WARNMIN;
 	}
 	if (sdtemp_read_16(sc, SDTEMP_REG_UPPER_LIM, lim) == 0  lim != 0) {
 		limits-sel_warnmax = sdtemp_decode_temp(sc, lim);
-		limits-sel_flags |= PROP_WARNMAX;
+		*props |= PROP_WARNMAX;
 	}
 	if (sdtemp_read_16(sc, SDTEMP_REG_CRIT_LIM, lim) == 0  lim != 0) {
 		limits-sel_critmax = sdtemp_decode_temp(sc, lim);
-		limits-sel_flags |= PROP_CRITMAX;
+		*props |= PROP_CRITMAX;
 	}
 	iic_release_bus(sc-sc_tag, 0);
-	if (limits-sel_flags != 0)
-		limits-sel_flags |= PROP_DRIVER_LIMITS;
+	if (*props != 0)
+		*props |= PROP_DRIVER_LIMITS;
 }
 
 /* Send current limit values to the device */
 static void
 sdtemp_set_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
-		  sysmon_envsys_lim_t *limits)
+		  sysmon_envsys_lim_t *limits, uint32_t *props)
 {
 	uint16_t val;
 	struct sdtemp_softc *sc = sme-sme_cookie;
 
 	iic_acquire_bus(sc-sc_tag, 0);
-	if (limits-sel_flags  PROP_WARNMIN) {
+	if (*props  PROP_WARNMIN) {
 		val = __UK2C(limits-sel_warnmin);
 		(void)sdtemp_write_16(sc, SDTEMP_REG_LOWER_LIM,
 	(val  4)  SDTEMP_TEMP_MASK);
 	}
-	if (limits-sel_flags  PROP_WARNMAX) {
+	if (*props  PROP_WARNMAX) {
 		val = __UK2C(limits-sel_warnmax);
 		(void)sdtemp_write_16(sc, SDTEMP_REG_UPPER_LIM,
 	(val  4)  SDTEMP_TEMP_MASK);
 	}
-	if (limits-sel_flags  PROP_CRITMAX) {
+	if (*props  PROP_CRITMAX) {
 		val = __UK2C(limits-sel_critmax);
 		(void)sdtemp_write_16(sc, SDTEMP_REG_CRIT_LIM,
 	(val  4)  SDTEMP_TEMP_MASK);
@@ -360,12 +361,12 @@
 	 * limits are set that we cannot handle, tell sysmon that
 	 * the driver will take care of monitoring the limits!
 	 */
-	if (limits-sel_flags  (PROP_CRITMIN | PROP_BATTCAP | PROP_BATTWARN))
-		limits-sel_flags = ~PROP_DRIVER_LIMITS;
-	else if (limits-sel_flags  PROP_LIMITS)
-		limits-sel_flags |= PROP_DRIVER_LIMITS;
+	if (*props  

CVS commit: src/sys/arch/x86/x86

2010-02-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 14 23:07:59 UTC 2010

Modified Files:
src/sys/arch/x86/x86: ipmi.c

Log Message:
Adapt to changes in sysmon's limit structure.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 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.42 src/sys/arch/x86/x86/ipmi.c:1.43
--- src/sys/arch/x86/x86/ipmi.c:1.42	Sun Jan 31 11:39:55 2010
+++ src/sys/arch/x86/x86/ipmi.c	Sun Feb 14 23:07:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.42 2010/01/31 11:39:55 mlelstv Exp $ */
+/*	$NetBSD: ipmi.c,v 1.43 2010/02/14 23:07:59 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.42 2010/01/31 11:39:55 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.43 2010/02/14 23:07:59 pgoyette Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -85,6 +85,7 @@
 	int 		i_envtype; /* envsys compatible type */
 	int		i_envnum; /* envsys index */
 	sysmon_envsys_lim_t i_limits;
+	uint32_t	i_props;
 	SLIST_ENTRY(ipmi_sensor) i_list;
 };
 
@@ -213,11 +214,11 @@
 
 int32_t	ipmi_convert_sensor(uint8_t *, struct ipmi_sensor *);
 void	ipmi_set_limits(struct sysmon_envsys *, envsys_data_t *,
-			sysmon_envsys_lim_t *);
+			sysmon_envsys_lim_t *, uint32_t *);
 void	ipmi_get_limits(struct sysmon_envsys *, envsys_data_t *,
-			sysmon_envsys_lim_t *);
+			sysmon_envsys_lim_t *, uint32_t *);
 void	ipmi_get_sensor_limits(struct ipmi_softc *, struct ipmi_sensor *,
-			   sysmon_envsys_lim_t *);
+			   sysmon_envsys_lim_t *, uint32_t *);
 int	ipmi_sensor_status(struct ipmi_softc *, struct ipmi_sensor *,
 			   envsys_data_t *, uint8_t *);
 
@@ -1351,15 +1352,16 @@
 
 void
 ipmi_set_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
-		sysmon_envsys_lim_t *limits)
+		sysmon_envsys_lim_t *limits, uint32_t *props)
 {
 	struct ipmi_sensor *ipmi_s;
 
 	/* Find the ipmi_sensor corresponding to this edata */
 	SLIST_FOREACH(ipmi_s, ipmi_sensor_list, i_list) {
 		if (ipmi_s-i_envnum == edata-sensor) {
-			limits-sel_flags |= PROP_DRIVER_LIMITS;
+			*props |= PROP_DRIVER_LIMITS;
 			ipmi_s-i_limits = *limits;
+			ipmi_s-i_props  = *props;
 			return;
 		}
 	}
@@ -1368,7 +1370,7 @@
 
 void
 ipmi_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
-		sysmon_envsys_lim_t *limits)
+		sysmon_envsys_lim_t *limits, uint32_t *props)
 {
 	struct ipmi_sensor *ipmi_s;
 	struct ipmi_softc *sc = sme-sme_cookie;
@@ -1376,8 +1378,9 @@
 	/* Find the ipmi_sensor corresponding to this edata */
 	SLIST_FOREACH(ipmi_s, ipmi_sensor_list, i_list) {
 		if (ipmi_s-i_envnum == edata-sensor) {
-			ipmi_get_sensor_limits(sc, ipmi_s, limits);
+			ipmi_get_sensor_limits(sc, ipmi_s, limits, props);
 			ipmi_s-i_limits = *limits;
+			ipmi_s-i_props  = *props;
 			return;
 		}
 	}
@@ -1386,14 +1389,14 @@
 
 void
 ipmi_get_sensor_limits(struct ipmi_softc *sc, struct ipmi_sensor *psensor,
-		   sysmon_envsys_lim_t *limits)
+		   sysmon_envsys_lim_t *limits, uint32_t *props)
 {
 	struct sdrtype1	*s1 = (struct sdrtype1 *)psensor-i_sdr;
 	bool failure;
 	int	rxlen;
 	uint8_t	data[32];
 
-	limits-sel_flags = 0;
+	*props = 0;
 	data[0] = psensor-i_num;
 	mutex_enter(sc-sc_cmd_mtx);
 	failure =
@@ -1409,27 +1412,27 @@
 
 	if (data[0]  0x20  data[6] != 0xff) {
 		limits-sel_critmax = ipmi_convert_sensor(data[6], psensor);
-		limits-sel_flags |= PROP_CRITMAX;
+		*props |= PROP_CRITMAX;
 	}
 	if (data[0]  0x10  data[5] != 0xff) {
 		limits-sel_critmax = ipmi_convert_sensor(data[5], psensor);
-		limits-sel_flags |= PROP_CRITMAX;
+		*props |= PROP_CRITMAX;
 	}
 	if (data[0]  0x08  data[4] != 0xff) {
 		limits-sel_warnmax = ipmi_convert_sensor(data[4], psensor);
-		limits-sel_flags |= PROP_WARNMAX;
+		*props |= PROP_WARNMAX;
 	}
 	if (data[0]  0x04  data[3] != 0x00) {
 		limits-sel_critmin = ipmi_convert_sensor(data[3], psensor);
-		limits-sel_flags |= PROP_CRITMIN;
+		*props |= PROP_CRITMIN;
 	}
 	if (data[0]  0x02  data[2] != 0x00) {
 		limits-sel_critmin = ipmi_convert_sensor(data[2], psensor);
-		limits-sel_flags |= PROP_CRITMIN;
+		*props |= PROP_CRITMIN;
 	}
 	if (data[0]  0x01  data[1] != 0x00) {
 		limits-sel_warnmin = ipmi_convert_sensor(data[1], psensor);
-		limits-sel_flags |= PROP_WARNMIN;
+		*props |= PROP_WARNMIN;
 	}
 	return;
 }
@@ -1449,19 +1452,19 @@
 	case IPMI_SENSOR_TYPE_TEMP:
 	case IPMI_SENSOR_TYPE_VOLT:
 	case IPMI_SENSOR_TYPE_FAN:
-		if (psensor-i_limits.sel_flags  PROP_CRITMAX 
+		if (psensor-i_props  PROP_CRITMAX 
 		edata-value_cur  psensor-i_limits.sel_critmax)
 			return ENVSYS_SCRITOVER;
 
-		if (psensor-i_limits.sel_flags  PROP_WARNMAX 
+		if (psensor-i_props  PROP_WARNMAX 
 		edata-value_cur  psensor-i_limits.sel_warnmax)
 			return ENVSYS_SWARNOVER;
 
-		if 

CVS commit: src/sys/dev/sysmon

2010-02-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 14 23:30:52 UTC 2010

Modified Files:
src/sys/dev/sysmon: sysmon_envsys_events.c

Log Message:
Replace large amount of replicated code with a macro to improve readability.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/sysmon/sysmon_envsys_events.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/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.82 src/sys/dev/sysmon/sysmon_envsys_events.c:1.83
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.82	Sun Feb 14 23:06:02 2010
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Sun Feb 14 23:30:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.82 2010/02/14 23:06:02 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.83 2010/02/14 23:30:52 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.82 2010/02/14 23:06:02 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.83 2010/02/14 23:30:52 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -218,126 +218,39 @@
 	/*
 	 * Limit operation requested.
 	 */
-	if (props  PROP_CRITMAX) {
-		objkey = critical-max;
-		obj = prop_dictionary_get(sdict, objkey);
-		if (obj  prop_object_type(obj) != PROP_TYPE_NUMBER) {
-			DPRINTF((%s: (%s) %s object not TYPE_NUMBER\n,
-			__func__, sme-sme_name, objkey));
-			error = ENOTSUP;
-		} else {
-			edata-limits.sel_critmax = lims-sel_critmax;
-			error = sme_sensor_upint32(sdict, objkey,
-		   lims-sel_critmax);
-			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
-			(%s updated)\n, __func__, sme-sme_name,
-			edata-desc, crittype, objkey));
-		}
-		if (error  error != EEXIST)
-			goto out;
-		edata-upropset |= PROP_CRITMAX;
-	}
-
-	if (props  PROP_WARNMAX) {
-		objkey = warning-max;
-		obj = prop_dictionary_get(sdict, objkey);
-		if (obj  prop_object_type(obj) != PROP_TYPE_NUMBER) {
-			DPRINTF((%s: (%s) %s object not TYPE_NUMBER\n,
-			__func__, sme-sme_name, objkey));
-			error = ENOTSUP;
-		} else {
-			edata-limits.sel_warnmax = lims-sel_warnmax;
-			error = sme_sensor_upint32(sdict, objkey,
-		   lims-sel_warnmax);
-			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
-			(%s updated)\n, __func__, sme-sme_name,
-			edata-desc, crittype, objkey));
-		}
-		if (error  error != EEXIST)
-			goto out;
-		edata-upropset |= PROP_WARNMAX;
-	}
-
-	if (props  PROP_WARNMIN) {
-		objkey = warning-min;
-		obj = prop_dictionary_get(sdict, objkey);
-		if (obj  prop_object_type(obj) != PROP_TYPE_NUMBER) {
-			DPRINTF((%s: (%s) %s object not TYPE_NUMBER\n,
-			__func__, sme-sme_name, objkey));
-			error = ENOTSUP;
-		} else {
-			edata-limits.sel_warnmin = lims-sel_warnmin;
-			error = sme_sensor_upint32(sdict, objkey,
-		   lims-sel_warnmin);
-			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
-			(%s updated)\n, __func__, sme-sme_name,
-			edata-desc, crittype, objkey));
-		}
-		if (error  error != EEXIST)
-			goto out;
-		edata-upropset |= PROP_WARNMIN;
-	}
-
-	if (props  PROP_CRITMIN) {
-		objkey = critical-min;
-		obj = prop_dictionary_get(sdict, objkey);
-		if (obj  prop_object_type(obj) != PROP_TYPE_NUMBER) {
-			DPRINTF((%s: (%s) %s object not TYPE_NUMBER\n,
-			__func__, sme-sme_name, objkey));
-			error = ENOTSUP;
-		} else {
-			edata-limits.sel_critmin = lims-sel_critmin;
-			error = sme_sensor_upint32(sdict, objkey,
-		   lims-sel_critmin);
-			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
-			(%s updated)\n, __func__, sme-sme_name,
-			edata-desc, crittype, objkey));
-		}
-		if (error  error != EEXIST)
-			goto out;
-		edata-upropset |= PROP_CRITMIN;
-	}
-
-	if (props  PROP_BATTWARN) {
-		objkey = warning-capacity;
-		obj = prop_dictionary_get(sdict, objkey);
-		if (obj  prop_object_type(obj) != PROP_TYPE_NUMBER) {
-			DPRINTF((%s: (%s) %s object not TYPE_NUMBER\n,
-			__func__, sme-sme_name, objkey));
-			error = ENOTSUP;
-		} else {
-			edata-limits.sel_warnmin = lims-sel_warnmin;
-			error = sme_sensor_upint32(sdict, objkey,
-		   lims-sel_warnmin);
-			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
-			(%s updated)\n, __func__, sme-sme_name,
-			edata-desc, crittype, objkey));
-		}
-		if (error  error != EEXIST)
-			goto out;
-		edata-upropset |= PROP_BATTWARN;
-	}
-
-	if (props  PROP_BATTCAP) {
-		objkey = critical-capacity;
-		obj = prop_dictionary_get(sdict, objkey);
-		if (obj  prop_object_type(obj) != PROP_TYPE_NUMBER) {
-			DPRINTF((%s: (%s) %s object not TYPE_NUMBER\n,
-			__func__, sme-sme_name, objkey));
-			error = ENOTSUP;
-		} else {
-			edata-limits.sel_critmin = lims-sel_critmin;
-			error = sme_sensor_upint32(sdict, objkey,
-		   lims-sel_critmin);
-			DPRINTF((%s: (%s) event [sensor=%s 

CVS commit: [netbsd-5-0] src/external/bsd/fetch/dist/libfetch

2010-02-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 15 00:47:56 UTC 2010

Modified Files:
src/external/bsd/fetch/dist/libfetch [netbsd-5-0]: common.c common.h
errlist.sh fetch.3 fetch.c fetch.cat3 fetch.h file.c ftp.c
ftp.errors http.c http.errors

Log Message:
Apply patch (requested by joerg in ticket #1294):
Update libfetch to 2.30.
Changes:
libfetch-2.25:
- address a number of lint warnings
- fix strict-alignment issues for GCC 4.4
- fix a bug in the line reading optimisation
- do not reuse a FTP connection if there is an active transfer on it

libfetch-2.26:
- Add support to aggressively cache directory listenings; useful for
  HTTP
- Avoid leaking memory in error cases. From Xavier from Arch Linux.

libfetch-2.30:
- Revamped connection cache, allowing more than one active session
- HTTP keep-alive support


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.8.1 -r1.1.1.2.8.2 \
src/external/bsd/fetch/dist/libfetch/common.c \
src/external/bsd/fetch/dist/libfetch/common.h \
src/external/bsd/fetch/dist/libfetch/errlist.sh \
src/external/bsd/fetch/dist/libfetch/fetch.h \
src/external/bsd/fetch/dist/libfetch/file.c \
src/external/bsd/fetch/dist/libfetch/ftp.errors \
src/external/bsd/fetch/dist/libfetch/http.c \
src/external/bsd/fetch/dist/libfetch/http.errors
cvs rdiff -u -r1.1.1.3.6.1 -r1.1.1.3.6.2 \
src/external/bsd/fetch/dist/libfetch/fetch.3 \
src/external/bsd/fetch/dist/libfetch/ftp.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.2 \
src/external/bsd/fetch/dist/libfetch/fetch.c
cvs rdiff -u -r1.1.1.2.6.1 -r1.1.1.2.6.2 \
src/external/bsd/fetch/dist/libfetch/fetch.cat3

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

Modified files:

Index: src/external/bsd/fetch/dist/libfetch/common.c
diff -u src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.2.8.1 src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.2.8.2
--- src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.2.8.1	Sat May 30 15:58:17 2009
+++ src/external/bsd/fetch/dist/libfetch/common.c	Mon Feb 15 00:47:55 2010
@@ -1,7 +1,7 @@
-/*	$NetBSD: common.c,v 1.1.1.2.8.1 2009/05/30 15:58:17 snj Exp $	*/
+/*	$NetBSD: common.c,v 1.1.1.2.8.2 2010/02/15 00:47:55 snj Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
- * Copyright (c) 2008 Joerg Sonnenberger jo...@netbsd.org
+ * Copyright (c) 2008, 2010 Joerg Sonnenberger jo...@netbsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -62,12 +62,13 @@
 #include string.h
 #include unistd.h
 
+#ifndef MSG_NOSIGNAL
+#include signal.h
+#endif
+
 #include fetch.h
 #include common.h
 
-#define DECONST(x,y) ((x)(uintptr_t)(y))
-
-
 /*** Local data **/
 
 /*
@@ -83,10 +84,6 @@
 	{ -1,		FETCH_UNKNOWN,	Unknown resolver error }
 };
 
-/* End-of-Line */
-static const char ENDL[2] = \r\n;
-
-
 /*** Error-reporting functions ***/
 
 /*
@@ -234,22 +231,10 @@
 	/* allocate and fill connection structure */
 	if ((conn = calloc(1, sizeof(*conn))) == NULL)
 		return (NULL);
+	conn-cache_url = NULL;
 	conn-next_buf = NULL;
 	conn-next_len = 0;
 	conn-sd = sd;
-	++conn-ref;
-	return (conn);
-}
-
-
-/*
- * Bump a connection's reference count.
- */
-conn_t *
-fetch_ref(conn_t *conn)
-{
-
-	++conn-ref;
 	return (conn);
 }
 
@@ -261,17 +246,17 @@
 fetch_bind(int sd, int af, const char *addr)
 {
 	struct addrinfo hints, *res, *res0;
-	int error;
 
 	memset(hints, 0, sizeof(hints));
 	hints.ai_family = af;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = 0;
-	if ((error = getaddrinfo(addr, NULL, hints, res0)) != 0)
+	if (getaddrinfo(addr, NULL, hints, res0))
 		return (-1);
-	for (res = res0; res; res = res-ai_next)
+	for (res = res0; res; res = res-ai_next) {
 		if (bind(sd, res-ai_addr, res-ai_addrlen) == 0)
 			return (0);
+	}
 	return (-1);
 }
 
@@ -280,7 +265,7 @@
  * Establish a TCP connection to the specified port on the specified host.
  */
 conn_t *
-fetch_connect(const char *host, int port, int af, int verbose)
+fetch_connect(struct url *url, int af, int verbose)
 {
 	conn_t *conn;
 	char pbuf[10];
@@ -289,22 +274,22 @@
 	int sd, error;
 
 	if (verbose)
-		fetch_info(looking up %s, host);
+		fetch_info(looking up %s, url-host);
 
 	/* look up host name and set up socket address structure */
-	snprintf(pbuf, sizeof(pbuf), %d, port);
+	snprintf(pbuf, sizeof(pbuf), %d, url-port);
 	memset(hints, 0, sizeof(hints));
 	hints.ai_family = af;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = 0;
-	if ((error = getaddrinfo(host, pbuf, hints, res0)) != 0) {
+	if ((error = getaddrinfo(url-host, pbuf, hints, res0)) != 0) {
 		netdb_seterr(error);
 		return (NULL);
 	}
 	bindaddr = getenv(FETCH_BIND_ADDRESS);
 
 	if (verbose)
-		fetch_info(connecting to %s:%d, host, port);
+		fetch_info(connecting to 

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

2010-02-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 15 01:20:27 UTC 2010

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

Log Message:
Tickets 1294 and 1298.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/doc/CHANGES-5.0.3

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

Modified files:

Index: src/doc/CHANGES-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.2 src/doc/CHANGES-5.0.3:1.1.2.3
--- src/doc/CHANGES-5.0.3:1.1.2.2	Sun Feb 14 14:05:07 2010
+++ src/doc/CHANGES-5.0.3	Mon Feb 15 01:20:27 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.2 2010/02/14 14:05:07 bouyer Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.3 2010/02/15 01:20:27 snj Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -13,3 +13,115 @@
 
 	Bump the size of the pmax instkernel ramdisk to 2200k.
 	[snj, ticket #1305]
+
+external/bsd/fetch/dist/libfetch/common.c	patch
+external/bsd/fetch/dist/libfetch/common.h	patch
+external/bsd/fetch/dist/libfetch/errlist.sh	patch
+external/bsd/fetch/dist/libfetch/fetch.3	patch
+external/bsd/fetch/dist/libfetch/fetch.c	patch
+external/bsd/fetch/dist/libfetch/fetch.cat3	patch
+external/bsd/fetch/dist/libfetch/fetch.h	patch
+external/bsd/fetch/dist/libfetch/file.c		patch
+external/bsd/fetch/dist/libfetch/ftp.c		patch
+external/bsd/fetch/dist/libfetch/ftp.errors	patch
+external/bsd/fetch/dist/libfetch/http.c		patch
+external/bsd/fetch/dist/libfetch/http.errors	patch
+
+	Update libfetch to 2.30.
+	libfetch-2.25:
+	- address a number of lint warnings
+	- fix strict-alignment issues for GCC 4.4
+	- fix a bug in the line reading optimisation
+	- do not reuse a FTP connection if there is an active transfer on it
+
+	libfetch-2.26:
+	- Add support to aggressively cache directory listenings, useful for
+	  HTTP
+	- Avoid leaking memory in error cases. From Xavier from Arch Linux.
+
+	libfetch-2.30:
+	- Revamped connection cache, allowing more than one active session
+	- HTTP keep-alive support
+	[joerg, ticket #1294]
+
+external/bsd/pkg_install/dist/add/add.h			patch
+external/bsd/pkg_install/dist/add/main.c		patch
+external/bsd/pkg_install/dist/add/perform.c		patch
+external/bsd/pkg_install/dist/add/pkg_add.1		patch
+external/bsd/pkg_install/dist/admin/audit.c		patch
+external/bsd/pkg_install/dist/admin/check.c		patch
+external/bsd/pkg_install/dist/admin/main.c		patch
+external/bsd/pkg_install/dist/admin/pkg_admin.1		patch
+external/bsd/pkg_install/dist/bpm/bpm.1			patch
+external/bsd/pkg_install/dist/bpm/bpm.sh.in		patch
+external/bsd/pkg_install/dist/create/build.c		patch
+external/bsd/pkg_install/dist/create/create.h		patch
+external/bsd/pkg_install/dist/create/main.c		patch
+external/bsd/pkg_install/dist/create/perform.c		patch
+external/bsd/pkg_install/dist/create/pkg_create.1	patch
+external/bsd/pkg_install/dist/create/pl.c		patch
+external/bsd/pkg_install/dist/delete/pkg_delete.1	patch
+external/bsd/pkg_install/dist/delete/pkg_delete.1.in	patch
+external/bsd/pkg_install/dist/delete/pkg_delete.c	patch
+external/bsd/pkg_install/dist/info/info.h		patch
+external/bsd/pkg_install/dist/info/main.c		patch
+external/bsd/pkg_install/dist/info/perform.c		patch
+external/bsd/pkg_install/dist/info/pkg_info.1		patch
+external/bsd/pkg_install/dist/info/show.c		patch
+external/bsd/pkg_install/dist/lib/automatic.c		patch
+external/bsd/pkg_install/dist/lib/conflicts.c		patch
+external/bsd/pkg_install/dist/lib/decompress.c		patch
+external/bsd/pkg_install/dist/lib/defs.h		patch
+external/bsd/pkg_install/dist/lib/dewey.c		patch
+external/bsd/pkg_install/dist/lib/fexec.c		patch
+external/bsd/pkg_install/dist/lib/file.c		patch
+external/bsd/pkg_install/dist/lib/global.c		patch
+external/bsd/pkg_install/dist/lib/gpgsig.c		patch
+external/bsd/pkg_install/dist/lib/iterate.c		patch
+external/bsd/pkg_install/dist/lib/lib.h			patch
+external/bsd/pkg_install/dist/lib/license.c		patch
+external/bsd/pkg_install/dist/lib/lpkg.c		patch
+external/bsd/pkg_install/dist/lib/opattern.c		patch
+external/bsd/pkg_install/dist/lib/parse-config.c	patch
+external/bsd/pkg_install/dist/lib/pkcs7.c		patch
+external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in	patch
+external/bsd/pkg_install/dist/lib/pkg_io.c		patch
+external/bsd/pkg_install/dist/lib/pkg_signature.c	patch
+external/bsd/pkg_install/dist/lib/pkg_summary.5		patch
+external/bsd/pkg_install/dist/lib/pkgdb.c		patch
+external/bsd/pkg_install/dist/lib/plist.c		patch
+external/bsd/pkg_install/dist/lib/remove.c		patch
+external/bsd/pkg_install/dist/lib/str.c			patch
+external/bsd/pkg_install/dist/lib/var.c			patch
+external/bsd/pkg_install/dist/lib/version.c		patch
+external/bsd/pkg_install/dist/lib/version.h		patch
+external/bsd/pkg_install/dist/lib/vulnerabilities-file.c patch
+external/bsd/pkg_install/dist/lib/xwrapper.c		patch
+external/bsd/pkg_install/dist/x509/pkgsrc.cnf		patch
+external/bsd/pkg_install/dist/x509/pkgsrc.sh		patch
+

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

2010-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Feb 15 03:09:59 UTC 2010

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: pcb.h

Log Message:
Put pcb_context first since it has the most interesting data (easier to
dump in debugger).


To generate a diff of this commit:
cvs rdiff -u -r1.20.62.2 -r1.20.62.3 src/sys/arch/mips/include/pcb.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/mips/include/pcb.h
diff -u src/sys/arch/mips/include/pcb.h:1.20.62.2 src/sys/arch/mips/include/pcb.h:1.20.62.3
--- src/sys/arch/mips/include/pcb.h:1.20.62.2	Mon Sep  7 21:28:33 2009
+++ src/sys/arch/mips/include/pcb.h	Mon Feb 15 03:09:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcb.h,v 1.20.62.2 2009/09/07 21:28:33 matt Exp $	*/
+/*	$NetBSD: pcb.h,v 1.20.62.3 2010/02/15 03:09:59 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -85,12 +85,11 @@
 /*
  * MIPS process control block
  */
-struct pcb
-{
-	struct fpreg pcb_fpregs;	/* saved floating point registers */
+struct pcb {
 	label_t pcb_context;		/* kernel context for resume */
 	void *	pcb_onfault;		/* for copyin/copyout faults */
 	uint32_t pcb_ppl;		/* previous priority level */
+	struct fpreg pcb_fpregs;	/* saved floating point registers */
 };
 
 /*



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

2010-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Feb 15 03:11:58 UTC 2010

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: lock.h

Log Message:
In SIMPLELOCK_LOCKED_P check against != UNLOCKED instead of == LOCKED.
This is so the compiler can emit a bnez instead of loading 1 into a register
and then doing beq.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.16.1 src/sys/arch/mips/include/lock.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/mips/include/lock.h
diff -u src/sys/arch/mips/include/lock.h:1.16 src/sys/arch/mips/include/lock.h:1.16.16.1
--- src/sys/arch/mips/include/lock.h:1.16	Mon Apr 28 20:23:28 2008
+++ src/sys/arch/mips/include/lock.h	Mon Feb 15 03:11:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.16 2008/04/28 20:23:28 martin Exp $	*/
+/*	$NetBSD: lock.h,v 1.16.16.1 2010/02/15 03:11:58 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
 static __inline int
 __SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr)
 {
-	return *__ptr == __SIMPLELOCK_LOCKED;
+	return *__ptr != __SIMPLELOCK_UNLOCKED;
 }
 
 static __inline int



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

2010-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Feb 15 03:12:17 UTC 2010

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: asm.h

Log Message:
Fix a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.40.38.11 -r1.40.38.12 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.40.38.11 src/sys/arch/mips/include/asm.h:1.40.38.12
--- src/sys/arch/mips/include/asm.h:1.40.38.11	Sat Jan 16 20:56:33 2010
+++ src/sys/arch/mips/include/asm.h	Mon Feb 15 03:12:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.40.38.11 2010/01/16 20:56:33 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.40.38.12 2010/02/15 03:12:17 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -305,8 +305,8 @@
 
 /*
  *  standard callframe {
- *	register_t cf_pad[N];		o32/64 (N=0), n32 (N=1) n64 (N=1)
  *  	register_t cf_args[4];		arg0 - arg3 (only on o32 and o64)
+ *	register_t cf_pad[N];		o32/64 (N=0), n32 (N=1) n64 (N=1)
  *  	register_t cf_gp;		global pointer (only on n32 and n64)
  *  	register_t cf_sp;		frame pointer
  *  	register_t cf_ra;		return address



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

2010-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Feb 15 07:37:37 UTC 2010

Modified Files:
src/sys/arch/evbmips/alchemy [matt-nb5-mips64]: mach_intr.c
src/sys/arch/evbmips/atheros [matt-nb5-mips64]: mach_intr.c
src/sys/arch/evbmips/evbmips [matt-nb5-mips64]: interrupt.c
src/sys/arch/evbmips/include [matt-nb5-mips64]: intr.h
src/sys/arch/evbmips/malta [matt-nb5-mips64]: malta_intr.c
src/sys/arch/mips/adm5120 [matt-nb5-mips64]: adm5120_intr.c
src/sys/arch/mips/alchemy [matt-nb5-mips64]: au_icu.c
src/sys/arch/mips/alchemy/include [matt-nb5-mips64]: auvar.h
src/sys/arch/mips/atheros [matt-nb5-mips64]: ar5312_intr.c
ar5315_intr.c
src/sys/arch/mips/atheros/include [matt-nb5-mips64]: ar531xvar.h
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c

Log Message:
Adapt to the new interrupt framework for NetBSD/mips.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.18.1 src/sys/arch/evbmips/alchemy/mach_intr.c
cvs rdiff -u -r1.2 -r1.2.18.1 src/sys/arch/evbmips/atheros/mach_intr.c
cvs rdiff -u -r1.11.18.2 -r1.11.18.3 src/sys/arch/evbmips/evbmips/interrupt.c
cvs rdiff -u -r1.16.18.2 -r1.16.18.3 src/sys/arch/evbmips/include/intr.h
cvs rdiff -u -r1.19.16.2 -r1.19.16.3 src/sys/arch/evbmips/malta/malta_intr.c
cvs rdiff -u -r1.3 -r1.3.18.1 src/sys/arch/mips/adm5120/adm5120_intr.c
cvs rdiff -u -r1.23 -r1.23.18.1 src/sys/arch/mips/alchemy/au_icu.c
cvs rdiff -u -r1.9 -r1.9.64.1 src/sys/arch/mips/alchemy/include/auvar.h
cvs rdiff -u -r1.6 -r1.6.28.1 src/sys/arch/mips/atheros/ar5312_intr.c
cvs rdiff -u -r1.5 -r1.5.28.1 src/sys/arch/mips/atheros/ar5315_intr.c
cvs rdiff -u -r1.5 -r1.5.74.1 src/sys/arch/mips/atheros/include/ar531xvar.h
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/arch/mips/rmi/rmixl_intr.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/evbmips/alchemy/mach_intr.c
diff -u src/sys/arch/evbmips/alchemy/mach_intr.c:1.3 src/sys/arch/evbmips/alchemy/mach_intr.c:1.3.18.1
--- src/sys/arch/evbmips/alchemy/mach_intr.c:1.3	Mon Apr 28 20:23:17 2008
+++ src/sys/arch/evbmips/alchemy/mach_intr.c	Mon Feb 15 07:37:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mach_intr.c,v 1.3 2008/04/28 20:23:17 martin Exp $	*/
+/*	$NetBSD: mach_intr.c,v 1.3.18.1 2010/02/15 07:37:35 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mach_intr.c,v 1.3 2008/04/28 20:23:17 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: mach_intr.c,v 1.3.18.1 2010/02/15 07:37:35 matt Exp $);
 
 #include opt_ddb.h
 
@@ -63,8 +63,8 @@
 }
 
 void
-evbmips_iointr(uint32_t status, uint32_t cause, uint32_t pc, uint32_t ipending)
+evbmips_iointr(int ipl, uint32_t pc, uint32_t ipending)
 {
 
-	au_iointr(status, cause, pc, ipending);
+	au_iointr(ipl, pc, ipending);
 }

Index: src/sys/arch/evbmips/atheros/mach_intr.c
diff -u src/sys/arch/evbmips/atheros/mach_intr.c:1.2 src/sys/arch/evbmips/atheros/mach_intr.c:1.2.18.1
--- src/sys/arch/evbmips/atheros/mach_intr.c:1.2	Mon Apr 28 20:23:17 2008
+++ src/sys/arch/evbmips/atheros/mach_intr.c	Mon Feb 15 07:37:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mach_intr.c,v 1.2 2008/04/28 20:23:17 martin Exp $	*/
+/*	$NetBSD: mach_intr.c,v 1.2.18.1 2010/02/15 07:37:35 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mach_intr.c,v 1.2 2008/04/28 20:23:17 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: mach_intr.c,v 1.2.18.1 2010/02/15 07:37:35 matt Exp $);
 
 #include opt_ddb.h
 
@@ -57,8 +57,8 @@
 }
 
 void
-evbmips_iointr(uint32_t status, uint32_t cause, uint32_t pc, uint32_t ipending)
+evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
 {
 
-	ar531x_cpuintr(status, cause, pc, ipending);
+	ar531x_cpuintr(ipl, pc, ipending);
 }

Index: src/sys/arch/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.11.18.2 src/sys/arch/evbmips/evbmips/interrupt.c:1.11.18.3
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.11.18.2	Fri Feb  5 07:39:52 2010
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Mon Feb 15 07:37:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.11.18.2 2010/02/05 07:39:52 matt Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.11.18.3 2010/02/15 07:37:36 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: interrupt.c,v 1.11.18.2 2010/02/05 07:39:52 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: interrupt.c,v 1.11.18.3 2010/02/15 07:37:36 matt Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -50,38 +50,39 @@
 }
 
 void
-cpu_intr(u_int32_t status, u_int32_t cause, vaddr_t pc, u_int32_t ipending)
+cpu_intr(int ppl, vaddr_t pc, uint32_t status)
 {
-	struct clockframe cf;
-	struct cpu_info *ci;
+	struct cpu_info * const ci = curcpu();
+	

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

2010-02-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 15 07:55:33 UTC 2010

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.212 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211 src/sys/arch/arm/arm32/pmap.c:1.212
--- src/sys/arch/arm/arm32/pmap.c:1.211	Sat Jan  2 07:53:29 2010
+++ src/sys/arch/arm/arm32/pmap.c	Mon Feb 15 07:55:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211 2010/01/02 07:53:29 he Exp $	*/
+/*	$NetBSD: pmap.c,v 1.212 2010/02/15 07:55:33 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211 2010/01/02 07:53:29 he Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.212 2010/02/15 07:55:33 skrll Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -2701,7 +2701,7 @@
 
 	if (flush) {
 		/*
-		 * Note: We can't use pmap_tlb_flush{I,}D() here since that
+		 * Note: We can't use pmap_tlb_flush{I,D}() here since that
 		 * would need a subsequent call to pmap_update() to ensure
 		 * curpm-pm_cstate.cs_all is reset. Our callers are not
 		 * required to do that (see pmap(9)), so we can't modify



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

2010-02-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb 15 07:56:51 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c locore.s

Log Message:
introduce a new patch_kernel() and call it from the end of bootstrap().
use it to patch up TLB flush instructions that don't match for USI/II
and later.  we can also hopefully use this to make GENERIC.MP minimally
expensive on single CPU machines as well.

this is the last piece needed to get GENERIC/GENERIC.MP to boot on the
USIII* machines.

idea and some initial code from openbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r1.313 -r1.314 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.166 src/sys/arch/sparc64/sparc64/autoconf.c:1.167
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.166	Thu Jan 21 15:58:32 2010
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Mon Feb 15 07:56:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.166 2010/01/21 15:58:32 martin Exp $ */
+/*	$NetBSD: autoconf.c,v 1.167 2010/02/15 07:56:51 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.166 2010/01/21 15:58:32 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.167 2010/02/15 07:56:51 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -183,6 +183,7 @@
 #endif
 
 int console_node, console_instance;
+static void patch_kernel(void);
 struct genfb_colormap_callback gfb_cb;
 static void of_set_palette(void *, int, int, int, int);
 static void copyprops(struct device *busdev, int, prop_dictionary_t);
@@ -334,6 +335,65 @@
 
 	get_ncpus();
 	pmap_bootstrap(KERNBASE, bi_kend-addr);
+
+	patch_kernel();
+}
+
+/*
+ * Now that we've stopped using the prom mappings, we need to handle any
+ * text fixups.
+ *
+ * For the USIII and newer cpus, convert ASI_DCACHE_TAG into
+ * ASI_DCACHE_INVALIDATE.
+ *
+ * For the older CPUs, we need to convert a branch to a nop in
+ * cache_flush_phys().
+ */
+static void
+patch_kernel(void)
+{
+	paddr_t pa;
+	vaddr_t *pva;
+
+	if (CPU_IS_USIII_UP()) {
+		extern vaddr_t dlflush_start;
+		uint32_t insn, oinsn;
+
+		for (pva = dlflush_start; *pva; pva++) {
+			oinsn = insn = *(uint32_t *)(*pva);
+			insn = ~(ASI_DCACHE_TAG  5);
+			insn |= (ASI_DCACHE_INVALIDATE  5);
+
+			if (pmap_extract(pmap_kernel(), *pva, pa)) {
+sta(pa, ASI_PHYS_CACHED, insn);
+flush((void *)(*pva));
+#ifdef PATCH_KERNEL_DEBUG
+printf(patched %p for USIII ASI_DCACHE_INVALIDATE
+   : old insn %08x ew insn %08x\n,
+(void *)(intptr_t)*pva, oinsn, insn);
+			} else {
+printf(could not pmap_extract() to patch %p\n,
+(void *)(intptr_t)*pva);
+#endif
+			}
+		}
+	} else {
+		extern vaddr_t nop_on_us_1_start;
+
+		for (pva = nop_on_us_1_start; *pva; pva++) {
+			if (pmap_extract(pmap_kernel(), *pva, pa)) {
+sta(pa, ASI_PHYS_CACHED, 0x0100);
+flush((void *)(*pva));
+#ifdef PATCH_KERNEL_DEBUG
+printf(patched %p for USI/II cache_flush_phys\n,
+(void *)(intptr_t)*pva);
+			} else {
+printf(could not pmap_extract() to patch %p\n,
+(void *)(intptr_t)*pva);
+#endif
+			}
+		}
+	}
 }
 
 /*

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.313 src/sys/arch/sparc64/sparc64/locore.s:1.314
--- src/sys/arch/sparc64/sparc64/locore.s:1.313	Sat Feb 13 22:29:55 2010
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon Feb 15 07:56:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.313 2010/02/13 22:29:55 mrg Exp $	*/
+/*	$NetBSD: locore.s,v 1.314 2010/02/15 07:56:51 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -55,15 +55,13 @@
  *	@(#)locore.s	8.4 (Berkeley) 12/10/93
  */
 
-#ifndef CHEETAH
-#define	SPITFIRE
-#endif
 #undef	PARANOID		/* Extremely expensive consistency checks */
 #undef	NO_VCACHE		/* Map w/D$ disabled */
 #undef	TRAPSTATS		/* Count traps */
 #undef	TRAPS_USE_IG		/* Use Interrupt Globals for all traps */
 #define	HWREF			/* Track ref/mod bits in trap handlers */
 #undef	DCACHE_BUG		/* Flush D$ around ASI_PHYS accesses */
+#undef	SPITFIRE		/* Only used in DLFLUSH* now, see DCACHE_BUG */
 #undef	NO_TSB			/* Don't use TSB */
 #define	USE_BLOCK_STORE_LOAD	/* enable block load/store ops */
 #define	BB_ERRATA_1		/* writes to TICK_CMPR may fail */
@@ -195,12 +193,6 @@
 /* Give this real authority: reset the machine */
 #define NOTREACHED	sir
 
-#ifdef SPITFIRE
-#define ASI_DCACHE_TAG_OR_INV	ASI_DCACHE_TAG
-#else
-#define ASI_DCACHE_TAG_OR_INV	ASI_DCACHE_INVALIDATE
-#endif
-
 /*
  * This macro will clear out a cache line before an explicit
  * access to that location.  It's mostly used to make certain
@@ -209,6 +201,12 @@
  * It uses a register with the address to clear and a