CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 06:55:38 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: TODO

Log Message:
i've created the initial draft of the man page - take this off the list of
things to do.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO

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

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/TODO
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/TODO	Mon Aug  8 06:55:37 2011
@@ -1,6 +1,5 @@
 To Do
 =
-man page
 global buf - make local
 
 Done
@@ -14,3 +13,4 @@
 u_int
 u_char
 mktemp()
+man page



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 06:54:41 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: Makefile

Log Message:
Also make the man page for iscsictl(8)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile

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

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.2	Mon Aug  8 02:25:32 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile	Mon Aug  8 06:54:41 2011
@@ -1,6 +1,5 @@
 #	$wasabi: Makefile,v 1.2 2006/05/03 22:45:02 wrstuden Exp $
 
-MKMAN=	no
 PROG=	iscsictl
 BINDIR=	/sbin
 
@@ -9,8 +8,13 @@
 
 CPPFLAGS+= -I${DESTDIR}/usr/include/dev/iscsi
 
+CPPFLAGS+=	-I${.CURDIR}/../../sys/dev/iscsi
+CPPFLAGS+=	-I${.CURDIR}/../../sys
+CPPFLAGS+=	-I${.CURDIR}/../iscsid
 WARNS=	4
 
+MAN=	iscsictl.8
+
 # CPPFLAGS+= -DISCSI_TEST_MODE -DISCSI_DEBUG
 
 .include 



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 06:53:00 UTC 2011

Added Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsictl.8

Log Message:
Add a first pass at a manual page, iscsictl(8).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8

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

Added files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8
diff -u /dev/null othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.1
--- /dev/null	Mon Aug  8 06:53:00 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8	Mon Aug  8 06:52:59 2011
@@ -0,0 +1,219 @@
+.\" $NetBSD: iscsictl.8,v 1.1 2011/08/08 06:52:59 agc Exp $
+.\"
+.\" Copyright (c) 2011 Alistair Crooks 
+.\" All rights reserved.
+.\"
+.\" 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 ``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 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.
+.\"
+.Dd August 5, 2011
+.Dt ISCSICTL 8
+.Os
+.Sh NAME
+.Nm iscsictl
+.Nd program to manage iSCSI instances
+.Sh SYNOPSIS
+.Nm
+.Op Fl v
+.Op Fl d Ar directory
+command
+.Op Ar arguments...
+.Sh DESCRIPTION
+The
+.Nm
+utility manages iSCSI instances on the local computer.
+It talks to the
+.Xr iscsid 8
+program to perform this management.
+.Pp
+iSCSI is a method for transferring SCSI commands across a TCP
+connection.
+The client which issues the SCSI command is called the initiator,
+and the device which receives the command and takes action
+is called the target; this mirrors SCSI devices, although instead
+of being physically attached to a host, the SCSI commands and
+responses take place over a TCP connection.
+iSCSI communication is done in sessions.
+The iSCSI initiator logs in to a terget across the network,
+possible authenticating itself; this creates an iSCSI session between initiator
+and target.
+The initiator can then issue commands
+and read responses from the target.
+.Pp
+Firstly, a TCP connection
+the iSCSI initiator on the local machine must be made
+aware of the network location of the target.
+The
+.Dv add_send_target
+is used in
+.Nm
+to do this.
+The targets can be listed using the
+.Dv list_targets
+command.
+To login from the initiator to the target, the
+.Dv login
+command is used; this creates a session between the initiator and target.
+The sessions can be listed by using
+the
+.Dv list_sessions
+command.
+.Pp
+The
+.Nm
+command argument is taken from one of the following options:
+.Bl -tag -width XCXremove_send_targetXX
+.It version
+return the version number of the
+.Nm
+utility
+.It add_target
+.It add_portal
+.It remove_target
+.It slp_find_targets
+.It refresh_targets
+this command causes the iSCSI initiator to refresh its view of the
+iSCSI targets to which it is connected.
+If this command completes successfully, an
+.Dq OK
+value is printed.
+For more context on the exact usage of this
+command, please ee the worked example below.
+.It list_targets
+.It add_send_target
+this coomand allows the iSCSI initiator to connect to an iSCSI
+target. The subsequent
+.Fl a
+target provides the address of the target.
+This can be provided as a numerical IP address,
+or as a textual FQDN.
+For more context on the exact usage of this
+command, please ee the worked example below.
+.It remove_send_target
+.It list_send_targets
+.It add_isns_server
+.It remove_isns_server
+.It find_isns_servers
+.It list_isns_servers
+.It refresh_isns
+.It login
+To be able to communicate with the iSCSI target, the initiator
+must login. This command allows this login to take place.
+The subsequent
+.Fl P session
+argument provides the session which should be used to
+perform the login.
+On successful completion of this command, the
+session which has been created will be displayed

CVS commit: src/sys/kern

2011-08-07 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Aug  8 06:30:43 UTC 2011

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

Log Message:
Bounds process's stack size with max_stack_size so that 32bit
binary works regardless of stack size limit setting.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/kern/exec_subr.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/exec_subr.c
diff -u src/sys/kern/exec_subr.c:1.69 src/sys/kern/exec_subr.c:1.70
--- src/sys/kern/exec_subr.c:1.69	Thu Jun 23 23:42:44 2011
+++ src/sys/kern/exec_subr.c	Mon Aug  8 06:30:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_subr.c,v 1.69 2011/06/23 23:42:44 matt Exp $	*/
+/*	$NetBSD: exec_subr.c,v 1.70 2011/08/08 06:30:43 enami Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.69 2011/06/23 23:42:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.70 2011/08/08 06:30:43 enami Exp $");
 
 #include "opt_pax.h"
 
@@ -404,7 +404,8 @@
 	(unsigned long long)epp->ep_minsaddr,
 	(unsigned long long)max_stack_size));
 
-	epp->ep_ssize = l->l_proc->p_rlimit[RLIMIT_STACK].rlim_cur;
+	epp->ep_ssize = MIN(l->l_proc->p_rlimit[RLIMIT_STACK].rlim_cur,
+	max_stack_size);
 
 #ifdef PAX_ASLR
 	pax_aslr_stack(l, epp, &max_stack_size);



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 02:25:32 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: Makefile

Log Message:
Make this compile WARNS=4


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile

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

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.1.1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.2
--- othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.1.1.1	Mon May  2 07:01:06 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile	Mon Aug  8 02:25:32 2011
@@ -2,12 +2,15 @@
 
 MKMAN=	no
 PROG=	iscsictl
+BINDIR=	/sbin
 
 SRCS=	iscsic_main.c iscsic_driverif.c iscsic_daemonif.c iscsic_parse.c \
 	iscsic_test.c
 
 CPPFLAGS+= -I${DESTDIR}/usr/include/dev/iscsi
 
+WARNS=	4
+
 # CPPFLAGS+= -DISCSI_TEST_MODE -DISCSI_DEBUG
 
 .include 



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 02:24:33 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: TODO iscsic_daemonif.c
iscsic_driverif.c iscsic_globals.h iscsic_main.c iscsic_parse.c

Log Message:
Make this compile WARNS=4


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_parse.c

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

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/TODO
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.1.1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.2
--- othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.1.1.1	Mon May  2 07:01:06 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/TODO	Mon Aug  8 02:24:33 2011
@@ -1,6 +1,5 @@
 To Do
 =
-mktemp()
 man page
 global buf - make local
 
@@ -14,3 +13,4 @@
 ctype.h
 u_int
 u_char
+mktemp()
Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.1.1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.2
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.1.1.1	Mon May  2 07:01:03 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c	Mon Aug  8 02:24:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_daemonif.c,v 1.1.1.1 2011/05/02 07:01:03 agc Exp $	*/
+/*	$NetBSD: iscsic_daemonif.c,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -49,7 +49,8 @@
 	iscsid_get_set_target_options_t opt;
 	iscsid_response_t *rsp;
 	iscsid_add_target_rsp_t *res;
-	int opts, auths, tlen, i;
+	unsigned		i;
+	int opts, auths, tlen;
 	uint32_t tid;
 
 	tlen = cl_get_target(&targ, argc, argv, kind != SEND_TARGETS_LIST);
@@ -134,7 +135,7 @@
 	iscsid_response_t *rsp;
 
 	if (!cl_get_id('I', &req.id, argc, argv)) {
-		if (!cl_get_string('n', srch.strval, argc, argv)) {
+		if (!cl_get_string('n', (char *)srch.strval, argc, argv)) {
 			arg_missing("Target ID or Name");
 		}
 		check_extra_args(argc, argv);
@@ -192,7 +193,8 @@
 
 			srch.search_kind = FIND_NAME;
 			srch.list_kind = kind;
-			strlcpy(srch.strval, id.name, sizeof(srch.strval));
+			strlcpy((char *)srch.strval, (char *)id.name,
+sizeof(srch.strval));
 
 			send_request(ISCSID_SEARCH_LIST, sizeof(srch), &srch);
 			rsp = get_response(FALSE);
@@ -347,7 +349,7 @@
 	iscsid_response_t *trsp, *prsp;
 	iscsid_get_target_rsp_t *targ;
 	iscsid_get_portal_rsp_t *port;
-	int i;
+	unsigned i;
 
 	/* get target info */
 	req.list_kind = kind;
@@ -414,7 +416,7 @@
 	iscsid_get_list_req_t lst;
 	iscsid_response_t *rsp;
 	iscsid_get_list_rsp_t *list;
-	int i;
+	unsigned i;
 
 	check_extra_args(argc, argv);
 
