CVS commit: src/sys/modules/raidframe

2009-08-10 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Mon Aug 10 07:19:11 UTC 2009

Added Files:
src/sys/modules/raidframe: Makefile

Log Message:
Add raidframe module dir. Rf needs some fixes before it can be used as a
kernel module.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/modules/raidframe/Makefile

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

Added files:

Index: src/sys/modules/raidframe/Makefile
diff -u /dev/null src/sys/modules/raidframe/Makefile:1.1
--- /dev/null	Mon Aug 10 07:19:11 2009
+++ src/sys/modules/raidframe/Makefile	Mon Aug 10 07:19:11 2009
@@ -0,0 +1,20 @@
+#	$NetBSD: Makefile,v 1.1 2009/08/10 07:19:11 haad Exp $
+
+.include ../Makefile.inc
+
+.PATH:	${S}/dev/raidframe
+
+KMOD=	raidframe
+SRCS=	rf_dagffwr.c rf_dagfuncs.c rf_dagutils.c rf_debugMem.c rf_debugprint.c \
+	rf_decluster.c rf_declusterPQ.c rf_diskqueue.c rf_disks.c rf_driver.c \
+	rf_engine.c rf_evenodd.c rf_evenodd_dagfuncs.c rf_evenodd_dags.c \
+	rf_fifo.c rf_interdecluster.c rf_invertq.c rf_layout.c rf_map.c \
+	rf_mcpair.c rf_netbsdkintf.c rf_nwayxor.c rf_options.c rf_paritylog.c \
+	rf_paritylogDiskMgr.c rf_paritylogging.c rf_parityloggingdags.c \
+	rf_parityscan.c rf_pq.c rf_pqdeg.c rf_pqdegdags.c rf_psstatus.c \
+	rf_raid0.c rf_raid1.c rf_raid4.c rf_raid5.c rf_raid5_rotatedspare.c \
+	rf_reconbuffer.c rf_reconmap.c rf_reconstruct.c rf_reconutil.c \
+	rf_revent.c rf_shutdown.c rf_sstf.c rf_states.c rf_stripelocks.c \
+	rf_strutils.c rf_utils.c
+
+.include bsd.kmodule.mk



CVS commit: src/sys/arch/vax/include

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Aug 10 08:05:33 UTC 2009

Modified Files:
src/sys/arch/vax/include: pte.h

Log Message:
Change kvtopte and kvtophys from ({ }) to static inline and while there
make them tolerable of rump.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/vax/include/pte.h

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

Modified files:

Index: src/sys/arch/vax/include/pte.h
diff -u src/sys/arch/vax/include/pte.h:1.22 src/sys/arch/vax/include/pte.h:1.23
--- src/sys/arch/vax/include/pte.h:1.22	Fri Aug 29 18:25:02 2008
+++ src/sys/arch/vax/include/pte.h	Mon Aug 10 08:05:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.22 2008/08/29 18:25:02 matt Exp $	  */
+/*	$NetBSD: pte.h,v 1.23 2009/08/10 08:05:32 matt Exp $	  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -77,17 +77,49 @@
 #endif
 
 #ifdef __GNUC__
-#define kvtopte(va) ({ \
-	struct pte *r; \
-	__asm(extzv $9,$21,%1,%0;moval *Sysmap[%0],%0 : =r(r) : g(va)); \
-	r; \
-})
-#define kvtophys(va) ({ \
-	paddr_t r; \
-	__asm(extzv $9,$21,%1,%0;ashl $9,*Sysmap[%0],%0;insv %1,$0,$9,%0 \
-	: =r(r) : g(va) : cc); \
-	r; \
-})
+#define	kvtopte(va)	kvtopte0((vaddr_t) (va))
+static inline struct pte *
+kvtopte0(vaddr_t va)
+{
+	struct pte *pt;
+#ifdef _RUMPKERNEL
+	__asm(
+		extzv $9,$21,%1,%0\n\t
+		moval %2[%0],%0\n\t
+	 : =r(pt)
+	 : g(va), o(*Sysmap));
+#else
+	__asm(
+		extzv $9,$21,%1,%0\n\t
+		moval *Sysmap[%0],%0\n\t
+	 : =r(pt)
+	 : g(va));
+#endif
+	return pt;
+}
+
+#define	kvtophys(va)	kvtophys0((vaddr_t) (va))
+static inline paddr_t
+kvtophys0(vaddr_t va)
+{
+	paddr_t pa;
+#ifdef _RUMPKERNEL
+	__asm(
+		extzv $9,$21,%1,%0\n\t
+		ashl $9,%2[%0],%0\n\t
+		insv %1,$0,$9,%0\n\t
+	: =r(pa)
+	: g(va), o(*Sysmap) : cc);
+#else
+	__asm(
+		extzv $9,$21,%1,%0\n\t
+		ashl $9,*Sysmap[%0],%0\n\t
+		insv %1,$0,$9,%0\n\t
+	: =r(pa)
+	: g(va) : cc);
+#endif
+	return pa;
+}
 #else /* __GNUC__ */
 #define kvtophys(va) \
 	(((kvtopte(va))-pg_pfn  VAX_PGSHIFT) | ((paddr_t)(va)  VAX_PGOFSET))



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2009-08-10 Thread Timo Ter�s
Module Name:src
Committed By:   tteras
Date:   Mon Aug 10 08:22:13 UTC 2009

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: pfkey.c

Log Message:
Don't print EAGAIN error from pfkey_handler(), it can occur normally
under some code paths and is not a hard error in any case.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/crypto/dist/ipsec-tools/src/racoon/pfkey.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/pfkey.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/pfkey.c:1.49 src/crypto/dist/ipsec-tools/src/racoon/pfkey.c:1.50
--- src/crypto/dist/ipsec-tools/src/racoon/pfkey.c:1.49	Wed Aug  5 13:16:01 2009
+++ src/crypto/dist/ipsec-tools/src/racoon/pfkey.c	Mon Aug 10 08:22:13 2009
@@ -1,6 +1,6 @@
-/*	$NetBSD: pfkey.c,v 1.49 2009/08/05 13:16:01 tteras Exp $	*/
+/*	$NetBSD: pfkey.c,v 1.50 2009/08/10 08:22:13 tteras Exp $	*/
 
-/* $Id: pfkey.c,v 1.49 2009/08/05 13:16:01 tteras Exp $ */
+/* $Id: pfkey.c,v 1.50 2009/08/10 08:22:13 tteras Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -214,6 +214,13 @@
 	msg = (struct sadb_msg *) pk_recv(fd, len);
 	if (msg == NULL) {
 		if (len  0) {
+		/* do not report EAGAIN as error; well get
+		 * called from main loop later. and it's normal
+		 * when spd dump is received during reload and
+		 * this function is called in loop. */
+		if (errno == EAGAIN)
+		goto end;
+
 			plog(LLV_ERROR, LOCATION, NULL,
 failed to recv from pfkey (%s)\n,
 strerror(errno));



CVS commit: src/sys/conf

2009-08-10 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Aug 10 11:46:42 UTC 2009

Modified Files:
src/sys/conf: std

Log Message:
Tab police.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/conf/std

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

Modified files:

Index: src/sys/conf/std
diff -u src/sys/conf/std:1.11 src/sys/conf/std:1.12
--- src/sys/conf/std:1.11	Sun Aug  9 21:58:03 2009
+++ src/sys/conf/std	Mon Aug 10 11:46:42 2009
@@ -1,4 +1,4 @@
-# $NetBSD: std,v 1.11 2009/08/09 21:58:03 matt Exp $
+# $NetBSD: std,v 1.12 2009/08/10 11:46:42 simonb Exp $
 #
 # standard MI 'options'
 #
@@ -8,7 +8,7 @@
 # the following options are on-by-default to keep
 # kernel config file compatibility.
 options	VMSWAP		# Swap device/file support
-options VMSWAP_UAREA	# Swap uarea's
+options	VMSWAP_UAREA	# Swap uarea's
 options	BUFQ_FCFS	# First-come First-serve strategy
 options	BUFQ_DISKSORT	# Traditional min seek sort strategy
 options	RFC2292		# Previous version of Adv. Sockets API for IPv6 
