CVS commit: src/lib/librump

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 08:50:45 UTC 2011

Modified Files:
src/lib/librump: rump.3

Log Message:
xfer rump_server(1), downgrade experimentalness level a bit


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/librump/rump.3

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

Modified files:

Index: src/lib/librump/rump.3
diff -u src/lib/librump/rump.3:1.7 src/lib/librump/rump.3:1.8
--- src/lib/librump/rump.3:1.7	Wed Feb 16 23:51:50 2011
+++ src/lib/librump/rump.3	Mon Feb 21 08:50:45 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: rump.3,v 1.7 2011/02/16 23:51:50 pooka Exp $
+.\ $NetBSD: rump.3,v 1.8 2011/02/21 08:50:45 pooka Exp $
 .\
 .\ Copyright (c) 2008-2010 Antti Kantee.  All rights reserved.
 .\
@@ -148,6 +148,7 @@
 Generally speaking, dynamically loadable components must follow
 kernel module boundaries.
 .Sh SEE ALSO
+.Xr rump_server 1 ,
 .Xr p2k 3 ,
 .Xr rump_etfs 3 ,
 .Xr rump_lwproc 3 ,
@@ -199,5 +200,4 @@
 .An Antti Kantee Aq po...@iki.fi
 .Sh NOTE
 .Nm
-is highly experimental and may change in header location, library
-name, API and/or ABI without warning.
+is still somewhat experimental.



CVS commit: src/sys/ufs/ffs

2011-02-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 21 09:29:21 UTC 2011

Modified Files:
src/sys/ufs/ffs: ffs_snapshot.c

Log Message:
Change the snapshot lock:
- No need to take the snapshot lock while the file system is suspended.
- Allow ffs_copyonwrite() one level of recursion with snapshots locked.
- Do the block address lookup with snapshots locked.
- Take the snapshot lock while removing a snapshot from the list.

While hunting deadlocks change the transaction scope for ffs_snapremove().
We could deadlock from UFS_WAPBL_BEGIN() with a buffer held.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/ufs/ffs/ffs_snapshot.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/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.105 src/sys/ufs/ffs/ffs_snapshot.c:1.106
--- src/sys/ufs/ffs/ffs_snapshot.c:1.105	Fri Feb 18 14:48:54 2011
+++ src/sys/ufs/ffs/ffs_snapshot.c	Mon Feb 21 09:29:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.105 2011/02/18 14:48:54 bouyer Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.106 2011/02/21 09:29:21 hannken Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.105 2011/02/18 14:48:54 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.106 2011/02/21 09:29:21 hannken Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -79,6 +79,7 @@
 struct snap_info {
 	kmutex_t si_lock;			/* Lock this snapinfo */
 	kmutex_t si_snaplock;			/* Snapshot vnode common lock */
+	lwp_t *si_owner;			/* Sanplock owner */
 	TAILQ_HEAD(inodelst, inode) si_snapshots; /* List of active snapshots */
 	daddr_t *si_snapblklist;		/* Snapshot block hints list */
 	uint32_t si_gen;			/* Incremented on change */
@@ -140,6 +141,7 @@
 	TAILQ_INIT(si-si_snapshots);
 	mutex_init(si-si_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(si-si_snaplock, MUTEX_DEFAULT, IPL_NONE);
+	si-si_owner = NULL;
 	si-si_gen = 0;
 	si-si_snapblklist = NULL;
 
@@ -173,7 +175,6 @@
 }
 #else /* defined(FFS_NO_SNAPSHOT) */
 	bool suspended = false;
-	bool snapshot_locked = false;
 	int error, redo = 0, snaploc;
 	void *sbbuf = NULL;
 	daddr_t *snaplist = NULL, snaplistsize = 0;
@@ -269,11 +270,6 @@
 	if (error)
 		goto out;
 	/*
-	 * Acquire the snapshot lock.
-	 */
-	mutex_enter(si-si_snaplock);
-	snapshot_locked = true;
-	/*
 	 * Record snapshot inode. Since this is the newest snapshot,
 	 * it must be placed at the end of the list.
 	 */
@@ -376,8 +372,6 @@
 	si-si_gen++;
 	mutex_exit(si-si_lock);
 
-	if (snapshot_locked)
-		mutex_exit(si-si_snaplock);
 	if (suspended) {
 		vfs_resume(vp-v_mount);
 #ifdef DEBUG
@@ -1354,8 +1348,7 @@
 	struct snap_info *si;
 	struct lwp *l = curlwp;
 	daddr_t numblks, blkno, dblk;
-	int error, loc, last, n;
-	const int wbreak = blocks_in_journal(fs)/8;
+	int error, loc, last;
 
 	si = VFSTOUFS(mp)-um_snapinfo;
 	/*
@@ -1365,6 +1358,7 @@
 	 *
 	 * Clear copy-on-write flag if last snapshot.
 	 */
+	mutex_enter(si-si_snaplock);
 	mutex_enter(si-si_lock);
 	if (is_active_snapshot(si, ip)) {
 		TAILQ_REMOVE(si-si_snapshots, ip, i_nextsnap);
@@ -1374,18 +1368,22 @@
 			si-si_snapblklist = xp-i_snapblklist;
 			si-si_gen++;
 			mutex_exit(si-si_lock);
+			mutex_exit(si-si_snaplock);
 		} else {
 			si-si_snapblklist = 0;
 			si-si_gen++;
 			mutex_exit(si-si_lock);
+			mutex_exit(si-si_snaplock);
 			fscow_disestablish(mp, ffs_copyonwrite, devvp);
 		}
 		if (ip-i_snapblklist != NULL) {
 			free(ip-i_snapblklist, M_UFSMNT);
 			ip-i_snapblklist = NULL;
 		}
-	} else
+	} else {
 		mutex_exit(si-si_lock);
+		mutex_exit(si-si_snaplock);
+	}
 	/*
 	 * Clear all BLK_NOCOPY fields. Pass any block claims to other
 	 * snapshots that want them (see ffs_snapblkfree below).
@@ -1402,7 +1400,7 @@
 		}
 	}
 	numblks = howmany(ip-i_size, fs-fs_bsize);
-	for (blkno = NDADDR, n = 0; blkno  numblks; blkno += NINDIR(fs)) {
+	for (blkno = NDADDR; blkno  numblks; blkno += NINDIR(fs)) {
 		error = ffs_balloc(vp, lblktosize(fs, (off_t)blkno),
 		fs-fs_bsize, l-l_cred, B_METAONLY, ibp);
 		if (error)
@@ -1412,12 +1410,6 @@
 		else
 			last = fs-fs_size - blkno;
 		for (loc = 0; loc  last; loc++) {
-			if (wbreak  0  (++n % wbreak) == 0) {
-UFS_WAPBL_END(mp);
-error = UFS_WAPBL_BEGIN(mp);
-if (error)
-	panic(UFS_WAPBL_BEGIN failed);
-			}
 			dblk = idb_get(ip, ibp-b_data, loc);
 			if (dblk == BLK_NOCOPY || dblk == BLK_SNAP)
 idb_assign(ip, ibp-b_data, loc, 0);
@@ -1429,6 +1421,9 @@
 			}
 		}
 		bawrite(ibp);
+		UFS_WAPBL_END(mp);
+		error = UFS_WAPBL_BEGIN(mp);
+		KASSERT(error == 0);
 	}
 	/*
 	 * Clear snapshot flag and drop reference.
@@ -1469,25 +1464,18 @@
 	daddr_t lbn;
 	daddr_t blkno;
 	uint32_t gen;
-	int indiroff = 0, snapshot_locked = 0, error = 0, claimedblk = 0;
+	int indiroff = 0, error = 0, claimedblk = 

CVS commit: src/sys/kern

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 09:53:06 UTC 2011

Modified Files:
src/sys/kern: kern_module.c

Log Message:
Don't allow disabling a builtin secmodel: too many questionable
security implications.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/kern/kern_module.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_module.c
diff -u src/sys/kern/kern_module.c:1.75 src/sys/kern/kern_module.c:1.76
--- src/sys/kern/kern_module.c:1.75	Fri Jan 14 10:18:21 2011
+++ src/sys/kern/kern_module.c	Mon Feb 21 09:53:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.75 2011/01/14 10:18:21 martin Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.76 2011/02/21 09:53:06 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.75 2011/01/14 10:18:21 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.76 2011/02/21 09:53:06 pooka Exp $);
 
 #define _MODULE_INTERNAL
 
@@ -1129,6 +1129,15 @@
 		module_print(module `%s' busy, name);
 		return EBUSY;
 	}
+
+	/*
+	 * Builtin secmodels are there to stay.
+	 */
+	if (mod-mod_source == MODULE_SOURCE_KERNEL 
+	mod-mod_info-mi_class == MODULE_CLASS_SECMODEL) {
+		return EPERM;
+	}
+
 	prev_active = module_active;
 	module_active = mod;
 	error = (*mod-mod_info-mi_modcmd)(MODULE_CMD_FINI, NULL);



CVS commit: src/share/man/man4

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 11:08:21 UTC 2011

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

Log Message:
add AR9285 support


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man4/ath.4

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

Modified files:

Index: src/share/man/man4/ath.4
diff -u src/share/man/man4/ath.4:1.29 src/share/man/man4/ath.4:1.30
--- src/share/man/man4/ath.4:1.29	Sun Feb 20 11:22:34 2011
+++ src/share/man/man4/ath.4	Mon Feb 21 11:08:21 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: ath.4,v 1.29 2011/02/20 11:22:34 jmcneill Exp $
+.\ $NetBSD: ath.4,v 1.30 2011/02/21 11:08:21 cegger Exp $
 .\
 .\ Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
 .\ All rights reserved.
@@ -41,7 +41,7 @@
 .\ $FreeBSD: /repoman/r/ncvs/src/share/man/man4/ath.4,v 1.16 2004/02/18 08:30:08 maxim Exp $
 .\ parts from $FreeBSD: /repoman/r/ncvs/src/share/man/man4/ath_hal.4,v 1.7 2004/01/07 20:49:51 blackend Exp $
 .\
-.Dd February 20, 2011
+.Dd February 21, 2011
 .Dt ATH 4
 .Os
 .Sh NAME
@@ -55,7 +55,7 @@
 .Nm
 driver provides support for wireless network adapters based on
 the Atheros AR2413, AR2417, AR5210, AR5211, AR5212, AR5213, AR5413,
-AR5416, AR5424, AR9160, and AR9280 chips.
+AR5416, AR5424, AR9160, AR9280, and AR9285 chips.
 Chip-specific support is provided by the Atheros Hardware Access Layer
 (HAL).
 .Pp



CVS commit: src/doc

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 11:09:16 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
ath(4): Add support for AR9285 devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1510 -r1.1511 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.1510 src/doc/CHANGES:1.1511
--- src/doc/CHANGES:1.1510	Sun Feb 20 17:09:31 2011
+++ src/doc/CHANGES	Mon Feb 21 11:09:16 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1510 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1511 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -865,3 +865,4 @@
 		more efficient, added fast software interrupts and kernel
 		preemption.  Added support for RMI (NetLogic) XLS/XLR models.
 		Major clean up for MIPS port. [matt 20110220]
+	ath(4): Add support for AR9285 devices. [cegger 20110221]



CVS commit: src/sys/modules/ath_hal

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 11:16:47 UTC 2011

Modified Files:
src/sys/modules/ath_hal: Makefile Makefile.inc

Log Message:
catch up to AR9285 changes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/ath_hal/Makefile \
src/sys/modules/ath_hal/Makefile.inc

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

Modified files:

Index: src/sys/modules/ath_hal/Makefile
diff -u src/sys/modules/ath_hal/Makefile:1.2 src/sys/modules/ath_hal/Makefile:1.3
--- src/sys/modules/ath_hal/Makefile:1.2	Sun Feb 20 11:26:33 2011
+++ src/sys/modules/ath_hal/Makefile	Mon Feb 21 11:16:47 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/02/20 11:26:33 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.3 2011/02/21 11:16:47 cegger Exp $
 
 .include ../Makefile.inc
 
@@ -89,7 +89,10 @@
 	ar5416_xmit.c \
 	ar9160_attach.c \
 	ar9280.c \
-	ar9280_attach.c
+	ar9280_attach.c \
+	ar9285.c \
+	ar9285_attach.c \
+	ar9285_reset.c
 
 WARNS=		3
 
Index: src/sys/modules/ath_hal/Makefile.inc
diff -u src/sys/modules/ath_hal/Makefile.inc:1.2 src/sys/modules/ath_hal/Makefile.inc:1.3
--- src/sys/modules/ath_hal/Makefile.inc:1.2	Sun Feb 20 11:26:34 2011
+++ src/sys/modules/ath_hal/Makefile.inc	Mon Feb 21 11:16:47 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile.inc,v 1.2 2011/02/20 11:26:34 jmcneill Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2011/02/21 11:16:47 cegger Exp $
 
 CPPFLAGS+=	-I${S}/external/isc/atheros_hal/dist
 CPPFLAGS+=	-I${S}/external/isc/atheros_hal/ic
 CPPFLAGS+=	-DATHHAL_AR5210 -DATHHAL_AR5211 -DATHHAL_AR5212 \
 		-DATHHAL_AR5311 -DATHHAL_AR5312 -DATHHAL_AR5416 \
-		-DATHHAL_AR9280
+		-DATHHAL_AR9280 -DATHHAL_AR9285
 CPPFLAGS+=	-DATHHAL_RF2316 -DATHHAL_RF2317 -DATHHAL_RF2413 \
 		-DATHHAL_RF2425 -DATHHAL_RF5111 -DATHHAL_RF5112 \
 		-DATHHAL_RF5413



CVS commit: src/sys/kern

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 11:29:53 UTC 2011

Modified Files:
src/sys/kern: makesyscalls.sh

Log Message:
Make sure we don't expose any errno set as a side-effect of us
executing the system call.  Some software ignores the return value
and looks only at errno.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/kern/makesyscalls.sh

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/makesyscalls.sh
diff -u src/sys/kern/makesyscalls.sh:1.109 src/sys/kern/makesyscalls.sh:1.110
--- src/sys/kern/makesyscalls.sh:1.109	Mon Jan 17 16:16:54 2011
+++ src/sys/kern/makesyscalls.sh	Mon Feb 21 11:29:53 2011
@@ -1,5 +1,5 @@
 #! /bin/sh -
-#	$NetBSD: makesyscalls.sh,v 1.109 2011/01/17 16:16:54 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.110 2011/02/21 11:29:53 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -808,12 +808,10 @@
 	printf(\terror = rsys_syscall(%s%s%s,  \
 	%s, %s, rval);\n, constprefix, compatwrap_, funcalias, \
 	argarg, argsize)  rumpcalls
-	printf(\tif (error) {\n\t\trval[0] = -1;\n)  rumpcalls
+	printf(\trsys_seterrno(error);\n)  rumpcalls
+	printf(\tif (error) {\n\t\trval[0] = -1;\n\t}\n)  rumpcalls
 	if (returntype != void) {
-		printf(\t\trsys_seterrno(error);\n\t}\n)  rumpcalls
 		printf(\treturn rval[0];\n)  rumpcalls
-	} else {
-		printf(\t}\n)  rumpcalls
 	}
 	printf(}\n)  rumpcalls
 	printf(rsys_alias(%s%s,rump_enosys)\n, \



CVS commit: src/sys/rump

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 11:32:26 UTC 2011

Modified Files:
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c

Log Message:
commit regen for int - pid_t fix


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.61 -r1.62 src/sys/rump/librump/rumpkern/rump_syscalls.c

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

Modified files:

Index: src/sys/rump/include/rump/rump_syscalls.h
diff -u src/sys/rump/include/rump/rump_syscalls.h:1.39 src/sys/rump/include/rump/rump_syscalls.h:1.40
--- src/sys/rump/include/rump/rump_syscalls.h:1.39	Mon Jan 17 18:25:17 2011
+++ src/sys/rump/include/rump/rump_syscalls.h	Mon Feb 21 11:32:26 2011
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_syscalls.h,v 1.39 2011/01/17 18:25:17 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.40 2011/02/21 11:32:26 pooka Exp $ */
 
 /*
  * System call protos in rump namespace.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.242 2011/01/17 18:24:17 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.243 2011/01/31 00:05:29 christos Exp
  */
 
 #ifndef _RUMP_RUMP_SYSCALLS_H_
@@ -665,7 +665,7 @@
 int rump_sys_getgroups(int, gid_t *) __RENAME(RUMP_SYS_RENAME_GETGROUPS);
 int rump_sys_setgroups(int, const gid_t *) __RENAME(RUMP_SYS_RENAME_SETGROUPS);
 int rump_sys_getpgrp(void) __RENAME(RUMP_SYS_RENAME_GETPGRP);
-int rump_sys_setpgid(int, int) __RENAME(RUMP_SYS_RENAME_SETPGID);
+int rump_sys_setpgid(pid_t, pid_t) __RENAME(RUMP_SYS_RENAME_SETPGID);
 int rump_sys_dup2(int, int) __RENAME(RUMP_SYS_RENAME_DUP2);
 int rump_sys_fcntl(int, int, ...) __RENAME(RUMP_SYS_RENAME_FCNTL);
 int rump_sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *) __RENAME(RUMP_SYS_RENAME_SELECT);

