CVS commit: src/sys

2010-04-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 12 06:56:19 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_apm.c
src/sys/dist/pf/net: pf.c

Log Message:
Spello in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/acpi/acpi_apm.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dist/pf/net/pf.c

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

Modified files:

Index: src/sys/dev/acpi/acpi_apm.c
diff -u src/sys/dev/acpi/acpi_apm.c:1.17 src/sys/dev/acpi/acpi_apm.c:1.18
--- src/sys/dev/acpi/acpi_apm.c:1.17	Sun Mar 28 13:11:23 2010
+++ src/sys/dev/acpi/acpi_apm.c	Mon Apr 12 06:56:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_apm.c,v 1.17 2010/03/28 13:11:23 pgoyette Exp $	*/
+/*	$NetBSD: acpi_apm.c,v 1.18 2010/04/12 06:56:19 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_apm.c,v 1.17 2010/03/28 13:11:23 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_apm.c,v 1.18 2010/04/12 06:56:19 skrll Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -332,7 +332,7 @@
   APM_BATT_FLAG_HIGH)
 	struct apm_sensor_info info;
 
-	/* Denote most variables as unitialized. */
+	/* Denote most variables as uninitialized. */
 	info.lowcap = info.warncap = info.descap = -1;
 
 	/*

Index: src/sys/dist/pf/net/pf.c
diff -u src/sys/dist/pf/net/pf.c:1.61 src/sys/dist/pf/net/pf.c:1.62
--- src/sys/dist/pf/net/pf.c:1.61	Tue Jan 19 22:08:00 2010
+++ src/sys/dist/pf/net/pf.c	Mon Apr 12 06:56:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf.c,v 1.61 2010/01/19 22:08:00 pooka Exp $	*/
+/*	$NetBSD: pf.c,v 1.62 2010/04/12 06:56:19 skrll Exp $	*/
 /*	$OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pf.c,v 1.61 2010/01/19 22:08:00 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: pf.c,v 1.62 2010/04/12 06:56:19 skrll Exp $);
 
 #include pflog.h
 
@@ -2926,7 +2926,7 @@
 	int			 hlen;
 	u_int16_t		 mss = tcp_mssdflt;
 
-	hlen = 0;	/* XXXGCC -Wunitialized m68k */
+	hlen = 0;	/* XXXGCC -Wuninitialized m68k */
 
 	memset(ro, 0, sizeof(ro));
 	switch (af) {
@@ -4312,8 +4312,8 @@
 	int		 state_icmp = 0;
 	struct pf_state_key_cmp key;
 
-	icmpsum = NULL;	/* XXXGCC -Wunitialized m68k */
-	icmptype = 0;	/* XXXGCC -Wunitialized m68k */
+	icmpsum = NULL;	/* XXXGCC -Wuninitialized m68k */
+	icmptype = 0;	/* XXXGCC -Wuninitialized m68k */
 
 	switch (pd-proto) {
 #ifdef INET



CVS commit: src/sys/external/intel-public/acpica/dist/include

2010-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Apr 12 12:04:54 UTC 2010

Modified Files:
src/sys/external/intel-public/acpica/dist/include: acglobal.h

Log Message:
Update the event counters to 64-bit integers.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/external/intel-public/acpica/dist/include/acglobal.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/external/intel-public/acpica/dist/include/acglobal.h
diff -u src/sys/external/intel-public/acpica/dist/include/acglobal.h:1.1.1.2 src/sys/external/intel-public/acpica/dist/include/acglobal.h:1.2
--- src/sys/external/intel-public/acpica/dist/include/acglobal.h:1.1.1.2	Thu Apr  8 04:28:01 2010
+++ src/sys/external/intel-public/acpica/dist/include/acglobal.h	Mon Apr 12 12:04:54 2010
@@ -421,10 +421,10 @@
 
 /* Event counters */
 
-ACPI_EXTERN UINT32  AcpiMethodCount;
-ACPI_EXTERN UINT32  AcpiGpeCount;
-ACPI_EXTERN UINT32  AcpiSciCount;
-ACPI_EXTERN UINT32  AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS];
+ACPI_EXTERN UINT64  AcpiMethodCount;
+ACPI_EXTERN UINT64  AcpiGpeCount;
+ACPI_EXTERN UINT64  AcpiSciCount;
+ACPI_EXTERN UINT64  AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS];
 
 /* Support for dynamic control method tracing mechanism */
 



CVS commit: src/share/man/man4

2010-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Apr 12 12:21:17 UTC 2010

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

Log Message:
Catch up with the sysctl-changes.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/share/man/man4/acpi.4

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

Modified files:

Index: src/share/man/man4/acpi.4
diff -u src/share/man/man4/acpi.4:1.47 src/share/man/man4/acpi.4:1.48
--- src/share/man/man4/acpi.4:1.47	Sun Apr 11 08:58:43 2010
+++ src/share/man/man4/acpi.4	Mon Apr 12 12:21:17 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpi.4,v 1.47 2010/04/11 08:58:43 jruoho Exp $
+.\ $NetBSD: acpi.4,v 1.48 2010/04/12 12:21:17 jruoho Exp $
 .\
 .\ Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd April 11, 2010
+.Dd April 12, 2010
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -99,17 +99,18 @@
 .Xr sysctl 8
 variables are directly relevant for
 .Tn ACPI .
-.Bl -inset -width hw.acpi.supported_state -offset 3n
+.Bl -tag -width 123456 -offset indent
 .It Ic hw.acpi.root
-is the
+The
 .Tn ACPI
 root pointer.
 .It Ic hw.acpi.supported_states
-is a list of the supported
+A list of the
 .Tn ACPI
-sleep states.
-The list can contain the following values:
-.Bl -tag -width XS1X -offset indent
+sleep states that the machine supports.
+The possible values are:
+.Pp
+.Bl -tag -width XS1X -offset indent -compact
 .It S0
 fully running
 .It S1
@@ -119,16 +120,36 @@
 .It S3
 suspend-to-RAM
 .It S4
-suspend-to-disk (not supported)
+suspend-to-disk (not supported on
+.Nx )
 .It S5
 power off
 .El
+.It Ic hw.acpi.stat.gpe
+The number of dispatched General Purpose Events
+.Pq Tn GPEs .
+.It Ic hw.acpi.stat.sci
+The number of System Control Interrupts
+.Pq Tn SCIs .
+See
+.Xr acpiec 4
+for a brief description of both
+.Tn GPEs
+and
+.Tn SCIs .
+.It Ic hw.acpi.stat.fixed
+The number of
+.Dq fixed events .
+.It Ic hw.acpi.stat.method
+The number of
+.Tn ACPI
+methods executed by the interpreter.
 .It Ic machdep.acpi_beep_on_reset
-is a boolean variable that controls whether the
+A boolean variable that controls whether the
 .Tn PC
-speaker is beeped upon resume.
+speaker is beeps upon resume.
 .It Ic machdep.acpi_vbios_reset
-defines the handling of the graphics card.
+Defines the handling of the graphics card.
 The supported values are:
 .Bl -tag -width '2' -offset indent
 .It 0
@@ -320,11 +341,11 @@
 .Xr sysctl 8
 variables that control the debug output at runtime.
 The
-.Ic hw.acpi.debug_layer
+.Ic hw.acpi.debug.layer
 limits the output to a specific
 .Tn ACPI
 layer and the
-.Ic hw.acpi.debug_level
+.Ic hw.acpi.debug.level
 controls the debug level.
 Both
 .Xr sysctl 8
@@ -408,7 +429,7 @@
 and
 .Dv ACPI_LV_DEBUG_INFO .
 The debug output can be stopped by setting
-.Ic hw.acpi.debug_level
+.Ic hw.acpi.debug.level
 to
 .Dv ACPI_DEBUG_NONE .
 .Ss EXAMPLE
@@ -427,11 +448,11 @@
 With these options the debug message from the
 .Dv ACPI_DEBUG_PRINT
 macro is only visible when
-.Ic hw.acpi.debug_layer
+.Ic hw.acpi.debug.layer
 is either
 .Dv ACPI_BUS_COMPONENT
 or a compound constant including it, and
-.Ic hw.acpi.debug_level
+.Ic hw.acpi.debug.level
 is
 .Dv ACPI_LV_INFO
 or some constant that includes it.



CVS commit: src/sys/arch/atari/dev

2010-04-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Apr 12 12:28:59 UTC 2010

Modified Files:
src/sys/arch/atari/dev: dma.c

Log Message:
KNF and cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/atari/dev/dma.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/atari/dev/dma.c
diff -u src/sys/arch/atari/dev/dma.c:1.25 src/sys/arch/atari/dev/dma.c:1.26
--- src/sys/arch/atari/dev/dma.c:1.25	Sat Apr 10 18:02:05 2010
+++ src/sys/arch/atari/dev/dma.c	Mon Apr 12 12:28:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dma.c,v 1.25 2010/04/10 18:02:05 tsutsui Exp $	*/
+/*	$NetBSD: dma.c,v 1.26 2010/04/12 12:28:59 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dma.c,v 1.25 2010/04/10 18:02:05 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dma.c,v 1.26 2010/04/12 12:28:59 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -89,7 +89,7 @@
 static void
 st_dma_init(void)
 {
-	int	i;
+	int i;
 
 	TAILQ_INIT(dma_free);
 	TAILQ_INIT(dma_active);
@@ -102,23 +102,24 @@
 }
 
 int
-st_dmagrab(dma_farg int_func, dma_farg call_func, void *softc, int *lock_stat, int rcaller)
+st_dmagrab(dma_farg int_func, dma_farg call_func, void *softc, int *lock_stat,
+int rcaller)
 {
-	int		sps;
-	DMA_ENTRY	*req;
+	int s;
+	DMA_ENTRY *req;
 
-	if(must_init) {
+	if (must_init) {
 		st_dma_init();
 		must_init = 0;
 	}
 	*lock_stat = DMA_LOCK_REQ;
 
-	sps = splhigh();
+	s = splhigh();
 
 	/*
 	 * Create a request...
 	 */
-	if(dma_free.tqh_first == NULL)
+	if (dma_free.tqh_first == NULL)
 		panic(st_dmagrab: Too many outstanding requests);
 	req = dma_free.tqh_first;
 	TAILQ_REMOVE(dma_free, dma_free.tqh_first, entries);
@@ -128,50 +129,50 @@
 	req-lock_stat = lock_stat;
 	TAILQ_INSERT_TAIL(dma_active, req, entries);
 
-	if(dma_active.tqh_first != req) {
+	if (dma_active.tqh_first != req) {
 		if (call_func == NULL) {
 			do {
 tsleep(dma_active, PRIBIO, dmalck, 0);
 			} while (*req-lock_stat != DMA_LOCK_GRANT);
-			splx(sps);
-			return(1);
+			splx(s);
+			return 1;
 		}
-		splx(sps);
-		return(0);
+		splx(s);
+		return 0;
 	}
-	splx(sps);
+	splx(s);
 
 	/*
 	 * We're at the head of the queue, ergo: we got the lock.
 	 */
 	*lock_stat = DMA_LOCK_GRANT;
 
-	if(rcaller || (call_func == NULL)) {
+	if (rcaller || (call_func == NULL)) {
 		/*
 		 * Just return to caller immediately without going
 		 * through 'call_func' first.
 		 */
-		return(1);
+		return 1;
 	}
 
 	(*call_func)(softc);	/* Call followup function		*/
-	return(0);
+	return 0;
 }
 
 void
 st_dmafree(void *softc, int *lock_stat)
 {
-	int		sps;
-	DMA_ENTRY	*req;
+	int s;
+	DMA_ENTRY *req;
 	
-	sps = splhigh();
+	s = splhigh();
 
 	/*
 	 * Some validity checks first.
 	 */
-	if((req = dma_active.tqh_first) == NULL)
+	if ((req = dma_active.tqh_first) == NULL)
 		panic(st_dmafree: empty active queue);
-	if(req-softc != softc)
+	if (req-softc != softc)
 		printf(Caller of st_dmafree is not lock-owner!\n);
 
 	/*
@@ -181,37 +182,37 @@
 	TAILQ_REMOVE(dma_active, req, entries);
 	TAILQ_INSERT_HEAD(dma_free, req, entries);
 
-	if((req = dma_active.tqh_first) != NULL) {
+	if ((req = dma_active.tqh_first) != NULL) {
 		*req-lock_stat = DMA_LOCK_GRANT;
 
 		if (req-call_func == NULL)
 			wakeup((void *)dma_active);
 		else {
-		/*
-		 * Call next request through softint handler. This avoids
-		 * spl-conflicts.
-		 */
-		add_sicallback((si_farg)req-call_func, req-softc, 0);
+			/*
+			 * Call next request through softint handler.
+			 * This avoids spl-conflicts.
+			 */
+			add_sicallback((si_farg)req-call_func, req-softc, 0);
 		}
 	}