@@ -20,7 +20,7 @@
 #
 # Security model.
 #
-options secmodel_bsd44	# Traditional 4.4BSD security model
+options	secmodel_bsd44	# Traditional 4.4BSD security model
 
 #
 # Scheduling algorithm



CVS commit: src/sys/uvm

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Aug 10 16:49:30 UTC 2009

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
Compare vaddr_t against 0, not NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.276 -r1.277 src/sys/uvm/uvm_map.c

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

Modified files:

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.276 src/sys/uvm/uvm_map.c:1.277
--- src/sys/uvm/uvm_map.c:1.276	Sun Aug  9 22:13:07 2009
+++ src/sys/uvm/uvm_map.c	Mon Aug 10 16:49:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.276 2009/08/09 22:13:07 matt Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.277 2009/08/10 16:49:30 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_map.c,v 1.276 2009/08/09 22:13:07 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_map.c,v 1.277 2009/08/10 16:49:30 matt Exp $);
 
 #include opt_ddb.h
 #include opt_uvmhist.h
@@ -4691,7 +4691,7 @@
 
 #ifdef PMAP_MAP_POOLPAGE
 	va = PMAP_MAP_POOLPAGE(VM_PAGE_TO_PHYS(pg));
-	KASSERT(va != NULL);
+	KASSERT(va != 0);
 #else
 	error = uvm_map_prepare(map, 0, PAGE_SIZE, NULL, UVM_UNKNOWN_OFFSET,
 	0, mapflags, args);



CVS commit: src/sys/uvm

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Aug 10 16:50:18 UTC 2009

Modified Files:
src/sys/uvm: uvm_glue.c

