CVS commit: src/lib/libpam/modules

2011-03-08 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Mar  8 09:49:43 UTC 2011

Modified Files:
src/lib/libpam/modules: Makefile

Log Message:
Don't try to clean/build or install a library here, there are only
subdirectories.

Also, bsd.lib.mk requires a defined LIB, otherwise it will generate
unwanted commands during clean. It even failed on netbsd-4 where
'rm -f' needs at least one parameter which is missing due to recent
corrections in make/vars.c.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libpam/modules/Makefile

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

Modified files:

Index: src/lib/libpam/modules/Makefile
diff -u src/lib/libpam/modules/Makefile:1.11 src/lib/libpam/modules/Makefile:1.12
--- src/lib/libpam/modules/Makefile:1.11	Mon Oct 27 07:48:27 2008
+++ src/lib/libpam/modules/Makefile	Tue Mar  8 09:49:42 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2008/10/27 07:48:27 mrg Exp $
+# $NetBSD: Makefile,v 1.12 2011/03/08 09:49:42 mlelstv Exp $
 # Copyright 1998 Juniper Networks, Inc.
 # All rights reserved.
 #
@@ -43,7 +43,4 @@
 SUBDIR+= pam_ssh
 .endif
 
-libinstall::		# disable install rule in bsd.lib.mk
-
-.include bsd.lib.mk
 .include bsd.subdir.mk



CVS commit: src/lib/librumpuser

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 10:02:01 UTC 2011

Modified Files:
src/lib/librumpuser: sp_common.c

Log Message:
return correct value when reading a short frame


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/librumpuser/sp_common.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/librumpuser/sp_common.c
diff -u src/lib/librumpuser/sp_common.c:1.28 src/lib/librumpuser/sp_common.c:1.29
--- src/lib/librumpuser/sp_common.c:1.28	Tue Feb 15 10:37:07 2011
+++ src/lib/librumpuser/sp_common.c	Tue Mar  8 10:02:01 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: sp_common.c,v 1.28 2011/02/15 10:37:07 pooka Exp $	*/
+/*  $NetBSD: sp_common.c,v 1.29 2011/03/08 10:02:01 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -419,8 +419,9 @@
 		}
 
 		spc-spc_off += n;
-		if (spc-spc_off  HDRSZ)
-			return -1;
+		if (spc-spc_off  HDRSZ) {
+			return 0;
+		}
 
 		/*LINTED*/
 		framelen = spc-spc_hdr.rsp_len;



CVS commit: src/distrib/utils/sysinst

2011-03-08 Thread Adam Ciarcinski
Module Name:src
Committed By:   adam
Date:   Tue Mar  8 11:24:28 UTC 2011

Modified Files:
src/distrib/utils/sysinst: msg.mbr.pl msg.mi.pl
src/distrib/utils/sysinst/arch/cats: msg.md.pl
src/distrib/utils/sysinst/arch/i386: msg.md.pl
src/distrib/utils/sysinst/arch/mac68k: msg.md.pl
src/distrib/utils/sysinst/arch/zaurus: msg.md.pl

Log Message:
Added missing Polish translations


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/utils/sysinst/msg.mbr.pl
cvs rdiff -u -r1.70 -r1.71 src/distrib/utils/sysinst/msg.mi.pl
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/sysinst/arch/cats/msg.md.pl
cvs rdiff -u -r1.31 -r1.32 src/distrib/utils/sysinst/arch/i386/msg.md.pl
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/sysinst/arch/mac68k/msg.md.pl
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/sysinst/arch/zaurus/msg.md.pl

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

Modified files:

Index: src/distrib/utils/sysinst/msg.mbr.pl
diff -u src/distrib/utils/sysinst/msg.mbr.pl:1.12 src/distrib/utils/sysinst/msg.mbr.pl:1.13
--- src/distrib/utils/sysinst/msg.mbr.pl:1.12	Mon Apr 19 19:22:41 2010
+++ src/distrib/utils/sysinst/msg.mbr.pl	Tue Mar  8 11:24:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mbr.pl,v 1.12 2010/04/19 19:22:41 martin Exp $	*/
+/*	$NetBSD: msg.mbr.pl,v 1.13 2011/03/08 11:24:28 adam Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -157,7 +157,7 @@
 {Inny typ, podaj identyfikator liczbowy}
 
 
-message reeditpart	/* XXX translate */
+message reeditpart
 {
 
 Czy chcesz zmienic tablice partycji (MBR)? Brak zgody przerwie instalacje.

Index: src/distrib/utils/sysinst/msg.mi.pl
diff -u src/distrib/utils/sysinst/msg.mi.pl:1.70 src/distrib/utils/sysinst/msg.mi.pl:1.71
--- src/distrib/utils/sysinst/msg.mi.pl:1.70	Tue Feb  1 01:42:07 2011
+++ src/distrib/utils/sysinst/msg.mi.pl	Tue Mar  8 11:24:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.70 2011/02/01 01:42:07 joerg Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.71 2011/03/08 11:24:28 adam Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp   */
 
@@ -239,9 +239,9 @@
 
 message toobigdisklabel
 {
-This disk is too large for a disklabel partition table to be used
-and hence cannot be used as a bootable disk or to hold the root
-partition.
+Ten dysk jest zbyt duzy dla tablicy partycji disklabel i dlatego
+nie moze zostac uzyty jako dysk starowy ani nie moze przechowywac
+glownej partycji.
 }
 
 message fspart
@@ -354,7 +354,7 @@
 nie zostalo jeszcze zapisane. Masz teraz ostatnia szanse na przerwanie tego
 procesu poki nic nie zostalo jeszcze zmienione.
 
-Czy kontynuowac ?
+Czy kontynuowac?
 }
 
 message disksetupdone
@@ -374,7 +374,7 @@
 }
 
 message mountfail
-{zamountowanie urzadzenia /dev/%s%c na %s nie powiodlo sie.
+{zamontowanie urzadzenia /dev/%s%c na %s nie powiodlo sie.
 }
 
 message extractcomplete
@@ -466,14 +466,14 @@
 }
 
 message Available_cds
-{Available CDs}
+{Dostepne CD}
 
 message ask_cd
-{Multiple CDs found, please select the one containing the install CD.}
+{Znaleziono kilka CD, prosze wybrac CD zawierajcy instalacje.}
 
 message cd_path_not_found