Index: src/sys/rump/librump/rumpkern/rump_syscalls.c
diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.61 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.62
--- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.61	Mon Jan 17 18:25:17 2011
+++ src/sys/rump/librump/rumpkern/rump_syscalls.c	Mon Feb 21 11:32:26 2011
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_syscalls.c,v 1.61 2011/01/17 18:25:17 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.62 2011/02/21 11:32:26 pooka Exp $ */
 
 /*
  * System call vector and marshalling for rump.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.242 2011/01/17 18:24:17 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.243 2011/01/31 00:05:29 christos Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.61 2011/01/17 18:25:17 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.62 2011/02/21 11:32:26 pooka Exp $);
 
 #include sys/param.h
 #include sys/fstypes.h
@@ -857,9 +857,9 @@
 }
 rsys_alias(sys_getpgrp,rump_enosys)
 
-int rump___sysimpl_setpgid(int, int);
+int rump___sysimpl_setpgid(pid_t, pid_t);
 int
-rump___sysimpl_setpgid(int pid, int pgid)
+rump___sysimpl_setpgid(pid_t pid, pid_t pgid)
 {
 	register_t rval[2] = {0, 0};
 	int error = 0;



CVS commit: src/sys/rump

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 11:33:36 UTC 2011

Modified Files:
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c

Log Message:
regen: always explicitly set errno (fixes some apps)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.62 -r1.63 src/sys/rump/librump/rumpkern/rump_syscalls.c

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

Modified files:

Index: src/sys/rump/include/rump/rump_syscalls.h
diff -u src/sys/rump/include/rump/rump_syscalls.h:1.40 src/sys/rump/include/rump/rump_syscalls.h:1.41
--- src/sys/rump/include/rump/rump_syscalls.h:1.40	Mon Feb 21 11:32:26 2011
+++ src/sys/rump/include/rump/rump_syscalls.h	Mon Feb 21 11:33:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_syscalls.h,v 1.40 2011/02/21 11:32:26 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.41 2011/02/21 11:33:36 pooka Exp $ */
 
 /*
  * System call protos in rump namespace.

Index: src/sys/rump/librump/rumpkern/rump_syscalls.c
diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.62 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.63
--- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.62	Mon Feb 21 11:32:26 2011
+++ src/sys/rump/librump/rumpkern/rump_syscalls.c	Mon Feb 21 11:33:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_syscalls.c,v 1.62 2011/02/21 11:32:26 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.63 2011/02/21 11:33:36 pooka Exp $ */
 
 /*
  * System call vector and marshalling for rump.
@@ -8,7 +8,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.62 2011/02/21 11:32:26 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.63 2011/02/21 11:33:36 pooka Exp $);
 
 #include sys/param.h
 #include sys/fstypes.h
@@ -78,9 +78,9 @@
 	SPARG(callarg, nbyte) = nbyte;
 
 	error = rsys_syscall(SYS_read, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -99,9 +99,9 @@
 	SPARG(callarg, nbyte) = nbyte;
 
 	error = rsys_syscall(SYS_write, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -120,9 +120,9 @@
 	SPARG(callarg, mode) = mode;
 
 	error = rsys_syscall(SYS_open, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -139,9 +139,9 @@
 	SPARG(callarg, fd) = fd;
 
 	error = rsys_syscall(SYS_close, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -159,9 +159,9 @@
 	SPARG(callarg, link) = link;
 
 	error = rsys_syscall(SYS_link, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -178,9 +178,9 @@
 	SPARG(callarg, path) = path;
 
 	error = rsys_syscall(SYS_unlink, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -197,9 +197,9 @@
 	SPARG(callarg, path) = path;
 
 	error = rsys_syscall(SYS_chdir, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -216,9 +216,9 @@
 	SPARG(callarg, fd) = fd;
 
 	error = rsys_syscall(SYS_fchdir, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -237,9 +237,9 @@
 	SPARG(callarg, dev) = dev;
 
 	error = rsys_syscall(SYS_compat_50_mknod, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -257,9 +257,9 @@
 	SPARG(callarg, mode) = mode;
 
 	error = rsys_syscall(SYS_chmod, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -278,9 +278,9 @@
 	SPARG(callarg, gid) = gid;
 
 	error = rsys_syscall(SYS_chown, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -294,9 +294,9 @@
 	int error = 0;
 
 	error = rsys_syscall(SYS_getpid, NULL, 0, rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -314,9 +314,9 @@
 	SPARG(callarg, flags) = flags;
 
 	error = rsys_syscall(SYS_unmount, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 	return rval[0];
 }
@@ -333,9 +333,9 @@
 	SPARG(callarg, uid) = uid;
 
 	error = rsys_syscall(SYS_setuid, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
 	if (error) {
 		rval[0] = -1;
-		rsys_seterrno(error);
 	}
 

CVS commit: src/sys/dev/hil

2011-02-21 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Feb 21 12:33:05 UTC 2011

Modified Files:
src/sys/dev/hil: hilkbd.c

Log Message:
Since hilkbd_rawrepeat() is only defined under WSDISPLAY_COMPAT_RAWKBD,
protect the declaration similarly to avoid build failure of the INSTALL
kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hil/hilkbd.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/hil/hilkbd.c
diff -u src/sys/dev/hil/hilkbd.c:1.2 src/sys/dev/hil/hilkbd.c:1.3
--- src/sys/dev/hil/hilkbd.c:1.2	Tue Feb 15 11:05:51 2011
+++ src/sys/dev/hil/hilkbd.c	Mon Feb 21 12:33:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hilkbd.c,v 1.2 2011/02/15 11:05:51 tsutsui Exp $	*/
+/*	$NetBSD: hilkbd.c,v 1.3 2011/02/21 12:33:05 he Exp $	*/
 /*	$OpenBSD: hilkbd.c,v 1.14 2009/01/21 21:53:59 grange Exp $	*/
 /*
  * Copyright (c) 2003, Miodrag Vallat.
@@ -122,7 +122,9 @@
 static void	hilkbd_decode(struct hilkbd_softc *, uint8_t, u_int *, int *,
 		int);
 static int	hilkbd_is_console(int);
+#ifdef WSDISPLAY_COMPAT_RAWKBD
 static void	hilkbd_rawrepeat(void *);
+#endif
 
 static int	seen_hilkbd_console;
 



CVS commit: src/sys/kern

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 12:49:06 UTC 2011

Modified Files:
src/sys/kern: syscalls.master

Log Message:
somehow i've missed preadv/pwritev from rump-relevant syscalls


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/sys/kern/syscalls.master

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/syscalls.master
diff -u src/sys/kern/syscalls.master:1.243 src/sys/kern/syscalls.master:1.244
--- src/sys/kern/syscalls.master:1.243	Mon Jan 31 00:05:29 2011
+++ src/sys/kern/syscalls.master	Mon Feb 21 12:49:06 2011
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.243 2011/01/31 00:05:29 christos Exp $
+	$NetBSD: syscalls.master,v 1.244 2011/02/21 12:49:06 pooka Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -547,10 +547,10 @@
 287	STD 		{ pid_t|sys||__clone(int flags, void *stack); }
 288	STD 		{ int|sys||fktrace(int fd, int ops, \
 			int facs, pid_t pid); }
-289	STD 		{ ssize_t|sys||preadv(int fd, \
+289	STD 	RUMP	{ ssize_t|sys||preadv(int fd, \
 			const struct iovec *iovp, int iovcnt, \
 			int PAD, off_t offset); }
-290	STD 		{ ssize_t|sys||pwritev(int fd, \
+290	STD 	RUMP	{ ssize_t|sys||pwritev(int fd, \
 			const struct iovec *iovp, int iovcnt, \
 			int PAD, off_t offset); }
 291	COMPAT_16 MODULAR { int|sys|14|sigaction(int signum, \



CVS commit: src/sys/rump

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 12:49:49 UTC 2011

Modified Files:
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c

Log Message:
regen: preadv/pwritev


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.63 -r1.64 src/sys/rump/librump/rumpkern/rump_syscalls.c

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

Modified files:

Index: src/sys/rump/include/rump/rump_syscalls.h
diff -u src/sys/rump/include/rump/rump_syscalls.h:1.41 src/sys/rump/include/rump/rump_syscalls.h:1.42
--- src/sys/rump/include/rump/rump_syscalls.h:1.41	Mon Feb 21 11:33:36 2011
+++ src/sys/rump/include/rump/rump_syscalls.h	Mon Feb 21 12:49:49 2011
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_syscalls.h,v 1.41 2011/02/21 11:33:36 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.42 2011/02/21 12:49:49 pooka Exp $ */
 
 /*
  * System call protos in rump namespace.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.243 2011/01/31 00:05:29 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.244 2011/02/21 12:49:06 pooka Exp
  */
 
 #ifndef _RUMP_RUMP_SYSCALLS_H_
@@ -41,6 +41,10 @@
 #define RUMP_SYS_RENAME_FHSTATVFS1 rump___sysimpl_fhstatvfs140
 #endif
 
+#ifndef RUMP_SYS_RENAME_PWRITEV
+#define RUMP_SYS_RENAME_PWRITEV rump___sysimpl_pwritev
+#endif
+
 #ifndef RUMP_SYS_RENAME_EXTATTR_GET_LINK
 #define RUMP_SYS_RENAME_EXTATTR_GET_LINK rump___sysimpl_extattr_get_link
 #endif
@@ -113,6 +117,10 @@
 #define RUMP_SYS_RENAME_EXTATTR_SET_FD rump___sysimpl_extattr_set_fd
 #endif
 
+#ifndef RUMP_SYS_RENAME_PREADV
+#define RUMP_SYS_RENAME_PREADV rump___sysimpl_preadv
+#endif
+
 #ifndef RUMP_SYS_RENAME_PATHCONF
 #define RUMP_SYS_RENAME_PATHCONF rump___sysimpl_pathconf
 #endif
@@ -724,6 +732,8 @@
 int rump_sys_lchown(const char *, uid_t, gid_t) __RENAME(RUMP_SYS_RENAME_LCHOWN);
 int rump_sys_lutimes(const char *, const struct timeval *) __RENAME(RUMP_SYS_RENAME_LUTIMES);
 pid_t rump_sys_getsid(pid_t) __RENAME(RUMP_SYS_RENAME_GETSID);
+ssize_t rump_sys_preadv(int, const struct iovec *, int, off_t) __RENAME(RUMP_SYS_RENAME_PREADV);
+ssize_t rump_sys_pwritev(int, const struct iovec *, int, off_t) __RENAME(RUMP_SYS_RENAME_PWRITEV);
 int rump_sys___getcwd(char *, size_t) __RENAME(RUMP_SYS_RENAME___GETCWD);
 int rump_sys_fchroot(int) __RENAME(RUMP_SYS_RENAME_FCHROOT);
 int rump_sys_lchflags(const char *, u_long) __RENAME(RUMP_SYS_RENAME_LCHFLAGS);

Index: src/sys/rump/librump/rumpkern/rump_syscalls.c
diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.63 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.64
--- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.63	Mon Feb 21 11:33:36 2011
+++ src/sys/rump/librump/rumpkern/rump_syscalls.c	Mon Feb 21 12:49:49 2011
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_syscalls.c,v 1.63 2011/02/21 11:33:36 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.64 2011/02/21 12:49:49 pooka Exp $ */
 
 /*
  * System call vector and marshalling for rump.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.243 2011/01/31 00:05:29 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.244 2011/02/21 12:49:06 pooka Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.63 2011/02/21 11:33:36 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.64 2011/02/21 12:49:49 pooka Exp $);
 
 #include sys/param.h
 #include sys/fstypes.h
@@ -2060,6 +2060,52 @@
 }
 rsys_alias(sys_getsid,rump_enosys)
 
+ssize_t rump___sysimpl_preadv(int, const struct iovec *, int, off_t);
+ssize_t
+rump___sysimpl_preadv(int fd, const struct iovec * iovp, int iovcnt, off_t offset)
+{
+	register_t rval[2] = {0, 0};
+	int error = 0;
+	struct sys_preadv_args callarg;
+
+	SPARG(callarg, fd) = fd;
+	SPARG(callarg, iovp) = iovp;
+	SPARG(callarg, iovcnt) = iovcnt;
+	SPARG(callarg, PAD) = 0;
+	SPARG(callarg, offset) = offset;
+
+	error = rsys_syscall(SYS_preadv, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
+	if (error) {
+		rval[0] = -1;
+	}
+	return rval[0];
+}
+rsys_alias(sys_preadv,rump_enosys)
+
+ssize_t rump___sysimpl_pwritev(int, const struct iovec *, int, off_t);
+ssize_t
+rump___sysimpl_pwritev(int fd, const struct iovec * iovp, int iovcnt, off_t offset)
+{
+	register_t rval[2] = {0, 0};
+	int error = 0;
+	struct sys_pwritev_args callarg;
+
+	SPARG(callarg, fd) = fd;
+	SPARG(callarg, iovp) = iovp;
+	SPARG(callarg, iovcnt) = iovcnt;
+	SPARG(callarg, PAD) = 0;
+	SPARG(callarg, offset) = offset;
+
+	error = rsys_syscall(SYS_pwritev, callarg, sizeof(callarg), rval);
+	rsys_seterrno(error);
+	if (error) {
+		rval[0] = -1;
+	}
+	return rval[0];
+}
+rsys_alias(sys_pwritev,rump_enosys)
+
 int rump___sysimpl___getcwd(char *, size_t);
 int
 rump___sysimpl___getcwd(char * bufp, size_t length)
@@ -3996,10 +4042,10 

CVS commit: src/lib/librumphijack

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 12:51:06 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
hijack:
  1) {,f,l}chflags (used e.g. by cp(1))
  2) p{read,write}{,v} (used by many)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.59 src/lib/librumphijack/hijack.c:1.60
--- src/lib/librumphijack/hijack.c:1.59	Sun Feb 20 23:47:04 2011
+++ src/lib/librumphijack/hijack.c	Mon Feb 21 12:51:06 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.59 2011/02/20 23:47:04 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.60 2011/02/21 12:51:06 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.59 2011/02/20 23:47:04 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.60 2011/02/21 12:51:06 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -59,7 +59,7 @@
 #include unistd.h
 
 enum dualcall {
-	DUALCALL_WRITE, DUALCALL_WRITEV,
+	DUALCALL_WRITE, DUALCALL_WRITEV, DUALCALL_PWRITE, DUALCALL_PWRITEV,
 	DUALCALL_IOCTL, DUALCALL_FCNTL,
 	DUALCALL_SOCKET, DUALCALL_ACCEPT, DUALCALL_BIND, DUALCALL_CONNECT,
 	DUALCALL_GETPEERNAME, DUALCALL_GETSOCKNAME, DUALCALL_LISTEN,
@@ -67,7 +67,7 @@
 	DUALCALL_SENDTO, DUALCALL_SENDMSG,
 	DUALCALL_GETSOCKOPT, DUALCALL_SETSOCKOPT,
 	DUALCALL_SHUTDOWN,
-	DUALCALL_READ, DUALCALL_READV,
+	DUALCALL_READ, DUALCALL_READV, DUALCALL_PREAD, DUALCALL_PREADV,
 	DUALCALL_DUP2,
 	DUALCALL_CLOSE,
 	DUALCALL_POLLTS,
@@ -88,6 +88,7 @@
 	DUALCALL_FSYNC, DUALCALL_FSYNC_RANGE,
 	DUALCALL_MOUNT, DUALCALL_UNMOUNT,
 	DUALCALL___GETCWD,
+	DUALCALL_CHFLAGS, DUALCALL_LCHFLAGS, DUALCALL_FCHFLAGS,
 	DUALCALL__NUM
 };
 
@@ -120,6 +121,8 @@
 #define REALFUTIMES __futimes50
 #endif
 #define REALREAD _sys_read
+#define REALPREAD _sys_pread
+#define REALPWRITE _sys_pwrite
 #define REALGETDENTS __getdents30
 #define REALMOUNT __mount50
 #define REALLSEEK _lseek
@@ -130,6 +133,8 @@
 int REALKEVENT(int, const struct kevent *, size_t, struct kevent *, size_t,
 	   const struct timespec *);
 ssize_t REALREAD(int, void *, size_t);
+ssize_t REALPREAD(int, void *, size_t, off_t);
+ssize_t REALPWRITE(int, const void *, size_t, off_t);
 int REALSTAT(const char *, struct stat *);
 int REALLSTAT(const char *, struct stat *);
 int REALFSTAT(int, struct stat *);
@@ -163,8 +168,12 @@
 	{ DUALCALL_SHUTDOWN,	shutdown,	RSYS_NAME(SHUTDOWN)	},
 	{ DUALCALL_READ,	S(REALREAD),	RSYS_NAME(READ)		},
 	{ DUALCALL_READV,	readv,	RSYS_NAME(READV)	},
+	{ DUALCALL_PREAD,	S(REALPREAD),	RSYS_NAME(PREAD)	},
+	{ DUALCALL_PREADV,	preadv,	RSYS_NAME(PREADV)	},
 	{ DUALCALL_WRITE,	write,	RSYS_NAME(WRITE)	},
 	{ DUALCALL_WRITEV,	writev,	RSYS_NAME(WRITEV)	},
+	{ DUALCALL_PWRITE,	S(REALPWRITE),	RSYS_NAME(PWRITE)	},
+	{ DUALCALL_PWRITEV,	pwritev,	RSYS_NAME(PWRITEV)	},
 	{ DUALCALL_IOCTL,	ioctl,	RSYS_NAME(IOCTL)	},
 	{ DUALCALL_FCNTL,	fcntl,	RSYS_NAME(FCNTL)	},
 	{ DUALCALL_DUP2,	dup2,		RSYS_NAME(DUP2)		},
@@ -203,6 +212,9 @@
 	{ DUALCALL_MOUNT,	S(REALMOUNT),	RSYS_NAME(MOUNT)	},
 	{ DUALCALL_UNMOUNT,	unmount,	RSYS_NAME(UNMOUNT)	},
 	{ DUALCALL___GETCWD,	__getcwd,	RSYS_NAME(__GETCWD)	},
+	{ DUALCALL_CHFLAGS,	chflags,	RSYS_NAME(CHFLAGS)	},
+	{ DUALCALL_LCHFLAGS,	lchflags,	RSYS_NAME(LCHFLAGS)	},
+	{ DUALCALL_FCHFLAGS,	fchflags,	RSYS_NAME(FCHFLAGS)	},
 };
 #undef S
 
@@ -1614,11 +1626,31 @@
 	(int, const struct iovec *, int),\
 	(fd, iov, iovcnt))
 
+FDCALL(ssize_t, REALPREAD, DUALCALL_PREAD,\
+	(int fd, void *buf, size_t nbytes, off_t offset),		\
+	(int, void *, size_t, off_t),	\
+	(fd, buf, nbytes, offset))
+
+FDCALL(ssize_t, preadv, DUALCALL_PREADV, \
+	(int fd, const struct iovec *iov, int iovcnt, off_t offset),	\
+	(int, const struct iovec *, int, off_t),			\
+	(fd, iov, iovcnt, offset))
+
 FDCALL(ssize_t, writev, DUALCALL_WRITEV, \
 	(int fd, const struct iovec *iov, int iovcnt),			\
 	(int, const struct iovec *, int),\
 	(fd, iov, iovcnt))
 
+FDCALL(ssize_t, REALPWRITE, DUALCALL_PWRITE,\
+	(int fd, const void *buf, size_t nbytes, off_t offset),		\
+	(int, const void *, size_t, off_t),\
+	(fd, buf, nbytes, offset))
+
+FDCALL(ssize_t, pwritev, DUALCALL_PWRITEV, \
+	(int fd, const struct iovec *iov, int iovcnt, off_t offset),	\
+	(int, const struct iovec *, int, off_t),			\
+	(fd, iov, iovcnt, offset))
+
 FDCALL(int, REALFSTAT, DUALCALL_FSTAT,	\
 	(int fd, struct stat *sb),	\
 	(int, struct stat *),		\
@@ -1669,6 +1701,11 @@
 	(int, const struct timeval *),	\
 	(fd, tv))
 
+FDCALL(int, fchflags, DUALCALL_FCHFLAGS,\
+	(int fd, u_long flags),		\
+	(int, u_long),			\
+	(fd, flags))
+
 /*
  * path-based selectors
  */