Log Message:
Revent change to printf.  (why can't __func__ concat with other string?)


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/sys/uvm/uvm_glue.c

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

Modified files:

Index: src/sys/uvm/uvm_glue.c
diff -u src/sys/uvm/uvm_glue.c:1.139 src/sys/uvm/uvm_glue.c:1.140
--- src/sys/uvm/uvm_glue.c:1.139	Sun Aug  9 22:19:09 2009
+++ src/sys/uvm/uvm_glue.c	Mon Aug 10 16:50:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_glue.c,v 1.139 2009/08/09 22:19:09 matt Exp $	*/
+/*	$NetBSD: uvm_glue.c,v 1.140 2009/08/10 16:50:18 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_glue.c,v 1.139 2009/08/09 22:19:09 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_glue.c,v 1.140 2009/08/10 16:50:18 matt Exp $);
 
 #include opt_kgdb.h
 #include opt_kstack.h
@@ -742,7 +742,7 @@
 			l = outl2;
 #ifdef DEBUG
 		if (swapdebug  SDB_SWAPOUT)
-			printf(__func__ : no duds, try procp %p\n, l);
+			printf(%s: no duds, try procp %p\n, __func__, l);
 #endif
 		if (l) {
 			mutex_enter(l-l_swaplock);



CVS commit: src/sys/compat/svr4_32

2009-08-10 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Mon Aug 10 17:36:00 UTC 2009

Modified Files:
src/sys/compat/svr4_32: svr4_32_misc.c

Log Message:
Add enum uio_seg argument to do_sys_mknod().


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/svr4_32/svr4_32_misc.c

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

Modified files:

Index: src/sys/compat/svr4_32/svr4_32_misc.c
diff -u src/sys/compat/svr4_32/svr4_32_misc.c:1.64 src/sys/compat/svr4_32/svr4_32_misc.c:1.65
--- src/sys/compat/svr4_32/svr4_32_misc.c:1.64	Sun Jan 11 13:14:14 2009
+++ src/sys/compat/svr4_32/svr4_32_misc.c	Mon Aug 10 17:36:00 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_32_misc.c,v 1.64 2009/01/11 13:14:14 nakayama Exp $	 */
+/*	$NetBSD: svr4_32_misc.c,v 1.65 2009/08/10 17:36:00 rjs Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: svr4_32_misc.c,v 1.64 2009/01/11 13:14:14 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: svr4_32_misc.c,v 1.65 2009/08/10 17:36:00 rjs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -535,7 +535,7 @@
 		SCARG(ap, mode) = mode;
 		return sys_mkfifo(l, ap, retval);
 	} else {
-		return do_sys_mknod(l, path, mode, dev, retval);
+		return do_sys_mknod(l, path, mode, dev, retval, UIO_USERSPACE);
 	}
 }
 



CVS commit: src

2009-08-10 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Mon Aug 10 18:25:20 UTC 2009

Modified Files:
src/share/man/man9: kauth.9
src/sys/netbt: bt_proto.c hci.h hci_socket.c
src/sys/secmodel/bsd44: secmodel_bsd44_suser.c
src/sys/sys: kauth.h

Log Message:
remove last usage of KAUTH_ISSUSER in bluetooth code by adding
some requests to the device scope:

KAUTH_DEVICE_BLUETOOTH_SEND_COMMAND
KAUTH_DEVICE_BLUETOOTH_RECV_COMMAND
KAUTH_DEVICE_BLUETOOTH_RECV_EVENT
KAUTH_DEVICE_BLUETOOTH_RECV_DATA

and a listener tied to the HCI protocol that will approve the basic
minimum to be sent and received.

handle the requests in the bsd44_suser listener by approving all
when the credential is root.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/share/man/man9/kauth.9
cvs rdiff -u -r1.10 -r1.11 src/sys/netbt/bt_proto.c
cvs rdiff -u -r1.29 -r1.30 src/sys/netbt/hci.h
cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/hci_socket.c
cvs rdiff -u -r1.68 -r1.69 src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
cvs rdiff -u -r1.60 -r1.61 src/sys/sys/kauth.h

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

Modified files:

Index: src/share/man/man9/kauth.9
diff -u src/share/man/man9/kauth.9:1.85 src/share/man/man9/kauth.9:1.86
--- src/share/man/man9/kauth.9:1.85	Fri May  8 21:52:20 2009
+++ src/share/man/man9/kauth.9	Mon Aug 10 18:25:20 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: kauth.9,v 1.85 2009/05/08 21:52:20 wiz Exp $
+.\ $NetBSD: kauth.9,v 1.86 2009/08/10 18:25:20 plunky Exp $
 .\
 .\ Copyright (c) 2005, 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -978,6 +978,32 @@
 .Xr btuart 4
 device is allowed.
 .El
+.It KAUTH_DEVICE_BLUETOOTH_RECV_COMMAND
+Check if a command packet can be received from the device.
+.Pp
+.Ar arg0
+is the command opcode.
+.It KAUTH_DEVICE_BLUETOOTH_RECV_DATA
+Check if a data packet can be received from the device.
+.Pp
+.Ar arg0
+is the packet type.
+.It KAUTH_DEVICE_BLUETOOTH_RECV_EVENT
+Check if a event packet can be received from the device.
+.Pp
+.Ar arg0
+is the event ID.
+.It KAUTH_DEVICE_BLUETOOTH_SEND_COMMAND
+Check if a command packet can be sent to the device.
+.Pp
+.Ar arg0
+is a
+.Ft struct hci_unit *
+describing the HCI unit,
+.Ar arg1
+is a
+.Ft hci_cmd_hdr_t *
+describing the command packet header.
 .It KAUTH_DEVICE_BLUETOOTH_SETPRIV
 Check if privileged settings can be changed.
 .Pp

Index: src/sys/netbt/bt_proto.c
diff -u src/sys/netbt/bt_proto.c:1.10 src/sys/netbt/bt_proto.c:1.11
--- src/sys/netbt/bt_proto.c:1.10	Thu Apr 24 11:38:37 2008
+++ src/sys/netbt/bt_proto.c	Mon Aug 10 18:25:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_proto.c,v 1.10 2008/04/24 11:38:37 ad Exp $	*/
+/*	$NetBSD: bt_proto.c,v 1.11 2009/08/10 18:25:20 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bt_proto.c,v 1.10 2008/04/24 11:38:37 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: bt_proto.c,v 1.11 2009/08/10 18:25:20 plunky Exp $);
 
 #include sys/param.h
 #include sys/domain.h
@@ -78,6 +78,7 @@
 		.pr_domain = btdomain,
 		.pr_protocol = BTPROTO_HCI,
 		.pr_flags = (PR_ADDR | PR_ATOMIC),
+		.pr_init = hci_init,
 		.pr_ctloutput = hci_ctloutput,
 		.pr_usrreq = hci_usrreq,
 	},

Index: src/sys/netbt/hci.h
diff -u src/sys/netbt/hci.h:1.29 src/sys/netbt/hci.h:1.30
--- src/sys/netbt/hci.h:1.29	Thu May 14 15:34:38 2009
+++ src/sys/netbt/hci.h	Mon Aug 10 18:25:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci.h,v 1.29 2009/05/14 15:34:38 plunky Exp $	*/
+/*	$NetBSD: hci.h,v 1.30 2009/08/10 18:25:20 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -54,7 +54,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: hci.h,v 1.29 2009/05/14 15:34:38 plunky Exp $
+ * $Id: hci.h,v 1.30 2009/08/10 18:25:20 plunky Exp $
  * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
  */
 
@@ -2543,6 +2543,7 @@
 
 /* hci_socket.c */
 void hci_drop(void *);
+void hci_init(void);
 int hci_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
 int hci_ctloutput(int, struct socket *, struct sockopt *);
 void hci_mtap(struct mbuf *, struct hci_unit *);

Index: src/sys/netbt/hci_socket.c
diff -u src/sys/netbt/hci_socket.c:1.17 src/sys/netbt/hci_socket.c:1.18
--- src/sys/netbt/hci_socket.c:1.17	Wed Aug  6 15:01:24 2008
+++ src/sys/netbt/hci_socket.c	Mon Aug 10 18:25:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_socket.c,v 1.17 2008/08/06 15:01:24 plunky Exp $	*/
+/*	$NetBSD: hci_socket.c,v 1.18 2009/08/10 18:25:20 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hci_socket.c,v 1.17 2008/08/06 15:01:24 plunky Exp $);
+__KERNEL_RCSID(0, $NetBSD: hci_socket.c,v 1.18 2009/08/10 18:25:20 plunky Exp $);
 
 /* load symbolic 

CVS commit: src

2009-08-10 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Mon Aug 10 20:22:06 UTC 2009

Modified Files:
src/share/man/man9: kauth.9
src/sys/netbt: hci_socket.c
src/sys/secmodel/bsd44: secmodel_bsd44_suser.c
src/sys/sys: kauth.h

Log Message:
reduce the number of KAUTH_DEVICE_BLUETOOTH_SEND/RECV requests
by passing the packet type as an argument rather than having
a different request for each type.

(from a suggestion by mrg)


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/share/man/man9/kauth.9
cvs rdiff -u -r1.18 -r1.19 src/sys/netbt/hci_socket.c
cvs rdiff -u -r1.69 -r1.70 src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
cvs rdiff -u -r1.61 -r1.62 src/sys/sys/kauth.h

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

Modified files:

Index: src/share/man/man9/kauth.9
diff -u src/share/man/man9/kauth.9:1.86 src/share/man/man9/kauth.9:1.87
--- src/share/man/man9/kauth.9:1.86	Mon Aug 10 18:25:20 2009
+++ src/share/man/man9/kauth.9	Mon Aug 10 20:22:06 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: kauth.9,v 1.86 2009/08/10 18:25:20 plunky Exp $
+.\ $NetBSD: kauth.9,v 1.87 2009/08/10 20:22:06 plunky Exp $
 .\
 .\ Copyright (c) 2005, 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -978,23 +978,28 @@
 .Xr btuart 4
 device is allowed.
 .El
-.It KAUTH_DEVICE_BLUETOOTH_RECV_COMMAND
-Check if a command packet can be received from the device.
-.Pp
-.Ar arg0
-is the command opcode.
-.It KAUTH_DEVICE_BLUETOOTH_RECV_DATA
-Check if a data packet can be received from the device.
+.It KAUTH_DEVICE_BLUETOOTH_RECV
+Check if a packet can be received from the device.
 .Pp
 .Ar arg0
 is the packet type.
-.It KAUTH_DEVICE_BLUETOOTH_RECV_EVENT
-Check if a event packet can be received from the device.
-.Pp
-.Ar arg0
-is the event ID.
-.It KAUTH_DEVICE_BLUETOOTH_SEND_COMMAND
-Check if a command packet can be sent to the device.
+For
+.Dv HCI_CMD_PKT
+packets,
+.Ar arg1
+is the opcode, for
+.Dv HCI_EVENT_PKT
+packets,
+.Ar arg1
+is the event ID, and for
+.Dv HCI_ACLDATA_PKT
+or
+.Dv HCI_SCODATA_PKT
+packets,
+.Ar arg1
+is the connection handle.
+.It KAUTH_DEVICE_BLUETOOTH_SEND
+Check if a packet can be sent to the device.
 .Pp
 .Ar arg0
 is a
@@ -1003,7 +1008,7 @@
 .Ar arg1
 is a
 .Ft hci_cmd_hdr_t *
-describing the command packet header.
+describing the packet header.
 .It KAUTH_DEVICE_BLUETOOTH_SETPRIV
 Check if privileged settings can be changed.
 .Pp

Index: src/sys/netbt/hci_socket.c
diff -u src/sys/netbt/hci_socket.c:1.18 src/sys/netbt/hci_socket.c:1.19
--- src/sys/netbt/hci_socket.c:1.18	Mon Aug 10 18:25:20 2009
+++ src/sys/netbt/hci_socket.c	Mon Aug 10 20:22:06 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_socket.c,v 1.18 2009/08/10 18:25:20 plunky Exp $	*/
+/*	$NetBSD: hci_socket.c,v 1.19 2009/08/10 20:22:06 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hci_socket.c,v 1.18 2009/08/10 18:25:20 plunky Exp $);
+__KERNEL_RCSID(0, $NetBSD: hci_socket.c,v 1.19 2009/08/10 20:22:06 plunky Exp $);
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -208,7 +208,7 @@
 	result = KAUTH_RESULT_DEFER;
 
 	switch (action) {
-	case KAUTH_DEVICE_BLUETOOTH_SEND_COMMAND: {
+	case KAUTH_DEVICE_BLUETOOTH_SEND: {
 		struct hci_unit *unit = (struct hci_unit *)arg0;
 		hci_cmd_hdr_t *hdr = (hci_cmd_hdr_t *)arg1;
 
@@ -217,6 +217,9 @@
 		 * is correct and the unit claims to support it
 		 */
 
+		if (hdr-type != HCI_CMD_PKT)
+			break;
+
 		for (i = 0; i  __arraycount(hci_cmds); i++) {
 			if (hdr-opcode == hci_cmds[i].opcode
 			 hdr-length == hci_cmds[i].length
@@ -229,51 +232,62 @@
 		break;
 		}
 
-	case KAUTH_DEVICE_BLUETOOTH_RECV_COMMAND: {
-		uint16_t opcode = (uint16_t)(uintptr_t)arg0;
+	case KAUTH_DEVICE_BLUETOOTH_RECV:
+		switch((uint8_t)(uintptr_t)arg0) {
+		case HCI_CMD_PKT: {
+			uint16_t opcode = (uint16_t)(uintptr_t)arg1;
+
+			/*
+			 * Allow to see any unprivileged command packet
+			 */
+
+			for (i = 0; i  __arraycount(hci_cmds); i++) {
+if (opcode == hci_cmds[i].opcode) {
+	result = KAUTH_RESULT_ALLOW;
+	break;
+}
+			}
 
-		/*
-		 * Allow to see any unprivileged command packet
-		 */
+			break;
+			}
 
-		for (i = 0; i  __arraycount(hci_cmds); i++) {
-			if (opcode == hci_cmds[i].opcode) {
+		case HCI_EVENT_PKT: {
+			uint8_t event = (uint8_t)(uintptr_t)arg1;
+
+			/*
+			 * Allow to receive most events
+			 */
+
+			switch (event) {
+			case HCI_EVENT_RETURN_LINK_KEYS:
+			case HCI_EVENT_LINK_KEY_NOTIFICATION:
+			case HCI_EVENT_USER_CONFIRM_REQ:
+			case HCI_EVENT_USER_PASSKEY_NOTIFICATION:
+			case HCI_EVENT_VENDOR:
+break;
+
+			default:
 result = KAUTH_RESULT_ALLOW;
 break;
 			}
-		}
-
-		break;
-		}
 
-	case KAUTH_DEVICE_BLUETOOTH_RECV_EVENT: {
-		uint8_t event = (uint8_t)(uintptr_t)arg0;
-
-		/*
-		 * Allow to receive most events
-		 */
+			break;
+			}
 
-		switch (event) {
-		case 

CVS commit: src/doc

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Aug 10 21:27:46 UTC 2009

Modified Files:
src/doc: BRANCHES

Log Message:
Add matt-nb5-mips64 branch


To generate a diff of this commit:
cvs rdiff -u -r1.283 -r1.284 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.283 src/doc/BRANCHES:1.284
--- src/doc/BRANCHES:1.283	Thu Jul 23 10:53:19 2009
+++ src/doc/BRANCHES	Mon Aug 10 21:27:46 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.283 2009/07/23 10:53:19 yamt Exp $
+#	$NetBSD: BRANCHES,v 1.284 2009/08/10 21:27:46 matt Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -421,13 +421,23 @@
 
 Branch:		matt-mips64
 Description:	Rototill the mips code to support LP64 mips and N32/N64 ABIs
-Status:		Active
+Status:		Mostly dead
 Start Date:	2007-07-17
 End Date:
 Base Tag:	matt-mips64-base
 Maintainer:	Matt Thomas m...@netbsd.org
 Scope:		kernel  userland
-Notes:	
+Notes:		
+
+Branch:		matt-nb5-mips64
+Description:	Rototill the mips code to support LP64 mips and N32/N64 ABIs
+Status:		Mostly dead
+Start Date:	2009-08-01
+End Date:
+Base Tag:	netbsd-5-0-1-RELEASE
+Maintainer:	Matt Thomas m...@netbsd.org
+Scope:		kernel  userland
+Notes:		
 
 Branch:		mjf-devfs2
 Description:	device file system supporting dynamic device nodes



CVS commit: src/sys/sys

2009-08-10 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Mon Aug 10 22:29:30 UTC 2009

Modified Files:
src/sys/sys: unistd.h

Log Message:
Add _PC_ACL_EXTENDED and _PC_MIN_HOLE_SIZE which are needed by zfs.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/sys/unistd.h

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

Modified files:

Index: src/sys/sys/unistd.h
diff -u src/sys/sys/unistd.h:1.48 src/sys/sys/unistd.h:1.49
--- src/sys/sys/unistd.h:1.48	Sat Aug  8 22:53:16 2009
+++ src/sys/sys/unistd.h	Mon Aug 10 22:29:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.48 2009/08/08 22:53:16 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.49 2009/08/10 22:29:29 haad Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -162,6 +162,10 @@
 #define	_PC_FILESIZEBITS	11
 #define	_PC_SYMLINK_MAX		12
 #define	_PC_2_SYMLINKS		13
+#define _PC_ACL_EXTENDED14
+
+/* From OpenSolaris, used by SEEK_DATA/SEEK_HOLE. */
+#define _PC_MIN_HOLE_SIZE   15
 
 /* configurable system variables; use as argument to sysconf(3) */
 /*



CVS commit: src/share/man/man9

2009-08-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 10 22:36:37 UTC 2009

Modified Files:
src/share/man/man9: kauth.9

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/share/man/man9/kauth.9

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

Modified files:

Index: src/share/man/man9/kauth.9
diff -u src/share/man/man9/kauth.9:1.87 src/share/man/man9/kauth.9:1.88
--- src/share/man/man9/kauth.9:1.87	Mon Aug 10 20:22:06 2009
+++ src/share/man/man9/kauth.9	Mon Aug 10 22:36:37 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: kauth.9,v 1.87 2009/08/10 20:22:06 plunky Exp $
+.\ $NetBSD: kauth.9,v 1.88 2009/08/10 22:36:37 wiz Exp $
 .\
 .\ Copyright (c) 2005, 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 7, 2009
+.Dd August 10, 2009
 .Dt KAUTH 9
 .Os
 .Sh NAME



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2009-08-10 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Mon Aug 10 22:38:02 UTC 2009

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: arc.c dmu.c
spa_history.c zfs_dir.c zfs_vfsops.c
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: vdev_disk.h
zfs_znode.h zvol.h

Log Message:
Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_dir.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev_disk.h \
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zvol.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.3
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.2	Fri Aug  7 20:16:45 2009
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c	Mon Aug 10 22:38:02 2009
@@ -133,6 +133,42 @@
 #include sys/callb.h
 #include sys/kstat.h
 
+#ifdef __NetBSD__
+#include uvm/uvm.h
+#define	btop(x)		((x) / PAGE_SIZE)
+#define	needfree	(uvmexp.free  uvmexp.freetarg ? uvmexp.freetarg : 0)
+#define	buf_init	arc_buf_init
+#define	freemem		uvmexp.free
+#define	minfree		uvmexp.freemin
+#define	desfree		uvmexp.freetarg
+#define	lotsfree	(desfree * 2)
+#define	availrmem	desfree
+#define	swapfs_minfree	0
+#define	swapfs_reserve	0
+#undef curproc
+#define	curproc		curlwp
+#define	proc_pageout	uvm.pagedaemon_lwp
+
+#define	heap_arena	kernel_map
+#define	VMEM_ALLOC	1
+#define	VMEM_FREE	2
+static inline size_t
+vmem_size(struct vm_map *map, int flag)
+{
+	switch (flag) {
+	case VMEM_ALLOC:
+		return map-size;
+	case VMEM_FREE:
+		return vm_map_max(map) - vm_map_min(map) - map-size;
+	case VMEM_FREE|VMEM_ALLOC:
+		return vm_map_max(map) - vm_map_min(map);
+	default:
+		panic(vmem_size);
+	}
+}
+static void	*zio_arena;
+#endif	/* __NetBSD__ */
+
 static kmutex_t		arc_reclaim_thr_lock;
 static kcondvar_t	arc_reclaim_thr_cv;	/* used to signal reclaim thr */
 static uint8_t		arc_thread_exit;
@@ -3233,10 +3269,8 @@
 	static uint64_t page_load = 0;
 	static uint64_t last_txg = 0;
 
-#if defined(__i386)
 	available_memory =
 	MIN(available_memory, vmem_size(heap_arena, VMEM_FREE));
-#endif
 	if (available_memory = zfs_write_limit_max)
 		return (0);
 
Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.3
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.2	Fri Aug  7 20:16:45 2009
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c	Mon Aug 10 22:38:02 2009
@@ -35,7 +35,6 @@
 #include sys/mntent.h
 #include sys/mount.h
 #include sys/cmn_err.h
-#include fs/fs_subr.h
 #include sys/zfs_znode.h
 #include sys/zfs_dir.h
 #include sys/zil.h
@@ -51,11 +50,9 @@
 #include sys/atomic.h
 #include sys/mkdev.h
 #include sys/modctl.h
-#include sys/refstr.h
 #include sys/zfs_ioctl.h
 #include sys/zfs_ctldir.h
 #include sys/zfs_fuid.h
-#include sys/bootconf.h
 #include sys/sunddi.h
 #include sys/dnlc.h
 #include sys/dmu_objset.h

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c:1.1.1.1 src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c:1.2
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c:1.1.1.1	Fri Aug  7 18:32:54 2009
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c	Mon Aug 10 22:38:02 2009
@@ -751,6 +751,7 @@
 	return (err);
 }
 
+#ifndef __NetBSD__
 int
 dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size,
 page_t *pp, dmu_tx_t *tx)
@@ -808,6 +809,7 @@
 	dmu_buf_rele_array(dbp, numbufs, FTAG);
 	return (err);
 }
+#endif  /* __NetBSD__ */
 #endif
 
 typedef struct {
Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.1.1.1 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.2
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.1.1.1	Fri Aug  7 18:33:07 2009
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c	Mon Aug 10 22:38:02 2009
@@ -178,7 +178,7 @@
 static char *
 spa_history_zone()
 {
-#ifdef 

CVS commit: src/external/cddl/osnet/sys/kern

2009-08-10 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Mon Aug 10 22:41:51 UTC 2009

Modified Files:
src/external/cddl/osnet/sys/kern: ddi.c

Log Message:
Fix number of arguments passed to do_sys_mkdir.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/sys/kern/ddi.c

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

Modified files:

Index: src/external/cddl/osnet/sys/kern/ddi.c
diff -u src/external/cddl/osnet/sys/kern/ddi.c:1.1 src/external/cddl/osnet/sys/kern/ddi.c:1.2
--- src/external/cddl/osnet/sys/kern/ddi.c:1.1	Fri Aug  7 20:57:57 2009
+++ src/external/cddl/osnet/sys/kern/ddi.c	Mon Aug 10 22:41:51 2009
@@ -105,7 +105,7 @@
 			break;
 		
 		strlcpy(here, path, e - path + 1);
-		error = do_sys_mkdir(l, (const char *)here, mode, ret, UIO_SYSSPACE);
+		error = do_sys_mkdir((const char *)here, mode, UIO_SYSSPACE);
 	}
 	PNBUF_PUT(here);
 



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

2009-08-10 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Mon Aug 10 22:44:41 UTC 2009

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

Log Message:
Rename getline to zgetline to avoid clashes with NetBSD getline.

Problem found by za...@.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libzfs/fsshare.c

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

Modified files:

Index: src/external/cddl/osnet/lib/libzfs/fsshare.c
diff -u src/external/cddl/osnet/lib/libzfs/fsshare.c:1.1 src/external/cddl/osnet/lib/libzfs/fsshare.c:1.2
--- src/external/cddl/osnet/lib/libzfs/fsshare.c:1.1	Fri Aug  7 20:57:56 2009
+++ src/external/cddl/osnet/lib/libzfs/fsshare.c	Mon Aug 10 22:44:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsshare.c,v 1.1 2009/08/07 20:57:56 haad Exp $	*/
+/*	$NetBSD: fsshare.c,v 1.2 2009/08/10 22:44:41 haad Exp $	*/
 
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek p...@freebsd.org
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 /* __FBSDID($FreeBSD: src/compat/opensolaris/misc/fsshare.c,v 1.2 2007/04/21 13:17:23 pjd Exp $); */
-__RCSID($NetBSD: fsshare.c,v 1.1 2009/08/07 20:57:56 haad Exp $);
+__RCSID($NetBSD: fsshare.c,v 1.2 2009/08/10 22:44:41 haad Exp $);
 
 #include sys/param.h
 #include stdio.h
@@ -65,7 +65,7 @@
  * mountpoint specified in the 'skip' argument.
  */
 static char *
-getline(FILE *fd, const char *skip)
+zgetline(FILE *fd, const char *skip)
 {
 	static char line[MAXLINESIZE];
 	size_t len, skiplen;
@@ -196,7 +196,7 @@
 
 	/* Place big, fat warning at the begining of the file. */
 	fprintf(newfd, %s, FILE_HEADER);
-	while (oldfd != NULL  (line = getline(oldfd, mountpoint)) != NULL)
+	while (oldfd != NULL  (line = zgetline(oldfd, mountpoint)) != NULL)
 		fprintf(newfd, %s\n, line);
 	if (oldfd != NULL  ferror(oldfd) != 0) {
 		error = ferror(oldfd);



CVS commit: src/external/cddl/osnet/dist/uts/common/sys

2009-08-10 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Mon Aug 10 22:47:09 UTC 2009

Added Files:
src/external/cddl/osnet/dist/uts/common/sys: priv_names.h

Log Message:
Add missing header file.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/cddl/osnet/dist/uts/common/sys/priv_names.h

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

Added files:

Index: src/external/cddl/osnet/dist/uts/common/sys/priv_names.h
diff -u /dev/null src/external/cddl/osnet/dist/uts/common/sys/priv_names.h:1.1
--- /dev/null	Mon Aug 10 22:47:09 2009
+++ src/external/cddl/osnet/dist/uts/common/sys/priv_names.h	Mon Aug 10 22:47:09 2009
@@ -0,0 +1,681 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the License).
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets [] replaced with your own identifying
+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Privilege constant definitions.  Privileges and privilege sets
+ * are only known by name and should be mapped at runtime.
+ *
+ * THIS FILE WAS GENERATED; DO NOT EDIT
+ */
+
+
+#ifndef _SYS_PRIV_NAMES_H
+#define	_SYS_PRIV_NAMES_H
+
+
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+#ifndef __PRIV_CONST_IMPL
+/*
+ * Privilege names
+ */
+/*
+ * Allows a process to request critical events without limitation.
+ * Allows a process to request reliable delivery of all events on
+ * any event queue.
+ */
+#define	PRIV_CONTRACT_EVENT	((const char *)contract_event)
+
+/*
+ * Allows a process to set the service FMRI value of a process
+ * contract template.
+ */
+#define	PRIV_CONTRACT_IDENTITY	((const char *)contract_identity)
+
+/*
+ * Allows a process to observe contract events generated by
+ * contracts created and owned by users other than the process's
+ * effective user ID.
+ * Allows a process to open contract event endpoints belonging to
+ * contracts created and owned by users other than the process's
+ * effective user ID.
+ */
+#define	PRIV_CONTRACT_OBSERVER	((const char *)contract_observer)
+
+/*
+ * Allow a process to access per-CPU hardware performance counters.
+ */
+#define	PRIV_CPC_CPU		((const char *)cpc_cpu)
+
+/*
+ * Allows DTrace kernel-level tracing.
+ */
+#define	PRIV_DTRACE_KERNEL	((const char *)dtrace_kernel)
+
+/*
+ * Allows DTrace process-level tracing.
+ * Allows process-level tracing probes to be placed and enabled in
+ * processes to which the user has permissions.
+ */
+#define	PRIV_DTRACE_PROC	((const char *)dtrace_proc)
+
+/*
+ * Allows DTrace user-level tracing.
+ * Allows use of the syscall and profile DTrace providers to
+ * examine processes to which the user has permissions.
+ */
+#define	PRIV_DTRACE_USER	((const char *)dtrace_user)
+
+/*
+ * Allows a process to change a file's owner user ID.
+ * Allows a process to change a file's group ID to one other than
+ * the process' effective group ID or one of the process'
+ * supplemental group IDs.
+ */
+#define	PRIV_FILE_CHOWN		((const char *)file_chown)
+
+/*
+ * Allows a process to give away its files; a process with this
+ * privilege will run as if {_POSIX_CHOWN_RESTRICTED} is not
+ * in effect.
+ */
+#define	PRIV_FILE_CHOWN_SELF	((const char *)file_chown_self)
+
+/*
+ * Allows a process to execute an executable file whose permission
+ * bits or ACL do not allow the process execute permission.
+ */
+#define	PRIV_FILE_DAC_EXECUTE	((const char *)file_dac_execute)
+
+/*
+ * Allows a process to read a file or directory whose permission
+ * bits or ACL do not allow the process read permission.
+ */
+#define	PRIV_FILE_DAC_READ	((const char *)file_dac_read)
+
+/*
+ * Allows a process to search a directory whose permission bits or
+ * ACL do not allow the process search permission.
+ */
+#define	PRIV_FILE_DAC_SEARCH	((const char *)file_dac_search)
+
+/*
+ * Allows a process to write a file or directory whose permission
+ * bits or ACL do not allow the process write permission.
+ * In order to write files owned by uid 0 in the absence of an
+ * effective uid of 0 ALL privileges are required.
+ */
+#define	PRIV_FILE_DAC_WRITE	((const char *)file_dac_write)
+
+/*
+ * Allows a process to set the sensitivity label of a file or
+ * directory to a sensitivity label that does not dominate 

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

2009-08-10 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Aug 10 23:08:12 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_ohci.c

Log Message:
Remove unused variable powman_ioh.
  It is used in GUMSTIX ohci patch.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/pxa2x0_ohci.c

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

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_ohci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.6 src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.7
--- src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.6	Sun Aug  9 06:12:34 2009
+++ src/sys/arch/arm/xscale/pxa2x0_ohci.c	Mon Aug 10 23:08:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_ohci.c,v 1.6 2009/08/09 06:12:34 kiyohara Exp $	*/
+/*	$NetBSD: pxa2x0_ohci.c,v 1.7 2009/08/10 23:08:12 kiyohara Exp $	*/
 /*	$OpenBSD: pxa2x0_ohci.c,v 1.19 2005/04/08 02:32:54 dlg Exp $ */
 
 /*
@@ -70,7 +70,6 @@
 {
 	struct pxaohci_softc *sc = device_private(self);
 	struct pxaip_attach_args *pxa = aux;
-	bus_space_handle_t powman_ioh;
 	usbd_status r;
 
 #ifdef USB_DEBUG



CVS commit: src/sys/uvm

2009-08-10 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Mon Aug 10 23:17:29 UTC 2009

Modified Files:
src/sys/uvm: uvm_extern.h uvm_page.c uvm_pdaemon.c

Log Message:
Add uvm_reclaim_hooks support for reclaiming kernel KVA space and memory.
This is used only by zfs where uvm_reclaim hook is added from arc cache.

Oked a...@.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.145 -r1.146 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.97 -r1.98 src/sys/uvm/uvm_pdaemon.c

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

Modified files:

Index: src/sys/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.157 src/sys/uvm/uvm_extern.h:1.158
--- src/sys/uvm/uvm_extern.h:1.157	Wed Aug  5 14:11:32 2009
+++ src/sys/uvm/uvm_extern.h	Mon Aug 10 23:17:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.157 2009/08/05 14:11:32 pooka Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.158 2009/08/10 23:17:29 haad Exp $	*/
 
 /*
  *
@@ -534,6 +534,19 @@
 #define	UVM_COREDUMP_STACK	0x01	/* region is user stack */
 
 /*
+ * Structure containig uvm reclaim hooks, uvm_reclaim_list is guarded by
+ * uvm_reclaim_lock.
+ */
+struct uvm_reclaim_hook {
+	void (*uvm_reclaim_hook)(void);
+	SLIST_ENTRY(uvm_reclaim_hook) uvm_reclaim_next;
+};
+
+voiduvm_reclaim_init(void);
+void 	uvm_reclaim_hook_add(struct uvm_reclaim_hook *);
+voiduvm_reclaim_hook_del(struct uvm_reclaim_hook *);
+
+/*
  * the various kernel maps, owned by MD code
  */
 extern struct vm_map *kernel_map;

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.145 src/sys/uvm/uvm_page.c:1.146
--- src/sys/uvm/uvm_page.c:1.145	Thu Mar 12 12:55:16 2009
+++ src/sys/uvm/uvm_page.c	Mon Aug 10 23:17:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.145 2009/03/12 12:55:16 abs Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.146 2009/08/10 23:17:29 haad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.145 2009/03/12 12:55:16 abs Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.146 2009/08/10 23:17:29 haad Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -116,6 +116,9 @@
  */
 int vm_page_reserve_kernel = 5;
 
+/* Physical memory size */
+uintptr_t physmem;
+
 /*
  * local variables
  */
@@ -349,6 +352,7 @@
 	 */
 
 	curcpu()-ci_data.cpu_uvm = uvm.cpus[0];
+	uvm_reclaim_init();
 	uvmpdpol_init();
 	mutex_init(uvm_pageqlock, MUTEX_DRIVER, IPL_NONE);
 	mutex_init(uvm_fpageqlock, MUTEX_DRIVER, IPL_VM);

Index: src/sys/uvm/uvm_pdaemon.c
diff -u src/sys/uvm/uvm_pdaemon.c:1.97 src/sys/uvm/uvm_pdaemon.c:1.98
--- src/sys/uvm/uvm_pdaemon.c:1.97	Sat Dec 13 11:26:57 2008
+++ src/sys/uvm/uvm_pdaemon.c	Mon Aug 10 23:17:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.c,v 1.97 2008/12/13 11:26:57 ad Exp $	*/
+/*	$NetBSD: uvm_pdaemon.c,v 1.98 2009/08/10 23:17:29 haad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_pdaemon.c,v 1.97 2008/12/13 11:26:57 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_pdaemon.c,v 1.98 2009/08/10 23:17:29 haad Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -114,6 +114,11 @@
  */
 u_int uvm_extrapages;
 
+static kmutex_t uvm_reclaim_lock;
+
+SLIST_HEAD(uvm_reclaim_hooks, uvm_reclaim_hook) uvm_reclaim_list;
+
+
 /*
  * uvm_wait: wait (sleep) for the page daemon to free some pages
  *
@@ -233,6 +238,8 @@
 	int extrapages = 0;
 	struct pool *pp;
 	uint64_t where;
+	struct uvm_reclaim_hook *hook;
+	
 	UVMHIST_FUNC(uvm_pageout); UVMHIST_CALLED(pdhist);
 
 	UVMHIST_LOG(pdhist,starting uvm pagedaemon, 0, 0, 0, 0);
@@ -340,6 +347,13 @@
 		buf_drain(bufcnt  PAGE_SHIFT);
 		mutex_exit(bufcache_lock);
 
+		mutex_enter(uvm_reclaim_lock);
+		SLIST_FOREACH(hook, uvm_reclaim_list, uvm_reclaim_next) {
+			(*hook-uvm_reclaim_hook)();
+		}
+		mutex_exit(uvm_reclaim_lock);
+		
+		
 		/*
 		 * complete draining the pools.
 		 */
@@ -1039,3 +1053,45 @@
 
 	uvmpdpol_estimatepageable(active, inactive);
 }
+
+void
+uvm_reclaim_init(void)
+{
+	
+	/* Initialize UVM reclaim hooks. */
+	mutex_init(uvm_reclaim_lock, MUTEX_DEFAULT, IPL_NONE);
+	SLIST_INIT(uvm_reclaim_list);
+
+}
+
+void
+uvm_reclaim_hook_add(struct uvm_reclaim_hook *hook)
+{
+
+	KASSERT(hook != NULL);
+	
+	mutex_enter(uvm_reclaim_lock);
+	SLIST_INSERT_HEAD(uvm_reclaim_list, hook, uvm_reclaim_next);
+	mutex_exit(uvm_reclaim_lock);
+}
+
+void
+uvm_reclaim_hook_del(struct uvm_reclaim_hook *hook_entry)
+{
+	struct uvm_reclaim_hook *hook;
+
+	KASSERT(hook_entry != NULL);
+	
+	mutex_enter(uvm_reclaim_lock);
+	SLIST_FOREACH(hook, uvm_reclaim_list, uvm_reclaim_next) {
+		if (hook != hook_entry) {
+			continue;
+		}
+
+		SLIST_REMOVE(uvm_reclaim_list, hook, uvm_reclaim_hook,
+		uvm_reclaim_next);
+		break;
+	}
+
+	mutex_exit(uvm_reclaim_lock);
+}



CVS commit: src/sys/arch/mips

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 11 00:34:29 UTC 2009

Modified Files:
src/sys/arch/mips/include: cache_ls2.h
src/sys/arch/mips/mips: cache.c cache_ls2.c

Log Message:
Flush by increasing way, then increasing addr.  flush L1 before L2 (even
though according to the specification it should be needed).  Reset
mips_sdcache_size to 0 so we will configure it.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/include/cache_ls2.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/mips/mips/cache.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/mips/cache_ls2.c

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

Modified files:

Index: src/sys/arch/mips/include/cache_ls2.h
diff -u src/sys/arch/mips/include/cache_ls2.h:1.1 src/sys/arch/mips/include/cache_ls2.h:1.2
--- src/sys/arch/mips/include/cache_ls2.h:1.1	Fri Aug  7 18:39:10 2009
+++ src/sys/arch/mips/include/cache_ls2.h	Tue Aug 11 00:34:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache_ls2.h,v 1.1 2009/08/07 18:39:10 matt Exp $	*/
+/*	$NetBSD: cache_ls2.h,v 1.2 2009/08/11 00:34:29 matt Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -51,22 +51,22 @@
 #define cache_op_ls2_8line_4way(va, op)	\
 	__asm volatile(			\
 .set noreorder	\n\t	\
-cache %1, 0x00(%0); cache %1, 0x01(%0)		\n\t	\
-cache %1, 0x02(%0); cache %1, 0x03(%0)		\n\t	\
-cache %1, 0x20(%0); cache %1, 0x21(%0)		\n\t	\
-cache %1, 0x22(%0); cache %1, 0x23(%0)		\n\t	\
-cache %1, 0x40(%0); cache %1, 0x41(%0)		\n\t	\
-cache %1, 0x42(%0); cache %1, 0x43(%0)		\n\t	\
-cache %1, 0x60(%0); cache %1, 0x61(%0)		\n\t	\
-cache %1, 0x62(%0); cache %1, 0x63(%0)		\n\t	\
-cache %1, 0x80(%0); cache %1, 0x81(%0)		\n\t	\
-cache %1, 0x82(%0); cache %1, 0x83(%0)		\n\t	\
-cache %1, 0xa0(%0); cache %1, 0xa1(%0)		\n\t	\
-cache %1, 0xa2(%0); cache %1, 0xa3(%0)		\n\t	\
-cache %1, 0xc0(%0); cache %1, 0xc1(%0)		\n\t	\
-cache %1, 0xc2(%0); cache %1, 0xc3(%0)		\n\t	\
-cache %1, 0xe0(%0); cache %1, 0xe1(%0)		\n\t	\
-cache %1, 0xe2(%0); cache %1, 0xe3(%0)		\n\t	\
+cache %1, 0x00(%0); cache %1, 0x20(%0)		\n\t	\
+cache %1, 0x40(%0); cache %1, 0x60(%0)		\n\t	\
+cache %1, 0x80(%0); cache %1, 0xa0(%0)		\n\t	\
+cache %1, 0xc0(%0); cache %1, 0xe0(%0)		\n\t	\
+cache %1, 0x01(%0); cache %1, 0x21(%0)		\n\t	\
+cache %1, 0x41(%0); cache %1, 0x61(%0)		\n\t	\
+cache %1, 0x81(%0); cache %1, 0xa1(%0)		\n\t	\
+cache %1, 0xc1(%0); cache %1, 0xe1(%0)		\n\t	\
+cache %1, 0x02(%0); cache %1, 0x22(%0)		\n\t	\
+cache %1, 0x42(%0); cache %1, 0x62(%0)		\n\t	\
+cache %1, 0x82(%0); cache %1, 0xa2(%0)		\n\t	\
+cache %1, 0xc2(%0); cache %1, 0xe2(%0)		\n\t	\
+cache %1, 0x03(%0); cache %1, 0x23(%0)		\n\t	\
+cache %1, 0x43(%0); cache %1, 0x63(%0)		\n\t	\
+cache %1, 0x83(%0); cache %1, 0xa3(%0)		\n\t	\
+cache %1, 0xc3(%0); cache %1, 0xe3(%0)		\n\t	\
 .set reorder		\
 :\
 : r (va), i (op)	\

Index: src/sys/arch/mips/mips/cache.c
diff -u src/sys/arch/mips/mips/cache.c:1.40 src/sys/arch/mips/mips/cache.c:1.41
--- src/sys/arch/mips/mips/cache.c:1.40	Sun Aug  9 04:05:03 2009
+++ src/sys/arch/mips/mips/cache.c	Tue Aug 11 00:34:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.c,v 1.40 2009/08/09 04:05:03 matt Exp $	*/
+/*	$NetBSD: cache.c,v 1.41 2009/08/11 00:34:29 matt Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cache.c,v 1.40 2009/08/09 04:05:03 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cache.c,v 1.41 2009/08/11 00:34:29 matt Exp $);
 
 #include opt_cputype.h
 #include opt_mips_cache.h
@@ -661,6 +661,8 @@
 
 		mips3_get_cache_config(csizebase);
 
+		mips_sdcache_size = 0;	/* don't trust config reg */
+
 		if (mips_picache_size / mips_picache_ways  PAGE_SIZE ||
 		mips_pdcache_size / mips_pdcache_ways  PAGE_SIZE)
 			mips_cache_virtual_alias = 1;

Index: src/sys/arch/mips/mips/cache_ls2.c
diff -u src/sys/arch/mips/mips/cache_ls2.c:1.2 src/sys/arch/mips/mips/cache_ls2.c:1.3
--- src/sys/arch/mips/mips/cache_ls2.c:1.2	Fri Aug  7 23:23:58 2009
+++ src/sys/arch/mips/mips/cache_ls2.c	Tue Aug 11 00:34:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache_ls2.c,v 1.2 2009/08/07 23:23:58 matt Exp $	*/
+/*	$NetBSD: cache_ls2.c,v 1.3 2009/08/11 00:34:29 matt Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h

CVS commit: src/sys/arch/evbmips/gdium

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 11 02:32:38 UTC 2009

Modified Files:
src/sys/arch/evbmips/gdium: mainbus.c

Log Message:
Fix mainbus_print and don't pass a NULL name.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/gdium/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/evbmips/gdium/mainbus.c
diff -u src/sys/arch/evbmips/gdium/mainbus.c:1.2 src/sys/arch/evbmips/gdium/mainbus.c:1.3
--- src/sys/arch/evbmips/gdium/mainbus.c:1.2	Thu Aug  6 16:37:01 2009
+++ src/sys/arch/evbmips/gdium/mainbus.c	Tue Aug 11 02:32:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.2 2009/08/06 16:37:01 matt Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.3 2009/08/11 02:32:38 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.2 2009/08/06 16:37:01 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.3 2009/08/11 02:32:38 matt Exp $);
 
 #include opt_pci.h
 
@@ -79,7 +79,6 @@
 	i2c,
 	gpio,
 #endif
-	NULL,
 };
 
 static int
@@ -118,7 +117,7 @@
 	for (i = 0; i  __arraycount(mainbusdevs); i++) {
 		struct mainbus_attach_args maa;
 		maa.maa_name = mainbusdevs[i];
-		(void) config_found_ia(self, mainbus, maa, mainbus_print);
+		(void) config_found(self, maa, mainbus_print);
 	}
 }
 
@@ -127,9 +126,6 @@
 {
 	struct mainbus_attach_args *maa = aux;
 
-	if (pnp != 0)
-		return QUIET;
-
 	if (pnp)
 		aprint_normal(%s at %s, maa-maa_name, pnp);
 



CVS commit: src/sys/arch/evbmips/gdium

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 11 02:35:15 UTC 2009

Modified Files:
src/sys/arch/evbmips/gdium: machdep.c

Log Message:
Disable 2nd PCI Windows @ 8MB


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbmips/gdium/machdep.c

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

Modified files:

Index: src/sys/arch/evbmips/gdium/machdep.c
diff -u src/sys/arch/evbmips/gdium/machdep.c:1.4 src/sys/arch/evbmips/gdium/machdep.c:1.5
--- src/sys/arch/evbmips/gdium/machdep.c:1.4	Sat Aug  8 20:49:58 2009
+++ src/sys/arch/evbmips/gdium/machdep.c	Tue Aug 11 02:35:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.4 2009/08/08 20:49:58 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.5 2009/08/11 02:35:15 matt Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.4 2009/08/08 20:49:58 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.5 2009/08/11 02:35:15 matt Exp $);
 
 #include opt_ddb.h
 #include opt_execfmt.h
@@ -225,6 +225,20 @@
 	 * Set the mapreg.
 	 */
 	pci_conf_write(pba-pba_pc, ralink_dev, PCI_MAPREG_START, v);
+
+#if 0
+	/*
+	 * Why does linux do this?
+	 */
+	for (int dev = 15; dev = 17; dev +=2) {
+		for (int func = 0; func = 1; func++) {
+			pcitag_t usb_dev = pci_make_tag(pba-pba_pc, 0, dev, func);
+			v = pci_conf_read(pba-pba_pc, usb_dev, 0xe0);
+			v |= 3;
+			pci_conf_write(pba-pba_pc, usb_dev, 0xe0, v);
+		}
+	}
+#endif
 }
 
 /*
@@ -275,6 +289,13 @@
 	gdium_cnattach(gc);
 
 	/*
+	 * Disable the 2nd PCI window since we don't need it.
+	 */
+	REGVAL(BONITO_REGBASE + 0x158) = 0xe;
+	REGVAL(BONITO_REGBASE + 0x15c) = 0;
+	pci_conf_write(gc-gc_pc, pci_make_tag(gc-gc_pc, 0, 0, 0), 18, 0);
+
+	/*
 	 * Get the timer from PMON.
 	 */
 	for (i = 0; envp[i] != NULL; i++) {
@@ -305,7 +326,6 @@
 #ifdef DEBUG
 	printf(Timer calibration: %lu cycles/sec\n,
 	curcpu()-ci_cpu_freq);
-	delay(100);
 #endif
 
 #if NCOM  0



CVS commit: src/sys/arch/evbmips/evbmips

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 11 02:37:29 UTC 2009

Modified Files:
src/sys/arch/evbmips/evbmips: cpu.c

Log Message:
Use aprint_normal


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbmips/evbmips/cpu.c

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

Modified files:

Index: src/sys/arch/evbmips/evbmips/cpu.c
diff -u src/sys/arch/evbmips/evbmips/cpu.c:1.1 src/sys/arch/evbmips/evbmips/cpu.c:1.2
--- src/sys/arch/evbmips/evbmips/cpu.c:1.1	Sun Aug  2 17:12:29 2009
+++ src/sys/arch/evbmips/evbmips/cpu.c	Tue Aug 11 02:37:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.1 2009/08/02 17:12:29 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.2 2009/08/11 02:37:29 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.1 2009/08/02 17:12:29 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.2 2009/08/11 02:37:29 matt Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -61,11 +61,11 @@
 {
 	struct cpu_info * const ci = curcpu();
 
-	printf(: %lu.%02luMHz (hz cycles = %lu, delay divisor = %lu)\n,
+	aprint_normal(: %lu.%02luMHz (hz cycles = %lu, delay divisor = %lu)\n,
 	ci-ci_cpu_freq / 100,
 	(ci-ci_cpu_freq % 100) / 1,
 	ci-ci_cycles_per_hz, ci-ci_divisor_delay);
 
-	printf(%s: , device_xname(self));
+	aprint_normal(%s: , device_xname(self));
 	cpu_identify();
 }



CVS commit: src/sys/arch/mips/mips

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 11 02:38:30 UTC 2009

Modified Files:
src/sys/arch/mips/mips: cache.c

Log Message:
Fix loongson2 sdcache init.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/mips/mips/cache.c

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

Modified files:

Index: src/sys/arch/mips/mips/cache.c
diff -u src/sys/arch/mips/mips/cache.c:1.41 src/sys/arch/mips/mips/cache.c:1.42
--- src/sys/arch/mips/mips/cache.c:1.41	Tue Aug 11 00:34:29 2009
+++ src/sys/arch/mips/mips/cache.c	Tue Aug 11 02:38:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.c,v 1.41 2009/08/11 00:34:29 matt Exp $	*/
+/*	$NetBSD: cache.c,v 1.42 2009/08/11 02:38:30 matt Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cache.c,v 1.41 2009/08/11 00:34:29 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cache.c,v 1.42 2009/08/11 02:38:30 matt Exp $);
 
 #include opt_cputype.h
 #include opt_mips_cache.h
@@ -661,7 +661,7 @@
 
 		mips3_get_cache_config(csizebase);
 
-		mips_sdcache_size = 0;	/* don't trust config reg */
+		mips_sdcache_line_size = 32;	/* don't trust config reg */
 
 		if (mips_picache_size / mips_picache_ways  PAGE_SIZE ||
 		mips_pdcache_size / mips_pdcache_ways  PAGE_SIZE)
@@ -840,7 +840,6 @@
 	case MIPS_LOONGSON2:
 		mips_sdcache_ways = 4;
 		mips_sdcache_size = 512*1024;
-		mips_sdcache_line_size = 32;
 		mips_scache_unified = 1;
 
 		mips_cache_ops.mco_sdcache_wbinv_all =



CVS commit: src/sys/arch/evbmips/gdium

2009-08-10 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Tue Aug 11 03:56:34 UTC 2009

Modified Files:
src/sys/arch/evbmips/gdium: machdep.c

Log Message:
#ifdef around boot args parsing for now, so won't kill autobooting the gdium


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbmips/gdium/machdep.c

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

Modified files:

Index: src/sys/arch/evbmips/gdium/machdep.c
diff -u src/sys/arch/evbmips/gdium/machdep.c:1.5 src/sys/arch/evbmips/gdium/machdep.c:1.6
--- src/sys/arch/evbmips/gdium/machdep.c:1.5	Tue Aug 11 02:35:15 2009
+++ src/sys/arch/evbmips/gdium/machdep.c	Tue Aug 11 03:56:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.5 2009/08/11 02:35:15 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.6 2009/08/11 03:56:34 cliff Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.5 2009/08/11 02:35:15 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.6 2009/08/11 03:56:34 cliff Exp $);
 
 #include opt_ddb.h
 #include opt_execfmt.h
@@ -250,8 +250,11 @@
 	struct gdium_config *gc = gdium_configuration;
 	void *kernend, *v;
 u_long first, last;
+#ifdef NOTYET
 	char *cp;
-	int i, howto;
+	int howto;
+#endif
+	int i;
 	psize_t memsize;
 
 	extern char edata[], end[];
@@ -355,6 +358,7 @@
 	 * Look at arguments passed to us and compute boothowto.
 	 */
 	boothowto = RB_AUTOBOOT;
+#ifdef NOTYET
 	for (i = 1; i  argc; i++) {
 		for (cp = argv[i]; *cp; cp++) {
 			/* Ignore superfluous '-', if there is one */
@@ -369,6 +373,7 @@
 boothowto |= howto;
 		}
 	}
+#endif
 
 	/*
 	 * Load the rest of the available pages into the VM system.



CVS commit: src/sys/arch/evbmips/gdium

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 11 04:46:21 UTC 2009

Modified Files:
src/sys/arch/evbmips/gdium: machdep.c

Log Message:
Remove declaration of physmem since uvm_page.c declares it.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbmips/gdium/machdep.c

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

Modified files:

Index: src/sys/arch/evbmips/gdium/machdep.c
diff -u src/sys/arch/evbmips/gdium/machdep.c:1.6 src/sys/arch/evbmips/gdium/machdep.c:1.7
--- src/sys/arch/evbmips/gdium/machdep.c:1.6	Tue Aug 11 03:56:34 2009
+++ src/sys/arch/evbmips/gdium/machdep.c	Tue Aug 11 04:46:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.6 2009/08/11 03:56:34 cliff Exp $	*/
+/*	$NetBSD: machdep.c,v 1.7 2009/08/11 04:46:21 matt Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.6 2009/08/11 03:56:34 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.7 2009/08/11 04:46:21 matt Exp $);
 
 #include opt_ddb.h
 #include opt_execfmt.h
@@ -172,7 +172,6 @@
 struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
-int	physmem;		/* Total physical memory */
 int	netboot;		/* Are we netbooting? */
 
 phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];