-{The installation sets have not been found at the default location on this
-CD. Please check device and path name.}
+{Zbiory instalacyjne nie zostaly znalezione w domyslnym polozeniu na tym
+CD. Prosze sprawdzic urzadzenie i sciezke.}
 
 message localfssource
 {Podaj niezamountowane lokalne urzadzenie oraz katalog na nim, gdzie
@@ -673,7 +673,7 @@
 
 message netnotup_continueanyway
 {Czy chcesz kontynuowac proces instalacji i zalozyc, ze twoja siec dziala?
-(Nie przerywa proces instalacji.)
+(Nie przerywa procesu instalacji.)
 }
 
 message makedev
@@ -746,10 +746,10 @@
 {Inne}
 
 message set_modules
-{Kernel Modules}
+{Moduly kernela}
 
 message set_tests
-{Test programs}
+{Programy testujace}
 
 message set_text_tools
 {Narzedzia Przetwarzania Tekstu}
@@ -764,7 +764,7 @@
 {Konfiguracja X11}
 
 message set_X11_fonts
-{Fonty X11}
+{Czcionki X11}
 
 message set_X11_servers
 {Serwery X11}
@@ -798,11 +798,11 @@
 {partycje %c i %c pokrycia.}
 
 message No_Bootcode
-{No bootcode for root partition}
+{Brak kodu startowego dla glownej partycji}
 
 message cannot_ufs2_root
-{Sorry, the root file system can't be FFSv2 due to lack of bootloader support
-on this port.}
+{Glowny system plikow nie moze byc FFSv2 poniewaz nie ma kodu startowego dla
+tej platformy.}
 
 message edit_partitions_again
 {
@@ -941,14 +941,14 @@
 .endif
 
 message oldsendmail
-{Sendmail is no longer in this release of NetBSD, default MTA is
-postfix. The file /etc/mailer.conf still chooses the removed
-sendmail. Do you want to upgrade /etc/mailer.conf automatically for
-postfix? If you choose No you will have to update /etc/mailer.conf
-yourself to ensure proper email delivery.}
+{Sendmail nie jest dostepny w tym wydaniu NetBSD. Domyslnym MTA 

CVS commit: src/share/mk

2011-03-08 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Mar  8 12:20:17 UTC 2011

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

Log Message:
Adjust html link template and css location for man pages in arch
subdirs.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/share/mk/bsd.man.mk
cvs rdiff -u -r1.652 -r1.653 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.man.mk
diff -u src/share/mk/bsd.man.mk:1.106 src/share/mk/bsd.man.mk:1.107
--- src/share/mk/bsd.man.mk:1.106	Wed Jan 12 23:03:24 2011
+++ src/share/mk/bsd.man.mk	Tue Mar  8 12:20:17 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.man.mk,v 1.106 2011/01/12 23:03:24 joerg Exp $
+#	$NetBSD: bsd.man.mk,v 1.107 2011/03/08 12:20:17 njoly Exp $
 #	@(#)bsd.man.mk	8.1 (Berkeley) 6/8/93
 
 .include bsd.init.mk
@@ -189,13 +189,17 @@
 htmlpages::	# ensure target exists
 HTMLPAGES=	${MAN:C/\.([1-9])$/.html\1/}
 
+HTMLLINKS=	${MANSUBDIR:?../:}../html%S/%N.html
+HTMLSTYLE=	${MANSUBDIR:?../:}../style.css
+
 realall:	${HTMLPAGES}
 .NOPATH:	${HTMLPAGES}
 .SUFFIXES:	${_MNUMBERS:@N@.html$N@}
 
 ${_MNUMBERS:@N@.$N.html$N@}: # build rule
 	${_MKTARGET_FORMAT}
-	${TOOL_MANDOC_HTML} ${.IMPSRC}  ${.TARGET}.tmp  \
+	${TOOL_MANDOC_HTML} -Oman=${HTMLLINKS} -Ostyle=${HTMLSTYLE} \
+	${.IMPSRC}  ${.TARGET}.tmp  \
 	mv ${.TARGET}.tmp ${.TARGET}
 
 .for F in ${HTMLPAGES:O:u}

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.652 src/share/mk/bsd.own.mk:1.653
--- src/share/mk/bsd.own.mk:1.652	Mon Feb  7 21:23:47 2011
+++ src/share/mk/bsd.own.mk	Tue Mar  8 12:20:17 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.652 2011/02/07 21:23:47 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.653 2011/03/08 12:20:17 njoly Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -268,7 +268,7 @@
 TOOL_MAKEINFO=		${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
 TOOL_MAKEWHATIS=	${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
 TOOL_MANDOC_ASCII=	${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
-TOOL_MANDOC_HTML=	${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml -Oman=../html%S/%N.html -Ostyle=../style.css
+TOOL_MANDOC_HTML=	${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
 TOOL_MANDOC_LINT=	${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
 TOOL_MDSETIMAGE=	${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
 TOOL_MENUC=		MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc



CVS commit: src

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 12:39:30 UTC 2011

Modified Files:
src/lib/librumpuser: rumpuser_sp.c sp_common.c
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: locks.c lwproc.c rump.c
src/sys/sys: lwp.h proc.h

Log Message:
Nuke all threads belonging to a process calling exec before allowing
the exec handshake to return.

In addition to being The Right Thing To Do, fixes some nasty
conditions for CLOEXEC fd's (or at least does so in theory, I
couldn't create any problems although I tried).


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/librumpuser/rumpuser_sp.c
cvs rdiff -u -r1.29 -r1.30 src/lib/librumpuser/sp_common.c
cvs rdiff -u -r1.66 -r1.67 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.50 -r1.51 src/sys/rump/librump/rumpkern/locks.c
cvs rdiff -u -r1.16 -r1.17 src/sys/rump/librump/rumpkern/lwproc.c
cvs rdiff -u -r1.231 -r1.232 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.149 -r1.150 src/sys/sys/lwp.h
cvs rdiff -u -r1.301 -r1.302 src/sys/sys/proc.h

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

Modified files:

Index: src/lib/librumpuser/rumpuser_sp.c
diff -u src/lib/librumpuser/rumpuser_sp.c:1.43 src/lib/librumpuser/rumpuser_sp.c:1.44
--- src/lib/librumpuser/rumpuser_sp.c:1.43	Mon Mar  7 21:57:15 2011
+++ src/lib/librumpuser/rumpuser_sp.c	Tue Mar  8 12:39:28 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpuser_sp.c,v 1.43 2011/03/07 21:57:15 pooka Exp $	*/
+/*  $NetBSD: rumpuser_sp.c,v 1.44 2011/03/08 12:39:28 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpuser_sp.c,v 1.43 2011/03/07 21:57:15 pooka Exp $);
+__RCSID($NetBSD: rumpuser_sp.c,v 1.44 2011/03/08 12:39:28 pooka Exp $);
 
 #include sys/types.h
 #include sys/atomic.h
@@ -195,6 +195,7 @@
 
 	return p;
 }
+
 static void
 lwproc_execnotify(const char *comm)
 {
@@ -205,11 +206,11 @@
 }
 
 static void
-lwproc_procexit(void)
+lwproc_lwpexit(void)
 {
 
 	spops.spop_schedule();
-	spops.spop_procexit();
+	spops.spop_lwpexit();
 	spops.spop_unschedule();
 }
 
@@ -453,6 +454,8 @@
 
 	pthread_mutex_lock(spc-spc_mtx);
 	ref = --spc-spc_refcnt;
+	if (__predict_false(spc-spc_inexec  ref = 2))
+		pthread_cond_broadcast(spc-spc_cv);
 	pthread_mutex_unlock(spc-spc_mtx);
 
 	if (ref  0)
@@ -480,6 +483,7 @@
 serv_handledisco(unsigned int idx)
 {
 	struct spclient *spc = spclist[idx];
+	int dolwpexit;
 
 	DPRINTF((rump_sp: disconnecting [%u]\n, idx));
 
@@ -489,11 +493,13 @@
 	spc-spc_state = SPCSTATE_DYING;
 	kickall(spc);
 	sendunlockl(spc);
+	/* exec uses mainlwp in another thread, but also nuked all lwps */
+	dolwpexit = !spc-spc_inexec;
 	pthread_mutex_unlock(spc-spc_mtx);
 
-	if (spc-spc_mainlwp) {
+	if (dolwpexit  spc-spc_mainlwp) {
 		lwproc_switch(spc-spc_mainlwp);
-		lwproc_procexit();
+		lwproc_lwpexit();
 		lwproc_switch(NULL);
 	}
 
@@ -591,7 +597,11 @@
 	DPRINTF((rump_sp: handling syscall %d from client %d\n,
 	sysnum, spc-spc_pid));
 
-	lwproc_newlwp(spc-spc_pid);
+	if (__predict_false((rv = lwproc_newlwp(spc-spc_pid)) != 0)) {
+		retval[0] = -1;
+		send_syscall_resp(spc, rhdr-rsp_reqno, rv, retval);
+		return;
+	}
 	spc-spc_syscallreq = rhdr-rsp_reqno;
 	rv = rumpsyscall(sysnum, data, retval);
 	spc-spc_syscallreq = 0;
@@ -603,23 +613,57 @@
 	send_syscall_resp(spc, rhdr-rsp_reqno, rv, retval);
 }
 
-struct sysbouncearg {
+static void
+serv_handleexec(struct spclient *spc, struct rsp_hdr *rhdr, char *comm)
+{
+	size_t commlen = rhdr-rsp_len - HDRSZ;
+
+	pthread_mutex_lock(spc-spc_mtx);
+	/* one for the connection and one for us */
+	while (spc-spc_refcnt  2)
+		pthread_cond_wait(spc-spc_cv, spc-spc_mtx);
+	pthread_mutex_unlock(spc-spc_mtx);
+
+	/*
+	 * ok, all the threads are dead (or one is still alive and
+	 * the connection is dead, in which case this doesn't matter
+	 * very much).  proceed with exec.
+	 */
+
+	/* ensure comm is 0-terminated */
+	/* TODO: make sure it contains sensible chars? */
+	comm[commlen] = '\0';
+
+	lwproc_switch(spc-spc_mainlwp);
+	lwproc_execnotify(comm);
+	lwproc_switch(NULL);
+
+	pthread_mutex_lock(spc-spc_mtx);
+	spc-spc_inexec = 0;
+	pthread_mutex_unlock(spc-spc_mtx);
+	send_handshake_resp(spc, rhdr-rsp_reqno, 0);
+}
+
+enum sbatype { SBA_SYSCALL, SBA_EXEC };
+
+struct servbouncearg {
 	struct spclient *sba_spc;
 	struct rsp_hdr sba_hdr;
+	enum sbatype sba_type;
 	uint8_t *sba_data;
 
-	TAILQ_ENTRY(sysbouncearg) sba_entries;
+	TAILQ_ENTRY(servbouncearg) sba_entries;
 };
 static pthread_mutex_t sbamtx;
 static pthread_cond_t sbacv;
 static int nworker, idleworker, nwork;
-static TAILQ_HEAD(, sysbouncearg) syslist = TAILQ_HEAD_INITIALIZER(syslist);
+static TAILQ_HEAD(, servbouncearg) wrklist = TAILQ_HEAD_INITIALIZER(wrklist);
 
 /*ARGSUSED*/
 static void *
-serv_syscallbouncer(void *arg)
+serv_workbouncer(void 

CVS commit: src/tests/lib/librumpclient

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 12:40:26 UTC 2011

Modified Files:
src/tests/lib/librumpclient: Makefile t_exec.sh
Added Files:
src/tests/lib/librumpclient: h_execthr.c

Log Message:
add test case for multithreaded client calling exec


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/librumpclient/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/librumpclient/h_execthr.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/librumpclient/t_exec.sh

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

Modified files:

Index: src/tests/lib/librumpclient/Makefile
diff -u src/tests/lib/librumpclient/Makefile:1.3 src/tests/lib/librumpclient/Makefile:1.4
--- src/tests/lib/librumpclient/Makefile:1.3	Wed Feb 16 16:02:52 2011
+++ src/tests/lib/librumpclient/Makefile	Tue Mar  8 12:40:25 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/02/16 16:02:52 pooka Exp $
+#	$NetBSD: Makefile,v 1.4 2011/03/08 12:40:25 pooka Exp $
 #
 
 .include bsd.own.mk
@@ -7,11 +7,13 @@
 
 TESTS_C=	t_fd
 TESTS_C+=	h_exec
+TESTS_C+=	h_execthr
 
 TESTS_SH=	t_exec
 
 ATFFILE=	yes
 
 LDADD+= -lrumpclient
+LDADD.h_execthr= -lpthread
 
 .include bsd.test.mk

Index: src/tests/lib/librumpclient/t_exec.sh
diff -u src/tests/lib/librumpclient/t_exec.sh:1.7 src/tests/lib/librumpclient/t_exec.sh:1.8
--- src/tests/lib/librumpclient/t_exec.sh:1.7	Sat Feb 19 09:59:12 2011
+++ src/tests/lib/librumpclient/t_exec.sh	Tue Mar  8 12:40:25 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: t_exec.sh,v 1.7 2011/02/19 09:59:12 pooka Exp $
+#   $NetBSD: t_exec.sh,v 1.8 2011/03/08 12:40:25 pooka Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -127,6 +127,22 @@
 	rump.halt
 }
 
+atf_test_case threxec cleanup
+threxec_head()
+{
+	atf_set descr check that threads are killed before exec continues
+}
+
+threxec_body()
+{
+	atf_check -s exit:0 rump_server ${RUMP_SERVER}
+	atf_check -s exit:0 $(atf_get_srcdir)/h_execthr
+}
+
+threxec_cleanup()
+{
+	rump.halt
+}
 
 atf_init_test_cases()
 {
@@ -134,4 +150,5 @@
 	atf_add_test_case exec
 	atf_add_test_case cloexec
 	atf_add_test_case vfork
+	atf_add_test_case threxec
 }

Added files:

Index: src/tests/lib/librumpclient/h_execthr.c
diff -u /dev/null src/tests/lib/librumpclient/h_execthr.c:1.1
--- /dev/null	Tue Mar  8 12:40:26 2011
+++ src/tests/lib/librumpclient/h_execthr.c	Tue Mar  8 12:40:25 2011
@@ -0,0 +1,184 @@
+/*	$NetBSD: h_execthr.c,v 1.1 2011/03/08 12:40:25 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/types.h
+#include sys/sysctl.h
+
+#include err.h
+#include errno.h
+#include fcntl.h
+#include pthread.h
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include unistd.h
+
+#include rump/rumpclient.h
+#include rump/rump_syscalls.h
+
+static int canreturn = 0;
+
+/*
+ * Use a fairly large number of threads so that we have
+ * a better chance catching races.  XXX: this is rumpuser's
+ * MAXWORKER-1.
+ */
+#define NTHR 63
+
+static void *
+wrk(void *arg)
+{
+	int fd = (uintptr_t)arg;
+
+	rump_sys_read(fd, fd, sizeof(fd));
+	if (!canreturn)
+		errx(1, should not have returned);
+	if (fd != 37)
+		errx(1, got invalid magic);
+
+	return NULL;
+}
+
+static int
+getproc(pid_t mypid, struct kinfo_proc2 *p)
+{
+	int name[6];
+	size_t len = sizeof(*p);
+
+	name[0] = CTL_KERN;
+	name[1] = KERN_PROC2;
+	name[2] = KERN_PROC_PID;
+	name[3] = mypid;
+	name[4] = len;
+	name[5] = 1;
+
+	return rump_sys___sysctl(name, __arraycount(name), p, len, NULL, 0);
+} 
+
+int
+main(int argc, char *argv[], char 

CVS commit: src/tests/lib/librumphijack

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 14:53:03 UTC 2011

Modified Files:
src/tests/lib/librumphijack: h_client.c

Log Message:
print out the unexpected rv too


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/librumphijack/h_client.c

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

Modified files:

Index: src/tests/lib/librumphijack/h_client.c
diff -u src/tests/lib/librumphijack/h_client.c:1.4 src/tests/lib/librumphijack/h_client.c:1.5
--- src/tests/lib/librumphijack/h_client.c:1.4	Tue Mar  1 08:54:18 2011
+++ src/tests/lib/librumphijack/h_client.c	Tue Mar  8 14:53:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_client.c,v 1.4 2011/03/01 08:54:18 pooka Exp $	*/
+/*	$NetBSD: h_client.c,v 1.5 2011/03/08 14:53:03 pooka Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
 		exit(0);
 	} else if (strcmp(argv[1], invafd) == 0) {
 		struct pollfd pfd[2];
-		int fd;
+		int fd, rv;
 
 		fd = open(/rump/dev/null, O_RDWR);
 		if (fd == -1)
@@ -107,8 +107,8 @@
 		pfd[1].fd = fd;
 		pfd[1].events = POLLIN;
 
-		if (poll(pfd, 2, INFTIM) != 1)
-			errx(1, poll unexpected rv);
+		if ((rv = poll(pfd, 2, INFTIM)) != 1)
+			errx(1, poll unexpected rv %d (%d), rv, errno);
 		if (pfd[1].revents != POLLNVAL || pfd[0].revents != 0)
 			errx(1, poll unexpected revents);
 



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

2011-03-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Mar  8 15:01:03 UTC 2011

Modified Files:
src/sys/arch/mips/mips: lock_stubs_ras.S

Log Message:
Put NOPs to avoid load delay hazard on R3000.
Fixes TLB miss panic in ras_mutex_spin_exit() on NWS-3470D.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/mips/lock_stubs_ras.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/mips/mips/lock_stubs_ras.S
diff -u src/sys/arch/mips/mips/lock_stubs_ras.S:1.1 src/sys/arch/mips/mips/lock_stubs_ras.S:1.2
--- src/sys/arch/mips/mips/lock_stubs_ras.S:1.1	Sun Feb 20 07:45:47 2011
+++ src/sys/arch/mips/mips/lock_stubs_ras.S	Tue Mar  8 15:01:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs_ras.S,v 1.1 2011/02/20 07:45:47 matt Exp $	*/
+/*	$NetBSD: lock_stubs_ras.S,v 1.2 2011/03/08 15:01:02 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -377,6 +377,7 @@
  */
 LEAF(ras_mutex_spin_exit)
 	PTR_L	t2, L_CPU(MIPS_CURLWP)
+	nop
 #if defined(DIAGNOSTIC)
 	INT_L	t0, MTX_LOCK(a0)
 	nop
@@ -392,7 +393,6 @@
 	 */
 #ifdef PARANOIA
 	INT_L	a2, MTX_IPL(a0)
-	nop
 #endif
 	INT_L	a0, CPU_INFO_MTX_OLDSPL(t2)
 
@@ -408,6 +408,7 @@
 	 * If the IPL doesn't change, nothing to do
 	 */
 	INT_L	a1, CPU_INFO_CPL(t2)
+	nop
 
 #ifdef PARANOIA
 	sltu	v0, a1, a2		# v0 = cpl  mtx_ipl



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

2011-03-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Mar  8 15:05:41 UTC 2011

Modified Files:
src/sys/arch/mips/mips: locore.S locore_mips1.S spl.S

Log Message:
Sprinkle NOPs to avoid load delay hazard on R3000.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/mips/mips/locore.S
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/mips/mips/locore_mips1.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/mips/spl.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/mips/mips/locore.S
diff -u src/sys/arch/mips/mips/locore.S:1.183 src/sys/arch/mips/mips/locore.S:1.184
--- src/sys/arch/mips/mips/locore.S:1.183	Sat Feb 26 13:58:34 2011
+++ src/sys/arch/mips/mips/locore.S	Tue Mar  8 15:05:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.183 2011/02/26 13:58:34 tsutsui Exp $	*/
+/*	$NetBSD: locore.S,v 1.184 2011/03/08 15:05:40 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -66,6 +66,12 @@
 
 #include assym.h
 
+#if defined(MIPS1) || defined(MIPS2)
+#define	NOP_L		nop
+#else
+#define	NOP_L		/* nothing */
+#endif
+
 	.set	noreorder
 
 	.globl	start
@@ -252,6 +258,7 @@
 	PTR_L	a0, L_PROC(MIPS_CURLWP)		# argument to ras_lookup
 	PTR_L	s5, L_PCB(MIPS_CURLWP)		# XXXuvm_lwp_getuarea
 	PTR_L	v1, P_RASLIST(a0)		# get raslist
+	NOP_L	# load delay
 	beqz	v1, 1f#   skip call if empty
 	 nop
 	jal	_C_LABEL(ras_lookup)		# ras_lookup(p, pc)
@@ -316,11 +323,14 @@
 	 nop
 #endif /* PARANOIA */
 	PTR_L	t0, L_CPU(MIPS_CURLWP)
+	NOP_L	# load delay
 	INT_L	t1, CPU_INFO_MTX_COUNT(t0)
+	NOP_L	# load delay
 	INT_ADDU t1, 1
 	INT_S	t1, CPU_INFO_MTX_COUNT(t0)
 	REG_L	ra, CALLFRAME_RA(sp)
 	REG_L	v0, CALLFRAME_S0(sp)		# get softint lwp
+	NOP_L	# load delay
 	PTR_S	zero, L_CTXSWITCH(v0)		# clear l_ctxswtch
 #if IPL_SCHED != IPL_HIGH
 	j	_C_LABEL(splhigh_noprof)
@@ -419,6 +429,7 @@
 	PTR_LA	t1, 1f# load addr of cleanup
 	PTR_S	t1, PCB_ONFAULT(t0)		# save onfault handler
 	PTR_L	t2, L_CPU(a0)			# grab cpu of supplied lwp
+	NOP_L	# load delay
 	PTR_L	t3, CPU_INFO_CURLWP(t2)		# grab curlwp of that cpu
 	li	v0, ESRCH			# assume the lwp isn't curlwp
 	bne	a0, t3, 1f			# branch if true (not equal)
@@ -640,6 +651,7 @@
 1:
 	INT_L		a0, 0(a0)		# a0 = coproc instruction
 2:
+	NOP_L	# load delay
 
 /*
  * Check to see if the instruction to be emulated is a floating-point

Index: src/sys/arch/mips/mips/locore_mips1.S
diff -u src/sys/arch/mips/mips/locore_mips1.S:1.73 src/sys/arch/mips/mips/locore_mips1.S:1.74
--- src/sys/arch/mips/mips/locore_mips1.S:1.73	Sun Feb 20 07:45:47 2011
+++ src/sys/arch/mips/mips/locore_mips1.S	Tue Mar  8 15:05:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_mips1.S,v 1.73 2011/02/20 07:45:47 matt Exp $	*/
+/*	$NetBSD: locore_mips1.S,v 1.74 2011/03/08 15:05:40 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -205,10 +205,12 @@
 	.mask	0x8000, -4
 #ifdef PARANOIA
 	PTR_L	k0, L_PCB(MIPS_CURLWP)
+	nop
 	slt	k0, k0, sp		# k0 = L_PCB(MIPS_CURLWP)  sp
 1:	beqz	k0, 1b			# loop forever if false
 	 nop
 	PTR_L	k0, L_PCB(MIPS_CURLWP)
+	nop
 	PTR_ADDU k0, USPACE
 	slt	k0, sp, k0		# k0 = sp  L_PCB(MIPS_CURLWP) + USPACE
 2:	beqz	k0, 2b			# loop forever if false
@@ -270,7 +272,9 @@
 	 * save PPL in trapframe
 	 */
 	PTR_L	t0, L_CPU(MIPS_CURLWP)
+	nop
 	INT_L	t1, CPU_INFO_CPL(t0)		# get current priority level
+	nop
 	INT_S	t1, TF_BASE+TF_PPL(sp)		# save priority level
 #endif /* PARANOIA */
 
@@ -297,6 +301,7 @@
 	 * Restore registers and return from the exception.
 	 */
 	REG_L	a0, TF_BASE+TF_REG_SR(sp)
+	nop
 	mtc0	a0, MIPS_COP_0_STATUS		# restore the SR, disable intrs
 
 	/*
@@ -313,7 +318,9 @@
 #ifdef PARANOIA
 	INT_L	t2, TF_BASE+TF_PPL(sp)		# get saved priority level
 	PTR_L	t0, L_CPU(MIPS_CURLWP)
+	nop
 	INT_L	t1, CPU_INFO_CPL(t0)		# get current priority level
+	nop
 11:	bne	t2, t1, 11b			# loop forever if unequal
 	 nop
 
@@ -384,16 +391,20 @@
 	.mask	0x8000, -4
 #ifdef PARANOIA
 	PTR_L	k0, L_PCB(MIPS_CURLWP)
+	nop
 	slt	k0, k0, sp			# k0 = L_PCB(MIPS_CURLWP)  sp
 1:	beqz	k0, 1b# loop forever if false
 	 nop
 	PTR_L	k0, L_PCB(MIPS_CURLWP)
+	nop
 	PTR_ADDU k0, USPACE
 	slt	k0, sp, k0			# k0 = sp  L_PCB(MIPS_CURLWP) + USPACE
 2:	beqz	k0, 2b# loop forever if false
 	 nop
 	PTR_L	k0, L_CPU(MIPS_CURLWP)
+	nop
 	INT_L	k0, CPU_INFO_IDEPTH(k0)		# grab interrupt depth
+	nop
 	sltu	k0, k0, 3			# must be  3
 3:	beqz	k0, 3b# loop forever if false
 	 nop
@@ -795,6 +806,7 @@
 	 * Interrupt depth is now back to 0.
 	 */
 	PTR_L	t0, L_CPU(MIPS_CURLWP)
+	nop
 	INT_S	zero, CPU_INFO_IDEPTH(t0)
 
 #ifdef __HAVE_FAST_SOFTINTS

Index: src/sys/arch/mips/mips/spl.S
diff -u src/sys/arch/mips/mips/spl.S:1.3 src/sys/arch/mips/mips/spl.S:1.4
--- src/sys/arch/mips/mips/spl.S:1.3	Fri Feb 25 14:57:45 2011
+++ src/sys/arch/mips/mips/spl.S	Tue Mar  8 15:05:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.3 2011/02/25 14:57:45 tsutsui Exp $	*/
+/*	$NetBSD: spl.S,v 1.4 2011/03/08 

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

2011-03-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Mar  8 15:12:46 UTC 2011

Modified Files:
src/sys/arch/mips/mips: locore_mips1.S

Log Message:
Pass correct exception PC value to cpu_intr() as mipsX_subr.S does.
Fixes SIGILL on all FPU exceptions on R3000.

XXX: cpu_intr() may require cause value as mentioned in PR port-mips/44639


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/mips/mips/locore_mips1.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/mips/mips/locore_mips1.S
diff -u src/sys/arch/mips/mips/locore_mips1.S:1.74 src/sys/arch/mips/mips/locore_mips1.S:1.75
--- src/sys/arch/mips/mips/locore_mips1.S:1.74	Tue Mar  8 15:05:40 2011
+++ src/sys/arch/mips/mips/locore_mips1.S	Tue Mar  8 15:12:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_mips1.S,v 1.74 2011/03/08 15:05:40 tsutsui Exp $	*/
+/*	$NetBSD: locore_mips1.S,v 1.75 2011/03/08 15:12:46 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -452,6 +452,7 @@
 #if defined(DDB) || defined(DEBUG) || defined(KGDB)
 	REG_S	ra, KERNFRAME_RA(sp)		# for debugging
 #endif
+	move	ta0, ra# save across spl* calls
 
 #ifdef PARANOIA
 	INT_L	s0, CPU_INFO_CPL(s2)
@@ -506,7 +507,7 @@
 	/*
 	 * Now hard interrupts can be processed.
 	 */
-	move	a1, ra# 2nd arg is exception PC
+	move	a1, ta0# 2nd arg is exception PC
 	move	a2, s1# 3rd arg is status
 	jal	_C_LABEL(cpu_intr)		# cpu_intr(ppl, pc, status)
 	 srl	a0, s0, 8			# 1st arg is previous pri level
@@ -763,6 +764,7 @@
 #ifdef __GP_SUPPORT__
 	PTR_LA	gp, _C_LABEL(_gp)		# switch to kernel GP
 #endif
+	move	ta0, ra# save across spl* calls
 
 	/*
 	 * We first need to get to IPL_HIGH so that interrupts are masked.
@@ -797,7 +799,7 @@
 	/*
 	 * Now hard interrupts can be processed.
 	 */
-	move	a1, ra# 2nd arg is exception pc
+	move	a1, ta0# 2nd arg is exception pc
 	move	a2, s1# 3rd arg is status
 	jal	_C_LABEL(cpu_intr)		# cpu_intr(ppl, pc, status)
 	 move	a0, s0# 1st arg is previous pri level



CVS commit: src/tests/lib/librumpclient

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 15:35:28 UTC 2011

Modified Files:
src/tests/lib/librumpclient: h_execthr.c

Log Message:
Enable the send a lot of syscall requests before exec code, since
it works now.  (or at least works in my tests)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/librumpclient/h_execthr.c

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

Modified files:

Index: src/tests/lib/librumpclient/h_execthr.c
diff -u src/tests/lib/librumpclient/h_execthr.c:1.1 src/tests/lib/librumpclient/h_execthr.c:1.2
--- src/tests/lib/librumpclient/h_execthr.c:1.1	Tue Mar  8 12:40:25 2011
+++ src/tests/lib/librumpclient/h_execthr.c	Tue Mar  8 15:35:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_execthr.c,v 1.1 2011/03/08 12:40:25 pooka Exp $	*/
+/*	$NetBSD: h_execthr.c,v 1.2 2011/03/08 15:35:28 pooka Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -164,7 +164,6 @@
 		usleep(1);
 	}
 
-#ifdef notyet
 	/*
 	 * load up one more (big) set.  these won't start executing, though,
 	 * but we're interested in if they create blockage
@@ -173,7 +172,6 @@
 		if (pthread_create(pt, NULL,
 		wrk, (void *)(uintptr_t)p1[0]) != 0)
 			errx(1, pthread_create 1 %d, i);
-#endif
 
 	/* then, we exec! */
 	execarg[0] = argv[0];



CVS commit: src/lib/librumpclient

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 15:55:12 UTC 2011

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
Since we ~never have a frame waiting on the initial call to waitresp,
call kevent before readframe.  Doesn't really affect performance,
but makes ktraces shorter ;)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/librumpclient/rumpclient.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/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.39 src/lib/librumpclient/rumpclient.c:1.40
--- src/lib/librumpclient/rumpclient.c:1.39	Tue Mar  8 15:34:37 2011
+++ src/lib/librumpclient/rumpclient.c	Tue Mar  8 15:55:12 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.39 2011/03/08 15:34:37 pooka Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.40 2011/03/08 15:55:12 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpclient.c,v 1.39 2011/03/08 15:34:37 pooka Exp $);
+__RCSID($NetBSD: rumpclient.c,v 1.40 2011/03/08 15:55:12 pooka Exp $);
 
 #include sys/param.h
 #include sys/event.h
@@ -202,37 +202,48 @@
 
 			dosig = 0;
 			for (gotresp = 0; !gotresp; ) {
-switch (readframe(spc)) {
-case 0:
-	rv = host_kevent(kq, NULL, 0,
-	kev, __arraycount(kev), NULL);
+/*
+ * typically we don't have a frame waiting
+ * when we come in here, so call kevent now
+ */
+rv = host_kevent(kq, NULL, 0,
+kev, __arraycount(kev), NULL);
+
+if (__predict_false(rv == -1)) {
+	goto activity;
+}
 
-	if (__predict_false(rv == -1)) {
-		goto cleanup;
-	}
-
-	/*
-	 * XXX: don't know how this can
-	 * happen (timeout cannot expire
-	 * since there isn't one), but
-	 * it does happen
-	 */
-	if (__predict_false(rv == 0))
-		continue;
-
-	for (i = 0; i  rv; i++) {
-		if (kev[i].filter
-		== EVFILT_SIGNAL)
-			dosig++;
-	}
-	if (dosig)
-		goto cleanup;
+/*
+ * XXX: don't know how this can happen
+ * (timeout cannot expire since there
+ * isn't one), but it does happen.
+ * treat it as an expectional condition
+ * and go through tryread to determine
+ * alive status.
+ */
+if (__predict_false(rv == 0))
+	goto activity;
+
+for (i = 0; i  rv; i++) {
+	if (kev[i].filter == EVFILT_SIGNAL)
+		dosig++;
+}
+if (dosig)
+	goto cleanup;
 
+/*
+ * ok, activity.  try to read a frame to
+ * determine what happens next.
+ */
+ activity:
+switch (readframe(spc)) {
+case 0:
 	continue;
 case -1:
 	imalive = false;
 	goto cleanup;
 default:
+	/* case 1 */
 	break;
 }
 



CVS commit: [rmind-uvmplock] src/sys/arch/hp700/hp700

2011-03-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  8 16:19:48 UTC 2011

Modified Files:
src/sys/arch/hp700/hp700 [rmind-uvmplock]: machdep.c

Log Message:
Fix mm_md_direct_mapped_phys.


To generate a diff of this commit:
cvs rdiff -u -r1.79.2.7 -r1.79.2.8 src/sys/arch/hp700/hp700/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/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.79.2.7 src/sys/arch/hp700/hp700/machdep.c:1.79.2.8
--- src/sys/arch/hp700/hp700/machdep.c:1.79.2.7	Sat Mar  5 20:50:28 2011
+++ src/sys/arch/hp700/hp700/machdep.c	Tue Mar  8 16:19:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.79.2.7 2011/03/05 20:50:28 rmind Exp $	*/
+/*	$NetBSD: machdep.c,v 1.79.2.8 2011/03/08 16:19:48 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.79.2.7 2011/03/05 20:50:28 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.79.2.8 2011/03/08 16:19:48 skrll Exp $);
 
 #include opt_cputype.h
 #include opt_ddb.h
@@ -2088,7 +2088,10 @@
 mm_md_direct_mapped_phys(paddr_t paddr, vaddr_t *vaddr)
 {
 
-	*vaddr = ptoa(physmem) - paddr;
+	if (atop(paddr)  physmem)
+		return false;
+*vaddr = paddr;
+
 	return true;
 }
 



CVS commit: [rmind-uvmplock] src/sys/arch/hp700/hp700

2011-03-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  8 16:21:32 UTC 2011

Modified Files:
src/sys/arch/hp700/hp700 [rmind-uvmplock]: machdep.c

Log Message:
RNF


To generate a diff of this commit:
cvs rdiff -u -r1.79.2.8 -r1.79.2.9 src/sys/arch/hp700/hp700/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/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.79.2.8 src/sys/arch/hp700/hp700/machdep.c:1.79.2.9
--- src/sys/arch/hp700/hp700/machdep.c:1.79.2.8	Tue Mar  8 16:19:48 2011
+++ src/sys/arch/hp700/hp700/machdep.c	Tue Mar  8 16:21:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.79.2.8 2011/03/08 16:19:48 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.79.2.9 2011/03/08 16:21:32 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.79.2.8 2011/03/08 16:19:48 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.79.2.9 2011/03/08 16:21:32 skrll Exp $);
 
 #include opt_cputype.h
 #include opt_ddb.h
@@ -2088,8 +2088,9 @@
 mm_md_direct_mapped_phys(paddr_t paddr, vaddr_t *vaddr)
 {
 
-	if (atop(paddr)  physmem)
+	if (atop(paddr)  physmem) {
 		return false;
+	}
 *vaddr = paddr;
 
 	return true;



CVS commit: [rmind-uvmplock] src/sys/arch/hp700/hp700

2011-03-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  8 16:30:38 UTC 2011

Modified Files:
src/sys/arch/hp700/hp700 [rmind-uvmplock]: machdep.c

Log Message:
whitespace. heh.


To generate a diff of this commit:
cvs rdiff -u -r1.79.2.9 -r1.79.2.10 src/sys/arch/hp700/hp700/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/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.79.2.9 src/sys/arch/hp700/hp700/machdep.c:1.79.2.10
--- src/sys/arch/hp700/hp700/machdep.c:1.79.2.9	Tue Mar  8 16:21:32 2011
+++ src/sys/arch/hp700/hp700/machdep.c	Tue Mar  8 16:30:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.79.2.9 2011/03/08 16:21:32 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.79.2.10 2011/03/08 16:30:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.79.2.9 2011/03/08 16:21:32 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.79.2.10 2011/03/08 16:30:38 skrll Exp $);
 
 #include opt_cputype.h
 #include opt_ddb.h
@@ -2091,7 +2091,7 @@
 	if (atop(paddr)  physmem) {
 		return false;
 	}
-*vaddr = paddr;
+	*vaddr = paddr;
 
 	return true;
 }



CVS commit: [netbsd-5] src/sbin/disklabel

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:05:32 UTC 2011

Modified Files:
src/sbin/disklabel [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1561):
sbin/disklabel/Makefile: revision 1.67
Disable COMPAT_386BSD_MBRPART. The code is still here if anyone needs it
for some reason. (But I have no idea why that would be -- if you have one
of these really ancient partitions and you're about to run disklabel, you
can easily run fdisk first and change the partition type to NetBSD.)
As it stands, the code will munch FreeBSD installs under some
circumstances, which is really not acceptable behavior.
The code, along with the kernel support that's been disabled by
default for several years, and some related but less dangerous code in
sysinst, should prboably be removed entirely after -6 is branched.
Discussed on tech-kern and tech-userlevel; closes PR 44496.
This is also almost certainly the cause of PR 42521 and PR 38841.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.6.1 src/sbin/disklabel/Makefile

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

Modified files:

Index: src/sbin/disklabel/Makefile
diff -u src/sbin/disklabel/Makefile:1.61 src/sbin/disklabel/Makefile:1.61.6.1
--- src/sbin/disklabel/Makefile:1.61	Tue Mar 11 08:18:22 2008
+++ src/sbin/disklabel/Makefile	Tue Mar  8 17:05:32 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.61 2008/03/11 08:18:22 aymeric Exp $
+#	$NetBSD: Makefile,v 1.61.6.1 2011/03/08 17:05:32 riz Exp $
 #	@(#)Makefile	8.2 (Berkeley) 3/17/94
 
 PROG=	disklabel
@@ -38,8 +38,8 @@
 )
 # use MBR partition info
 CPPFLAGS+= -DUSE_MBR
-# recognize old MBR partition ID for a while
-CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
+# do not recognize old MBR partition ID any more
+#CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
 .endif
 
 .if (${MACHINE} == acorn32 || ${MACHINE} == acorn26)



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

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:09:13 UTC 2011

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

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1562):
sys/dev/usb/if_rum.c: revision 1.34
fix typo (clean up the rx list on failure setting it up, not the tx list)
from openbsd -r1.75, mentioned by Alexander Nasonov in PR 42667


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/dev/usb/if_rum.c

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

Modified files:

Index: src/sys/dev/usb/if_rum.c
diff -u src/sys/dev/usb/if_rum.c:1.23 src/sys/dev/usb/if_rum.c:1.23.4.1
--- src/sys/dev/usb/if_rum.c:1.23	Tue Oct 21 12:21:46 2008
+++ src/sys/dev/usb/if_rum.c	Tue Mar  8 17:09:13 2011
@@ -1,5 +1,5 @@
 /*	$OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $	*/
-/*	$NetBSD: if_rum.c,v 1.23 2008/10/21 12:21:46 jun Exp $	*/
+/*	$NetBSD: if_rum.c,v 1.23.4.1 2011/03/08 17:09:13 riz Exp $	*/
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini damien.bergam...@free.fr
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.23 2008/10/21 12:21:46 jun Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.23.4.1 2011/03/08 17:09:13 riz Exp $);
 
 #include bpfilter.h
 
@@ -629,7 +629,7 @@
 
 	return 0;
 
-fail:	rum_free_tx_list(sc);
+fail:	rum_free_rx_list(sc);
 	return error;
 }
 



CVS commit: [netbsd-5] src

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:17:54 UTC 2011

Modified Files:
src/dist/atf/tests/atf/tools [netbsd-5]: t_atf_config.sh
src/lib/libatf-c [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by jmmv in ticket #1563):
dist/atf/tests/atf/tools/t_atf_config.shpatch
lib/libatf-c/Makefile   patch

Fix the values of atf_arch and atf_machine: the former is supposed to be
the cpu name and the latter the port name.  They had been reversed until
now due to some smart stupidity^Wlogic in the upstream configure script,
which is now gone.
This is a pullup of revision f9329ca68da7e8557e0803b5747a12f8c10b1258
plus the corresponding reachover build changes.
Addresses PR bin/44305.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.6.1 \
src/dist/atf/tests/atf/tools/t_atf_config.sh
cvs rdiff -u -r1.2 -r1.2.4.1 src/lib/libatf-c/Makefile

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

Modified files:

Index: src/dist/atf/tests/atf/tools/t_atf_config.sh
diff -u src/dist/atf/tests/atf/tools/t_atf_config.sh:1.1.1.3 src/dist/atf/tests/atf/tools/t_atf_config.sh:1.1.1.3.6.1
--- src/dist/atf/tests/atf/tools/t_atf_config.sh:1.1.1.3	Thu May  1 15:22:33 2008
+++ src/dist/atf/tests/atf/tools/t_atf_config.sh	Tue Mar  8 17:17:54 2011
@@ -150,36 +150,6 @@
 done
 }
 
-# XXX: This does not seem to belong here...
-atf_test_case arch
-arch_head()
-{
-atf_set descr Tests that the current value of atf_arch is correct \
-for the corresponding atf_machine
-}
-arch_body()
-{
-atf_check atf-config -t atf_arch 0 stdout null
-arch=$(cat stdout)
-atf_check atf-config -t atf_machine 0 stdout null
-machine=$(cat stdout)
-echo Machine type ${machine}, architecture ${arch}
-
-case ${machine} in
-i386|i486|i586|i686)
-exp_arch=i386
-;;
-x86_64)
-exp_arch=amd64
-;;
-*)
-exp_arch=${machine}
-esac
-echo Expected architecture ${exp_arch}
-
-atf_check_equal ${arch} ${exp_arch}
-}
-
 atf_init_test_cases()
 {
 atf_add_test_case list_all
@@ -191,8 +161,6 @@
 atf_add_test_case query_mixture
 
 atf_add_test_case override_env
-
-atf_add_test_case arch
 }
 
 # vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4

Index: src/lib/libatf-c/Makefile
diff -u src/lib/libatf-c/Makefile:1.2 src/lib/libatf-c/Makefile:1.2.4.1
--- src/lib/libatf-c/Makefile:1.2	Sun Jul 20 14:36:52 2008
+++ src/lib/libatf-c/Makefile	Tue Mar  8 17:17:54 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2008/07/20 14:36:52 veego Exp $
+# $NetBSD: Makefile,v 1.2.4.1 2011/03/08 17:17:54 riz Exp $
 
 NOLINT=		# defined
 
@@ -15,10 +15,10 @@
 CPPFLAGS+=	-I.
 
 CPPFLAGS+=	-DHAVE_CONFIG_H
-CPPFLAGS+=	-DATF_ARCH=\${MACHINE}\
+CPPFLAGS+=	-DATF_ARCH=\${MACHINE_ARCH}\
 CPPFLAGS+=	-DATF_CONFDIR=\/etc/atf\
 CPPFLAGS+=	-DATF_LIBEXECDIR=\/usr/libexec\
-CPPFLAGS+=	-DATF_MACHINE=\${MACHINE_ARCH}\
+CPPFLAGS+=	-DATF_MACHINE=\${MACHINE}\
 CPPFLAGS+=	-DATF_PKGDATADIR=\/usr/share/atf\
 CPPFLAGS+=	-DATF_SHELL=\/bin/sh\
 CPPFLAGS+=	-DATF_WORKDIR=\/tmp\



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

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:29:46 UTC 2011

Modified Files:
src/sys/arch/sparc/dev [netbsd-5]: zs.c
src/sys/arch/sparc/include [netbsd-5]: cpu.h z8530var.h
src/sys/arch/sparc/sparc [netbsd-5]: cpu.c cpuvar.h db_interface.c
genassym.cf intr.c locore.s machdep.c timer.c timer_sun4m.c
timervar.h trap.c vm_machdep.c

Log Message:
Apply patches (requested by mrg in ticket #1564):
sys/arch/sparc/dev/zs.c:patch
sys/arch/sparc/include/cpu.h:   patch
sys/arch/sparc/include/z8530var.h:  patch
sys/arch/sparc/sparc/cpu.c: patch
sys/arch/sparc/sparc/cpuvar.h:  patch
sys/arch/sparc/sparc/db_interface.c:patch
sys/arch/sparc/sparc/genassym.cf:   patch
sys/arch/sparc/sparc/intr.c:patch
sys/arch/sparc/sparc/locore.s:  patch
sys/arch/sparc/sparc/machdep.c: patch
sys/arch/sparc/sparc/timer.c:   patch
sys/arch/sparc/sparc/timer_sun4m.c: patch
sys/arch/sparc/sparc/timervar.h:patch
sys/arch/sparc/sparc/trap.c:patch
sys/arch/sparc/sparc/vm_machdep.c:  patch

- fix a panic in savefpstate.  idea, and code suggestions from uwe
- convert xpmsg_lock to IPL_SCHED.  the old spl/simple_lock code ran at
  splsched(), and this significantly helps with stability under load when
  running with multiple active CPUs
- in strayintr() don't print about stray zs inters in MP case
- fix a deadlock in xcall()
- consolidate the interrupt evcnt(9) into a full set of per-IPL per-CPU
  soft/hard counters
- fix xcall() failure messages in some cases
- addd new ddb command mach xcall
- use schedintr() (not schedintr_4m()) on MP or single CPU configurations
- call hardclock() the same way on cpu0 in MP and !MP cases
- request the appropriate stack space for nmi_sun4m, in particular,
  make sure we have space for %g2...%g5.  now entering ddb via eg,
  serial break no longer causes cpu1 to fault.
- give memfault_sun*() some entry points that both gdb and ddb will find.
from tsutsui:
- fix panic in interrupt handlers in zs


To generate a diff of this commit:
cvs rdiff -u -r1.111.6.3 -r1.111.6.4 src/sys/arch/sparc/dev/zs.c
cvs rdiff -u -r1.84.14.1 -r1.84.14.2 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.9 -r1.9.14.1 src/sys/arch/sparc/include/z8530var.h
cvs rdiff -u -r1.211.8.4 -r1.211.8.5 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.75.10.4 -r1.75.10.5 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.79.4.2 -r1.79.4.3 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.56.4.1 -r1.56.4.2 src/sys/arch/sparc/sparc/genassym.cf
cvs rdiff -u -r1.100.20.2 -r1.100.20.3 src/sys/arch/sparc/sparc/intr.c
cvs rdiff -u -r1.244.8.3 -r1.244.8.4 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.282.4.3 -r1.282.4.4 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.23 -r1.23.28.1 src/sys/arch/sparc/sparc/timer.c
cvs rdiff -u -r1.16.56.2 -r1.16.56.3 src/sys/arch/sparc/sparc/timer_sun4m.c
cvs rdiff -u -r1.8 -r1.8.74.1 src/sys/arch/sparc/sparc/timervar.h
cvs rdiff -u -r1.176 -r1.176.4.1 src/sys/arch/sparc/sparc/trap.c
cvs rdiff -u -r1.95.4.2 -r1.95.4.3 src/sys/arch/sparc/sparc/vm_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/sparc/dev/zs.c
diff -u src/sys/arch/sparc/dev/zs.c:1.111.6.3 src/sys/arch/sparc/dev/zs.c:1.111.6.4
--- src/sys/arch/sparc/dev/zs.c:1.111.6.3	Sun Jan 16 12:54:42 2011
+++ src/sys/arch/sparc/dev/zs.c	Tue Mar  8 17:29:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.111.6.3 2011/01/16 12:54:42 bouyer Exp $	*/
+/*	$NetBSD: zs.c,v 1.111.6.4 2011/03/08 17:29:45 riz Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: zs.c,v 1.111.6.3 2011/01/16 12:54:42 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: zs.c,v 1.111.6.4 2011/03/08 17:29:45 riz Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -171,12 +171,8 @@
 
 extern struct cfdriver zs_cd;
 
-/* softintr(9) cookie, shared by all instances of this driver */
-static void *zs_sicookie;
-
 /* Interrupt handlers. */
 static int zshard(void *);
-static void zssoft(void *);
 
 static int zs_get_speed(struct zs_chanstate *);
 
@@ -396,7 +392,6 @@
 	struct zsc_attach_args zsc_args;
 	struct zs_chanstate *cs;
 	int channel;
-	static int didintr, prevpri;
 #if (NKBD  0) || (NMS  0)
 	int ch0_is_cons = 0;
 #endif
@@ -407,12 +402,11 @@
 		return;
 	}
 
-	if (!didintr) {
-		zs_sicookie = softint_establish(SOFTINT_SERIAL, zssoft, NULL);
-		if (zs_sicookie == NULL) {
-			aprint_error(: cannot establish soft int handler\n);
-			return;
-		}
+	zsc-zsc_sicookie = softint_establish(SOFTINT_SERIAL,
+	(void (*)(void *))zsc_intr_soft, zsc);
+	if (zsc-zsc_sicookie == NULL) {
+		aprint_error(: 

CVS commit: [netbsd-5] src

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:38:31 UTC 2011

Modified Files:
src/distrib/sets/lists/base [netbsd-5]: mi
src/etc/mtree [netbsd-5]: NetBSD.dist

Log Message:
Pull up following revision(s) (requested by spz in ticket #1566):
distrib/sets/lists/base/mi: revision 1.881 via patch
etc/mtree/NetBSD.dist: patch
add the keys directory to base.
add keys directory


To generate a diff of this commit:
cvs rdiff -u -r1.780.2.18 -r1.780.2.19 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.385.2.5 -r1.385.2.6 src/etc/mtree/NetBSD.dist

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.780.2.18 src/distrib/sets/lists/base/mi:1.780.2.19
--- src/distrib/sets/lists/base/mi:1.780.2.18	Wed Feb 16 19:27:15 2011
+++ src/distrib/sets/lists/base/mi	Tue Mar  8 17:38:30 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.780.2.18 2011/02/16 19:27:15 bouyer Exp $
+# $NetBSD: mi,v 1.780.2.19 2011/03/08 17:38:30 riz Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -4943,6 +4943,7 @@
 ./var/chroot/named/etcbase-bind-root
 ./var/chroot/named/etc/namedb			base-bind-root
 ./var/chroot/named/etc/namedb/cache		base-bind-root
+./var/chroot/named/etc/namedb/keys		base-bind-root
 ./var/chroot/named/usrbase-bind-root
 ./var/chroot/named/usr/libexec			base-bind-root
 ./var/chroot/named/varbase-bind-root

Index: src/etc/mtree/NetBSD.dist
diff -u src/etc/mtree/NetBSD.dist:1.385.2.5 src/etc/mtree/NetBSD.dist:1.385.2.6
--- src/etc/mtree/NetBSD.dist:1.385.2.5	Sat Oct 10 19:53:24 2009
+++ src/etc/mtree/NetBSD.dist	Tue Mar  8 17:38:31 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist,v 1.385.2.5 2009/10/10 19:53:24 sborrill Exp $
+#	$NetBSD: NetBSD.dist,v 1.385.2.6 2011/03/08 17:38:31 riz Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1431,6 +1431,7 @@
 ./var/chroot/named/etc
 ./var/chroot/named/etc/namedb
 ./var/chroot/named/etc/namedb/cache	mode=0775 uname=named gname=named
+./var/chroot/named/etc/namedb/keys	mode=0775 uname=named gname=named
 ./var/chroot/named/usr
 ./var/chroot/named/usr/libexec
 ./var/chroot/named/var



CVS commit: [netbsd-5-1] src

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:43:10 UTC 2011

Modified Files:
src/distrib/sets/lists/base [netbsd-5-1]: mi
src/etc/mtree [netbsd-5-1]: NetBSD.dist

Log Message:
Pull up following revision(s) (requested by spz in ticket #1566):
distrib/sets/lists/base/mi: revision 1.881 via patch
etc/mtree/NetBSD.dist: patch
add the keys directory to base.
add keys directory


To generate a diff of this commit:
cvs rdiff -u -r1.780.2.16.2.1 -r1.780.2.16.2.2 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.385.2.5 -r1.385.2.5.2.1 src/etc/mtree/NetBSD.dist

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.780.2.16.2.1 src/distrib/sets/lists/base/mi:1.780.2.16.2.2
--- src/distrib/sets/lists/base/mi:1.780.2.16.2.1	Sun Jan  9 20:42:43 2011
+++ src/distrib/sets/lists/base/mi	Tue Mar  8 17:43:08 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.780.2.16.2.1 2011/01/09 20:42:43 riz Exp $
+# $NetBSD: mi,v 1.780.2.16.2.2 2011/03/08 17:43:08 riz Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -4942,6 +4942,7 @@
 ./var/chroot/named/etcbase-bind-root
 ./var/chroot/named/etc/namedb			base-bind-root
 ./var/chroot/named/etc/namedb/cache		base-bind-root
+./var/chroot/named/etc/namedb/keys		base-bind-root
 ./var/chroot/named/usrbase-bind-root
 ./var/chroot/named/usr/libexec			base-bind-root
 ./var/chroot/named/varbase-bind-root

Index: src/etc/mtree/NetBSD.dist
diff -u src/etc/mtree/NetBSD.dist:1.385.2.5 src/etc/mtree/NetBSD.dist:1.385.2.5.2.1
--- src/etc/mtree/NetBSD.dist:1.385.2.5	Sat Oct 10 19:53:24 2009
+++ src/etc/mtree/NetBSD.dist	Tue Mar  8 17:43:09 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist,v 1.385.2.5 2009/10/10 19:53:24 sborrill Exp $
+#	$NetBSD: NetBSD.dist,v 1.385.2.5.2.1 2011/03/08 17:43:09 riz Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1431,6 +1431,7 @@
 ./var/chroot/named/etc
 ./var/chroot/named/etc/namedb
 ./var/chroot/named/etc/namedb/cache	mode=0775 uname=named gname=named
+./var/chroot/named/etc/namedb/keys	mode=0775 uname=named gname=named
 ./var/chroot/named/usr
 ./var/chroot/named/usr/libexec
 ./var/chroot/named/var



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

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:43:34 UTC 2011

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

Log Message:
Ticket 1566.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-5.1.1

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

Modified files:

Index: src/doc/CHANGES-5.1.1
diff -u src/doc/CHANGES-5.1.1:1.1.2.14 src/doc/CHANGES-5.1.1:1.1.2.15
--- src/doc/CHANGES-5.1.1:1.1.2.14	Mon Mar  7 17:11:52 2011
+++ src/doc/CHANGES-5.1.1	Tue Mar  8 17:43:34 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.1,v 1.1.2.14 2011/03/07 17:11:52 snj Exp $
+# $NetBSD: CHANGES-5.1.1,v 1.1.2.15 2011/03/08 17:43:34 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.1.1
 release:
@@ -2274,3 +2274,9 @@
 	Sanitize arguments before memory allocation.
 	[joerg, ticket #1575]
 
+distrib/sets/lists/base/mi			1.881 via patch
+etc/mtree/NetBSD.distpatch
+
+	Add keys directory for recently updated BIND.
+	[spz, ticket #1566]
+



CVS commit: [netbsd-5-0] src

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:43:51 UTC 2011

Modified Files:
src/distrib/sets/lists/base [netbsd-5-0]: mi
src/etc/mtree [netbsd-5-0]: NetBSD.dist

Log Message:
Pull up following revision(s) (requested by spz in ticket #1566):
distrib/sets/lists/base/mi: revision 1.881 via patch
etc/mtree/NetBSD.dist: patch
add the keys directory to base.
add keys directory


To generate a diff of this commit:
cvs rdiff -u -r1.780.2.6.2.2 -r1.780.2.6.2.3 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.385.2.1 -r1.385.2.1.2.1 src/etc/mtree/NetBSD.dist

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.780.2.6.2.2 src/distrib/sets/lists/base/mi:1.780.2.6.2.3
--- src/distrib/sets/lists/base/mi:1.780.2.6.2.2	Mon Jan 10 00:40:34 2011
+++ src/distrib/sets/lists/base/mi	Tue Mar  8 17:43:50 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.780.2.6.2.2 2011/01/10 00:40:34 riz Exp $
+# $NetBSD: mi,v 1.780.2.6.2.3 2011/03/08 17:43:50 riz Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -4887,6 +4887,7 @@
 ./var/chroot/named/etcbase-bind-root
 ./var/chroot/named/etc/namedb			base-bind-root
 ./var/chroot/named/etc/namedb/cache		base-bind-root
+./var/chroot/named/etc/namedb/keys		base-bind-root
 ./var/chroot/named/usrbase-bind-root
 ./var/chroot/named/usr/libexec			base-bind-root
 ./var/chroot/named/varbase-bind-root

Index: src/etc/mtree/NetBSD.dist
diff -u src/etc/mtree/NetBSD.dist:1.385.2.1 src/etc/mtree/NetBSD.dist:1.385.2.1.2.1
--- src/etc/mtree/NetBSD.dist:1.385.2.1	Thu Jan 15 03:24:06 2009
+++ src/etc/mtree/NetBSD.dist	Tue Mar  8 17:43:51 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist,v 1.385.2.1 2009/01/15 03:24:06 snj Exp $
+#	$NetBSD: NetBSD.dist,v 1.385.2.1.2.1 2011/03/08 17:43:51 riz Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1424,6 +1424,7 @@
 ./var/chroot/named/etc
 ./var/chroot/named/etc/namedb
 ./var/chroot/named/etc/namedb/cache	mode=0775 uname=named gname=named
+./var/chroot/named/etc/namedb/keys	mode=0775 uname=named gname=named
 ./var/chroot/named/usr
 ./var/chroot/named/usr/libexec
 ./var/chroot/named/var



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

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:44:17 UTC 2011

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

Log Message:
Ticket 1566.


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

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

Modified files:

Index: src/doc/CHANGES-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.28 src/doc/CHANGES-5.0.3:1.1.2.29
--- src/doc/CHANGES-5.0.3:1.1.2.28	Mon Mar  7 17:12:40 2011
+++ src/doc/CHANGES-5.0.3	Tue Mar  8 17:44:16 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.28 2011/03/07 17:12:40 snj Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.29 2011/03/08 17:44:16 riz Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -2582,3 +2582,9 @@
 	Sanitize arguments before memory allocation.
 	[joerg, ticket #1575]
 
+distrib/sets/lists/base/mi			1.881 via patch
+etc/mtree/NetBSD.distpatch
+
+	Add keys directory for recently updated BIND.
+	[spz, ticket #1566]
+



CVS commit: [netbsd-5] src

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:47:59 UTC 2011

Modified Files:
src [netbsd-5]: BUILDING Makefile

Log Message:
Pull up following revision(s) (requested by jym in ticket #1565):
Makefile: revision 1.282 via patch
BUILDING: revision 1.92 via patch
Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.
$ ./build.sh -V INSTALLSETS=base etc install=idir
should now work as expected.
Reviewed by apb@ on tech-toolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.3 -r1.78.2.4 src/BUILDING
cvs rdiff -u -r1.262.2.4 -r1.262.2.5 src/Makefile

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

Modified files:

Index: src/BUILDING
diff -u src/BUILDING:1.78.2.3 src/BUILDING:1.78.2.4
--- src/BUILDING:1.78.2.3	Mon May 11 19:40:22 2009
+++ src/BUILDING	Tue Mar  8 17:47:59 2011
@@ -521,9 +521,10 @@
ing.
 
The INSTALLSETS environment variable may be set to a list
-   of distribution sets to be installed.  By default, all sets
-   except ``etc'' and ``xetc'' are installed, so most files in
-   INSTALLWORLDDIR/etc will not be installed or modified.
+   of distribution sets to be installed, separated by spaces.
+   By default, all sets except ``etc'' and ``xetc'' are
+   extracted, so most files in INSTALLWORLDDIR/etc will not
+   be installed or modified.
 
Note: Before performing this operation with
INSTALLWORLDDIR=/, it is highly recommended that you
@@ -657,7 +658,8 @@
 
  install=idir  Install the contents of DESTDIR to idir, using ``make
installworld''.  Note that files that are part of the
-   ``etc'' or ``xetc'' sets will not be installed.
+   ``etc'' or ``xetc'' sets will not be installed, unless
+   overridden by the INSTALLSETS environment variable.
 
  kernel=kconf  Build a new kernel.  The kconf argument is the name of a
configuration file suitable for use by config(1).  If kconf

Index: src/Makefile
diff -u src/Makefile:1.262.2.4 src/Makefile:1.262.2.5
--- src/Makefile:1.262.2.4	Thu Jan  6 05:19:54 2011
+++ src/Makefile	Tue Mar  8 17:47:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.262.2.4 2011/01/06 05:19:54 riz Exp $
+#	$NetBSD: Makefile,v 1.262.2.5 2011/03/08 17:47:59 riz Exp $
 
 #
 # This is the top-level makefile for building NetBSD. For an outline of
@@ -320,7 +320,7 @@
 .endif
 .endif
 	${MAKEDIRTARGET} distrib/sets installsets \
-	INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=
+		INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
 	${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
 	@echo   make ${.TARGET} started at:  ${START_TIME}
 	@printf make ${.TARGET} finished at:   date



CVS commit: [netbsd-5] src/doc

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:49:23 UTC 2011

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

Log Message:
Tickets 1561-1566.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.65 -r1.1.2.66 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.65 src/doc/CHANGES-5.2:1.1.2.66
--- src/doc/CHANGES-5.2:1.1.2.65	Mon Mar  7 18:58:30 2011
+++ src/doc/CHANGES-5.2	Tue Mar  8 17:49:22 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.65 2011/03/07 18:58:30 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.66 2011/03/08 17:49:22 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -4789,3 +4789,50 @@
 	Fix trouble with Composite and DAMAGE extensions.
 	[jmcneill, ticket #1558]
 
+sbin/disklabel/Makefile1.67
+
+	Disable COMPAT_386BSD_MBRPART.  PR#44496.
+	[dholland, ticket #1561]
+
+sys/dev/usb/if_rum.c1.34
+
+	On failure setting up the rx list, clean _it_ up, not the tx list.
+	[dholland, ticket #1562]
+
+dist/atf/tests/atf/tools/t_atf_config.sh	patch
+lib/libatf-c/Makefilepatch
+
+	Fix the values of atf_arch and atf_machine.  Addresses PR bin/44305.
+	[jmmv, ticket #1563]
+
+sys/arch/sparc/dev/zs.cpatch
+sys/arch/sparc/include/cpu.h			patch
+sys/arch/sparc/include/z8530var.h		patch
+sys/arch/sparc/sparc/cpu.c			patch
+sys/arch/sparc/sparc/cpuvar.h			patch
+sys/arch/sparc/sparc/db_interface.c		patch
+sys/arch/sparc/sparc/genassym.cf		patch
+sys/arch/sparc/sparc/intr.c			patch
+sys/arch/sparc/sparc/locore.s			patch
+sys/arch/sparc/sparc/machdep.c			patch
+sys/arch/sparc/sparc/timer.c			patch
+sys/arch/sparc/sparc/timer_sun4m.c		patch
+sys/arch/sparc/sparc/timervar.h			patch
+sys/arch/sparc/sparc/trap.c			patch
+sys/arch/sparc/sparc/vm_machdep.c		patch
+
+	Improve the stability of sparc SMP.
+	[mrg, ticket #1564]
+
+distrib/sets/lists/base/mi			1.881 via patch
+etc/mtree/NetBSD.distpatch
+
+	Add keys directory for recently updated BIND.
+	[spz, ticket #1566]
+
+BUILDING	1.92 via patch
+Makefile	1.282 via patch
+
+	Pass down INSTALLSETS variable to installsets target.
+	[jym, ticket #1565]
+



CVS commit: src/lib/librumpclient

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 18:25:16 UTC 2011

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
lint love


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/librumpclient/rumpclient.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/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.40 src/lib/librumpclient/rumpclient.c:1.41
--- src/lib/librumpclient/rumpclient.c:1.40	Tue Mar  8 15:55:12 2011
+++ src/lib/librumpclient/rumpclient.c	Tue Mar  8 18:25:16 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.40 2011/03/08 15:55:12 pooka Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.41 2011/03/08 18:25:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpclient.c,v 1.40 2011/03/08 15:55:12 pooka Exp $);
+__RCSID($NetBSD: rumpclient.c,v 1.41 2011/03/08 18:25:16 pooka Exp $);
 
 #include sys/param.h
 #include sys/event.h
@@ -920,6 +920,7 @@
 	return 0;
 }
 
+/*ARGUSED*/
 void
 rumpclient_fork_cancel(struct rumpclient_fork *rpf)
 {



CVS commit: src/lib/librumpclient

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 18:28:02 UTC 2011

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
and for my next trick, i'm going to spell ARGSUSED correctly


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/librumpclient/rumpclient.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/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.41 src/lib/librumpclient/rumpclient.c:1.42
--- src/lib/librumpclient/rumpclient.c:1.41	Tue Mar  8 18:25:16 2011
+++ src/lib/librumpclient/rumpclient.c	Tue Mar  8 18:28:01 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.41 2011/03/08 18:25:16 pooka Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.42 2011/03/08 18:28:01 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpclient.c,v 1.41 2011/03/08 18:25:16 pooka Exp $);
+__RCSID($NetBSD: rumpclient.c,v 1.42 2011/03/08 18:28:01 pooka Exp $);
 
 #include sys/param.h
 #include sys/event.h
@@ -920,7 +920,7 @@
 	return 0;
 }
 
-/*ARGUSED*/
+/*ARGSUSED*/
 void
 rumpclient_fork_cancel(struct rumpclient_fork *rpf)
 {



CVS commit: src/sys/kern

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 18:29:50 UTC 2011

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

Log Message:
Include syscall.h and syscallargs.h from srcsys instead of sys
in the RUMP_CLIENT case.  This makes librumpclient compile against
-current sources regardless of host.

inspired by Taylor R Campbell


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

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

Modified files:

Index: src/sys/kern/makesyscalls.sh
diff -u src/sys/kern/makesyscalls.sh:1.116 src/sys/kern/makesyscalls.sh:1.117
--- src/sys/kern/makesyscalls.sh:1.116	Tue Feb 22 14:08:58 2011
+++ src/sys/kern/makesyscalls.sh	Tue Mar  8 18:29:49 2011
@@ -1,5 +1,5 @@
 #! /bin/sh -
-#	$NetBSD: makesyscalls.sh,v 1.116 2011/02/22 14:08:58 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.117 2011/03/08 18:29:49 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -220,15 +220,17 @@
 	printf #include sys/param.h\n  rumpcalls
 	printf #include sys/fstypes.h\n  rumpcalls
 	printf #include sys/proc.h\n  rumpcalls
-	printf #include sys/syscall.h\n  rumpcalls
-	printf #include sys/syscallargs.h\n\n  rumpcalls
 	printf #ifdef RUMP_CLIENT\n  rumpcalls
+	printf #include srcsys/syscall.h\n  rumpcalls
+	printf #include srcsys/syscallargs.h\n\n  rumpcalls
 	printf #include errno.h\n  rumpcalls
 	printf #include rump/rumpclient.h\n\n  rumpcalls
 	printf #define rsys_syscall(num, data, dlen, retval)\t\\\n  rumpcalls
 	printf rumpclient_syscall(num, data, dlen, retval)\n  rumpcalls
 	printf #define rsys_seterrno(error) errno = error\n  rumpcalls
 	printf #define rsys_alias(a,b)\n#else\n  rumpcalls
+	printf #include sys/syscall.h\n  rumpcalls
+	printf #include sys/syscallargs.h\n\n  rumpcalls
 	printf #include sys/syscallvar.h\n\n  rumpcalls
 	printf #include rump/rumpuser.h\n  rumpcalls
 	printf #include \rump_private.h\\n\n  rumpcalls



CVS commit: src/lib/librumpclient

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 18:30:24 UTC 2011

Modified Files:
src/lib/librumpclient: Makefile

Log Message:
create srcsys symlink


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/librumpclient/Makefile

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

Modified files:

Index: src/lib/librumpclient/Makefile
diff -u src/lib/librumpclient/Makefile:1.5 src/lib/librumpclient/Makefile:1.6
--- src/lib/librumpclient/Makefile:1.5	Tue Feb 22 17:32:49 2011
+++ src/lib/librumpclient/Makefile	Tue Mar  8 18:30:24 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2011/02/22 17:32:49 tron Exp $
+#	$NetBSD: Makefile,v 1.6 2011/03/08 18:30:24 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../sys/rump/librump/rumpkern
@@ -16,6 +16,14 @@
 SRCS=		rumpclient.c
 SRCS+=		rump_syscalls.c
 
+CLEANFILES+=	srcsys
+
 COPTS.rump_syscalls.c+= -fno-strict-aliasing
 
+.if !make(obj)  !make(clean)  !make(cleandir)
+.BEGIN:
+	@rm -f srcsys
+	@ln -s ${NETBSDSRCDIR}/sys/sys srcsys
+.endif
+
 .include bsd.lib.mk



CVS commit: src/sys/rump

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 18:31:11 UTC 2011

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

Log Message:
regen: include rumpclient syscall headers from source tree instead of host


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.70 -r1.71 src/sys/rump/librump/rumpkern/rump_syscalls.c

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

Modified files:

Index: src/sys/rump/include/rump/rump_syscalls.h
diff -u src/sys/rump/include/rump/rump_syscalls.h:1.48 src/sys/rump/include/rump/rump_syscalls.h:1.49
--- src/sys/rump/include/rump/rump_syscalls.h:1.48	Sun Mar  6 17:08:37 2011
+++ src/sys/rump/include/rump/rump_syscalls.h	Tue Mar  8 18:31:11 2011
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_syscalls.h,v 1.48 2011/03/06 17:08:37 bouyer Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.49 2011/03/08 18:31:11 pooka Exp $ */
 
 /*
  * System call protos in rump namespace.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD
+ * created from	NetBSD: syscalls.master,v 1.246 2011/03/06 17:08:36 bouyer Exp
  */
 
 #ifndef _RUMP_RUMP_SYSCALLS_H_

Index: src/sys/rump/librump/rumpkern/rump_syscalls.c
diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.70 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.71
--- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.70	Sun Mar  6 17:08:37 2011
+++ src/sys/rump/librump/rumpkern/rump_syscalls.c	Tue Mar  8 18:31:11 2011
@@ -1,22 +1,22 @@
-/* $NetBSD: rump_syscalls.c,v 1.70 2011/03/06 17:08:37 bouyer Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.71 2011/03/08 18:31:11 pooka Exp $ */
 
 /*
  * System call vector and marshalling for rump.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD
+ * created from	NetBSD: syscalls.master,v 1.246 2011/03/06 17:08:36 bouyer Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.70 2011/03/06 17:08:37 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_syscalls.c,v 1.71 2011/03/08 18:31:11 pooka Exp $);
 
 #include sys/param.h
 #include sys/fstypes.h
 #include sys/proc.h
-#include sys/syscall.h
-#include sys/syscallargs.h
-
 #ifdef RUMP_CLIENT
+#include srcsys/syscall.h
+#include srcsys/syscallargs.h
+
 #include errno.h
 #include rump/rumpclient.h
 
@@ -25,6 +25,9 @@
 #define rsys_seterrno(error) errno = error
 #define rsys_alias(a,b)
 #else
+#include sys/syscall.h
+#include sys/syscallargs.h
+
 #include sys/syscallvar.h
 
 #include rump/rumpuser.h



CVS commit: src/sys/rump/include/rump

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 18:35:10 UTC 2011

Modified Files:
src/sys/rump/include/rump: rump.h

Log Message:
g/c old-style syscall selection method


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/rump/include/rump/rump.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/rump/include/rump/rump.h
diff -u src/sys/rump/include/rump/rump.h:1.50 src/sys/rump/include/rump/rump.h:1.51
--- src/sys/rump/include/rump/rump.h:1.50	Sun Jan  2 12:52:25 2011
+++ src/sys/rump/include/rump/rump.h	Tue Mar  8 18:35:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.h,v 1.50 2011/01/02 12:52:25 pooka Exp $	*/
+/*	$NetBSD: rump.h,v 1.51 2011/03/08 18:35:10 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -125,81 +125,4 @@
 _END_DECLS
 #endif
 
-/*
- * Begin rump syscall conditionals.  Yes, something a little better
- * is required here.
- */
-#ifdef RUMP_SYS_NETWORKING
-#define socket(a,b,c) rump_sys_socket(a,b,c)
-#define accept(a,b,c) rump_sys_accept(a,b,c)
-#define bind(a,b,c) rump_sys_bind(a,b,c)
-#define connect(a,b,c) rump_sys_connect(a,b,c)
-#define getpeername(a,b,c) rump_sys_getpeername(a,b,c)
-#define getsockname(a,b,c) rump_sys_getsockname(a,b,c)
-#define listen(a,b) rump_sys_listen(a,b)
-#define recvfrom(a,b,c,d,e,f) rump_sys_recvfrom(a,b,c,d,e,f)
-#define recvmsg(a,b,c) rump_sys_recvmsg(a,b,c)
-#define sendto(a,b,c,d,e,f) rump_sys_sendto(a,b,c,d,e,f)
-#define sendmsg(a,b,c) rump_sys_sendmsg(a,b,c)
-#define getsockopt(a,b,c,d,e) rump_sys_getsockopt(a,b,c,d,e)
-#define setsockopt(a,b,c,d,e) rump_sys_setsockopt(a,b,c,d,e)
-#define shutdown(a,b) rump_sys_shutdown(a,b)
-#endif /* RUMP_SYS_NETWORKING */
-
-#ifdef RUMP_SYS_IOCTL
-#define ioctl(...) rump_sys_ioctl(__VA_ARGS__)
-#define fnctl(...) rump_sys_fcntl(__VA_ARGS__)
-#endif /* RUMP_SYS_IOCTL */
-
-#ifdef RUMP_SYS_CLOSE
-#define close(a) rump_sys_close(a)
-#endif /* RUMP_SYS_CLOSE */
-
-#ifdef RUMP_SYS_OPEN
-#define open(...) rump_sys_open(__VA_ARGS__)
-#endif /* RUMP_SYS_OPEN */
-
-#ifdef RUMP_SYS_READWRITE
-#define read(a,b,c) rump_sys_read(a,b,c)
-#define readv(a,b,c) rump_sys_readv(a,b,c)
-#define pread(a,b,c,d) rump_sys_pread(a,b,c,d)
-#define preadv(a,b,c,d) rump_sys_preadv(a,b,c,d)
-#define write(a,b,c) rump_sys_write(a,b,c)
-#define writev(a,b,c) rump_sys_writev(a,b,c)
-#define pwrite(a,b,c,d) rump_sys_pwrite(a,b,c,d)
-#define pwritev(a,b,c,d) rump_sys_pwritev(a,b,c,d)
-#endif /* RUMP_SYS_READWRITE */
-
-#ifdef RUMP_SYS_FILEOPS
-#define mkdir(a,b) rump_sys_mkdir(a,b)
-#define rmdir(a) rump_sys_rmdir(a)
-#define link(a,b) rump_sys_link(a,b)
-#define symlink(a,b) rump_sys_symlink(a,b)
-#define unlink(a) rump_sys_unlink(a)
-#define readlink(a,b,c) rump_sys_readlink(a,b,c)
-#define chdir(a) rump_sys_chdir(a)
-#define fsync(a) rump_sys_fsync(a)
-#define sync() rump_sys_sync()
-#define chown(a,b,c) rump_sys_chown(a,b,c)
-#define fchown(a,b,c) rump_sys_fchown(a,b,c)
-#define lchown(a,b,c) rump_sys_lchown(a,b,c)
-#define lseek(a,b,c) rump_sys_lseek(a,b,c)
-#define mknod(a,b,c) rump_sys_mknod(a,b,c)
-#define rename(a,b) rump_sys_rename(a,b)
-#define truncate(a,b) rump_sys_truncate(a,b)
-#define ftruncate(a,b) rump_sys_ftruncate(a,b)
-#define umask(a) rump_sys_umask(a)
-#define getdents(a,b,c) rump_sys_getdents(a,b,c)
-#endif /* RUMP_SYS_FILEOPS */
-
-#ifdef RUMP_SYS_STAT
-#define stat(a,b) rump_sys_stat(a,b)
-#define fstat(a,b) rump_sys_fstat(a,b)
-#define lstat(a,b) rump_sys_lstat(a,b)
-#endif /* RUMP_SYS_STAT */
-
-#ifdef RUMP_SYS_PROCOPS
-#define getpid() rump_sys_getpid()
-#endif /* RUMP_SYS_PROCOPS */
-
 #endif /* _RUMP_RUMP_H_ */



CVS commit: src/sys/arch/sandpoint/stand/altboot

2011-03-08 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Mar  8 19:00:39 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: stg.c

Log Message:
Driver seems to work now. Successfully booted a kernel via BOOTP and NFS on
an ST1023-compatible IC+ IP1000A chip.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sandpoint/stand/altboot/stg.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/sandpoint/stand/altboot/stg.c
diff -u src/sys/arch/sandpoint/stand/altboot/stg.c:1.1 src/sys/arch/sandpoint/stand/altboot/stg.c:1.2
--- src/sys/arch/sandpoint/stand/altboot/stg.c:1.1	Sun Mar  6 13:55:12 2011
+++ src/sys/arch/sandpoint/stand/altboot/stg.c	Tue Mar  8 19:00:38 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: stg.c,v 1.1 2011/03/06 13:55:12 phx Exp $ */
+/* $NetBSD: stg.c,v 1.2 2011/03/08 19:00:38 phx Exp $ */
 
 /*-
  * Copyright (c) 2011 Frank Wille.
@@ -52,17 +52,15 @@
 #define ALLOC(T,A)		(T *)allocaligned(sizeof(T),(A))
 
 struct desc {
-	uint64_t xd0, xd1, xd2;
+	uint64_t xd0, xd1, xd2, dummy;
 };
-/* xd1 */
-#define RXLEN(x)		((x)  0x)
-#define RXERRORMASK		0x3fLL
-#define TXNOALIGN		(1ULL  16)
-#define TXFRAGCOUNT(x)		(((uint64_t)((x)  0xf))  48)
-#define DONE			(1ULL  31)
-/* xd2 */
-#define FRAGADDR(x)		((uint64_t)(x))
-#define FRAGLEN(x)		(((uint64_t)((x)  0x))  48)
+#define T1_EMPTY		(1U  31)	/* no Tx frame available */
+#define T1_NOALIGN		(03  16)	/* allow any Tx alignment */
+#define T1_CNTSHIFT		24		/* Tx fragment count */
+#define T2_LENSHIFT		48		/* Tx frame length */
+#define R1_DONE			(1U  31)	/* desc has a Rx frame */
+#define R1_FL_MASK		0x		/* Rx frame length */
+#define R1_ER_MASK		0x3f	/* Rx error indication */
 
 #define STGE_DMACtrl		0x00
 #define  DMAC_RxDMAComplete	(1U  3)
@@ -73,6 +71,7 @@
 #define STGE_TFDListPtrHi	0x14
 #define STGE_RFDListPtrLo	0x1c
 #define STGE_RFDListPtrHi	0x20
+#define STGE_DebugCtrl		0x2c
 #define STGE_AsicCtrl		0x30
 #define  AC_PhyMedia		(1U  7)
 #define  AC_GlobalReset		(1U  16)
@@ -93,6 +92,8 @@
 #define  EC_EepromBusy		(1U  15)
 #define STGE_IntEnable		0x5c
 #define STGE_MACCtrl		0x6c
+#define  MC_DuplexSelect	(1U  5)
+#define  MC_StatisticsDisable	(1U  22)
 #define  MC_TxEnable		(1U  24)
 #define  MC_RxEnable		(1U  27)
 #define STGE_PhyCtrl		0x76
@@ -110,18 +111,17 @@
 #define STGE_StationAddress0	0x78
 #define STGE_StationAddress1	0x7a
 #define STGE_StationAddress2	0x7c
+#define STGE_MaxFrameSize	0x84
+#define STGE_ReceiveMode	0x88
+#define  RM_ReceiveUnicast	(1U  0)
+#define  RM_ReceiveMulticast	(1U  1)
+#define  RM_ReceiveBroadcast	(1U  2)
+#define  RM_ReceiveAllFrames	(1U  3)
+#define  RM_ReceiveMulticastHash (1U  4)
+#define  RM_ReceiveIPMulticast	(1U  5)
 
 #define STGE_EEPROM_SA0		0x10
 
-#define MII_PSSR		0x11	/* MAKPHY status register */
-#define  PSSR_DUPLEX		0x2000	/* FDX */
-#define  PSSR_RESOLVED		0x0800	/* speed and duplex resolved */
-#define  PSSR_LINK		0x0400  /* link indication */
-#define  PSSR_SPEED(x)		(((x)  14)  0x3)
-#define  SPEED10		0
-#define  SPEED100		1
-#define  SPEED1000 		2
-
 #define FRAMESIZE	1536
 
 struct local {
@@ -162,7 +162,7 @@
 	struct desc *txd, *rxd;
 	uint8_t *en;
 	unsigned i;
-	uint32_t reg;
+	uint32_t macctl, reg;
 
 	l = ALLOC(struct local, 32);		/* desc alignment */
 	memset(l, 0, sizeof(struct local));
@@ -231,6 +231,43 @@
 	DPRINTF((PHY %d (%04x.%04x)\n, l-phy,
 	mii_read(l, l-phy, 2), mii_read(l, l-phy, 3)));
 
+	/* setup descriptors */
+	txd = l-txd[0];
+	txd[0].xd0 = htole64(VTOPHYS(txd[1]));
+	txd[0].xd1 = htole64(T1_EMPTY);
+	txd[1].xd0 = htole64(VTOPHYS(txd[0]));
+	txd[1].xd1 = htole64(T1_EMPTY);
+	rxd = l-rxd[0];
+	rxd[0].xd0 = htole64(VTOPHYS(rxd[1]));
+	rxd[0].xd2 = htole64((uint64_t)VTOPHYS(l-rxstore[0]) |
+	((uint64_t)FRAMESIZE  48));
+	rxd[1].xd0 = htole64(VTOPHYS(rxd[0]));
+	rxd[1].xd2 = htole64((uint64_t)VTOPHYS(l-rxstore[1]) |
+	((uint64_t)FRAMESIZE  48));
+	wbinv(l, sizeof(struct local));
+
+	CSR_WRITE_2(l, STGE_IntEnable, 0);
+	CSR_WRITE_2(l, STGE_ReceiveMode, RM_ReceiveUnicast |
+	RM_ReceiveBroadcast | RM_ReceiveAllFrames | RM_ReceiveMulticast);
+	CSR_WRITE_4(l, STGE_TFDListPtrHi, 0);
+	CSR_WRITE_4(l, STGE_TFDListPtrLo, VTOPHYS(txd));
+	CSR_WRITE_4(l, STGE_RFDListPtrHi, 0);
+	CSR_WRITE_4(l, STGE_RFDListPtrLo, VTOPHYS(rxd));
+	CSR_WRITE_2(l, STGE_MaxFrameSize, FRAMESIZE);
+	CSR_WRITE_4(l, STGE_MACCtrl, 0);	/* do IFSSelect(0) first */
+	macctl = MC_StatisticsDisable | MC_TxEnable | MC_RxEnable;
+
+	if ((pcicfgread(tag, PCI_CLASS_REG)  0xff) = 6) {
+		/* some workarounds for revisions = 6 */
+		CSR_WRITE_2(l, STGE_DebugCtrl,
+		CSR_READ_2(l, STGE_DebugCtrl) | 0x0200);
+		CSR_WRITE_2(l, STGE_DebugCtrl,
+		CSR_READ_2(l, STGE_DebugCtrl) | 0x0010);
+		CSR_WRITE_2(l, STGE_DebugCtrl,
+		CSR_READ_2(l, STGE_DebugCtrl) | 0x0020);
+	}
+
+	/* auto negotiation, set the current media */
 	mii_dealan(l, 5);
 
 	reg = 

CVS commit: src/sys/dev/pci

2011-03-08 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Mar  8 19:06:59 UTC 2011

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

Log Message:
On the ST1023 (and compatible, like IP1000A), the mac-address can also be
passed via device properties, when the serial EEPROM is missing or empty.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_stge.c

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

Modified files:

Index: src/sys/dev/pci/if_stge.c
diff -u src/sys/dev/pci/if_stge.c:1.51 src/sys/dev/pci/if_stge.c:1.52
--- src/sys/dev/pci/if_stge.c:1.51	Sat Nov 13 13:52:07 2010
+++ src/sys/dev/pci/if_stge.c	Tue Mar  8 19:06:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_stge.c,v 1.51 2010/11/13 13:52:07 uebayasi Exp $	*/
+/*	$NetBSD: if_stge.c,v 1.52 2011/03/08 19:06:58 phx Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_stge.c,v 1.51 2010/11/13 13:52:07 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_stge.c,v 1.52 2011/03/08 19:06:58 phx Exp $);
 
 
 #include sys/param.h
@@ -70,6 +70,8 @@
 
 #include dev/pci/if_stgereg.h
 
+#include prop/proplib.h
+
 /* #define	STGE_CU_BUG			1 */
 #define	STGE_VLAN_UNTAG			1
 /* #define	STGE_VLAN_CFI		1 */
@@ -379,6 +381,7 @@
 	bus_space_tag_t iot, memt;
 	bus_space_handle_t ioh, memh;
 	bus_dma_segment_t seg;
+	prop_data_t data;
 	int ioh_valid, memh_valid;
 	int i, rseg, error;
 	const struct stge_product *sp;
@@ -557,13 +560,27 @@
 		STGE_StationAddress2)  8;
 		sc-sc_stge1023 = 0;
 	} else {
-		uint16_t myaddr[ETHER_ADDR_LEN / 2];
-		for (i = 0; i ETHER_ADDR_LEN / 2; i++) {
-			stge_read_eeprom(sc, STGE_EEPROM_StationAddress0 + i, 
-			myaddr[i]);
-			myaddr[i] = le16toh(myaddr[i]);
+		data = prop_dictionary_get(device_properties(self),
+		mac-address);
+		if (data != NULL) {
+			/*
+			 * Try to get the station address from device
+			 * properties first, in case the EEPROM is missing.
+			 */
+			KASSERT(prop_object_type(data) == PROP_TYPE_DATA);
+			KASSERT(prop_data_size(data) == ETHER_ADDR_LEN);
+			(void)memcpy(enaddr, prop_data_data_nocopy(data),
+			ETHER_ADDR_LEN);
+		} else {
+			uint16_t myaddr[ETHER_ADDR_LEN / 2];
+			for (i = 0; i ETHER_ADDR_LEN / 2; i++) {
+stge_read_eeprom(sc, 
+STGE_EEPROM_StationAddress0 + i,
+myaddr[i]);
+myaddr[i] = le16toh(myaddr[i]);
+			}
+			(void)memcpy(enaddr, myaddr, sizeof(enaddr));
 		}
-		(void)memcpy(enaddr, myaddr, sizeof(enaddr));
 		sc-sc_stge1023 = 1;
 	}
 



CVS commit: src/lib/librumpclient

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 19:11:27 UTC 2011

Modified Files:
src/lib/librumpclient: Makefile

Log Message:
need -I${.OBJDIR} now


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/librumpclient/Makefile

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

Modified files:

Index: src/lib/librumpclient/Makefile
diff -u src/lib/librumpclient/Makefile:1.6 src/lib/librumpclient/Makefile:1.7
--- src/lib/librumpclient/Makefile:1.6	Tue Mar  8 18:30:24 2011
+++ src/lib/librumpclient/Makefile	Tue Mar  8 19:11:27 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2011/03/08 18:30:24 pooka Exp $
+#	$NetBSD: Makefile,v 1.7 2011/03/08 19:11:27 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../sys/rump/librump/rumpkern
@@ -12,7 +12,8 @@
 INCS=		rumpclient.h
 INCSDIR=	/usr/include/rump
 
-CPPFLAGS+=	-DRUMP_CLIENT -I${.CURDIR} -I${.CURDIR}/../librumpuser
+CPPFLAGS+=	-DRUMP_CLIENT
+CPPFLAGS+=	-I${.OBJDIR} -I${.CURDIR} -I${.CURDIR}/../librumpuser
 SRCS=		rumpclient.c
 SRCS+=		rump_syscalls.c
 



CVS commit: src/external/bsd/flex/bin

2011-03-08 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Mar  8 19:25:32 UTC 2011

Modified Files:
src/external/bsd/flex/bin: Makefile

Log Message:
source files are scan.l and parse.y

in particular, parse.y was being processed twice.. with one
process leaving a y.tab.h file behind

no need to explicitly add scan.c, parse.c and parse.h to CLEANFILES,
the framework knows they are generated and will remove them


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/flex/bin/Makefile

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

Modified files:

Index: src/external/bsd/flex/bin/Makefile
diff -u src/external/bsd/flex/bin/Makefile:1.8 src/external/bsd/flex/bin/Makefile:1.9
--- src/external/bsd/flex/bin/Makefile:1.8	Wed Apr  7 16:14:35 2010
+++ src/external/bsd/flex/bin/Makefile	Tue Mar  8 19:25:32 2011
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	5.4 (Berkeley) 6/24/90
-#	$NetBSD: Makefile,v 1.8 2010/04/07 16:14:35 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2011/03/08 19:25:32 plunky Exp $
 #
 # By default, flex will be configured to generate 8-bit scanners only if the
 # -8 flag is given.  If you want it to always generate 8-bit scanners, add
@@ -25,9 +25,9 @@
 misc.c \
 nfa.c \
 options.c \
-parse.c \
+parse.y \
 regex.c \
-scan.c \
+scan.l \
 scanflags.c \
 scanopt.c \
 skel.c \
@@ -38,7 +38,7 @@
 yylex.c
 
 YHEADER=1
-CLEANFILES+=scan.c skel.c parse.c parse.h
+CLEANFILES+=skel.c
 INCS	=FlexLexer.h
 INCSDIR=/usr/include/g++
 LDADD+=-lm



CVS commit: [rmind-uvmplock] src/sys/arch/x86/x86

2011-03-08 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Mar  8 20:07:31 UTC 2011

Modified Files:
src/sys/arch/x86/x86 [rmind-uvmplock]: pmap.c

Log Message:
- pmap_remove_ptes: simplify by removing the duplicate code and re-using
  equivalent functionality in pmap_remove_pte().
- pmap_remove_pte: fix assert to allow page owner lock to be unacquired
  if pmap is pmap_kernel(); relevant for UVM_KMF_PAGEABLE memory case.


To generate a diff of this commit:
cvs rdiff -u -r1.105.2.10 -r1.105.2.11 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.105.2.10 src/sys/arch/x86/x86/pmap.c:1.105.2.11
--- src/sys/arch/x86/x86/pmap.c:1.105.2.10	Sat Mar  5 20:52:31 2011
+++ src/sys/arch/x86/x86/pmap.c	Tue Mar  8 20:07:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.105.2.10 2011/03/05 20:52:31 rmind Exp $	*/
+/*	$NetBSD: pmap.c,v 1.105.2.11 2011/03/08 20:07:30 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.105.2.10 2011/03/05 20:52:31 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.105.2.11 2011/03/08 20:07:30 rmind Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -3121,9 +3121,7 @@
 pmap_remove_ptes(struct pmap *pmap, struct vm_page *ptp, vaddr_t ptpva,
 		 vaddr_t startva, vaddr_t endva, struct pv_entry **pv_tofree)
 {
-	struct pv_entry *pve;
-	pt_entry_t *pte = (pt_entry_t *) ptpva;
-	pt_entry_t opte;
+	pt_entry_t *pte = (pt_entry_t *)ptpva;
 
 	KASSERT(pmap == pmap_kernel() || mutex_owned(pmap-pm_lock));
 	KASSERT(kpreempt_disabled());
@@ -3136,74 +3134,16 @@
 	 * and the wire_count is greater than 1 (because we use the wire_count
 	 * to keep track of the number of real PTEs in the PTP).
 	 */
-
-	for (/*null*/; startva  endva  (ptp == NULL || ptp-wire_count  1)
-			 ; pte++, startva += PAGE_SIZE) {
-		struct vm_page *pg;
-		struct pmap_page *pp;
-
-		if (!pmap_valid_entry(*pte))
-			continue;			/* VA not mapped */
-
-		/* atomically save the old PTE and zap! it */
-		opte = pmap_pte_testset(pte, 0);
-		if (!pmap_valid_entry(opte)) {
-			continue;
-		}
-
-		pmap_exec_account(pmap, startva, opte, 0);
-		pmap_stats_update_bypte(pmap, 0, opte);
-
-		if (ptp) {
-			ptp-wire_count--;		/* dropping a PTE */
-			/* Make sure that the PDE is flushed */
-			if (ptp-wire_count = 1)
-opte |= PG_U;
-		}
-
-		if ((opte  PG_U) != 0) {
-			pmap_tlb_shootdown(pmap, startva, opte,
-			TLBSHOOT_REMOVE_PTES);
-		}
-
-		/*
-		 * if we are not on a pv_head list we are done.
-		 */
-
-		if ((opte  PG_PVLIST) == 0) {
-#if defined(DIAGNOSTIC)  !defined(DOM0OPS)
-			if (PHYS_TO_VM_PAGE(pmap_pte2pa(opte)) != NULL)
-panic(pmap_remove_ptes: managed page without 
-  PG_PVLIST for %# PRIxVADDR, startva);
-#endif
-			continue;
-		}
-
-		pg = PHYS_TO_VM_PAGE(pmap_pte2pa(opte));
-
-		KASSERTMSG(pg != NULL, (pmap_remove_ptes: unmanaged page 
-		marked PG_PVLIST, va = %# PRIxVADDR , pa = %# PRIxPADDR,
-		startva, (paddr_t)pmap_pte2pa(opte)));
-
-		KASSERT(uvm_page_locked_p(pg));
-
-		/* sync R/M bits */
-		pp = VM_PAGE_TO_PP(pg);
-		pp-pp_attrs |= opte;
-		pve = pmap_remove_pv(pp, ptp, startva);
-
-		if (pve != NULL) {
-			pve-pve_next = *pv_tofree;
-			*pv_tofree = pve;
-		}
-
-		/* end of for loop: time for next pte */
+	while (startva  endva  (ptp == NULL || ptp-wire_count  1)) {
+		(void)pmap_remove_pte(pmap, ptp, pte, startva, pv_tofree);
+		startva += PAGE_SIZE;
+		pte++;
 	}
 }
 
 
 /*
- * pmap_remove_pte: remove a single PTE from a PTP
+ * pmap_remove_pte: remove a single PTE from a PTP.
  *
  * = caller must hold pmap's lock
  * = PTP must be mapped into KVA
@@ -3211,23 +3151,24 @@
  * = returns true if we removed a mapping
  * = must be called with kernel preemption disabled
  */
-
 static bool
 pmap_remove_pte(struct pmap *pmap, struct vm_page *ptp, pt_entry_t *pte,
 		vaddr_t va, struct pv_entry **pv_tofree)
 {
-	pt_entry_t opte;
 	struct pv_entry *pve;
 	struct vm_page *pg;
 	struct pmap_page *pp;
+	pt_entry_t opte;
 
 	KASSERT(pmap == pmap_kernel() || mutex_owned(pmap-pm_lock));
-	KASSERT(pmap == pmap_kernel() || kpreempt_disabled());
+	KASSERT(kpreempt_disabled());
 
-	if (!pmap_valid_entry(*pte))
-		return(false);		/* VA not mapped */
+	if (!pmap_valid_entry(*pte)) {
+		/* VA not mapped. */
+		return false;
+	}
 
-	/* atomically save the old PTE and zap! it */
+	/* Atomically save the old PTE and zap it. */
 	opte = pmap_pte_testset(pte, 0);
 	if (!pmap_valid_entry(opte)) {
 		return false;
@@ -3237,10 +3178,13 @@
 	pmap_stats_update_bypte(pmap, 0, opte);
 
 	if (ptp) {
-		ptp-wire_count--;		/* dropping a PTE */
-		/* Make sure that the PDE is flushed */
-		if (ptp-wire_count = 1)
+		/*
+		 * Dropping a PTE.  Make sure that the PDE is flushed.
+		 */
+		ptp-wire_count--;
+		

CVS commit: src/lib/librumphijack

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 20:59:02 UTC 2011

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

Log Message:
Add ``blanket''.  It acts like path, except that the prefix does
_not_ get removed if the call goes to the rump namespace.

So, now it's possible to use e.g. tcpdump (and most other utilities
which hardcore a /dev pathname) on a rump kernel:

golem setenv RUMPHIJACK blanket=/dev/bpf
golem tcpdump -n -i virt0
tcpdump: WARNING: SIOCGIFADDR: virt0: Device not configured
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on virt0, link-type EN10MB (Ethernet), capture size 96 bytes
21:55:38.925596 IP 192.168.2.101  204.152.190.12: ICMP echo request, id 47811, 
seq 0, length 64
21:55:39.095596 IP 204.152.190.12  192.168.2.101: ICMP echo reply, id 47811, 
seq 0, length 64

(if you additionally set socket=all in RUMPHIJACK, tcpdump doesn't
whine about the not configured interface)


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/lib/librumphijack/hijack.c
cvs rdiff -u -r1.5 -r1.6 src/lib/librumphijack/rumphijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.74 src/lib/librumphijack/hijack.c:1.75
--- src/lib/librumphijack/hijack.c:1.74	Tue Mar  1 10:54:06 2011
+++ src/lib/librumphijack/hijack.c	Tue Mar  8 20:59:01 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.74 2011/03/01 10:54:06 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.75 2011/03/08 20:59:01 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.74 2011/03/01 10:54:06 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.75 2011/03/08 20:59:01 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -237,8 +237,16 @@
 static int	(*host_execve)(const char *, char *const[], char *const[]);
 static void *	(*host_mmap)(void *, size_t, int, int, int, off_t);
 
-static bool	fd_isrump(int);
-static bool	path_isrump(const char *);
+/*
+ * This tracks if our process is in a subdirectory of /rump.
+ * It's preserved over exec.
+ */
+static bool pwdinrump;
+
+enum pathtype { PATH_HOST, PATH_RUMP, PATH_RUMPBLANKET };
+
+static bool		fd_isrump(int);
+static enum pathtype	path_isrump(const char *);
 
 /*
  * Maintain a mapping table for the usual dup2 suspects.
@@ -381,12 +389,14 @@
 type name args\
 {	\
 	type (*fun) proto;		\
+	enum pathtype pt;		\
 	\
 	DPRINTF((%s - %s (%s)\n, __STRING(name), path,		\
 	whichpath(path)));		\
-	if (path_isrump(path)) {	\
+	if ((pt = path_isrump(path)) != PATH_HOST) {			\
 		fun = syscalls[rcname].bs_rump;\
-		path = path_host2rump(path);\
+		if (pt == PATH_RUMP)	\
+			path = path_host2rump(path);			\
 	} else {			\
 		fun = syscalls[rcname].bs_host;\
 	}\
@@ -395,12 +405,6 @@
 }
 
 /*
- * This tracks if our process is in a subdirectory of /rump.
- * It's preserved over exec.
- */
-static bool pwdinrump = false;
-
-/*
  * These variables are set from the RUMPHIJACK string and control
  * which operations can product rump kernel file descriptors.
  * This should be easily extendable for future needs.
@@ -483,12 +487,46 @@
 	rumpprefixlen = strlen(rumpprefix);
 }
 
+static struct blanket {
+	const char *pfx;
+	size_t len;
+} *blanket;
+static int nblanket;
+
+static void
+blanketparser(char *buf)
+{
+	char *p, *l;
+	int i;
+
+	for (nblanket = 0, p = buf; p; p = strchr(p+1, ':'), nblanket++)
+		continue;
+
+	blanket = malloc(nblanket * sizeof(*blanket));
+	if (blanket == NULL)
+		err(1, alloc blanket %d, nblanket);
+
+	for (p = strtok_r(buf, :, l), i = 0; p;
+	p = strtok_r(NULL, :, l), i++) {
+		blanket[i].pfx = strdup(p);
+		if (blanket[i].pfx == NULL)
+			err(1, strdup blanket);
+		blanket[i].len = strlen(p);
+
+		if (blanket[i].len == 0 || *blanket[i].pfx != '/')
+			errx(1, invalid blanket specifier %s, p);
+		if (*(blanket[i].pfx + blanket[i].len-1) == '/')
+			errx(1, invalid blanket specifier %s, p);
+	}
+}
+
 static struct {
 	void (*parsefn)(char *);
 	const char *name;
 } hijackparse[] = {
 	{ sockparser, socket },
 	{ pathparser, path },
+	{ blanketparser, blanket },
 	{ NULL, NULL },
 };
 
@@ -651,19 +689,28 @@
 
 #define assertfd(_fd_) assert(ISDUP2D(_fd_) || (_fd_) = HIJACK_FDOFF)
 
-static bool
+static enum pathtype
 path_isrump(const char *path)
 {
+	int i;
 
-	if (rumpprefix == NULL)
-		return false;
+	if (rumpprefix == NULL  nblanket == 0)
+		return PATH_HOST;
 
 	if (*path == '/') {
-		if (strncmp(path, rumpprefix, rumpprefixlen) == 0)
-			return true;
-		return false;
+		if (rumpprefix) {
+			if (strncmp(path, rumpprefix, rumpprefixlen) == 0) {
+return PATH_RUMP;
+			}
+		}
+		for (i = 0; i  nblanket; i++) {
+			if (strncmp(path, blanket[i].pfx, 

CVS commit: src/lib/librumphijack

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 21:02:22 UTC 2011

Modified Files:
src/lib/librumphijack: rumphijack.3

Log Message:
maybe typo


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/librumphijack/rumphijack.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/librumphijack/rumphijack.3
diff -u src/lib/librumphijack/rumphijack.3:1.6 src/lib/librumphijack/rumphijack.3:1.7
--- src/lib/librumphijack/rumphijack.3:1.6	Tue Mar  8 20:59:01 2011
+++ src/lib/librumphijack/rumphijack.3	Tue Mar  8 21:02:22 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: rumphijack.3,v 1.6 2011/03/08 20:59:01 pooka Exp $
+.\ $NetBSD: rumphijack.3,v 1.7 2011/03/08 21:02:22 pooka Exp $
 .\
 .\ Copyright (c) 2011 Antti Kantee.  All rights reserved.
 .\
@@ -92,7 +92,7 @@
 In case the current working directory is changed to a blanketed
 directory, the current working directory will still be reported
 with the rump prefix, if available.
-Note, though, that some shells cache the directory and maybe report
+Note, though, that some shells cache the directory and may report
 something else.
 In case no rump path prefix has been configured, the raw rump
 directory is reported.



CVS commit: src/lib/librumphijack

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 21:09:19 UTC 2011

Modified Files:
src/lib/librumphijack: rumphijack.3

Log Message:
clarify blanket operation a bit more


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/librumphijack/rumphijack.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/librumphijack/rumphijack.3
diff -u src/lib/librumphijack/rumphijack.3:1.7 src/lib/librumphijack/rumphijack.3:1.8
--- src/lib/librumphijack/rumphijack.3:1.7	Tue Mar  8 21:02:22 2011
+++ src/lib/librumphijack/rumphijack.3	Tue Mar  8 21:09:18 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: rumphijack.3,v 1.7 2011/03/08 21:02:22 pooka Exp $
+.\ $NetBSD: rumphijack.3,v 1.8 2011/03/08 21:09:18 pooka Exp $
 .\
 .\ Copyright (c) 2011 Antti Kantee.  All rights reserved.
 .\
@@ -103,6 +103,13 @@
 instead of
 .Pa /dev
 unless necessary to do otherwise.
+Also, note that the blanket prefix does not follow directory borders. 
+In other words, setting the blanket for
+.Pa /dev/bpf
+means it is set for
+.Em all
+pathnames with the given prefix, not just ones in
+.Pa /dev .
 .It Dq socket
 The specifier
 .Ar value



CVS commit: src/lib/librumphijack

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 21:36:01 UTC 2011

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

Log Message:
Enforce that the path=/rump specifier specifies and actual path
prefix and doesn't accept e.g. /rumpdev (only /rump/dev).


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

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.75 src/lib/librumphijack/hijack.c:1.76
--- src/lib/librumphijack/hijack.c:1.75	Tue Mar  8 20:59:01 2011
+++ src/lib/librumphijack/hijack.c	Tue Mar  8 21:36:01 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.75 2011/03/08 20:59:01 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.76 2011/03/08 21:36:01 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.75 2011/03/08 20:59:01 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.76 2011/03/08 21:36:01 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -692,14 +692,18 @@
 static enum pathtype
 path_isrump(const char *path)
 {
+	size_t plen;
 	int i;
 
 	if (rumpprefix == NULL  nblanket == 0)
 		return PATH_HOST;
 
 	if (*path == '/') {
-		if (rumpprefix) {
-			if (strncmp(path, rumpprefix, rumpprefixlen) == 0) {
+		plen = strlen(path);
+		if (rumpprefix  plen = rumpprefixlen) {
+			if (strncmp(path, rumpprefix, rumpprefixlen) == 0
+			 (plen == rumpprefixlen
+			  || *(path + rumpprefixlen) == '/')) {
 return PATH_RUMP;
 			}
 		}



CVS commit: src/tests/lib/librumphijack

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 21:36:25 UTC 2011

Modified Files:
src/tests/lib/librumphijack: t_vfs.sh

Log Message:
test case for runon prefixes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/librumphijack/t_vfs.sh

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

Modified files:

Index: src/tests/lib/librumphijack/t_vfs.sh
diff -u src/tests/lib/librumphijack/t_vfs.sh:1.2 src/tests/lib/librumphijack/t_vfs.sh:1.3
--- src/tests/lib/librumphijack/t_vfs.sh:1.2	Wed Feb 23 16:38:08 2011
+++ src/tests/lib/librumphijack/t_vfs.sh	Tue Mar  8 21:36:25 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: t_vfs.sh,v 1.2 2011/02/23 16:38:08 pooka Exp $
+#   $NetBSD: t_vfs.sh,v 1.3 2011/03/08 21:36:25 pooka Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -136,6 +136,7 @@
 }
 
 simpletest mv_x
+simpletest runonprefix
 
 #
 # do a cross-kernel mv
@@ -149,6 +150,13 @@
 	atf_check -s exit:0 diff -ru ${thedir}.2 /rump/${thedir}
 }
 
+runonprefix()
+{
+
+	atf_check -s exit:0 -o ignore stat /rump/dev
+	atf_check -s exit:1 -e ignore stat /rumpdev
+}
+
 atf_init_test_cases()
 {
 
@@ -156,4 +164,5 @@
 	atf_add_test_case cpcopy
 	atf_add_test_case mv_x
 	atf_add_test_case mv_nox
+	atf_add_test_case runonprefix
 }



CVS commit: src/tests/lib/librumphijack

2011-03-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  8 22:21:52 UTC 2011

Modified Files:
src/tests/lib/librumphijack: t_vfs.sh

Log Message:
some blanket tests


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/librumphijack/t_vfs.sh

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

Modified files:

Index: src/tests/lib/librumphijack/t_vfs.sh
diff -u src/tests/lib/librumphijack/t_vfs.sh:1.3 src/tests/lib/librumphijack/t_vfs.sh:1.4
--- src/tests/lib/librumphijack/t_vfs.sh:1.3	Tue Mar  8 21:36:25 2011
+++ src/tests/lib/librumphijack/t_vfs.sh	Tue Mar  8 22:21:52 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: t_vfs.sh,v 1.3 2011/03/08 21:36:25 pooka Exp $
+#   $NetBSD: t_vfs.sh,v 1.4 2011/03/08 22:21:52 pooka Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -137,6 +137,8 @@
 
 simpletest mv_x
 simpletest runonprefix
+simpletest blanket
+simpletest doubleblanket
 
 #
 # do a cross-kernel mv
@@ -152,11 +154,33 @@
 
 runonprefix()
 {
-
 	atf_check -s exit:0 -o ignore stat /rump/dev
 	atf_check -s exit:1 -e ignore stat /rumpdev
 }
 
+blanket()
+{
+	export RUMPHIJACK='blanket=/dev,path=/rump'
+	atf_check -s exit:0 -o save:stat.out \
+	stat -f ${statstr} /rump/dev/null
+	atf_check -s exit:0 -o file:stat.out \
+	stat -f ${statstr} /dev/null
+}
+
+doubleblanket()
+{
+	atf_check -s exit:0 mkdir /rump/dir
+	atf_check -s exit:0 ln -s dir /rump/dirtoo
+
+	export RUMPHIJACK='blanket=/dirtoo:/dir'
+	atf_check -s exit:0 touch /dir/file
+
+	atf_check -s exit:0 -o save:stat.out \
+	stat -f ${statstr} /dir/file
+	atf_check -s exit:0 -o file:stat.out \
+	stat -f ${statstr} /dirtoo/file
+}
+
 atf_init_test_cases()
 {
 
@@ -165,4 +189,6 @@
 	atf_add_test_case mv_x
 	atf_add_test_case mv_nox
 	atf_add_test_case runonprefix
+	atf_add_test_case blanket
+	atf_add_test_case doubleblanket
 }



CVS commit: [rmind-uvmplock] src/sys/arch/x86/x86

2011-03-08 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Mar  8 23:26:36 UTC 2011

Modified Files:
src/sys/arch/x86/x86 [rmind-uvmplock]: pmap.c

Log Message:
pmap_deactivate: improve comment.


To generate a diff of this commit:
cvs rdiff -u -r1.105.2.11 -r1.105.2.12 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.105.2.11 src/sys/arch/x86/x86/pmap.c:1.105.2.12
--- src/sys/arch/x86/x86/pmap.c:1.105.2.11	Tue Mar  8 20:07:30 2011
+++ src/sys/arch/x86/x86/pmap.c	Tue Mar  8 23:26:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.105.2.11 2011/03/08 20:07:30 rmind Exp $	*/
+/*	$NetBSD: pmap.c,v 1.105.2.12 2011/03/08 23:26:35 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.105.2.11 2011/03/08 20:07:30 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.105.2.12 2011/03/08 23:26:35 rmind Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -2712,11 +2712,10 @@
 }
 
 /*
- * pmap_deactivate: deactivate a process' pmap
+ * pmap_deactivate: deactivate a process' pmap.
  *
- * = must be called with kernel preemption disabled (high SPL is enough)
+ * = Must be called with kernel preemption disabled (high IPL is enough).
  */
-
 void
 pmap_deactivate(struct lwp *l)
 {
@@ -2730,10 +2729,10 @@
 	}
 
 	/*
-	 * wait for pending TLB shootdowns to complete.  necessary
-	 * because TLB shootdown state is per-CPU, and the LWP may
-	 * be coming off the CPU before it has a chance to call
-	 * pmap_update().
+	 * Wait for pending TLB shootdowns to complete.  Necessary because
+	 * TLB shootdown state is per-CPU, and the LWP may be coming off
+	 * the CPU before it has a chance to call pmap_update(), e.g. due
+	 * to kernel preemption or blocking routine in between.
 	 */
 	pmap_tlb_shootnow();
 



CVS commit: [rmind-uvmplock] src/sys/arch/x86/include

2011-03-08 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Mar  8 23:27:50 UTC 2011

Modified Files:
src/sys/arch/x86/include [rmind-uvmplock]: pmap.h

Log Message:
struct pmap_tlb_mailbox: make tm_pending and tm_gen volatile.


To generate a diff of this commit:
cvs rdiff -u -r1.29.2.7 -r1.29.2.8 src/sys/arch/x86/include/pmap.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/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.29.2.7 src/sys/arch/x86/include/pmap.h:1.29.2.8
--- src/sys/arch/x86/include/pmap.h:1.29.2.7	Sat Mar  5 20:52:28 2011
+++ src/sys/arch/x86/include/pmap.h	Tue Mar  8 23:27:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.29.2.7 2011/03/05 20:52:28 rmind Exp $	*/
+/*	$NetBSD: pmap.h,v 1.29.2.8 2011/03/08 23:27:50 rmind Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -465,23 +465,25 @@
 
 struct pmap_tlb_packet {
 #ifdef _LP64
-	uintptr_t	tp_va[14];	/* whole struct: 128 bytes */
+	uintptr_t		tp_va[14];	/* whole struct: 128 bytes */
 #else
-	uintptr_t	tp_va[13];	/* whole struct: 64 bytes */
+	uintptr_t		tp_va[13];	/* whole struct: 64 bytes */
 #endif
-	uint16_t	tp_count;
-	uint16_t	tp_pte;
-	uint32_t	tp_cpumask;
-	uint32_t	tp_usermask;
+	uint16_t		tp_count;
+	uint16_t		tp_pte;
+	uint32_t		tp_cpumask;
+	uint32_t		tp_usermask;
 };
-#define	TP_MAXVA	6		/* no more than N seperate invlpg */
+
+/* No more than N seperate invlpg. */
+#define	TP_MAXVA		6
 
 struct pmap_tlb_mailbox {
-	uint32_t	tm_pending;
-	uint32_t	tm_gen;
-	uint32_t	tm_usergen;
-	uint32_t	tm_globalgen;
-	char		tm_pad[64 - sizeof(uintptr_t) * 4];
+	volatile uint32_t	tm_pending;
+	volatile uint32_t	tm_gen;
+	uint32_t		tm_usergen;
+	uint32_t		tm_globalgen;
+	char			tm_pad[64 - sizeof(uintptr_t) * 4];
 };
 
 #endif /* _KERNEL */



CVS commit: [rmind-uvmplock] src/sys/arch/x86/x86

2011-03-08 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Mar  8 23:41:09 UTC 2011

Modified Files:
src/sys/arch/x86/x86 [rmind-uvmplock]: pmap_tlb.c

Log Message:
- pmap_tlb_shootdown: fix a bug when state for full TLB flush can be
  reverted to a single page invalidation(s).
- pmap_tlb_init: clear pmap_tlb_packet and pmap_tlb_mailbox structs.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/x86/x86/pmap_tlb.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap_tlb.c
diff -u src/sys/arch/x86/x86/pmap_tlb.c:1.1.2.3 src/sys/arch/x86/x86/pmap_tlb.c:1.1.2.4
--- src/sys/arch/x86/x86/pmap_tlb.c:1.1.2.3	Fri Jul  2 02:11:21 2010
+++ src/sys/arch/x86/x86/pmap_tlb.c	Tue Mar  8 23:41:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.1.2.3 2010/07/02 02:11:21 rmind Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.1.2.4 2011/03/08 23:41:09 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.1.2.3 2010/07/02 02:11:21 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.1.2.4 2011/03/08 23:41:09 rmind Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -59,9 +59,9 @@
 /*
  * TLB shootdown state.
  */
-static struct evcnt		pmap_tlb_evcnt __aligned(64);
-struct pmap_tlb_packet		pmap_tlb_packet __aligned(64);
-struct pmap_tlb_mailbox		pmap_tlb_mailbox __aligned(64);
+static struct evcnt		pmap_tlb_evcnt		__cacheline_aligned;
+struct pmap_tlb_packet		pmap_tlb_packet		__cacheline_aligned;
+struct pmap_tlb_mailbox		pmap_tlb_mailbox	__cacheline_aligned;
 
 /*
  * TLB shootdown statistics.
@@ -93,6 +93,10 @@
 void
 pmap_tlb_init(void)
 {
+	int i = 0;
+
+	memset(pmap_tlb_packet, 0, sizeof(struct pmap_tlb_packet));
+	memset(pmap_tlb_mailbox, 0, sizeof(struct pmap_tlb_mailbox));
 
 	evcnt_attach_dynamic(pmap_tlb_evcnt, EVCNT_TYPE_INTR,
 	NULL, TLB, shootdown);
@@ -177,9 +181,14 @@
 	CTASSERT(PG_G == (uint16_t)PG_G);
 	tp-tp_pte |= (uint16_t)pte;
 
-	if (tp-tp_count  TP_MAXVA  va != (vaddr_t)-1LL) {
+	if (tp-tp_count == (uint16_t)-1) {
+		/*
+		 * Already flushing everything.
+		 */
+	} else if (tp-tp_count  TP_MAXVA  va != (vaddr_t)-1LL) {
 		/* Flush a single page. */
 		tp-tp_va[tp-tp_count++] = va;
+		KASSERT(tp-tp_count  0);
 	} else {
 		/* Flush everything. */
 		tp-tp_count = (uint16_t)-1;



CVS commit: src/lib/librumphijack

2011-03-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Mar  8 23:51:23 UTC 2011

Modified Files:
src/lib/librumphijack: rumphijack.3

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/librumphijack/rumphijack.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/librumphijack/rumphijack.3
diff -u src/lib/librumphijack/rumphijack.3:1.8 src/lib/librumphijack/rumphijack.3:1.9
--- src/lib/librumphijack/rumphijack.3:1.8	Tue Mar  8 21:09:18 2011
+++ src/lib/librumphijack/rumphijack.3	Tue Mar  8 23:51:23 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: rumphijack.3,v 1.8 2011/03/08 21:09:18 pooka Exp $
+.\ $NetBSD: rumphijack.3,v 1.9 2011/03/08 23:51:23 wiz Exp $
 .\
 .\ Copyright (c) 2011 Antti Kantee.  All rights reserved.
 .\
@@ -103,7 +103,7 @@
 instead of
 .Pa /dev
 unless necessary to do otherwise.
-Also, note that the blanket prefix does not follow directory borders. 
+Also, note that the blanket prefix does not follow directory borders.
 In other words, setting the blanket for
 .Pa /dev/bpf
 means it is set for



CVS commit: src/usr.bin/m4

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 23:55:19 UTC 2011

Modified Files:
src/usr.bin/m4: pathnames.h

Log Message:
Revert previous, to fix build on Mac OS X again.

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/m4/pathnames.h

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

Modified files:

Index: src/usr.bin/m4/pathnames.h
diff -u src/usr.bin/m4/pathnames.h:1.14 src/usr.bin/m4/pathnames.h:1.15
--- src/usr.bin/m4/pathnames.h:1.14	Sat Mar  5 16:38:46 2011
+++ src/usr.bin/m4/pathnames.h	Tue Mar  8 23:55:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pathnames.h,v 1.14 2011/03/05 16:38:46 christos Exp $	*/
+/*	$NetBSD: pathnames.h,v 1.15 2011/03/08 23:55:19 riz Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,21 +35,6 @@
  */
 
 /*
- * Definitions of diversion files.  If the name of the file is changed,
- * adjust UNIQUE to point to the wildcard (*) character in the filename.
+ * Definitions of diversion files.
  */
-
-#ifdef msdos
-#define _PATH_DIVNAME	\\M4*XX		/* msdos diversion files */
-#define	UNIQUE		3			/* unique char location */
-#endif
-
-#if defined(unix) || defined(__NetBSD__) || defined(__OpenBSD__)
 #define _PATH_DIVNAME	/tmp/m4.0XX	/* unix diversion files */
-#define UNIQUE		8			/* unique char location */
-#endif
-
-#ifdef vms
-#define _PATH_DIVNAME	sys$login:m4*XX	/* vms diversion files */
-#define UNIQUE		12			/* unique char location */
-#endif



CVS commit: src/sys/netinet

2011-03-08 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Mar  9 00:44:24 UTC 2011

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
fix a typo in rev.1.283, which broke tcp dupack and duppack statistics.


To generate a diff of this commit:
cvs rdiff -u -r1.306 -r1.307 src/sys/netinet/tcp_input.c

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

Modified files:

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.306 src/sys/netinet/tcp_input.c:1.307
--- src/sys/netinet/tcp_input.c:1.306	Thu Dec  2 19:07:27 2010
+++ src/sys/netinet/tcp_input.c	Wed Mar  9 00:44:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.306 2010/12/02 19:07:27 plunky Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.307 2011/03/09 00:44:23 yamt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -145,7 +145,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.306 2010/12/02 19:07:27 plunky Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.307 2011/03/09 00:44:23 yamt Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -2344,7 +2344,7 @@
 
 		if (SEQ_LEQ(th-th_ack, tp-snd_una)) {
 			if (tlen == 0  !dupseg  tiwin == tp-snd_wnd) {
-TCP_STATINC(TCP_STAT_RCVDUPPACK);
+TCP_STATINC(TCP_STAT_RCVDUPACK);
 /*
  * If we have outstanding data (other than
  * a window probe), this is a completely



CVS commit: src/sys/dev/sbus

2011-03-08 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar  9 05:40:11 UTC 2011

Modified Files:
src/sys/dev/sbus: dbri.c

Log Message:
change dbri's DMA segment size to a power of two value - the ship allows
segments up to 0x1fff bytes but even rounded to 32bit this seems to
confuse the rest of the audio code these days
TODO: we don't need to interrupt at every single segment
either way, with this mpg123 doesn't produce semi-random funny noises
anymore


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sbus/dbri.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/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.32 src/sys/dev/sbus/dbri.c:1.33
--- src/sys/dev/sbus/dbri.c:1.32	Tue Jan 11 00:49:50 2011
+++ src/sys/dev/sbus/dbri.c	Wed Mar  9 05:40:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbri.c,v 1.32 2011/01/11 00:49:50 macallan Exp $	*/
+/*	$NetBSD: dbri.c,v 1.33 2011/03/09 05:40:11 macallan Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.32 2011/01/11 00:49:50 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.33 2011/03/09 05:40:11 macallan Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -1729,8 +1729,12 @@
 			const audio_params_t *param)
 {
 
-	/* DBRI DMA segment size, rounded down to 32bit alignment */
-	return 0x1ffc;
+	/*
+	 * DBRI DMA segment size can be up to 0x1fff, sixes that are not powers
+	 * of two seem to confuse the upper audio layer so we're going with
+	 * 0x1000 here
+	 */
+	return 0x1000;
 }
 
 static int
@@ -1946,7 +1950,7 @@
 dbri_round_buffersize(void *hdl, int dir, size_t bufsize)
 {
 #ifdef DBRI_BIG_BUFFER
-	return 16*0x1ffc;	/* use ~128KB buffer */
+	return 0x2;	/* use 128KB buffer */
 #else
 	return bufsize;
 #endif



CVS commit: src/sys/dev/nand

2011-03-08 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Wed Mar  9 07:49:15 UTC 2011

Modified Files:
src/sys/dev/nand: nand.c

Log Message:
cleanup comments, prototypes
remove unused leftover debug code


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/nand/nand.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/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.1 src/sys/dev/nand/nand.c:1.2
--- src/sys/dev/nand/nand.c:1.1	Sat Feb 26 18:07:31 2011
+++ src/sys/dev/nand/nand.c	Wed Mar  9 07:49:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.1 2011/02/26 18:07:31 ahoka Exp $	*/
+/*	$NetBSD: nand.c,v 1.2 2011/03/09 07:49:15 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.1 2011/02/26 18:07:31 ahoka Exp $);
+__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.2 2011/03/09 07:49:15 ahoka Exp $);
 
 #include locators.h
 
@@ -53,22 +53,21 @@
 
 #include opt_nand.h
 
-int nand_match(device_t parent, cfdata_t match, void *aux);
-void nand_attach(device_t parent, device_t self, void *aux);
-int nand_detach(device_t device, int flags);
-bool nand_shutdown(device_t self, int howto);
-
-int nand_print(void *aux, const char *pnp);
-
-static int nand_search(device_t parent, cfdata_t cf, const int *ldesc,
-void *aux);
-static void nand_address_row(device_t self, size_t row);
-static void nand_address_column(device_t self, size_t row, size_t column);
-static void nand_readid(device_t self, struct nand_chip *chip);
-static void nand_read_parameter_page(device_t self, struct nand_chip *chip);
-static const char *nand_midtoname(int id);
-static int nand_scan_media(device_t self, struct nand_chip *chip);
-static bool nand_check_wp(device_t self);
+int nand_match(device_t, cfdata_t, void *);
+void nand_attach(device_t, device_t, void *);
+int nand_detach(device_t, int);
+bool nand_shutdown(device_t, int);
+
+int nand_print(void *, const char *);
+
+static int nand_search(device_t, cfdata_t, const int *, void *);
+static void nand_address_row(device_t, size_t);
+static void nand_address_column(device_t, size_t, size_t);
+static void nand_readid(device_t, struct nand_chip *);
+static void nand_read_parameter_page(device_t, struct nand_chip *);
+static const char *nand_midtoname(int);
+static int nand_scan_media(device_t, struct nand_chip *);
+static bool nand_check_wp(device_t);
 
 CFATTACH_DECL_NEW(nand, sizeof(struct nand_softc),
 nand_match, nand_attach, nand_detach, NULL);
@@ -107,17 +106,12 @@
 	struct nand_softc *sc = device_private(self);
 	struct nand_attach_args *naa = aux;
 	struct nand_chip *chip = sc-sc_chip;
-//	struct flash_interface *flash_if;
-//	int i;
 
 	sc-sc_dev = self;
 	sc-nand_dev = parent;
 	sc-nand_if = naa-naa_nand_if;
 
-//	sc-nand_softc = device_private(parent);
-
 	aprint_naive(\n);
-//	aprint_normal(: NAND flash memory\n);
 
 	if (nand_check_wp(self)) {
 		aprint_error(NAND chip is write protected!\n);
@@ -500,7 +494,6 @@
 
 	/* XXX TODO */
 	row = chip-nc_page_shift;
-//	DPRINTF((row address is: 0x%jx\n, (uintmax_t )row));
 
 	/* Write the column (subpage) address */
 	if (chip-nc_flags  NC_BUSWIDTH_16)
@@ -520,8 +513,6 @@
 	struct nand_chip *chip = sc-sc_chip;
 	off_t i;
 
-//	DPRINTF((addressing row: %zu\n, row));
-
 	/* XXX TODO */
 	row = chip-nc_page_shift;
 
@@ -571,8 +562,6 @@
 	uint8_t *ecc;
 	int result;
 
-	DPRINTF((nand read page\n));
-
 	nand_prepare_read(self, offset, 0);
 
 	bs = chip-nc_ecc-necc_block_size;
@@ -595,7 +584,10 @@
 		}
 	}
 
-//	nand_dump_data(page, data, chip-nc_page_size);
+	/* for debugging new drivers */
+#if 0
+	nand_dump_data(page, data, chip-nc_page_size);
+#endif
 
 	nand_read_oob(self, offset, chip-nc_oob_cache);
 	ecc = chip-nc_oob_cache + chip-nc_ecc-necc_offset;
@@ -693,6 +685,7 @@
 
 	nand_busy(self);
 
+	/* for debugging ecc */
 #if 0
 	printf(dumping ecc %d\n--\n, chip-nc_ecc-necc_steps);
 	for (e = 0; e  chip-nc_ecc-necc_steps; e++) {
@@ -728,7 +721,10 @@
 	else
 		nand_read_buf_byte(self, oob, chip-nc_spare_size);
 
-//	nand_dump_data(oob, oob, chip-nc_spare_size);
+	/* for debugging drivers */
+#if 0
+	nand_dump_data(oob, oob, chip-nc_spare_size);
+#endif
 
 	return 0;
 }
@@ -888,8 +884,6 @@
 int
 nand_erase_block(device_t self, size_t offset)
 {
-//	struct nand_softc *sc = device_private(self);
-//	struct nand_chip *chip = sc-sc_chip;
 	uint8_t status;
 
 	/* xxx calculate first page of block for address? */
@@ -953,9 +947,6 @@
 	size_t left, count;
 	int error, i;
 
-	/* to debug chfs */
-//	printf(unaligned write to nand\n);
-
 	first = offset  chip-nc_page_mask;
 	firstoff = offset  ~chip-nc_page_mask;
 	/* XXX check if this should be len - 1 */
@@ -1131,13 +1122,9 @@
 	size_t left;
 	int error = 0, i;
 
-	/* to debug chfs */