@@ -512,10 +514,11 @@
 int
 add_isns_server(int argc, char **argv)
 {
-	iscsid_add_isns_server_req_t arg = { {0} };
+	iscsid_add_isns_server_req_t arg;
 	iscsid_add_isns_server_rsp_t *res;
 	iscsid_response_t *rsp;
 
+	(void) memset(&arg, 0x0, sizeof(arg));
 	if (!(cl_get_isns(&arg, argc, argv))) {
 		arg_missing("Server Address");
 	}
@@ -553,7 +556,7 @@
 	iscsid_response_t *rsp;
 
 	if (!cl_get_id('I', &req, argc, argv)) {
-		if (!cl_get_string('a', srch.strval, argc, argv)) {
+		if (!cl_get_string('a', (char *)srch.strval, argc, argv)) {
 			arg_missing("Server Address");
 		}
 		check_extra_args(argc, argv);
@@ -615,9 +618,10 @@
 	iscsid_response_t *rsp, *prsp;
 	iscsid_get_list_rsp_t *list;
 	iscsid_get_isns_server_rsp_t *isns;
-	iscsid_sym_id_t req = { 0 };
-	int i;
+	iscsid_sym_id_t req;
+	unsigned i;
 
+	(void) memset(&req, 0x0, sizeof(req));
 	check_extra_args(argc, argv);
 
 	/* get the list of servers */
@@ -674,11 +678,12 @@
 int
 add_initiator(int argc, char **argv)
 {
-	iscsid_add_initiator_req_t req = { {0} };
+	iscsid_add_initiator_req_t req;
 	iscsid_add_initiator_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	if (!cl_get_string('a', req.address, argc, argv)) {
+	(void) memset(&req, 0x0, sizeof(req));
+	if (!cl_get_string('a', (char *)req.address, argc, argv)) {
 		arg_missing("Interface Address");
 	}
 	cl_get_symname(req.name, argc, argv);
@@ -709,9 +714,10 @@
 int
 remove_initiator(int argc, char **argv)
 {
-	iscsid_sym_id_t req = { 0 };
+	iscsid_sym_id_t req;
 	iscsid_response_t *rsp;
 
+	(void) memset(&req, 0x0, sizeof(req));
 	if (!cl_get_id('I', &req, argc, argv)) {
 		arg_missing("Initiator Portal ID");
 	}
@@ -744,9 +750,10 @@
 	iscsid_response_t *rsp, *prsp;
 	iscsid_get_list_rsp_t *list;
 	iscsid_get_initiator_rsp_t *init;
-	iscsid_sym_id_t req = { 0 };
-	int i;
+	iscsid_sym_id_t 

CVS commit: src/sys

2011-08-07 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Aug  7 21:38:32 UTC 2011

Modified Files:
src/sys/kern: kern_cpu.c subr_kcpuset.c subr_pserialize.c sys_sched.c
src/sys/sys: kcpuset.h

Log Message:
- Add an argument to kcpuset_create() for zeroing.
- Add kcpuset_atomic_set(), kcpuset_atomic_clear() and kcpuset_merge().


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/kern/kern_cpu.c
cvs rdiff -u -r1.2 -r1.3 src/sys/kern/subr_kcpuset.c
cvs rdiff -u -r1.3 -r1.4 src/sys/kern/subr_pserialize.c
cvs rdiff -u -r1.37 -r1.38 src/sys/kern/sys_sched.c
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/kcpuset.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_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.49 src/sys/kern/kern_cpu.c:1.50
--- src/sys/kern/kern_cpu.c:1.49	Sun Aug  7 21:13:05 2011
+++ src/sys/kern/kern_cpu.c	Sun Aug  7 21:38:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.49 2011/08/07 21:13:05 rmind Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.50 2011/08/07 21:38:32 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.49 2011/08/07 21:13:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.50 2011/08/07 21:38:32 rmind Exp $");
 
 #include 
 #include 
@@ -134,8 +134,7 @@
 	if (__predict_false(cpu_infos == NULL)) {
 		cpu_infos =
 		kmem_zalloc(sizeof(cpu_infos[0]) * maxcpus, KM_SLEEP);
-		kcpuset_create(&kcpuset_attached);
-		kcpuset_zero(kcpuset_attached);
+		kcpuset_create(&kcpuset_attached, true);
 	}
 	cpu_infos[cpu_index(ci)] = ci;
 	kcpuset_set(kcpuset_attached, ci->ci_index);

Index: src/sys/kern/subr_kcpuset.c
diff -u src/sys/kern/subr_kcpuset.c:1.2 src/sys/kern/subr_kcpuset.c:1.3
--- src/sys/kern/subr_kcpuset.c:1.2	Sun Aug  7 21:13:05 2011
+++ src/sys/kern/subr_kcpuset.c	Sun Aug  7 21:38:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kcpuset.c,v 1.2 2011/08/07 21:13:05 rmind Exp $	*/
+/*	$NetBSD: subr_kcpuset.c,v 1.3 2011/08/07 21:38:32 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kcpuset.c,v 1.2 2011/08/07 21:13:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kcpuset.c,v 1.3 2011/08/07 21:38:32 rmind Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@
 
 static pool_cache_t		kc_cache __read_mostly;
 
-static kcpuset_t *		kcpuset_create_raw(void);
+static kcpuset_t *		kcpuset_create_raw(bool);
 
 /*
  * kcpuset_sysinit: initialize the subsystem, transfer early boot cases
@@ -119,8 +119,7 @@
 
 	/* First, pre-allocate kcpuset entries. */
 	for (i = 0; i < kc_last_idx; i++) {
-		kcp = kcpuset_create_raw();
-		kcpuset_zero(kcp);
+		kcp = kcpuset_create_raw(true);
 		kc_dynamic[i] = kcp;
 	}
 
@@ -188,7 +187,7 @@
  */
 
 static kcpuset_t *
-kcpuset_create_raw(void)
+kcpuset_create_raw(bool zero)
 {
 	kcpuset_impl_t *kc;
 
@@ -196,13 +195,17 @@
 	kc->kc_refcnt = 1;
 	kc->kc_next = NULL;
 
+	if (zero) {
+		memset(&kc->kc_field, 0, kc_bitsize);
+	}
+
 	/* Note: return pointer to the actual field of bits. */
 	KASSERT((uint8_t *)kc + KC_BITS_OFF == (uint8_t *)&kc->kc_field);
 	return &kc->kc_field;
 }
 
 void
-kcpuset_create(kcpuset_t **retkcp)
+kcpuset_create(kcpuset_t **retkcp, bool zero)
 {
 
 	if (__predict_false(!kc_initialised)) {
@@ -210,7 +213,7 @@
 		*retkcp = kcpuset_early_ptr(retkcp);
 		return;
 	}
-	*retkcp = kcpuset_create_raw();
+	*retkcp = kcpuset_create_raw(zero);
 }
 
 void
@@ -237,8 +240,7 @@
 kcpuset_copy(kcpuset_t *dkcp, kcpuset_t *skcp)
 {
 
-	KASSERT(kc_initialised);
-	KASSERT(KC_GETSTRUCT(dkcp)->kc_refcnt == 1);
+	KASSERT(!kc_initialised || KC_GETSTRUCT(dkcp)->kc_refcnt == 1);
 	memcpy(dkcp, skcp, kc_bitsize);
 }
 
@@ -383,3 +385,34 @@
 
 	return memcmp(kcp1, kcp2, kc_bitsize) == 0;
 }
+
+void
+kcpuset_merge(kcpuset_t *kcp1, kcpuset_t *kcp2)
+{
+
+	for (size_t j = 0; j < kc_nfields; j++) {
+		kcp1->bits[j] |= kcp2->bits[j];
+	}
+}
+
+/*
+ * Routines to set/clear the flags atomically.
+ */
+
+void
+kcpuset_atomic_set(kcpuset_t *kcp, cpuid_t i)
+{
+	const size_t j = i >> KC_SHIFT;
+
+	KASSERT(j < kc_nfields);
+	atomic_or_32(&kcp->bits[j], 1 << (i & KC_MASK));
+}
+
+void
+kcpuset_atomic_clear(kcpuset_t *kcp, cpuid_t i)
+{
+	const size_t j = i >> KC_SHIFT;
+
+	KASSERT(j < kc_nfields);
+	atomic_and_32(&kcp->bits[j], ~(1 << (i & KC_MASK)));
+}

Index: src/sys/kern/subr_pserialize.c
diff -u src/sys/kern/subr_pserialize.c:1.3 src/sys/kern/subr_pserialize.c:1.4
--- src/sys/kern/subr_pserialize.c:1.3	Sun Aug  7 13:33:01 2011
+++ src/sys/kern/subr_pserialize.c	Sun Aug  7 21:38:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pserialize.c,v 1.3 2011/08/07 13:33:01 rmind Exp $	*/
+/*	$NetBSD: subr_pserialize.c,v 1.4 2011/08/07 21:38:32 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #includ

CVS commit: src/sys

2011-08-07 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Aug  7 21:13:06 UTC 2011

Modified Files:
src/sys/kern: kern_cpu.c kern_lwp.c kern_runq.c subr_kcpuset.c
sys_pset.c sys_sched.c
src/sys/sys: lwp.h

Log Message:
Remove LW_AFFINITY flag and fix some bugs affinity mask handling.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/kern/kern_cpu.c
cvs rdiff -u -r1.161 -r1.162 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/kern_runq.c
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/subr_kcpuset.c
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/sys_pset.c
cvs rdiff -u -r1.36 -r1.37 src/sys/kern/sys_sched.c
cvs rdiff -u -r1.154 -r1.155 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_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.48 src/sys/kern/kern_cpu.c:1.49
--- src/sys/kern/kern_cpu.c:1.48	Sun Aug  7 13:33:01 2011
+++ src/sys/kern/kern_cpu.c	Sun Aug  7 21:13:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.48 2011/08/07 13:33:01 rmind Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.49 2011/08/07 21:13:05 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.48 2011/08/07 13:33:01 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.49 2011/08/07 21:13:05 rmind Exp $");
 
 #include 
 #include 
@@ -311,13 +311,12 @@
 			lwp_unlock(l);
 			continue;
 		}
-		/* Normal case - no affinity */
-		if ((l->l_flag & LW_AFFINITY) == 0) {
+		/* Regular case - no affinity. */
+		if (l->l_affinity == NULL) {
 			lwp_migrate(l, target_ci);
 			continue;
 		}
-		/* Affinity is set, find an online CPU in the set */
-		KASSERT(l->l_affinity != NULL);
+		/* Affinity is set, find an online CPU in the set. */
 		for (CPU_INFO_FOREACH(cii, mci)) {
 			mspc = &mci->ci_schedstate;
 			if ((mspc->spc_flags & SPCF_OFFLINE) == 0 &&

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.161 src/sys/kern/kern_lwp.c:1.162
--- src/sys/kern/kern_lwp.c:1.161	Sat Jul 30 17:01:04 2011
+++ src/sys/kern/kern_lwp.c	Sun Aug  7 21:13:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.161 2011/07/30 17:01:04 christos Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.162 2011/08/07 21:13:05 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.161 2011/07/30 17:01:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.162 2011/08/07 21:13:05 rmind Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -803,18 +803,19 @@
 	p2->p_nlwps++;
 	p2->p_nrlwps++;
 
+	KASSERT(l2->l_affinity == NULL);
+
 	if ((p2->p_flag & PK_SYSTEM) == 0) {
-		/* Inherit an affinity */
-		if (l1->l_flag & LW_AFFINITY) {
+		/* Inherit the affinity mask. */
+		if (l1->l_affinity) {
 			/*
 			 * Note that we hold the state lock while inheriting
 			 * the affinity to avoid race with sched_setaffinity().
 			 */
 			lwp_lock(l1);
-			if (l1->l_flag & LW_AFFINITY) {
+			if (l1->l_affinity) {
 kcpuset_use(l1->l_affinity);
 l2->l_affinity = l1->l_affinity;
-l2->l_flag |= LW_AFFINITY;
 			}
 			lwp_unlock(l1);
 		}
@@ -987,12 +988,8 @@
 
 	lwp_lock(l);
 	l->l_stat = LSZOMB;
-	if (l->l_name != NULL)
+	if (l->l_name != NULL) {
 		strcpy(l->l_name, "(zombie)");
-	if (l->l_flag & LW_AFFINITY) {
-		l->l_flag &= ~LW_AFFINITY;
-	} else {
-		KASSERT(l->l_affinity == NULL);
 	}
 	lwp_unlock(l);
 	p->p_nrlwps--;
@@ -1001,12 +998,6 @@
 		l->l_lwpctl->lc_curcpu = LWPCTL_CPU_EXITED;
 	mutex_exit(p->p_lock);
 
-	/* Safe without lock since LWP is in zombie state */
-	if (l->l_affinity) {
-		kcpuset_unuse(l->l_affinity, NULL);
-		l->l_affinity = NULL;
-	}
-
 	/*
 	 * We can no longer block.  At this point, lwp_free() may already
 	 * be gunning for us.  On a multi-CPU system, we may be off p_lwps.
@@ -1103,6 +1094,17 @@
 	cv_destroy(&l->l_sigcv);
 
 	/*
+	 * Free lwpctl structure and affinity.
+	 */
+	if (l->l_lwpctl) {
+		lwp_ctl_free(l);
+	}
+	if (l->l_affinity) {
+		kcpuset_unuse(l->l_affinity, NULL);
+		l->l_affinity = NULL;
+	}
+
+	/*
 	 * Free the LWP's turnstile and the LWP structure itself unless the
 	 * caller wants to recycle them.  Also, free the scheduler specific
 	 * data.
@@ -1112,8 +1114,6 @@
 	 *
 	 * We don't recycle the VM resources at this time.
 	 */
-	if (l->l_lwpctl != NULL)
-		lwp_ctl_free(l);
 
 	if (!recycle && l->l_ts != &turnstile0)
 		pool_cache_put(turnstile_cache, l->l_ts);

Index: src/sys/kern/kern_runq.c
diff -u src/sys/kern/kern_runq.c:1.31 src/sys/kern/kern_runq.c:1.32
--- src/sys/kern/kern_runq.c:1.31	Sun Aug  7 13:33:01 2011
+++ src/sys/kern/kern_runq.c	Sun Aug  7 21:13:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.31 2011/08/07 13:33:01 rmind Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.32 2011/08/07 21:13:05 rmind Exp $	*/
 

CVS commit: src/doc

2011-08-07 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sun Aug  7 20:44:32 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
New linux syscalls: fadvise64() and fadvise64_64().


To generate a diff of this commit:
cvs rdiff -u -r1.1590 -r1.1591 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.1590 src/doc/CHANGES:1.1591
--- src/doc/CHANGES:1.1590	Sun Aug  7 08:15:56 2011
+++ src/doc/CHANGES	Sun Aug  7 20:44:32 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1590 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1591 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1022,6 +1022,8 @@
 	makefs(8): Fix a corrupted RRIP entry problem in deep directories on
 		cd9660 fs with rockridge extension. [tsutsui 20110529]
 	tmpfs: Many fixes and some performance improvements. [rmind 20110529]
+	compat_linux(8), compat_linux32: Add fadvise64() and fadvise64_64()
+		syscalls. [alnsn 20110530]
 	powerpc: Initial SMP support for MPC85xx, reworked and unified IPI
 		code, various other improvements. [matt 20110605]
 	ktrace(1): Add a new trace point to list all open file descriptors



CVS commit: src/sys/dev/ic

2011-08-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Aug  7 20:14:42 UTC 2011

Modified Files:
src/sys/dev/ic: isacsx.h

Log Message:
Another instance of REG_OFFSET that needs to be consistent with the rest.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/isacsx.h

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

Modified files:

Index: src/sys/dev/ic/isacsx.h
diff -u src/sys/dev/ic/isacsx.h:1.4 src/sys/dev/ic/isacsx.h:1.5
--- src/sys/dev/ic/isacsx.h:1.4	Mon Sep  8 23:36:54 2008
+++ src/sys/dev/ic/isacsx.h	Sun Aug  7 20:14:42 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: isacsx.h,v 1.4 2008/09/08 23:36:54 gmcgarry Exp $	*/
+/* $NetBSD: isacsx.h,v 1.5 2011/08/07 20:14:42 jakllsch Exp $	*/
 /*
  *   Copyright (c) 2001 Gary Jennejohn. All rights reserved.
  *
@@ -241,7 +241,7 @@
 	} isacsx_rw;
 }  __packed isacsx_reg_t;
 
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
+#define REG_OFFSET(type, field) (uintptr_t)(&(((type *)0)->field))
 
 /* ISACSX read registers */
 



CVS commit: src/sys/dev/ic

2011-08-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Aug  7 20:05:08 UTC 2011

Modified Files:
src/sys/dev/ic: hscx.h ipac.h isac.h

Log Message:
Appease _LP64 build with GCC 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/hscx.h src/sys/dev/ic/ipac.h \
src/sys/dev/ic/isac.h

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

Modified files:

Index: src/sys/dev/ic/hscx.h
diff -u src/sys/dev/ic/hscx.h:1.3 src/sys/dev/ic/hscx.h:1.4
--- src/sys/dev/ic/hscx.h:1.3	Sun Dec 11 12:21:26 2005
+++ src/sys/dev/ic/hscx.h	Sun Aug  7 20:05:08 2011
@@ -30,7 +30,7 @@
  *
  *---
  *
- *	$Id: hscx.h,v 1.3 2005/12/11 12:21:26 christos Exp $
+ *	$Id: hscx.h,v 1.4 2011/08/07 20:05:08 jakllsch Exp $
  *
  *  last edit-date: [Sun Feb 14 10:26:56 1999]
  *
@@ -119,7 +119,7 @@
 	} hscx_rw;
 } hscx_reg_t;
 
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
+#define REG_OFFSET(type, field) (uintptr_t)(&(((type *)0)->field))
 
 /* HSCX read registers */
 
Index: src/sys/dev/ic/ipac.h
diff -u src/sys/dev/ic/ipac.h:1.3 src/sys/dev/ic/ipac.h:1.4
--- src/sys/dev/ic/ipac.h:1.3	Sun Dec 11 12:21:27 2005
+++ src/sys/dev/ic/ipac.h	Sun Aug  7 20:05:08 2011
@@ -27,7 +27,7 @@
  *	i4b_ipac.h - definitions for the Siemens IPAC PSB2115 chip
  *	==
  *
- *	$Id: ipac.h,v 1.3 2005/12/11 12:21:27 christos Exp $
+ *	$Id: ipac.h,v 1.4 2011/08/07 20:05:08 jakllsch Exp $
  *
  *  last edit-date: [Thu Jan  6 14:54:19 2000]
  *
@@ -92,7 +92,7 @@
 	} ipac_rw;
 } ipac_reg_t;
 
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
+#define REG_OFFSET(type, field) (uintptr_t)(&(((type *)0)->field))
 
 /* IPAC read registers */
 
Index: src/sys/dev/ic/isac.h
diff -u src/sys/dev/ic/isac.h:1.3 src/sys/dev/ic/isac.h:1.4
--- src/sys/dev/ic/isac.h:1.3	Sun Dec 11 12:21:27 2005
+++ src/sys/dev/ic/isac.h	Sun Aug  7 20:05:08 2011
@@ -30,7 +30,7 @@
  *
  *---
  *
- *	$Id: isac.h,v 1.3 2005/12/11 12:21:27 christos Exp $
+ *	$Id: isac.h,v 1.4 2011/08/07 20:05:08 jakllsch Exp $
  *
  *  last edit-date: [Sun Feb 14 10:27:13 1999]
  *
@@ -144,7 +144,7 @@
 	} isac_rw;
 } isac_reg_t;
 
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
+#define REG_OFFSET(type, field) (uintptr_t)(&(((type *)0)->field))
 
 /* ISAC read registers */
 



CVS commit: [cherry-xenmp] src/sys/arch

2011-08-07 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sun Aug  7 19:48:08 UTC 2011

Modified Files:
src/sys/arch/i386/i386 [cherry-xenmp]: machdep.c
src/sys/arch/xen/x86 [cherry-xenmp]: cpu.c

Log Message:
Fix XEN3PAE_DOMx build


To generate a diff of this commit:
cvs rdiff -u -r1.702.2.3 -r1.702.2.4 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.56.2.4 -r1.56.2.5 src/sys/arch/xen/x86/cpu.c

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

Modified files:

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.702.2.3 src/sys/arch/i386/i386/machdep.c:1.702.2.4
--- src/sys/arch/i386/i386/machdep.c:1.702.2.3	Sat Aug  6 21:06:34 2011
+++ src/sys/arch/i386/i386/machdep.c	Sun Aug  7 19:48:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.702.2.3 2011/08/06 21:06:34 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.702.2.4 2011/08/07 19:48:07 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.702.2.3 2011/08/06 21:06:34 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.702.2.4 2011/08/07 19:48:07 cherry Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -1195,7 +1195,7 @@
 		pt_entry_t pg_nx = (cpu_feature[2] & CPUID_NOX ? PG_NX : 0);
 
 		pte = kvtopte((vaddr_t)gdt);
-		npte = pmap_pa2pte((paddr_t)gdt - KERNBASE);
+		npte = pmap_pa2pte((vaddr_t)gdt - KERNBASE);
 		npte |= PG_RO | pg_nx | PG_V;
 
 		xpq_queue_lock();

Index: src/sys/arch/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.56.2.4 src/sys/arch/xen/x86/cpu.c:1.56.2.5
--- src/sys/arch/xen/x86/cpu.c:1.56.2.4	Sun Jul 31 20:49:11 2011
+++ src/sys/arch/xen/x86/cpu.c	Sun Aug  7 19:48:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.56.2.4 2011/07/31 20:49:11 cherry Exp $	*/
+/*	$NetBSD: cpu.c,v 1.56.2.5 2011/08/07 19:48:08 cherry Exp $	*/
 /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp  */
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.56.2.4 2011/07/31 20:49:11 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.56.2.5 2011/08/07 19:48:08 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -140,7 +140,7 @@
 	bool sc_wasonline;
 };
 
-int mp_cpu_start(struct cpu_info *, paddr_t);
+int mp_cpu_start(struct cpu_info *, vaddr_t);
 void mp_cpu_start_cleanup(struct cpu_info *);
 const struct cpu_functions mp_cpu_funcs = { mp_cpu_start, NULL,
   mp_cpu_start_cleanup };



CVS commit: src/sys/dev/isa

2011-08-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Aug  7 19:46:22 UTC 2011

Modified Files:
src/sys/dev/isa: dpt_isa.c

Log Message:
Appease _LP64 build with GCC 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/isa/dpt_isa.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/isa/dpt_isa.c
diff -u src/sys/dev/isa/dpt_isa.c:1.20 src/sys/dev/isa/dpt_isa.c:1.21
--- src/sys/dev/isa/dpt_isa.c:1.20	Tue May 12 09:10:15 2009
+++ src/sys/dev/isa/dpt_isa.c	Sun Aug  7 19:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dpt_isa.c,v 1.20 2009/05/12 09:10:15 cegger Exp $	*/
+/*	$NetBSD: dpt_isa.c,v 1.21 2011/08/07 19:46:22 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Andrew Doran 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dpt_isa.c,v 1.20 2009/05/12 09:10:15 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dpt_isa.c,v 1.21 2011/08/07 19:46:22 jakllsch Exp $");
 
 #include 
 #include 
@@ -171,7 +171,7 @@
 	 */
 	bus_space_write_1(iot, ioh, HA_COMMAND, CP_PIO_GETCFG);
 	memset(&ec, 0, sizeof(ec));
-	i = ((int)&((struct eata_cfg *)0)->ec_cfglen +
+	i = ((uintptr_t)&((struct eata_cfg *)0)->ec_cfglen +
 	sizeof(ec.ec_cfglen)) >> 1;
 	p = (u_int16_t *)&ec;
 
@@ -183,13 +183,13 @@
 		*p++ = bus_space_read_stream_2(iot, ioh, HA_DATA);
 
 	if ((i = ec.ec_cfglen) > (sizeof(struct eata_cfg)
-	- (int)(&(((struct eata_cfg *)0L)->ec_cfglen))
+	- (uintptr_t)(&(((struct eata_cfg *)0L)->ec_cfglen))
 	- sizeof(ec.ec_cfglen)))
 		i = sizeof(struct eata_cfg)
-		  - (int)(&(((struct eata_cfg *)0L)->ec_cfglen))
+		  - (uintptr_t)(&(((struct eata_cfg *)0L)->ec_cfglen))
 		  - sizeof(ec.ec_cfglen);
 
-	j = i + (int)(&(((struct eata_cfg *)0L)->ec_cfglen)) +
+	j = i + (uintptr_t)(&(((struct eata_cfg *)0L)->ec_cfglen)) +
 	sizeof(ec.ec_cfglen);
 	i >>= 1;
 



CVS commit: src/sys/dev/usb

2011-08-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Aug  7 18:58:53 UTC 2011

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

Log Message:
Make uhci_find_prev_qh() always 'static inline', just 'inline" leads to trouble.


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/sys/dev/usb/uhci.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/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.239 src/sys/dev/usb/uhci.c:1.240
--- src/sys/dev/usb/uhci.c:1.239	Thu Jun  9 19:08:32 2011
+++ src/sys/dev/usb/uhci.c	Sun Aug  7 18:58:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.239 2011/06/09 19:08:32 matt Exp $	*/
+/*	$NetBSD: uhci.c,v 1.240 2011/08/07 18:58:52 jakllsch Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.239 2011/06/09 19:08:32 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.240 2011/08/07 18:58:52 jakllsch Exp $");
 
 #include "opt_usb.h"
 
@@ -222,7 +222,7 @@
 Static void		uhci_device_clear_toggle(usbd_pipe_handle pipe);
 Static void		uhci_noop(usbd_pipe_handle pipe);
 
-Static inline uhci_soft_qh_t *uhci_find_prev_qh(uhci_soft_qh_t *,
+static inline uhci_soft_qh_t *uhci_find_prev_qh(uhci_soft_qh_t *,
 		uhci_soft_qh_t *);
 
 #ifdef UHCI_DEBUG
@@ -353,7 +353,7 @@
 	} while (0)
 #define uhci_active_intr_info(ii) ((ii)->list.le_prev != NULL)
 
-Static inline uhci_soft_qh_t *
+static inline uhci_soft_qh_t *
 uhci_find_prev_qh(uhci_soft_qh_t *pqh, uhci_soft_qh_t *sqh)
 {
 	DPRINTFN(15,("uhci_find_prev_qh: pqh=%p sqh=%p\n", pqh, sqh));



CVS commit: src/sys/arch/xen/xen

2011-08-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Aug  7 17:39:34 UTC 2011

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Guard against spurious xbdback_backend_changed() calls which would result
in the block device being opened twice. Fixes port-xen/45158,
although the underlying cause (multiple open of the same device not
properly handled any more) is not fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.44 src/sys/arch/xen/xen/xbdback_xenbus.c:1.45
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.44	Sun Aug  7 17:15:40 2011
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Sun Aug  7 17:39:34 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.44 2011/08/07 17:15:40 bouyer Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.45 2011/08/07 17:39:34 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.44 2011/08/07 17:15:40 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.45 2011/08/07 17:39:34 bouyer Exp $");
 
 #include 
 #include 
@@ -691,10 +691,16 @@
 	 */
 	if (err)
 		return;
-	if (xbdi->xbdi_status == CONNECTED && xbdi->xbdi_dev != dev) {
-		printf("xbdback %s: changing physical device from 0x%"PRIx64
-		" to 0x%lx not supported\n",
-		xbusd->xbusd_path, xbdi->xbdi_dev, dev);
+	/*
+	 * we can also fire up after having openned the device, don't try
+	 * to do it twice.
+	 */
+	if (xbdi->xbdi_vp != NULL) {
+		if (xbdi->xbdi_status == CONNECTED && xbdi->xbdi_dev != dev) {
+			printf("xbdback %s: changing physical device from "
+			"0x%" PRIx64 " to 0x%lx not supported\n",
+			xbusd->xbusd_path, xbdi->xbdi_dev, dev);
+		}
 		return;
 	}
 	xbdi->xbdi_dev = dev;



CVS commit: src/sys/arch/xen/xen

2011-08-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Aug  7 17:10:35 UTC 2011

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Several fixes to the continuation engine:
- make sure to enter the continuation loop at splbio(), and add some
  KASSERT() for this.
- When a flush operation is enqueued to the workqueue, make sure the
  continuation loop can't be restarted by a previous workqueue
  completion or an event. We can't restart it at this point because
  the flush even is still recorded as the current I/O.
  For this add a xbdback_co_cache_doflush_wait() which acts as a noop;
  the workqueue callback will restart the loop once the flush is complete.
Should fix "kernel diagnostic assertion xbd_io->xio_mapped == 0" panics
reported by Jeff Rizzo on port-xen@.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.42 src/sys/arch/xen/xen/xbdback_xenbus.c:1.43
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.42	Thu Aug  4 18:01:49 2011
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Sun Aug  7 17:10:35 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.42 2011/08/04 18:01:49 bouyer Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.43 2011/08/07 17:10:35 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.42 2011/08/04 18:01:49 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.43 2011/08/07 17:10:35 bouyer Exp $");
 
 #include 
 #include 
@@ -287,6 +287,7 @@
 static void *xbdback_co_cache_flush(struct xbdback_instance *, void *);
 static void *xbdback_co_cache_flush2(struct xbdback_instance *, void *);
 static void *xbdback_co_cache_doflush(struct xbdback_instance *, void *);
+static void *xbdback_co_cache_doflush_wait(struct xbdback_instance *, void *);
 
 static void *xbdback_co_io(struct xbdback_instance *, void *);
 static void *xbdback_co_io_gotreq(struct xbdback_instance *, void *);
@@ -967,6 +968,8 @@
 {
 	(void)obj;
 	if (xbdi->xbdi_io != NULL) {
+		KASSERT(xbdi->xbdi_io->xio_operation == BLKIF_OP_READ ||
+		xbdi->xbdi_io->xio_operation == BLKIF_OP_WRITE);
 		xbdi->xbdi_cont = xbdback_co_flush;
 		xbdi->xbdi_cont_aux = xbdback_co_main_done2;
 	} else {
@@ -999,9 +1002,13 @@
 xbdback_co_cache_flush(struct xbdback_instance *xbdi, void *obj)
 {
 	(void)obj;
+	KASSERT(curcpu()->ci_ilevel >= IPL_BIO);
 	XENPRINTF(("xbdback_co_cache_flush %p %p\n", xbdi, obj));
 	if (xbdi->xbdi_io != NULL) {
 		/* Some I/Os are required for this instance. Process them. */
+		KASSERT(xbdi->xbdi_io->xio_operation == BLKIF_OP_READ ||
+		xbdi->xbdi_io->xio_operation == BLKIF_OP_WRITE);
+		KASSERT(xbdi->xbdi_pendingreqs == 0);
 		xbdi->xbdi_cont = xbdback_co_flush;
 		xbdi->xbdi_cont_aux = xbdback_co_cache_flush2;
 	} else {
@@ -1016,8 +1023,10 @@
 	(void)obj;
 	XENPRINTF(("xbdback_co_cache_flush2 %p %p\n", xbdi, obj));
 	if (xbdi->xbdi_pendingreqs > 0) {
-		/* There are pending requests.
-		 * Event or iodone() will restart processing */
+		/*
+		 * There are pending requests.
+		 * Event or iodone() will restart processing
+		 */
 		xbdi->xbdi_cont = NULL;
 		xbdi_put(xbdi);
 		return NULL;
@@ -1039,7 +1048,17 @@
 	xbd_io->xio_flush_id = xbdi->xbdi_xen_req.id;
 	workqueue_enqueue(xbdback_workqueue, &xbdi->xbdi_io->xio_work, NULL);
 	/* xbdback_do_io() will advance req pointer and restart processing */
-	xbdi->xbdi_cont = NULL;
+	xbdi->xbdi_cont = xbdback_co_cache_doflush_wait;
+	return NULL;
+}
+
+/* wait for the flush work to complete */
+static void *
+xbdback_co_cache_doflush_wait(struct xbdback_instance *xbdi, void *obj)
+{
+	(void)obj;
+	/* abort the continuation loop; xbdback_do_io() will restart it */
+	xbdi->xbdi_cont = xbdback_co_cache_doflush_wait;
 	return NULL;
 }
 
@@ -1067,6 +1086,8 @@
 		goto end;
 	}
 
+	KASSERT(req->operation == BLKIF_OP_READ ||
+	req->operation == BLKIF_OP_WRITE);
 	if (req->operation == BLKIF_OP_WRITE) {
 		if (xbdi->xbdi_ro) {
 			error = EROFS;
@@ -1122,6 +1143,8 @@
 	xrq->rq_ioerrs = 0;
 	xrq->rq_id = xbdi->xbdi_xen_req.id;
 	xrq->rq_operation = xbdi->xbdi_xen_req.operation;
+	KASSERT(xbdi->xbdi_req->rq_operation == BLKIF_OP_READ ||
+	xbdi->xbdi_req->rq_operation == BLKIF_OP_WRITE);
 
 	/* 
 	 * Request-level reasons not to coalesce: different device,
@@ -1144,6 +1167,8 @@
 			xbdi->xbdi_next_sector =
 			xbdi->xbdi_xen_req.sector_number;
 			xbdi->xbdi_cont_aux = xbdi->xbdi_cont; 
+			KASSERT(xbdi->xbdi_io->xio_operation == BLKIF_OP_READ ||
+			xbdi->xbdi_io->xio_operation == BLKIF_OP_WRITE);
 			xbdi->xbdi_cont = xbdback_co_flush;
 		}
 	} else {
@@ -1159,6 +1184,8 @@
 	struct xbdback_io *xio;
 
 	(void)obj;
+	KASSERT(xbdi->xbdi_req->rq_operation

CVS commit: src/sys/arch/xen/xen

2011-08-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Aug  7 17:15:40 UTC 2011

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Add a comment explaing why a flush workqueue is handled differently from
read/write workqueue requests.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.43 src/sys/arch/xen/xen/xbdback_xenbus.c:1.44
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.43	Sun Aug  7 17:10:35 2011
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Sun Aug  7 17:15:40 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.43 2011/08/07 17:10:35 bouyer Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.44 2011/08/07 17:15:40 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.43 2011/08/07 17:10:35 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.44 2011/08/07 17:15:40 bouyer Exp $");
 
 #include 
 #include 
@@ -1047,7 +1047,12 @@
 	xbd_io->xio_operation = xbdi->xbdi_xen_req.operation;
 	xbd_io->xio_flush_id = xbdi->xbdi_xen_req.id;
 	workqueue_enqueue(xbdback_workqueue, &xbdi->xbdi_io->xio_work, NULL);
-	/* xbdback_do_io() will advance req pointer and restart processing */
+	/*
+	 * xbdback_do_io() will advance req pointer and restart processing.
+	 * Note that we could probably set xbdi->xbdi_io to NULL and
+	 * let the processing continue, but we really want to wait
+	 * for the flush to complete before doing any more work.
+	 */
 	xbdi->xbdi_cont = xbdback_co_cache_doflush_wait;
 	return NULL;
 }



CVS commit: src/sys/arch/bebox/bebox

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 15:44:59 UTC 2011

Modified Files:
src/sys/arch/bebox/bebox: locore.S

Log Message:
Cleanup spin loop for 2nd cpu.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/bebox/bebox/locore.S

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

Modified files:

Index: src/sys/arch/bebox/bebox/locore.S
diff -u src/sys/arch/bebox/bebox/locore.S:1.24 src/sys/arch/bebox/bebox/locore.S:1.25
--- src/sys/arch/bebox/bebox/locore.S:1.24	Mon Jun 20 19:56:11 2011
+++ src/sys/arch/bebox/bebox/locore.S	Sun Aug  7 15:44:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.24 2011/06/20 19:56:11 matt Exp $	*/
+/*	$NetBSD: locore.S,v 1.25 2011/08/07 15:44:59 kiyohara Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -120,31 +120,17 @@
 	cmpwi	0, 9, 0		/* 0 if read by CPU 0, 1 if read by CPU 1 */
 	bne	__start_cpu1
 	b	__start_cpu0
+	nop
 
 __start_cpu1:
-#ifdef CPU1_SLEEP
-	lis	8, 0x0020	/* SLEEP */
-	mfspr	7, SPR_HID0	/* get HID0 */
-	or	7, 7, 8
-	mtspr	SPR_HID0, 7	/* set HID0 */
-	lis	8, 0x0004	/* POW */
-	sync
-	mtmsr	8
-	isync			/* zzz... */
+#ifdef MULTIPROCESSOR
+	li	3, 0x1		/* CPU ID 1 */
+	ba	cpu_spinstart	/* cpu_spinstart(CPU ID) */
 #else
-	addi	9, 9, 1
-	lis	7, 0x100
-__start_cpu1_loop:
-	subi	7, 7, 1
-	cmpi	0, 7, 0
-	bne	__start_cpu1_loop
-	lis	8, 0x8000
-	ori	8, 8, 0x0c00
-	lis	9,_C_LABEL(cpu_info)+CI_CPL@ha
-	lwz	9,_C_LABEL(cpu_info)+CI_CPL@l(9)
-	stb	9, 0(8)
+1:
+	b	1b
 #endif
-	b	__start_cpu1
+	nop
 
 __start_cpu0:
 



CVS commit: src/sys/arch/bebox/bebox

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 15:31:35 UTC 2011

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

Log Message:
Try to attach 2nd CPU.  But not support options MULTIPROCESSOR yet.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/bebox/bebox/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/bebox/bebox/mainbus.c
diff -u src/sys/arch/bebox/bebox/mainbus.c:1.27 src/sys/arch/bebox/bebox/mainbus.c:1.28
--- src/sys/arch/bebox/bebox/mainbus.c:1.27	Fri Jul  1 20:34:53 2011
+++ src/sys/arch/bebox/bebox/mainbus.c	Sun Aug  7 15:31:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.27 2011/07/01 20:34:53 dyoung Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.28 2011/08/07 15:31:35 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.27 2011/07/01 20:34:53 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.28 2011/08/07 15:31:35 kiyohara Exp $");
 
 #include 
 #include 
@@ -108,6 +108,9 @@
 	ca.ca_name = "cpu";
 	ca.ca_node = 0;
 	config_found_ia(self, "mainbus", &ca, mainbus_print);
+	ca.ca_name = "cpu";
+	ca.ca_node = 1;
+	config_found_ia(self, "mainbus", &ca, mainbus_print);
 
 	/*
 	 * XXX Note also that the presence of a PCI bus should



CVS commit: src/sys/arch/bebox

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 15:22:19 UTC 2011

Modified Files:
src/sys/arch/bebox/bebox: machdep.c
src/sys/arch/bebox/include: isa_machdep.h

Log Message:
Cleanup headers and variables.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/bebox/bebox/machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/bebox/include/isa_machdep.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/bebox/bebox/machdep.c
diff -u src/sys/arch/bebox/bebox/machdep.c:1.103 src/sys/arch/bebox/bebox/machdep.c:1.104
--- src/sys/arch/bebox/bebox/machdep.c:1.103	Sun Aug  7 15:16:35 2011
+++ src/sys/arch/bebox/bebox/machdep.c	Sun Aug  7 15:22:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.103 2011/08/07 15:16:35 kiyohara Exp $	*/
+/*	$NetBSD: machdep.c,v 1.104 2011/08/07 15:22:19 kiyohara Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.103 2011/08/07 15:16:35 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.104 2011/08/07 15:22:19 kiyohara Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -41,42 +41,27 @@
 #define _POWERPC_BUS_DMA_PRIVATE
 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
 #include 
+#include 
 
 #include 
 
-#include 
+#include 
 #include 
+#include 
 #include 
 
-#include 
-#include 
-#include 
-
-#include 
 #include  
+#include 
 
 #include 
 
-#include "ksyms.h"
-
 #include "vga.h"
 #if (NVGA > 0)
 #include 
@@ -104,12 +89,10 @@
  * Global variables used here and there
  */
 char bootinfo[BOOTINFO_MAXSIZE];
-#define	OFMEMREGIONS	32
-struct mem_region physmemr[OFMEMREGIONS], availmemr[OFMEMREGIONS];
+#define	MEMREGIONS	2
+struct mem_region physmemr[MEMREGIONS], availmemr[MEMREGIONS];
 char bootpath[256];
-paddr_t avail_end;			/* XXX temporary */
 struct pic_ops *isa_pic;
-int isa_pcmciamask = 0x8b28;		/*  */
 extern int primary_pic;
 void initppc(u_long, u_long, u_int, void *);
 static void disable_device(const char *);
@@ -140,7 +123,6 @@
 		availmemr[0].start = (endkernel + PGOFSET) & ~PGOFSET;
 		availmemr[0].size = meminfo->memsize - availmemr[0].start;
 	}
-	avail_end = physmemr[0].start + physmemr[0].size;/* XXX temporary */
 
 	/*
 	 * Get CPU clock

Index: src/sys/arch/bebox/include/isa_machdep.h
diff -u src/sys/arch/bebox/include/isa_machdep.h:1.20 src/sys/arch/bebox/include/isa_machdep.h:1.21
--- src/sys/arch/bebox/include/isa_machdep.h:1.20	Wed Aug 19 15:00:46 2009
+++ src/sys/arch/bebox/include/isa_machdep.h	Sun Aug  7 15:22:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.h,v 1.20 2009/08/19 15:00:46 dyoung Exp $	*/
+/*	$NetBSD: isa_machdep.h,v 1.21 2011/08/07 15:22:19 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -44,7 +44,6 @@
 
 extern struct powerpc_bus_dma_tag isa_bus_dma_tag;
 extern struct pic_ops *isa_pic;
-extern int isa_pcmciamask;
 
 /* function mappings */
 #define isa_attach_hook(p, s, iaa)	\
@@ -58,7 +57,7 @@
 #define isa_intr_disestablish(ic, arg)	\
 	genppc_isa_intr_disestablish(ic, arg)
 #define isa_intr_alloc(ic, mask, type, irqp)\
-	genppc_isa_intr_alloc(ic, isa_pic, mask & isa_pcmciamask, type, irqp)
+	genppc_isa_intr_alloc(ic, isa_pic, mask, type, irqp)
 
 /*
  * Miscellanous functions.



CVS commit: src/sys/arch/bebox/bebox

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 15:16:35 UTC 2011

Modified Files:
src/sys/arch/bebox/bebox: machdep.c

Log Message:
Not allow interrupt hear.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/bebox/bebox/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/bebox/bebox/machdep.c
diff -u src/sys/arch/bebox/bebox/machdep.c:1.102 src/sys/arch/bebox/bebox/machdep.c:1.103
--- src/sys/arch/bebox/bebox/machdep.c:1.102	Sun Aug  7 15:04:46 2011
+++ src/sys/arch/bebox/bebox/machdep.c	Sun Aug  7 15:16:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.102 2011/08/07 15:04:46 kiyohara Exp $	*/
+/*	$NetBSD: machdep.c,v 1.103 2011/08/07 15:16:35 kiyohara Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102 2011/08/07 15:04:46 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.103 2011/08/07 15:16:35 kiyohara Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -188,17 +188,6 @@
 	 * Now that we have VM, malloc's are OK in bus_space.
 	 */
 	bus_space_mallocok();
-
-	/*
-	 * Now allow hardware interrupts.
-	 */
-	{
-		int msr;
-
-		splraise(-1);
-		__asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0"
-		: "=r"(msr) : "K"(PSL_EE));
-	}
 }
 
 /*



CVS commit: src/sys/arch/bebox

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 15:13:07 UTC 2011

Modified Files:
src/sys/arch/bebox/bebox: pic_bebox.c
src/sys/arch/bebox/include: intr.h

Log Message:
Use BEBOX_REG for mapped to BAT instead of bebox_mb_reg.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/bebox/bebox/pic_bebox.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/bebox/include/intr.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/bebox/bebox/pic_bebox.c
diff -u src/sys/arch/bebox/bebox/pic_bebox.c:1.7 src/sys/arch/bebox/bebox/pic_bebox.c:1.8
--- src/sys/arch/bebox/bebox/pic_bebox.c:1.7	Sun Jun  5 16:52:23 2011
+++ src/sys/arch/bebox/bebox/pic_bebox.c	Sun Aug  7 15:13:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pic_bebox.c,v 1.7 2011/06/05 16:52:23 matt Exp $ */
+/* $NetBSD: pic_bebox.c,v 1.8 2011/08/07 15:13:07 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.7 2011/06/05 16:52:23 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.8 2011/08/07 15:13:07 kiyohara Exp $");
 
 #include 
 #include 
@@ -38,18 +38,14 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
 
-extern paddr_t bebox_mb_reg;
-
 #define BEBOX_INTR_MASK		0x0ffc
 #define BEBOX_SET_MASK		0x8000
 #define BEBOX_INTR(x)		(0x8000 >> x)
-#define CPU0_INT_MASK		0x0f0
-#define CPU1_INT_MASK		0x1f0
-#define INT_STATE_REG		0x2f0
 
 static void bebox_enable_irq(struct pic_ops *, int, int);
 static void bebox_disable_irq(struct pic_ops *, int);
@@ -66,7 +62,7 @@
 	KASSERT(pic != NULL);
 
 	pic->pic_numintrs = 32;
-	pic->pic_cookie = (void *)bebox_mb_reg;
+	pic->pic_cookie = (void *)BEBOX_REG;
 	pic->pic_enable_irq = bebox_enable_irq;
 	pic->pic_reenable_irq = bebox_enable_irq;
 	pic->pic_disable_irq = bebox_disable_irq;
@@ -82,7 +78,7 @@
 bebox_enable_irq(struct pic_ops *pic, int irq, int type)
 {
 
-	*(volatile unsigned int *)(bebox_mb_reg + CPU0_INT_MASK) =
+	*(volatile unsigned int *)(BEBOX_REG + CPU0_INT_MASK) =
 	BEBOX_SET_MASK | (1 << (31 - irq));
 }
 
@@ -90,7 +86,7 @@
 bebox_disable_irq(struct pic_ops *pic, int irq)
 {
 
-	*(volatile unsigned int *)(bebox_mb_reg + CPU0_INT_MASK) =
+	*(volatile unsigned int *)(BEBOX_REG + CPU0_INT_MASK) =
 	(1 << (31 - irq));
 }
 
@@ -99,9 +95,9 @@
 {
 	unsigned int state;
 
-	state = *(volatile unsigned int *)(bebox_mb_reg + INT_STATE_REG);
+	state = *(volatile unsigned int *)(BEBOX_REG + INT_SOURCE);
 	state &= BEBOX_INTR_MASK;
-	state &= *(volatile unsigned int *)(bebox_mb_reg + CPU0_INT_MASK);
+	state &= *(volatile unsigned int *)(BEBOX_REG + CPU0_INT_MASK);
 	if (state == 0)
 		return 255;
 	return __builtin_clz(state);

Index: src/sys/arch/bebox/include/intr.h
diff -u src/sys/arch/bebox/include/intr.h:1.30 src/sys/arch/bebox/include/intr.h:1.31
--- src/sys/arch/bebox/include/intr.h:1.30	Fri Jun 17 23:36:17 2011
+++ src/sys/arch/bebox/include/intr.h	Sun Aug  7 15:13:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.30 2011/06/17 23:36:17 matt Exp $	*/
+/*	$NetBSD: intr.h,v 1.31 2011/08/07 15:13:07 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -40,15 +40,11 @@
 void enable_intr(void);
 void disable_intr(void);
 
-extern paddr_t bebox_mb_reg;
 
 #define ICU_LEN			32
 #define IRQ_SLAVE		2
 #define LEGAL_HWIRQ_P(x)	((u_int)(x) < ICU_LEN && (x) != IRQ_SLAVE)
 
-#define BEBOX_INTR_REG		0x7000
-#define INTR_VECTOR_REG		0xff0
-
 #endif /* !_LOCORE */
 
 #endif /* !_BEBOX_INTR_H_ */



CVS commit: src/sys/arch/bebox

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 15:04:46 UTC 2011

Modified Files:
src/sys/arch/bebox/bebox: machdep.c
Added Files:
src/sys/arch/bebox/include: bebox.h

Log Message:
Use BEBOX_REG for mapped to BAT instead of bebox_mb_reg.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/bebox/bebox/machdep.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/bebox/include/bebox.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/bebox/bebox/machdep.c
diff -u src/sys/arch/bebox/bebox/machdep.c:1.101 src/sys/arch/bebox/bebox/machdep.c:1.102
--- src/sys/arch/bebox/bebox/machdep.c:1.101	Thu Jun 30 00:52:55 2011
+++ src/sys/arch/bebox/bebox/machdep.c	Sun Aug  7 15:04:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.101 2011/06/30 00:52:55 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.102 2011/08/07 15:04:46 kiyohara Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.101 2011/06/30 00:52:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102 2011/08/07 15:04:46 kiyohara Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -104,7 +104,6 @@
  * Global variables used here and there
  */
 char bootinfo[BOOTINFO_MAXSIZE];
-paddr_t bebox_mb_reg;		/* BeBox MotherBoard register */
 #define	OFMEMREGIONS	32
 struct mem_region physmemr[OFMEMREGIONS], availmemr[OFMEMREGIONS];
 char bootpath[256];
@@ -167,12 +166,6 @@
 void
 cpu_startup(void)
 {
-	/*
-	 * BeBox Mother Board's Register Mapping
-	 */
-	bebox_mb_reg = (vaddr_t) mapiodev(BEBOX_INTR_REG, PAGE_SIZE, false);
-	if (!bebox_mb_reg)
-		panic("cpu_startup: no room for interrupt register");
 
 	/*
 	 * Do common VM initialization

Added files:

Index: src/sys/arch/bebox/include/bebox.h
diff -u /dev/null src/sys/arch/bebox/include/bebox.h:1.1
--- /dev/null	Sun Aug  7 15:04:46 2011
+++ src/sys/arch/bebox/include/bebox.h	Sun Aug  7 15:04:45 2011
@@ -0,0 +1,66 @@
+/*	$NetBSD: bebox.h,v 1.1 2011/08/07 15:04:45 kiyohara Exp $	*/
+/*
+ * Copyright (c) 2011 KIYOHARA Takashi
+ * All rights reserved.
+ *
+ * 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 ``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 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.
+ */
+
+#ifndef _BEBOX_H
+#define _BEBOX_H
+
+/*
+ * BeBox mainboard's Register
+ */
+#define BEBOX_REG		0x7000
+
+#define BEBOX_SET_MASK		0x8000
+#define BEBOX_CLEAR_MASK	0x
+
+#define READ_BEBOX_REG(reg)	*(uint32_t *)(BEBOX_REG + (reg))
+#define SET_BEBOX_REG(reg, v)	\
+		*(uint32_t *)(BEBOX_REG + (reg)) = ((v) | BEBOX_SET_MASK)
+#define CLEAR_BEBOX_REG(reg, v)	\
+		*(uint32_t *)(BEBOX_REG + (reg)) = ((v) | BEBOX_CLEAR_MASK)
+
+#define CPU0_INT_MASK	 0x0f0	/* Interrupt Mask for CPU0 */
+#define CPU1_INT_MASK	 0x1f0	/* Interrupt Mask for CPU1 */
+#define INT_SOURCE	 0x2f0	/* Interrupt Source */
+#define CPU_CONTROL	 0x3f0	/* Inter-CPU Interrupt */
+#define CPU_RESET	 0x4f0	/* Reset Control */
+#define INTR_VECTOR_REG	 0xff0
+
+/* Control */
+#define CPU0_SMI	(1 << 30)	/* SMI to CPU0 */
+#define CPU1_SMI	(1 << 29)	/* SMI to CPU1 */
+#define CPU1_INT	(1 << 28)	/* Interrupt to CPU1 (rev.1 only) */
+#define CPU0_TLBISYNC	(1 << 27)	/* tlbsync to CPU0 */
+#define CPU1_TLBISYNC	(1 << 26)	/* tlbsync to CPU1 */
+#define WHO_AM_I	(1 << 25)
+
+#define TLBISYNC_FROM(n)	(1 << (CPU1_TLBISYNC + (n)))
+
+/* Reset */
+#define CPU1_SRESET	(1 << 30)	/* Software Reset to CPU1 */
+#define CPU1_HRESET	(1 << 29)	/* Hardware Reset to CPU1 */
+
+#endif /* _BEBOX_H */



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

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 14:47:05 UTC 2011

Modified Files:
src/sys/arch/powerpc/oea: prep_machdep.c

Log Message:
Set BeBox Mainboard Registers space to BAT register.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/oea/prep_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/powerpc/oea/prep_machdep.c
diff -u src/sys/arch/powerpc/oea/prep_machdep.c:1.7 src/sys/arch/powerpc/oea/prep_machdep.c:1.8
--- src/sys/arch/powerpc/oea/prep_machdep.c:1.7	Fri Jul  1 18:59:19 2011
+++ src/sys/arch/powerpc/oea/prep_machdep.c	Sun Aug  7 14:47:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: prep_machdep.c,v 1.7 2011/07/01 18:59:19 dyoung Exp $ */
+/* $NetBSD: prep_machdep.c,v 1.8 2011/08/07 14:47:05 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: prep_machdep.c,v 1.7 2011/07/01 18:59:19 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: prep_machdep.c,v 1.8 2011/08/07 14:47:05 kiyohara Exp $");
 
 #include "opt_modular.h"
 
@@ -147,7 +147,9 @@
 	oea_batinit(
 	PREP_BUS_SPACE_MEM, BAT_BL_256M,
 	PREP_BUS_SPACE_IO,  BAT_BL_256M,
-#ifdef prep
+#if defined(bebox)
+	0x7000, BAT_BL_128K,	/* BeBox Mainboard Registers (4KB) */
+#elif defined(prep)
 	0xbf80, BAT_BL_8M,
 #endif
 	0);



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

2011-08-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Aug  7 14:39:15 UTC 2011

Modified Files:
src/sys/arch/i386/conf: Makefile.i386

Log Message:
Try to ensure no SSE instructions are generated for kernel code,
as is already done on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/arch/i386/conf/Makefile.i386

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

Modified files:

Index: src/sys/arch/i386/conf/Makefile.i386
diff -u src/sys/arch/i386/conf/Makefile.i386:1.173 src/sys/arch/i386/conf/Makefile.i386:1.174
--- src/sys/arch/i386/conf/Makefile.i386:1.173	Mon Jul  4 16:20:45 2011
+++ src/sys/arch/i386/conf/Makefile.i386	Sun Aug  7 14:39:15 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.i386,v 1.173 2011/07/04 16:20:45 joerg Exp $
+#	$NetBSD: Makefile.i386,v 1.174 2011/08/07 14:39:15 jakllsch Exp $
 
 # Makefile for NetBSD
 #
@@ -34,6 +34,7 @@
 ## (2) compile settings
 ##
 CPPFLAGS+=	-Di386
+CFLAGS+=	-mno-sse -mno-sse2 -mno-sse3
 
 AFLAGS.mptramp.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
 CWARNFLAGS.ah_regdomain.c= ${${ACTIVE_CC} == "clang":?-Wno-error:}



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

2011-08-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  7 14:36:36 UTC 2011

Removed Files:
src/sys/arch/bebox/include: mouse.h pccons.h
src/sys/arch/bebox/include/pc: display.h

Log Message:
Remove obsoleted headers.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/arch/bebox/include/mouse.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/bebox/include/pccons.h
cvs rdiff -u -r1.1 -r0 src/sys/arch/bebox/include/pc/display.h

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



CVS commit: src

2011-08-07 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Aug  7 14:03:17 UTC 2011

Modified Files:
src/share/man/man9: kthread.9
src/sys/dev: fss.c
src/sys/dev/flash: flash_io.c
src/sys/kern: kern_kthread.c
src/sys/rump/librump/rumpkern: threads.c
src/sys/rump/net/lib/libshmif: if_shmem.c
src/sys/rump/net/lib/libvirtif: if_virt.c
src/sys/sys: kthread.h lwp.h
src/tests/rump/kernspace: busypage.c thread.c tsleep.c

Log Message:
Rename slightly misleading KTHREAD_JOINABLE to KTHREAD_MUSTJOIN.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/kthread.9
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/fss.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/flash/flash_io.c
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/kern_kthread.c
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/librump/rumpkern/threads.c
cvs rdiff -u -r1.39 -r1.40 src/sys/rump/net/lib/libshmif/if_shmem.c
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/net/lib/libvirtif/if_virt.c
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/kthread.h
cvs rdiff -u -r1.153 -r1.154 src/sys/sys/lwp.h
cvs rdiff -u -r1.4 -r1.5 src/tests/rump/kernspace/busypage.c
cvs rdiff -u -r1.1 -r1.2 src/tests/rump/kernspace/thread.c \
src/tests/rump/kernspace/tsleep.c

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/kthread.9
diff -u src/share/man/man9/kthread.9:1.26 src/share/man/man9/kthread.9:1.27
--- src/share/man/man9/kthread.9:1.26	Thu May 19 08:55:01 2011
+++ src/share/man/man9/kthread.9	Sun Aug  7 14:03:16 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: kthread.9,v 1.26 2011/05/19 08:55:01 wiz Exp $
+.\" $NetBSD: kthread.9,v 1.27 2011/08/07 14:03:16 rmind Exp $
 .\"
 .\" Copyright (c) 2000, 2007, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 19, 2011
+.Dd August 7, 2011
 .Dt KTHREAD 9
 .Os
 .Sh NAME
@@ -93,7 +93,7 @@
 May be
 .Dv NULL ,
 unless
-.Dv KTHREAD_JOINABLE
+.Dv KTHREAD_MUSTJOIN
 is specified in
 .Fa flags .
 .It Fa fmt
@@ -106,7 +106,7 @@
 The following
 .Va flags
 are defined.
-.Bl -tag -width KTHREAD_JOINABLE
+.Bl -tag -width KTHREAD_MUSTJOIN
 .It Dv KTHREAD_IDLE
 Causes the thread to be created in the
 .Dv LSIDL
@@ -138,8 +138,8 @@
 .Dv SCHED_RR
 class do not have their priority dynamically
 adjusted by the scheduler.
-.It Dv KTHREAD_JOINABLE
-Requests creation of joinable kthread.
+.It Dv KTHREAD_MUSTJOIN
+Indicates that created kthread must be joined.
 In such case
 .Fn kthread_exit
 will wait until
@@ -160,7 +160,7 @@
 .Xr pthread_join 3 ,
 however it must be called only once for kernel thread which was
 created using the
-.Dv KTHREAD_JOIN
+.Dv KTHREAD_MUSTJOIN
 flag and would wait on
 .Fa kthread_exit .
 .El

Index: src/sys/dev/fss.c
diff -u src/sys/dev/fss.c:1.77 src/sys/dev/fss.c:1.78
--- src/sys/dev/fss.c:1.77	Tue Jun 21 13:59:41 2011
+++ src/sys/dev/fss.c	Sun Aug  7 14:03:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.77 2011/06/21 13:59:41 hannken Exp $	*/
+/*	$NetBSD: fss.c,v 1.78 2011/08/07 14:03:16 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.77 2011/06/21 13:59:41 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.78 2011/08/07 14:03:16 rmind Exp $");
 
 #include 
 #include 
@@ -455,7 +455,7 @@
 	}
 
 	sc->sc_flags |= FSS_BS_THREAD;
-	if ((error = kthread_create(PRI_BIO, KTHREAD_JOINABLE, NULL,
+	if ((error = kthread_create(PRI_BIO, KTHREAD_MUSTJOIN, NULL,
 	fss_bs_thread, sc, &sc->sc_bs_lwp,
 	"%s", device_xname(sc->sc_dev))) != 0) {
 		sc->sc_flags &= ~FSS_BS_THREAD;

Index: src/sys/dev/flash/flash_io.c
diff -u src/sys/dev/flash/flash_io.c:1.3 src/sys/dev/flash/flash_io.c:1.4
--- src/sys/dev/flash/flash_io.c:1.3	Fri Jul 15 19:19:57 2011
+++ src/sys/dev/flash/flash_io.c	Sun Aug  7 14:03:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: flash_io.c,v 1.3 2011/07/15 19:19:57 cliff Exp $	*/
+/*	$NetBSD: flash_io.c,v 1.4 2011/08/07 14:03:16 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2011 Department of Software Engineering,
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: flash_io.c,v 1.3 2011/07/15 19:19:57 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: flash_io.c,v 1.4 2011/08/07 14:03:16 rmind Exp $");
 
 #include 
 #include 
@@ -119,7 +119,7 @@
 	fio->fio_write_pending = false;
 
 	/* arrange to allocate the kthread */
-	error = kthread_create(PRI_NONE, KTHREAD_JOINABLE | KTHREAD_MPSAFE,
+	error = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN | KTHREAD_MPSAFE,
 	NULL, flash_sync_thread, fio, &fio->fio_thread, "flashio");
 
 	if (!error)

Index: src/sys/kern/kern_kthread.c
diff -u src/sys/kern/kern_kthread.c:1.35 src/sys/kern/kern_kthread.c:1.36
--- src/sys/kern/kern_kthread.c:1.35	Sun Jul 17 20:54:52 2011
+++ src/sys/k

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

2011-08-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Aug  7 14:00:08 UTC 2011

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

Log Message:
Trailing whitespace, what trailing whitespace?


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/arch/sparc64/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/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.142 src/sys/arch/sparc64/conf/GENERIC:1.143
--- src/sys/arch/sparc64/conf/GENERIC:1.142	Fri Jul 29 08:37:37 2011
+++ src/sys/arch/sparc64/conf/GENERIC	Sun Aug  7 14:00:08 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.142 2011/07/29 08:37:37 mrg Exp $
+# $NetBSD: GENERIC,v 1.143 2011/08/07 14:00:08 jakllsch Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.142 $"
+#ident 		"GENERIC-$Revision: 1.143 $"
 
 maxusers	64
 
@@ -432,7 +432,7 @@
 ## A disk-like interface to files.  Can be used to create floppy, CD,
 ## miniroot images, etc.
 
-pseudo-device	vnd	
+pseudo-device	vnd
 #options 	VND_COMPRESSION		# compressed vnd(4)
 
 ## Concatenated and striped disks; with this, you can create a software-based
@@ -461,7 +461,7 @@
 ## Memory disk device, used on boot floppies with compressed
 ## kernel-plus-root-disk images.
 
-pseudo-device	md	
+pseudo-device	md
 
 
  Network interfaces
@@ -692,20 +692,20 @@
 pseudo-device	loop
 
 ## SLIP and CSLIP interfaces, for IP over a serial line.
-pseudo-device	sl		
+pseudo-device	sl
 
 ## PPP, the successor to SLIP.  See pppd(8).
-pseudo-device	ppp		
+pseudo-device	ppp
 
 ## PPP over Ethernet (RFC 2516)
 pseudo-device	pppoe
 
 ## Starmode Radio IP, a special hardware network device.
-pseudo-device	strip		
+pseudo-device	strip
 
 ## Network "tunnel" device, allowing protocol stacks to run in the userland.
 ## This is used by the third-party user-mode "ppp" program, and others.
-pseudo-device	tun		
+pseudo-device	tun
 pseudo-device	tap			# virtual Ethernet
 
 ## Generic L3 over IP tunnel



CVS commit: src/sys/net

2011-08-07 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Aug  7 13:51:37 UTC 2011

Modified Files:
src/sys/net: if_ppp.c

Log Message:
Convert ppp_list_lock to mutex(9).


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/net/if_ppp.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/net/if_ppp.c
diff -u src/sys/net/if_ppp.c:1.133 src/sys/net/if_ppp.c:1.134
--- src/sys/net/if_ppp.c:1.133	Sat Apr  2 08:11:32 2011
+++ src/sys/net/if_ppp.c	Sun Aug  7 13:51:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ppp.c,v 1.133 2011/04/02 08:11:32 mbalmer Exp $	*/
+/*	$NetBSD: if_ppp.c,v 1.134 2011/08/07 13:51:37 rmind Exp $	*/
 /*	Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp 	*/
 
 /*
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.133 2011/04/02 08:11:32 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.134 2011/08/07 13:51:37 rmind Exp $");
 
 #include "ppp.h"
 
@@ -130,7 +130,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -205,12 +204,11 @@
 static struct ppp_softc *ppp_create(const char *, int);
 
 static LIST_HEAD(, ppp_softc) ppp_softc_list;
+static kmutex_t ppp_list_lock;
 
 struct if_clone ppp_cloner =
 IF_CLONE_INITIALIZER("ppp", ppp_clone_create, ppp_clone_destroy);
 
-static struct simplelock ppp_list_mutex = SIMPLELOCK_INITIALIZER;
-
 #ifdef PPP_COMPRESS
 ONCE_DECL(ppp_compressor_mtx_init);
 static LIST_HEAD(, compressor) ppp_compressors = { NULL };
@@ -232,6 +230,8 @@
 
 if (ttyldisc_attach(&ppp_disc) != 0)
 	panic("pppattach");
+
+mutex_init(&ppp_list_lock, MUTEX_DEFAULT, IPL_NONE);
 LIST_INIT(&ppp_softc_list);
 if_clone_attach(&ppp_cloner);
 RUN_ONCE(&ppp_compressor_mtx_init, ppp_compressor_init);
@@ -244,7 +244,7 @@
 
 sc = malloc(sizeof(*sc), M_DEVBUF, M_WAIT|M_ZERO);
 
-simple_lock(&ppp_list_mutex);
+mutex_enter(&ppp_list_lock);
 if (unit == -1) {
 	int i = 0;
 	LIST_FOREACH(sci, &ppp_softc_list, sc_iflist) {
@@ -280,7 +280,7 @@
 else
 	LIST_INSERT_HEAD(&ppp_softc_list, sc, sc_iflist);
 
-simple_unlock(&ppp_list_mutex);
+mutex_exit(&ppp_list_lock);
 
 if_initname(&sc->sc_if, name, sc->sc_unit = unit);
 callout_init(&sc->sc_timo_ch, 0);
@@ -322,9 +322,9 @@
 if (sc->sc_devp != NULL)
 	return EBUSY; /* Not removing it */
 
-simple_lock(&ppp_list_mutex);
+mutex_enter(&ppp_list_lock);
 LIST_REMOVE(sc, sc_iflist);
-simple_unlock(&ppp_list_mutex);
+mutex_exit(&ppp_list_lock);
 
 bpf_detach(ifp);
 if_detach(ifp);
@@ -342,18 +342,17 @@
 struct ppp_softc *sc = NULL, *scf;
 int i;
 
-simple_lock(&ppp_list_mutex);
-for (scf = LIST_FIRST(&ppp_softc_list); scf != NULL;
-	scf = LIST_NEXT(scf, sc_iflist)) {
+mutex_enter(&ppp_list_lock);
+LIST_FOREACH(scf, &ppp_softc_list, sc_iflist) {
 	if (scf->sc_xfer == pid) {
 	scf->sc_xfer = 0;
-	simple_unlock(&ppp_list_mutex);
+	mutex_exit(&ppp_list_lock);
 	return scf;
 	}
 	if (scf->sc_devp == NULL && sc == NULL)
 	sc = scf;
 }
-simple_unlock(&ppp_list_mutex);
+mutex_exit(&ppp_list_lock);
 
 if (sc == NULL)
 	sc = ppp_create(ppp_cloner.ifc_name, -1);



CVS commit: src/sys/dev/usb

2011-08-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  7 13:45:46 UTC 2011

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

Log Message:
PR# kern/30398: panic in ohci_softintr

If the host controller has a TD that the driver doesn't know about, ignore it
instead of calling panic. Patch from Karl Janmar.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/dev/usb/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/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.217 src/sys/dev/usb/ohci.c:1.218
--- src/sys/dev/usb/ohci.c:1.217	Sat Jul 30 20:05:36 2011
+++ src/sys/dev/usb/ohci.c	Sun Aug  7 13:45:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.217 2011/07/30 20:05:36 jmcneill Exp $	*/
+/*	$NetBSD: ohci.c,v 1.218 2011/08/07 13:45:46 jmcneill Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.217 2011/07/30 20:05:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.218 2011/08/07 13:45:46 jmcneill Exp $");
 
 #include "opt_usb.h"
 
@@ -1293,7 +1293,9 @@
 			DPRINTFN(5,("add ITD %p\n", sitd));
 			continue;
 		}
-		panic("ohci_softintr: addr 0x%08lx not found", (u_long)done);
+		device_printf(sc->sc_dev, "WARNING: addr 0x%08lx not found\n",
+		(u_long)done);
+		break;
 	}
 
 	DPRINTFN(10,("ohci_softintr: sdone=%p sidone=%p\n", sdone, sidone));



CVS commit: src/sys/dev

2011-08-07 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Aug  7 13:39:24 UTC 2011

Modified Files:
src/sys/dev/i2o: dpti.c dptivar.h
src/sys/dev/ic: dpt.c dptvar.h
src/sys/dev/mca: ed_mca.c edc_mca.c

Log Message:
Replace some wakeup_one(9) uses with mutex(9) or plain wakeup(9).


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/i2o/dpti.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/i2o/dptivar.h
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/ic/dpt.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ic/dptvar.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/mca/ed_mca.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/mca/edc_mca.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/i2o/dpti.c
diff -u src/sys/dev/i2o/dpti.c:1.43 src/sys/dev/i2o/dpti.c:1.44
--- src/sys/dev/i2o/dpti.c:1.43	Sat Nov 13 13:51:59 2010
+++ src/sys/dev/i2o/dpti.c	Sun Aug  7 13:39:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dpti.c,v 1.43 2010/11/13 13:51:59 uebayasi Exp $	*/
+/*	$NetBSD: dpti.c,v 1.44 2011/08/07 13:39:23 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dpti.c,v 1.43 2010/11/13 13:51:59 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dpti.c,v 1.44 2011/08/07 13:39:23 rmind Exp $");
 
 #include 
 #include 
@@ -272,16 +272,13 @@
 		if (rv)
 			break;
 
-		if (sc->sc_nactive++ >= 2)
-			tsleep(&sc->sc_nactive, PRIBIO, "dptislp", 0);
-
-		if (linux)
+		mutex_enter(&iop->sc_conflock);
+		if (linux) {
 			rv = dpti_passthrough(sc, data, l->l_proc);
-		else
+		} else {
 			rv = dpti_passthrough(sc, *(void **)data, l->l_proc);
-
-		sc->sc_nactive--;
-		wakeup_one(&sc->sc_nactive);
+		}
+		mutex_exit(&iop->sc_conflock);
 		break;
 
 	case DPT_I2ORESETCMD:

Index: src/sys/dev/i2o/dptivar.h
diff -u src/sys/dev/i2o/dptivar.h:1.7 src/sys/dev/i2o/dptivar.h:1.8
--- src/sys/dev/i2o/dptivar.h:1.7	Mon Apr 28 20:23:48 2008
+++ src/sys/dev/i2o/dptivar.h	Sun Aug  7 13:39:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dptivar.h,v 1.7 2008/04/28 20:23:48 martin Exp $	*/
+/*	$NetBSD: dptivar.h,v 1.8 2011/08/07 13:39:23 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -63,7 +63,6 @@
 struct dpti_softc {
 	struct	device sc_dv;
 	int	sc_blinkled;
-	int	sc_nactive;
 };
 
 struct dpti_ptbuf {

Index: src/sys/dev/ic/dpt.c
diff -u src/sys/dev/ic/dpt.c:1.65 src/sys/dev/ic/dpt.c:1.66
--- src/sys/dev/ic/dpt.c:1.65	Fri Jul  1 08:38:10 2011
+++ src/sys/dev/ic/dpt.c	Sun Aug  7 13:39:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dpt.c,v 1.65 2011/07/01 08:38:10 mrg Exp $	*/
+/*	$NetBSD: dpt.c,v 1.66 2011/08/07 13:39:24 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.65 2011/07/01 08:38:10 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.66 2011/08/07 13:39:24 rmind Exp $");
 
 #include 
 #include 
@@ -82,6 +82,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #ifdef i386
@@ -330,6 +331,7 @@
 	ec = &sc->sc_ec;
 	snprintf(dpt_sig.dsDescription, sizeof(dpt_sig.dsDescription),
 	"NetBSD %s DPT driver", osrelease);
+	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	/*
 	 * Allocate the CCB/status packet/scratch DMA map and load.
@@ -1156,13 +1158,10 @@
 			return (EINVAL);
 		}
 
-		if (sc->sc_uactive++)
-			tsleep(&sc->sc_uactive, PRIBIO, "dptslp", 0);
-
+		mutex_enter(&sc->sc_lock);
 		rv = dpt_passthrough(sc, (struct eata_ucp *)data, l);
+		mutex_exit(&sc->sc_lock);
 
-		sc->sc_uactive--;
-		wakeup_one(&sc->sc_uactive);
 		return (rv);
 
 	default:

Index: src/sys/dev/ic/dptvar.h
diff -u src/sys/dev/ic/dptvar.h:1.14 src/sys/dev/ic/dptvar.h:1.15
--- src/sys/dev/ic/dptvar.h:1.14	Sun Mar  4 06:01:54 2007
+++ src/sys/dev/ic/dptvar.h	Sun Aug  7 13:39:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dptvar.h,v 1.14 2007/03/04 06:01:54 christos Exp $	*/
+/*	$NetBSD: dptvar.h,v 1.15 2011/08/07 13:39:24 rmind Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Andrew Doran 
@@ -65,6 +65,7 @@
 
 struct dpt_softc {
 	struct device	sc_dv;		/* generic device data */
+	kmutex_t	sc_lock;
 	struct scsipi_adapter sc_adapt;	/* scsipi adapter */
 	struct scsipi_channel sc_chans[3]; /* each channel */
 	bus_space_handle_t sc_ioh;	/* bus space handle */
@@ -83,7 +84,6 @@
 	int		sc_nccbs;	/* number of CCBs available */
 	SLIST_HEAD(, dpt_ccb) sc_ccb_free;/* free ccb list */
 	struct eata_cfg sc_ec;		/* EATA configuration data */
-	int		sc_uactive;	/* user command active */
 	int		sc_bustype;	/* SysInfo bus type */
 	int		sc_isadrq;	/* ISA DRQ */
 	int		sc_isairq;	/* ISA IRQ */

Index: src/sys/dev/mca/ed_mca.c
diff -u src/sys/dev/mca/ed_mca.c:1.47 src/sys/dev/mca/ed_mca.c:1.48
--- src/sys/dev/mca/ed_mca.c:1.47	Tue May 12 14:31:00 2009
+++ src/sys/dev/mca/ed_mca.c	Sun Aug  7 13:39:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ed_mca.c,v 1.47 2009/05/12 14

CVS commit: src

2011-08-07 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Aug  7 13:33:03 UTC 2011

Modified Files:
src/common/lib/libc/sys: cpuset.c
src/distrib/sets/lists/comp: mi
src/sys/conf: files
src/sys/kern: init_main.c kern_cpu.c kern_runq.c subr_pserialize.c
sys_pset.c sys_sched.c
src/sys/sys: Makefile cpu.h lwp.h sched.h
Added Files:
src/sys/kern: subr_kcpuset.c
src/sys/sys: kcpuset.h

Log Message:
Add kcpuset(9) - a reworked dynamic CPU set implementation for kernel.
Suitable for use during the early boot.  MD and other implementations
should be replaced with this interface.

Discussed on: tech-kern@


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libc/sys/cpuset.c
cvs rdiff -u -r1.1657 -r1.1658 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1022 -r1.1023 src/sys/conf/files
cvs rdiff -u -r1.434 -r1.435 src/sys/kern/init_main.c
cvs rdiff -u -r1.47 -r1.48 src/sys/kern/kern_cpu.c
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/kern_runq.c
cvs rdiff -u -r0 -r1.1 src/sys/kern/subr_kcpuset.c
cvs rdiff -u -r1.2 -r1.3 src/sys/kern/subr_pserialize.c
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/sys_pset.c
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/sys_sched.c
cvs rdiff -u -r1.136 -r1.137 src/sys/sys/Makefile
cvs rdiff -u -r1.32 -r1.33 src/sys/sys/cpu.h
cvs rdiff -u -r0 -r1.1 src/sys/sys/kcpuset.h
cvs rdiff -u -r1.152 -r1.153 src/sys/sys/lwp.h
cvs rdiff -u -r1.72 -r1.73 src/sys/sys/sched.h

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/libc/sys/cpuset.c
diff -u src/common/lib/libc/sys/cpuset.c:1.16 src/common/lib/libc/sys/cpuset.c:1.17
--- src/common/lib/libc/sys/cpuset.c:1.16	Tue Sep 21 02:03:29 2010
+++ src/common/lib/libc/sys/cpuset.c	Sun Aug  7 13:33:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuset.c,v 1.16 2010/09/21 02:03:29 rmind Exp $	*/
+/*	$NetBSD: cpuset.c,v 1.17 2011/08/07 13:33:02 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #ifndef _STANDALONE
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: cpuset.c,v 1.16 2010/09/21 02:03:29 rmind Exp $");
+__RCSID("$NetBSD: cpuset.c,v 1.17 2011/08/07 13:33:02 rmind Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -64,24 +64,11 @@
 	uint32_t	bits[0];
 };
 
-#ifdef _KERNEL
-struct _kcpuset {
-	unsigned int	nused;
-	struct _kcpuset *next;
-	uint32_t	bits[0];
-};
-#define KCPUSET_SIZE(n)	(sizeof( \
-	struct {  \
-		unsigned int nused; \
-		struct _kcpuset *next; \
-		uint32_t bits[0]; \
-	}) + sizeof(uint32_t) * (n))
-#endif
+#ifndef _KERNEL
 
 static size_t cpuset_size = 0;
 static size_t cpuset_nentries = 0;
 
-#ifndef _KERNEL
 size_t
 /*ARGSUSED*/
 _cpuset_size(const cpuset_t *c)
@@ -161,150 +148,5 @@
 	free(c);
 }
 
-#else
-
-kcpuset_t *
-kcpuset_create(void)
-{
-	kcpuset_t *c;
-
-	if (cpuset_size == 0) {
-		cpuset_nentries = CPUSET_NENTRIES(MAXCPUS);
-		cpuset_size = KCPUSET_SIZE(cpuset_nentries);
-	}
-	c = kmem_zalloc(cpuset_size, KM_SLEEP);
-	c->next = NULL;
-	c->nused = 1;
-	return c;
-}
-
-void
-kcpuset_destroy(kcpuset_t *c)
-{
-	kcpuset_t *nc;
-
-	while (c) {
-		KASSERT(c->nused == 0);
-		nc = c->next;
-		kmem_free(c, cpuset_size);
-		c = nc;
-	}
-}
-
-void
-kcpuset_copy(kcpuset_t *d, const kcpuset_t *s)
-{
-
-	KASSERT(d->nused == 1);
-	memcpy(d->bits, s->bits, cpuset_nentries * sizeof(s->bits[0]));
-}
-
-void
-kcpuset_use(kcpuset_t *c)
-{
-
-	atomic_inc_uint(&c->nused);
-}
-
-void
-kcpuset_unuse(kcpuset_t *c, kcpuset_t **lst)
-{
-
-	if (atomic_dec_uint_nv(&c->nused) != 0)
-		return;
-	KASSERT(c->nused == 0);
-	KASSERT(c->next == NULL);
-	if (lst == NULL) {
-		kcpuset_destroy(c);
-		return;
-	}
-	c->next = *lst;
-	*lst = c;
-}
-
-int
-kcpuset_copyin(const cpuset_t *u, kcpuset_t *k, size_t len)
-{
-
-	KASSERT(k->nused > 0);
-	KASSERT(k->next == NULL);
-	if (len != CPUSET_SIZE(cpuset_nentries))
-		return EINVAL;
-	return copyin(u->bits, k->bits, cpuset_nentries * sizeof(k->bits[0]));
-}
-
-int
-kcpuset_copyout(const kcpuset_t *k, cpuset_t *u, size_t len)
-{
-
-	KASSERT(k->nused > 0);
-	KASSERT(k->next == NULL);
-	if (len != CPUSET_SIZE(cpuset_nentries))
-		return EINVAL;
-	return copyout(k->bits, u->bits, cpuset_nentries * sizeof(u->bits[0]));
-}
-
-void
-kcpuset_zero(kcpuset_t *c)
-{
-
-	KASSERT(c->nused > 0);
-	KASSERT(c->next == NULL);
-	memset(c->bits, 0, cpuset_nentries * sizeof(c->bits[0]));
-}
-
-void
-kcpuset_fill(kcpuset_t *c)
-{
-
-	KASSERT(c->nused > 0);
-	KASSERT(c->next == NULL);
-	memset(c->bits, ~0, cpuset_nentries * sizeof(c->bits[0]));
-}
-
-void
-kcpuset_set(cpuid_t i, kcpuset_t *c)
-{
-	const unsigned long j = i >> CPUSET_SHIFT;
-
-	KASSERT(c->next == NULL);
-	KASSERT(j < cpuset_nentries);
-	c->bits[j] |= 1 << (i & CPUSET_MASK);
-}
-
-int
-kcpuset_isset(cpuid_t i, const kcpuset_t *c)
-{
-	const unsigned long j = i >> CPUSET_SHIFT;
-
-	KASSERT(c != NULL);
-	KASSERT(c->nused > 0);
-	K

CVS commit: src/sbin/drvctl

2011-08-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  7 13:00:35 UTC 2011

Modified Files:
src/sbin/drvctl: drvctl.8 drvctl.c

Log Message:
add the -t option that modifies -l behaviour to recursively scan for
child devices and print them in tree format:

$ drvctl -lt usb0
uhub0
  uhub6
uhidev0
  ukbd0
wskbd1
uhidev1
  ums0
wsmouse1
  uhid0
ubt0


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sbin/drvctl/drvctl.8 src/sbin/drvctl/drvctl.c

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

Modified files:

Index: src/sbin/drvctl/drvctl.8
diff -u src/sbin/drvctl/drvctl.8:1.11 src/sbin/drvctl/drvctl.8:1.12
--- src/sbin/drvctl/drvctl.8:1.11	Sun Aug  7 12:00:11 2011
+++ src/sbin/drvctl/drvctl.8	Sun Aug  7 13:00:35 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: drvctl.8,v 1.11 2011/08/07 12:00:11 jmcneill Exp $
+.\" $NetBSD: drvctl.8,v 1.12 2011/08/07 13:00:35 jmcneill Exp $
 .\"
 .\" Copyright (c) 2004
 .\" 	Matthias Drochner.  All rights reserved.
@@ -40,7 +40,7 @@
 .Fl d
 .Ar device
 .Nm
-.Op Fl n
+.Op Fl nt
 .Fl l
 .Op Ar device
 .Nm
@@ -128,6 +128,10 @@
 and
 .Ar device
 itself.
+.It Fl t
+Print a tree of devices in
+.Fl l
+output.
 .El
 .Sh FILES
 .Pa /dev/drvctl
Index: src/sbin/drvctl/drvctl.c
diff -u src/sbin/drvctl/drvctl.c:1.11 src/sbin/drvctl/drvctl.c:1.12
--- src/sbin/drvctl/drvctl.c:1.11	Sun Aug  7 12:00:11 2011
+++ src/sbin/drvctl/drvctl.c	Sun Aug  7 13:00:35 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: drvctl.c,v 1.11 2011/08/07 12:00:11 jmcneill Exp $ */
+/* $NetBSD: drvctl.c,v 1.12 2011/08/07 13:00:35 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2004
@@ -37,7 +37,7 @@
 #include 
 #include 
 
-#define OPTS "QRSa:dlnpr"
+#define OPTS "QRSa:dlnprt"
 
 #define	OPEN_MODE(mode)			\
 	(((mode) == 'd' || (mode) == 'r') ? O_RDWR			\
@@ -45,6 +45,7 @@
 
 static void usage(void);
 static void extract_property(prop_dictionary_t, const char *);
+static void list_children(int, char *, bool, bool, int);
 
 static void
 usage(void)
@@ -52,7 +53,7 @@
 
 	fprintf(stderr, "Usage: %s -r [-a attribute] busdevice [locator ...]\n"
 	"   %s -d device\n"
-	"   %s [-n] -l [device]\n"
+	"   %s [-nt] -l [device]\n"
 	"   %s -p device [prop]\n"
 	"   %s -Q device\n"
 	"   %s -R device\n"
@@ -65,16 +66,13 @@
 int
 main(int argc, char **argv)
 {
-	bool nflag = false;
+	bool nflag = false, tflag = false;
 	int c, mode;
 	char *attr = 0;
 	extern char *optarg;
 	extern int optind;
 	int fd, res;
-	size_t children;
 	struct devpmargs paa = {.devname = "", .flags = 0};
-	struct devlistargs laa = {.l_devname = "", .l_childname = NULL,
-  .l_children = 0};
 	struct devdetachargs daa;
 	struct devrescanargs raa;
 	int *locs, i;
@@ -102,6 +100,9 @@
 		case 'n':
 			nflag = true;
 			break;
+		case 't':
+			tflag = nflag = true;
+			break;
 		case '?':
 		default:
 			usage();
@@ -141,31 +142,7 @@
 			err(3, "DRVDETACHDEV");
 		break;
 	case 'l':
-		if (argc == 0)
-			*laa.l_devname = '\0';
-		else
-			strlcpy(laa.l_devname, argv[0], sizeof(laa.l_devname));
-
-		if (ioctl(fd, DRVLISTDEV, &laa) == -1)
-			err(3, "DRVLISTDEV");
-
-		children = laa.l_children;
-
-		laa.l_childname = malloc(children * sizeof(laa.l_childname[0]));
-		if (laa.l_childname == NULL)
-			err(5, "DRVLISTDEV");
-		if (ioctl(fd, DRVLISTDEV, &laa) == -1)
-			err(3, "DRVLISTDEV");
-		if (laa.l_children > children)
-			err(6, "DRVLISTDEV: number of children grew");
-
-		for (i = 0; i < (int)laa.l_children; i++) {
-			if (!nflag) {
-printf("%s ",
-(argc == 0) ? "root" : laa.l_devname);
-			}
-			printf("%s\n", laa.l_childname[i]);
-		}
+		list_children(fd, argc ? argv[0] : NULL, nflag, tflag, 0);
 		break;
 	case 'r':
 		memset(&raa, 0, sizeof(raa));
@@ -286,3 +263,49 @@
 
 	free(s);
 }
+
+static void
+list_children(int fd, char *dvname, bool nflag, bool tflag, int depth)
+{
+	struct devlistargs laa = {.l_devname = "", .l_childname = NULL,
+  .l_children = 0};
+	size_t children;
+	int i, n;
+
+	if (dvname == NULL) {
+		if (depth > 0)
+			return;
+		*laa.l_devname = '\0';
+	} else {
+		strlcpy(laa.l_devname, dvname, sizeof(laa.l_devname));
+	}
+
+	if (ioctl(fd, DRVLISTDEV, &laa) == -1)
+		err(3, "DRVLISTDEV");
+
+	children = laa.l_children;
+
+	laa.l_childname = malloc(children * sizeof(laa.l_childname[0]));
+	if (laa.l_childname == NULL)
+		err(5, "DRVLISTDEV");
+	if (ioctl(fd, DRVLISTDEV, &laa) == -1)
+		err(3, "DRVLISTDEV");
+	if (laa.l_children > children)
+		err(6, "DRVLISTDEV: number of children grew");
+
+	for (i = 0; i < (int)laa.l_children; i++) {
+		for (n = 0; n < depth; n++)
+			printf("  ");
+		if (!nflag) {
+			printf("%s ",
+			(dvname == NULL) ? "root" : laa.l_devname);
+		}
+		printf("%s\n", laa.l_childname[i]);
+		if (tflag) {
+			list_children(fd, laa.l_childname[i], nflag,
+			tflag, depth + 1);
+		}
+	}
+
+	free(laa.l_childname);
+}



CVS commit: src/share/man/man9

2011-08-07 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Aug  7 12:29:24 UTC 2011

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

Log Message:
Fix .Xr to membar_ops(3), not membar(9).  Spotted by wiz@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/pserialize.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/pserialize.9
diff -u src/share/man/man9/pserialize.9:1.2 src/share/man/man9/pserialize.9:1.3
--- src/share/man/man9/pserialize.9:1.2	Tue Aug  2 10:17:35 2011
+++ src/share/man/man9/pserialize.9	Sun Aug  7 12:29:24 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pserialize.9,v 1.2 2011/08/02 10:17:35 wiz Exp $
+.\"	$NetBSD: pserialize.9,v 1.3 2011/08/07 12:29:24 rmind Exp $
 .\"
 .\" Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -94,8 +94,8 @@
 is implemented within the file
 .Pa sys/kern/subr_pserialize.c .
 .Sh SEE ALSO
+.Xr membar_ops 3 ,
 .Xr condvar 9 ,
-.Xr membar 9 ,
 .Xr mutex 9 ,
 .Xr rwlock 9
 .Rs



CVS commit: src/external/gpl3/gcc

2011-08-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug  7 12:20:10 UTC 2011

Modified Files:
src/external/gpl3/gcc/lib/libgcc/arch: hppa.mk
src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa: c++config.h config.h
gstdint.h
src/external/gpl3/gcc/usr.bin/gcc/arch/hppa: configargs.h defs.mk

Log Message:
re-run mknative for hppa.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/lib/libgcc/arch/hppa.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/config.h \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/gstdint.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gcc/usr.bin/gcc/arch/hppa/configargs.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/hppa/defs.mk

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

Modified files:

Index: src/external/gpl3/gcc/lib/libgcc/arch/hppa.mk
diff -u src/external/gpl3/gcc/lib/libgcc/arch/hppa.mk:1.1 src/external/gpl3/gcc/lib/libgcc/arch/hppa.mk:1.2
--- src/external/gpl3/gcc/lib/libgcc/arch/hppa.mk:1.1	Thu Jul  7 02:07:31 2011
+++ src/external/gpl3/gcc/lib/libgcc/arch/hppa.mk	Sun Aug  7 12:20:10 2011
@@ -4,7 +4,7 @@
 #
 G_INCLUDES=-I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber   -I/usr/include/libelf
 G_LIB2ADD=${GNUHOSTDIST}/gcc/config/pa/fptr.c
-G_LIB2ADDEH=${GNUHOSTDIST}/gcc/unwind-dw2.c ${GNUHOSTDIST}/gcc/unwind-dw2-fde.c ${GNUHOSTDIST}/gcc/unwind-sjlj.c ${GNUHOSTDIST}/gcc/gthr-gnat.c ${GNUHOSTDIST}/gcc/unwind-c.c
+G_LIB2ADDEH=${GNUHOSTDIST}/gcc/unwind-dw2.c ${GNUHOSTDIST}/gcc/unwind-dw2-fde-glibc.c ${GNUHOSTDIST}/gcc/unwind-sjlj.c ${GNUHOSTDIST}/gcc/gthr-gnat.c ${GNUHOSTDIST}/gcc/unwind-c.c
 G_LIB2ADD_ST=
 G_LIB1ASMFUNCS=_divI _divU _remI _remU _div_const _mulI _dyncall
 G_LIB1ASMSRC=pa/milli64.S

Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h:1.1 src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h:1.2
--- src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h:1.1	Thu Jul  7 02:07:32 2011
+++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h	Sun Aug  7 12:20:10 2011
@@ -499,7 +499,7 @@
 /* #undef _GLIBCXX_HAVE_FABSL */
 
 /* Define to 1 if you have the  header file. */
-/* #undef _GLIBCXX_HAVE_FENV_H */
+#define _GLIBCXX_HAVE_FENV_H 1
 
 /* Define to 1 if you have the `finite' function. */
 #define _GLIBCXX_HAVE_FINITE 1
@@ -788,7 +788,7 @@
 /* #undef _GLIBCXX_HAVE_TANL */
 
 /* Define to 1 if you have the  header file. */
-/* #undef _GLIBCXX_HAVE_TGMATH_H */
+#define _GLIBCXX_HAVE_TGMATH_H 1
 
 /* Define to 1 if the target supports thread-local storage. */
 /* #undef _GLIBCXX_HAVE_TLS */
Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/config.h
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/config.h:1.1 src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/config.h:1.2
--- src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/config.h:1.1	Thu Jul  7 02:07:32 2011
+++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/config.h	Sun Aug  7 12:20:10 2011
@@ -120,7 +120,7 @@
 /* #undef HAVE_FABSL */
 
 /* Define to 1 if you have the  header file. */
-/* #undef HAVE_FENV_H */
+#define HAVE_FENV_H 1
 
 /* Define to 1 if you have the `finite' function. */
 #define HAVE_FINITE 1
@@ -409,7 +409,7 @@
 /* #undef HAVE_TANL */
 
 /* Define to 1 if you have the  header file. */
-/* #undef HAVE_TGMATH_H */
+#define HAVE_TGMATH_H 1
 
 /* Define to 1 if the target supports thread-local storage. */
 /* #undef HAVE_TLS */
Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/gstdint.h
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/gstdint.h:1.1 src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/gstdint.h:1.2
--- src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/gstdint.h:1.1	Thu Jul  7 02:07:32 2011
+++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/gstdint.h	Sun Aug  7 12:20:10 2011
@@ -2,7 +2,7 @@
 /* Generated from: 	NetBSD: mknative-gcc,v 1.61 2011/07/03 12:26:02 mrg Exp  */
 /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp  */
 
-/* generated for  hppa--netbsd-gcc (GCC) 4.1.3 20080704 (prerelease) (NetBSD nb2 20081120) */
+/* generated for  hppa--netbsd-gcc (NetBSD nb1 20110620) 4.5.3 */
 
 #ifndef GCC_GENERATED_STDINT_H
 #define GCC_GENERATED_STDINT_H 1

Index: src/external/gpl3/gcc/usr.bin/gcc/arch/hppa/configargs.h
diff -u src/external/gpl3/gcc/usr.bin/gcc/arch/hppa/configargs.h:1.1 src/external/gpl3/gcc/usr.bin/gcc/arch/hppa/configargs.h:1.2
--- src/external/gpl3/gcc/usr.bin/gcc/arch/hppa/configargs.h:1.1	Thu Jul  7 02:07:33 2011
+++ src/external/gpl3/gcc/usr.bin/gcc/arch/hppa/configargs.h	Sun Aug  

CVS commit: src/sbin/drvctl

2011-08-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  7 12:00:11 UTC 2011

Modified Files:
src/sbin/drvctl: drvctl.8 drvctl.c

Log Message:
add an optional argument to the -p flag that lets you extract specific
property values from the command-line:

  $ drvctl -p wd0 disk-info/geometry/cylinders-per-unit
  620181
  $ drvctl -p wd0 device-driver device-unit
  wd
  0
  $ drvctl -p wd0 nonexistent || echo "not found"
  not found


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sbin/drvctl/drvctl.8 src/sbin/drvctl/drvctl.c

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

Modified files:

Index: src/sbin/drvctl/drvctl.8
diff -u src/sbin/drvctl/drvctl.8:1.10 src/sbin/drvctl/drvctl.8:1.11
--- src/sbin/drvctl/drvctl.8:1.10	Mon Apr 20 22:07:23 2009
+++ src/sbin/drvctl/drvctl.8	Sun Aug  7 12:00:11 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: drvctl.8,v 1.10 2009/04/20 22:07:23 wiz Exp $
+.\" $NetBSD: drvctl.8,v 1.11 2011/08/07 12:00:11 jmcneill Exp $
 .\"
 .\" Copyright (c) 2004
 .\" 	Matthias Drochner.  All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 20, 2009
+.Dd August 7, 2011
 .Dt DRVCTL 8
 .Os
 .Sh NAME
@@ -46,6 +46,7 @@
 .Nm
 .Fl p
 .Ar device
+.Op Ar property ...
 .Nm
 .Fl Q
 .Ar device
@@ -96,10 +97,13 @@
 .Fl l
 output.
 .It Fl p
-Get the properties for the device specified by the
+Get properties for the device specified by the
 .Ar device
 argument.
-The properties are displayed as an XML property list.
+If
+.Ar property
+is specified, the value of that property is printed, otherwise
+the properties are displayed as an XML property list.
 .It Fl Q
 Resume the ancestors of
 .Ar device ,
Index: src/sbin/drvctl/drvctl.c
diff -u src/sbin/drvctl/drvctl.c:1.10 src/sbin/drvctl/drvctl.c:1.11
--- src/sbin/drvctl/drvctl.c:1.10	Mon Apr 20 21:41:50 2009
+++ src/sbin/drvctl/drvctl.c	Sun Aug  7 12:00:11 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: drvctl.c,v 1.10 2009/04/20 21:41:50 dyoung Exp $ */
+/* $NetBSD: drvctl.c,v 1.11 2011/08/07 12:00:11 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2004
@@ -26,6 +26,7 @@
  * SUCH DAMAGE.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -43,6 +44,7 @@
 	  : O_RDONLY)
 
 static void usage(void);
+static void extract_property(prop_dictionary_t, const char *);
 
 static void
 usage(void)
@@ -51,7 +53,7 @@
 	fprintf(stderr, "Usage: %s -r [-a attribute] busdevice [locator ...]\n"
 	"   %s -d device\n"
 	"   %s [-n] -l [device]\n"
-	"   %s -p device\n"
+	"   %s -p device [prop]\n"
 	"   %s -Q device\n"
 	"   %s -R device\n"
 	"   %s -S device\n",
@@ -219,12 +221,17 @@
 			errx(3, "get-properties: failed to return result data");
 		}
 
-		xml = prop_dictionary_externalize(data_dict);
-		prop_object_release(results_dict);
+		if (argc == 1) {
+			xml = prop_dictionary_externalize(data_dict);
+			printf("Properties for device `%s':\n%s",
+			   argv[0], xml);
+			free(xml);
+		} else {
+			for (i = 1; i < argc; i++)
+extract_property(data_dict, argv[i]);
+		}
 
-		printf("Properties for device `%s':\n%s",
-		   argv[0], xml);
-		free(xml);
+		prop_object_release(results_dict);
 		break;
 	default:
 		errx(4, "unknown command");
@@ -232,3 +239,50 @@
 
 	return (0);
 }
+
+static void
+extract_property(prop_dictionary_t dict, const char *prop)
+{
+	char *s, *p, *cur, *ep = NULL, *xml;
+	prop_object_t obj;
+
+	s = strdup(prop);
+	p = strtok_r(s, "/", &ep);
+	while (p) {
+		cur = p;
+		p = strtok_r(NULL, "/", &ep);
+		if (p) {
+			if (prop_dictionary_get_dict(dict, cur, &dict) == false)
+exit(EXIT_FAILURE);
+		} else {
+			obj = prop_dictionary_get(dict, cur);
+			if (obj == NULL)
+exit(EXIT_FAILURE);
+			switch (prop_object_type(obj)) {
+			case PROP_TYPE_BOOL:
+printf("%s\n",
+prop_bool_true(obj) ? "true" : "false");
+break;
+			case PROP_TYPE_NUMBER:
+printf("%" PRId64 "\n",
+prop_number_integer_value(obj));
+break;
+			case PROP_TYPE_STRING:
+printf("%s\n",
+prop_string_cstring_nocopy(obj));
+break;
+			case PROP_TYPE_DICTIONARY:
+xml = prop_dictionary_externalize(obj);
+printf("%s", xml);
+free(xml);
+break;
+			default:
+fprintf(stderr, "unhandled type %d\n",
+prop_object_type(obj));
+exit(EXIT_FAILURE);
+			}
+		}
+	}
+
+	free(s);
+}



CVS commit: src/external/gpl3/gcc/usr.bin

2011-08-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug  7 11:41:50 UTC 2011

Modified Files:
src/external/gpl3/gcc/usr.bin: Makefile.inc

Log Message:
after all the recent fixes, let's call this "NetBSD nb2 20110806"


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc/usr.bin/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/external/gpl3/gcc/usr.bin/Makefile.inc
diff -u src/external/gpl3/gcc/usr.bin/Makefile.inc:1.9 src/external/gpl3/gcc/usr.bin/Makefile.inc:1.10
--- src/external/gpl3/gcc/usr.bin/Makefile.inc:1.9	Thu Jul 21 03:13:32 2011
+++ src/external/gpl3/gcc/usr.bin/Makefile.inc	Sun Aug  7 11:41:50 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.9 2011/07/21 03:13:32 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.10 2011/08/07 11:41:50 mrg Exp $
 
 .ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_
 _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_=1
@@ -65,7 +65,7 @@
 # XXX pull this out of our configs
 G_BUGURL=
 G_BUGURL_s="\"${G_BUG_URL}\""
-G_PKGVERSION=(NetBSD nb1 20110620) 
+G_PKGVERSION=(NetBSD nb2 20110806) 
 G_PKGVERSION_s="\"${G_PKGVERSION} \""
 
 VER_CPPFLAGS=			-DBUGURL=${G_BUGURL_s} \



CVS commit: src/lib/libcurses

2011-08-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug  7 11:37:06 UTC 2011

Modified Files:
src/lib/libcurses: curses_inch.3

Log Message:
Add serial comma, remove trailing whitespace, bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libcurses/curses_inch.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/libcurses/curses_inch.3
diff -u src/lib/libcurses/curses_inch.3:1.11 src/lib/libcurses/curses_inch.3:1.12
--- src/lib/libcurses/curses_inch.3:1.11	Sun Aug  7 10:55:59 2011
+++ src/lib/libcurses/curses_inch.3	Sun Aug  7 11:37:06 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_inch.3,v 1.11 2011/08/07 10:55:59 blymn Exp $
+.\"	$NetBSD: curses_inch.3,v 1.12 2011/08/07 11:37:06 wiz Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd April 18, 2004
+.Dd August 7, 2011
 .Dt CURSES_INCH 3
 .Os
 .Sh NAME
@@ -222,9 +222,9 @@
 If the calls
 .Fn innstr ,
 .Fn mvinnstr ,
-.Fn mvwinnstr
+.Fn mvwinnstr ,
 and
-.Fn winnstr 
+.Fn winnstr
 succeed then they will return the number of characters actually read.
 Functions returning pointers will return
 .Dv NULL



CVS commit: src/common/lib/libprop

2011-08-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  7 11:33:03 UTC 2011

Modified Files:
src/common/lib/libprop: prop_dictionary_util.3

Log Message:
prop_dictionary_get_dict: last argument is prop_dictionary_t *, not bool *


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_dictionary_util.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_dictionary_util.3
diff -u src/common/lib/libprop/prop_dictionary_util.3:1.6 src/common/lib/libprop/prop_dictionary_util.3:1.7
--- src/common/lib/libprop/prop_dictionary_util.3:1.6	Sun Mar 27 22:45:30 2011
+++ src/common/lib/libprop/prop_dictionary_util.3	Sun Aug  7 11:33:03 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prop_dictionary_util.3,v 1.6 2011/03/27 22:45:30 wiz Exp $
+.\"	$NetBSD: prop_dictionary_util.3,v 1.7 2011/08/07 11:33:03 jmcneill Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 12, 2011
+.Dd August 7, 2011
 .Dt PROP_DICTIONARY_UTIL 3
 .Os
 .Sh NAME
@@ -63,7 +63,7 @@
 .\"
 .Ft bool
 .Fn prop_dictionary_get_dict "prop_dictionary_t dict" "const char *key" \
-"bool *dictp"
+"prop_dictionary_t *dictp"
 .Ft bool
 .Fn prop_dictionary_get_bool "prop_dictionary_t dict" "const char *key" \
 "bool *valp"



CVS commit: src/lib/libcurses

2011-08-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Aug  7 10:57:10 UTC 2011

Modified Files:
src/lib/libcurses: inchstr.c

Log Message:
Merge the attributes into the returned characters.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libcurses/inchstr.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/libcurses/inchstr.c
diff -u src/lib/libcurses/inchstr.c:1.3 src/lib/libcurses/inchstr.c:1.4
--- src/lib/libcurses/inchstr.c:1.3	Wed Jul 22 16:57:14 2009
+++ src/lib/libcurses/inchstr.c	Sun Aug  7 10:57:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: inchstr.c,v 1.3 2009/07/22 16:57:14 roy Exp $	*/
+/*	$NetBSD: inchstr.c,v 1.4 2011/08/07 10:57:10 blymn Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: inchstr.c,v 1.3 2009/07/22 16:57:14 roy Exp $");
+__RCSID("$NetBSD: inchstr.c,v 1.4 2011/08/07 10:57:10 blymn Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -144,7 +144,8 @@
 	end = &win->alines[win->cury]->line[epos];
 
 	while (start <= end) {
-		*chstr = start->ch;
+		/* or in the attributes but strip out internal flags */
+		*chstr = start->ch | (start->attr & ~__ACS_IS_WACS);
 		chstr++;
 		start++;
 	}



CVS commit: src/lib/libcurses

2011-08-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Aug  7 10:55:59 UTC 2011

Modified Files:
src/lib/libcurses: curses_inch.3

Log Message:
Document the return values for innstr and friends.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/curses_inch.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/libcurses/curses_inch.3
diff -u src/lib/libcurses/curses_inch.3:1.10 src/lib/libcurses/curses_inch.3:1.11
--- src/lib/libcurses/curses_inch.3:1.10	Wed Apr 21 06:24:32 2004
+++ src/lib/libcurses/curses_inch.3	Sun Aug  7 10:55:59 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_inch.3,v 1.10 2004/04/21 06:24:32 jdc Exp $
+.\"	$NetBSD: curses_inch.3,v 1.11 2011/08/07 10:55:59 blymn Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -219,6 +219,13 @@
 .Fn winstr
 is not recommended.
 .Sh RETURN VALUES
+If the calls
+.Fn innstr ,
+.Fn mvinnstr ,
+.Fn mvwinnstr
+and
+.Fn winnstr 
+succeed then they will return the number of characters actually read.
 Functions returning pointers will return
 .Dv NULL
 if an error is detected.



CVS commit: src/lib/libcurses

2011-08-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Aug  7 10:54:53 UTC 2011

Modified Files:
src/lib/libcurses: instr.c

Log Message:
Fix a bug that prevented instr and friends returning OK.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libcurses/instr.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/libcurses/instr.c
diff -u src/lib/libcurses/instr.c:1.3 src/lib/libcurses/instr.c:1.4
--- src/lib/libcurses/instr.c:1.3	Wed Jul 22 16:57:15 2009
+++ src/lib/libcurses/instr.c	Sun Aug  7 10:54:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: instr.c,v 1.3 2009/07/22 16:57:15 roy Exp $	*/
+/*	$NetBSD: instr.c,v 1.4 2011/08/07 10:54:53 blymn Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: instr.c,v 1.3 2009/07/22 16:57:15 roy Exp $");
+__RCSID("$NetBSD: instr.c,v 1.4 2011/08/07 10:54:53 blymn Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -137,11 +137,12 @@
 winnstr(WINDOW *win, char *str, int n)
 {
 	__LDATA	*end, *start;
-	int epos;
+	int epos, sn;
 
 	if (str == NULL)
 		return ERR;
 
+	sn = n;
 	start = &win->alines[win->cury]->line[win->curx];
 	/* (n - 1) to leave room for the trailing NUL */
 	if (n < 0 || (n - 1) > win->maxx - win->curx - 1) {
@@ -161,7 +162,7 @@
 	}
 	*str = '\0';
 
-	if (n < 0)
+	if (sn < 0)
 		return OK;
 	else
 		return n;



CVS commit: src/lib/libcurses

2011-08-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Aug  7 10:52:18 UTC 2011

Modified Files:
src/lib/libcurses: meta.c

Log Message:
flush the output after writing the meta sequence.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libcurses/meta.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/libcurses/meta.c
diff -u src/lib/libcurses/meta.c:1.7 src/lib/libcurses/meta.c:1.8
--- src/lib/libcurses/meta.c:1.7	Wed Feb  3 15:34:40 2010
+++ src/lib/libcurses/meta.c	Sun Aug  7 10:52:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: meta.c,v 1.7 2010/02/03 15:34:40 roy Exp $	*/
+/*	$NetBSD: meta.c,v 1.8 2011/08/07 10:52:18 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: meta.c,v 1.7 2010/02/03 15:34:40 roy Exp $");
+__RCSID("$NetBSD: meta.c,v 1.8 2011/08/07 10:52:18 blymn Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -51,6 +51,7 @@
 #endif
 			tputs(meta_on, 0, __cputchar);
 			_cursesi_screen->meta_state = TRUE;
+			fflush(_cursesi_screen->outfd);
 		}
 	} else {
 		if (meta_off != NULL) {
@@ -59,6 +60,7 @@
 #endif
 			tputs(meta_off, 0, __cputchar);
 			_cursesi_screen->meta_state = FALSE;
+			fflush(_cursesi_screen->outfd);
 		}
 	}
 



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

2011-08-07 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Sun Aug  7 10:04:42 UTC 2011

Modified Files:
src/sys/arch/i386/conf: GENERIC XEN3_DOMU

Log Message:
Add commented out entries for V7FS and V7FS Endian Independent support.


To generate a diff of this commit:
cvs rdiff -u -r1.1041 -r1.1042 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/i386/conf/XEN3_DOMU

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

Modified files:

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1041 src/sys/arch/i386/conf/GENERIC:1.1042
--- src/sys/arch/i386/conf/GENERIC:1.1041	Sat Jul 23 21:12:58 2011
+++ src/sys/arch/i386/conf/GENERIC	Sun Aug  7 10:04:41 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1041 2011/07/23 21:12:58 jakllsch Exp $
+# $NetBSD: GENERIC,v 1.1042 2011/08/07 10:04:41 tron Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.1041 $"
+#ident 		"GENERIC-$Revision: 1.1042 $"
 
 maxusers	64		# estimated number of users
 
@@ -186,6 +186,7 @@
 #file-system	UDF		# experimental - OSTA UDF CD/DVD file-system
 #file-system	HFS		# experimental - Apple HFS+ (read-only)
 #file-system	NILFS		# experimental - NTT's NiLFS(2)
+#file-system	V7FS		# 7th Edition(V7) File System
 
 # File system options
 #options 	QUOTA		# legacy UFS quotas
@@ -197,6 +198,7 @@
 #options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 # immutable) behave as system flags.
+#options 	V7FS_EI		# V7FS Endian Independent support
 
 # Networking options
 #options 	GATEWAY		# packet forwarding

Index: src/sys/arch/i386/conf/XEN3_DOMU
diff -u src/sys/arch/i386/conf/XEN3_DOMU:1.35 src/sys/arch/i386/conf/XEN3_DOMU:1.36
--- src/sys/arch/i386/conf/XEN3_DOMU:1.35	Sat May 28 13:01:50 2011
+++ src/sys/arch/i386/conf/XEN3_DOMU	Sun Aug  7 10:04:41 2011
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.35 2011/05/28 13:01:50 ryo Exp $
+# $NetBSD: XEN3_DOMU,v 1.36 2011/08/07 10:04:41 tron Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -104,6 +104,7 @@
 file-system 	PTYFS		# /dev/pts/N support
 file-system 	TMPFS		# Efficient memory file-system
 file-system	NILFS		# experimental - NTT's NiLFS(2)
+#file-system	V7FS		# 7th Edition(V7) File System
 
 # File system options
 options 	QUOTA		# legacy UFS quotas
@@ -115,6 +116,7 @@
 #options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 # immutable) behave as system flags.
+#options 	V7FS_EI		# V7FS Endian Independent support
 
 # Networking options
 #options 	GATEWAY		# packet forwarding



CVS commit: src/doc

2011-08-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug  7 08:15:56 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
note switch to GCC 4.5 on x86


To generate a diff of this commit:
cvs rdiff -u -r1.1589 -r1.1590 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.1589 src/doc/CHANGES:1.1590
--- src/doc/CHANGES:1.1589	Sat Aug  6 08:47:14 2011
+++ src/doc/CHANGES	Sun Aug  7 08:15:56 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1589 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1590 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1096,4 +1096,6 @@
 		the module is to be loaded from a filesystem path, it must not
 		contain a / character when the module is to be loaded from
 		the system module area. [mbalmer 20110806]
+	amd64: Switch to GCC 4.5.3  [mrg 20110806]
+	i386: Switch to GCC 4.5.3  [mrg 20110806]
 



CVS commit: src/share/mk

2011-08-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug  7 08:15:03 UTC 2011

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch x86 to GCC 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.677 -r1.678 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.677 src/share/mk/bsd.own.mk:1.678
--- src/share/mk/bsd.own.mk:1.677	Fri Aug  5 00:24:12 2011
+++ src/share/mk/bsd.own.mk	Sun Aug  7 08:15:02 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.677 2011/08/05 00:24:12 matt Exp $
+#	$NetBSD: bsd.own.mk,v 1.678 2011/08/07 08:15:02 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -49,9 +49,11 @@
 #
 # Platforms using GCC 4.5
 #
-.if ${MACHINE_ARCH} == "sparc64" || \
-${MACHINE_CPU} == mips || \
-${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_ARCH} == "i386" || \
+${MACHINE_CPU}  == "mips" || \
+${MACHINE_ARCH} == "powerpc"  || \
+${MACHINE_ARCH} == "sparc64"  || \
+${MACHINE_ARCH} == "x86_64"
 HAVE_GCC?=45
 .endif