CVS commit: src/lib/libc/arch/arm/gen

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 06:02:13 UTC 2012

Modified Files:
src/lib/libc/arch/arm/gen: _setjmp.S setjmp.S

Log Message:
Add #error cases in case someone tries to compile hardfloat VFP libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/arm/gen/_setjmp.S
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/arm/gen/setjmp.S

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

Modified files:

Index: src/lib/libc/arch/arm/gen/_setjmp.S
diff -u src/lib/libc/arch/arm/gen/_setjmp.S:1.6 src/lib/libc/arch/arm/gen/_setjmp.S:1.7
--- src/lib/libc/arch/arm/gen/_setjmp.S:1.6	Sat Aug 21 11:20:10 2004
+++ src/lib/libc/arch/arm/gen/_setjmp.S	Wed Aug  1 06:02:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.6 2004/08/21 11:20:10 rearnsha Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.7 2012/08/01 06:02:13 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark Brinicombe
@@ -53,6 +53,8 @@ ENTRY(_setjmp)
 	str	r1, [r0], #4
 #ifdef SOFTFLOAT
 	add	r0, r0, #52
+#elif defined(__VFP_FP__)
+#error _setjmp VFP support missing
 #else
 	/* Store fp registers */
 	sfm	f4, 4, [r0], #48
@@ -77,6 +79,8 @@ ENTRY(_longjmp)
 
 #ifdef SOFTFLOAT
 	add	r0, r0, #52
+#elif defined(__VFP_FP__)
+#error _longjmp VFP support missing
 #else
 	/* Restore fp registers */
 	lfm	f4, 4, [r0], #48

Index: src/lib/libc/arch/arm/gen/setjmp.S
diff -u src/lib/libc/arch/arm/gen/setjmp.S:1.8 src/lib/libc/arch/arm/gen/setjmp.S:1.9
--- src/lib/libc/arch/arm/gen/setjmp.S:1.8	Sun Oct 16 17:26:24 2005
+++ src/lib/libc/arch/arm/gen/setjmp.S	Wed Aug  1 06:02:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: setjmp.S,v 1.8 2005/10/16 17:26:24 christos Exp $	*/
+/*	$NetBSD: setjmp.S,v 1.9 2012/08/01 06:02:13 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark Brinicombe
@@ -59,6 +59,8 @@ ENTRY(__setjmp14)
 
 #ifdef SOFTFLOAT
 	add	r0, r0, #52
+#elif defined(__VFP_FP__)
+#error __setjmp14 VFP support missing
 #else
 	/* Store fp registers */
 	sfm	f4, 4, [r0], #48
@@ -92,6 +94,8 @@ ENTRY(__longjmp14)
 	add	r0, r0, #4
 #ifdef SOFTFLOAT
 	add	r0, r0, #52
+#elif defined(__VFP_FP__)
+#error __longjmp14 VFP support missing
 #else
 	/* Restore fp registers */
 	lfm	f4, 4, [r0], #48



CVS commit: src/lib/libc/arch/arm/hardfloat

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 06:10:21 UTC 2012

Modified Files:
src/lib/libc/arch/arm/hardfloat: fpgetmask.S fpgetsticky.S fpsetmask.S
fpsetsticky.S

Log Message:
Error out if compiled with -mfp=vfp and -mhard-float


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/arm/hardfloat/fpgetmask.S \
src/lib/libc/arch/arm/hardfloat/fpgetsticky.S \
src/lib/libc/arch/arm/hardfloat/fpsetmask.S \
src/lib/libc/arch/arm/hardfloat/fpsetsticky.S

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

Modified files:

Index: src/lib/libc/arch/arm/hardfloat/fpgetmask.S
diff -u src/lib/libc/arch/arm/hardfloat/fpgetmask.S:1.4 src/lib/libc/arch/arm/hardfloat/fpgetmask.S:1.5
--- src/lib/libc/arch/arm/hardfloat/fpgetmask.S:1.4	Sat Aug 21 11:21:00 2004
+++ src/lib/libc/arch/arm/hardfloat/fpgetmask.S	Wed Aug  1 06:10:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetmask.S,v 1.4 2004/08/21 11:21:00 rearnsha Exp $	*/
+/*	$NetBSD: fpgetmask.S,v 1.5 2012/08/01 06:10:21 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -45,7 +45,11 @@ ENTRY(_fpgetmask)
 #else
 ENTRY(fpgetmask)
 #endif
+#ifdef __VFP_FP__
+#error _fpgetmask VFP support missing
+#else
 	rfs	r0
 	mov	r0, r0, lsr #16
 	and	r0, r0, #0x1f
 	RET
+#endif
Index: src/lib/libc/arch/arm/hardfloat/fpgetsticky.S
diff -u src/lib/libc/arch/arm/hardfloat/fpgetsticky.S:1.4 src/lib/libc/arch/arm/hardfloat/fpgetsticky.S:1.5
--- src/lib/libc/arch/arm/hardfloat/fpgetsticky.S:1.4	Sat Aug 21 11:21:00 2004
+++ src/lib/libc/arch/arm/hardfloat/fpgetsticky.S	Wed Aug  1 06:10:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.S,v 1.4 2004/08/21 11:21:00 rearnsha Exp $	*/
+/*	$NetBSD: fpgetsticky.S,v 1.5 2012/08/01 06:10:21 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -45,6 +45,10 @@ ENTRY(_fpgetsticky)
 #else
 ENTRY(fpgetsticky)
 #endif
+#ifdef __VFP_FP__
+#error _fpgetsticky VFP support missing
+#else
 	rfs	r0
 	and	r0, r0, #0x1f
 	RET
+#endif
Index: src/lib/libc/arch/arm/hardfloat/fpsetmask.S
diff -u src/lib/libc/arch/arm/hardfloat/fpsetmask.S:1.4 src/lib/libc/arch/arm/hardfloat/fpsetmask.S:1.5
--- src/lib/libc/arch/arm/hardfloat/fpsetmask.S:1.4	Sat Aug 21 11:21:00 2004
+++ src/lib/libc/arch/arm/hardfloat/fpsetmask.S	Wed Aug  1 06:10:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.S,v 1.4 2004/08/21 11:21:00 rearnsha Exp $	*/
+/*	$NetBSD: fpsetmask.S,v 1.5 2012/08/01 06:10:21 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -45,6 +45,9 @@ ENTRY(_fpsetmask)
 #else
 ENTRY(fpsetmask)
 #endif
+#ifdef __VFP_FP__
+#error _fpsetmask VFP support missing
+#else
 	rfs	r1
 	bic	r1, r1, #0x001f
 	and	r0, r0, #0x001f
@@ -52,3 +55,4 @@ ENTRY(fpsetmask)
 	wfs	r0
 	mov	r0, r1, lsr #16		/* Return old mask */
 	RET
+#endif
Index: src/lib/libc/arch/arm/hardfloat/fpsetsticky.S
diff -u src/lib/libc/arch/arm/hardfloat/fpsetsticky.S:1.4 src/lib/libc/arch/arm/hardfloat/fpsetsticky.S:1.5
--- src/lib/libc/arch/arm/hardfloat/fpsetsticky.S:1.4	Sat Aug 21 11:21:00 2004
+++ src/lib/libc/arch/arm/hardfloat/fpsetsticky.S	Wed Aug  1 06:10:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.S,v 1.4 2004/08/21 11:21:00 rearnsha Exp $	*/
+/*	$NetBSD: fpsetsticky.S,v 1.5 2012/08/01 06:10:21 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -45,6 +45,9 @@ ENTRY(_fpsetsticky)
 #else
 ENTRY(fpsetsticky)
 #endif
+#ifdef __VFP_FP__
+#error _fpsetsticky VFP support missing
+#else
 	rfs	r1
 	bic	r1, r1, #0x1f
 	and	r0, r0, #0x1f
@@ -52,3 +55,4 @@ ENTRY(fpsetsticky)
 	wfs	r0
 	mov	r0, r1			/* Return old mask */
 	RET
+#endif



CVS commit: src/sys/dev/ata

2012-08-01 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Aug  1 09:02:04 UTC 2012

Added Files:
src/sys/dev/ata: satapmp_subr.c satapmpvar.h

Log Message:
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.9 src/sys/dev/ata/satapmp_subr.c
cvs rdiff -u -r0 -r1.3 src/sys/dev/ata/satapmpvar.h

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

Added files:

Index: src/sys/dev/ata/satapmp_subr.c
diff -u /dev/null src/sys/dev/ata/satapmp_subr.c:1.9
--- /dev/null	Wed Aug  1 09:02:04 2012
+++ src/sys/dev/ata/satapmp_subr.c	Wed Aug  1 09:02:03 2012
@@ -0,0 +1,278 @@
+/*	$NetBSD: satapmp_subr.c,v 1.9 2012/08/01 09:02:03 bouyer Exp $	*/
+
+/*
+ * Copyright (c) 2012 Manuel Bouyer.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: satapmp_subr.c,v 1.9 2012/08/01 09:02:03 bouyer Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/device.h
+#include sys/conf.h
+#include sys/fcntl.h
+#include sys/proc.h
+#include sys/errno.h
+#include sys/kmem.h
+#include sys/intr.h
+
+#include dev/ata/ataconf.h
+#include dev/ata/atareg.h
+#include dev/ata/atavar.h
+
+#include dev/ata/satapmpvar.h
+#include dev/ata/satapmpreg.h
+#include dev/ata/satavar.h
+#include dev/ata/satareg.h
+
+static int
+satapmp_read_8(struct ata_channel *chp, int port, int reg, uint64_t *value)
+{
+	struct ata_command ata_c;
+	struct atac_softc *atac = chp-ch_atac;
+	struct ata_drive_datas *drvp;
+
+	KASSERT(port  PMP_MAX_DRIVES);
+	KASSERT(reg  PMP_GSCR_NREGS);
+	KASSERT(chp-ch_ndrives = PMP_MAX_DRIVES);
+	drvp = chp-ch_drive[PMP_PORT_CTL];
+	KASSERT(drvp-drive == PMP_PORT_CTL);
+
+	memset(ata_c, 0, sizeof(struct ata_command));
+
+	ata_c.r_command = PMPC_READ_PORT;
+	ata_c.r_features = reg;
+	ata_c.r_device = port;
+	ata_c.timeout = 3000; /* 3s */
+	ata_c.r_st_bmask = WDCS_DRDY;
+	ata_c.r_st_pmask = 0;
+	ata_c.flags = AT_LBA48 | AT_READREG | AT_WAIT;
+
+	if ((*atac-atac_bustype_ata-ata_exec_command)(drvp,
+	ata_c) != ATACMD_COMPLETE) {
+		aprint_error_dev(chp-atabus,
+		PMP register %d read failed\n, reg);
+		return EIO;
+	}
+	if (ata_c.flags  (AT_TIMEOU | AT_DF)) {
+		aprint_error_dev(chp-atabus,
+		PMP register %d read failed, flags 0x%x\n,
+		reg, ata_c.flags);
+		return EIO;
+	}
+	if (ata_c.flags  AT_ERROR) {
+		aprint_verbose_dev(chp-atabus,
+		PMP register %d read failed, error 0x%x\n,
+		reg, ata_c.r_error);
+		return EIO;
+	}
+
+	*value = ((uint64_t)((ata_c.r_lba  24)  0xff)  40) |
+		((uint64_t)((ata_c.r_count  8)  0xff)  32) |
+		((uint64_t)((ata_c.r_lba  0)  0xff)  8) |
+		((uint64_t)((ata_c.r_count  0)  0xff)  0);
+
+	return 0;
+}
+
+static inline int
+satapmp_read(struct ata_channel *chp, int port, int reg, uint32_t *value)
+{
+	uint64_t value64;
+	int ret;
+
+	ret = satapmp_read_8(chp, port, reg, value64);
+	if (ret)
+		return ret;
+
+	*value = value64  0x;
+	return ret;
+}
+
+static int
+satapmp_write_8(struct ata_channel *chp, int port, int reg, uint64_t value)
+{
+	struct ata_command ata_c;
+	struct atac_softc *atac = chp-ch_atac;
+	struct ata_drive_datas *drvp;
+
+	KASSERT(port  PMP_MAX_DRIVES);
+	KASSERT(reg  PMP_GSCR_NREGS);
+	KASSERT(chp-ch_ndrives = PMP_MAX_DRIVES);
+	drvp = chp-ch_drive[PMP_PORT_CTL];
+	KASSERT(drvp-drive == PMP_PORT_CTL);
+
+	memset(ata_c, 0, sizeof(struct ata_command));
+
+	ata_c.r_command = PMPC_WRITE_PORT;
+	ata_c.r_features = reg;
+	ata_c.r_device = port;
+	ata_c.r_lba = (((value  40)  0xff)  24) |
+		  (((value   8)  0xff)   

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

2012-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  1 09:07:36 UTC 2012

Modified Files:
src/sys/arch/sparc64/sparc64: trap.c

Log Message:
Do not spam the console when sending a sigill due to a T_ILLINST trap,
new openssl probes for the cpu sub family/features by trying some new
instructions and catching sigill.
In all other cases, move the printf inside a #ifdef DEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/arch/sparc64/sparc64/trap.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/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.176 src/sys/arch/sparc64/sparc64/trap.c:1.177
--- src/sys/arch/sparc64/sparc64/trap.c:1.176	Wed Apr 25 19:58:07 2012
+++ src/sys/arch/sparc64/sparc64/trap.c	Wed Aug  1 09:07:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.176 2012/04/25 19:58:07 martin Exp $ */
+/*	$NetBSD: trap.c,v 1.177 2012/08/01 09:07:35 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.176 2012/04/25 19:58:07 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.177 2012/08/01 09:07:35 martin Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -625,13 +625,15 @@ badtrap:
 			preempt();
 		break;
 
-	case T_ILLINST:
 	case T_INST_EXCEPT:
 	case T_TEXTFAULT:
+#ifdef DEBUG
 		/* This is not an MMU issue */
 		printf(trap: pid=%d.%d comm=%s textfault at %lx!! sending SIGILL due to trap %d: %s\n, 
 		   l-l_proc-p_pid, l-l_lid, l-l_proc-p_comm,
 		   pc, type, type  N_TRAP_TYPES ? trap_type[type] : T);
+#endif
+	case T_ILLINST:
 #if defined(DDB)  defined(DEBUG)
 		if (trapdebug  TDB_STOPSIG)
 			Debugger();



CVS commit: src/sys/dev/ata

2012-08-01 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Aug  1 09:38:55 UTC 2012

Modified Files:
src/sys/dev/ata: satapmp_subr.c

Log Message:
Make this compile again after DRIVET rename


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ata/satapmp_subr.c

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

Modified files:

Index: src/sys/dev/ata/satapmp_subr.c
diff -u src/sys/dev/ata/satapmp_subr.c:1.9 src/sys/dev/ata/satapmp_subr.c:1.10
--- src/sys/dev/ata/satapmp_subr.c:1.9	Wed Aug  1 09:02:03 2012
+++ src/sys/dev/ata/satapmp_subr.c	Wed Aug  1 09:38:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: satapmp_subr.c,v 1.9 2012/08/01 09:02:03 bouyer Exp $	*/
+/*	$NetBSD: satapmp_subr.c,v 1.10 2012/08/01 09:38:55 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2012 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: satapmp_subr.c,v 1.9 2012/08/01 09:02:03 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: satapmp_subr.c,v 1.10 2012/08/01 09:38:55 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -229,7 +229,7 @@ satapmp_rescan(struct ata_channel *chp) 
 	KASSERT(chp-ch_satapmp_nports = chp-ch_ndrives);
 
 	for (i = 0; i  chp-ch_satapmp_nports; i++) {
-		if (chp-ch_drive[i].drive_type != DRIVET_NONE ||
+		if (chp-ch_drive[i].drive_type != ATA_DRIVET_NONE ||
 		satapmp_reset_device_port(chp, i) != SStatus_DET_DEV) {
 			continue;
 		}



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

2012-08-01 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Aug  1 10:34:42 UTC 2012

Modified Files:
src/sys/arch/arm/marvell: kirkwoodreg.h mvsoc.c
Added Files:
src/sys/arch/arm/marvell: mvsocts.c

Log Message:
Add Thermal Sensor for Kirkwood(88F6282).  tested only OpenBlockS A6.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/marvell/kirkwoodreg.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/marvell/mvsoc.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/marvell/mvsocts.c

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

Modified files:

Index: src/sys/arch/arm/marvell/kirkwoodreg.h
diff -u src/sys/arch/arm/marvell/kirkwoodreg.h:1.3 src/sys/arch/arm/marvell/kirkwoodreg.h:1.4
--- src/sys/arch/arm/marvell/kirkwoodreg.h:1.3	Sat Jul 21 04:30:34 2012
+++ src/sys/arch/arm/marvell/kirkwoodreg.h	Wed Aug  1 10:34:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kirkwoodreg.h,v 1.3 2012/07/21 04:30:34 kiyohara Exp $	*/
+/*	$NetBSD: kirkwoodreg.h,v 1.4 2012/08/01 10:34:42 kiyohara Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -166,6 +166,11 @@
 
 
 /*
+ * Kirkwood Thermal Sensor(6282 only)
+ */
+#define KIRKWOOD_TS_BASE	(MVSOC_DEVBUS_BASE + 0x0078)	/* : ??? */
+
+/*
  * Two-Wire Serial Interface Registers
  */
 #define KIRKWOOD_TWSI1_BASE	(MVSOC_TWSI_BASE + 0x0100)

Index: src/sys/arch/arm/marvell/mvsoc.c
diff -u src/sys/arch/arm/marvell/mvsoc.c:1.7 src/sys/arch/arm/marvell/mvsoc.c:1.8
--- src/sys/arch/arm/marvell/mvsoc.c:1.7	Mon Jul 23 06:19:04 2012
+++ src/sys/arch/arm/marvell/mvsoc.c	Wed Aug  1 10:34:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc.c,v 1.7 2012/07/23 06:19:04 kiyohara Exp $	*/
+/*	$NetBSD: mvsoc.c,v 1.8 2012/08/01 10:34:42 kiyohara Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mvsoc.c,v 1.7 2012/07/23 06:19:04 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: mvsoc.c,v 1.8 2012/08/01 10:34:42 kiyohara Exp $);
 
 #include opt_cputypes.h
 #include opt_mvsoc.h
@@ -353,6 +353,7 @@ static const struct mvsoc_periph {
 { KIRKWOOD(88F6282),mvsoctmr,0, MVSOC_TMR_BASE,	IRQ_DEFAULT },
 { KIRKWOOD(88F6282),mvsocgpp,0, MVSOC_GPP_BASE,	KIRKWOOD_IRQ_GPIOLO7_0},
 { KIRKWOOD(88F6282),mvsocrtc,0, KIRKWOOD_RTC_BASE,IRQ_DEFAULT },
+{ KIRKWOOD(88F6282),mvsocts, 0, KIRKWOOD_TS_BASE,	IRQ_DEFAULT },
 { KIRKWOOD(88F6282),com, 0, MVSOC_COM0_BASE,	KIRKWOOD_IRQ_UART0INT },
 { KIRKWOOD(88F6282),com, 1, MVSOC_COM1_BASE,	KIRKWOOD_IRQ_UART1INT },
 { KIRKWOOD(88F6282),ehci,0, KIRKWOOD_USB_BASE,KIRKWOOD_IRQ_USB0CNT },

Added files:

Index: src/sys/arch/arm/marvell/mvsocts.c
diff -u /dev/null src/sys/arch/arm/marvell/mvsocts.c:1.1
--- /dev/null	Wed Aug  1 10:34:42 2012
+++ src/sys/arch/arm/marvell/mvsocts.c	Wed Aug  1 10:34:42 2012
@@ -0,0 +1,129 @@
+/*	$NetBSD: mvsocts.c,v 1.1 2012/08/01 10:34:42 kiyohara Exp $	*/
+/*
+ * Copyright (c) 2012 KIYOHARA Takashi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: mvsocts.c,v 1.1 2012/08/01 10:34:42 kiyohara Exp $);
+
+#include sys/param.h
+#include sys/bus.h
+#include sys/device.h
+#include sys/errno.h
+
+#include dev/sysmon/sysmonvar.h
+
+#include dev/marvell/marvellvar.h
+
+#define TS_STATUS		0x0
+#define   STATUS_VALID			(1  9)
+#define   STATUS_VAL(v)			(((v)  10)  0x1ff)
+
+#define VAL2MCELSIUS(v)		(((322 - (v)) * 1) / 13625)
+
+struct mvsocts_softc {
+	device_t sc_dev;
+
+	struct sysmon_envsys *sc_sme;
+	envsys_data_t sc_sensor;
+
+	bus_space_tag_t sc_iot;
+	bus_space_handle_t sc_ioh;
+};
+
+
+static int 

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

2012-08-01 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Aug  1 10:38:41 UTC 2012

Modified Files:
src/sys/arch/arm/marvell: files.marvell

Log Message:
Add mvsocts.


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

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

Modified files:

Index: src/sys/arch/arm/marvell/files.marvell
diff -u src/sys/arch/arm/marvell/files.marvell:1.6 src/sys/arch/arm/marvell/files.marvell:1.7
--- src/sys/arch/arm/marvell/files.marvell:1.6	Fri Jul 27 03:03:34 2012
+++ src/sys/arch/arm/marvell/files.marvell	Wed Aug  1 10:38:41 2012
@@ -1,4 +1,4 @@
-#   $NetBSD: files.marvell,v 1.6 2012/07/27 03:03:34 kiyohara Exp $
+#   $NetBSD: files.marvell,v 1.7 2012/08/01 10:38:41 kiyohara Exp $
 #
 # Configuration info for Marvell System on Chip support
 #
@@ -74,3 +74,8 @@ file	arch/arm/marvell/mvsocgpp.c		mvsocg
 
 # Secure Digital Input/Output (SDIO) Interface
 attach	mvsdio at mvsoc with mvsdio_mbus
+
+# Thermal Sensor
+device	mvsocts: sysmon_envsys
+attach	mvsocts at mvsoc
+file	arch/arm/marvell/mvsocts.c		mvsocts



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

2012-08-01 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Aug  1 10:50:06 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: README.evbarm
Added Files:
src/sys/arch/evbarm/conf: OPENBLOCKS_A6

Log Message:
Add OPENBLOCKS_A6 (Plat'Home OpenBlockS A6).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/OPENBLOCKS_A6
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/README.evbarm

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/evbarm/conf/README.evbarm
diff -u src/sys/arch/evbarm/conf/README.evbarm:1.2 src/sys/arch/evbarm/conf/README.evbarm:1.3
--- src/sys/arch/evbarm/conf/README.evbarm:1.2	Thu Jul 26 17:26:59 2012
+++ src/sys/arch/evbarm/conf/README.evbarm	Wed Aug  1 10:50:05 2012
@@ -1,4 +1,4 @@
-$NetBSD: README.evbarm,v 1.2 2012/07/26 17:26:59 tsutsui Exp $
+$NetBSD: README.evbarm,v 1.3 2012/08/01 10:50:05 kiyohara Exp $
 
 config		date		boards
 ---
@@ -31,6 +31,7 @@ MV2120		2011/07/20	HP Media Vault MV2011
 NAPPI		2002/07/15	Netwise APlication Platform Board
 NETWALKER	2010/11/13	Sharp NetWalker
 NSLU2		2006/02/28	Linksys NSLU2 (a.k.a. Slug)
+OPENBLOCKS_A6	2012/08/01	Plat'Home. OpenBlockS A6
 OSK5912		2007/01/06	TI OMAP 5912 OSK board
 OVERO		2010/07/10	Gumstix Inc. OMAP3530 based Overo boards
 SHEEVAPLUG	2010/10/02	Marvell SheevaPlug

Added files:

Index: src/sys/arch/evbarm/conf/OPENBLOCKS_A6
diff -u /dev/null src/sys/arch/evbarm/conf/OPENBLOCKS_A6:1.1
--- /dev/null	Wed Aug  1 10:50:06 2012
+++ src/sys/arch/evbarm/conf/OPENBLOCKS_A6	Wed Aug  1 10:50:05 2012
@@ -0,0 +1,415 @@
+#	$NetBSD: OPENBLOCKS_A6,v 1.1 2012/08/01 10:50:05 kiyohara Exp $
+#
+#  OPENBLOCKS_A6 -- Plat'Home. OpenBlockS A6 kernel
+#
+
+include 	arch/evbarm/conf/std.marvell
+
+options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+# estimated number of users
+
+maxusers	32
+
+# Board Type
+makeoptions	BOARDTYPE=openblocks_a6
+options 	EVBARM_BOARDTYPE=openblocks_a6
+
+# CPU options
+options 	CPU_SHEEVA
+#options 	MV_L2_CACHE_ENABLE
+#options 	MV_L2_CACHE_WRITE_THROUGH
+options 	MV_CACHE_RANGE_OPS
+makeoptions	CPUFLAGS=-march=armv5te
+
+# Marvell SoC options
+options 	KIRKWOOD
+
+# Standard system options
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+options 	NTP		# NTP phase/frequency locked loop
+
+# File systems
+
+file-system 	FFS		# UFS
+file-system 	EXT2FS		# second extended file system (linux)
+#file-system 	LFS		# log-structured file system
+#file-system 	MFS		# memory file system
+file-system 	NFS		# Network File System client
+#file-system 	NTFS		# Windows/NT file system (experimental)
+#file-system 	CD9660		# ISO 9660 + Rock Ridge file system
+file-system 	MSDOSFS		# MS-DOS file system
+file-system 	FDESC		# /dev/fd
+file-system 	KERNFS		# /kern
+#file-system 	NULLFS		# loopback file system
+#file-system 	OVERLAY		# overlay file system
+#file-system 	PORTAL		# portal filesystem (still experimental)
+file-system 	PROCFS		# /proc
+#file-system 	UMAPFS		# NULLFS + uid and gid remapping
+#file-system 	UNION		# union file system
+#file-system 	CODA		# Coda File System; also needs vcoda (below)
+#file-system 	SMBFS		# experimental - CIFS; also needs nsmb (below)
+file-system 	PTYFS		# /dev/ptm support
+file-system 	TMPFS		# Efficient memory file-system
+#file-system 	UDF		# experimental - OSTA UDF CD/DVD file-system
+#file-system 	HFS		# experimental - Apple HFS+ (read-only)
+
+# File system options
+#options 	QUOTA		# legacy UFS quotas
+#options 	QUOTA2		# new, in-filesystem UFS quotas
+#options 	FFS_EI		# FFS Endian Independent support
+options 	WAPBL		# File system journaling support
+# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
+# It is not recommended for general use.
+#options 	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
+options 	NFSSERVER	# Network File System server
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+#options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+# immutable) behave as system flags.
+
+# Networking options
+
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPv6
+options 	IPSEC		# IP security
+options 	IPSEC_ESP	# IP security (encryption part; define w/IPSEC)
+options 	IPSEC_NAT_T	# IPsec NAT traversal (NAT-T)
+#options 	IPSEC_DEBUG	# debug for IP security
+#options 	MROUTING	# IP multicast routing
+#options 	PIM		# Protocol Independent Multicast
+#options 	ISO,TPIP	# OSI
+#options 	EON		# OSI tunneling over IP
+options 	NETATALK	# AppleTalk networking protocols
+options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+options 	PPP_DEFLATE	# Deflate compression support for PPP
+options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
+options 	PFIL_HOOKS	# pfil(9) packet filter hooks
+options 	

CVS commit: src

2012-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  1 15:24:22 UTC 2012

Modified Files:
src/lib/libc/gen: sysconf.c
src/sys/sys: unistd.h

Log Message:
Define _POSIX_SPAWN in unistd.h and also provide its value via sysconf(),
as required by posix since we support posix_spawn().


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/gen/sysconf.c
cvs rdiff -u -r1.52 -r1.53 src/sys/sys/unistd.h

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

Modified files:

Index: src/lib/libc/gen/sysconf.c
diff -u src/lib/libc/gen/sysconf.c:1.33 src/lib/libc/gen/sysconf.c:1.34
--- src/lib/libc/gen/sysconf.c:1.33	Wed Aug  6 17:17:04 2008
+++ src/lib/libc/gen/sysconf.c	Wed Aug  1 15:24:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysconf.c,v 1.33 2008/08/06 17:17:04 matt Exp $	*/
+/*	$NetBSD: sysconf.c,v 1.34 2012/08/01 15:24:22 martin Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)sysconf.c	8.2 (Berkeley) 3/20/94;
 #else
-__RCSID($NetBSD: sysconf.c,v 1.33 2008/08/06 17:17:04 matt Exp $);
+__RCSID($NetBSD: sysconf.c,v 1.34 2012/08/01 15:24:22 martin Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -346,6 +346,8 @@ sysconf(int name)
 		return _POSIX_REGEXP;
 	case _SC_SHELL:
 		return _POSIX_SHELL;
+	case _SC_SPAWN:
+		return _POSIX_SPAWN;
 	case _SC_SYMLOOP_MAX:
 		return MAXSYMLINKS;
 

Index: src/sys/sys/unistd.h
diff -u src/sys/sys/unistd.h:1.52 src/sys/sys/unistd.h:1.53
--- src/sys/sys/unistd.h:1.52	Sun Aug 30 16:38:48 2009
+++ src/sys/sys/unistd.h	Wed Aug  1 15:24:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.52 2009/08/30 16:38:48 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.53 2012/08/01 15:24:22 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -62,6 +62,11 @@
 #define	_POSIX_VERSION			200112L
 #define	_POSIX2_VERSION			200112L
 
+/*
+ * We support the posix_spawn() family of functions (unconditionally).
+ */
+#define	_POSIX_SPAWN			200809L
+
 /* execution-time symbolic constants */
 
 /*
@@ -298,6 +303,9 @@
 #define	_SC_2_PBS_MESSAGE		84
 #define	_SC_2_PBS_TRACK			85
 
+/* This is implemented */
+#define	_SC_SPAWN			86
+
 #ifdef _NETBSD_SOURCE
 /* Commonly provided sysconf() extensions */
 #define	_SC_NPROCESSORS_CONF	1001



CVS commit: src/sys/arch/powerpc

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 16:19:43 UTC 2012

Modified Files:
src/sys/arch/powerpc/booke: genassym.cf trap_subr.S
src/sys/arch/powerpc/include: frame.h

Log Message:
Fix a problem where the kernel could randomly reset due to a watchdog event.
When an exception happens, the srr0 (exception PC) was being saved in the
normal location of the current callframe.  This was fine except when the
routine was in its prologue after it had saved LR but had not yet updated the
stack pointer or when the routine was in its epilogue after it has restored
the stack pointer but not yet loaded the LR.  In either case this would cause
the LR to be corrupted (either running the routine forever or by branching
to itself forever).  Now we save and restore the contents of that memory
location so the corruption can't happen.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/genassym.cf
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/trap_subr.S
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/include/frame.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/powerpc/booke/genassym.cf
diff -u src/sys/arch/powerpc/booke/genassym.cf:1.8 src/sys/arch/powerpc/booke/genassym.cf:1.9
--- src/sys/arch/powerpc/booke/genassym.cf:1.8	Wed Jun 29 06:06:04 2011
+++ src/sys/arch/powerpc/booke/genassym.cf	Wed Aug  1 16:19:43 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.8 2011/06/29 06:06:04 matt Exp $
+#	$NetBSD: genassym.cf,v 1.9 2012/08/01 16:19:43 matt Exp $
 
 #-
 # Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -61,6 +61,7 @@ define	FRAME_MCSR	offsetof(struct ktrapf
 define	FRAME_MCAR	offsetof(struct ktrapframe, ktf_tf.tf_mcar)
 define	FRAME_SPRG1	offsetof(struct ktrapframe, ktf_tf.tf_sprg1)
 define	FRAME_SPEFSCR	offsetof(struct ktrapframe, ktf_tf.tf_spefscr)
+define	FRAME_CFRAME_LR	offsetof(struct ktrapframe, ktf_cframe_lr)
 
 define	CI_SAVELIFO	offsetof(struct cpu_info, ci_savearea[0])
 define	CI_PMAP_SEGTAB	offsetof(struct cpu_info, ci_pmap_segtabs[0])

Index: src/sys/arch/powerpc/booke/trap_subr.S
diff -u src/sys/arch/powerpc/booke/trap_subr.S:1.7 src/sys/arch/powerpc/booke/trap_subr.S:1.8
--- src/sys/arch/powerpc/booke/trap_subr.S:1.7	Mon Jul  9 17:36:55 2012
+++ src/sys/arch/powerpc/booke/trap_subr.S	Wed Aug  1 16:19:43 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.7 2012/07/09 17:36:55 matt Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.8 2012/08/01 16:19:43 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-RCSID($NetBSD: trap_subr.S,v 1.7 2012/07/09 17:36:55 matt Exp $)
+RCSID($NetBSD: trap_subr.S,v 1.8 2012/08/01 16:19:43 matt Exp $)
 
 	.globl	_C_LABEL(sctrapexit), _C_LABEL(trapexit), _C_LABEL(intrcall)
 
@@ -137,14 +137,24 @@ RCSID($NetBSD: trap_subr.S,v 1.7 2012/0
 /*
  * DDB expects to fetch the LR from the previous frame.  But it also
  * expects to be pointing at the instruction after the branch link.  Since
- * we didn't branch, we need to advance it by to fake out DDB.
+ * we didn't branch, we need to advance it by to fake out DDB.  But there's
+ * problem.  If the routine is in either its first or last two instructions
+ * (before or after its adjusted its stack pointer), we could possibly
+ * overwrite stored return address.  So that stored return address needs to
+ * saved and restored.
  */
-#ifdef DDB
+#if defined(DDB)
 #define FRAME_SAVE_SRR0_FOR_DDB		\
-	addi	%r30, %r30, 4;		/* ddb thinks its the next insn */ \
-	stw	%r30, FRAMELEN+SZREG(%r1); /* appease ddb stacktrace */
+	lwz	%r29, FRAMELEN+CFRAME_LR(%r1);	/* fetch old return address */\
+	stw	%r29, FRAME_CFRAME_LR(%r1);	/* save it */		 \
+	addi	%r30, %r30, 4;			/* point to s the next insn */ \
+	stw	%r30, FRAMELEN+CFRAME_LR(%r1)	/* appease ddb stacktrace */
+#define FRAME_RESTORE_RETURN_ADDRESS	\
+	lwz	%r3, FRAME_CFRAME_LR(%r1);	/* fetch old return address */ \
+	stw	%r3, FRAMELEN+CFRAME_LR(%r1)	/* restore it */
 #else
 #define FRAME_SAVE_SRR0_FOR_DDB
+#define FRAME_RESTORE_RETURN_ADDRESS
 #endif
 
 #ifdef PPC_HAVE_SPE
@@ -175,7 +185,6 @@ RCSID($NetBSD: trap_subr.S,v 1.7 2012/0
 	addi	%r1, %r2, USPACE-CALLFRAMELEN;\
 	/* start stack at top of it */	\
 1:	\
-	stw	%r30, CFRAME_LR(%r1);	/* save in previous callframe */ \
 	stwu	%r31, -FRAMELEN(%r1);	/* get space for trapframe */	\
 	stw	%r0, FRAME_R0(%r1);	/* save r0 */			\
 	stw	%r31, FRAME_R1(%r1);	/* save (saved) r1 */		\
@@ -203,6 +212,7 @@ RCSID($NetBSD: trap_subr.S,v 1.7 2012/0
 	addi	tf, %r1, FRAME_TF	/* get address of trap frame */
 
 #define FRAME_EXC_EXIT(rfi, srr)	\
+	FRAME_RESTORE_RETURN_ADDRESS;	/* restore return address */	\
 	lmw	%r26, FRAME_LR(%r1);	/* get LR CR XER CTR SRR0/1 */	\
 	oris	%r31,%r31,PSL_CE@h;	\
 	mtspr	SPR_##srr##1, %r31;	/* restore SRR1 */		\
@@ 

CVS commit: src/sys/arch/powerpc

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 16:35:50 UTC 2012

Modified Files:
src/sys/arch/powerpc/booke: trap.c
src/sys/arch/powerpc/include/booke: cpuvar.h

Log Message:
Export dump_trapframe.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/booke/cpuvar.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.18 src/sys/arch/powerpc/booke/trap.c:1.19
--- src/sys/arch/powerpc/booke/trap.c:1.18	Mon Jul 23 04:13:06 2012
+++ src/sys/arch/powerpc/booke/trap.c	Wed Aug  1 16:35:50 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.18 2012/07/23 04:13:06 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.19 2012/08/01 16:35:50 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.18 2012/07/23 04:13:06 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.19 2012/08/01 16:35:50 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -71,7 +71,6 @@ __KERNEL_RCSID(1, $NetBSD: trap.c,v 1.1
 #include powerpc/booke/pte.h
 
 void trap(enum ppc_booke_exceptions, struct trapframe *);
-static void dump_trapframe(const struct trapframe *);
 
 static const char trap_names[][8] = {
 	[T_CRITIAL_INPUT] = CRIT,
@@ -620,7 +619,7 @@ embedded_fp_round_exception(struct trapf
 	return rv;
 }
 
-static void
+void
 dump_trapframe(const struct trapframe *tf)
 {
 	printf(trapframe %p (exc=%x srr0/1=%#lx/%#lx esr/dear=%#x/%#lx)\n,

Index: src/sys/arch/powerpc/include/booke/cpuvar.h
diff -u src/sys/arch/powerpc/include/booke/cpuvar.h:1.14 src/sys/arch/powerpc/include/booke/cpuvar.h:1.15
--- src/sys/arch/powerpc/include/booke/cpuvar.h:1.14	Sun Jul 29 21:39:43 2012
+++ src/sys/arch/powerpc/include/booke/cpuvar.h	Wed Aug  1 16:35:50 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.14 2012/07/29 21:39:43 matt Exp $	*/
+/*	$NetBSD: cpuvar.h,v 1.15 2012/08/01 16:35:50 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -62,6 +62,8 @@ struct cpu_softc {
 	struct evcnt cpu_ev_late_clock;
 	u_long cpu_ticks_per_clock_intr;
 	struct evcnt cpu_ev_exec_trap_sync;
+
+	uint64_t cpu_spl_tb[NIPL][NIPL];
 };
 
 struct cpunode_locators {
@@ -194,6 +196,9 @@ void	*board_info_get_object(const char *
 const void *
 	board_info_get_data(const char *, size_t *);
 
+/* trap.c */
+void dump_trapframe(const struct trapframe *);
+
 extern char root_string[];
 extern paddr_t msgbuf_paddr;
 extern prop_dictionary_t board_properties;



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

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 20:35:53 UTC 2012

Modified Files:
src/sys/arch/powerpc/powerpc: genassym.cf locore_subr.S

Log Message:
Add diagnostic code emptyidlespin verifying that the current IPL
is IPL_NONE and EE is set in the MSR.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/powerpc/genassym.cf
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/powerpc/powerpc/locore_subr.S

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/genassym.cf
diff -u src/sys/arch/powerpc/powerpc/genassym.cf:1.8 src/sys/arch/powerpc/powerpc/genassym.cf:1.9
--- src/sys/arch/powerpc/powerpc/genassym.cf:1.8	Mon Jun 20 08:18:28 2011
+++ src/sys/arch/powerpc/powerpc/genassym.cf	Wed Aug  1 20:35:52 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.8 2011/06/20 08:18:28 matt Exp $
+#	$NetBSD: genassym.cf,v 1.9 2012/08/01 20:35:52 matt Exp $
 
 #-
 # Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@ include powerpc/psl.h
 define	IPL_HIGH		IPL_HIGH
 define	IPL_SCHED		IPL_SCHED
 define	IPL_VM			IPL_VM
+define	IPL_NONE		IPL_NONE
 
 define	CPU_MAXNUM		CPU_MAXNUM
 

Index: src/sys/arch/powerpc/powerpc/locore_subr.S
diff -u src/sys/arch/powerpc/powerpc/locore_subr.S:1.48 src/sys/arch/powerpc/powerpc/locore_subr.S:1.49
--- src/sys/arch/powerpc/powerpc/locore_subr.S:1.48	Sun Feb 19 21:06:23 2012
+++ src/sys/arch/powerpc/powerpc/locore_subr.S	Wed Aug  1 20:35:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_subr.S,v 1.48 2012/02/19 21:06:23 rmind Exp $	*/
+/*	$NetBSD: locore_subr.S,v 1.49 2012/08/01 20:35:52 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -295,7 +295,17 @@ switchto_restore:
 #endif
 	ldreg	%r0,CFRAME_LR(%r1)
 	mtlr	%r0
+	blr/* CPUINIT needs a raw blr */
+
 ENTRY_NOPROFILE(emptyidlespin)
+#ifdef DIAGNOSTIC
+	GET_CPUINFO(%r3)
+	lbz	%r4,CI_CPL(%r3)
+	twnei	%r4,IPL_NONE
+	mfmsr	%r5
+	andi.	%r5,%r5,PSL_EE@l
+	tweqi	%r5,PSL_EE@l
+#endif
 	blr/* CPUINIT needs a raw blr */
 
 #ifdef __HAVE_FAST_SOFTINTS



CVS commit: [yamt-pagecache] src

2012-08-01 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Aug  1 21:09:27 UTC 2012

Modified Files:
src/common/lib/libc/gen [yamt-pagecache]: radixtree.c
src/sys/sys [yamt-pagecache]: radixtree.h

Log Message:
make tag-variants of radix tree functions take and return a mask of tags
rather than tag ids so that they can deal with multiple tags at once.


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.3 -r1.17.2.4 src/common/lib/libc/gen/radixtree.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/sys/sys/radixtree.h

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

Modified files:

Index: src/common/lib/libc/gen/radixtree.c
diff -u src/common/lib/libc/gen/radixtree.c:1.17.2.3 src/common/lib/libc/gen/radixtree.c:1.17.2.4
--- src/common/lib/libc/gen/radixtree.c:1.17.2.3	Wed Jun 13 14:18:49 2012
+++ src/common/lib/libc/gen/radixtree.c	Wed Aug  1 21:09:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: radixtree.c,v 1.17.2.3 2012/06/13 14:18:49 yamt Exp $	*/
+/*	$NetBSD: radixtree.c,v 1.17.2.4 2012/08/01 21:09:27 yamt Exp $	*/
 
 /*-
  * Copyright (c)2011,2012 YAMAMOTO Takashi,
@@ -75,12 +75,17 @@
  * leaf nodes with the given tag.  To reduce amount of nodes to visit for
  * these functions, this implementation keeps tagging information in internal
  * intermediate nodes and quickly skips uninterested parts of a tree.
+ *
+ * A tree has RADIX_TREE_TAG_ID_MAX independent tag spaces, each of which are
+ * identified by an zero-origin numbers, tagid.  For the current implementation,
+ * RADIX_TREE_TAG_ID_MAX is 2.  A set of tags is described as a bitmask tagmask,
+ * which is a bitwise OR of (1  tagid).
  */
 
 #include sys/cdefs.h
 
 #if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, $NetBSD: radixtree.c,v 1.17.2.3 2012/06/13 14:18:49 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: radixtree.c,v 1.17.2.4 2012/08/01 21:09:27 yamt Exp $);
 #include sys/param.h
 #include sys/errno.h
 #include sys/pool.h
@@ -90,7 +95,7 @@ __KERNEL_RCSID(0, $NetBSD: radixtree.c,
 #include lib/libsa/stand.h
 #endif /* defined(_STANDALONE) */
 #else /* defined(_KERNEL) || defined(_STANDALONE) */
-__RCSID($NetBSD: radixtree.c,v 1.17.2.3 2012/06/13 14:18:49 yamt Exp $);
+__RCSID($NetBSD: radixtree.c,v 1.17.2.4 2012/08/01 21:09:27 yamt Exp $);
 #include assert.h
 #include errno.h
 #include stdbool.h
@@ -149,15 +154,6 @@ entry_match_p(void *p, unsigned int tagm
 	return (entry_tagmask(p)  tagmask) != 0;
 }
 
-static inline unsigned int
-tagid_to_mask(radix_tree_tagid_t id)
-{
-
-	KASSERT(id = 0);
-	KASSERT(id  RADIX_TREE_TAG_ID_MAX);
-	return 1U  id;
-}
-
 /*
  * radix_tree_node: an intermediate node
  *
@@ -274,13 +270,15 @@ radix_tree_empty_tree_p(struct radix_tre
  *
  * Return true if the tree has any nodes with the given tag.  Otherwise
  * return false.
+ *
+ * It's illegal to call this function with tagmask 0.
  */
 
 bool
-radix_tree_empty_tagged_tree_p(struct radix_tree *t, radix_tree_tagid_t tagid)
+radix_tree_empty_tagged_tree_p(struct radix_tree *t, unsigned int tagmask)
 {
-	const unsigned int tagmask = tagid_to_mask(tagid);
 
+	KASSERT(tagmask != 0);
 	return (entry_tagmask(t-t_root)  tagmask) == 0;
 }
 
@@ -873,16 +871,17 @@ radix_tree_gang_lookup_node_reverse(stru
  *
  * Same as radix_tree_gang_lookup_node except that this one only returns
  * nodes tagged with tagid.
+ *
+ * It's illegal to call this function with tagmask 0.
  */
 
 unsigned int
 radix_tree_gang_lookup_tagged_node(struct radix_tree *t, uint64_t idx,
-void **results, unsigned int maxresults, bool dense,
-radix_tree_tagid_t tagid)
+void **results, unsigned int maxresults, bool dense, unsigned int tagmask)
 {
 	struct radix_tree_path path;
-	const unsigned int tagmask = tagid_to_mask(tagid);
 
+	KASSERT(tagmask != 0);
 	gang_lookup_init(t, idx, path, tagmask);
 	return gang_lookup_scan(t, path, results, maxresults, tagmask, false,
 	dense);
@@ -897,12 +896,11 @@ radix_tree_gang_lookup_tagged_node(struc
 
 unsigned int
 radix_tree_gang_lookup_tagged_node_reverse(struct radix_tree *t, uint64_t idx,
-void **results, unsigned int maxresults, bool dense,
-radix_tree_tagid_t tagid)
+void **results, unsigned int maxresults, bool dense, unsigned int tagmask)
 {
 	struct radix_tree_path path;
-	const unsigned int tagmask = tagid_to_mask(tagid);
 
+	KASSERT(tagmask != 0);
 	gang_lookup_init(t, idx, path, tagmask);
 	return gang_lookup_scan(t, path, results, maxresults, tagmask, true,
 	dense);
@@ -911,21 +909,19 @@ radix_tree_gang_lookup_tagged_node_rever
 /*
  * radix_tree_get_tag:
  *
- * Return if the tag is set for the node at the given index.  (true if set)
+ * Return the tagmask for the node at the given index.
  *
  * It's illegal to call this function for a node which has not been inserted.
  */
 
-bool
-radix_tree_get_tag(struct radix_tree *t, uint64_t idx,
-radix_tree_tagid_t tagid)
+unsigned int
+radix_tree_get_tag(struct radix_tree *t, uint64_t idx, 

CVS commit: [yamt-pagecache] src/sys/uvm

2012-08-01 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Aug  1 21:12:24 UTC 2012

Modified Files:
src/sys/uvm [yamt-pagecache]: uvm_vnode.c

Log Message:
fix a typo in a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.97.2.5 -r1.97.2.6 src/sys/uvm/uvm_vnode.c

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

Modified files:

Index: src/sys/uvm/uvm_vnode.c
diff -u src/sys/uvm/uvm_vnode.c:1.97.2.5 src/sys/uvm/uvm_vnode.c:1.97.2.6
--- src/sys/uvm/uvm_vnode.c:1.97.2.5	Fri Feb 17 08:18:57 2012
+++ src/sys/uvm/uvm_vnode.c	Wed Aug  1 21:12:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_vnode.c,v 1.97.2.5 2012/02/17 08:18:57 yamt Exp $	*/
+/*	$NetBSD: uvm_vnode.c,v 1.97.2.6 2012/08/01 21:12:23 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_vnode.c,v 1.97.2.5 2012/02/17 08:18:57 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_vnode.c,v 1.97.2.6 2012/08/01 21:12:23 yamt Exp $);
 
 #include opt_uvmhist.h
 
@@ -261,7 +261,7 @@ uvn_findpage(struct uvm_object *uobj, vo
 		 *
 		 * XXX fragile API
 		 * note that the array can be the one supplied by the caller of
-		 * uvm_findpages.  in that case, fillflags used by the caller
+		 * uvn_findpages.  in that case, fillflags used by the caller
 		 * might not match strictly with ours.
 		 * in particular, the caller might have filled the array
 		 * without DIRTYONLY or DENSE but passed us UFP_DIRTYONLY.



CVS commit: [yamt-pagecache] src/sys/miscfs/genfs

2012-08-01 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Aug  1 21:13:46 UTC 2012

Modified Files:
src/sys/miscfs/genfs [yamt-pagecache]: genfs_io.c

Log Message:
remove stale comments


To generate a diff of this commit:
cvs rdiff -u -r1.53.2.14 -r1.53.2.15 src/sys/miscfs/genfs/genfs_io.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/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.53.2.14 src/sys/miscfs/genfs/genfs_io.c:1.53.2.15
--- src/sys/miscfs/genfs/genfs_io.c:1.53.2.14	Wed May 23 10:08:14 2012
+++ src/sys/miscfs/genfs/genfs_io.c	Wed Aug  1 21:13:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.53.2.14 2012/05/23 10:08:14 yamt Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.53.2.15 2012/08/01 21:13:45 yamt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.53.2.14 2012/05/23 10:08:14 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.53.2.15 2012/08/01 21:13:45 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -787,11 +787,6 @@ out_err:
  *	(e.g. vm_map) before calling flush.
  * = if neither PGO_CLEANIT nor PGO_SYNCIO is set, we will not block
  * = if PGO_ALLPAGES is set, then all pages in the object will be processed.
- * = NOTE: we rely on the fact that the object's memq is a TAILQ and
- *	that new pages are inserted on the tail end of the list.   thus,
- *	we can make a complete pass through the object in one go by starting
- *	at the head and working towards the tail (new pages are put in
- *	front of us).
  * = NOTE: we are allowed to lock the page queues, so the caller
  *	must not be holding the page queue lock.
  *
@@ -808,19 +803,6 @@ out_err:
  *	object we need to wait for the other PG_BUSY pages to clear
  *	off (i.e. we need to do an iosync).   also note that once a
  *	page is PG_BUSY it must stay in its object until it is un-busyed.
- *
- * note on page traversal:
- *	we can traverse the pages in an object either by going down the
- *	linked list in uobj-memq, or we can go over the address range
- *	by page doing hash table lookups for each address.depending
- *	on how many pages are in the object it may be cheaper to do one
- *	or the other.   we set by_list to true if we are using memq.
- *	if the cost of a hash lookup was equal to the cost of the list
- *	traversal we could compare the number of pages in the start-stop
- *	range to the total number of pages in the object.   however, it
- *	seems that a hash table lookup is more expensive than the linked
- *	list traversal, so we multiply the number of pages in the
- *	range by an estimate of the relatively higher cost of the hash lookup.
  */
 
 int



CVS commit: src/sys/arch/powerpc

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 21:30:25 UTC 2012

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c e500_intr.c trap.c
src/sys/arch/powerpc/include/booke: cpuvar.h
src/sys/arch/powerpc/powerpc: db_interface.c

Log Message:
Add a machine splhist command to give (a incomplete) spl history.
(only the most recent are going to be accurate).

splraise(6) from 0 at 549214603
splraise(7) from 6 at 549214643 (+40)
splx(6) from 7 at 549214691 (+48)
splx(0) from 6 at 549214730 (+39)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/booke/e500_intr.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/booke/cpuvar.h
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/powerpc/powerpc/db_interface.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.15 src/sys/arch/powerpc/booke/booke_machdep.c:1.16
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.15	Wed Jul 18 18:51:59 2012
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Wed Aug  1 21:30:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_machdep.c,v 1.15 2012/07/18 18:51:59 matt Exp $	*/
+/*	$NetBSD: booke_machdep.c,v 1.16 2012/08/01 21:30:21 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: booke_machdep.c,v 1.15 2012/07/18 18:51:59 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: booke_machdep.c,v 1.16 2012/08/01 21:30:21 matt Exp $);
 
 #include opt_modular.h
 
@@ -570,3 +570,102 @@ booke_sstep(struct trapframe *tf)
 	mtspr(SPR_DBCR1, dbcr1);
 	mtspr(SPR_DBCR0, dbcr0);
 }
+
+#ifdef DIAGNOSTIC
+static inline void
+swap_data(uint64_t *data, size_t a, size_t b)
+{
+	uint64_t swap = data[a];
+	data[a] = data[b];
+	data[b] = swap;
+}
+
+static void
+sort_data(uint64_t *data, size_t count)
+{
+#if 0
+	/*
+	 * Mostly classic bubble sort
+	 */
+	do {
+		size_t new_count = 0;
+		for (size_t i = 1; i  count; i++) {
+			if (tbs[i - 1]  tbs[i]) {
+swap_tbs(tbs, i - 1, i);
+new_count = i;
+			}
+		}
+		count = new_count;
+	} while (count  0);
+#else
+	/*
+	 * Comb sort
+	 */
+	size_t gap = count;
+	bool swapped = false;
+	while (gap  1 || swapped) {
+		if (gap  1) {
+			/*
+			 * phi = (1 + sqrt(5)) / 2 [golden ratio]
+			 * N = 1 / (1 - e^-phi)) = 1.247330950103979
+			 *
+			 * We want to but can't use floating point to calculate
+			 *	gap = (size_t)((double)gap / N)
+			 *
+			 * So we will use the multicative inverse of N
+			 * (module 65536) to achieve the division.
+			 *
+			 * iN = 2^16 / 1.24733... = 52540
+			 * x / N == (x * iN) / 65536 
+			 */
+			gap = (gap * 52540) / 65536;
+		}
+
+		swapped = false;
+
+		for (size_t i = 0; gap + i  count; i++) {
+			if (data[i]  data[i + gap]) {
+swap_data(data, i, i + gap);
+swapped = true;
+			}
+		}
+	}
+#endif
+}
+#endif
+
+void
+dump_splhist(struct cpu_info *ci, void (*pr)(const char *, ...))
+{
+#ifdef DIAGNOSTIC
+	struct cpu_softc * const cpu = ci-ci_softc;
+	uint64_t tbs[NIPL*NIPL];
+	size_t ntbs = 0;
+	for (size_t to = 0; to  NIPL; to++) {
+		for (size_t from = 0; from  NIPL; from++) {
+			uint64_t tb = cpu-cpu_spl_tb[to][from];
+			if (tb == 0)
+continue;
+			tbs[ntbs++] = (tb  8) | (to  4) | from;
+		}
+	}
+	sort_data(tbs, ntbs);
+
+	if (pr == NULL)
+		pr = printf;
+	uint64_t last_tb = 0;
+	for (size_t i = 0; i  ntbs; i++) {
+		uint64_t tb = tbs[i];
+		size_t from = tb  15;
+		size_t to = (tb  4)  15;
+		tb = 8;
+		(*pr)(%s(%zu) from %zu at %PRId64,
+		 from  to ? splraise : splx,
+		 to, from, tb);
+		if (last_tb  from != IPL_NONE)
+			(*pr)( (+%PRId64), tb - last_tb);
+		(*pr)(\n);
+		last_tb = tb;
+	}
+#endif
+}

Index: src/sys/arch/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.20 src/sys/arch/powerpc/booke/e500_intr.c:1.21
--- src/sys/arch/powerpc/booke/e500_intr.c:1.20	Wed Jul 18 16:45:33 2012
+++ src/sys/arch/powerpc/booke/e500_intr.c	Wed Aug  1 21:30:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.20 2012/07/18 16:45:33 matt Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.21 2012/08/01 21:30:22 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 #define __INTR_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: e500_intr.c,v 1.20 2012/07/18 16:45:33 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: e500_intr.c,v 1.21 2012/08/01 21:30:22 matt Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -419,6 +419,8 @@ const struct intrsw e500_intrsw = {
 #endif
 };
 
+static bool wdog_barked;
+
 static inline uint32_t 
 openpic_read(struct cpu_softc *cpu, 

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

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 22:28:10 UTC 2012

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

Log Message:
bump symtab_space


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/shark/conf/GENERIC

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

Modified files:

Index: src/sys/arch/shark/conf/GENERIC
diff -u src/sys/arch/shark/conf/GENERIC:1.101 src/sys/arch/shark/conf/GENERIC:1.102
--- src/sys/arch/shark/conf/GENERIC:1.101	Tue Jun  5 08:44:15 2012
+++ src/sys/arch/shark/conf/GENERIC	Wed Aug  1 22:28:10 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.101 2012/06/05 08:44:15 abs Exp $
+#	$NetBSD: GENERIC,v 1.102 2012/08/01 22:28:10 matt Exp $
 #
 # Generic Shark configuration.
 #
@@ -7,7 +7,7 @@ include	arch/shark/conf/std.shark
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		GENERIC-$Revision: 1.101 $
+#ident		GENERIC-$Revision: 1.102 $
 
 # estimated number of users
 maxusers	32
@@ -161,7 +161,7 @@ options 	MODULAR		# new style module(7) 
 options 	DIAGNOSTIC	# internal consistency checks
 #options 	PMAP_DEBUG	# Enable pmap_debug_level code
 options 	DDB		# in-kernel debugger
-options 	SYMTAB_SPACE=45 	# reserve symbol space for DDB
+options 	SYMTAB_SPACE=60 	# reserve symbol space for DDB
 # (needed because we boot netbsd.aout)
 #options 	DDB_ONPANIC=0	# don't run DDB at panictime
 #options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB



CVS commit: [yamt-pagecache] src/sys

2012-08-01 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Aug  1 22:34:15 UTC 2012

Modified Files:
src/sys/miscfs/genfs [yamt-pagecache]: genfs_io.c
src/sys/uvm [yamt-pagecache]: uvm_object.h uvm_page_array.c
uvm_page_array.h uvm_page_status.c uvm_pager.c uvm_vnode.c

Log Message:
- fix integrity sync.
  putpages for integrity sync (fsync, msync with MS_SYNC, etc) should not
  skip pages being written back by other threads.

- adapt to radix tree tag api changes.


To generate a diff of this commit:
cvs rdiff -u -r1.53.2.15 -r1.53.2.16 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.31.2.3 -r1.31.2.4 src/sys/uvm/uvm_object.h
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/uvm/uvm_page_array.c \
src/sys/uvm/uvm_page_array.h
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/uvm/uvm_page_status.c
cvs rdiff -u -r1.107.2.3 -r1.107.2.4 src/sys/uvm/uvm_pager.c
cvs rdiff -u -r1.97.2.6 -r1.97.2.7 src/sys/uvm/uvm_vnode.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/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.53.2.15 src/sys/miscfs/genfs/genfs_io.c:1.53.2.16
--- src/sys/miscfs/genfs/genfs_io.c:1.53.2.15	Wed Aug  1 21:13:45 2012
+++ src/sys/miscfs/genfs/genfs_io.c	Wed Aug  1 22:34:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.53.2.15 2012/08/01 21:13:45 yamt Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.53.2.16 2012/08/01 22:34:15 yamt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.53.2.15 2012/08/01 21:13:45 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.53.2.16 2012/08/01 22:34:15 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -834,8 +834,7 @@ genfs_do_putpages(struct vnode *vp, off_
 	int error;
 	struct vm_page *pgs[maxpages], *pg;
 	struct uvm_page_array a;
-	bool wasclean, needs_clean, yld;
-	bool async = (origflags  PGO_SYNCIO) == 0;
+	bool wasclean, needs_clean;
 	bool pagedaemon = curlwp == uvm.pagedaemon_lwp;
 	struct lwp * const l = curlwp ? curlwp : lwp0;
 	int flags;
@@ -844,6 +843,8 @@ genfs_do_putpages(struct vnode *vp, off_
 	bool has_trans;
 	bool tryclean;		/* try to pull off from the syncer's list */
 	bool onworklst;
+	const bool integrity_sync =
+	(origflags  (PGO_LAZY|PGO_SYNCIO)) == PGO_SYNCIO;
 	const bool dirtyonly = (origflags  (PGO_DEACTIVATE|PGO_FREE)) == 0;
 
 	UVMHIST_FUNC(genfs_putpages); UVMHIST_CALLED(ubchist);
@@ -941,45 +942,59 @@ retry:
 	for (;;) {
 		bool protected;
 
+		/*
+		 * if we are asked to sync for integrity, we should wait on
+		 * pages being written back by another threads as well.
+		 */
+
 		pg = uvm_page_array_fill_and_peek(a, uobj, nextoff, 0,
-		dirtyonly ? UVM_PAGE_ARRAY_FILL_DIRTYONLY : 0);
+		dirtyonly ? (UVM_PAGE_ARRAY_FILL_DIRTY |
+		(integrity_sync ? UVM_PAGE_ARRAY_FILL_WRITEBACK : 0)) : 0);
 		if (pg == NULL) {
 			break;
 		}
 
-		/*
-		 * if the current page is not interesting, move on to the next.
-		 */
-
 		KASSERT(pg-uobject == uobj);
 		KASSERT((pg-flags  (PG_RELEASED|PG_PAGEOUT)) == 0 ||
 		(pg-flags  (PG_BUSY)) != 0);
 		KASSERT(pg-offset = startoff);
 		KASSERT(pg-offset = nextoff);
 		KASSERT(!dirtyonly ||
-		uvm_pagegetdirty(pg) != UVM_PAGE_STATUS_CLEAN);
+		uvm_pagegetdirty(pg) != UVM_PAGE_STATUS_CLEAN ||
+		radix_tree_get_tag(uobj-uo_pages,
+			pg-offset  PAGE_SHIFT, UVM_PAGE_WRITEBACK_TAG));
 		if (pg-offset = endoff) {
 			break;
 		}
-		if (pg-flags  (PG_RELEASED|PG_PAGEOUT)) {
-			KASSERT((pg-flags  PG_BUSY) != 0);
-			wasclean = false;
-			nextoff = pg-offset + PAGE_SIZE;
-			uvm_page_array_advance(a);
+
+		/*
+		 * a preempt point.
+		 */
+
+		if ((l-l_cpu-ci_schedstate.spc_flags  SPCF_SHOULDYIELD)
+		!= 0) {
+			nextoff = pg-offset; /* visit this page again */
+			mutex_exit(slock);
+			preempt();
+			/*
+			 * as we dropped the object lock, our cached pages can
+			 * be stale.
+			 */
+			uvm_page_array_clear(a);
+			mutex_enter(slock);
 			continue;
 		}
 
 		/*
-		 * if the current page needs to be cleaned and it's busy,
-		 * wait for it to become unbusy.
+		 * if the current page is busy, wait for it to become unbusy.
 		 */
 
-		yld = (l-l_cpu-ci_schedstate.spc_flags 
-		SPCF_SHOULDYIELD)  !pagedaemon;
-		if (pg-flags  PG_BUSY || yld) {
+		if ((pg-flags  PG_BUSY) != 0) {
 			UVMHIST_LOG(ubchist, busy %p, pg,0,0,0);
-			if (flags  PGO_BUSYFAIL  pg-flags  PG_BUSY) {
-UVMHIST_LOG(ubchist, busyfail %p, pg, 0,0,0);
+			if ((pg-flags  (PG_RELEASED|PG_PAGEOUT)) != 0
+			 (flags  PGO_BUSYFAIL) != 0) {
+UVMHIST_LOG(ubchist, busyfail %p, pg,
+0,0,0);
 error = EDEADLK;
 if (busypg != NULL)
 	*busypg = pg;
@@ -992,15 +1007,19 @@ retry:
  */
 break;
 			}
-			nextoff = pg-offset; /* visit this page again */
-			if ((pg-flags  PG_BUSY) != 0) {
-pg-flags |= PG_WANTED;
-UVM_UNLOCK_AND_WAIT(pg, slock, 

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

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 22:46:07 UTC 2012

Modified Files:
src/sys/arch/arm/include: frame.h
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Move fill to between spsr and r0 so that the registers will be dword aligned.
Adjust PUSH/PULL macros accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/frame.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/include/arm32/frame.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/arm/include/frame.h
diff -u src/sys/arch/arm/include/frame.h:1.14 src/sys/arch/arm/include/frame.h:1.15
--- src/sys/arch/arm/include/frame.h:1.14	Tue Jul 31 07:23:16 2012
+++ src/sys/arch/arm/include/frame.h	Wed Aug  1 22:46:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.14 2012/07/31 07:23:16 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.15 2012/08/01 22:46:07 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -52,6 +52,7 @@
 
 typedef struct trapframe {
 	register_t tf_spsr; /* Zero on arm26 */
+	register_t tf_fill; /* fill here so r0 will dword aligned */
 	register_t tf_r0;
 	register_t tf_r1;
 	register_t tf_r2;
@@ -67,7 +68,6 @@ typedef struct trapframe {
 	register_t tf_r12;
 	register_t tf_usr_sp;
 	register_t tf_usr_lr;
-	register_t tf_fill;
 	register_t tf_svc_sp; /* Not used on arm26 */
 	register_t tf_svc_lr; /* Not used on arm26 */
 	register_t tf_pc;

Index: src/sys/arch/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.28 src/sys/arch/arm/include/arm32/frame.h:1.29
--- src/sys/arch/arm/include/arm32/frame.h:1.28	Wed Aug  1 05:40:20 2012
+++ src/sys/arch/arm/include/arm32/frame.h	Wed Aug  1 22:46:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.28 2012/08/01 05:40:20 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.29 2012/08/01 22:46:07 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -56,6 +56,7 @@
 
 typedef struct irqframe {
 	unsigned int if_spsr;
+	unsigned int if_fill;	/* fill here so r0 will dword aligned */
 	unsigned int if_r0;
 	unsigned int if_r1;
 	unsigned int if_r2;
@@ -71,7 +72,6 @@ typedef struct irqframe {
 	unsigned int if_r12;
 	unsigned int if_usr_sp;
 	unsigned int if_usr_lr;
-	unsigned int if_fill;
 	unsigned int if_svc_sp;
 	unsigned int if_svc_lr;
 	unsigned int if_pc;
@@ -324,11 +324,11 @@ LOCK_CAS_DEBUG_LOCALS
 
 #define PUSHFRAME			   \
 	str	lr, [sp, #-4]!;		/* Push the return address */	   \
-	sub	sp, sp, #(4*18);	/* Adjust the stack pointer */	   \
+	sub	sp, sp, #(4*17);	/* Adjust the stack pointer */	   \
 	PUSHUSERREGS;			/* Push the user mode registers */ \
 	mov r0, r0; /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Get the SPSR */		   \
-	str	r0, [sp, #-4]!		/* Push the SPSR on the stack */
+	str	r0, [sp, #-8]!		/* Push the SPSR on the stack */
 
 /*
  * PULLFRAME - macro to pull a trap frame from the stack in the current mode
@@ -336,11 +336,11 @@ LOCK_CAS_DEBUG_LOCALS
  */
 
 #define PULLFRAME			   \
-	ldr r0, [sp], #0x0004;  /* Pop the SPSR from stack */	   \
+	ldr r0, [sp], #0x0008;  /* Pop the SPSR from stack */	   \
 	msr spsr_all, r0;		   \
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov r0, r0; /* NOP for previous instruction */ \
-	add	sp, sp, #(4*18);	/* Adjust the stack pointer */	   \
+	add	sp, sp, #(4*17);	/* Adjust the stack pointer */	   \
  	ldr	lr, [sp], #0x0004	/* Pop the return address */
 
 /*
@@ -374,14 +374,14 @@ LOCK_CAS_DEBUG_LOCALS
 	bic	r2, sp, #7;		/* Align new SVC sp */		   \
 	str	r0, [r2, #-4]!;		/* Push return address */	   \
 	stmdb	r2!, {sp, lr};		/* Push SVC sp, lr */		   \
-	sub	sp, r2, #4;		/* Keep stack aligned */	   \
+	mov	sp, r2;			/* Keep stack aligned */	   \
 	msr spsr_all, r3;		/* Restore correct spsr */	   \
 	ldmdb	r1, {r0-r3};		/* Restore 4 regs from xxx mode */ \
 	sub	sp, sp, #(4*15);	/* Adjust the stack pointer */	   \
 	PUSHUSERREGS;			/* Push the user mode registers */ \
 	mov r0, r0; /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Get the SPSR */		   \
-	str	r0, [sp, #-4]!		/* Push the SPSR onto the stack */
+	str	r0, [sp, #-8]!		/* Push the SPSR onto the stack */
 
 /*
  * PULLFRAMEFROMSVCANDEXIT - macro to pull a trap frame from the stack
@@ -391,11 +391,11 @@ LOCK_CAS_DEBUG_LOCALS
  */
 
 #define PULLFRAMEFROMSVCANDEXIT		   \
-	ldr r0, [sp], #0x0004;	/* Pop the SPSR from stack */	   \
+	ldr r0, [sp], #0x0008;	/* Pop the SPSR from stack */	   \
 	msr spsr_all, r0;		/* restore SPSR */		   \
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov r0, r0;	  		/* NOP for previous instruction */ \
-	add	sp, sp, #(4*16);	/* Adjust the stack pointer */	   \
+	add	sp, sp, #(4*15);	/* Adjust the stack pointer */	   \
 	ldmia	sp, {sp, lr, pc}^	/* Restore lr and exit */
 

CVS commit: src/doc

2012-08-01 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Aug  1 23:39:12 UTC 2012

Modified Files:
src/doc: CHANGES

Log Message:
Mention BPF JIT.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1728 src/doc/CHANGES:1.1729
--- src/doc/CHANGES:1.1728	Mon Jul 30 19:50:51 2012
+++ src/doc/CHANGES	Wed Aug  1 23:39:12 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1728 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1729 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -95,3 +95,5 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	kernel: safepri is dead; replaced by macro IPL_SAFEPRI. [matt 20120727]
 	kernel: Add malo(4), a driver for Marvell Libertas IEEE 802.11b/g
 		wireless network devices, ported from OpenBSD. [degroote 20120730]
+	kernel: Add BPF JIT compiler, currently supporting amd64 and i386.
+		[rmind 20120802]



CVS commit: src/sys/dev/pci

2012-08-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Aug  2 00:17:45 UTC 2012

Modified Files:
src/sys/dev/pci: files.pci machfb.c

Log Message:
add support for anti-aliased fonts


To generate a diff of this commit:
cvs rdiff -u -r1.359 -r1.360 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/pci/machfb.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/files.pci
diff -u src/sys/dev/pci/files.pci:1.359 src/sys/dev/pci/files.pci:1.360
--- src/sys/dev/pci/files.pci:1.359	Mon Jul 30 18:57:19 2012
+++ src/sys/dev/pci/files.pci	Thu Aug  2 00:17:44 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.359 2012/07/30 18:57:19 degroote Exp $
+#	$NetBSD: files.pci,v 1.360 2012/08/02 00:17:44 macallan Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -830,7 +830,7 @@ file	dev/pci/joy_pci.c		joy_pci
 
 # ATI Mach64 framebuffer console driver
 defflag	opt_machfb.h	MACHFB_DEBUG
-device	machfb: wsemuldisplaydev, rasops8, fb, vcons, videomode, edid, drm
+device	machfb: wsemuldisplaydev, rasops8, fb, vcons, videomode, edid, drm, glyphcache
 attach	machfb at pci
 file	dev/pci/machfb.c		machfb
 

Index: src/sys/dev/pci/machfb.c
diff -u src/sys/dev/pci/machfb.c:1.78 src/sys/dev/pci/machfb.c:1.79
--- src/sys/dev/pci/machfb.c:1.78	Thu Jun 14 00:56:37 2012
+++ src/sys/dev/pci/machfb.c	Thu Aug  2 00:17:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machfb.c,v 1.78 2012/06/14 00:56:37 macallan Exp $	*/
+/*	$NetBSD: machfb.c,v 1.79 2012/08/02 00:17:44 macallan Exp $	*/
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 __KERNEL_RCSID(0, 
-	$NetBSD: machfb.c,v 1.78 2012/06/14 00:56:37 macallan Exp $);
+	$NetBSD: machfb.c,v 1.79 2012/08/02 00:17:44 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -68,6 +68,7 @@ __KERNEL_RCSID(0, 
 #include dev/pci/wsdisplay_pci.h
 
 #include dev/wscons/wsdisplay_vconsvar.h
+#include dev/wscons/wsdisplay_glyphcachevar.h
 
 #include opt_wsemul.h
 #include opt_machfb.h
@@ -153,6 +154,7 @@ struct mach64_softc {
 	int sc_dacw, sc_blanked, sc_console;
 	struct vcons_data vd;
 	struct wsdisplay_accessops sc_accessops;
+	glyphcache sc_gc;
 };
 
 struct mach64_crtcregs {
@@ -272,7 +274,8 @@ static void	mach64_cursor(void *, int, i
 #if 0
 static int	mach64_mapchar(void *, int, u_int *);
 #endif
-static void	mach64_putchar(void *, int, int, u_int, long);
+static void	mach64_putchar_mono(void *, int, int, u_int, long);
+static void	mach64_putchar_aa8(void *, int, int, u_int, long);
 static void	mach64_copycols(void *, int, int, int, int);
 static void	mach64_erasecols(void *, int, int, int, long);
 static void	mach64_copyrows(void *, int, int, int);
@@ -283,8 +286,7 @@ static int	mach64_putcmap(struct mach64_
 static int	mach64_getcmap(struct mach64_softc *, struct wsdisplay_cmap *);
 static int	mach64_putpalreg(struct mach64_softc *, uint8_t, uint8_t,
  uint8_t, uint8_t);
-static void	mach64_bitblt(struct mach64_softc *, int, int, int, int, int,
-			  int, int, int) ;
+static void	mach64_bitblt(void *, int, int, int, int, int, int, int);
 static void	mach64_rectfill(struct mach64_softc *, int, int, int, int, int);
 static void	mach64_setup_mono(struct mach64_softc *, int, int, int, int,
   uint32_t, uint32_t);
@@ -428,6 +430,14 @@ regw(struct mach64_softc *sc, uint32_t i
 }
 
 static inline void
+regws(struct mach64_softc *sc, uint32_t index, uint32_t data)
+{
+	bus_space_write_stream_4(sc-sc_regt, sc-sc_regh, index, data);
+	bus_space_barrier(sc-sc_regt, sc-sc_regh, index, 4, 
+	BUS_SPACE_BARRIER_WRITE);
+}
+
+static inline void
 regwb(struct mach64_softc *sc, uint32_t index, uint8_t data)
 {
 	bus_space_write_1(sc-sc_regt, sc-sc_regh, index, data);
@@ -748,17 +758,28 @@ mach64_attach(device_t parent, device_t 
 	vcons_init(sc-vd, sc, mach64_defaultscreen, sc-sc_accessops);
 	sc-vd.init_screen = mach64_init_screen;
 
+	sc-sc_gc.gc_bitblt = mach64_bitblt;
+	sc-sc_gc.gc_blitcookie = sc;
+	sc-sc_gc.gc_rop = MIX_SRC;
+
+	ri = mach64_console_screen.scr_ri;
 	if (sc-sc_console) {
 
 		vcons_init_screen(sc-vd, mach64_console_screen, 1,
 		defattr);
 		mach64_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
 
-		ri = mach64_console_screen.scr_ri;
 		mach64_defaultscreen.textops = ri-ri_ops;
 		mach64_defaultscreen.capabilities = ri-ri_caps;
 		mach64_defaultscreen.nrows = ri-ri_rows;
 		mach64_defaultscreen.ncols = ri-ri_cols;
+		glyphcache_init(sc-sc_gc, sc-sc_my_mode-vdisplay + 5,
+			(sc-memsize / sc-sc_my_mode-hdisplay) -
+			sc-sc_my_mode-vdisplay - 5,
+			sc-sc_my_mode-hdisplay,
+			ri-ri_font-fontwidth,
+			ri-ri_font-fontheight,
+			defattr);
 
 		wsdisplay_cnattach(mach64_defaultscreen, ri, 0, 0, defattr);	
 	} else {
@@ -772,7 +793,16 @@ mach64_attach(device_t parent, device_t 
 			

CVS commit: src/sys/modules/bpf

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug  2 00:22:32 UTC 2012

Modified Files:
src/sys/modules/bpf: Makefile

Log Message:
Add missing paren.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/bpf/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/bpf/Makefile
diff -u src/sys/modules/bpf/Makefile:1.2 src/sys/modules/bpf/Makefile:1.3
--- src/sys/modules/bpf/Makefile:1.2	Wed Aug  1 23:24:29 2012
+++ src/sys/modules/bpf/Makefile	Thu Aug  2 00:22:32 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2012/08/01 23:24:29 rmind Exp $
+#	$NetBSD: Makefile,v 1.3 2012/08/02 00:22:32 matt Exp $
 #
 
 .include ../Makefile.inc
@@ -15,7 +15,7 @@ SRCS=	bpf.c bpf_filter.c
 .PATH:	${S}/arch/${MACHINE_CPU}/${MACHINE_CPU}
 
 .if (exists(${S}/arch/${MACHINE}/${MACHINE}/bpf_jit_machdep.c)) || \
-(exists(${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}/bpf_jit_machdep.c) || \
+(exists(${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}/bpf_jit_machdep.c)) || \
 (exists(${S}/arch/${MACHINE_CPU}/${MACHINE_CPU}/bpf_jit_machdep.c))
 SRCS+=		bpf_jit.c
 SRCS+=		bpf_jit_machdep.c



CVS commit: src/sys/net

2012-08-01 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Aug  2 00:40:51 UTC 2012

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

Log Message:
Build fix for some ports.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/net/bpf.c

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

Modified files:

Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.169 src/sys/net/bpf.c:1.170
--- src/sys/net/bpf.c:1.169	Wed Aug  1 23:24:29 2012
+++ src/sys/net/bpf.c	Thu Aug  2 00:40:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.169 2012/08/01 23:24:29 rmind Exp $	*/
+/*	$NetBSD: bpf.c,v 1.170 2012/08/02 00:40:51 rmind Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.169 2012/08/01 23:24:29 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.170 2012/08/02 00:40:51 rmind Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_bpf.h
@@ -124,8 +124,8 @@ static kmutex_t bpf_mtx;
 static bool bpf_jit_enable __read_mostly = false;
 
 #ifndef BPF_JIT
-#define	bpf_jit(x, y)	NULL
-#define	bpf_destroy_jit_filter(x)
+#define	bpf_jit(x, y)			NULL
+#define	bpf_destroy_jit_filter(x)	(void)x
 #endif
 
 /*



CVS commit: src/sys/net

2012-08-01 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Aug  2 01:05:06 UTC 2012

Modified Files:
src/sys/net: bpf_jit.h

Log Message:
Add struct bpf_insn tag.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/bpf_jit.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/net/bpf_jit.h
diff -u src/sys/net/bpf_jit.h:1.1 src/sys/net/bpf_jit.h:1.2
--- src/sys/net/bpf_jit.h:1.1	Wed Aug  1 23:24:29 2012
+++ src/sys/net/bpf_jit.h	Thu Aug  2 01:05:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf_jit.h,v 1.1 2012/08/01 23:24:29 rmind Exp $	*/
+/*	$NetBSD: bpf_jit.h,v 1.2 2012/08/02 01:05:05 rmind Exp $	*/
 
 /*-
  * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy)
@@ -36,6 +36,8 @@
 #ifndef _NET_BPF_JIT_H_
 #define _NET_BPF_JIT_H_
 
+struct bpf_insn;
+
 /*
  * Prototype of a filtering function created by the JIT compiler.
  *



CVS commit: src

2012-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug  2 01:16:37 UTC 2012

Modified Files:
src/distrib/sets/lists/comp: mi
src/sys/net: Makefile

Log Message:
Export net/bpf_jit.h and add to the set lists.


To generate a diff of this commit:
cvs rdiff -u -r1.1772 -r1.1773 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.29 -r1.30 src/sys/net/Makefile

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.1772 src/distrib/sets/lists/comp/mi:1.1773
--- src/distrib/sets/lists/comp/mi:1.1772	Mon Jul 30 16:43:36 2012
+++ src/distrib/sets/lists/comp/mi	Thu Aug  2 01:16:36 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1772 2012/07/30 16:43:36 njoly Exp $
+#	$NetBSD: mi,v 1.1773 2012/08/02 01:16:36 matt Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1805,6 +1805,7 @@
 ./usr/include/net/agr/if_agrioctl.h		comp-c-include
 ./usr/include/net/bpf.hcomp-c-include
 ./usr/include/net/bpfdesc.h			comp-c-include
+./usr/include/net/bpf_jit.h			comp-c-include
 ./usr/include/net/dlt.hcomp-c-include
 ./usr/include/net/ethertypes.h			comp-c-include
 ./usr/include/net/if.hcomp-c-include

Index: src/sys/net/Makefile
diff -u src/sys/net/Makefile:1.29 src/sys/net/Makefile:1.30
--- src/sys/net/Makefile:1.29	Sun Aug 22 18:56:22 2010
+++ src/sys/net/Makefile	Thu Aug  2 01:16:36 2012
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.29 2010/08/22 18:56:22 rmind Exp $
+#	$NetBSD: Makefile,v 1.30 2012/08/02 01:16:36 matt Exp $
 
 INCSDIR= /usr/include/net
 
-INCS=	bpf.h bpfdesc.h dlt.h ethertypes.h if.h if_arc.h if_arp.h \
+INCS=	bpf.h bpfdesc.h bpf_jit.h dlt.h ethertypes.h if.h if_arc.h if_arp.h \
 	if_atm.h if_bridgevar.h if_dl.h if_ether.h if_etherip.h if_fddi.h if_gif.h \
 	if_gre.h if_hippi.h if_ieee1394.h if_llc.h if_media.h if_mpls.h \
 	if_pflog.h if_ppp.h if_pppoe.h if_sppp.h if_srt.h if_stf.h \