@@ -1743,6 +1780,16 @@
 	(const char *, const struct timeval *),			

CVS commit: src/lib/librumphijack

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 12:55:21 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Actually, we need both lseek and _lseek so that out-of-libc references
go to the right place instead of directly to __lseek.  Seeking in
mplayer works now.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.60 src/lib/librumphijack/hijack.c:1.61
--- src/lib/librumphijack/hijack.c:1.60	Mon Feb 21 12:51:06 2011
+++ src/lib/librumphijack/hijack.c	Mon Feb 21 12:55:21 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.60 2011/02/21 12:51:06 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.61 2011/02/21 12:55:21 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.60 2011/02/21 12:51:06 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.61 2011/02/21 12:55:21 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -125,7 +125,6 @@
 #define REALPWRITE _sys_pwrite
 #define REALGETDENTS __getdents30
 #define REALMOUNT __mount50
-#define REALLSEEK _lseek
 
 int REALSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 int REALPOLLTS(struct pollfd *, nfds_t,
@@ -143,7 +142,6 @@
 int REALLUTIMES(const char *, const struct timeval [2]);
 int REALFUTIMES(int, const struct timeval [2]);
 int REALMOUNT(const char *, const char *, int, void *, size_t);
-off_t REALLSEEK(int, off_t, int);
 int __getcwd(char *, size_t);
 
 #define S(a) __STRING(a)
@@ -197,7 +195,7 @@
 	{ DUALCALL_FSTATVFS1,	fstatvfs1,	RSYS_NAME(FSTATVFS1)	},
 	{ DUALCALL_CHDIR,	chdir,	RSYS_NAME(CHDIR)	},
 	{ DUALCALL_FCHDIR,	fchdir,	RSYS_NAME(FCHDIR)	},
-	{ DUALCALL_LSEEK,	S(REALLSEEK),	RSYS_NAME(LSEEK)	},
+	{ DUALCALL_LSEEK,	lseek,	RSYS_NAME(LSEEK)	},
 	{ DUALCALL_GETDENTS,	__getdents30,	RSYS_NAME(GETDENTS)	},
 	{ DUALCALL_UNLINK,	unlink,	RSYS_NAME(UNLINK)	},
 	{ DUALCALL_SYMLINK,	symlink,	RSYS_NAME(SYMLINK)	},
@@ -1661,10 +1659,11 @@
 	(int, struct statvfs *, int),	\
 	(fd, buf, flags))
 