-	splx(sps);
-	return;
+	splx(s);
 }
 
 int
 st_dmawanted(void)
 {
-	return(dma_active.tqh_first-entries.tqe_next != NULL);
+
+	return dma_active.tqh_first-entries.tqe_next != NULL;
 }
 
 int
 cdmaint(void *unused, int sr)
 	/* sr:	 sr at time of interrupt */
 {
-	dma_farg	int_func;
-	void		*softc;
+	dma_farg int_func;
+	void *softc;
 
-	if(dma_active.tqh_first != NULL) {
+	if (dma_active.tqh_first != NULL) {
 		/*
 		 * Due to the logic of the ST-DMA chip, it is not possible to
 		 * check for stray interrupts here...
@@ -229,9 +230,9 @@
  * Note: The order _is_ important!
  */
 void
-st_dmaaddr_set(void * address)
+st_dmaaddr_set(void *address)
 {
-	register u_long ad = (u_long)address;
+	u_long ad = (u_long)address;
 
 	DMA-dma_addr[AD_LOW ] = (ad )  0xff;
 	DMA-dma_addr[AD_MID ] = (ad  8)  0xff;
@@ -244,12 +245,12 @@
 u_long
 st_dmaaddr_get(void)
 {
-	register u_long ad = 0;
+	u_long ad = 0;
 
 	ad  = (DMA-dma_addr[AD_LOW ]  0xff);
 	ad |= (DMA-dma_addr[AD_MID ]  0xff)  8;
 	ad |= (DMA-dma_addr[AD_HIGH]  0xff) 16;
-	return(ad);
+	return ad;
 }
 
 /*
@@ -259,6 +260,7 @@
 void
 st_dmacomm(int mode, int nblk)
 {
+
 	DMA-dma_mode = mode;
 	DMA-dma_mode = mode ^ DMA_WRBIT;
 	DMA-dma_mode 

CVS commit: src/share/man/man4

2010-04-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 12 12:41:36 UTC 2010

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

Log Message:
Remove superfluous word.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/share/man/man4/acpi.4

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

Modified files:

Index: src/share/man/man4/acpi.4
diff -u src/share/man/man4/acpi.4:1.48 src/share/man/man4/acpi.4:1.49
--- src/share/man/man4/acpi.4:1.48	Mon Apr 12 12:21:17 2010
+++ src/share/man/man4/acpi.4	Mon Apr 12 12:41:36 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpi.4,v 1.48 2010/04/12 12:21:17 jruoho Exp $
+.\ $NetBSD: acpi.4,v 1.49 2010/04/12 12:41:36 wiz Exp $
 .\
 .\ Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -147,7 +147,7 @@
 .It Ic machdep.acpi_beep_on_reset
 A boolean variable that controls whether the
 .Tn PC
-speaker is beeps upon resume.
+speaker beeps upon resume.
 .It Ic machdep.acpi_vbios_reset
 Defines the handling of the graphics card.
 The supported values are:



CVS commit: src/sys/arch/atari/dev

2010-04-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Apr 12 12:43:39 UTC 2010

Modified Files:
src/sys/arch/atari/dev: dma.c

Log Message:
- more cosmetics
- use queue(3) macro properly


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/atari/dev/dma.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/atari/dev/dma.c
diff -u src/sys/arch/atari/dev/dma.c:1.26 src/sys/arch/atari/dev/dma.c:1.27
--- src/sys/arch/atari/dev/dma.c:1.26	Mon Apr 12 12:28:59 2010
+++ src/sys/arch/atari/dev/dma.c	Mon Apr 12 12:43:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dma.c,v 1.26 2010/04/12 12:28:59 tsutsui Exp $	*/
+/*	$NetBSD: dma.c,v 1.27 2010/04/12 12:43:39 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dma.c,v 1.26 2010/04/12 12:28:59 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dma.c,v 1.27 2010/04/12 12:43:39 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -94,7 +94,7 @@
 	TAILQ_INIT(dma_free);
 	TAILQ_INIT(dma_active);
 
-	for(i = 0; i  NDMA_DEV; i++)
+	for (i = 0; i  NDMA_DEV; i++)
 		TAILQ_INSERT_HEAD(dma_free, dmatable[i], entries);
 
 	if (intr_establish(7, USER_VEC, 0, cdmaint, NULL) == NULL)
@@ -119,17 +119,16 @@
 	/*
 	 * Create a request...
 	 */
-	if (dma_free.tqh_first == NULL)
+	if ((req = TAILQ_FIRST(dma_free)) == NULL)
 		panic(st_dmagrab: Too many outstanding requests);
-	req = dma_free.tqh_first;
-	TAILQ_REMOVE(dma_free, dma_free.tqh_first, entries);
+	TAILQ_REMOVE(dma_free, req, entries);
 	req-call_func = call_func;
 	req-int_func  = int_func;
 	req-softc = softc;
 	req-lock_stat = lock_stat;
 	TAILQ_INSERT_TAIL(dma_active, req, entries);
 
-	if (dma_active.tqh_first != req) {
+	if (TAILQ_FIRST(dma_active) != req) {
 		if (call_func == NULL) {
 			do {
 tsleep(dma_active, PRIBIO, dmalck, 0);
@@ -170,7 +169,7 @@
 	/*
 	 * Some validity checks first.
 	 */
-	if ((req = dma_active.tqh_first) == NULL)
+	if ((req = TAILQ_FIRST(dma_active)) == NULL)
 		panic(st_dmafree: empty active queue);
 	if (req-softc != softc)
 		printf(Caller of st_dmafree is not lock-owner!\n);
@@ -182,7 +181,7 @@
 	TAILQ_REMOVE(dma_active, req, entries);
 	TAILQ_INSERT_HEAD(dma_free, req, entries);
 
-	if ((req = dma_active.tqh_first) != NULL) {
+	if ((req = TAILQ_FIRST(dma_active)) != NULL) {
 		*req-lock_stat = DMA_LOCK_GRANT;
 
 		if (req-call_func == NULL)
@@ -202,7 +201,7 @@
 st_dmawanted(void)
 {
 
-	return dma_active.tqh_first-entries.tqe_next != NULL;
+	return TAILQ_NEXT(TAILQ_FIRST(dma_active), entries) != NULL;
 }
 
 int
@@ -212,13 +211,13 @@
 	dma_farg int_func;
 	void *softc;
 
-	if (dma_active.tqh_first != NULL) {
+	if (TAILQ_FIRST(dma_active) != NULL) {
 		/*
 		 * Due to the logic of the ST-DMA chip, it is not possible to
 		 * check for stray interrupts here...
 		 */
-		int_func = dma_active.tqh_first-int_func;
-		softc= dma_active.tqh_first-softc;
+		int_func = TAILQ_FIRST(dma_active)-int_func;
+		softc= TAILQ_FIRST(dma_active)-softc;
 		add_sicallback((si_farg)int_func, softc, 0);
 		return 1;
 	}



CVS commit: src/sys/arch/atari/dev

2010-04-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Apr 12 13:05:25 UTC 2010

Modified Files:
src/sys/arch/atari/dev: lpt.c

Log Message:
Replace old MD sicallback functions with MI softint(9).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/atari/dev/lpt.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/atari/dev/lpt.c
diff -u src/sys/arch/atari/dev/lpt.c:1.32 src/sys/arch/atari/dev/lpt.c:1.33
--- src/sys/arch/atari/dev/lpt.c:1.32	Mon Nov 23 00:11:43 2009
+++ src/sys/arch/atari/dev/lpt.c	Mon Apr 12 13:05:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: lpt.c,v 1.32 2009/11/23 00:11:43 rmind Exp $ */
+/*	$NetBSD: lpt.c,v 1.33 2010/04/12 13:05:25 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1996 Leo Weppelman
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lpt.c,v 1.32 2009/11/23 00:11:43 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: lpt.c,v 1.33 2010/04/12 13:05:25 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -104,6 +104,7 @@
 	u_char		sc_flags;
 #define	LPT_AUTOLF	0x20	/* automatic LF on CR XXX: LWP - not yet... */
 #define	LPT_NOINTR	0x40	/* do not use interrupt */
+	void		*sc_sicookie;
 };
 
 #define	LPTUNIT(s)	(minor(s)  0x1f)
@@ -118,9 +119,9 @@
 
 static void lptwakeup (void *arg);
 static int pushbytes (struct lpt_softc *);
-static void lptpseudointr (struct lpt_softc *);
+static void lptpseudointr (void *);
 int lptintr (struct lpt_softc *);
-int lpthwintr (struct lpt_softc *, int);
+int lpthwintr (void *);
 
 
 /*
@@ -166,6 +167,7 @@
 	if (intr_establish(0, USER_VEC, 0, (hw_ifun_t)lpthwintr, sc) == NULL)
 		aprint_error_dev(dp, Can't establish interrupt\n);
 	ym2149_strobe(1);
+	sc-sc_sicookie = softint_establish(SOFTINT_SERIAL, lptpseudointr, sc);
 
 	callout_init(sc-sc_wakeup_ch, 0);
 }
@@ -382,21 +384,24 @@
 }
 
 static void
-lptpseudointr(struct lpt_softc *sc)
+lptpseudointr(void *arg)
 {
+	struct lpt_softc *sc;
 	int	s;
 
+	sc = arg;
 	s = spltty();
 	lptintr(sc);
 	splx(s);
 }
 
 int
-lpthwintr(struct lpt_softc *sc, int sr)
+lpthwintr(void *arg)
 {
-	if (!BASEPRI(sr))
-		add_sicallback((si_farg)lptpseudointr, sc, 0);
-	else lptpseudointr(sc);
+	struct lpt_softc *sc;
+
+	sc = arg;
+	softint_schedule(sc-sc_sicookie);
 	return 1;
 }
 



CVS commit: src/sys/modules

2010-04-12 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Mon Apr 12 14:08:58 UTC 2010

Modified Files:
src/sys/modules: Makefile

Log Message:
Connect the pf module to the build.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/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/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.40 src/sys/modules/Makefile:1.41
--- src/sys/modules/Makefile:1.40	Fri Apr  9 13:49:12 2010
+++ src/sys/modules/Makefile	Mon Apr 12 14:08:58 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.40 2010/04/09 13:49:12 ahoka Exp $
+#	$NetBSD: Makefile,v 1.41 2010/04/12 14:08:58 ahoka Exp $
 
 .include bsd.own.mk
 
@@ -36,6 +36,7 @@
 SUBDIR+=	ntfs
 SUBDIR+=	null
 SUBDIR+=	overlay
+SUBDIR+=	pf
 SUBDIR+=	ppp_bsdcomp
 SUBDIR+=	ppp_deflate
 SUBDIR+=	procfs



CVS commit: src/distrib/sets/lists/modules

2010-04-12 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Mon Apr 12 14:12:43 UTC 2010

Modified Files:
src/distrib/sets/lists/modules: mi

Log Message:
Add pf to the module set list.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/sets/lists/modules/mi

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/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.12 src/distrib/sets/lists/modules/mi:1.13
--- src/distrib/sets/lists/modules/mi:1.12	Fri Mar 12 21:53:16 2010
+++ src/distrib/sets/lists/modules/mi	Mon Apr 12 14:12:43 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.12 2010/03/12 21:53:16 darran Exp $
+# $NetBSD: mi,v 1.13 2010/04/12 14:12:43 ahoka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -80,6 +80,8 @@
 ./@MODULEDIR@/null/null.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/overlaybase-kernel-modules	kmod
 ./@MODULEDIR@/overlay/overlay.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/pfbase-kernel-modules	kmod
+./@MODULEDIR@/pf/pf.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/portalbase-obsolete		obsolete
 ./@MODULEDIR@/portal/portal.kmod		base-obsolete		obsolete
 ./@MODULEDIR@/ppp_bsdcomp			base-kernel-modules	kmod



CVS commit: src/dist/pf/share/man/man4

2010-04-12 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Mon Apr 12 14:26:11 UTC 2010

Modified Files:
src/dist/pf/share/man/man4: pfsync.4

Log Message:
mention pfsync not working as a kernel module


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/dist/pf/share/man/man4/pfsync.4

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

Modified files:

Index: src/dist/pf/share/man/man4/pfsync.4
diff -u src/dist/pf/share/man/man4/pfsync.4:1.4 src/dist/pf/share/man/man4/pfsync.4:1.5
--- src/dist/pf/share/man/man4/pfsync.4:1.4	Sun Oct  4 18:07:26 2009
+++ src/dist/pf/share/man/man4/pfsync.4	Mon Apr 12 14:26:11 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: pfsync.4,v 1.4 2009/10/04 18:07:26 joerg Exp $
+.\	$NetBSD: pfsync.4,v 1.5 2010/04/12 14:26:11 ahoka Exp $
 .\	$OpenBSD: pfsync.4,v 1.25 2007/05/31 19:19:51 jmc Exp $
 .\
 .\ Copyright (c) 2002 Michael Shalayeff
@@ -246,3 +246,8 @@
 .Nm
 device first appeared in
 .Ox 3.3 .
+.Sh CAVEATS
+.Nm
+is not available when using
+.Xr pf 4
+as a kernel module.



CVS commit: src/sys/dev/pci

2010-04-12 Thread Matthew Jacob
Module Name:src
Committed By:   mjacob
Date:   Mon Apr 12 14:26:21 UTC 2010

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

Log Message:
Oops. Don't forget to set the isp_port value based upon PCI function code.
Otherwise you end up with both ports using the same WWPN. Bad.
Discovered by Havard. Pointy hat to me.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/isp_pci.c

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

Modified files:

Index: src/sys/dev/pci/isp_pci.c
diff -u src/sys/dev/pci/isp_pci.c:1.111 src/sys/dev/pci/isp_pci.c:1.112
--- src/sys/dev/pci/isp_pci.c:1.111	Fri Mar 26 20:52:01 2010
+++ src/sys/dev/pci/isp_pci.c	Mon Apr 12 14:26:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_pci.c,v 1.111 2010/03/26 20:52:01 mjacob Exp $ */
+/* $NetBSD: isp_pci.c,v 1.112 2010/04/12 14:26:21 mjacob Exp $ */
 /*
  * Copyright (C) 1997, 1998, 1999 National Aeronautics  Space Administration
  * All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: isp_pci.c,v 1.111 2010/03/26 20:52:01 mjacob Exp $);
+__KERNEL_RCSID(0, $NetBSD: isp_pci.c,v 1.112 2010/04/12 14:26:21 mjacob Exp $);
 
 #include dev/ic/isp_netbsd.h
 #include dev/pci/pcireg.h
@@ -665,6 +665,7 @@
 			dstring = : QLogic FC-AL and 4Gbps Fabric PCI-E HBA\n;
 		}
 		isp-isp_type = ISP_HA_FC_2400;
+		isp-isp_port = pa-pa_function;
 		mamt = sizeof (fcparam);
 		pcs-pci_poff[MBOX_BLOCK  _BLK_REG_SHFT] =
 		PCI_MBOX_REGS2400_OFF;
@@ -674,6 +675,7 @@
 		isp-isp_mdvec = mdvec_2500;
 		dstring = : QLogic FC-AL and 8Gbps Fabric PCI-E HBA\n;
 		isp-isp_type = ISP_HA_FC_2500;
+		isp-isp_port = pa-pa_function;
 		mamt = sizeof (fcparam);
 		pcs-pci_poff[MBOX_BLOCK  _BLK_REG_SHFT] =
 		PCI_MBOX_REGS2400_OFF;



CVS commit: src/crypto/external/bsd/openssl/lib/libdes

2010-04-12 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 12 17:58:40 UTC 2010

Modified Files:
src/crypto/external/bsd/openssl/lib/libdes: Makefile

Log Message:
Add management target for the man pages.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/openssl/lib/libdes/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libdes/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.1 src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.2
--- src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.1	Sun Jul 19 23:30:57 2009
+++ src/crypto/external/bsd/openssl/lib/libdes/Makefile	Mon Apr 12 17:58:40 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/07/19 23:30:57 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2010/04/12 17:58:40 joerg Exp $
 
 .include bsd.own.mk
 
@@ -20,8 +20,12 @@
 INCS=	des.h
 INCSDIR=/usr/include
 
-# pod2man --section=3 --center=libdes --release=0.9.6j des.pod  des.3
-# pod2man --section=7 --center=libdes --release=0.9.6j des_modes.pod  des_modes.7
+make-manpages:
+	pod2man --section=3 --center=libdes --release=0.9.6j des.pod | \
+	sed -e 's/[[:space:]]*$$//'  ${.CURDIR}/des.3
+	pod2man --section=7 --center=libdes --release=0.9.6j des_modes.pod | \
+	sed -e 's/[[:space:]]*$$//'  ${.CURDIR}/des_modes.7
+
 MAN=	des.3 des_modes.7
 
 MLINKS+=des.3 des_cbc_cksum.3 \



CVS commit: src/crypto/external/bsd/openssl/lib/libdes

2010-04-12 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 12 17:59:37 UTC 2010

Modified Files:
src/crypto/external/bsd/openssl/lib/libdes: des.3 des_modes.7

Log Message:
Regen man pages with modern pod2man to get more normalised version.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/openssl/lib/libdes/des.3 \
src/crypto/external/bsd/openssl/lib/libdes/des_modes.7

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libdes/des.3
diff -u src/crypto/external/bsd/openssl/lib/libdes/des.3:1.1 src/crypto/external/bsd/openssl/lib/libdes/des.3:1.2
--- src/crypto/external/bsd/openssl/lib/libdes/des.3:1.1	Sun Jul 19 23:30:57 2009
+++ src/crypto/external/bsd/openssl/lib/libdes/des.3	Mon Apr 12 17:59:37 2010
@@ -1,26 +1,11 @@
-.\ Automatically generated by Pod::Man version 1.02
-.\ Wed Jul 23 14:41:57 2003
+.\ Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
 .\
 .\ Standard preamble:
-.\ ==
-.de Sh \ Subsection heading
-.br
-.if t .Sp
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
+.\ 
 .de Sp \ Vertical space (when we can't use .PP)
 .if t .sp .5v
 .if n .sp
 ..
-.de Ip \ List item
-.br
-.ie \\n(.$=3 .ne \\$3
-.el .ne 3
-.IP \\$1 \\$2
-..
 .de Vb \ Begin verbatim text
 .ft CW
 .nf
@@ -28,16 +13,15 @@
 ..
 .de Ve \ End verbatim text
 .ft R
-
 .fi
 ..
 .\ Set up some character translations and predefined strings.  \*(-- will
 .\ give an unbreakable dash, \*(PI will give pi, \*(L will give a left
-.\ double quote, and \*(R will give a right double quote.  | will give a
-.\ real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used
-.\ to do unbreakable dashes and therefore won't be available.  \*(C` and
-.\ \*(C' expand to `' in nroff, nothing in troff, for use with C
-.tr \(*W-|\(bv\*(Tr
+.\ double quote, and \*(R will give a right double quote.  \*(C+ will
+.\ give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\ therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\ nothing in troff, for use with C.
+.tr \(*W-
 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
 .ie n \{\
 .ds -- \(*W-
@@ -46,8 +30,8 @@
 .if (\n(.H=4u)(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\  diablo 12 pitch
 .ds L 
 .ds R 
-.ds C` `
-.ds C' '
+.ds C` 
+.ds C' 
 'br\}
 .el\{\
 .ds -- \|\(em\|
@@ -56,26 +40,28 @@
 .ds R ''
 'br\}
 .\
-.\ If the F register is turned on, we'll generate index entries on stderr
-.\ for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
-.\ index entries marked with X in POD.  Of course, you'll have to process
-.\ the output yourself in some meaningful fashion.
-.if \nF \{\
+.\ Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el   .ds Aq '
+.\
+.\ If the F register is turned on, we'll generate index entries on stderr for
+.\ titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\ entries marked with X in POD.  Of course, you'll have to process the
+.\ output yourself in some meaningful fashion.
+.ie \nF \{\
 .de IX
 .tm Index:\\$1\t\\n%\t\\$2
-..
+..
 .nr % 0
 .rr F
 .\}
-.\
-.\ For nroff, turn off justification.  Always turn off hyphenation; it
-.\ makes way too many mistakes in technical documents.
-.hy 0
-.if n .na
+.el \{\
+.de IX
+..
+.\}
 .\
 .\ Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
 .\ Fear.  Run.  Save yourself.  No user-serviceable parts.
-.bd B 3
 .\ fudge factors for nroff and troff
 .if n \{\
 .ds #H 0
@@ -135,11 +121,14 @@
 .ds Ae AE
 .\}
 .rm #[ #] #H #V #F C
-.\ ==
+.\ 
 .\
 .IX Title des 3
-.TH des 3 0.9.6j 2003-07-23 libdes
-.UC
+.TH des 3 2009-07-20 0.9.6j libdes
+.\ For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\ way too many mistakes in technical documents.
+.if n .ad l
+.nh
 .SH NAME
 des_random_key, des_set_key, des_key_sched, des_set_key_checked,
 des_set_key_unchecked, des_set_odd_parity, des_is_weak_key,
@@ -150,39 +139,34 @@
 des_ede3_cbcm_encrypt, des_ede3_cfb64_encrypt, des_ede3_ofb64_encrypt,
 des_read_password, des_read_2passwords, des_read_pw_string,
 des_cbc_cksum, des_quad_cksum, des_string_to_key, des_string_to_2keys,
-des_fcrypt, des_crypt, des_enc_read, des_enc_write \- \s-1DES\s0 encryption
+des_fcrypt, des_crypt, des_enc_read, des_enc_write \- DES encryption
 .SH SYNOPSIS
 .IX Header SYNOPSIS
 .Vb 1
 \ #include openssl/des.h
-.Ve
-.Vb 1
+\
 \ void des_random_key(des_cblock *ret);
-.Ve
-.Vb 6
+\
 \ int des_set_key(const_des_cblock *key, des_key_schedule 

CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/man

2010-04-12 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 12 18:02:46 UTC 2010

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/man: Makefile

Log Message:
Rename management target to not overlap with the normal mk rules.
Explicitly drop trailing whitespace after pod2man.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile:1.2	Sun Jan 24 19:16:05 2010
+++ src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile	Mon Apr 12 18:02:46 2010
@@ -1,17 +1,15 @@
-#	$NetBSD: Makefile,v 1.2 2010/01/24 19:16:05 joerg Exp $
+#	$NetBSD: Makefile,v 1.3 2010/04/12 18:02:46 joerg Exp $
 
 # the makefile is not, and should not be visited during normal build process.
 # try to use latest pod2man, which comes with the latest perl.
 
-# XXX: remove .UC lines
-
 .include bsd.own.mk
 CRYPTODIST=	${NETBSDSRCDIR}/crypto
 .include ${NETBSDSRCDIR}/crypto/Makefile.openssl
 
 VERSION!=	head -2 ${OPENSSLSRC}/README | tail -1 | awk '{ print $$2; }'
 
-manpages:
+make-manpages:
 	for i in ${OPENSSLSRC}/doc/apps/*.pod; do \
 		fn=`basename $$i .pod`; \
 		if [ $$fn = config ]; then \
@@ -27,6 +25,7 @@
 		(cd `dirname $$i`; \
 		 pod2man --section=$$sec --center=OpenSSL --release=${VERSION} \
 			`basename $$i`) | \
+		sed -e 's/[[:space:]]*$$//' | \
 		perl libcrypto.pl $$dst; \
 	done
 	for i in ${OPENSSLSRC}/doc/crypto/*.pod \
@@ -36,12 +35,15 @@
 			sec=7; \
 			(cd `dirname $$i`; \
 			 pod2man --section=$$sec --center=OpenSSL --release=${VERSION} \
-`basename $$i`) | sed -e '/$$RCSfile/d' -e '/$$Log/d'  `basename $$i .pod`.$$sec; \
+`basename $$i`) | \
+			sed -e '/$$RCSfile/d' -e '/$$Log/d' -e 's/[[:space:]]*$$//' \
+			 `basename $$i .pod`.$$sec; \
 		else \
 			sec=3; \
 			(cd `dirname $$i`; \
 			 pod2man --section=$$sec --center=OpenSSL --release=${VERSION} \
 `basename $$i`) | \
+			sed -e 's/[[:space:]]*$$//' | \
 			perl libcrypto.pl `basename $$i .pod`.$$sec; \
 		fi \
 	done



CVS commit: src/sys/dev/acpi

2010-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Apr 12 18:55:27 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi.c acpi_quirks.c acpivar.h

Log Message:
Remove some unused and global variables. Make the code more readable. Deny
invalid writes to machdep.sleep_state. Cosmetics. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/acpi_quirks.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/acpi/acpivar.h

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

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.165 src/sys/dev/acpi/acpi.c:1.166
--- src/sys/dev/acpi/acpi.c:1.165	Mon Apr 12 12:14:26 2010
+++ src/sys/dev/acpi/acpi.c	Mon Apr 12 18:55:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.165 2010/04/12 12:14:26 jruoho Exp $	*/
+/*	$NetBSD: acpi.c,v 1.166 2010/04/12 18:55:27 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.165 2010/04/12 12:14:26 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.166 2010/04/12 18:55:27 jruoho Exp $);
 
 #include opt_acpi.h
 #include opt_pcifixup.h
@@ -94,7 +94,7 @@
 #include dev/acpi/acpidevs_data.h
 #endif
 
-#define _COMPONENT  ACPI_TOOLS 
+#define _COMPONENT  ACPI_BUS_COMPONENT
 ACPI_MODULE_NAME(acpi)
 
 #if defined(ACPI_PCI_FIXUP)
@@ -135,6 +135,7 @@
 
 static int	sysctl_hw_acpi_fixedstats(SYSCTLFN_ARGS);
 static int	sysctl_hw_acpi_sleepstate(SYSCTLFN_ARGS);
+static int	sysctl_hw_acpi_sleepstates(SYSCTLFN_ARGS);
 
 extern struct cfdriver acpi_cd;
 
@@ -150,15 +151,8 @@
 int	acpi_force_load;
 int	acpi_suspended = 0;
 
-/*
- * Pointer to the ACPI subsystem's state.  There can be only
- * one ACPI instance.
- */
 struct acpi_softc *acpi_softc;
-
-/*
- * Locking stuff.
- */
+static uint64_t acpi_root_pointer;
 extern kmutex_t acpi_interrupt_list_mtx;
 
 /*
@@ -184,14 +178,6 @@
 };
 
 /*
- * sysctl-related information
- */
-
-static uint64_t acpi_root_pointer;	/* found as hw.acpi.root */
-static int acpi_sleepstate = ACPI_STATE_S0;
-static char acpi_supported_states[3 * 6 + 1] = ;
-
-/*
  * Prototypes.
  */
 static void		acpi_build_tree(struct acpi_softc *);
@@ -199,10 +185,10 @@
 	  void *, void **);
 
 static void		acpi_enable_fixed_events(struct acpi_softc *);
+static void		acpi_sleep_init(struct acpi_softc *);
 
 static ACPI_TABLE_HEADER *acpi_map_rsdt(void);
 static void		acpi_unmap_rsdt(ACPI_TABLE_HEADER *);
-static int		is_available_state(struct acpi_softc *, int);
 
 static bool		acpi_suspend(device_t, const pmf_qual_t *);
 static bool		acpi_resume(device_t, const pmf_qual_t *);
@@ -435,8 +421,8 @@
 {
 	struct acpi_softc *sc = device_private(self);
 	struct acpibus_attach_args *aa = aux;
-	ACPI_STATUS rv;
 	ACPI_TABLE_HEADER *rsdt;
+	ACPI_STATUS rv;
 
 	aprint_naive(\n);
 	aprint_normal(: Intel ACPICA %08x\n, ACPI_CA_VERSION);
@@ -461,6 +447,7 @@
 
 	sc-sc_dev = self;
 	sc-sc_quirks = acpi_find_quirks();
+	sc-sc_sleepstate = ACPI_STATE_S0;
 
 	sc-sc_iot = aa-aa_iot;
 	sc-sc_memt = aa-aa_memt;
@@ -540,16 +527,9 @@
 	if (acpi_dbgr  ACPI_DBGR_PROBE)
 		acpi_osd_debugger();
 #endif
-	acpi_build_tree(sc);
 
-	snprintf(acpi_supported_states, sizeof(acpi_supported_states),
-	%s%s%s%s%s%s,
-	is_available_state(sc, ACPI_STATE_S0) ? S0  : ,
-	is_available_state(sc, ACPI_STATE_S1) ? S1  : ,
-	is_available_state(sc, ACPI_STATE_S2) ? S2  : ,
-	is_available_state(sc, ACPI_STATE_S3) ? S3  : ,
-	is_available_state(sc, ACPI_STATE_S4) ? S4  : ,
-	is_available_state(sc, ACPI_STATE_S5) ? S5  : );
+	acpi_build_tree(sc);
+	acpi_sleep_init(sc);
 
 #ifdef ACPI_DEBUGGER
 	if (acpi_dbgr  ACPI_DBGR_RUNNING)
@@ -1480,13 +1460,28 @@
  * ACPI sleep support.
  */
 
-static int
-is_available_state(struct acpi_softc *sc, int state)
+/*
+ * acpi_sleep_init:
+ *
+ *	Evaluate supported sleep states.
+ */
+static void
+acpi_sleep_init(struct acpi_softc *sc)
 {
-	UINT8 type_a, type_b;
+	uint8_t a, b, i;
+	ACPI_STATUS rv;
 
-	return ACPI_SUCCESS(AcpiGetSleepTypeData((UINT8)state,
-type_a, type_b));
+	CTASSERT(ACPI_STATE_S0 == 0  ACPI_STATE_S1 == 1);
+	CTASSERT(ACPI_STATE_S2 == 2  ACPI_STATE_S3 == 3);
+	CTASSERT(ACPI_STATE_S4 == 4  ACPI_STATE_S5 == 5);
+
+	for (i = ACPI_STATE_S0; i = ACPI_STATE_S5; i++) {
+
+		rv = AcpiGetSleepTypeData(i, a, b);
+
+		if (ACPI_SUCCESS(rv))
+			sc-sc_sleepstates |= __BIT(i);
+	}
 }
 
 /*
@@ -1494,84 +1489,100 @@
  *
  *	Enter to the specified sleep state.
  */
-
 ACPI_STATUS
 acpi_enter_sleep_state(struct acpi_softc *sc, int state)
 {
+	ACPI_STATUS rv = AE_OK;
 	int err;
-	ACPI_STATUS ret = AE_OK;
 
-	if (state == acpi_sleepstate)
+	if (state == sc-sc_sleepstate)
 		return AE_OK;
 
-	aprint_normal_dev(sc-sc_dev, 

CVS commit: src/sys/dev/acpi

2010-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Apr 12 18:59:08 UTC 2010

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

Log Message:
Scan the namespace from the root object instead of scanning from separate
scopes. Also raise the namespace walk from 100 (per scope) to UINT32_MAX.

ok jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/dev/acpi/acpi.c

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

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.166 src/sys/dev/acpi/acpi.c:1.167
--- src/sys/dev/acpi/acpi.c:1.166	Mon Apr 12 18:55:27 2010
+++ src/sys/dev/acpi/acpi.c	Mon Apr 12 18:59:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.166 2010/04/12 18:55:27 jruoho Exp $	*/
+/*	$NetBSD: acpi.c,v 1.167 2010/04/12 18:59:08 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.166 2010/04/12 18:55:27 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.167 2010/04/12 18:59:08 jruoho Exp $);
 
 #include opt_acpi.h
 #include opt_pcifixup.h
@@ -653,31 +653,14 @@
 /*
  * acpi_build_tree:
  *
- *	Scan relevant portions of the ACPI namespace and attach
- *	child devices.
+ *	Scan the ACPI namespace and attach child devices.
  */
 static void
 acpi_build_tree(struct acpi_softc *sc)
 {
-	static const char *scopes[] = {
-		\\_PR_, \\_SB_, \\_SI_, \\_TZ_, NULL
-	};
 
-	ACPI_HANDLE parent;
-	ACPI_STATUS rv;
-	int i;
-
-	/*
-	 * Scan the namespace and build our device tree.
-	 */
-	for (i = 0; scopes[i] != NULL; i++) {
-
-		rv = AcpiGetHandle(ACPI_ROOT_OBJECT, scopes[i], parent);
-
-		if (ACPI_SUCCESS(rv))
-			(void)AcpiWalkNamespace(ACPI_TYPE_ANY, parent, 100,
-			acpi_make_devnode, NULL, sc, NULL);
-	}
+	(void)AcpiWalkNamespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+	UINT32_MAX, acpi_make_devnode, NULL, sc, NULL);
 
 	acpi_rescan1(sc, NULL, NULL);
 	acpi_rescan_capabilities(sc);



CVS commit: src/dist/pf/share/man/man4

2010-04-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 12 21:28:24 UTC 2010

Modified Files:
src/dist/pf/share/man/man4: pfsync.4

Log Message:
Bump date for new CAVEATS.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/dist/pf/share/man/man4/pfsync.4

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

Modified files:

Index: src/dist/pf/share/man/man4/pfsync.4
diff -u src/dist/pf/share/man/man4/pfsync.4:1.5 src/dist/pf/share/man/man4/pfsync.4:1.6
--- src/dist/pf/share/man/man4/pfsync.4:1.5	Mon Apr 12 14:26:11 2010
+++ src/dist/pf/share/man/man4/pfsync.4	Mon Apr 12 21:28:23 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: pfsync.4,v 1.5 2010/04/12 14:26:11 ahoka Exp $
+.\	$NetBSD: pfsync.4,v 1.6 2010/04/12 21:28:23 wiz Exp $
 .\	$OpenBSD: pfsync.4,v 1.25 2007/05/31 19:19:51 jmc Exp $
 .\
 .\ Copyright (c) 2002 Michael Shalayeff
@@ -25,7 +25,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd September 14, 2009
+.Dd April 12, 2010
 .Dt PFSYNC 4
 .Os
 .Sh NAME



CVS commit: src/share/man/man9

2010-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Apr 12 21:28:55 UTC 2010

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

Log Message:
Add a FUNCTIONS section.

In addition, small improvements to wording and markup.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man9/fstrans.9

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

Modified files:

Index: src/share/man/man9/fstrans.9
diff -u src/share/man/man9/fstrans.9:1.14 src/share/man/man9/fstrans.9:1.15
--- src/share/man/man9/fstrans.9:1.14	Wed Jun 24 22:39:40 2009
+++ src/share/man/man9/fstrans.9	Mon Apr 12 21:28:55 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: fstrans.9,v 1.14 2009/06/24 22:39:40 zafer Exp $
+.\ $NetBSD: fstrans.9,v 1.15 2010/04/12 21:28:55 jruoho Exp $
 .\
 .\ Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 2, 2007
+.Dd April 13, 2010
 .Dt FSTRANS 9
 .Os
 .Sh NAME
@@ -77,68 +77,76 @@
 .Dv mnt_iflag .
 .Pp
 File systems are always in one of these states:
+.Pp
 .Bl -tag -offset indent -width FSTRANS_SUSPENDING -compact
 .It Dv FSTRANS_NORMAL
-normal operations.
+Normal operations.
 .It Dv FSTRANS_SUSPENDING
-preparing a suspension.
+Preparing a suspension.
 .It Dv FSTRANS_SUSPENDED
-suspended.
+Suspended.
 .El
+.Pp
 This state is represented by
 .Vt enum fstrans_state .
-.Bl -tag -width compact
-.It Fn fstrans_getstate mp
-returns the current state of the file system
-.Fa mp .
-.Pp
-.It Fn fstrans_setstate mp new_state
-changes the state of the file system
-.Fa mp
-to
-.Fa new_state .
-.El
 .Pp
 All file system operations use a
 .Em fstrans lock .
 This lock is recursive.
 A thread already owning a lock will always get another lock.
 The lock has two variants:
-.Bl -tag -offset indent -width FSTRANS_SHARED -compact
+.Bl -tag -offset indent -width FSTRANS_SHARED
 .It Dv FSTRANS_SHARED
-this lock will be granted if the file system is in state
+A lock that will be granted if the file system is in state
 .Dv FSTRANS_NORMAL .
 .It Dv FSTRANS_LAZY
-this lock will be granted if the file system is in state
+A lock that will be granted if the file system is in state
 .Dv FSTRANS_NORMAL
 or
 .Dv FSTRANS_SUSPENDING .
 It needs special care because operations using this variant will not block
 while the file system prepares suspension.
 .El
+.Pp
 The lock variant is represented by
 .Vt enum fstrans_lock_type .
+.Sh FUNCTIONS
+The following functions comprise the
+.Tn API
+provided by
+.Nm .
 .Bl -tag -width compact
+.It Fn fstrans_getstate mp
+Returns the current state of the file system
+.Fa mp .
+.It Fn fstrans_setstate mp new_state
+Changes the state of the file system
+.Fa mp
+to
+.Fa new_state .
 .It Fn fstrans_start mp lock_type
-sets a lock of type
+Sets a lock of type
 .Fa lock_type
 on the file system
 .Fa mp .
 .It Fn fstrans_start_nowait mp lock_type
-will not wait for a state change of the file system when attempting to
+Like
+.Fn fstrans_start ,
+but will not wait for a state change of the file system when attempting to
 acquire the lock.
 The thread may still sleep while attempting to acquire the lock.
 .It Fn fstrans_done mp
-releases a lock on the file system
+Releases a lock on the file system
 .Fa mp .
 .It Fn fstrans_is_owner mp
-returns
+Returns
 .Dv true
 if this thread is currently suspending the file system
 .Fa mp .
 .It Fn fscow_establish mp func cookie
 Establish a copy-on-write callback for the file system
 .Fa mp .
+The function
 .Fa func
 will be called for every buffer written through this file system.
 .It Fn fscow_disestablish mp func cookie



CVS commit: src/sys/rump/librump/rumpvfs

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 21:37:44 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Report f_iosize as 512.  Some callers want it, and we can only
guess a safe default here (because of etfs).


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/rump/librump/rumpvfs/rumpfs.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/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.37 src/sys/rump/librump/rumpvfs/rumpfs.c:1.38
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.37	Mon Mar  1 13:03:30 2010
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Mon Apr 12 21:37:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.37 2010/03/01 13:03:30 pooka Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.38 2010/04/12 21:37:44 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009  Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rumpfs.c,v 1.37 2010/03/01 13:03:30 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rumpfs.c,v 1.38 2010/04/12 21:37:44 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -893,6 +893,7 @@
 
 	mp-mnt_data = rfsmp;
 	mp-mnt_stat.f_namemax = MAXNAMLEN;
+	mp-mnt_stat.f_iosize = 512;
 	mp-mnt_flag |= MNT_LOCAL;
 	vfs_getnewfsid(mp);
 



CVS commit: [netbsd-5] src/external/bsd/openldap/dist/libraries/libldap

2010-04-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 12 21:42:56 UTC 2010

Modified Files:
src/external/bsd/openldap/dist/libraries/libldap [netbsd-5]: tls.c

Log Message:
Apply patch (requested by lukem in ticket #1374):
Fix CVE-2009-3767.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.6.1 \
src/external/bsd/openldap/dist/libraries/libldap/tls.c

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

Modified files:

Index: src/external/bsd/openldap/dist/libraries/libldap/tls.c
diff -u src/external/bsd/openldap/dist/libraries/libldap/tls.c:1.1.1.2 src/external/bsd/openldap/dist/libraries/libldap/tls.c:1.1.1.2.6.1
--- src/external/bsd/openldap/dist/libraries/libldap/tls.c:1.1.1.2	Wed Jul  9 23:56:44 2008
+++ src/external/bsd/openldap/dist/libraries/libldap/tls.c	Mon Apr 12 21:42:56 2010
@@ -1932,7 +1932,7 @@
 	X509 *x;
 	const char *name;
 	char *ptr;
-	int ntype = IS_DNS;
+	int ntype = IS_DNS, nlen;
 #ifdef LDAP_PF_INET6
 	struct in6_addr addr;
 #else
@@ -1946,6 +1946,7 @@
 	} else {
 		name = name_in;
 	}
+	nlen = strlen(name);
 
 	x = tls_get_cert((SSL *)s);
 	if (!x) {
@@ -1979,15 +1980,14 @@
 		ex = X509_get_ext(x, i);
 		alt = X509V3_EXT_d2i(ex);
 		if (alt) {
-			int n, len1 = 0, len2 = 0;
+			int n, len2 = 0;
 			char *domain = NULL;
 			GENERAL_NAME *gn;
 
 			if (ntype == IS_DNS) {
-len1 = strlen(name);
 domain = strchr(name, '.');
 if (domain) {
-	len2 = len1 - (domain-name);
+	len2 = nlen - (domain-name);
 }
 			}
 			n = sk_GENERAL_NAME_num(alt);
@@ -2005,7 +2005,7 @@
 	if (sl == 0) continue;
 
 	/* Is this an exact match? */
-	if ((len1 == sl)  !strncasecmp(name, sn, len1)) {
+	if ((nlen == sl)  !strncasecmp(name, sn, nlen)) {
 		break;
 	}
 
@@ -2045,13 +2045,28 @@
 
 	if (ret != LDAP_SUCCESS) {
 		X509_NAME *xn;
-		char buf[2048];
-		buf[0] = '\0';
+		X509_NAME_ENTRY *ne;
+		ASN1_OBJECT *obj;
+		ASN1_STRING *cn = NULL;
+		int navas;
+
+		/* find the last CN */
+		obj = OBJ_nid2obj( NID_commonName );
+		if ( !obj ) goto no_cn;	/* should never happen */
 
 		xn = X509_get_subject_name(x);
-		if( X509_NAME_get_text_by_NID( xn, NID_commonName,
-			buf, sizeof(buf)) == -1)
+		navas = X509_NAME_entry_count( xn );
+		for ( i=navas-1; i=0; i-- ) {
+			ne = X509_NAME_get_entry( xn, i );
+			if ( !OBJ_cmp( ne-object, obj )) {
+cn = X509_NAME_ENTRY_get_data( ne );
+break;
+			}
+		}
+
+		if( !cn )
 		{
+no_cn:
 			Debug( LDAP_DEBUG_ANY,
 TLS: unable to get common name from peer certificate.\n,
 0, 0, 0 );
@@ -2062,21 +2077,20 @@
 			ld-ld_error = LDAP_STRDUP(
 _(TLS: unable to get CN from peer certificate));
 
-		} else if (strcasecmp(name, buf) == 0 ) {
+		} else if ( cn-length == nlen 
+			strncasecmp( name, (char *) cn-data, nlen ) == 0 ) {
 			ret = LDAP_SUCCESS;
 
-		} else if (( buf[0] == '*' )  ( buf[1] == '.' )) {
+		} else if (( cn-data[0] == '*' )  ( cn-data[1] == '.' )) {
 			char *domain = strchr(name, '.');
 			if( domain ) {
-size_t dlen = 0;
-size_t sl;
+size_t dlen;
 
-sl = strlen(name);
-dlen = sl - (domain-name);
-sl = strlen(buf);
+dlen = nlen - (domain-name);
 
 /* Is this a wildcard match? */
-if ((dlen == sl-1)  !strncasecmp(domain, buf[1], dlen)) {
+if ((dlen == cn-length-1) 
+	!strncasecmp(domain, (char *) cn-data[1], dlen)) {
 	ret = LDAP_SUCCESS;
 }
 			}
@@ -2084,8 +2098,8 @@
 
 		if( ret == LDAP_LOCAL_ERROR ) {
 			Debug( LDAP_DEBUG_ANY, TLS: hostname (%s) does not match 
-common name in certificate (%s).\n, 
-name, buf, 0 );
+common name in certificate (%.*s).\n,
+name, cn-length, cn-data );
 			ret = LDAP_CONNECT_ERROR;
 			if ( ld-ld_error ) {
 LDAP_FREE( ld-ld_error );



CVS commit: [netbsd-5] src/doc

2010-04-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 12 21:46:03 UTC 2010

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

Log Message:
Ticket 1374.


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

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.225 src/doc/CHANGES-5.1:1.1.2.226
--- src/doc/CHANGES-5.1:1.1.2.225	Mon Apr 12 02:32:57 2010
+++ src/doc/CHANGES-5.1	Mon Apr 12 21:46:03 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.225 2010/04/12 02:32:57 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.226 2010/04/12 21:46:03 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -17171,3 +17171,8 @@
 	Update version to 20100320.
 	[lukem, ticket #1372]
 
+external/bsd/openldap/dist/libraries/libldap/tls.c patch
+
+	Fix CVE-2009-3767.
+	[lukem, ticket #1374]
+



CVS commit: [netbsd-5-0] src/external/bsd/openldap/dist/libraries/libldap

2010-04-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 12 21:51:37 UTC 2010

Modified Files:
src/external/bsd/openldap/dist/libraries/libldap [netbsd-5-0]: tls.c

Log Message:
Apply patch (requested by lukem in ticket #1374):
Fix CVE-2009-3767.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.10.1 \
src/external/bsd/openldap/dist/libraries/libldap/tls.c

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

Modified files:

Index: src/external/bsd/openldap/dist/libraries/libldap/tls.c
diff -u src/external/bsd/openldap/dist/libraries/libldap/tls.c:1.1.1.2 src/external/bsd/openldap/dist/libraries/libldap/tls.c:1.1.1.2.10.1
--- src/external/bsd/openldap/dist/libraries/libldap/tls.c:1.1.1.2	Wed Jul  9 23:56:44 2008
+++ src/external/bsd/openldap/dist/libraries/libldap/tls.c	Mon Apr 12 21:51:37 2010
@@ -1932,7 +1932,7 @@
 	X509 *x;
 	const char *name;
 	char *ptr;
-	int ntype = IS_DNS;
+	int ntype = IS_DNS, nlen;
 #ifdef LDAP_PF_INET6
 	struct in6_addr addr;
 #else
@@ -1946,6 +1946,7 @@
 	} else {
 		name = name_in;
 	}
+	nlen = strlen(name);
 
 	x = tls_get_cert((SSL *)s);
 	if (!x) {
@@ -1979,15 +1980,14 @@
 		ex = X509_get_ext(x, i);
 		alt = X509V3_EXT_d2i(ex);
 		if (alt) {
-			int n, len1 = 0, len2 = 0;
+			int n, len2 = 0;
 			char *domain = NULL;
 			GENERAL_NAME *gn;
 
 			if (ntype == IS_DNS) {
-len1 = strlen(name);
 domain = strchr(name, '.');
 if (domain) {
-	len2 = len1 - (domain-name);
+	len2 = nlen - (domain-name);
 }
 			}
 			n = sk_GENERAL_NAME_num(alt);
@@ -2005,7 +2005,7 @@
 	if (sl == 0) continue;
 
 	/* Is this an exact match? */
-	if ((len1 == sl)  !strncasecmp(name, sn, len1)) {
+	if ((nlen == sl)  !strncasecmp(name, sn, nlen)) {
 		break;
 	}
 
@@ -2045,13 +2045,28 @@
 
 	if (ret != LDAP_SUCCESS) {
 		X509_NAME *xn;
-		char buf[2048];
-		buf[0] = '\0';
+		X509_NAME_ENTRY *ne;
+		ASN1_OBJECT *obj;
+		ASN1_STRING *cn = NULL;
+		int navas;
+
+		/* find the last CN */
+		obj = OBJ_nid2obj( NID_commonName );
+		if ( !obj ) goto no_cn;	/* should never happen */
 
 		xn = X509_get_subject_name(x);
-		if( X509_NAME_get_text_by_NID( xn, NID_commonName,
-			buf, sizeof(buf)) == -1)
+		navas = X509_NAME_entry_count( xn );
+		for ( i=navas-1; i=0; i-- ) {
+			ne = X509_NAME_get_entry( xn, i );
+			if ( !OBJ_cmp( ne-object, obj )) {
+cn = X509_NAME_ENTRY_get_data( ne );
+break;
+			}
+		}
+
+		if( !cn )
 		{
+no_cn:
 			Debug( LDAP_DEBUG_ANY,
 TLS: unable to get common name from peer certificate.\n,
 0, 0, 0 );
@@ -2062,21 +2077,20 @@
 			ld-ld_error = LDAP_STRDUP(
 _(TLS: unable to get CN from peer certificate));
 
-		} else if (strcasecmp(name, buf) == 0 ) {
+		} else if ( cn-length == nlen 
+			strncasecmp( name, (char *) cn-data, nlen ) == 0 ) {
 			ret = LDAP_SUCCESS;
 
-		} else if (( buf[0] == '*' )  ( buf[1] == '.' )) {
+		} else if (( cn-data[0] == '*' )  ( cn-data[1] == '.' )) {
 			char *domain = strchr(name, '.');
 			if( domain ) {
-size_t dlen = 0;
-size_t sl;
+size_t dlen;
 
-sl = strlen(name);
-dlen = sl - (domain-name);
-sl = strlen(buf);
+dlen = nlen - (domain-name);
 
 /* Is this a wildcard match? */
-if ((dlen == sl-1)  !strncasecmp(domain, buf[1], dlen)) {
+if ((dlen == cn-length-1) 
+	!strncasecmp(domain, (char *) cn-data[1], dlen)) {
 	ret = LDAP_SUCCESS;
 }
 			}
@@ -2084,8 +2098,8 @@
 
 		if( ret == LDAP_LOCAL_ERROR ) {
 			Debug( LDAP_DEBUG_ANY, TLS: hostname (%s) does not match 
-common name in certificate (%s).\n, 
-name, buf, 0 );
+common name in certificate (%.*s).\n,
+name, cn-length, cn-data );
 			ret = LDAP_CONNECT_ERROR;
 			if ( ld-ld_error ) {
 LDAP_FREE( ld-ld_error );



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

2010-04-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 12 21:55:48 UTC 2010

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

Log Message:
Ticket 1374.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 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.9 src/doc/CHANGES-5.0.3:1.1.2.10
--- src/doc/CHANGES-5.0.3:1.1.2.9	Mon Apr 12 02:36:38 2010
+++ src/doc/CHANGES-5.0.3	Mon Apr 12 21:55:48 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.9 2010/04/12 02:36:38 snj Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.10 2010/04/12 21:55:48 snj Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -188,3 +188,8 @@
 	Update version to 20100320.
 	[lukem, ticket #1372]
 
+external/bsd/openldap/dist/libraries/libldap/tls.c patch
+
+	Fix CVE-2009-3767.
+	[lukem, ticket #1374]
+



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

2010-04-12 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Mon Apr 12 22:00:51 UTC 2010

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

Log Message:
- rmixl_pcix and rmixl_pcie get 'needs-flag'


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/arch/mips/conf/files.rmixl

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

Modified files:

Index: src/sys/arch/mips/conf/files.rmixl
diff -u src/sys/arch/mips/conf/files.rmixl:1.1.2.11 src/sys/arch/mips/conf/files.rmixl:1.1.2.12
--- src/sys/arch/mips/conf/files.rmixl:1.1.2.11	Wed Apr  7 19:31:37 2010
+++ src/sys/arch/mips/conf/files.rmixl	Mon Apr 12 22:00:51 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rmixl,v 1.1.2.11 2010/04/07 19:31:37 cliff Exp $
+#	$NetBSD: files.rmixl,v 1.1.2.12 2010/04/12 22:00:51 cliff Exp $
 #
 # Configuration info for RMI XLP, XLR, XLS
 #
@@ -44,12 +44,12 @@
 # PCIe
 device  rmixl_pcie: pcibus
 attach  rmixl_pcie at obio
-filearch/mips/rmi/rmixl_pcie.c		rmixl_pcie
+filearch/mips/rmi/rmixl_pcie.c		rmixl_pcie	needs-flag
 
 # PCI-X
 device  rmixl_pcix: pcibus
 attach  rmixl_pcix at obio
-filearch/mips/rmi/rmixl_pcix.c		rmixl_pcix
+filearch/mips/rmi/rmixl_pcix.c		rmixl_pcix	needs-flag
 
 # On-chip USB interface
 define rmixl_usbi { [addr=-1], [size=-1], [intr=-1] }



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

2010-04-12 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Mon Apr 12 22:01:14 UTC 2010

Modified Files:
src/sys/arch/evbmips/conf [matt-nb5-mips64]: XLSATX

Log Message:
- wildcard pci at pcie0


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/arch/evbmips/conf/XLSATX

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

Modified files:

Index: src/sys/arch/evbmips/conf/XLSATX
diff -u src/sys/arch/evbmips/conf/XLSATX:1.1.2.7 src/sys/arch/evbmips/conf/XLSATX:1.1.2.8
--- src/sys/arch/evbmips/conf/XLSATX:1.1.2.7	Wed Apr  7 19:31:37 2010
+++ src/sys/arch/evbmips/conf/XLSATX	Mon Apr 12 22:01:14 2010
@@ -1,8 +1,8 @@
-#	$NetBSD: XLSATX,v 1.1.2.7 2010/04/07 19:31:37 cliff Exp $
+#	$NetBSD: XLSATX,v 1.1.2.8 2010/04/12 22:01:14 cliff Exp $
 
 include 	arch/evbmips/conf/std.rmixl
 
-#ident 		XLSATX-$Revision: 1.1.2.7 $
+#ident 		XLSATX-$Revision: 1.1.2.8 $
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
@@ -146,7 +146,7 @@
 rmixl_pcix0	at obio0
 pci*		at rmixl_pcix0
 rmixl_pcie0	at obio0
-pci0		at rmixl_pcie0
+pci*		at rmixl_pcie0
 ppb*		at pci?
 pci*		at ppb?
 wm*		at pci? dev ? function ?	# Intel i82546EB Gig-E



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

2010-04-12 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Mon Apr 12 22:01:42 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c

Log Message:
- add whitespace to make print format of regions in
mips_page_physload() more readable


To generate a diff of this commit:
cvs rdiff -u -r1.205.4.1.2.1.2.42 -r1.205.4.1.2.1.2.43 \
src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.42 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.43
--- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.42	Mon Mar 29 23:33:37 2010
+++ src/sys/arch/mips/mips/mips_machdep.c	Mon Apr 12 22:01:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.42 2010/03/29 23:33:37 cliff Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.43 2010/04/12 22:01:41 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.42 2010/03/29 23:33:37 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.43 2010/04/12 22:01:41 cliff Exp $);
 
 #define	__INTR_PRIVATE
 
@@ -1671,7 +1671,7 @@
 		paddr_t segstart = round_page(segs-start);
 		const paddr_t segfinish = trunc_page(segs-start + segs-size);
 
-		printf(phys segment: %#PRIxPADDR@%#PRIxPADDR\n,
+		printf(phys segment: %#PRIxPADDR @ %#PRIxPADDR\n,
 		segfinish - segstart, segstart);
 
 		/*
@@ -1760,7 +1760,7 @@
 	 * Just skip the segment entirely since
 	 * it's completely inside the kernel.
 	 */
-	printf(skipping %#PRIxPADDR@%#PRIxPADDR (kernel)\n,
+	printf(skipping %#PRIxPADDR @ %#PRIxPADDR (kernel)\n,
 	segend - segstart, segstart);
 	break;
 }
@@ -1769,7 +1769,7 @@
 			/*
 			 * Now we give this segment to uvm.
 			 */
-			printf(adding %#PRIxPADDR@%#PRIxPADDR to freelist %d\n,
+			printf(adding %#PRIxPADDR @ %#PRIxPADDR to freelist %d\n,
 			
 			segend - segstart, segstart, freelist);
 			paddr_t first = atop(segstart);



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

2010-04-12 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Mon Apr 12 22:02:52 UTC 2010

Modified Files:
src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c

Log Message:
- include rmixl_pcix.h and rmixl_pcie.h to get the config flags
- include rmixl_pcixvar.h to get proto for rmixl_physaddr_init_pcix()
- calls to rmixl_physaddr_init_pcix() and rmixl_physaddr_init_pcie()
depend on the config flags
- eliminate vm_clusters[], just use mem_clusters[] for everything
- add mem_cluster_maxaddr to track highest RAM addr,
used to check PCI-X Host BARs; calculate his value just before
calling mips_page_physload() i.e. once mem_clusters[] is stable.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/sys/arch/evbmips/rmixl/machdep.c

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

Modified files:

Index: src/sys/arch/evbmips/rmixl/machdep.c
diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.27 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.28
--- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.27	Mon Mar 29 23:40:58 2010
+++ src/sys/arch/evbmips/rmixl/machdep.c	Mon Apr 12 22:02:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.1.2.27 2010/03/29 23:40:58 cliff Exp $	*/
+/*	$NetBSD: machdep.c,v 1.1.2.28 2010/04/12 22:02:52 cliff Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.27 2010/03/29 23:40:58 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.28 2010/04/12 22:02:52 cliff Exp $);
 
 #define __INTR_PRIVATE
 
@@ -120,6 +120,8 @@
 #include opt_com.h
 #include opt_execfmt.h
 #include opt_memsize.h
+#include rmixl_pcix.h
+#include rmixl_pcie.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -167,6 +169,7 @@
 #include mips/rmi/rmixl_firmware.h
 #include mips/rmi/rmixl_comvar.h
 #include mips/rmi/rmixl_pcievar.h
+#include mips/rmi/rmixl_pcixvar.h
 
 #ifdef MACHDEP_DEBUG
 int machdep_debug=MACHDEP_DEBUG;
@@ -241,6 +244,7 @@
 
 
 phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];
+u_quad_t mem_cluster_maxaddr;
 u_int mem_cluster_cnt;
 
 
@@ -278,9 +282,7 @@
 	struct rmixl_config *rcp = rmixl_configuration;
 	void *kernend;
 	uint64_t memsize;
-	u_int vm_cluster_cnt;
 	uint32_t r;
-	phys_ram_seg_t vm_clusters[VM_PHYSSEG_MAX];
 	extern char edata[], end[];
 
 #ifndef MULTIPROCESSOR
@@ -397,41 +399,45 @@
 
 	/*
 	 * Reserve pages from the VM system.
-	 * to maintain mem_clusters[] as a map of raw ram,
-	 * copy into temporary table vm_clusters[]
-	 * work on that and use it to feed vm_physload()
 	 */
-	KASSERT(sizeof(mem_clusters) == sizeof(vm_clusters));
-	memcpy(vm_clusters, mem_clusters, sizeof(vm_clusters));
-	vm_cluster_cnt = mem_cluster_cnt;
 
 	/* reserve 0..start..kernend pages */
-	vm_cluster_cnt = ram_seg_resv(vm_clusters, vm_cluster_cnt,
+	mem_cluster_cnt = ram_seg_resv(mem_clusters, mem_cluster_cnt,
 		0, round_page(MIPS_KSEG0_TO_PHYS(kernend)));
 
 	/* reserve reset exception vector page */
 	/* should never be in our clusters anyway... */
-	vm_cluster_cnt = ram_seg_resv(vm_clusters, vm_cluster_cnt,
+	mem_cluster_cnt = ram_seg_resv(mem_clusters, mem_cluster_cnt,
 		0x1FC0, 0x1FC0+NBPG);
 
 #ifdef MULTIPROCEESOR
 	/* reserve the cpu_wakeup_info area */
-	vm_cluster_cnt = ram_seg_resv(vm_clusters, vm_cluster_cnt,
+	mem_cluster_cnt = ram_seg_resv(mem_clusters, mem_cluster_cnt,
 		(u_quad_t)trunc_page(rcp-rc_cpu_wakeup_info),
 		(u_quad_t)round_page(rcp-rc_cpu_wakeup_end));
 #endif
 
 #ifdef MEMLIMIT
 	/* reserve everything = MEMLIMIT */
-	vm_cluster_cnt = ram_seg_resv(vm_clusters, vm_cluster_cnt,
+	mem_cluster_cnt = ram_seg_resv(mem_clusters, mem_cluster_cnt,
 		(u_quad_t)MEMLIMIT, (u_quad_t)~0);
 #endif
 
+	/* get maximum RAM address from the VM clusters */
+	mem_cluster_maxaddr = 0;
+	for (u_int i=0; i  mem_cluster_cnt; i++) {
+		u_quad_t tmp = round_page(
+			mem_clusters[i].start + mem_clusters[i].size);
+		if (tmp  mem_cluster_maxaddr)
+			mem_cluster_maxaddr = tmp;
+	}
+	DPRINTF((mem_cluster_maxaddr %#PRIx64\n, mem_cluster_maxaddr));
+
 	/*
-	 * Load vm_clusters[] into the VM system.
+	 * Load mem_clusters[] into the VM system.
 	 */
 	mips_page_physload(MIPS_KSEG0_START, (vaddr_t) kernend,
-	vm_clusters, vm_cluster_cnt, NULL, 0);
+	mem_clusters, mem_cluster_cnt, NULL, 0);
 
 	/*
 	 * Initialize error message buffer (at end of core).
@@ -614,10 +620,14 @@
 	 */
 	switch(cpu_rmixl_chip_type(mips_options.mips_cpu)) {
 	case CIDFL_RMI_TYPE_XLR:
-		/* XXX TBD */
+#if NRMIXL_PCIX
+		rmixl_physaddr_init_pcix(ext);
+#endif
 		break;
 	case CIDFL_RMI_TYPE_XLS:
+#if NRMIXL_PCIE
 		rmixl_physaddr_init_pcie(ext);
+#endif
 		break;
 	case CIDFL_RMI_TYPE_XLP:
 		/* XXX TBD */



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

2010-04-12 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Mon Apr 12 22:03:33 UTC 2010

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_pcix.c

Log Message:
- add bit defines for HOST_MODE_CTL reg
- panic if Host BAR regs do not cover RAM addrs 0..mem_cluster_maxaddr


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_pcix.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_pcix.c
diff -u src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.2
--- src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.1	Wed Apr  7 19:25:48 2010
+++ src/sys/arch/mips/rmi/rmixl_pcix.c	Mon Apr 12 22:03:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_pcix.c,v 1.1.2.1 2010/04/07 19:25:48 cliff Exp $	*/
+/*	$NetBSD: rmixl_pcix.c,v 1.1.2.2 2010/04/12 22:03:33 cliff Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_pcix.c,v 1.1.2.1 2010/04/07 19:25:48 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_pcix.c,v 1.1.2.2 2010/04/12 22:03:33 cliff Exp $);
 
 #include opt_pci.h
 #include pci.h
@@ -161,6 +161,18 @@
 #define PCIX_INTR_ERR_STATUS_RESV	\
 		(PCIX_INTR_ERR_STATUS_RESa|PCIX_INTR_ERR_STATUS_RESb)
 
+/*
+ * RMIXL_PCIX_ECFG_HOST_MODE_CTL bit defines
+ */
+#define PCIX_HOST_MODE_CTL_HDMSTAT	__BIT(1)	/* Host/Dev Mode status
+			 *  read-only
+			 *  1 = host
+			 *  0 = device
+			 */
+#define PCIX_HOST_MODE_CTL_HOSTSWRST	__BIT(0)	/* Host soft reset
+			 *  set to 1 to reset
+			 *  set to 0 to un-reset
+			 */
 
 
 #if BYTE_ORDER == BIG_ENDIAN
@@ -278,7 +290,7 @@
 
 	/* read Host Mode Control register */
 	r = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_HOST_MODE_CTL);
-	r = __BIT(1);		/* XXX HDMStat */
+	r = PCIX_HOST_MODE_CTL_HDMSTAT;
 	if (r == 0)
 		return 0;	/* strapped for Device Mode */
 
@@ -313,22 +325,39 @@
 	/*
 	 * check XLR Control Register
 	 */
-	uint32_t xlr_control;
-	xlr_control = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_XLR_CONTROL);
-	printf(%s: XLR_CONTROL=%#x\n, __func__, xlr_control);
-
-	/*
-	 * check HBAR[0..7]
-	 */
-	uint32_t hbar_addr, hbar_size;
-	u_int addr_off = RMIXL_PCIX_ECFG_HOST_BAR0_ADDR;
-	u_int size_off = RMIXL_PCIX_ECFG_HOST_BAR0_SIZE;
-	for (int i=0; i  7; i++) {
-		hbar_addr = RMIXL_PCIXREG_READ(addr_off);
-		hbar_size = RMIXL_PCIXREG_READ(size_off);
-		addr_off += 4;
-		size_off += 4;
-		printf(%s: HBAR[%d]=%#x @ %#x\n, __func__, i, hbar_size, hbar_addr);
+	DPRINTF((%s: XLR_CONTROL=%#x\n, __func__, 
+		RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_XLR_CONTROL)));
+
+	/*
+	 * HBAR[0]   if a 32 bit BAR, or
+	 * HBAR[0,1] if a 64 bit BAR pair 
+	 * must cover all RAM
+	 */
+	extern u_quad_t mem_cluster_maxaddr;
+	uint64_t hbar_addr;
+	uint64_t hbar_size;
+	uint32_t hbar_size_lo, hbar_size_hi;
+	uint32_t hbar_addr_lo, hbar_addr_hi;
+
+	hbar_addr_lo = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_HOST_BAR0_ADDR);
+	hbar_addr_hi = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_HOST_BAR1_ADDR);
+	hbar_size_lo = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_HOST_BAR0_SIZE);
+	hbar_size_hi = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_HOST_BAR1_SIZE);
+
+	hbar_addr = (u_quad_t)(hbar_addr_lo  PCI_MAPREG_MEM_ADDR_MASK);
+	hbar_size = hbar_size_lo;
+	if ((hbar_size_lo  PCI_MAPREG_MEM_TYPE_64BIT) != 0) {
+		hbar_addr |= (uint64_t)hbar_addr_hi  32;
+		hbar_size |= (uint64_t)hbar_size_hi  32;
+	}
+	if ((hbar_addr != 0) || (hbar_size  mem_cluster_maxaddr)) {
+		printf(%s: HostBAR0 addr %#x, size %#x\n,
+			device_xname(self), hbar_addr_lo, hbar_size_lo);
+		if ((hbar_size_lo  PCI_MAPREG_MEM_TYPE_64BIT) != 0)
+			printf(%s: HostBAR1 addr %#x, size %#x\n,
+device_xname(self), hbar_addr_hi, hbar_size_hi);
+		panic(PCI-X Host BAR does not cover RAM range 0..%#PRIx64,
+			mem_cluster_maxaddr);
 	}
 
 	/*
@@ -339,7 +368,7 @@
 	mble = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_XLR_MBLE);
 	mba  = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_MATCH_BIT_ADDR);
 	mbs  = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_MATCH_BIT_SIZE);
-	printf(%s: MBLE=%#x, MBA=%#x, MBS=%#x\n, __func__, mble, mba, mbs);
+	DPRINTF((%s: MBLE=%#x, MBA=%#x, MBS=%#x\n, __func__, mble, mba, mbs));
 	if ((mble  __BIT(40)) != 0)
 		RMIXL_PCIXREG_WRITE(RMIXL_PCIX_ECFG_XLR_MBLE, 0);
 
@@ -368,8 +397,6 @@
 	}
 	rcp-rc_pci_mem_pbase = (bus_addr_t)RMIXL_PCIX_MEM_BAR_TO_BA(bar);
 	rcp-rc_pci_mem_size  = (bus_size_t)RMIXL_PCIX_MEM_BAR_TO_SIZE(bar);
-printf(%s: rc_pci_mem_pbase %#PRIxBUSADDR, rc_pci_mem_size %#PRIxBUSSIZE\n,
-__func__, rcp-rc_pci_mem_pbase, rcp-rc_pci_mem_size);
 
 	/*
 	 * get PCI IO space base [addr, size] from SBC PCIe IO BAR



CVS commit: src/sys

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:15:32 UTC 2010

Modified Files:
src/sys/conf: files
src/sys/kern: kern_lwp.c
src/sys/sys: lwp.h
Added Files:
src/sys/kern: subr_lwp_specificdata.c

Log Message:
Separate lwp specificdata data structure management from lwp cpu/vm
management.

No functional change.

(specificdata routines went from kern_lwp.c to subr_lwp_specificdata.c)


To generate a diff of this commit:
cvs rdiff -u -r1.985 -r1.986 src/sys/conf/files
cvs rdiff -u -r1.143 -r1.144 src/sys/kern/kern_lwp.c
cvs rdiff -u -r0 -r1.1 src/sys/kern/subr_lwp_specificdata.c
cvs rdiff -u -r1.129 -r1.130 src/sys/sys/lwp.h

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.985 src/sys/conf/files:1.986
--- src/sys/conf/files:1.985	Fri Apr  9 10:09:49 2010
+++ src/sys/conf/files	Mon Apr 12 22:15:32 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.985 2010/04/09 10:09:49 nonaka Exp $
+#	$NetBSD: files,v 1.986 2010/04/12 22:15:32 pooka Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20090313
@@ -1510,6 +1510,7 @@
 file	kern/subr_kobj_vfs.c
 file	kern/subr_lockdebug.c
 file	kern/subr_log.c
+file	kern/subr_lwp_specificdata.c
 file	kern/subr_once.c
 file	kern/subr_optstr.c
 file	kern/subr_percpu.c

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.143 src/sys/kern/kern_lwp.c:1.144
--- src/sys/kern/kern_lwp.c:1.143	Fri Apr  9 11:47:17 2010
+++ src/sys/kern/kern_lwp.c	Mon Apr 12 22:15:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.143 2010/04/09 11:47:17 njoly Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.144 2010/04/12 22:15:31 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -209,7 +209,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_lwp.c,v 1.143 2010/04/09 11:47:17 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_lwp.c,v 1.144 2010/04/12 22:15:31 pooka Exp $);
 
 #include opt_ddb.h
 #include opt_lockdebug.h
@@ -247,7 +247,6 @@
 struct pool lwp_uc_pool;
 
 static pool_cache_t lwp_cache;
-static specificdata_domain_t lwp_specificdata_domain;
 
 /* DTrace proc provider probes */
 SDT_PROBE_DEFINE(proc,,,lwp_create,
@@ -269,8 +268,7 @@
 
 	pool_init(lwp_uc_pool, sizeof(ucontext_t), 0, 0, 0, lwpucpl,
 	pool_allocator_nointr, IPL_NONE);
-	lwp_specificdata_domain = specificdata_domain_create();
-	KASSERT(lwp_specificdata_domain != NULL);
+	lwpinit_specificdata();
 	lwp_sys_init();
 	lwp_cache = pool_cache_init(sizeof(lwp_t), MIN_LWP_ALIGNMENT, 0, 0,
 	lwppl, NULL, IPL_NONE, NULL, NULL, NULL);
@@ -829,7 +827,7 @@
 	fd_free();
 
 	/* Delete the specificdata while it's still safe to sleep. */
-	specificdata_fini(lwp_specificdata_domain, l-l_specdataref);
+	lwp_finispecific(l)
 
 	/*
 	 * Release our cached credentials.
@@ -1513,91 +1511,6 @@
 }
 
 /*
- * lwp_specific_key_create --
- *	Create a key for subsystem lwp-specific data.
- */
-int
-lwp_specific_key_create(specificdata_key_t *keyp, specificdata_dtor_t dtor)
-{
-
-	return (specificdata_key_create(lwp_specificdata_domain, keyp, dtor));
-}
-
-/*
- * lwp_specific_key_delete --
- *	Delete a key for subsystem lwp-specific data.
- */
-void
-lwp_specific_key_delete(specificdata_key_t key)
-{
-
-	specificdata_key_delete(lwp_specificdata_domain, key);
-}
-
-/*
- * lwp_initspecific --
- *	Initialize an LWP's specificdata container.
- */
-void
-lwp_initspecific(struct lwp *l)
-{
-	int error;
-
-	error = specificdata_init(lwp_specificdata_domain, l-l_specdataref);
-	KASSERT(error == 0);
-}
-
-/*
- * lwp_finispecific --
- *	Finalize an LWP's specificdata container.
- */
-void
-lwp_finispecific(struct lwp *l)
-{
-
-	specificdata_fini(lwp_specificdata_domain, l-l_specdataref);
-}
-
-/*
- * lwp_getspecific --
- *	Return lwp-specific data corresponding to the specified key.
- *
- *	Note: LWP specific data is NOT INTERLOCKED.  An LWP should access
- *	only its OWN SPECIFIC DATA.  If it is necessary to access another
- *	LWP's specifc data, care must be taken to ensure that doing so
- *	would not cause internal data structure inconsistency (i.e. caller
- *	can guarantee that the target LWP is not inside an lwp_getspecific()
- *	or lwp_setspecific() call).
- */
-void *
-lwp_getspecific(specificdata_key_t key)
-{
-
-	return (specificdata_getspecific_unlocked(lwp_specificdata_domain,
-		  curlwp-l_specdataref, key));
-}
-
-void *
-_lwp_getspecific_by_lwp(struct lwp *l, specificdata_key_t key)
-{
-
-	return (specificdata_getspecific_unlocked(lwp_specificdata_domain,
-		  l-l_specdataref, key));
-}
-
-/*
- * lwp_setspecific --
- *	Set lwp-specific data corresponding to the specified key.
- */
-void
-lwp_setspecific(specificdata_key_t key, void *data)
-{
-
-	specificdata_setspecific(lwp_specificdata_domain,
- curlwp-l_specdataref, key, data);
-}
-
-/*
  * Allocate a new lwpctl structure for a user 

CVS commit: src/sys/rump/librump/rumpkern

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:17:23 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: Makefile.rumpkern rump.c

Log Message:
support lwp specificdata


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r1.158 -r1.159 src/sys/rump/librump/rumpkern/rump.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/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.74 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.75
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.74	Tue Feb 16 20:42:47 2010
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Mon Apr 12 22:17:23 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.74 2010/02/16 20:42:47 pooka Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.75 2010/04/12 22:17:23 pooka Exp $
 #
 
 .include ${RUMPTOP}/Makefile.rump
@@ -46,8 +46,9 @@
 # sys/kern subr (misc)
 SRCS+=	subr_devsw.c subr_callback.c subr_copy.c subr_device.c		\
 	subr_evcnt.c subr_extent.c subr_hash.c subr_humanize.c		\
-	subr_iostat.c subr_kobj.c subr_log.c subr_once.c subr_prf.c	\
-	subr_specificdata.c subr_time.c subr_workqueue.c subr_xcall.c
+	subr_iostat.c subr_kobj.c subr_log.c subr_lwp_specificdata.c	\
+	subr_once.c subr_prf.c subr_specificdata.c subr_time.c		\
+	subr_workqueue.c subr_xcall.c
 
 # sys/uvm
 SRCS+=	uvm_readahead.c

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.158 src/sys/rump/librump/rumpkern/rump.c:1.159
--- src/sys/rump/librump/rumpkern/rump.c:1.158	Wed Mar 31 18:56:07 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Mon Apr 12 22:17:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.158 2010/03/31 18:56:07 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.159 2010/04/12 22:17:23 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.158 2010/03/31 18:56:07 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.159 2010/04/12 22:17:23 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -277,6 +277,7 @@
 	LIST_INIT(allproc);
 	LIST_INSERT_HEAD(allproc, proc0, p_list);
 	proc_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
+	lwpinit_specificdata();
 
 	rump_limits.pl_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
 	rump_limits.pl_rlimit[RLIMIT_NOFILE].rlim_cur = RLIM_INFINITY;
@@ -488,6 +489,7 @@
 	l-l_lid = lid;
 	l-l_fd = p-p_fd;
 	l-l_cpu = NULL;
+	lwp_initspecific(l);
 
 	return l;
 }
@@ -534,6 +536,7 @@
 	KASSERT(l-l_mutex == NULL);
 	if (l-l_name)
 		kmem_free(l-l_name, MAXCOMLEN);
+	lwp_finispecific(l);
 	kmem_free(l, sizeof(*l));
 }
 



CVS commit: src/sys/rump/librump/rumpvfs

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:19:18 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: Makefile.rumpvfs rump_vfs.c
Removed Files:
src/sys/rump/librump/rumpvfs: fstrans_stub.c

Log Message:
Support real file system transactions/suspension (vfs_trans.c)
instead of just stubbing it.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs
cvs rdiff -u -r1.2 -r0 src/sys/rump/librump/rumpvfs/fstrans_stub.c
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/librump/rumpvfs/rump_vfs.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/librump/rumpvfs/Makefile.rumpvfs
diff -u src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.26 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.27
--- src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.26	Mon Mar 29 13:20:31 2010
+++ src/sys/rump/librump/rumpvfs/Makefile.rumpvfs	Mon Apr 12 22:19:17 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpvfs,v 1.26 2010/03/29 13:20:31 pooka Exp $
+#	$NetBSD: Makefile.rumpvfs,v 1.27 2010/04/12 22:19:17 pooka Exp $
 #
 
 .include ${RUMPTOP}/Makefile.rump
@@ -17,8 +17,6 @@
 # 
 SRCS=	rump_vfs.c devnodes.c devnull.c rumpblk.c rumpfs.c vm_vfs.c
 
-SRCS+=	fstrans_stub.c
-
 SRCS+=	rumpvfs_if_wrappers.c
 
 # sys/kern I/O
@@ -27,7 +25,7 @@
 # sys/kern vfs
 SRCS+=	vfs_bio.c vfs_cache.c vfs_cwd.c vfs_dirhash.c vfs_getcwd.c	\
 	vfs_hooks.c vfs_init.c vfs_lockf.c vfs_lookup.c vfs_subr.c	\
-	vfs_syscalls.c vfs_vnops.c vfs_wapbl.c vfs_xattr.c
+	vfs_syscalls.c vfs_trans.c vfs_vnops.c vfs_wapbl.c vfs_xattr.c
 
 # sys/kern module (and syscall)
 SRCS+=	kern_module_vfs.c subr_kobj_vfs.c sys_module.c

Index: src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.44 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.45
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.44	Fri Mar 26 18:21:28 2010
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c	Mon Apr 12 22:19:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_vfs.c,v 1.44 2010/03/26 18:21:28 pooka Exp $	*/
+/*	$NetBSD: rump_vfs.c,v 1.45 2010/04/12 22:19:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,13 +29,14 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.44 2010/03/26 18:21:28 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.45 2010/04/12 22:19:17 pooka Exp $);
 
 #include sys/param.h
 #include sys/buf.h
 #include sys/conf.h
 #include sys/evcnt.h
 #include sys/filedesc.h
+#include sys/fstrans.h
 #include sys/lockf.h
 #include sys/kthread.h
 #include sys/module.h
@@ -102,6 +103,7 @@
 	cwd_sys_init();
 	lf_init();
 	spec_init();
+	fstrans_init();
 
 	if (rump_threads) {
 		if ((rv = kthread_create(PRI_BIO, KTHREAD_MPSAFE, NULL,



CVS commit: src/sys/dev

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:29:11 UTC 2010

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

Log Message:
Ignore EEXIST from devsw_attach.  This is not the optimal solution,
but it makes it possible to dynamically create device nodes for
fss before the fss module init runs by allowing to run devsw_attach
earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/fss.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/fss.c
diff -u src/sys/dev/fss.c:1.66 src/sys/dev/fss.c:1.67
--- src/sys/dev/fss.c:1.66	Mon Apr  5 09:30:46 2010
+++ src/sys/dev/fss.c	Mon Apr 12 22:29:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.66 2010/04/05 09:30:46 hannken Exp $	*/
+/*	$NetBSD: fss.c,v 1.67 2010/04/12 22:29:11 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.66 2010/04/05 09:30:46 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.67 2010/04/12 22:29:11 pooka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1248,6 +1248,8 @@
 		}
 		error = devsw_attach(fss_cd.cd_name,
 		fss_bdevsw, bmajor, fss_cdevsw, cmajor);
+		if (error == EEXIST)
+			error = 0;
 		if (error) {
 			config_cfattach_detach(fss_cd.cd_name, fss_ca);
 			config_cfdriver_detach(fss_cd);



CVS commit: src/sys/rump/dev

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:31:48 UTC 2010

Modified Files:
src/sys/rump/dev: Makefile.rumpdev
Added Files:
src/sys/rump/dev/lib/libfss: Makefile component.c shlib_version

Log Message:
support file system snapshot device


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/dev/Makefile.rumpdev
cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libfss/Makefile \
src/sys/rump/dev/lib/libfss/component.c \
src/sys/rump/dev/lib/libfss/shlib_version

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/dev/Makefile.rumpdev
diff -u src/sys/rump/dev/Makefile.rumpdev:1.10 src/sys/rump/dev/Makefile.rumpdev:1.11
--- src/sys/rump/dev/Makefile.rumpdev:1.10	Mon Mar 22 12:14:51 2010
+++ src/sys/rump/dev/Makefile.rumpdev	Mon Apr 12 22:31:48 2010
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile.rumpdev,v 1.10 2010/03/22 12:14:51 pooka Exp $
+#	$NetBSD: Makefile.rumpdev,v 1.11 2010/04/12 22:31:48 pooka Exp $
 #
 
-RUMPDEVLIST=	bpf cgd disk dm netsmb raidframe rnd sysmon ubt ucom	\
-		ugenhc ulpt umass usb wscons
+RUMPDEVLIST=	bpf cgd disk dm fss netsmb raidframe rnd sysmon		\
+		ubt ucom ugenhc ulpt umass usb wscons
 
 
 .for var in ${RUMPDEVLIST}

Added files:

Index: src/sys/rump/dev/lib/libfss/Makefile
diff -u /dev/null src/sys/rump/dev/lib/libfss/Makefile:1.1
--- /dev/null	Mon Apr 12 22:31:48 2010
+++ src/sys/rump/dev/lib/libfss/Makefile	Mon Apr 12 22:31:48 2010
@@ -0,0 +1,15 @@
+#	$NetBSD: Makefile,v 1.1 2010/04/12 22:31:48 pooka Exp $
+#
+
+.PATH:	${.CURDIR}/../../../../dev
+
+LIB=	rumpdev_fss
+
+SRCS=   fss.c
+
+SRCS+=	component.c
+
+CPPFLAGS+=	-I${RUMPTOP}/librump/rumpvfs
+
+.include bsd.lib.mk
+.include bsd.klinks.mk
Index: src/sys/rump/dev/lib/libfss/component.c
diff -u /dev/null src/sys/rump/dev/lib/libfss/component.c:1.1
--- /dev/null	Mon Apr 12 22:31:48 2010
+++ src/sys/rump/dev/lib/libfss/component.c	Mon Apr 12 22:31:48 2010
@@ -0,0 +1,59 @@
+/*	$NetBSD: component.c,v 1.1 2010/04/12 22:31:48 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: component.c,v 1.1 2010/04/12 22:31:48 pooka Exp $);
+
+#include sys/param.h
+#include sys/conf.h
+#include sys/device.h
+#include sys/stat.h
+
+#include rump_private.h
+#include rump_vfs_private.h
+
+RUMP_COMPONENT(RUMP_COMPONENT_DEV)
+{
+	extern const struct bdevsw fss_bdevsw;
+	extern const struct cdevsw fss_cdevsw;
+	devmajor_t bmaj, cmaj;
+	int error;
+
+	bmaj = bdevsw_lookup_major(fss_bdevsw);
+	cmaj = cdevsw_lookup_major(fss_cdevsw);
+
+	if ((error = devsw_attach(fss, fss_bdevsw, bmaj,
+	fss_cdevsw, cmaj)) != 0)
+		panic(cannot attach fss: %d, error);
+
+	if ((error = rump_vfs_makedevnodes(S_IFBLK, /dev/fss, '0',
+	bmaj, 0, 4)) != 0)
+		panic(cannot create cooked fss dev nodes: %d, error);
+	if ((error = rump_vfs_makedevnodes(S_IFCHR, /dev/rfss, '0',
+	cmaj, 0, 4)) != 0)
+		panic(cannot create raw fss dev nodes: %d, error);
+}
Index: src/sys/rump/dev/lib/libfss/shlib_version
diff -u /dev/null src/sys/rump/dev/lib/libfss/shlib_version:1.1
--- /dev/null	Mon Apr 12 22:31:48 2010
+++ src/sys/rump/dev/lib/libfss/shlib_version	Mon Apr 12 22:31:48 2010
@@ -0,0 +1,4 @@
+#	$NetBSD: shlib_version,v 1.1 2010/04/12 22:31:48 pooka Exp $
+#
+major=0
+minor=0



CVS commit: src/distrib/sets/lists

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:34:17 UTC 2010

Modified Files:
src/distrib/sets/lists/base: shl.elf shl.mi
src/distrib/sets/lists/comp: mi shl.mi

Log Message:
add rumpdev_fss to setlists


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/distrib/sets/lists/base/shl.elf
cvs rdiff -u -r1.533 -r1.534 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.1424 -r1.1425 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.114 -r1.115 src/distrib/sets/lists/comp/shl.mi

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/shl.elf
diff -u src/distrib/sets/lists/base/shl.elf:1.212 src/distrib/sets/lists/base/shl.elf:1.213
--- src/distrib/sets/lists/base/shl.elf:1.212	Sun Apr 11 05:45:57 2010
+++ src/distrib/sets/lists/base/shl.elf	Mon Apr 12 22:34:17 2010
@@ -1,4 +1,4 @@
-# $NetBSD: shl.elf,v 1.212 2010/04/11 05:45:57 pooka Exp $
+# $NetBSD: shl.elf,v 1.213 2010/04/12 22:34:17 pooka Exp $
 #
 # Note:	Do not mark old major and major.minor shared libraries as
 #	obsolete; just remove the entry, as third-party applications
@@ -254,6 +254,8 @@
 ./usr/lib/librumpdev_disk.so.0			base-rump-shlib
 ./usr/lib/librumpdev_dm.so			base-rump-shlib
 ./usr/lib/librumpdev_dm.so.0			base-rump-shlib
+./usr/lib/librumpdev_fss.so			base-rump-shlib
+./usr/lib/librumpdev_fss.so.0			base-rump-shlib
 ./usr/lib/librumpdev_netsmb.so			base-rump-shlib
 ./usr/lib/librumpdev_netsmb.so.0		base-rump-shlib
 ./usr/lib/librumpdev_raidframe.so		base-rump-shlib

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.533 src/distrib/sets/lists/base/shl.mi:1.534
--- src/distrib/sets/lists/base/shl.mi:1.533	Sun Apr 11 05:45:57 2010
+++ src/distrib/sets/lists/base/shl.mi	Mon Apr 12 22:34:17 2010
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.533 2010/04/11 05:45:57 pooka Exp $
+# $NetBSD: shl.mi,v 1.534 2010/04/12 22:34:17 pooka Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -134,6 +134,7 @@
 ./usr/lib/librumpdev_cgd.so.0.0			base-rump-shlib
 ./usr/lib/librumpdev_disk.so.0.0		base-rump-shlib
 ./usr/lib/librumpdev_dm.so.0.0			base-rump-shlib
+./usr/lib/librumpdev_fss.so.0.0			base-rump-shlib
 ./usr/lib/librumpdev_netsmb.so.0.0		base-rump-shlib
 ./usr/lib/librumpdev_raidframe.so.0.0		base-rump-shlib
 ./usr/lib/librumpdev_rnd.so.0.0			base-rump-shlib

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1424 src/distrib/sets/lists/comp/mi:1.1425
--- src/distrib/sets/lists/comp/mi:1.1424	Sun Apr 11 05:45:57 2010
+++ src/distrib/sets/lists/comp/mi	Mon Apr 12 22:34:17 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1424 2010/04/11 05:45:57 pooka Exp $
+#	$NetBSD: mi,v 1.1425 2010/04/12 22:34:17 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -2590,6 +2590,9 @@
 ./usr/lib/librumpdev_dm.a			comp-c-lib
 ./usr/lib/librumpdev_dm_g.a			-unknown-		debuglib
 ./usr/lib/librumpdev_dm_p.a			comp-c-proflib		profile
+./usr/lib/librumpdev_fss.a			comp-c-lib
+./usr/lib/librumpdev_fss_g.a			-unknown-		debuglib
+./usr/lib/librumpdev_fss_p.a			comp-c-proflib		profile
 ./usr/lib/librumpdev_g.a			-unknown-		debuglib
 ./usr/lib/librumpdev_netsmb.a			comp-c-lib
 ./usr/lib/librumpdev_netsmb_g.a			-unknown-		debuglib

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.114 src/distrib/sets/lists/comp/shl.mi:1.115
--- src/distrib/sets/lists/comp/shl.mi:1.114	Sun Apr 11 05:45:58 2010
+++ src/distrib/sets/lists/comp/shl.mi	Mon Apr 12 22:34:17 2010
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.114 2010/04/11 05:45:58 pooka Exp $
+# $NetBSD: shl.mi,v 1.115 2010/04/12 22:34:17 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -96,6 +96,7 @@
 ./usr/lib/librumpdev_cgd_pic.a			comp-c-piclib
 ./usr/lib/librumpdev_disk_pic.a			comp-c-piclib
 ./usr/lib/librumpdev_dm_pic.a			comp-c-piclib
+./usr/lib/librumpdev_fss_pic.a			comp-c-piclib
 ./usr/lib/librumpdev_netsmb_pic.a		comp-c-piclib
 ./usr/lib/librumpdev_raidframe_pic.a		comp-c-piclib
 ./usr/lib/librumpdev_rnd_pic.a			comp-c-piclib



CVS commit: src/distrib/sets/lists/comp

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:38:37 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
As long as humans have to edit these lists, use non-braindead sorting.


To generate a diff of this commit:
cvs rdiff -u -r1.1425 -r1.1426 src/distrib/sets/lists/comp/mi

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1425 src/distrib/sets/lists/comp/mi:1.1426
--- src/distrib/sets/lists/comp/mi:1.1425	Mon Apr 12 22:34:17 2010
+++ src/distrib/sets/lists/comp/mi	Mon Apr 12 22:38:36 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1425 2010/04/12 22:34:17 pooka Exp $
+#	$NetBSD: mi,v 1.1426 2010/04/12 22:38:36 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -2578,6 +2578,8 @@
 ./usr/lib/librumpcrypto_g.a			-unknown-		debuglib
 ./usr/lib/librumpcrypto_p.a			comp-c-proflib		profile
 ./usr/lib/librumpdev.acomp-c-lib
+./usr/lib/librumpdev_g.a			-unknown-		debuglib
+./usr/lib/librumpdev_p.a			comp-c-proflib		profile
 ./usr/lib/librumpdev_bpf.a			comp-c-lib
 ./usr/lib/librumpdev_bpf_g.a			-unknown-		debuglib
 ./usr/lib/librumpdev_bpf_p.a			comp-c-proflib		profile
@@ -2593,11 +2595,9 @@
 ./usr/lib/librumpdev_fss.a			comp-c-lib
 ./usr/lib/librumpdev_fss_g.a			-unknown-		debuglib
 ./usr/lib/librumpdev_fss_p.a			comp-c-proflib		profile
-./usr/lib/librumpdev_g.a			-unknown-		debuglib
 ./usr/lib/librumpdev_netsmb.a			comp-c-lib
 ./usr/lib/librumpdev_netsmb_g.a			-unknown-		debuglib
 ./usr/lib/librumpdev_netsmb_p.a			comp-c-proflib		profile
-./usr/lib/librumpdev_p.a			comp-c-proflib		profile
 ./usr/lib/librumpdev_raidframe.a		comp-c-lib
 ./usr/lib/librumpdev_raidframe_g.a		-unknown-		debuglib
 ./usr/lib/librumpdev_raidframe_p.a		comp-c-proflib		profile
@@ -2708,6 +2708,7 @@
 ./usr/lib/librumpvfs_layerfs_p.a		comp-c-proflib		profile
 ./usr/lib/librumpnet.acomp-c-lib
 ./usr/lib/librumpnet_g.a			-unknown-		debuglib
+./usr/lib/librumpnet_p.a			comp-c-proflib		profile
 ./usr/lib/librumpnet_local.a			comp-c-lib
 ./usr/lib/librumpnet_local_g.a			-unknown-		debuglib
 ./usr/lib/librumpnet_local_p.a			comp-c-proflib		profile
@@ -2715,15 +2716,14 @@
 ./usr/lib/librumpnet_netbt_g.a			-unknown-		debuglib
 ./usr/lib/librumpnet_netbt_p.a			comp-c-proflib		profile
 ./usr/lib/librumpnet_net.a			comp-c-lib
+./usr/lib/librumpnet_net_g.a			-unknown-		debuglib
+./usr/lib/librumpnet_net_p.a			comp-c-proflib		profile
 ./usr/lib/librumpnet_net80211.a			comp-c-lib
 ./usr/lib/librumpnet_net80211_g.a		-unknown-		debuglib
 ./usr/lib/librumpnet_net80211_p.a		comp-c-proflib		profile
-./usr/lib/librumpnet_net_g.a			-unknown-		debuglib
-./usr/lib/librumpnet_net_p.a			comp-c-proflib		profile
 ./usr/lib/librumpnet_netinet.a			comp-c-lib
 ./usr/lib/librumpnet_netinet_g.a		-unknown-		debuglib
 ./usr/lib/librumpnet_netinet_p.a		comp-c-proflib		profile
-./usr/lib/librumpnet_p.a			comp-c-proflib		profile
 ./usr/lib/librumpnet_shmif.a			comp-c-lib
 ./usr/lib/librumpnet_shmif_g.a			-unknown-		debuglib
 ./usr/lib/librumpnet_shmif_p.a			comp-c-proflib		profile



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

2010-04-12 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Mon Apr 12 22:40:55 UTC 2010

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c rmixl_intr.h

Log Message:
- establishing an ISR now takes 'mpsafe' arg
- obtain/release kernel lock around calls to non-mpsafe ISRs


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/sys/arch/mips/rmi/rmixl_intr.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_intr.h

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_intr.c
diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.16 src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.17
--- src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.16	Mon Mar 29 23:35:24 2010
+++ src/sys/arch/mips/rmi/rmixl_intr.c	Mon Apr 12 22:40:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.c,v 1.1.2.16 2010/03/29 23:35:24 cliff Exp $	*/
+/*	$NetBSD: rmixl_intr.c,v 1.1.2.17 2010/04/12 22:40:55 cliff Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.16 2010/03/29 23:35:24 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.17 2010/04/12 22:40:55 cliff Exp $);
 
 #include opt_ddb.h
 #define	__INTR_PRIVATE
@@ -422,12 +422,13 @@
  * establish vector for mips3 count/compare clock interrupt
  * this ensures we enable in EIRR,
  * even though cpu_intr() handles the interrupt
+ * note the 'mpsafe' arg here is a placeholder only
  */
 void *
 rmixl_intr_init_clk(void)
 {
 	int vec = ffs(MIPS_INT_MASK_5  8) - 1;
-	void *ih = rmixl_vec_establish(vec, 0, IPL_SCHED, NULL, NULL);
+	void *ih = rmixl_vec_establish(vec, 0, IPL_SCHED, NULL, NULL, false);
 	if (ih == NULL)
 		panic(%s: establish vec %d failed, __func__, vec);
 	
@@ -442,7 +443,7 @@
 rmixl_intr_init_ipi(void)
 {
 	void *ih = rmixl_vec_establish(RMIXL_INTRVEC_IPI, -1, IPL_SCHED,
-		rmixl_ipi_intr, NULL);
+		rmixl_ipi_intr, NULL, false);
 	if (ih == NULL)
 		panic(%s: establish vec %d failed,
 			__func__, RMIXL_INTRVEC_IPI);
@@ -671,7 +672,7 @@
 
 void *
 rmixl_vec_establish(int vec, int cpumask, int ipl,
-	int (*func)(void *), void *arg)
+	int (*func)(void *), void *arg, bool mpsafe)
 {
 	rmixl_intrhand_t *ih;
 	int s;
@@ -700,6 +701,7 @@
 
 	ih-ih_func = func;
 	ih-ih_arg = arg;
+	ih-ih_mpsafe = mpsafe;
 	ih-ih_irq = vec;
 	ih-ih_ipl = ipl;
 	ih-ih_cpumask = cpumask;
@@ -710,8 +712,9 @@
 }
 
 void *
-rmixl_intr_establish(int irq, int cpumask, int ipl, rmixl_intr_trigger_t trigger,
-	rmixl_intr_polarity_t polarity, int (*func)(void *), void *arg)
+rmixl_intr_establish(int irq, int cpumask, int ipl,
+	rmixl_intr_trigger_t trigger, rmixl_intr_polarity_t polarity,
+	int (*func)(void *), void *arg, bool mpsafe)
 {
 	rmixl_intrhand_t *ih;
 	int s;
@@ -738,7 +741,7 @@
 	/*
 	 * establish vector
 	 */
-	ih = rmixl_vec_establish(irq, cpumask, ipl, func, arg);
+	ih = rmixl_vec_establish(irq, cpumask, ipl, func, arg, mpsafe);
 
 	/*
 	 * establish IRT Entry
@@ -843,8 +846,19 @@
 			RMIXL_PICREG_WRITE(RMIXL_PIC_INTRACK,
 (uint32_t)vecbit);
 
-		if (ih-ih_func != NULL)
+		if (ih-ih_func != NULL) {
+#ifdef MULTIPROCESSOR
+			if (ih-ih_mpsafe) {
+(void)(*ih-ih_func)(ih-ih_arg);
+			} else {
+KERNEL_LOCK(1, NULL);
+(void)(*ih-ih_func)(ih-ih_arg);
+KERNEL_UNLOCK_ONE(NULL);
+			}
+#else
 			(void)(*ih-ih_func)(ih-ih_arg);
+#endif /* MULTIPROCESSOR */
+		}
 
 		sc-sc_vec_evcnts[vec].ev_count++;
 	}

Index: src/sys/arch/mips/rmi/rmixl_intr.h
diff -u src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.1 src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.2
--- src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.1	Sun Mar 21 19:28:01 2010
+++ src/sys/arch/mips/rmi/rmixl_intr.h	Mon Apr 12 22:40:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.h,v 1.1.2.1 2010/03/21 19:28:01 cliff Exp $	*/
+/*	$NetBSD: rmixl_intr.h,v 1.1.2.2 2010/04/12 22:40:55 cliff Exp $	*/
 
 #ifndef _MIPS_RMI_RMIXL_INTR_H_
 #define _MIPS_RMI_RMIXL_INTR_H_
@@ -40,6 +40,7 @@
 typedef struct rmixl_intrhand {
 int (*ih_func)(void *);
 void *ih_arg; 
+int ih_mpsafe; 			/* true if does not need kernel lock */
 int ih_irq;			/* =32 if not-PIC-based */
 int ih_ipl; 			/* interrupt priority */
 int ih_cpumask; 		/* CPUs which may handle this irpt */
@@ -53,10 +54,10 @@
 
 extern void *rmixl_intr_establish(int, int, int,
 	rmixl_intr_trigger_t, rmixl_intr_polarity_t,
-	int (*)(void *), void *);
+	int (*)(void *), void *, bool);
 extern void  rmixl_intr_disestablish(void *);
 extern void *rmixl_vec_establish(int, int, int,
-	int (*)(void *), void *);
+	int (*)(void *), void *, bool);
 extern void  rmixl_vec_disestablish(void *);
 extern const char *rmixl_intr_string(int);
 extern void rmixl_intr_init_cpu(struct cpu_info *);



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

2010-04-12 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Mon Apr 12 22:42:07 UTC 2010

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c rmixl_obio.c
rmixl_pcie.c rmixl_pcix.c rmixl_usbi.c

Log Message:
- specifiy if mpsafe when establishing interrupts
(all are 'false' except comintr for now)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/arch/mips/rmi/rmixl_com.c \
src/sys/arch/mips/rmi/rmixl_pcie.c
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/sys/arch/mips/rmi/rmixl_obio.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/rmi/rmixl_pcix.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_usbi.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_com.c
diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.11 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.12
--- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.11	Sun Mar 21 21:23:32 2010
+++ src/sys/arch/mips/rmi/rmixl_com.c	Mon Apr 12 22:42:07 2010
@@ -1,4 +1,4 @@
-/* $Id: rmixl_com.c,v 1.1.2.11 2010/03/21 21:23:32 cliff Exp $ */
+/* $Id: rmixl_com.c,v 1.1.2.12 2010/04/12 22:42:07 cliff Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -101,7 +101,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.11 2010/03/21 21:23:32 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.12 2010/04/12 22:42:07 cliff Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -286,7 +286,8 @@
 	com_attach_subr(sc);
 
 	rmixl_intr_establish(obio-obio_intr, obio-obio_tmsk,
-		IPL_SERIAL, RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH, comintr, sc);
+		IPL_SERIAL, RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH,
+		comintr, sc, true);
 
 }
 
Index: src/sys/arch/mips/rmi/rmixl_pcie.c
diff -u src/sys/arch/mips/rmi/rmixl_pcie.c:1.1.2.11 src/sys/arch/mips/rmi/rmixl_pcie.c:1.1.2.12
--- src/sys/arch/mips/rmi/rmixl_pcie.c:1.1.2.11	Wed Apr  7 19:26:14 2010
+++ src/sys/arch/mips/rmi/rmixl_pcie.c	Mon Apr 12 22:42:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_pcie.c,v 1.1.2.11 2010/04/07 19:26:14 cliff Exp $	*/
+/*	$NetBSD: rmixl_pcie.c,v 1.1.2.12 2010/04/12 22:42:06 cliff Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_pcie.c,v 1.1.2.11 2010/04/07 19:26:14 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_pcie.c,v 1.1.2.12 2010/04/12 22:42:06 cliff Exp $);
 
 #include opt_pci.h
 #include pci.h
@@ -782,7 +782,7 @@
 	case MIPS_XLS408LITE:
 		sc-sc_fatal_ih = rmixl_intr_establish(29, sc-sc_tmsk,
 			IPL_HIGH, RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH,
-			rmixl_pcie_error_intr, v);
+			rmixl_pcie_error_intr, v, false);
 		break;
 	default:
 		break;
@@ -1300,7 +1300,7 @@
 	if (lip-enabled == false) {
 		lip-ih = rmixl_intr_establish(irq, sc-sc_tmsk,
 			ipl, RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH,
-			rmixl_pcie_intr, lip);
+			rmixl_pcie_intr, lip, false);
 		if (lip-ih == NULL)
 			panic(%s: cannot establish irq %d, __func__, irq);
 

Index: src/sys/arch/mips/rmi/rmixl_obio.c
diff -u src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.14 src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.15
--- src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.14	Sun Mar 21 21:26:13 2010
+++ src/sys/arch/mips/rmi/rmixl_obio.c	Mon Apr 12 22:42:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_obio.c,v 1.1.2.14 2010/03/21 21:26:13 cliff Exp $	*/
+/*	$NetBSD: rmixl_obio.c,v 1.1.2.15 2010/04/12 22:42:06 cliff Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.14 2010/03/21 21:26:13 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.15 2010/04/12 22:42:06 cliff Exp $);
 
 #include locators.h
 #include pci.h
@@ -283,8 +283,9 @@
 	 * XXX is true for XLS family only
 	 */
 	if (cpu_rmixls(mips_options.mips_cpu))
-		rmixl_intr_establish(16, 1, IPL_HIGH, RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH,
-			rmixl_addr_error_intr, NULL);
+		rmixl_intr_establish(16, 1, IPL_HIGH,
+			RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH,
+			rmixl_addr_error_intr, NULL, false);
 }
 
 int

Index: src/sys/arch/mips/rmi/rmixl_pcix.c
diff -u src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.2 src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.3
--- src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.2	Mon Apr 12 22:03:33 2010
+++ src/sys/arch/mips/rmi/rmixl_pcix.c	Mon Apr 12 22:42:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_pcix.c,v 1.1.2.2 2010/04/12 22:03:33 cliff Exp $	*/
+/*	$NetBSD: rmixl_pcix.c,v 1.1.2.3 2010/04/12 22:42:07 cliff Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_pcix.c,v 1.1.2.2 2010/04/12 22:03:33 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_pcix.c,v 1.1.2.3 2010/04/12 22:42:07 cliff Exp $);
 
 #include opt_pci.h
 #include pci.h
@@ -482,13 +482,13 @@
 
 	

CVS commit: src/tests/fs/ffs

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:58:53 UTC 2010

Modified Files:
src/tests/fs/ffs: Makefile
Added Files:
src/tests/fs/ffs: t_snapshot.c

Log Message:
test for the very basic snapshot features


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/ffs/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/ffs/t_snapshot.c

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

Modified files:

Index: src/tests/fs/ffs/Makefile
diff -u src/tests/fs/ffs/Makefile:1.6 src/tests/fs/ffs/Makefile:1.7
--- src/tests/fs/ffs/Makefile:1.6	Mon Mar 29 13:26:32 2010
+++ src/tests/fs/ffs/Makefile	Mon Apr 12 22:58:53 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2010/03/29 13:26:32 pooka Exp $
+#	$NetBSD: Makefile,v 1.7 2010/04/12 22:58:53 pooka Exp $
 #
 
 TESTSDIR=	${TESTSBASE}/fs/ffs
@@ -6,8 +6,10 @@
 
 TESTS_C=	t_renamerace
 TESTS_C+=	t_fifos
+TESTS_C+=	t_snapshot
 
 LDADD+=-lrumpfs_ffs		# ffs
+LDADD+=-lrumpdev_fss		# snapshot dev
 LDADD+=-lrumpdev_disk -lrumpdev	# disk device
 LDADD+=-lrumpvfs_fifofs -lrumpnet_local -lrumpnet_net -lrumpnet	# fifos
 LDADD+=-lrumpvfs -lrump -lrumpuser -lpthread			# base

Added files:

Index: src/tests/fs/ffs/t_snapshot.c
diff -u /dev/null src/tests/fs/ffs/t_snapshot.c:1.1
--- /dev/null	Mon Apr 12 22:58:53 2010
+++ src/tests/fs/ffs/t_snapshot.c	Mon Apr 12 22:58:53 2010
@@ -0,0 +1,136 @@
+/*	$NetBSD: t_snapshot.c,v 1.1 2010/04/12 22:58:53 pooka Exp $	*/
+
+#include sys/types.h
+#include sys/ioctl.h
+#include sys/mount.h
+
+#include dev/fssvar.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+#include ufs/ufs/ufsmount.h
+
+#include atf-c.h
+#include fcntl.h
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include unistd.h
+
+#include ../../h_macros.h
+
+#define IMGNAME ffs.img
+#define NEWFS newfs -F -s 1  IMGNAME
+#define BAKNAME /mnt/bak.img
+
+ATF_TC_WITH_CLEANUP(snapshot);
+ATF_TC_HEAD(snapshot, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, basic snapshot features);
+}
+
+static void
+makefile(const char *path)
+{
+	int fd;
+
+	fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777);
+	if (fd == -1)
+		atf_tc_fail_errno(create %s, path);
+	rump_sys_close(fd);
+}
+
+ATF_TC_BODY(snapshot, tc)
+{
+	char buf[1024];
+	struct ufs_args uargs;
+	struct fss_set fss;
+	int fssfd;
+	int fd, fd2;
+
+	if (system(NEWFS) == -1)
+		atf_tc_fail_errno(cannot create file system);
+
+	rump_init();
+
+	if (rump_sys_mkdir(/mnt, 0777) == -1)
+		atf_tc_fail_errno(mount point create);
+	if (rump_sys_mkdir(/snap, 0777) == -1)
+		atf_tc_fail_errno(mount point 2 create);
+
+	rump_pub_etfs_register(./ffs.img, ./ffs.img, RUMP_ETFS_BLK);
+
+	uargs.fspec = __UNCONST(./ffs.img);
+
+	if (rump_sys_mount(MOUNT_FFS, /mnt, 0, uargs, sizeof(uargs)) == -1)
+		atf_tc_fail_errno(mount ffs);
+
+#define TESTSTR1 huihai\n
+#define TESTSZ1 (sizeof(TESTSTR1)-1)
+#define TESTSTR2 baana liten\n
+#define TESTSZ2 (sizeof(TESTSTR2)-1)
+
+	fd = rump_sys_open(/mnt/myfile, O_RDWR | O_CREAT, 0777);
+	if (fd == -1)
+		atf_tc_fail_errno(create file);
+	if (rump_sys_write(fd, TESTSTR1, TESTSZ1) != TESTSZ1)
+		atf_tc_fail_errno(write fail);
+
+	fssfd = rump_sys_open(/dev/rfss0, O_RDWR);
+	if (fd == -1)
+		atf_tc_fail_errno(cannot open fss);
+	makefile(BAKNAME);
+	memset(fss, 0, sizeof(fss));
+	fss.fss_mount = __UNCONST(/mnt);
+	fss.fss_bstore = __UNCONST(BAKNAME);
+	fss.fss_csize = 0;
+	if (rump_sys_ioctl(fssfd, FSSIOCSET, fss) == -1)
+		atf_tc_fail_errno(create snapshot);
+
+	if (rump_sys_pwrite(fd, TESTSTR2, TESTSZ2, 0) != TESTSZ2)
+		atf_tc_fail_errno(write fail);
+	rump_sys_sync();
+
+	uargs.fspec = __UNCONST(/dev/fss0);
+
+	/* technically we should fsck it first? */
+	if (rump_sys_mount(MOUNT_FFS, /snap, 0, uargs, sizeof(uargs)) == -1)
+		atf_tc_fail_errno(mount snapshot);
+
+	/* check for old contents */
+	fd2 = rump_sys_open(/snap/myfile, O_RDONLY);
+	if (fd2 == -1)
+		atf_tc_fail_errno(fail);
+	memset(buf, 0, sizeof(buf));
+	if (rump_sys_read(fd2, buf, sizeof(buf)) == -1)
+		atf_tc_fail_errno(read snap);
+
+	/* check that new files are invisible in the snapshot */
+	makefile(/mnt/newfile);
+	if (rump_sys_open(/snap/newfile, O_RDONLY) != -1)
+		atf_tc_fail(newfile exists in snapshot);
+	if (errno != ENOENT)
+		atf_tc_fail_errno(newfile open should fail with ENOENT);
+
+	/* check that removed files are still visible in the snapshot */
+	rump_sys_unlink(/mnt/myfile);
+
+	if (rump_sys_open(/snap/myfile, O_RDONLY) == -1)
+		atf_tc_fail_errno(unlinked file no longer in snapshot);
+
+	ATF_CHECK(strcmp(buf, TESTSTR1) == 0);
+}
+
+ATF_TC_CLEANUP(snapshot, tc)
+{
+
+	unlink(IMGNAME);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+	ATF_TP_ADD_TC(tp, snapshot);
+	return 0;
+}



CVS commit: src/distrib/sets/lists/tests

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 22:59:49 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
snapshot test - setlists


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/distrib/sets/lists/tests/mi

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.68 src/distrib/sets/lists/tests/mi:1.69
--- src/distrib/sets/lists/tests/mi:1.68	Wed Mar 31 19:18:39 2010
+++ src/distrib/sets/lists/tests/mi	Mon Apr 12 22:59:49 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.68 2010/03/31 19:18:39 pooka Exp $
+# $NetBSD: mi,v 1.69 2010/04/12 22:59:49 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -113,6 +113,7 @@
 ./usr/libdata/debug/usr/tests/fs/ffs	tests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/ffs/t_fifos.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/ffs/t_renamerace.debug			tests-fs-debug		debug,atf
+./usr/libdata/debug/usr/tests/fs/ffs/t_snapshot.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/kernfs	tests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/kernfs/t_basic.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/nullfs	tests-fs-debug
@@ -565,6 +566,7 @@
 ./usr/tests/fs/ffs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/ffs/t_fifos			tests-fs-tests		atf
 ./usr/tests/fs/ffs/t_renamerace			tests-fs-tests		atf
+./usr/tests/fs/ffs/t_snapshot			tests-fs-tests		atf
 ./usr/tests/fs/kernfstests-fs-tests
 ./usr/tests/fs/kernfs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/kernfs/t_basic			tests-fs-tests		atf



CVS commit: src/sys/kern

2010-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 12 23:09:28 UTC 2010

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

Log Message:
void police!


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

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

Modified files:

Index: src/sys/kern/subr_lwp_specificdata.c
diff -u src/sys/kern/subr_lwp_specificdata.c:1.1 src/sys/kern/subr_lwp_specificdata.c:1.2
--- src/sys/kern/subr_lwp_specificdata.c:1.1	Mon Apr 12 18:15:31 2010
+++ src/sys/kern/subr_lwp_specificdata.c	Mon Apr 12 19:09:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_lwp_specificdata.c,v 1.1 2010/04/12 22:15:31 pooka Exp $	*/
+/*	$NetBSD: subr_lwp_specificdata.c,v 1.2 2010/04/12 23:09:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #define _LWP_API_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_lwp_specificdata.c,v 1.1 2010/04/12 22:15:31 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_lwp_specificdata.c,v 1.2 2010/04/12 23:09:28 christos Exp $);
 
 #include sys/param.h
 #include sys/lwp.h
@@ -38,7 +38,7 @@
 static specificdata_domain_t lwp_specificdata_domain;
 
 void
-lwpinit_specificdata()
+lwpinit_specificdata(void)
 {
 
 	lwp_specificdata_domain = specificdata_domain_create();



CVS commit: src/tests/fs/ffs

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 23:15:24 UTC 2010

Modified Files:
src/tests/fs/ffs: t_snapshot.c

Log Message:
move check next to operation


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/ffs/t_snapshot.c

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

Modified files:

Index: src/tests/fs/ffs/t_snapshot.c
diff -u src/tests/fs/ffs/t_snapshot.c:1.1 src/tests/fs/ffs/t_snapshot.c:1.2
--- src/tests/fs/ffs/t_snapshot.c:1.1	Mon Apr 12 22:58:53 2010
+++ src/tests/fs/ffs/t_snapshot.c	Mon Apr 12 23:15:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_snapshot.c,v 1.1 2010/04/12 22:58:53 pooka Exp $	*/
+/*	$NetBSD: t_snapshot.c,v 1.2 2010/04/12 23:15:24 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/ioctl.h
@@ -106,6 +106,7 @@
 	memset(buf, 0, sizeof(buf));
 	if (rump_sys_read(fd2, buf, sizeof(buf)) == -1)
 		atf_tc_fail_errno(read snap);
+	ATF_CHECK(strcmp(buf, TESTSTR1) == 0);
 
 	/* check that new files are invisible in the snapshot */
 	makefile(/mnt/newfile);
@@ -116,11 +117,10 @@
 
 	/* check that removed files are still visible in the snapshot */
 	rump_sys_unlink(/mnt/myfile);
-
 	if (rump_sys_open(/snap/myfile, O_RDONLY) == -1)
 		atf_tc_fail_errno(unlinked file no longer in snapshot);
 
-	ATF_CHECK(strcmp(buf, TESTSTR1) == 0);
+	/* done for now */
 }
 
 ATF_TC_CLEANUP(snapshot, tc)



CVS commit: src/sys/kern

2010-04-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Apr 12 23:20:18 UTC 2010

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

Log Message:
tyop


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/kern/kern_lwp.c

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

Modified files:

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.144 src/sys/kern/kern_lwp.c:1.145
--- src/sys/kern/kern_lwp.c:1.144	Mon Apr 12 22:15:31 2010
+++ src/sys/kern/kern_lwp.c	Mon Apr 12 23:20:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.144 2010/04/12 22:15:31 pooka Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.145 2010/04/12 23:20:18 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -209,7 +209,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_lwp.c,v 1.144 2010/04/12 22:15:31 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_lwp.c,v 1.145 2010/04/12 23:20:18 pooka Exp $);
 
 #include opt_ddb.h
 #include opt_lockdebug.h
@@ -827,7 +827,7 @@
 	fd_free();
 
 	/* Delete the specificdata while it's still safe to sleep. */
-	lwp_finispecific(l)
+	lwp_finispecific(l);
 
 	/*
 	 * Release our cached credentials.



CVS commit: src/sys/dist/pf/net

2010-04-12 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Tue Apr 13 01:02:43 UTC 2010

Modified Files:
src/sys/dist/pf/net: pf_ioctl.c

Log Message:
Do not auto unload pf if it's enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dist/pf/net/pf_ioctl.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/dist/pf/net/pf_ioctl.c
diff -u src/sys/dist/pf/net/pf_ioctl.c:1.38 src/sys/dist/pf/net/pf_ioctl.c:1.39
--- src/sys/dist/pf/net/pf_ioctl.c:1.38	Mon Apr 12 13:57:38 2010
+++ src/sys/dist/pf/net/pf_ioctl.c	Tue Apr 13 01:02:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf_ioctl.c,v 1.38 2010/04/12 13:57:38 ahoka Exp $	*/
+/*	$NetBSD: pf_ioctl.c,v 1.39 2010/04/13 01:02:43 ahoka Exp $	*/
 /*	$OpenBSD: pf_ioctl.c,v 1.182 2007/06/24 11:17:13 mcbride Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pf_ioctl.c,v 1.38 2010/04/12 13:57:38 ahoka Exp $);
+__KERNEL_RCSID(0, $NetBSD: pf_ioctl.c,v 1.39 2010/04/13 01:02:43 ahoka Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_inet.h
@@ -3367,6 +3367,13 @@
 		pfdetach();
 		pflogdetach();
 		return devsw_detach(NULL, pf_cdevsw);
+	case MODULE_CMD_AUTOUNLOAD:
+		/* Do not auto unload pf if it's enabled. */
+		if (pf_status.running) {
+			return EBUSY;
+		} else {
+			return ENOTTY;
+		}
 	default:
 		return ENOTTY;
 	}



CVS commit: src/sys/miscfs/specfs

2010-04-12 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Tue Apr 13 01:15:56 UTC 2010

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
Autoload modules with any class.

This fixes autoloading of pf, zfs and possibly others.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/miscfs/specfs/spec_vnops.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/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.127 src/sys/miscfs/specfs/spec_vnops.c:1.128
--- src/sys/miscfs/specfs/spec_vnops.c:1.127	Sat Nov 14 18:36:57 2009
+++ src/sys/miscfs/specfs/spec_vnops.c	Tue Apr 13 01:15:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.127 2009/11/14 18:36:57 elad Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.128 2010/04/13 01:15:56 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: spec_vnops.c,v 1.127 2009/11/14 18:36:57 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: spec_vnops.c,v 1.128 2010/04/13 01:15:56 ahoka Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -460,7 +460,7 @@
 			
 			/* Try to autoload device module */
 			mutex_enter(module_lock);
-			(void) module_autoload(name, MODULE_CLASS_DRIVER);
+			(void) module_autoload(name, MODULE_CLASS_ANY);
 			mutex_exit(module_lock);
 		} while (gen != module_gen);
 



CVS commit: src

2010-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 13 05:40:13 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile curproc.9

Log Message:
Briefly note also curlwp.


To generate a diff of this commit:
cvs rdiff -u -r1.1426 -r1.1427 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.323 -r1.324 src/share/man/man9/Makefile
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/curproc.9

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1426 src/distrib/sets/lists/comp/mi:1.1427
--- src/distrib/sets/lists/comp/mi:1.1426	Mon Apr 12 22:38:36 2010
+++ src/distrib/sets/lists/comp/mi	Tue Apr 13 05:40:12 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1426 2010/04/12 22:38:36 pooka Exp $
+#	$NetBSD: mi,v 1.1427 2010/04/13 05:40:12 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -8859,6 +8859,7 @@
 ./usr/share/man/cat9/ctxsw.0			comp-obsolete		obsolete
 ./usr/share/man/cat9/curcpu.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/curproc.0			comp-sys-catman		.cat
+./usr/share/man/cat9/curlwp.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/cv.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/cv_broadcast.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/cv_destroy.0		comp-sys-catman		.cat
@@ -14529,6 +14530,7 @@
 ./usr/share/man/html9/csf.html			comp-sys-htmlman	html
 ./usr/share/man/html9/curcpu.html		comp-sys-htmlman	html
 ./usr/share/man/html9/curproc.html		comp-sys-htmlman	html
+./usr/share/man/html9/curlwp.html		comp-sys-htmlman	html
 ./usr/share/man/html9/cv.html			comp-sys-htmlman	html
 ./usr/share/man/html9/cv_broadcast.html		comp-sys-htmlman	html
 ./usr/share/man/html9/cv_destroy.html		comp-sys-htmlman	html
@@ -20346,6 +20348,7 @@
 ./usr/share/man/man9/ctxsw.9			comp-obsolete		obsolete
 ./usr/share/man/man9/curcpu.9			comp-sys-man		.man
 ./usr/share/man/man9/curproc.9			comp-sys-man		.man
+./usr/share/man/man9/curlwp.9			comp-sys-man		.man
 ./usr/share/man/man9/cv.9			comp-sys-man		.man
 ./usr/share/man/man9/cv_broadcast.9		comp-sys-man		.man
 ./usr/share/man/man9/cv_destroy.9		comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.323 src/share/man/man9/Makefile:1.324
--- src/share/man/man9/Makefile:1.323	Thu Mar 25 14:59:36 2010
+++ src/share/man/man9/Makefile	Tue Apr 13 05:40:12 2010
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.323 2010/03/25 14:59:36 jruoho Exp $
+#   $NetBSD: Makefile,v 1.324 2010/04/13 05:40:12 jruoho Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -223,7 +223,7 @@
 	cpu_dumpconf.9 dumpsys.9
 MLINKS+=cpu_lwp_fork.9 child_return.9 cpu_lwp_fork.9 proc_trampoline.9
 MLINKS+=cpu_swapout.9 cpu_swapin.9
-MLINKS+=curproc.9 curcpu.9
+MLINKS+=curproc.9 curcpu.9 curproc.9 curlwp.9
 MLINKS+=delay.9 DELAY.9
 MLINKS+=disk.9 disk_attach.9 disk.9 disk_detach.9 \
 	disk.9 disk_busy.9 disk.9 disk_unbusy.9 disk.9 disk_find.9 \

Index: src/share/man/man9/curproc.9
diff -u src/share/man/man9/curproc.9:1.3 src/share/man/man9/curproc.9:1.4
--- src/share/man/man9/curproc.9:1.3	Wed Apr 30 13:10:58 2008
+++ src/share/man/man9/curproc.9	Tue Apr 13 05:40:12 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: curproc.9,v 1.3 2008/04/30 13:10:58 martin Exp $
+.\ $NetBSD: curproc.9,v 1.4 2010/04/13 05:40:12 jruoho Exp $
 .\
 .\ Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,24 +27,54 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 23, 2002
+.Dd April 13, 2010
 .Dt CURPROC 9
 .Os
 .Sh NAME
 .Nm curproc ,
-.Nm curcpu
-.Nd current process and processor
+.Nm curcpu ,
+.Nm curlwp
+.Nd current process, processor, and
+.Tn LWP
 .Sh SYNOPSIS
 .In sys/proc.h
 .Ft struct cpu_info *
 .Fn curcpu void
 .Ft struct proc *
 .Fn curproc void
+.Ft struct lwp *
+.Fn curlwp void
 .Sh DESCRIPTION
+The following macros can be used to retrieve
+the current processor, process, and light-weight process
+.Pq Tn LWP ,
+respectively:
+.Bl -enum -offset indent
+.It
+The machine-dependent
 .Fn curcpu
-returns a pointer to a
+macro returns a pointer to a
 .Em cpu_info
-structure containing information of the CPU that this thread is
-running on.
+structure containing information of the
+.Tn CPU
+that this thread is running on.
+.It
+The machine-independent
 .Fn curproc
-returns a pointer to the process currently running on this CPU.
+macro refers to a pointer to the process currently running on this
+.Tn CPU .
+.It
+The
+.Fn curlwp
+macro expands to a pointer to
+.Em lwp
+structure, containing information about the current
+.Tn LWP .
+This macro is machine-independent,
+but machine-dependent
+.In machine/cpu.h
+may redefine it.
+.El
+.Sh SEE ALSO
+.Xr cpu_number 9 ,
+.Xr pfind 9



CVS commit: src/share/man/man9

2010-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 13 05:41:54 UTC 2010

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

Log Message:
Refer to cpu_switchto(9) instead of nonexistent cpu_switch(x).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/cpu_lwp_fork.9

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

Modified files:

Index: src/share/man/man9/cpu_lwp_fork.9
diff -u src/share/man/man9/cpu_lwp_fork.9:1.3 src/share/man/man9/cpu_lwp_fork.9:1.4
--- src/share/man/man9/cpu_lwp_fork.9:1.3	Wed Apr 30 13:10:58 2008
+++ src/share/man/man9/cpu_lwp_fork.9	Tue Apr 13 05:41:53 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: cpu_lwp_fork.9,v 1.3 2008/04/30 13:10:58 martin Exp $
+.\ $NetBSD: cpu_lwp_fork.9,v 1.4 2010/04/13 05:41:53 jruoho Exp $
 .\
 .\ Copyright (c) 2002, 2005, 2006 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd January 29, 2006
+.Dd April 13, 2010
 .Dt CPU_LWP_FORK 9
 .Os
 .Sh NAME
@@ -98,5 +98,5 @@
 while the parent process returns normally.
 .Sh SEE ALSO
 .Xr fork 2 ,
-.Xr cpu_switch 9 ,
+.Xr cpu_switchto 9 ,
 .Xr fork1 9