-FDCALL(off_t, REALLSEEK, DUALCALL_LSEEK,\
+FDCALL(off_t, lseek, DUALCALL_LSEEK,	\
 	(int fd, off_t offset, int whence),\
 	(int, off_t, int),		\
 	(fd, offset, whence))
+__strong_alias(_lseek,lseek);
 
 FDCALL(int, REALGETDENTS, DUALCALL_GETDENTS,\
 	(int fd, char *buf, size_t nbytes),\



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

2011-02-21 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Feb 21 12:56:52 UTC 2011

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

Log Message:
Add couple of additional CPU model checks for the undocumented Tj(max).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/coretemp.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/coretemp.c
diff -u src/sys/arch/x86/x86/coretemp.c:1.19 src/sys/arch/x86/x86/coretemp.c:1.20
--- src/sys/arch/x86/x86/coretemp.c:1.19	Mon Feb 21 05:26:08 2011
+++ src/sys/arch/x86/x86/coretemp.c	Mon Feb 21 12:56:52 2011
@@ -1,4 +1,34 @@
-/* $NetBSD: coretemp.c,v 1.19 2011/02/21 05:26:08 jruoho Exp $ */
+/* $NetBSD: coretemp.c,v 1.20 2011/02/21 12:56:52 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
 
 /*-
  * Copyright (c) 2007 Juan Romero Pardines.
@@ -30,13 +60,8 @@
  *
  */
 
-/*
- * Device driver for Intel's On Die thermal sensor via MSR.
- * First introduced in Intel's Core line of processors.
- */
-
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coretemp.c,v 1.19 2011/02/21 05:26:08 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: coretemp.c,v 1.20 2011/02/21 12:56:52 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -75,11 +100,13 @@
 #define MSR_THERM_INTR_TRIP2_VAL	__BITS(16, 22)
 #define MSR_THERM_INTR_TRIP2		__BIT(23)
 
+#define MSR_TEMP_TARGET_READOUT		__BITS(16, 23)
+
 static int	coretemp_match(device_t, cfdata_t, void *);
 static void	coretemp_attach(device_t, device_t, void *);
 static int	coretemp_detach(device_t, int);
 static int	coretemp_quirks(struct cpu_info *);
-static void	coretemp_ext_config(device_t);
+static void	coretemp_tjmax(device_t);
 static void	coretemp_refresh(struct sysmon_envsys *, envsys_data_t *);
 static void	coretemp_refresh_xcall(void *, void *);
 
@@ -156,8 +183,7 @@
 	if (sysmon_envsys_register(sc-sc_sme) != 0)
 		goto fail;
 
-	coretemp_ext_config(self);
-
+	coretemp_tjmax(self);
 	return;
 
 fail:
@@ -179,11 +205,11 @@
 static int
 coretemp_quirks(struct cpu_info *ci)
 {
-	uint32_t mask, model;
+	uint32_t model, stepping;
 	uint64_t msr;
 
-	mask = ci-ci_signature  0x0F;
 	model = CPUID2MODEL(ci-ci_signature);
+	stepping = CPUID2STEPPING(ci-ci_signature);
 
 	/*
 	 * Check if the MSR contains thermal
@@ -204,7 +230,7 @@
 	 *
 	 * Adapted from the Linux coretemp driver.
 	 */
-	if (model == 0x0E  mask  0x0C) {
+	if (model == 0x0E  stepping  0x0C) {
 
 		msr = rdmsr(MSR_BIOS_SIGN);
 		msr = msr  32;
@@ -217,34 +243,57 @@
 }
 
 void
-coretemp_ext_config(device_t self)
+coretemp_tjmax(device_t self)
 {
 	struct coretemp_softc *sc = device_private(self);
 	struct cpu_info *ci = sc-sc_ci;
-	uint32_t emodel, mask, model;
+	uint32_t extmodel, model, stepping;
 	uint64_t msr;
 
-	mask = ci-ci_signature  0x0F;
 	model = CPUID2MODEL(ci-ci_signature);
-	emodel = CPUID2EXTMODEL(ci-ci_signature);
+	extmodel = CPUID2EXTMODEL(ci-ci_signature);
+	stepping = CPUID2STEPPING(ci-ci_signature);
+
+	sc-sc_tjmax = 100;
 
 	/*
-	 * On some Core 2 CPUs, there's an undocumented MSR that
-	 * can tell us if Tj(max) is 100 or 85.
-	 *
-	 * The if-clause for CPUs having the MSR_IA32_EXT_CONFIG was adapted
-	 * from the Linux coretemp driver.
-	 *
-	 * MSR_IA32_EXT_CONFIG is NOT safe on all CPUs
+	 * The mobile Penryn family.
 	 */
-	sc-sc_tjmax = 100;
+	if (model == 0x17  stepping == 0x06) {
+		sc-sc_tjmax = 105;
+		return;
+	}
 
-	if ((model == 0x0F  mask = 

CVS commit: src/sys/external/isc/atheros_hal/dist/ar5416

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 13:04:22 UTC 2011

Modified Files:
src/sys/external/isc/atheros_hal/dist/ar5416: ar9285_reset.c

Log Message:
make it compile with ATHHAL_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c

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

Modified files:

Index: src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c
diff -u src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c:1.1 src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c:1.2
--- src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c:1.1	Mon Feb 21 11:06:38 2011
+++ src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c	Mon Feb 21 13:04:22 2011
@@ -119,7 +119,7 @@
 twiceMaxRegulatoryPower = AH_MIN(MAX_RATE_POWER, AH_PRIVATE(ah)-ah_powerLimit); 
 pModal = pEepData-modalHeader;
 HALDEBUG(ah, HAL_DEBUG_RESET, %s Channel=%u CfgCtl=%u\n,
-	__func__,chan-ic_freq, cfgCtl );  
+	__func__,chan-channel, cfgCtl );  
   
 if (IS_EEP_MINOR_V2(ah)) {
 ht40PowerIncForPdadc = pModal-ht40PowerIncForPdadc;



CVS commit: src/lib/librumphijack

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 13:19:35 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
disallow mmap(MAP_FILE) from a rump kernel fd


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.61 src/lib/librumphijack/hijack.c:1.62
--- src/lib/librumphijack/hijack.c:1.61	Mon Feb 21 12:55:21 2011
+++ src/lib/librumphijack/hijack.c	Mon Feb 21 13:19:35 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.61 2011/02/21 12:55:21 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.62 2011/02/21 13:19:35 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.61 2011/02/21 12:55:21 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.62 2011/02/21 13:19:35 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -34,6 +34,7 @@
 #include sys/types.h
 #include sys/event.h
 #include sys/ioctl.h
+#include sys/mman.h
 #include sys/mount.h
 #include sys/poll.h
 #include sys/socket.h
@@ -225,6 +226,7 @@
 pid_t	(*host_fork)(void);
 int	(*host_daemon)(int, int);
 int	(*host_execve)(const char *, char *const[], char *const[]);
+void *	(*host_mmap)(void *, size_t, int, int, int, off_t);
 
 /* ok, we need *two* bits per dup2'd fd to track fd+HIJACKOFF aliases */
 static uint32_t dup2mask;
@@ -454,6 +456,7 @@
 	host_fork = dlsym(RTLD_NEXT, fork);
 	host_daemon = dlsym(RTLD_NEXT, daemon);
 	host_execve = dlsym(RTLD_NEXT, execve);
+	host_mmap = dlsym(RTLD_NEXT, mmap);
 
 	/*
 	 * In theory cannot print anything during lookups because
@@ -1527,6 +1530,20 @@
 }
 
 /*
+ * mmapping from a rump kernel is not supported, so disallow it.
+ */
+void *
+mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+
+	if (flags  MAP_FILE  fd_isrump(fd)) {
+		errno = ENOSYS;
+		return MAP_FAILED;
+	}
+	return host_mmap(addr, len, prot, flags, fd, offset);
+}
+
+/*
  * Rest are std type calls.
  */
 



CVS commit: src/sys/dev/pci

2011-02-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 21 13:38:18 UTC 2011

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add two more Intel 82Q45 devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1059 -r1.1060 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1059 src/sys/dev/pci/pcidevs:1.1060
--- src/sys/dev/pci/pcidevs:1.1059	Sun Feb 20 22:16:18 2011
+++ src/sys/dev/pci/pcidevs	Mon Feb 21 13:38:18 2011
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1059 2011/02/20 22:16:18 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1060 2011/02/21 13:38:18 njoly Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2797,7 +2797,9 @@
 product INTEL 82IGD_E_HB	0x2e00	82IGD_E Host Bridge
 product INTEL 82IGD_E_IGD	0x2e02	82IGD_E Integrated Graphics
 product INTEL 82Q45_HB		0x2e10	82Q45 Host Bridge
+product INTEL 82Q45_EXP		0x2e11	82Q45 PCI Express Bridge
 product INTEL 82Q45_IGD		0x2e12	82Q45 Integrated Graphics Device
+product INTEL 82Q45_IGD_1	0x2e13	82Q45 Integrated Graphics Device
 product INTEL 82G45_HB		0x2e20	82G45 Host Bridge
 product INTEL 82G45_IGD		0x2e22	82G45 Integrated Graphics Device
 product INTEL 82G41_HB		0x2e30	82G41 Host Bridge



CVS commit: src/sys/dev/pci

2011-02-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 21 13:38:58 UTC 2011

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen: Add two more Intel 82Q45 devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1056 -r1.1057 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1055 -r1.1056 src/sys/dev/pci/pcidevs_data.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/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1056 src/sys/dev/pci/pcidevs.h:1.1057
--- src/sys/dev/pci/pcidevs.h:1.1056	Sun Feb 20 22:16:50 2011
+++ src/sys/dev/pci/pcidevs.h	Mon Feb 21 13:38:55 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1056 2011/02/20 22:16:50 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1057 2011/02/21 13:38:55 njoly Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1059 2011/02/20 22:16:18 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1060 2011/02/21 13:38:18 njoly Exp
  */
 
 /*
@@ -2804,7 +2804,9 @@
 #define	PCI_PRODUCT_INTEL_82IGD_E_HB	0x2e00		/* 82IGD_E Host Bridge */
 #define	PCI_PRODUCT_INTEL_82IGD_E_IGD	0x2e02		/* 82IGD_E Integrated Graphics */
 #define	PCI_PRODUCT_INTEL_82Q45_HB	0x2e10		/* 82Q45 Host Bridge */
+#define	PCI_PRODUCT_INTEL_82Q45_EXP	0x2e11		/* 82Q45 PCI Express Bridge */
 #define	PCI_PRODUCT_INTEL_82Q45_IGD	0x2e12		/* 82Q45 Integrated Graphics Device */
+#define	PCI_PRODUCT_INTEL_82Q45_IGD_1	0x2e13		/* 82Q45 Integrated Graphics Device */
 #define	PCI_PRODUCT_INTEL_82G45_HB	0x2e20		/* 82G45 Host Bridge */
 #define	PCI_PRODUCT_INTEL_82G45_IGD	0x2e22		/* 82G45 Integrated Graphics Device */
 #define	PCI_PRODUCT_INTEL_82G41_HB	0x2e30		/* 82G41 Host Bridge */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1055 src/sys/dev/pci/pcidevs_data.h:1.1056
--- src/sys/dev/pci/pcidevs_data.h:1.1055	Sun Feb 20 22:16:50 2011
+++ src/sys/dev/pci/pcidevs_data.h	Mon Feb 21 13:38:56 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1055 2011/02/20 22:16:50 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1056 2011/02/21 13:38:56 njoly Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1059 2011/02/20 22:16:18 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1060 2011/02/21 13:38:18 njoly Exp
  */
 
 /*
@@ -4403,8 +4403,12 @@
 	17853, 692, 1716, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82Q45_HB, 
 	17861, 6632, 6242, 0,
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82Q45_EXP, 
+	17861, 615, 4337, 6242, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82Q45_IGD, 
 	17861, 692, 1716, 2443, 0,
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82Q45_IGD_1, 
+	17861, 692, 1716, 2443, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82G45_HB, 
 	17867, 6632, 6242, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82G45_IGD, 
@@ -7732,7 +7736,7 @@
 	TMC\0 /* 1 refs @ 601 */
 	Miro\0 /* 1 refs @ 605 */
 	(2nd\0 /* 14 refs @ 610 */
-	PCI\0 /* 303 refs @ 615 */
+	PCI\0 /* 304 refs @ 615 */
 	Vendor\0 /* 15 refs @ 619 */
 	ID)\0 /* 18 refs @ 626 */
 	NEC\0 /* 2 refs @ 630 */
@@ -7746,7 +7750,7 @@
 	Hitach\0 /* 1 refs @ 673 */
 	AMP\0 /* 1 refs @ 680 */
 	Silicon\0 /* 4 refs @ 684 */
-	Integrated\0 /* 66 refs @ 692 */
+	Integrated\0 /* 67 refs @ 692 */
 	Seiko\0 /* 1 refs @ 703 */
 	Tatung\0 /* 1 refs @ 709 */
 	Hewlett-Packard\0 /* 1 refs @ 716 */
@@ -7880,7 +7884,7 @@
 	Industrial\0 /* 2 refs @ 1688 */
 	Benchmarq\0 /* 1 refs @ 1699 */
 	Sierra\0 /* 2 refs @ 1709 */
-	Graphics\0 /* 64 refs @ 1716 */
+	Graphics\0 /* 65 refs @ 1716 */
 	ACC\0 /* 1 refs @ 1725 */
 	Digicom\0 /* 1 refs @ 1729 */
 	Honeywell\0 /* 1 refs @ 1737 */
@@ -7977,7 +7981,7 @@
 	F.\0 /* 1 refs @ 2420 */
 	Mikroelektronik\0 /* 1 refs @ 2423 */
 	I-O\0 /* 1 refs @ 2439 */
-	Device\0 /* 51 refs @ 2443 */
+	Device\0 /* 52 refs @ 2443 */
 	Soyo\0 /* 1 refs @ 2450 */
 	Fast\0 /* 19 refs @ 2455 */
 	NCube\0 /* 1 refs @ 2460 */
@@ -8229,7 +8233,7 @@
 	Transmeta\0 /* 1 refs @ 4310 */
 	Rockwell\0 /* 1 refs @ 4320 */
 	Davicom\0 /* 1 refs @ 4329 */
-	Express\0 /* 95 refs @ 4337 */
+	Express\0 /* 96 refs @ 4337 */
 	TriTech\0 /* 1 refs @ 4345 */
 	Kofax\0 /* 1 refs @ 4353 */
 	Image\0 /* 1 refs @ 4359 */
@@ -8480,7 +8484,7 @@
 	ACCM\0 /* 1 refs @ 6225 */
 	2188\0 /* 1 refs @ 6230 */
 	VL-PCI\0 /* 3 refs @ 6235 */
-	Bridge\0 /* 530 refs @ 6242 */
+	Bridge\0 /* 531 refs @ 6242 */
 	2051\0 /* 2 refs @ 6249 */
 	Single\0 /* 5 refs @ 6254 */
 	Solution\0 /* 2 refs @ 6261 */
@@ -10095,7 +10099,7 @@
 	82965GME\0 /* 2 refs @ 17837 */
 	82GM45\0 /* 3 refs @ 17846 */
 	82IGD_E\0 /* 2 refs @ 17853 */
-	82Q45\0 /* 2 refs @ 17861 */
+	82Q45\0 /* 4 refs @ 17861 */
 	82G45\0 /* 

CVS commit: src/common/lib/libprop

2011-02-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 21 13:42:57 UTC 2011

Modified Files:
src/common/lib/libprop: prop_array.3 prop_dictionary.3

Log Message:
Fix section for umask xrefs.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libprop/prop_array.3
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libprop/prop_dictionary.3

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

Modified files:

Index: src/common/lib/libprop/prop_array.3
diff -u src/common/lib/libprop/prop_array.3:1.11 src/common/lib/libprop/prop_array.3:1.12
--- src/common/lib/libprop/prop_array.3:1.11	Mon Dec 14 06:03:23 2009
+++ src/common/lib/libprop/prop_array.3	Mon Feb 21 13:42:57 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: prop_array.3,v 1.11 2009/12/14 06:03:23 dholland Exp $
+.\	$NetBSD: prop_array.3,v 1.12 2011/02/21 13:42:57 njoly Exp $
 .\
 .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -253,7 +253,7 @@
 The file is saved with the mode
 .Dv 0666
 as modified by the process's file creation mask
-.Pq see Xr umask 3
+.Pq see Xr umask 2
 and is written atomically.
 Returns
 .Dv false

Index: src/common/lib/libprop/prop_dictionary.3
diff -u src/common/lib/libprop/prop_dictionary.3:1.16 src/common/lib/libprop/prop_dictionary.3:1.17
--- src/common/lib/libprop/prop_dictionary.3:1.16	Wed Feb  2 16:37:27 2011
+++ src/common/lib/libprop/prop_dictionary.3	Mon Feb 21 13:42:57 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: prop_dictionary.3,v 1.16 2011/02/02 16:37:27 plunky Exp $
+.\	$NetBSD: prop_dictionary.3,v 1.17 2011/02/21 13:42:57 njoly Exp $
 .\
 .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -305,7 +305,7 @@
 The file is saved with the mode
 .Dv 0666
 as modified by the process's file creation mask
-.Pq see Xr umask 3
+.Pq see Xr umask 2
 and is written atomically.
 Returns
 .Dv false



CVS commit: src/sys/dev/pci

2011-02-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Feb 21 14:43:58 UTC 2011

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

Log Message:
print the device name at attach, like so:

ath0 at pci4 dev 0 function 0: Atheros 9280


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_ath_pci.c

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

Modified files:

Index: src/sys/dev/pci/if_ath_pci.c
diff -u src/sys/dev/pci/if_ath_pci.c:1.40 src/sys/dev/pci/if_ath_pci.c:1.41
--- src/sys/dev/pci/if_ath_pci.c:1.40	Sun Feb 20 03:56:45 2011
+++ src/sys/dev/pci/if_ath_pci.c	Mon Feb 21 14:43:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ath_pci.c,v 1.40 2011/02/20 03:56:45 jmcneill Exp $	*/
+/*	$NetBSD: if_ath_pci.c,v 1.41 2011/02/21 14:43:58 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ath_pci.c,v 1.40 2011/02/20 03:56:45 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ath_pci.c,v 1.41 2011/02/21 14:43:58 jmcneill Exp $);
 
 /*
  * PCI/Cardbus front-end for the Atheros Wireless LAN controller driver.
@@ -128,6 +128,7 @@
 	struct pci_attach_args *pa = aux;
 	pci_chipset_tag_t pc = pa-pa_pc;
 	const char *intrstr = NULL;
+	const char *devname;
 	pcireg_t mem_type;
 
 	sc-sc_dev = self;
@@ -135,7 +136,8 @@
 	psc-sc_pc = pc;
 	psc-sc_tag = pa-pa_tag;
 
-	aprint_normal(\n);
+	devname = ath_hal_probe(PCI_VENDOR(pa-pa_id), PCI_PRODUCT(pa-pa_id));
+	aprint_normal(: %s\n, devname);
 
 	if (!ath_pci_setup(psc))
 		goto bad;



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

2011-02-21 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Feb 21 15:10:54 UTC 2011

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

Log Message:
Call pmf_device_deregister(9) during detach.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/coretemp.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/coretemp.c
diff -u src/sys/arch/x86/x86/coretemp.c:1.20 src/sys/arch/x86/x86/coretemp.c:1.21
--- src/sys/arch/x86/x86/coretemp.c:1.20	Mon Feb 21 12:56:52 2011
+++ src/sys/arch/x86/x86/coretemp.c	Mon Feb 21 15:10:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: coretemp.c,v 1.20 2011/02/21 12:56:52 jruoho Exp $ */
+/* $NetBSD: coretemp.c,v 1.21 2011/02/21 15:10:54 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coretemp.c,v 1.20 2011/02/21 12:56:52 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: coretemp.c,v 1.21 2011/02/21 15:10:54 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -199,6 +199,8 @@
 	if (sc-sc_sme != NULL)
 		sysmon_envsys_unregister(sc-sc_sme);
 
+	pmf_device_deregister(self);
+
 	return 0;
 }
 



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

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 16:24:30 UTC 2011

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
Put coredumps back as a built-in.  Until it can autoload or something,
there's no point in causing user-visible (and test-visible)
regressions.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/sys/arch/amd64/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/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.310 src/sys/arch/amd64/conf/GENERIC:1.311
--- src/sys/arch/amd64/conf/GENERIC:1.310	Sun Feb 20 13:42:45 2011
+++ src/sys/arch/amd64/conf/GENERIC	Mon Feb 21 16:24:29 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.310 2011/02/20 13:42:45 jruoho Exp $
+# $NetBSD: GENERIC,v 1.311 2011/02/21 16:24:29 pooka Exp $
 #
 # GENERIC machine description file
 #
@@ -22,11 +22,10 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.310 $
+#ident 		GENERIC-$Revision: 1.311 $
 
 maxusers	64		# estimated number of users
 
-no options 	COREDUMP	# coredump support, built as module(7)
 # Common binary formats are statically compiled in by default.
 options 	EXEC_ELF32	# exec ELF 32-bits binaries
 #no options 	EXEC_ELF64	# exec ELF 64-bits binaries



CVS commit: src/sbin/dmctl

2011-02-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 21 17:05:50 UTC 2011

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

Log Message:
Small typo in macro (Ii - It).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/dmctl/dmctl.8

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

Modified files:

Index: src/sbin/dmctl/dmctl.8
diff -u src/sbin/dmctl/dmctl.8:1.2 src/sbin/dmctl/dmctl.8:1.3
--- src/sbin/dmctl/dmctl.8:1.2	Tue Feb  8 09:51:17 2011
+++ src/sbin/dmctl/dmctl.8	Mon Feb 21 17:05:50 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: dmctl.8,v 1.2 2011/02/08 09:51:17 wiz Exp $
+.\ $NetBSD: dmctl.8,v 1.3 2011/02/21 17:05:50 njoly Exp $
 .\
 .\ Copyright (c) 2004,2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -39,7 +39,7 @@
 works with the device-mapper kernel driver.
 It can send and receive information and commands from the dm driver.
 .Bl -column -offset indent suspend Switch active and passive tables for
-.Ii Li version Ta Print driver and lib version.
+.It Li version Ta Print driver and lib version.
 .It Li targets Ta List available kernel targets.
 .It Li create Ta Create device with [dm device name].
 .It Li ls Ta List existing dm devices.



CVS commit: src/external/bsd/iscsi/dist/src/initiator

2011-02-21 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Feb 21 17:24:20 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist/src/initiator: iscsi-initiator.8
iscsi-initiator.c

Log Message:
Remove hostname from pathname to storage in mount point.
This means /mnt/mytarget.domain.local/target0/storage is now
/mnt/target0/storage.

Rationale is as follows:
- The hostname used may vary (i.e. name vs FQDN vs IP) which can mess up
  mountpoints (especially across multiple hosts e.g. in a shared xen pool)
- Target name is given in the mount anyway so it is redundant

OK agc@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c

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

Modified files:

Index: src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8
diff -u src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8:1.3 src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8:1.4
--- src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8:1.3	Tue Aug  3 10:24:39 2010
+++ src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8	Mon Feb 21 17:24:19 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: iscsi-initiator.8,v 1.3 2010/08/03 10:24:39 sborrill Exp $
+.\ $NetBSD: iscsi-initiator.8,v 1.4 2011/02/21 17:24:19 sborrill Exp $
 .\
 .\ Copyright © 2007 Alistair Crooks.  All rights reserved.
 .\
@@ -26,7 +26,7 @@
 .\ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 .\ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd August 3, 2010
+.Dd February 21, 2011
 .Dt ISCSI-INITIATOR 8
 .Os
 .Sh NAME
@@ -120,7 +120,7 @@
 .Sh EXAMPLES
 .Bd -literal
 # ./iscsi-initiator -u agc -h iscsi-target0.alistaircrooks.co.uk /mnt
-# ls -al /mnt/iscsi-target0.alistaircrooks.co.uk/target0
+# ls -al /mnt/target0
 total 576
 drwxr-xr-x  2 agc  agc512 May 11 22:24 .
 drwxr-xr-x  2 agc  agc512 May 11 22:24 ..

Index: src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c
diff -u src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.4 src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.5
--- src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.4	Sun Nov  8 15:33:21 2009
+++ src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c	Mon Feb 21 17:24:19 2011
@@ -718,36 +718,31 @@
 		tv.v[tv.c].serial = strdup((char *)data[4]);
 
 		/* create the tree using virtdir routines */
-		cc = snprintf(name, sizeof(name), /%s/%s, host, colon);
+		cc = snprintf(name, sizeof(name), /%s, colon);
 		virtdir_add(iscsi, name, cc, 'd', name, cc);
-		cc = snprintf(name, sizeof(name), /%s/%s/storage, host,
-colon);
+		cc = snprintf(name, sizeof(name), /%s/storage, colon);
 		virtdir_add(iscsi, name, cc, devtype, (void *)sti,
 sizeof(sti));
-		cc = snprintf(name, sizeof(name), /%s/%s/hostname, host,
-colon);
+		cc = snprintf(name, sizeof(name), /%s/hostname, colon);
 		virtdir_add(iscsi, name, cc, 'l', tinfo.name,
 strlen(tinfo.name));
-		cc = snprintf(name, sizeof(name), /%s/%s/ip, host, colon);
+		cc = snprintf(name, sizeof(name), /%s/ip, colon);
 		virtdir_add(iscsi, name, cc, 'l', tinfo.ip, strlen(tinfo.ip));
-		cc = snprintf(name, sizeof(name), /%s/%s/targetname, host,
-colon);
+		cc = snprintf(name, sizeof(name), /%s/targetname, colon);
 		virtdir_add(iscsi, name, cc, 'l', tinfo.TargetName,
 strlen(tinfo.TargetName));
-		cc = snprintf(name, sizeof(name), /%s/%s/vendor, host, colon);
+		cc = snprintf(name, sizeof(name), /%s/vendor, colon);
 		virtdir_add(iscsi, name, cc, 'l', tv.v[tv.c].vendor,
 strlen(tv.v[tv.c].vendor));
-		cc = snprintf(name, sizeof(name), /%s/%s/product, host,
-colon);
+		cc = snprintf(name, sizeof(name), /%s/product, colon);
 		virtdir_add(iscsi, name, cc, 'l', tv.v[tv.c].product,
 strlen(tv.v[tv.c].product));
-		cc = snprintf(name, sizeof(name), /%s/%s/version, host,
-colon);
+		cc = snprintf(name, sizeof(name), /%s/version, colon);
 		virtdir_add(iscsi, name, cc, 'l', tv.v[tv.c].version,
 strlen(tv.v[tv.c].version));
 		if (tv.v[tv.c].serial[0]  tv.v[tv.c].serial[0] != ' ') {
-			cc = snprintf(name, sizeof(name), /%s/%s/serial,
-host, colon);
+			cc = snprintf(name, sizeof(name), /%s/serial,
+colon);
 			virtdir_add(iscsi, name, cc, 'l', tv.v[tv.c].serial,
 strlen(tv.v[tv.c].serial));
 		}



CVS commit: src/external/bsd/iscsi/dist

2011-02-21 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Feb 21 17:48:43 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist: configure.ac
src/external/bsd/iscsi/dist/src/initiator: iscsi-initiator.c
src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
man page claims that you can use auth type = none, but in reality this
didn't work (insisted on a username being given and then used, plus always
advertised CHAP to the target). Make initiator work as advertised (i.e.
defaults to auth type none and so don't require a username).

To use CHAP you should explicitly request CHAP:
iscsi-initiator -a chap -u user -h targetname /mountpoint

For backwards compatibility, if a username is given (-u) and no auth type
is specified (-a), it will default to CHAP, i.e. to use none, just give no
username:
iscsi-initiator -h targetname /mountpoint


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/iscsi/dist/configure.ac
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/iscsi/dist/src/lib/initiator.c

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

Modified files:

Index: src/external/bsd/iscsi/dist/configure.ac
diff -u src/external/bsd/iscsi/dist/configure.ac:1.4 src/external/bsd/iscsi/dist/configure.ac:1.5
--- src/external/bsd/iscsi/dist/configure.ac:1.4	Mon Apr 19 08:09:02 2010
+++ src/external/bsd/iscsi/dist/configure.ac	Mon Feb 21 17:48:43 2011
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.57)
-AC_INIT([netbsd-iscsi],[20100416],[Alistair Crooks a...@netbsd.org])
+AC_INIT([netbsd-iscsi],[20110221],[Alistair Crooks a...@netbsd.org])
 
 AC_CONFIG_SRCDIR([src/lib/protocol.c])
 AC_CONFIG_AUX_DIR([buildaux])

Index: src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c
diff -u src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.5 src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.6
--- src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.5	Mon Feb 21 17:24:19 2011
+++ src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c	Mon Feb 21 17:48:43 2011
@@ -618,11 +618,22 @@
 	*argv, i);
 		}
 	}
-	if (iscsi_initiator_getvar(ini, user) == NULL) {
-		iscsi_err(__FILE__, __LINE__, user must be specified with -u\n);
+	if (!strcmp(iscsi_initiator_getvar(ini, auth type), chap) 
+	iscsi_initiator_getvar(ini, user) == NULL) {
+		iscsi_err(__FILE__, __LINE__, user must be specified with 
+		-u if using CHAP authentication\n);
 		exit(EXIT_FAILURE);
 	}
 
+	if (strcmp(iscsi_initiator_getvar(ini, auth type), none) 
+	iscsi_initiator_getvar(ini, user) != NULL) {
+		/* 
+		 * For backwards compatibility, default to using CHAP
+		 * if username given
+		 */
+		iscsi_initiator_setvar(ini, auth type, chap);
+	}
+
 	if (iscsi_initiator_start(ini) == -1) {
 		iscsi_err(__FILE__, __LINE__, initiator_init() failed\n);
 		exit(EXIT_FAILURE);

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.3 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.4
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.3	Wed Feb  9 00:59:23 2011
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Mon Feb 21 17:48:43 2011
@@ -211,10 +211,10 @@
 	}
 	s = *sess;
 	user = NULL;
-if (s-sess_params.cred.user) {
+auth_type = s-sess_params.auth_type;
+if (s-sess_params.cred.user  auth_type != AuthNone) {
 user = s-sess_params.cred.user;
 }
-auth_type = s-sess_params.auth_type;
 mutual_auth = s-sess_params.mutual_auth;
 	(void) memset(s, 0x0, sizeof(*s));
 	s-state = INITIATOR_SESSION_STATE_INITIALIZING;
@@ -468,7 +468,11 @@
 	if (security == IS_SECURITY) {
 		PARAM_TEXT_ADD(sess-params, InitiatorName, iqn.1994-04.org.NetBSD.iscsi-initiator:agc, text, len, textsize, 1, return -1);
 		PARAM_TEXT_ADD(sess-params, InitiatorAlias, NetBSD, text, len, textsize, 1, return -1);
-		PARAM_TEXT_ADD(sess-params, AuthMethod, CHAP,None, text, len, textsize, 1, return -1);
+		if (sess-sess_params.auth_type != AuthNone) {
+			PARAM_TEXT_ADD(sess-params, AuthMethod, CHAP,None, text, len, textsize, 1, return -1);
+		} else {
+			PARAM_TEXT_ADD(sess-params, AuthMethod, None, text, len, textsize, 1, return -1);
+		}
 	} else {
 		PARAM_TEXT_ADD(sess-params, HeaderDigest, None, text, len, textsize, 1, return -1);
 		PARAM_TEXT_ADD(sess-params, DataDigest, None, text, len, textsize, 1, return -1);
@@ -890,11 +894,13 @@
 			INIT_CLEANUP;
 			return -1;
 		}
-		sess-sess_params.cred.user =
-strdup(iscsi_initiator_getvar(ini, user));
 		cp = iscsi_initiator_getvar(ini, auth type);
 		if (strcmp(cp, none) == 0) {
 			sess-sess_params.auth_type = AuthNone;
+			sess-sess_params.cred.user = NULL;
+		} else {
+			sess-sess_params.cred.user =
+strdup

CVS commit: src/share/man/man5

2011-02-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 21 18:12:26 UTC 2011

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
Typo in macro.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/share/man/man5/mk.conf.5

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/man5/mk.conf.5
diff -u src/share/man/man5/mk.conf.5:1.51 src/share/man/man5/mk.conf.5:1.52
--- src/share/man/man5/mk.conf.5:1.51	Tue Mar  2 07:26:47 2010
+++ src/share/man/man5/mk.conf.5	Mon Feb 21 18:12:26 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: mk.conf.5,v 1.51 2010/03/02 07:26:47 jruoho Exp $
+.\	$NetBSD: mk.conf.5,v 1.52 2011/02/21 18:12:26 njoly Exp $
 .\
 .\  Copyright (c) 1999-2003 The NetBSD Foundation, Inc.
 .\  All rights reserved.
@@ -331,7 +331,7 @@
 and
 .Pa /sbin
 statically.
-.DFTLy
+.DFLTy
 .
 .It Sy MKGCC
 .YorN



CVS commit: src/lib/librumphijack

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 20:11:57 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
If minfd for F_DUPFD is = hijackoff, assume it means a minimum
value in the rump kernel and adjust accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.62 src/lib/librumphijack/hijack.c:1.63
--- src/lib/librumphijack/hijack.c:1.62	Mon Feb 21 13:19:35 2011
+++ src/lib/librumphijack/hijack.c	Mon Feb 21 20:11:56 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.62 2011/02/21 13:19:35 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.63 2011/02/21 20:11:56 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.62 2011/02/21 13:19:35 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.63 2011/02/21 20:11:56 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -604,6 +604,8 @@
 	if (fd_isrump(oldd)) {
 		op_fcntl = GETSYSCALL(rump, FCNTL);
 		oldd = fd_host2rump(oldd);
+		if (minfd = HIJACK_FDOFF)
+			minfd -= HIJACK_FDOFF;
 		isrump = 1;
 	} else {
 		op_fcntl = GETSYSCALL(host, FCNTL);



CVS commit: src/sys

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 20:23:29 UTC 2011

Modified Files:
src/sys/kern: kern_exec.c kern_exit.c kern_lwp.c
src/sys/sys: lwp.h

Log Message:
Borrow the lwpctl data area from the parent for the vfork() child.
Otherwise the child will incorrectly see it is not running on any
CPU.  Among other things, this fixes crashes from having
LD_PRELOAD=libpthread.so set in the env.

reviewed by tech-kern


To generate a diff of this commit:
cvs rdiff -u -r1.307 -r1.308 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.231 -r1.232 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.155 -r1.156 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.148 -r1.149 src/sys/sys/lwp.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/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.307 src/sys/kern/kern_exec.c:1.308
--- src/sys/kern/kern_exec.c:1.307	Tue Feb 15 16:49:54 2011
+++ src/sys/kern/kern_exec.c	Mon Feb 21 20:23:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.307 2011/02/15 16:49:54 pooka Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.308 2011/02/21 20:23:29 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.307 2011/02/15 16:49:54 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.308 2011/02/21 20:23:29 pooka Exp $);
 
 #include opt_ktrace.h
 #include opt_modular.h
@@ -978,6 +978,7 @@
 	 */
 	if ((p-p_lflag  PL_PPWAIT) != 0) {
 		mutex_enter(proc_lock);
+		l-l_lwpctl = NULL; /* was on loan from blocked parent */
 		p-p_lflag = ~PL_PPWAIT;
 		cv_broadcast(p-p_pptr-p_waitcv);
 		mutex_exit(proc_lock);

Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.231 src/sys/kern/kern_exit.c:1.232
--- src/sys/kern/kern_exit.c:1.231	Sat Dec 18 01:36:19 2010
+++ src/sys/kern/kern_exit.c	Mon Feb 21 20:23:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.231 2010/12/18 01:36:19 rmind Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.232 2011/02/21 20:23:28 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_exit.c,v 1.231 2010/12/18 01:36:19 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exit.c,v 1.232 2011/02/21 20:23:28 pooka Exp $);
 
 #include opt_ktrace.h
 #include opt_perfctrs.h
@@ -341,6 +341,7 @@
 	 */
 	mutex_enter(proc_lock);
 	if (p-p_lflag  PL_PPWAIT) {
+		l-l_lwpctl = NULL; /* was on loan from blocked parent */
 		p-p_lflag = ~PL_PPWAIT;
 		cv_broadcast(p-p_pptr-p_waitcv);
 	}

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.155 src/sys/kern/kern_lwp.c:1.156
--- src/sys/kern/kern_lwp.c:1.155	Thu Feb 17 18:50:02 2011
+++ src/sys/kern/kern_lwp.c	Mon Feb 21 20:23:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.155 2011/02/17 18:50:02 matt Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.156 2011/02/21 20:23:28 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_lwp.c,v 1.155 2011/02/17 18:50:02 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_lwp.c,v 1.156 2011/02/21 20:23:28 pooka Exp $);
 
 #include opt_ddb.h
 #include opt_lockdebug.h
@@ -697,6 +697,15 @@
 	TAILQ_INIT(l2-l_ld_locks);
 
 	/*
+	 * For vfork, borrow parent's lwpctl context if it exists.
+	 * This also causes us to return via lwp_userret.
+	 */
+	if (flags  LWP_VFORK  l1-l_lwpctl) {
+		l2-l_lwpctl = l1-l_lwpctl;
+		l2-l_flag |= LW_LWPCTL;
+	}
+
+	/*
 	 * If not the first LWP in the process, grab a reference to the
 	 * descriptor table.
 	 */
@@ -1377,6 +1386,16 @@
 			KASSERT(0);
 			/* NOTREACHED */
 		}
+
+		/* update lwpctl processor (for vfork child_return) */
+		if (l-l_flag  LW_LWPCTL) {
+			lwp_lock(l);
+			KASSERT(kpreempt_disabled());
+			l-l_lwpctl-lc_curcpu = (int)cpu_index(l-l_cpu);
+			l-l_lwpctl-lc_pctr++;
+			l-l_flag = ~LW_LWPCTL;
+			lwp_unlock(l);
+		}
 	}
 
 #ifdef KERN_SA
@@ -1530,6 +1549,10 @@
 	l = curlwp;
 	p = l-l_proc;
 
+	/* don't allow a vforked process to create lwp ctls */
+	if (p-p_lflag  PL_PPWAIT)
+		return EBUSY;
+
 	if (l-l_lcpage != NULL) {
 		lcp = l-l_lcpage;
 		*uaddr = lcp-lcp_uaddr + (vaddr_t)l-l_lwpctl - lcp-lcp_kaddr;
@@ -1654,11 +1677,18 @@
 void
 lwp_ctl_free(lwp_t *l)
 {
+	struct proc *p = l-l_proc;
 	lcproc_t *lp;
 	lcpage_t *lcp;
 	u_int map, offset;
 
-	lp = l-l_proc-p_lwpctl;
+	/* don't free a lwp context we borrowed for vfork */
+	if (p-p_lflag  PL_PPWAIT) {
+		l-l_lwpctl = NULL;
+		return;
+	}
+
+	lp = p-p_lwpctl;
 	KASSERT(lp != NULL);
 
 	lcp = l-l_lcpage;

Index: src/sys/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.148 src/sys/sys/lwp.h:1.149
--- src/sys/sys/lwp.h:1.148	Sat Feb 19 20:19:54 2011
+++ src/sys/sys/lwp.h	Mon Feb 21 20:23:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.148 2011/02/19 20:19:54 matt Exp $	

CVS commit: src/tests/lib/libpthread

2011-02-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Feb 21 21:43:41 UTC 2011

Modified Files:
src/tests/lib/libpthread: t_mutex.c

Log Message:
mutex2/mutex3 are expected to fail on powerpc because of
PR port-powerpc/44387.

XXX the ugly sleep at the end is because ATF will mark an un-triggered
race condition (ie, the test passes unexpectedly) as a test failure otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libpthread/t_mutex.c

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

Modified files:

Index: src/tests/lib/libpthread/t_mutex.c
diff -u src/tests/lib/libpthread/t_mutex.c:1.3 src/tests/lib/libpthread/t_mutex.c:1.4
--- src/tests/lib/libpthread/t_mutex.c:1.3	Sun Feb 20 14:37:44 2011
+++ src/tests/lib/libpthread/t_mutex.c	Mon Feb 21 21:43:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mutex.c,v 1.3 2011/02/20 14:37:44 jmmv Exp $ */
+/* $NetBSD: t_mutex.c,v 1.4 2011/02/21 21:43:41 riz Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,13 +29,15 @@
 #include sys/cdefs.h
 __COPYRIGHT(@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.);
-__RCSID($NetBSD: t_mutex.c,v 1.3 2011/02/20 14:37:44 jmmv Exp $);
+__RCSID($NetBSD: t_mutex.c,v 1.4 2011/02/21 21:43:41 riz Exp $);
 
 #include pthread.h
 #include stdio.h
+#include string.h
 #include unistd.h
 
 #include atf-c.h
+#include atf-c/config.h
 
 #include h_common.h
 
@@ -116,17 +118,24 @@
 ATF_TC_HEAD(mutex2, tc)
 {
 	atf_tc_set_md_var(tc, descr, Checks mutexes);
+	atf_tc_set_md_var(tc, timeout, 40);
 }
 ATF_TC_BODY(mutex2, tc)
 {
+	const char *m_arch;
 	int count, count2;
 	pthread_t new;
 	void *joinval;
 
 	printf(1: Mutex-test 2\n);
 
-	PTHREAD_REQUIRE(pthread_mutex_init(mutex, NULL));
+	m_arch = atf_config_get(atf_arch);
+	if (strcmp(m_arch, powerpc) == 0) {
+		atf_tc_expect_timeout(PR port-powerpc/44387);
+	}
 
+	PTHREAD_REQUIRE(pthread_mutex_init(mutex, NULL));
+	
 	global_x = 0;
 	count = count2 = 1000;
 
@@ -149,6 +158,14 @@
 	printf(1: Thread joined. X was %d. Return value (long) was %ld\n,
 		global_x, (long)joinval);
 	ATF_REQUIRE_EQ(global_x, 2000);
+
+	/* XXX force a timeout in ppc case since an un-triggered race
+	   otherwise looks like a failure */
+	if (strcmp(m_arch, powerpc) == 0) {
+		/* We sleep for longer than the timeout to make ATF not
+		   complain about unexpected success */
+		sleep(41);
+	}
 }
 
 static void *
@@ -172,15 +189,22 @@
 {
 	atf_tc_set_md_var(tc, descr, Checks mutexes using a static 
 	initializer);
+	atf_tc_set_md_var(tc, timeout, 40);
 }
 ATF_TC_BODY(mutex3, tc)
 {
+	const char *m_arch;
 	int count, count2;
 	pthread_t new;
 	void *joinval;
 
 	printf(1: Mutex-test 3\n);
 
+	m_arch = atf_config_get(atf_arch);
+	if (strcmp(m_arch, powerpc) == 0) {
+		atf_tc_expect_timeout(PR port-powerpc/44387);
+	}
+
 	global_x = 0;
 	count = count2 = 1000;
 
@@ -203,6 +227,14 @@
 	printf(1: Thread joined. X was %d. Return value (long) was %ld\n,
 		global_x, (long)joinval);
 	ATF_REQUIRE_EQ(global_x, 2000);
+
+	/* XXX force a timeout in ppc case since an un-triggered race
+	   otherwise looks like a failure */
+	if (strcmp(m_arch, powerpc) == 0) {
+		/* We sleep for longer than the timeout to make ATF not
+		   complain about unexpected success */
+		sleep(41);
+	}
 }
 
 static void *



CVS commit: src/lib/libc

2011-02-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 21 22:07:45 UTC 2011

Modified Files:
src/lib/libc/compat/time: compat_localtime.c
src/lib/libc/time: localtime.c

Log Message:
remove duplicate weak aliases


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/time/compat_localtime.c
cvs rdiff -u -r1.55 -r1.56 src/lib/libc/time/localtime.c

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

Modified files:

Index: src/lib/libc/compat/time/compat_localtime.c
diff -u src/lib/libc/compat/time/compat_localtime.c:1.2 src/lib/libc/compat/time/compat_localtime.c:1.3
--- src/lib/libc/compat/time/compat_localtime.c:1.2	Sat Jan 10 22:46:25 2009
+++ src/lib/libc/compat/time/compat_localtime.c	Mon Feb 21 17:07:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_localtime.c,v 1.2 2009/01/11 03:46:25 christos Exp $	*/
+/*	$NetBSD: compat_localtime.c,v 1.3 2011/02/21 22:07:44 christos Exp $	*/
 
 /*
  * Written by Jason R. Thorpe thor...@netbsd.org, October 21, 1997.
@@ -16,10 +16,14 @@
 
 #ifdef __weak_alias
 __weak_alias(ctime_r,_ctime_r)
+__weak_alias(ctime_rz,_ctime_rz)
 __weak_alias(gmtime_r,_gmtime_r)
 __weak_alias(localtime_r,_localtime_r)
+__weak_alias(localtime_rz,_localtime_rz)
+__weak_alias(mktime_z,_mktime_z)
 __weak_alias(offtime,_offtime)
 __weak_alias(posix2time,_posix2time)
+__weak_alias(posix2time_z,_posix2time_z)
 __weak_alias(time2posix,_time2posix)
 __weak_alias(timegm,_timegm)
 __weak_alias(timelocal,_timelocal)
@@ -31,18 +35,30 @@
 __warn_references(ctime_r,
 warning: reference to compatibility ctime_r();
  include time.h for correct reference)
+__warn_references(ctime_rz,
+warning: reference to compatibility ctime_rz();
+ include time.h for correct reference)
 __warn_references(gmtime_r,
 warning: reference to compatibility gmtime_r();
  include time.h for correct reference)
 __warn_references(localtime_r,
 warning: reference to compatibility localtime_r();
  include time.h for correct reference)
+__warn_references(localtime_rz,
+warning: reference to compatibility localtime_rz();
+ include time.h for correct reference)
+__warn_references(mktime_z,
+warning: reference to compatibility mktime_z();
+ include time.h for correct reference)
 __warn_references(offtime,
 warning: reference to compatibility offtime();
  include time.h for correct reference)
 __warn_references(posix2time,
 warning: reference to compatibility posix2time();
  include time.h for correct reference)
+__warn_references(posix2time_z,
+warning: reference to compatibility posix2time_z();
+ include time.h for correct reference)
 __warn_references(time2posix,
 warning: reference to compatibility time2posix();
  include time.h for correct reference)

Index: src/lib/libc/time/localtime.c
diff -u src/lib/libc/time/localtime.c:1.55 src/lib/libc/time/localtime.c:1.56
--- src/lib/libc/time/localtime.c:1.55	Sun Feb 13 18:58:40 2011
+++ src/lib/libc/time/localtime.c	Mon Feb 21 17:07:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.55 2011/02/13 23:58:40 christos Exp $	*/
+/*	$NetBSD: localtime.c,v 1.56 2011/02/21 22:07:44 christos Exp $	*/
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char	elsieid[] = @(#)localtime.c	8.9;
 #else
-__RCSID($NetBSD: localtime.c,v 1.55 2011/02/13 23:58:40 christos Exp $);
+__RCSID($NetBSD: localtime.c,v 1.56 2011/02/21 22:07:44 christos Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -28,14 +28,7 @@
 #include reentrant.h
 
 #if defined(__weak_alias)
-__weak_alias(ctime_r,_ctime_r)
-__weak_alias(ctime_rz,_ctime_rz)
 __weak_alias(daylight,_daylight)
-__weak_alias(mktime_z,_mktime_z)
-__weak_alias(localtime_r,_localtime_r)
-__weak_alias(localtime_rz,_localtime_rz)
-__weak_alias(posix2time,_posix2time)
-__weak_alias(posix2time_z,_posix2time_z)
 __weak_alias(tzname,_tzname)
 #endif
 



CVS commit: src/sys/netipsec

2011-02-21 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon Feb 21 22:54:45 UTC 2011

Modified Files:
src/sys/netipsec: ipsec_input.c

Log Message:
adopt a fix from OpenBSD: when scanning the IPv6 header chain, take
into account that the extension header type is not in the extension
header itself but in the previous one -- this makes a difference
because (a) the length field is different for AH than for all others
and (b) the offset of the next type field isn't the same in primary
and extension headers.
(I didn't manage to trigger the bug in my tests, no extension headers
besides AH made it to that point. Didn't try hard enough -- the fix
is still valid.)


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/netipsec/ipsec_input.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/netipsec/ipsec_input.c
diff -u src/sys/netipsec/ipsec_input.c:1.26 src/sys/netipsec/ipsec_input.c:1.27
--- src/sys/netipsec/ipsec_input.c:1.26	Fri Feb 18 16:10:11 2011
+++ src/sys/netipsec/ipsec_input.c	Mon Feb 21 22:54:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_input.c,v 1.26 2011/02/18 16:10:11 drochner Exp $	*/
+/*	$NetBSD: ipsec_input.c,v 1.27 2011/02/21 22:54:45 drochner Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec_input.c,v 1.2.4.2 2003/03/28 20:32:53 sam Exp $	*/
 /*	$OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $	*/
 
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipsec_input.c,v 1.26 2011/02/18 16:10:11 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipsec_input.c,v 1.27 2011/02/21 22:54:45 drochner Exp $);
 
 /*
  * IPsec input processing.
@@ -477,7 +477,7 @@
 ipsec6_common_input(struct mbuf **mp, int *offp, int proto)
 {
 	int l = 0;
-	int protoff;
+	int protoff, nxt;
 	struct ip6_ext ip6e;
 
 	if (*offp  sizeof(struct ip6_hdr)) {
@@ -491,17 +491,20 @@
 	} else {
 		/* Chase down the header chain... */
 		protoff = sizeof(struct ip6_hdr);
+		nxt = (mtod(*mp, struct ip6_hdr *))-ip6_nxt;
 
 		do {
 			protoff += l;
 			m_copydata(*mp, protoff, sizeof(ip6e), ip6e);
 
-			if (ip6e.ip6e_nxt == IPPROTO_AH)
+			if (nxt == IPPROTO_AH)
 l = (ip6e.ip6e_len + 2)  2;
 			else
 l = (ip6e.ip6e_len + 1)  3;
 			IPSEC_ASSERT(l  0,
 			  (ipsec6_common_input: l went zero or negative));
+
+			nxt = ip6e.ip6e_nxt;
 		} while (protoff + l  *offp);
 
 		/* Malformed packet check */



CVS commit: src/doc

2011-02-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 21 22:26:10 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
belated mention for libsaslc.


To generate a diff of this commit:
cvs rdiff -u -r1.1511 -r1.1512 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.1511 src/doc/CHANGES:1.1512
--- src/doc/CHANGES:1.1511	Mon Feb 21 06:09:16 2011
+++ src/doc/CHANGES	Mon Feb 21 17:26:10 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1511 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1512 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -866,3 +866,7 @@
 		preemption.  Added support for RMI (NetLogic) XLS/XLR models.
 		Major clean up for MIPS port. [matt 20110220]
 	ath(4): Add support for AR9285 devices. [cegger 20110221]
+	libsaslc)(3): Complete integration of libsaslc written for SoC 2010
+		by Mateusz Kocielski, improved and integrated with Postfix
+		by Anon Ymous. Supported mechs are: ANONYMOUS, CRAM-MD5,
+		DIGEST-MD5, EXTERNAL, GSSAPI, LOGIN, PLAIN [christos 20110221]



CVS commit: src/sys/kern

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 23:20:20 UTC 2011

Modified Files:
src/sys/kern: makesyscalls.sh syscalls.master

Log Message:
Add syscall type NOERR which signals that a system call is STD but
does not return an errno the usual way.  The main use case is to
fix the posix_fadvise() rump stub (yes, posix_fadvise is a bit
special... bologna).

The list of NOERR syscalls currently matches the libc NOERR list
(and the libc Makefile can in the future be autogenerated from this
info).

Problem spotted by, *shocker*, the automated test runs, specifically
the posix_fadvise test.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r1.244 -r1.245 src/sys/kern/syscalls.master

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/makesyscalls.sh
diff -u src/sys/kern/makesyscalls.sh:1.110 src/sys/kern/makesyscalls.sh:1.111
--- src/sys/kern/makesyscalls.sh:1.110	Mon Feb 21 11:29:53 2011
+++ src/sys/kern/makesyscalls.sh	Mon Feb 21 23:20:19 2011
@@ -1,5 +1,5 @@
 #! /bin/sh -
-#	$NetBSD: makesyscalls.sh,v 1.110 2011/02/21 11:29:53 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.111 2011/02/21 23:20:19 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -717,7 +717,8 @@
 	 sysnamesbottom
 
 	# output syscall number of header, if appropriate
-	if (type == STD || type == NOARGS || type == INDIR) {
+	if (type == STD || type == NOARGS || type == INDIR || \
+	type == NOERR) {
 		# output a prototype, to be used to generate lint stubs in
 		# libc.
 		printproto()
@@ -776,8 +777,9 @@
 	}
 	printf(%s %s)\n, uncompattype(argtype[argc]), argname[argc]) \
 	 rumpcalls
-	printf({\n\tregister_t rval[2] = {0, 0};\n\tint error = 0;\n) \
-	 rumpcalls
+	printf({\n\tregister_t rval[2] = {0, 0};\n)  rumpcalls
+	if (returntype != void)
+		printf(\tint error = 0;\n)  rumpcalls
 
 	argarg = NULL
 	argsize = 0;
@@ -805,20 +807,29 @@
 	} else {
 		printf(\n)  rumpcalls
 	}
-	printf(\terror = rsys_syscall(%s%s%s,  \
+	printf(\t)  rumpcalls
+	if (returntype != void)
+		printf(error = )  rumpcalls
+	printf(rsys_syscall(%s%s%s,  \
 	%s, %s, rval);\n, constprefix, compatwrap_, funcalias, \
 	argarg, argsize)  rumpcalls
-	printf(\trsys_seterrno(error);\n)  rumpcalls
-	printf(\tif (error) {\n\t\trval[0] = -1;\n\t}\n)  rumpcalls
+	if (type != NOERR) {
+		printf(\trsys_seterrno(error);\n)  rumpcalls
+		printf(\tif (error) {\n\t\trval[0] = -1;\n\t}\n)  rumpcalls
+		rvariable = rval[0];
+	} else {
+		rvariable = error;
+	}
 	if (returntype != void) {
-		printf(\treturn rval[0];\n)  rumpcalls
+		printf(\treturn %s;\n, rvariable)  rumpcalls
 	}
 	printf(}\n)  rumpcalls
 	printf(rsys_alias(%s%s,rump_enosys)\n, \
 	compatwrap_, funcname)  rumpcalls
 
 }
-$2 == STD || $2 == NODEF || $2 == NOARGS || $2 == INDIR {
+$2 == STD || $2 == NODEF || $2 == NOARGS || $2 == INDIR \
+|| $2 == NOERR {
 	parseline()
 	putent($2, )
 	syscall++

Index: src/sys/kern/syscalls.master
diff -u src/sys/kern/syscalls.master:1.244 src/sys/kern/syscalls.master:1.245
--- src/sys/kern/syscalls.master:1.244	Mon Feb 21 12:49:06 2011
+++ src/sys/kern/syscalls.master	Mon Feb 21 23:20:19 2011
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.244 2011/02/21 12:49:06 pooka Exp $
+	$NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -13,7 +13,7 @@
 ; Optional fields are specified after the type field
 ; (NOTE! they *must* be specified in this order):
 ;	MODULAR:attempt to autoload system call if not present
-;	RUMP:	the system call can be called directly from rumps
+;	RUMP:	generate rump syscall entry point
 ;
 ; types:
 ;	STD	always included
@@ -25,6 +25,7 @@
 ;	NOARGS	included, but don't define the syscall args structure
 ;	INDIR	included, but don't define the syscall args structure,
 ;		and allow it to be really varargs.
+;	NOERR	included, syscall does not set errno
 ;
 ; arguments:
 ;	PAD	argument not part of the C interface, used only for padding
@@ -90,13 +91,13 @@
 			long bufsize, int flags); }
 19	COMPAT_43 MODULAR { long|sys||lseek(int fd, long offset, int whence); }\
 			olseek
-20	STD 	RUMP	{ pid_t|sys||getpid_with_ppid(void); } getpid
+20	NOERR 	RUMP	{ pid_t|sys||getpid_with_ppid(void); } getpid
 21	COMPAT_40 MODULAR { int|sys||mount(const char *type, const char *path, \
 			int flags, void *data); }
 22	STD 	 RUMP	{ int|sys||unmount(const char *path, int flags); }
 23	STD 	RUMP	{ int|sys||setuid(uid_t uid); }
-24	STD 	RUMP	{ uid_t|sys||getuid_with_euid(void); } getuid
-25	STD 	RUMP	{ uid_t|sys||geteuid(void); }
+24	NOERR 	RUMP	{ uid_t|sys||getuid_with_euid(void); } getuid
+25	NOERR 	RUMP	{ uid_t|sys||geteuid(void); }
 26	STD 		{ int|sys||ptrace(int req, pid_t pid, void *addr, \
 			int data); }
 27	STD 	RUMP	{ ssize_t|sys||recvmsg(int 

CVS commit: src/sys/netipsec

2011-02-21 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon Feb 21 22:21:41 UTC 2011

Modified Files:
src/sys/netipsec: key_debug.c key_debug.h

Log Message:
declare input to kdebug_*() functions which dump structures
to stdout in human readable form as const


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/netipsec/key_debug.c
cvs rdiff -u -r1.5 -r1.6 src/sys/netipsec/key_debug.h

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

Modified files:

Index: src/sys/netipsec/key_debug.c
diff -u src/sys/netipsec/key_debug.c:1.9 src/sys/netipsec/key_debug.c:1.10
--- src/sys/netipsec/key_debug.c:1.9	Sat Jul  7 18:38:23 2007
+++ src/sys/netipsec/key_debug.c	Mon Feb 21 22:21:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: key_debug.c,v 1.9 2007/07/07 18:38:23 degroote Exp $	*/
+/*	$NetBSD: key_debug.c,v 1.10 2011/02/21 22:21:40 drochner Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key_debug.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$KAME: key_debug.c,v 1.26 2001/06/27 10:46:50 sakane Exp $	*/
 
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: key_debug.c,v 1.9 2007/07/07 18:38:23 degroote Exp $);
+__KERNEL_RCSID(0, $NetBSD: key_debug.c,v 1.10 2011/02/21 22:21:40 drochner Exp $);
 #endif
 
 #include opt_inet.h
@@ -65,17 +65,17 @@
 #include stdlib.h
 #endif /* !_KERNEL */
 
-static void kdebug_sadb_prop (struct sadb_ext *);
-static void kdebug_sadb_identity (struct sadb_ext *);
-static void kdebug_sadb_supported (struct sadb_ext *);
-static void kdebug_sadb_lifetime (struct sadb_ext *);
-static void kdebug_sadb_sa (struct sadb_ext *);
-static void kdebug_sadb_address (struct sadb_ext *);
-static void kdebug_sadb_key (struct sadb_ext *);
-static void kdebug_sadb_x_sa2 (struct sadb_ext *);
+static void kdebug_sadb_prop (const struct sadb_ext *);
+static void kdebug_sadb_identity (const struct sadb_ext *);
+static void kdebug_sadb_supported (const struct sadb_ext *);
+static void kdebug_sadb_lifetime (const struct sadb_ext *);
+static void kdebug_sadb_sa (const struct sadb_ext *);
+static void kdebug_sadb_address (const struct sadb_ext *);
+static void kdebug_sadb_key (const struct sadb_ext *);
+static void kdebug_sadb_x_sa2 (const struct sadb_ext *);
 
 #ifdef _KERNEL
-static void kdebug_secreplay (struct secreplay *);
+static void kdebug_secreplay (const struct secreplay *);
 #endif
 
 #ifndef _KERNEL
@@ -86,9 +86,9 @@
 
 /* %%%: about struct sadb_msg */
 void
-kdebug_sadb(struct sadb_msg *base)
+kdebug_sadb(const struct sadb_msg *base)
 {
-	struct sadb_ext *ext;
+	const struct sadb_ext *ext;
 	int tlen, extlen;
 
 	/* sanity check */
@@ -103,7 +103,7 @@
 	base-sadb_msg_seq, base-sadb_msg_pid);
 
 	tlen = PFKEY_UNUNIT64(base-sadb_msg_len) - sizeof(struct sadb_msg);
-	ext = (struct sadb_ext *)((char *)base + sizeof(struct sadb_msg));
+	ext = (const struct sadb_ext *)((const char *)base + sizeof(struct sadb_msg));
 
 	while (tlen  0) {
 		printf(sadb_ext{ len=%u type=%u }\n,
@@ -166,17 +166,17 @@
 
 		extlen = PFKEY_UNUNIT64(ext-sadb_ext_len);
 		tlen -= extlen;
-		ext = (struct sadb_ext *)((char *)ext + extlen);
+		ext = (const struct sadb_ext *)((const char *)ext + extlen);
 	}
 
 	return;
 }
 
 static void
-kdebug_sadb_prop(struct sadb_ext *ext)
+kdebug_sadb_prop(const struct sadb_ext *ext)
 {
-	struct sadb_prop *prop = (struct sadb_prop *)ext;
-	struct sadb_comb *comb;
+	const struct sadb_prop *prop = (const struct sadb_prop *)ext;
+	const struct sadb_comb *comb;
 	int len;
 
 	/* sanity check */
@@ -185,7 +185,7 @@
 
 	len = (PFKEY_UNUNIT64(prop-sadb_prop_len) - sizeof(*prop))
 		/ sizeof(*comb);
-	comb = (struct sadb_comb *)(prop + 1);
+	comb = (const struct sadb_comb *)(prop + 1);
 	printf(sadb_prop{ replay=%u\n, prop-sadb_prop_replay);
 
 	while (len--) {
@@ -222,9 +222,9 @@
 }
 
 static void
-kdebug_sadb_identity(struct sadb_ext *ext)
+kdebug_sadb_identity(const struct sadb_ext *ext)
 {
-	struct sadb_ident *id = (struct sadb_ident *)ext;
+	const struct sadb_ident *id = (const struct sadb_ident *)ext;
 	int len;
 
 	/* sanity check */
@@ -240,11 +240,11 @@
 			id-sadb_ident_type, (u_long)id-sadb_ident_id);
 		if (len) {
 #ifdef _KERNEL
-			ipsec_hexdump((char *)(id + 1), len); /*XXX cast ?*/
+			ipsec_hexdump((const char *)(id + 1), len); /*XXX cast ?*/
 #else
-			char *p, *ep;
+			const char *p, *ep;
 			printf(\n  str=\);
-			p = (char *)(id + 1);
+			p = (const char *)(id + 1);
 			ep = p + len;
 			for (/*nothing*/; *p  p  ep; p++) {
 if (isprint(*p))
@@ -264,10 +264,10 @@
 }
 
 static void
-kdebug_sadb_supported(struct sadb_ext *ext)
+kdebug_sadb_supported(const struct sadb_ext *ext)
 {
-	struct sadb_supported *sup = (struct sadb_supported *)ext;
-	struct sadb_alg *alg;
+	const struct sadb_supported *sup = (const struct sadb_supported *)ext;
+	const struct sadb_alg *alg;
 	int len;
 
 	/* sanity check */
@@ -276,7 +276,7 @@
 
 	len = (PFKEY_UNUNIT64(sup-sadb_supported_len) - 

CVS commit: src/sys/netipsec

2011-02-21 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon Feb 21 22:28:19 UTC 2011

Modified Files:
src/sys/netipsec: key.c key.h

Log Message:
treat struct secpolicyindex and struct secasindex as const once
they are initialized -- during lifetime, no changes are expected
plus some constification of input to comparision functions etc
mostly required by the former


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/netipsec/key.c
cvs rdiff -u -r1.8 -r1.9 src/sys/netipsec/key.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/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.65 src/sys/netipsec/key.c:1.66
--- src/sys/netipsec/key.c:1.65	Fri Feb 18 20:40:58 2011
+++ src/sys/netipsec/key.c	Mon Feb 21 22:28:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.65 2011/02/18 20:40:58 drochner Exp $	*/
+/*	$NetBSD: key.c,v 1.66 2011/02/21 22:28:18 drochner Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 	
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: key.c,v 1.65 2011/02/18 20:40:58 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: key.c,v 1.66 2011/02/21 22:28:18 drochner Exp $);
 
 /*
  * This code is referd to RFC 2367
@@ -152,18 +152,18 @@
 static LIST_HEAD(_spacqtree, secspacq) spacqtree;	/* SP acquiring list */
 
 /* search order for SAs */
-static u_int saorder_state_valid[] = {
+static const u_int saorder_state_valid[] = {
 	SADB_SASTATE_DYING, SADB_SASTATE_MATURE,
 	/*
 	 * This order is important because we must select the oldest SA
 	 * for outbound processing.  For inbound, This is not important.
 	 */
 };
-static u_int saorder_state_alive[] = {
+static const u_int saorder_state_alive[] = {
 	/* except DEAD */
 	SADB_SASTATE_MATURE, SADB_SASTATE_DYING, SADB_SASTATE_LARVAL
 };
-static u_int saorder_state_any[] = {
+static const u_int saorder_state_any[] = {
 	SADB_SASTATE_MATURE, SADB_SASTATE_DYING,
 	SADB_SASTATE_LARVAL, SADB_SASTATE_DEAD
 };
@@ -379,7 +379,7 @@
 static void key_freesp_so (struct secpolicy **);
 static struct secasvar *key_do_allocsa_policy (struct secashead *, u_int);
 static void key_delsp (struct secpolicy *);
-static struct secpolicy *key_getsp (struct secpolicyindex *);
+static struct secpolicy *key_getsp (const struct secpolicyindex *);
 static struct secpolicy *key_getspbyid (u_int32_t);
 static u_int16_t key_newreqid (void);
 static struct mbuf *key_gather_mbuf (struct mbuf *,
@@ -405,9 +405,9 @@
 #endif
 static struct mbuf *key_setdumpsp (struct secpolicy *,
 	u_int8_t, u_int32_t, pid_t);
-static u_int key_getspreqmsglen (struct secpolicy *);
+static u_int key_getspreqmsglen (const struct secpolicy *);
 static int key_spdexpire (struct secpolicy *);
-static struct secashead *key_newsah (struct secasindex *);
+static struct secashead *key_newsah (const struct secasindex *);
 static void key_delsah (struct secashead *);
 static struct secasvar *key_newsav (struct mbuf *,
 	const struct sadb_msghdr *, struct secashead *, int *,
@@ -415,8 +415,8 @@
 #define	KEY_NEWSAV(m, sadb, sah, e)\
 	key_newsav(m, sadb, sah, e, __FILE__, __LINE__)
 static void key_delsav (struct secasvar *);
-static struct secashead *key_getsah (struct secasindex *);
-static struct secasvar *key_checkspidup (struct secasindex *, u_int32_t);
+static struct secashead *key_getsah (const struct secasindex *);
+static struct secasvar *key_checkspidup (const struct secasindex *, u_int32_t);
 static struct secasvar *key_getsavbyspi (struct secashead *, u_int32_t);
 static int key_setsaval (struct secasvar *, struct mbuf *,
 	const struct sadb_msghdr *);
@@ -443,7 +443,7 @@
 	u_int32_t);
 static void *key_newbuf (const void *, u_int);
 #ifdef INET6
-static int key_ismyaddr6 (struct sockaddr_in6 *);
+static int key_ismyaddr6 (const struct sockaddr_in6 *);
 #endif
 
 /* flags for key_cmpsaidx() */
@@ -462,8 +462,8 @@
 
 static int key_getspi (struct socket *, struct mbuf *,
 	const struct sadb_msghdr *);
-static u_int32_t key_do_getnewspi (struct sadb_spirange *,
-	struct secasindex *);
+static u_int32_t key_do_getnewspi (const struct sadb_spirange *,
+	const struct secasindex *);
 #ifdef IPSEC_NAT_T
 static int key_handle_natt_info (struct secasvar *, 
  const struct sadb_msghdr *);
@@ -499,8 +499,8 @@
 static struct secacq *key_getacq (const struct secasindex *);
 static struct secacq *key_getacqbyseq (u_int32_t);
 #endif
-static struct secspacq *key_newspacq (struct secpolicyindex *);
-static struct secspacq *key_getspacq (struct secpolicyindex *);
+static struct secspacq *key_newspacq (const struct secpolicyindex *);
+static struct secspacq *key_getspacq (const struct secpolicyindex *);
 static int key_acquire2 (struct socket *, struct mbuf *,
 	const struct sadb_msghdr *);
 static int key_register (struct socket *, struct mbuf *,
@@ -592,7 +592,7 @@

CVS commit: src/sys/kern

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 23:30:13 UTC 2011

Modified Files:
src/sys/kern: makesyscalls.sh

Log Message:
S'no way bro!

Return the correct return value from NOERR, which is retval
instead of error.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/kern/makesyscalls.sh

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/makesyscalls.sh
diff -u src/sys/kern/makesyscalls.sh:1.111 src/sys/kern/makesyscalls.sh:1.112
--- src/sys/kern/makesyscalls.sh:1.111	Mon Feb 21 23:20:19 2011
+++ src/sys/kern/makesyscalls.sh	Mon Feb 21 23:30:12 2011
@@ -1,5 +1,5 @@
 #! /bin/sh -
-#	$NetBSD: makesyscalls.sh,v 1.111 2011/02/21 23:20:19 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.112 2011/02/21 23:30:12 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -778,7 +778,7 @@
 	printf(%s %s)\n, uncompattype(argtype[argc]), argname[argc]) \
 	 rumpcalls
 	printf({\n\tregister_t rval[2] = {0, 0};\n)  rumpcalls
-	if (returntype != void)
+	if (returntype != void  type != NOERR)
 		printf(\tint error = 0;\n)  rumpcalls
 
 	argarg = NULL
@@ -808,7 +808,7 @@
 		printf(\n)  rumpcalls
 	}
 	printf(\t)  rumpcalls
-	if (returntype != void)
+	if (returntype != void  type != NOERR)
 		printf(error = )  rumpcalls
 	printf(rsys_syscall(%s%s%s,  \
 	%s, %s, rval);\n, constprefix, compatwrap_, funcalias, \
@@ -816,12 +816,9 @@
 	if (type != NOERR) {
 		printf(\trsys_seterrno(error);\n)  rumpcalls
 		printf(\tif (error) {\n\t\trval[0] = -1;\n\t}\n)  rumpcalls
-		rvariable = rval[0];
-	} else {
-		rvariable = error;
 	}
 	if (returntype != void) {
-		printf(\treturn %s;\n, rvariable)  rumpcalls
+		printf(\treturn rval[0];\n)  rumpcalls
 	}
 	printf(}\n)  rumpcalls
 	printf(rsys_alias(%s%s,rump_enosys)\n, \



CVS commit: src/sys

2011-02-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 21 23:31:01 UTC 2011

Modified Files:
src/sys/kern: init_sysent.c syscalls.c
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c
src/sys/sys: syscall.h syscallargs.h

Log Message:
regen: NOERR syscalls


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.243 -r1.244 src/sys/kern/syscalls.c
cvs rdiff -u -r1.42 -r1.43 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.64 -r1.65 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.239 -r1.240 src/sys/sys/syscall.h
cvs rdiff -u -r1.222 -r1.223 src/sys/sys/syscallargs.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/kern/init_sysent.c
diff -u src/sys/kern/init_sysent.c:1.252 src/sys/kern/init_sysent.c:1.253
--- src/sys/kern/init_sysent.c:1.252	Mon Jan 31 00:06:57 2011
+++ src/sys/kern/init_sysent.c	Mon Feb 21 23:31:00 2011
@@ -1,14 +1,14 @@
-/* $NetBSD: init_sysent.c,v 1.252 2011/01/31 00:06:57 christos Exp $ */
+/* $NetBSD: init_sysent.c,v 1.253 2011/02/21 23:31:00 pooka Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.243 2011/01/31 00:05:29 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: init_sysent.c,v 1.252 2011/01/31 00:06:57 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: init_sysent.c,v 1.253 2011/02/21 23:31:00 pooka Exp $);
 
 #include opt_modular.h
 #include opt_ntp.h

Index: src/sys/kern/syscalls.c
diff -u src/sys/kern/syscalls.c:1.243 src/sys/kern/syscalls.c:1.244
--- src/sys/kern/syscalls.c:1.243	Mon Jan 31 00:06:57 2011
+++ src/sys/kern/syscalls.c	Mon Feb 21 23:31:00 2011
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls.c,v 1.243 2011/01/31 00:06:57 christos Exp $ */
+/* $NetBSD: syscalls.c,v 1.244 2011/02/21 23:31:00 pooka Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.243 2011/01/31 00:05:29 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: syscalls.c,v 1.243 2011/01/31 00:06:57 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscalls.c,v 1.244 2011/02/21 23:31:00 pooka Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_modular.h

Index: src/sys/rump/include/rump/rump_syscalls.h
diff -u src/sys/rump/include/rump/rump_syscalls.h:1.42 src/sys/rump/include/rump/rump_syscalls.h:1.43
--- src/sys/rump/include/rump/rump_syscalls.h:1.42	Mon Feb 21 12:49:49 2011
+++ src/sys/rump/include/rump/rump_syscalls.h	Mon Feb 21 23:31:00 2011
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_syscalls.h,v 1.42 2011/02/21 12:49:49 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.43 2011/02/21 23:31:00 pooka Exp $ */
 
 /*
  * System call protos in rump namespace.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.244 2011/02/21 12:49:06 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
  */
 
 #ifndef _RUMP_RUMP_SYSCALLS_H_

Index: src/sys/rump/librump/rumpkern/rump_syscalls.c
diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.64 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.65
--- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.64	Mon Feb 21 12:49:49 2011
+++ src/sys/rump/librump/rumpkern/rump_syscalls.c	Mon Feb 21 23:31:00 2011
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_syscalls.c,v 1.64 2011/02/21 12:49:49 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.65 2011/02/21 23:31:00 pooka Exp $ */
 
 /*
  * System call vector and marshalling for rump.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.244 2011/02/21 12:49:06 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.64 2011/02/21 12:49:49 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.65 2011/02/21 23:31:00 pooka Exp $);
 
 #include sys/param.h
 #include sys/fstypes.h
@@ -291,13 +291,8 @@
 rump___sysimpl_getpid(void )
 {
 	register_t rval[2] = {0, 0};
-	int error = 0;
 
-	error = rsys_syscall(SYS_getpid, NULL, 0, rval);
-	rsys_seterrno(error);
-	if (error) {
-		rval[0] = -1;
-	}
+	rsys_syscall(SYS_getpid, NULL, 0, rval);
 	return rval[0];
 }
 rsys_alias(sys_getpid_with_ppid,rump_enosys)
@@ -346,13 +341,8 @@
 rump___sysimpl_getuid(void )
 {
 	register_t rval[2] = {0, 0};
-	int error = 0;
 
-	error = rsys_syscall(SYS_getuid, NULL, 0, rval);
-	rsys_seterrno(error);
-	if (error) {
-		rval[0] = -1;
-	}
+	rsys_syscall(SYS_getuid, NULL, 0, rval);
 	return rval[0];
 }
 

CVS commit: src/sys/net80211

2011-02-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Feb 21 23:50:08 UTC 2011

Modified Files:
src/sys/net80211: ieee80211_output.c ieee80211_proto.h

Log Message:
add ieee80211_get_rts and ieee80211_get_cts_to_self from openbsd, ok dyoung@


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/net80211/ieee80211_output.c
cvs rdiff -u -r1.17 -r1.18 src/sys/net80211/ieee80211_proto.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/net80211/ieee80211_output.c
diff -u src/sys/net80211/ieee80211_output.c:1.49 src/sys/net80211/ieee80211_output.c:1.50
--- src/sys/net80211/ieee80211_output.c:1.49	Tue Jan 19 22:08:17 2010
+++ src/sys/net80211/ieee80211_output.c	Mon Feb 21 23:50:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_output.c,v 1.49 2010/01/19 22:08:17 pooka Exp $	*/
+/*	$NetBSD: ieee80211_output.c,v 1.50 2011/02/21 23:50:08 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID($FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.34 2005/08/10 16:22:29 sam Exp $);
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, $NetBSD: ieee80211_output.c,v 1.49 2010/01/19 22:08:17 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: ieee80211_output.c,v 1.50 2011/02/21 23:50:08 jmcneill Exp $);
 #endif
 
 #include opt_inet.h
@@ -1706,6 +1706,58 @@
 }
 
 /*
+ * Build a RTS (Request To Send) control frame.
+ */
+struct mbuf *
+ieee80211_get_rts(struct ieee80211com *ic, const struct ieee80211_frame *wh,
+uint16_t dur)
+{
+	struct ieee80211_frame_rts *rts;
+	struct mbuf *m;
+
+	MGETHDR(m, M_DONTWAIT, MT_DATA);
+	if (m == NULL)
+		return NULL;
+
+	m-m_pkthdr.len = m-m_len = sizeof(struct ieee80211_frame_rts);
+
+	rts = mtod(m, struct ieee80211_frame_rts *);
+	rts-i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_CTL |
+	IEEE80211_FC0_SUBTYPE_RTS;
+	rts-i_fc[1] = IEEE80211_FC1_DIR_NODS;
+	*(uint16_t *)rts-i_dur = htole16(dur);
+	IEEE80211_ADDR_COPY(rts-i_ra, wh-i_addr1);
+	IEEE80211_ADDR_COPY(rts-i_ta, wh-i_addr2);
+
+	return m;
+}
+
+/*
+ * Build a CTS-to-self (Clear To Send) control frame.
+ */
+struct mbuf *
+ieee80211_get_cts_to_self(struct ieee80211com *ic, uint16_t dur)
+{
+	struct ieee80211_frame_cts *cts;
+	struct mbuf *m;
+
+	MGETHDR(m, M_DONTWAIT, MT_DATA);
+	if (m == NULL)
+		return NULL;
+
+	m-m_pkthdr.len = m-m_len = sizeof(struct ieee80211_frame_cts);
+
+	cts = mtod(m, struct ieee80211_frame_cts *);
+	cts-i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_CTL |
+	IEEE80211_FC0_SUBTYPE_CTS;
+	cts-i_fc[1] = IEEE80211_FC1_DIR_NODS;
+	*(uint16_t *)cts-i_dur = htole16(dur);
+	IEEE80211_ADDR_COPY(cts-i_ra, ic-ic_myaddr);
+
+	return m;
+}
+
+/*
  * Allocate a beacon frame and fillin the appropriate bits.
  */
 struct mbuf *

Index: src/sys/net80211/ieee80211_proto.h
diff -u src/sys/net80211/ieee80211_proto.h:1.17 src/sys/net80211/ieee80211_proto.h:1.18
--- src/sys/net80211/ieee80211_proto.h:1.17	Mon Jul 28 17:54:02 2008
+++ src/sys/net80211/ieee80211_proto.h	Mon Feb 21 23:50:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_proto.h,v 1.17 2008/07/28 17:54:02 christos Exp $	*/
+/*	$NetBSD: ieee80211_proto.h,v 1.18 2011/02/21 23:50:08 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -78,6 +78,10 @@
 		struct ieee80211_node *);
 struct mbuf *ieee80211_encap(struct ieee80211com *, struct mbuf *,
 		struct ieee80211_node *);
+struct mbuf *ieee80211_get_rts(struct ieee80211com *,
+		const struct ieee80211_frame *, uint16_t);
+struct mbuf *ieee80211_get_cts_to_self(struct ieee80211com *,
+		uint16_t);
 void	ieee80211_pwrsave(struct ieee80211com *, struct ieee80211_node *, 
 		struct mbuf *);
 



CVS commit: src/sys/dev/usb

2011-02-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Feb 21 23:50:42 UTC 2011

Modified Files:
src/sys/dev/usb: if_rum.c if_rumreg.h if_rumvar.h

Log Message:
sync driver with openbsd


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/if_rum.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/if_rumreg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_rumvar.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/usb/if_rum.c
diff -u src/sys/dev/usb/if_rum.c:1.34 src/sys/dev/usb/if_rum.c:1.35
--- src/sys/dev/usb/if_rum.c:1.34	Sun Feb 13 05:51:24 2011
+++ src/sys/dev/usb/if_rum.c	Mon Feb 21 23:50:42 2011
@@ -1,5 +1,5 @@
 /*	$OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $	*/
-/*	$NetBSD: if_rum.c,v 1.34 2011/02/13 05:51:24 dholland Exp $	*/
+/*	$NetBSD: if_rum.c,v 1.35 2011/02/21 23:50:42 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini damien.bergam...@free.fr
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.34 2011/02/13 05:51:24 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.35 2011/02/21 23:50:42 jmcneill Exp $);
 
 
 #include sys/param.h
@@ -134,71 +134,69 @@
 	{ USB_VENDOR_SURECOM,		USB_PRODUCT_SURECOM_RT2573 }
 };
 
-Static int		rum_attachhook(void *);
-Static int		rum_alloc_tx_list(struct rum_softc *);
-Static void		rum_free_tx_list(struct rum_softc *);
-Static int		rum_alloc_rx_list(struct rum_softc *);
-Static void		rum_free_rx_list(struct rum_softc *);
-Static int		rum_media_change(struct ifnet *);
-Static void		rum_next_scan(void *);
-Static void		rum_task(void *);
-Static int		rum_newstate(struct ieee80211com *,
+static int		rum_attachhook(void *);
+static int		rum_alloc_tx_list(struct rum_softc *);
+static void		rum_free_tx_list(struct rum_softc *);
+static int		rum_alloc_rx_list(struct rum_softc *);
+static void		rum_free_rx_list(struct rum_softc *);
+static int		rum_media_change(struct ifnet *);
+static void		rum_next_scan(void *);
+static void		rum_task(void *);
+static int		rum_newstate(struct ieee80211com *,
 			enum ieee80211_state, int);
-Static void		rum_txeof(usbd_xfer_handle, usbd_private_handle,
+static void		rum_txeof(usbd_xfer_handle, usbd_private_handle,
 			usbd_status);
-Static void		rum_rxeof(usbd_xfer_handle, usbd_private_handle,
+static void		rum_rxeof(usbd_xfer_handle, usbd_private_handle,
 			usbd_status);
-Static uint8_t		rum_rxrate(const struct rum_rx_desc *);
-Static int		rum_ack_rate(struct ieee80211com *, int);
-Static uint16_t		rum_txtime(int, int, uint32_t);
-Static uint8_t		rum_plcp_signal(int);
-Static void		rum_setup_tx_desc(struct rum_softc *,
+static uint8_t		rum_rxrate(const struct rum_rx_desc *);
+static int		rum_ack_rate(struct ieee80211com *, int);
+static uint16_t		rum_txtime(int, int, uint32_t);
+static uint8_t		rum_plcp_signal(int);
+static void		rum_setup_tx_desc(struct rum_softc *,
 			struct rum_tx_desc *, uint32_t, uint16_t, int,
 			int);
-Static int		rum_tx_mgt(struct rum_softc *, struct mbuf *,
+static int		rum_tx_data(struct rum_softc *, struct mbuf *,
 			struct ieee80211_node *);
-Static int		rum_tx_data(struct rum_softc *, struct mbuf *,
-			struct ieee80211_node *);
-Static void		rum_start(struct ifnet *);
-Static void		rum_watchdog(struct ifnet *);
-Static int		rum_ioctl(struct ifnet *, u_long, void *);
-Static void		rum_eeprom_read(struct rum_softc *, uint16_t, void *,
+static void		rum_start(struct ifnet *);
+static void		rum_watchdog(struct ifnet *);
+static int		rum_ioctl(struct ifnet *, u_long, void *);
+static void		rum_eeprom_read(struct rum_softc *, uint16_t, void *,
 			int);
-Static uint32_t		rum_read(struct rum_softc *, uint16_t);
-Static void		rum_read_multi(struct rum_softc *, uint16_t, void *,
+static uint32_t		rum_read(struct rum_softc *, uint16_t);
+static void		rum_read_multi(struct rum_softc *, uint16_t, void *,
 			int);
-Static void		rum_write(struct rum_softc *, uint16_t, uint32_t);
-Static void		rum_write_multi(struct rum_softc *, uint16_t, void *,
+static void		rum_write(struct rum_softc *, uint16_t, uint32_t);
+static void		rum_write_multi(struct rum_softc *, uint16_t, void *,
 			size_t);
-Static void		rum_bbp_write(struct rum_softc *, uint8_t, uint8_t);
-Static uint8_t		rum_bbp_read(struct rum_softc *, uint8_t);
-Static void		rum_rf_write(struct rum_softc *, uint8_t, uint32_t);
-Static void		rum_select_antenna(struct rum_softc *);
-Static void		rum_enable_mrr(struct rum_softc *);
-Static void		rum_set_txpreamble(struct rum_softc *);
-Static void		rum_set_basicrates(struct rum_softc *);
-Static void		rum_select_band(struct rum_softc *,
+static void		rum_bbp_write(struct rum_softc *, uint8_t, uint8_t);
+static uint8_t		rum_bbp_read(struct rum_softc *, uint8_t);
+static void		rum_rf_write(struct rum_softc *, uint8_t, uint32_t);
+static void		rum_select_antenna(struct 

CVS commit: src/sys/dev/usb

2011-02-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Feb 22 00:58:09 UTC 2011

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

Log Message:
make rum_ioctl look like other wireless drivers, now dhcpcd works and
mdnsd doesn't hang my laptop


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/usb/if_rum.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/if_rum.c
diff -u src/sys/dev/usb/if_rum.c:1.35 src/sys/dev/usb/if_rum.c:1.36
--- src/sys/dev/usb/if_rum.c:1.35	Mon Feb 21 23:50:42 2011
+++ src/sys/dev/usb/if_rum.c	Tue Feb 22 00:58:08 2011
@@ -1,5 +1,5 @@
 /*	$OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $	*/
-/*	$NetBSD: if_rum.c,v 1.35 2011/02/21 23:50:42 jmcneill Exp $	*/
+/*	$NetBSD: if_rum.c,v 1.36 2011/02/22 00:58:08 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini damien.bergam...@free.fr
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.35 2011/02/21 23:50:42 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.36 2011/02/22 00:58:08 jmcneill Exp $);
 
 
 #include sys/param.h
@@ -1356,6 +1356,9 @@
 static int
 rum_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
+#define IS_RUNNING(ifp) \
+	(((ifp)-if_flags  IFF_UP)  ((ifp)-if_flags  IFF_RUNNING))
+
 	struct rum_softc *sc = ifp-if_softc;
 	struct ieee80211com *ic = sc-sc_ic;
 	int s, error = 0;
@@ -1366,7 +1369,6 @@
 	case SIOCSIFFLAGS:
 		if ((error = ifioctl_common(ifp, cmd, data)) != 0)
 			break;
-		/* XXX re-use ether_ioctl() */
 		switch (ifp-if_flags  (IFF_UP|IFF_RUNNING)) {
 		case IFF_UP|IFF_RUNNING:
 			rum_update_promisc(sc);
@@ -1382,13 +1384,20 @@
 		}
 		break;
 
+	case SIOCADDMULTI:
+	case SIOCDELMULTI:
+		if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
+			error = 0;
+		}
+		break;
+
 	default:
 		error = ieee80211_ioctl(ic, cmd, data);
 	}
 
 	if (error == ENETRESET) {
-		if ((ifp-if_flags  (IFF_UP | IFF_RUNNING)) ==
-		(IFF_UP | IFF_RUNNING))
+		if (IS_RUNNING(ifp) 
+			(ic-ic_roaming != IEEE80211_ROAMING_MANUAL))
 			rum_init(ifp);
 		error = 0;
 	}
@@ -1396,6 +1405,7 @@
 	splx(s);
 
 	return error;
+#undef IS_RUNNING
 }
 
 static void



CVS commit: src/sys/dev/usb

2011-02-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Feb 22 01:11:30 UTC 2011

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

Log Message:
make ural_ioctl look like other wireless drivers, should make dhcpcd and
mdnsd work again


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/if_ural.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/if_ural.c
diff -u src/sys/dev/usb/if_ural.c:1.36 src/sys/dev/usb/if_ural.c:1.37
--- src/sys/dev/usb/if_ural.c:1.36	Wed Nov  3 22:28:31 2010
+++ src/sys/dev/usb/if_ural.c	Tue Feb 22 01:11:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ural.c,v 1.36 2010/11/03 22:28:31 dyoung Exp $ */
+/*	$NetBSD: if_ural.c,v 1.37 2011/02/22 01:11:30 jmcneill Exp $ */
 /*	$FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $	*/
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ural.c,v 1.36 2010/11/03 22:28:31 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ural.c,v 1.37 2011/02/22 01:11:30 jmcneill Exp $);
 
 
 #include sys/param.h
@@ -1486,6 +1486,9 @@
 Static int
 ural_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
+#define IS_RUNNING(ifp) \
+	(((ifp)-if_flags  IFF_UP)  ((ifp)-if_flags  IFF_RUNNING))
+
 	struct ural_softc *sc = ifp-if_softc;
 	struct ieee80211com *ic = sc-sc_ic;
 	int s, error = 0;
@@ -1512,13 +1515,20 @@
 		}
 		break;
 
+	case SIOCADDMULTI:
+	case SIOCDELMULTI:
+		if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
+			error = 0;
+		}
+		break;
+
 	default:
 		error = ieee80211_ioctl(ic, cmd, data);
 	}
 
 	if (error == ENETRESET) {
-		if ((ifp-if_flags  (IFF_UP | IFF_RUNNING)) ==
-		(IFF_UP | IFF_RUNNING))
+		if (IS_RUNNING(ifp) 
+			(ic-ic_roaming != IEEE80211_ROAMING_MANUAL))
 			ural_init(ifp);
 		error = 0;
 	}
@@ -1526,6 +1536,7 @@
 	splx(s);
 
 	return error;
+#undef IS_RUNNING
 }
 
 Static void



CVS commit: src/sys/dev/wsfb

2011-02-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Feb 22 01:26:14 UTC 2011

Modified Files:
src/sys/dev/wsfb: genfb.c

Log Message:
genfb_enable/disable_polling only matters if genfb is the console screen,
so make it a noop if it's not


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/wsfb/genfb.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/wsfb/genfb.c
diff -u src/sys/dev/wsfb/genfb.c:1.37 src/sys/dev/wsfb/genfb.c:1.38
--- src/sys/dev/wsfb/genfb.c:1.37	Fri Feb 18 13:56:58 2011
+++ src/sys/dev/wsfb/genfb.c	Tue Feb 22 01:26:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb.c,v 1.37 2011/02/18 13:56:58 jmcneill Exp $ */
+/*	$NetBSD: genfb.c,v 1.38 2011/02/22 01:26:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfb.c,v 1.37 2011/02/18 13:56:58 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfb.c,v 1.38 2011/02/22 01:26:14 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -691,9 +691,11 @@
 {
 	struct genfb_softc *sc = device_private(dev);
 
-	SCREEN_ENABLE_DRAWING(sc-sc_console_screen);
-	vcons_hard_switch(sc-sc_console_screen);
-	vcons_enable_polling(sc-vd);
+	if (sc-sc_console_screen.scr_vd) {
+		SCREEN_ENABLE_DRAWING(sc-sc_console_screen);
+		vcons_hard_switch(sc-sc_console_screen);
+		vcons_enable_polling(sc-vd);
+	}
 }
 
 void
@@ -701,5 +703,7 @@
 {
 	struct genfb_softc *sc = device_private(dev);
 
-	vcons_disable_polling(sc-vd);
+	if (sc-sc_console_screen.scr_vd) {
+		vcons_disable_polling(sc-vd);
+	}
 }



CVS commit: src/doc

2011-02-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 22 02:44:58 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
fix typos in saslc entry.


To generate a diff of this commit:
cvs rdiff -u -r1.1512 -r1.1513 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.1512 src/doc/CHANGES:1.1513
--- src/doc/CHANGES:1.1512	Mon Feb 21 17:26:10 2011
+++ src/doc/CHANGES	Mon Feb 21 21:44:58 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1512 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1513 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -866,7 +866,7 @@
 		preemption.  Added support for RMI (NetLogic) XLS/XLR models.
 		Major clean up for MIPS port. [matt 20110220]
 	ath(4): Add support for AR9285 devices. [cegger 20110221]
-	libsaslc)(3): Complete integration of libsaslc written for SoC 2010
+	libsaslc(3): Complete integration of libsaslc written for GSoC 2010
 		by Mateusz Kocielski, improved and integrated with Postfix
 		by Anon Ymous. Supported mechs are: ANONYMOUS, CRAM-MD5,
 		DIGEST-MD5, EXTERNAL, GSSAPI, LOGIN, PLAIN [christos 20110221]



CVS commit: src/sys/arch/amd64/amd64

2011-02-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Feb 22 05:07:36 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: cpufunc.S

Log Message:
Be explicit about the member of the fld family wanted here.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amd64/amd64/cpufunc.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/amd64/amd64/cpufunc.S
diff -u src/sys/arch/amd64/amd64/cpufunc.S:1.17 src/sys/arch/amd64/amd64/cpufunc.S:1.18
--- src/sys/arch/amd64/amd64/cpufunc.S:1.17	Wed Jul  7 01:14:52 2010
+++ src/sys/arch/amd64/amd64/cpufunc.S	Tue Feb 22 05:07:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.S,v 1.17 2010/07/07 01:14:52 chs Exp $	*/
+/*	$NetBSD: cpufunc.S,v 1.18 2011/02/22 05:07:36 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -427,7 +427,7 @@
 
 ENTRY(fldummy)
 	ffree	%st(7)
-	fld	(%rdi)
+	flds	(%rdi)
 	ret
 
 ENTRY(x86_ldmxcsr)



CVS commit: src

2011-02-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Feb 22 05:45:09 UTC 2011

Modified Files:
src/crypto/external/bsd/libsaslc/dist/src: mech.c
src/lib/csu/alpha: crt0.c
src/lib/csu/arm_elf: crt0.c
src/lib/csu/common: crt0-common.c
src/lib/csu/common_elf: common.h
src/lib/csu/hppa: crt0.c
src/lib/csu/ia64: crt0.c
src/lib/csu/m68k_elf: crt0.c
src/lib/csu/mips: crt0.c
src/lib/csu/powerpc: crt0.c
src/lib/csu/powerpc64: crt0.c
src/lib/csu/sh3_elf: crt0.c
src/lib/csu/sparc64: crt0.c
src/lib/csu/sparc_elf: crt0.c
src/lib/csu/vax_elf: crt0.c
src/lib/libc/net: nsdispatch.c
src/lib/libedit: vi.c
src/sys/sys: cdefs_elf.h

Log Message:
Introduce __weakref_visible to handle the different required visibility
for weak references. GCC 4.2+ and Clang require static, older GCC wants
extern. Change __weak_reference to include sym. This requires changes
the existing users to not reuse the name of the symbol, but avoids
further differences between GCC 4.1 and GCC 4.2+/clang.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/libsaslc/dist/src/mech.c
cvs rdiff -u -r1.24 -r1.25 src/lib/csu/alpha/crt0.c
cvs rdiff -u -r1.7 -r1.8 src/lib/csu/arm_elf/crt0.c
cvs rdiff -u -r1.3 -r1.4 src/lib/csu/common/crt0-common.c
cvs rdiff -u -r1.13 -r1.14 src/lib/csu/common_elf/common.h
cvs rdiff -u -r1.7 -r1.8 src/lib/csu/hppa/crt0.c
cvs rdiff -u -r1.2 -r1.3 src/lib/csu/ia64/crt0.c
cvs rdiff -u -r1.11 -r1.12 src/lib/csu/m68k_elf/crt0.c
cvs rdiff -u -r1.21 -r1.22 src/lib/csu/mips/crt0.c
cvs rdiff -u -r1.26 -r1.27 src/lib/csu/powerpc/crt0.c
cvs rdiff -u -r1.2 -r1.3 src/lib/csu/powerpc64/crt0.c
cvs rdiff -u -r1.10 -r1.11 src/lib/csu/sh3_elf/crt0.c
cvs rdiff -u -r1.24 -r1.25 src/lib/csu/sparc64/crt0.c
cvs rdiff -u -r1.12 -r1.13 src/lib/csu/sparc_elf/crt0.c
cvs rdiff -u -r1.10 -r1.11 src/lib/csu/vax_elf/crt0.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/net/nsdispatch.c
cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/vi.c
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/cdefs_elf.h

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

Modified files:

Index: src/crypto/external/bsd/libsaslc/dist/src/mech.c
diff -u src/crypto/external/bsd/libsaslc/dist/src/mech.c:1.6 src/crypto/external/bsd/libsaslc/dist/src/mech.c:1.7
--- src/crypto/external/bsd/libsaslc/dist/src/mech.c:1.6	Mon Feb 14 12:45:31 2011
+++ src/crypto/external/bsd/libsaslc/dist/src/mech.c	Tue Feb 22 05:45:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mech.c,v 1.6 2011/02/14 12:45:31 christos Exp $ */
+/* $NetBSD: mech.c,v 1.7 2011/02/22 05:45:05 joerg Exp $ */
 
 /* Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: mech.c,v 1.6 2011/02/14 12:45:31 christos Exp $);
+__RCSID($NetBSD: mech.c,v 1.7 2011/02/22 05:45:05 joerg Exp $);
 
 #include sys/queue.h
 
@@ -51,29 +51,29 @@
 #include saslc_private.h
 
 /* mechanisms */
-extern const saslc__mech_t saslc__mech_anonymous
+__weakref_visible const saslc__mech_t weak_saslc__mech_anonymous
 __weak_reference(saslc__mech_anonymous);
-extern const saslc__mech_t saslc__mech_crammd5
+__weakref_visible const saslc__mech_t weak_saslc__mech_crammd5
 __weak_reference(saslc__mech_crammd5);
-extern const saslc__mech_t saslc__mech_digestmd5
+__weakref_visible const saslc__mech_t weak_saslc__mech_digestmd5
 __weak_reference(saslc__mech_digestmd5);
-extern const saslc__mech_t saslc__mech_external
+__weakref_visible const saslc__mech_t weak_saslc__mech_external
 __weak_reference(saslc__mech_external);
-extern const saslc__mech_t saslc__mech_gssapi
+__weakref_visible const saslc__mech_t weak_saslc__mech_gssapi
 __weak_reference(saslc__mech_gssapi);
-extern const saslc__mech_t saslc__mech_login
+__weakref_visible const saslc__mech_t weak_saslc__mech_login
 __weak_reference(saslc__mech_login);
-extern const saslc__mech_t saslc__mech_plain
+__weakref_visible const saslc__mech_t weak_saslc__mech_plain
 __weak_reference(saslc__mech_plain);
 
 static const saslc__mech_t *saslc__mechanisms[] = {
-	saslc__mech_anonymous,
-	saslc__mech_crammd5,
-	saslc__mech_digestmd5,
-	saslc__mech_external,
-	saslc__mech_gssapi,
-	saslc__mech_login,
-	saslc__mech_plain,
+	weak_saslc__mech_anonymous,
+	weak_saslc__mech_crammd5,
+	weak_saslc__mech_digestmd5,
+	weak_saslc__mech_external,
+	weak_saslc__mech_gssapi,
+	weak_saslc__mech_login,
+	weak_saslc__mech_plain,
 };
 
 /*

Index: src/lib/csu/alpha/crt0.c
diff -u src/lib/csu/alpha/crt0.c:1.24 src/lib/csu/alpha/crt0.c:1.25
--- src/lib/csu/alpha/crt0.c:1.24	Sat Jul 26 19:24:25 2003
+++ src/lib/csu/alpha/crt0.c	Tue Feb 22 05:45:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.24 2003/07/26 19:24:25 salo Exp $ */
+/* $NetBSD: crt0.c,v 1.25 2011/02/22 05:45:05 joerg Exp $ */
 
 /*
  

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

2011-02-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Feb 22 06:33:34 UTC 2011

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

Log Message:
vga_posth should be inside NPCI  0; from Jarle Greipsland in PR 43449.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/x86/x86/x86_autoconf.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/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.57 src/sys/arch/x86/x86/x86_autoconf.c:1.58
--- src/sys/arch/x86/x86/x86_autoconf.c:1.57	Sat Feb 12 19:20:44 2011
+++ src/sys/arch/x86/x86/x86_autoconf.c	Tue Feb 22 06:33:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.57 2011/02/12 19:20:44 jmcneill Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.58 2011/02/22 06:33:33 dholland 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.57 2011/02/12 19:20:44 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.58 2011/02/22 06:33:33 dholland Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -89,10 +89,10 @@
 static struct genfb_colormap_callback gfb_cb;
 static struct genfb_pmf_callback pmf_cb;
 static struct genfb_mode_callback mode_cb;
-#endif
 #ifdef VGA_POST
 static struct vga_post *vga_posth = NULL;
 #endif
+#endif
 #if NGENFB  0  NACPICA  0  defined(VGA_POST)
 extern int acpi_md_vbios_reset;
 extern int acpi_md_vesa_modenum;



CVS commit: src/sys/arch

2011-02-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Feb 22 06:37:24 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: autoconf.c
src/sys/arch/i386/i386: autoconf.c

Log Message:
Include sys/device.h for config_rootfound, instead of relying on it
being included by accident. From Jarle Greipsland in PR 43449.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amd64/amd64/autoconf.c
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/i386/i386/autoconf.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/amd64/amd64/autoconf.c
diff -u src/sys/arch/amd64/amd64/autoconf.c:1.22 src/sys/arch/amd64/amd64/autoconf.c:1.23
--- src/sys/arch/amd64/amd64/autoconf.c:1.22	Sun Mar 15 14:21:48 2009
+++ src/sys/arch/amd64/amd64/autoconf.c	Tue Feb 22 06:37:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.22 2009/03/15 14:21:48 cegger Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.23 2011/02/22 06:37:24 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.22 2009/03/15 14:21:48 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.23 2011/02/22 06:37:24 dholland Exp $);
 
 #include opt_multiprocessor.h
 
@@ -54,6 +54,7 @@
 #include sys/systm.h
 #include sys/buf.h
 #include sys/cpu.h
+#include sys/device.h
 
 #include machine/pte.h
 #include machine/cpufunc.h

Index: src/sys/arch/i386/i386/autoconf.c
diff -u src/sys/arch/i386/i386/autoconf.c:1.96 src/sys/arch/i386/i386/autoconf.c:1.97
--- src/sys/arch/i386/i386/autoconf.c:1.96	Sat Feb 19 13:52:28 2011
+++ src/sys/arch/i386/i386/autoconf.c	Tue Feb 22 06:37:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.96 2011/02/19 13:52:28 jmcneill Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.97 2011/02/22 06:37:24 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.96 2011/02/19 13:52:28 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.97 2011/02/22 06:37:24 dholland Exp $);
 
 #include opt_compat_oldboot.h
 #include opt_intrdebug.h
@@ -56,6 +56,7 @@
 #include sys/systm.h
 #include sys/buf.h
 #include sys/proc.h
+#include sys/device.h
 
 #include machine/pte.h
 #include machine/cpu.h



CVS commit: src/sys/arch/amd64/amd64

2011-02-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Feb 22 07:12:29 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: mainbus.c

Log Message:
Fix build in admittedly quixotic case with IPMI but no PCI or ACPI.
(ACPI currently doesn't work without PCI, fwiw.)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amd64/amd64/mainbus.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/amd64/amd64/mainbus.c
diff -u src/sys/arch/amd64/amd64/mainbus.c:1.31 src/sys/arch/amd64/amd64/mainbus.c:1.32
--- src/sys/arch/amd64/amd64/mainbus.c:1.31	Wed Apr 28 19:17:03 2010
+++ src/sys/arch/amd64/amd64/mainbus.c	Tue Feb 22 07:12:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.31 2010/04/28 19:17:03 dyoung Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.32 2011/02/22 07:12:29 dholland Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.31 2010/04/28 19:17:03 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.32 2011/02/22 07:12:29 dholland Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -149,9 +149,11 @@
 void
 mainbus_attach(device_t parent, device_t self, void *aux)
 {
+#if NPCI  0 || NACPICA  0 || NIPMI  0
+	union mainbus_attach_args mba;
+#endif
 #if NPCI  0
 	int mode;
-	union mainbus_attach_args mba;
 #endif
 #if NACPICA  0
 	int acpi_present = 0;