CVS commit: src/sys/arch/sparc/sparc

2011-01-26 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 27 06:24:59 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc: cpu.c cpuvar.h genassym.cf intr.c locore.s
timer_sun4m.c

Log Message:
consolidate the interrupt evcnt(9) into a full set of per-IPL per-CPU
soft/hard counters.  beyond the extra info, it seems to help avoid some
of these counters getting corrupted due to unlocked multiple accesses.

adjust the xcallintr() from xcall() hack so that we don't count these
events as interrupts.  align the existing evcnt name to count this.


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sparc/sparc/genassym.cf
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/sparc/sparc/intr.c
cvs rdiff -u -r1.259 -r1.260 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sparc/sparc/timer_sun4m.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.226 src/sys/arch/sparc/sparc/cpu.c:1.227
--- src/sys/arch/sparc/sparc/cpu.c:1.226	Thu Jan 27 05:31:13 2011
+++ src/sys/arch/sparc/sparc/cpu.c	Thu Jan 27 06:24:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.226 2011/01/27 05:31:13 mrg Exp $ */
+/*	$NetBSD: cpu.c,v 1.227 2011/01/27 06:24:59 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.226 2011/01/27 05:31:13 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.227 2011/01/27 06:24:59 mrg Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -296,9 +296,48 @@
 }
 #endif /* SUN4D */
 
+static const char * const hard_intr_names[] = {
+	"spur hard",
+	"lev1 hard",
+	"lev2 hard",
+	"lev3 hard",
+	"lev4 hard",
+	"lev5 hard",
+	"lev6 hard",
+	"lev7 hard",
+	"lev8 hard",
+	"lev9 hard",
+	"clock hard",
+	"lev11 hard",
+	"lev12 hard",
+	"lev13 hard",
+	"prof hard",
+	"nmi hard",
+};
+
+static const char * const soft_intr_names[] = {
+	"spur soft",
+	"lev1 soft",
+	"lev2 soft",
+	"lev3 soft",
+	"lev4 soft",
+	"lev5 soft",
+	"lev6 soft",
+	"lev7 soft",
+	"lev8 soft",
+	"lev9 soft",
+	"lev10 soft",
+	"lev11 soft",
+	"lev12 soft",
+	"xcall std",
+	"xcall fast",
+	"nmi soft",
+};
+
 static void
 cpu_init_evcnt(struct cpu_info *cpi)
 {
+	int i;
 
 	/*
 	 * Setup the per-cpu counters.
@@ -313,7 +352,17 @@
 	evcnt_attach_dynamic(&cpi->ci_xpmsg_mutex_fail, EVCNT_TYPE_MISC,
 			 NULL, cpu_name(cpi), "IPI mutex_trylock fail");
 	evcnt_attach_dynamic(&cpi->ci_xpmsg_mutex_fail_call, EVCNT_TYPE_MISC,
-			 NULL, cpu_name(cpi), "IPI mutex_trylock fail with call");
+			 NULL, cpu_name(cpi), "IPI mutex_trylock fail/call");
+
+	/*
+	 * These are the per-cpu per-IPL hard & soft interrupt counters.
+	 */
+	for (i = 0; i < 16; i++) {
+		evcnt_attach_dynamic(&cpi->ci_intrcnt[i], EVCNT_TYPE_INTR,
+ NULL, cpu_name(cpi), hard_intr_names[i]);
+		evcnt_attach_dynamic(&cpi->ci_sintrcnt[i], EVCNT_TYPE_INTR,
+ NULL, cpu_name(cpi), soft_intr_names[i]);
+	}
 }
 
 /*
@@ -621,7 +670,7 @@
 			cpuinfo.ci_xpmsg_mutex_fail.ev_count++;
 			if (cpuinfo.msg.tag) {
 cpuinfo.ci_xpmsg_mutex_fail_call.ev_count++;
-xcallintr(NULL);
+xcallintr(xcallintr);
 			}
 		}
 	}

Index: src/sys/arch/sparc/sparc/cpuvar.h
diff -u src/sys/arch/sparc/sparc/cpuvar.h:1.85 src/sys/arch/sparc/sparc/cpuvar.h:1.86
--- src/sys/arch/sparc/sparc/cpuvar.h:1.85	Thu Jan 27 05:31:14 2011
+++ src/sys/arch/sparc/sparc/cpuvar.h	Thu Jan 27 06:24:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.85 2011/01/27 05:31:14 mrg Exp $ */
+/*	$NetBSD: cpuvar.h,v 1.86 2011/01/27 06:24:59 mrg Exp $ */
 
 /*
  *  Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -336,12 +336,12 @@
 	 */
 	vaddr_t	ci_free_sva1, ci_free_eva1, ci_free_sva2, ci_free_eva2;
 
-	struct evcnt ci_lev10;
-	struct evcnt ci_lev14;
 	struct evcnt ci_savefpstate;
 	struct evcnt ci_savefpstate_null;
 	struct evcnt ci_xpmsg_mutex_fail;
 	struct evcnt ci_xpmsg_mutex_fail_call;
+	struct evcnt ci_intrcnt[16];
+	struct evcnt ci_sintrcnt[16];
 };
 
 /*

Index: src/sys/arch/sparc/sparc/genassym.cf
diff -u src/sys/arch/sparc/sparc/genassym.cf:1.63 src/sys/arch/sparc/sparc/genassym.cf:1.64
--- src/sys/arch/sparc/sparc/genassym.cf:1.63	Fri Jan 14 02:06:31 2011
+++ src/sys/arch/sparc/sparc/genassym.cf	Thu Jan 27 06:24:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.63 2011/01/14 02:06:31 rmind Exp $
+#	$NetBSD: genassym.cf,v 1.64 2011/01/27 06:24:59 mrg Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -128,6 +128,9 @@
 define	CPUINFO_NINTR	offsetof(struct cpu_info, ci_data.cpu_nintr)
 define	CPUINFO_NSOFT	offsetof(struct cpu_info, ci_data.cpu_nsoft)
 define	CPUINFO_NFAULT	offsetof(struct cpu_info, ci_data.cpu_nfault)
+define	CPUINFO_LEV14	offsetof(struct cpu_info, ci_sintrcnt[14])

CVS commit: src/sys/arch/sparc/sparc

2011-01-26 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 27 05:31:14 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc: cpu.c cpuvar.h intr.c

Log Message:
to quote a new comment:

 * There's a deadlock potential between multiple CPUs trying
 * to xcall() at the same time, and the thread that loses the
 * race to get xpmsg_lock is at an IPL above the incoming IPI
 * IPL level, so it sits around waiting to take the lock while
 * the other CPU is waiting for this CPU to handle the IPI and
 * mark it as completed.
 *
 * If we fail to get the mutex, and we're at high enough IPL,
 * call xcallintr() if there is a valid msg.tag.

this seems to fix the xcall() failed to ping cpus problem.
idea from martin, tested by macallan and myself.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/sparc/sparc/intr.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.225 src/sys/arch/sparc/sparc/cpu.c:1.226
--- src/sys/arch/sparc/sparc/cpu.c:1.225	Sat Jan 22 12:13:25 2011
+++ src/sys/arch/sparc/sparc/cpu.c	Thu Jan 27 05:31:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.225 2011/01/22 12:13:25 mrg Exp $ */
+/*	$NetBSD: cpu.c,v 1.226 2011/01/27 05:31:13 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.225 2011/01/22 12:13:25 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.226 2011/01/27 05:31:13 mrg Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -301,14 +301,19 @@
 {
 
 	/*
-	 * Setup the per-cpu savefpstate counters.  The "savefp null"
-	 * counter should go away when the NULL struct fpstate * bug
-	 * is fixed.
+	 * Setup the per-cpu counters.
+	 *
+	 * The "savefp null" counter should go away when the NULL
+	 * struct fpstate * bug is fixed.
 	 */
 	evcnt_attach_dynamic(&cpi->ci_savefpstate, EVCNT_TYPE_MISC,
 			 NULL, cpu_name(cpi), "savefp ipi");
 	evcnt_attach_dynamic(&cpi->ci_savefpstate_null, EVCNT_TYPE_MISC,
 			 NULL, cpu_name(cpi), "savefp null ipi");
+	evcnt_attach_dynamic(&cpi->ci_xpmsg_mutex_fail, EVCNT_TYPE_MISC,
+			 NULL, cpu_name(cpi), "IPI mutex_trylock fail");
+	evcnt_attach_dynamic(&cpi->ci_xpmsg_mutex_fail_call, EVCNT_TYPE_MISC,
+			 NULL, cpu_name(cpi), "IPI mutex_trylock fail with call");
 }
 
 /*
@@ -581,6 +586,7 @@
 	struct cpu_info *cpi;
 	int n, i, done, callself, mybit;
 	volatile struct xpmsg_func *p;
+	u_int pil;
 	int fasttrap;
 	int is_noop = func == (xcall_func_t)sparc_noop;
 
@@ -592,7 +598,34 @@
 	cpuset &= cpu_ready_mask;
 
 	/* prevent interrupts that grab the kernel lock */
+#if 0
 	mutex_spin_enter(&xpmsg_mutex);
+#else
+	/*
+	 * There's a deadlock potential between multiple CPUs trying
+	 * to xcall() at the same time, and the thread that loses the
+	 * race to get xpmsg_lock is at an IPL above the incoming IPI
+	 * IPL level, so it sits around waiting to take the lock while
+	 * the other CPU is waiting for this CPU to handle the IPI and
+	 * mark it as completed.
+	 *
+	 * If we fail to get the mutex, and we're at high enough IPL,
+	 * call xcallintr() if there is a valid msg.tag.
+	 */
+	pil = (getpsr() & PSR_PIL) >> 8;
+	
+	if (cold || pil < 13)
+		mutex_spin_enter(&xpmsg_mutex);
+	else {
+		while (mutex_tryenter(&xpmsg_mutex) == 0) {
+			cpuinfo.ci_xpmsg_mutex_fail.ev_count++;
+			if (cpuinfo.msg.tag) {
+cpuinfo.ci_xpmsg_mutex_fail_call.ev_count++;
+xcallintr(NULL);
+			}
+		}
+	}
+#endif
 
 	/*
 	 * Firstly, call each CPU.  We do this so that they might have

Index: src/sys/arch/sparc/sparc/cpuvar.h
diff -u src/sys/arch/sparc/sparc/cpuvar.h:1.84 src/sys/arch/sparc/sparc/cpuvar.h:1.85
--- src/sys/arch/sparc/sparc/cpuvar.h:1.84	Thu Jan 13 05:20:27 2011
+++ src/sys/arch/sparc/sparc/cpuvar.h	Thu Jan 27 05:31:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.84 2011/01/13 05:20:27 mrg Exp $ */
+/*	$NetBSD: cpuvar.h,v 1.85 2011/01/27 05:31:14 mrg Exp $ */
 
 /*
  *  Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -340,6 +340,8 @@
 	struct evcnt ci_lev14;
 	struct evcnt ci_savefpstate;
 	struct evcnt ci_savefpstate_null;
+	struct evcnt ci_xpmsg_mutex_fail;
+	struct evcnt ci_xpmsg_mutex_fail_call;
 };
 
 /*
@@ -453,6 +455,8 @@
 typedef void (*xcall_func_t)(int, int, int);
 typedef void (*xcall_trap_t)(int, int, int);
 void xcall(xcall_func_t, xcall_trap_t, int, int, int, u_int);
+/* from intr.c */
+void xcallintr(void *);
 /* Shorthand */
 #define XCALL0(f,cpuset)		\
 	xcall((xcall_func_t)f, NULL, 0, 0, 0, cpuset)

Index: src/sys/arch/sparc/sparc/intr.c
diff -u src/sys/arch/sparc/sparc/intr.c:1.109 src/sys/arch/sparc/sparc/intr.c:1.110
--- src/sys/arch/sparc/sparc/intr.c:1.109	Sat Jan 22 10:37:22 2011
+++ src/sys/arch/sparc/sparc/intr.c	Thu Jan 27 

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

2011-01-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Jan 27 04:54:40 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: Makefile

Log Message:
remove an excess echo line accidentally creeped in.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/stand/altboot/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/arch/sandpoint/stand/altboot/Makefile
diff -u src/sys/arch/sandpoint/stand/altboot/Makefile:1.4 src/sys/arch/sandpoint/stand/altboot/Makefile:1.5
--- src/sys/arch/sandpoint/stand/altboot/Makefile:1.4	Thu Jan 27 04:32:49 2011
+++ src/sys/arch/sandpoint/stand/altboot/Makefile	Thu Jan 27 04:54:40 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2011/01/27 04:32:49 nisimura Exp $
+#	$NetBSD: Makefile,v 1.5 2011/01/27 04:54:40 nisimura Exp $
 
 S=		${.CURDIR}/../../../..
 
@@ -54,7 +54,6 @@
 LIBSA=		${SALIB}
 
 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
-	echo ${OBJS}
 	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
 	${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version sandpoint
 	${CC} -c vers.c



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

2011-01-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Jan 27 04:32:49 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: Makefile

Log Message:
arrange vers.c generation to honour MKREPRO for global build control.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/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/arch/sandpoint/stand/altboot/Makefile
diff -u src/sys/arch/sandpoint/stand/altboot/Makefile:1.3 src/sys/arch/sandpoint/stand/altboot/Makefile:1.4
--- src/sys/arch/sandpoint/stand/altboot/Makefile:1.3	Wed Jan 26 13:36:49 2011
+++ src/sys/arch/sandpoint/stand/altboot/Makefile	Thu Jan 27 04:32:49 2011
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2011/01/26 13:36:49 nisimura Exp $
+#	$NetBSD: Makefile,v 1.4 2011/01/27 04:32:49 nisimura Exp $
 
 S=		${.CURDIR}/../../../..
 
 PROG=		altboot
+NOMAN=		# defined
 SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c nif.c \
 		fxp.c tlp.c rge.c skg.c dsk.c pciide.c siisata.c printf.c
 CLEANFILES+=	vers.c vers.o ${PROG} ${PROG}.bin
@@ -14,20 +15,20 @@
 CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
 DBG=		-Os
 
+.include 
+
 # XXX SHOULD NOT NEED TO DEFINE THESE!
 LIBCRT0=
 LIBC=
 LIBCRTBEGIN=
 LIBCRTEND=
 
-NOMAN=		# defined
 STRIPFLAG=
 BINMODE=	444
 
 RELOC=		100
 ENTRY=		_start
 
-
 .if !make(obj) && !make(clean) && !make(cleandir)
 .BEGIN:
 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
@@ -53,7 +54,9 @@
 LIBSA=		${SALIB}
 
 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
-	${HOST_SH} ${S}/conf/newvers_stand.sh -KD ${.CURDIR}/version sandpoint
+	echo ${OBJS}
+	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
+	${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version sandpoint
 	${CC} -c vers.c
 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
 	${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}



CVS commit: src/sys/arch/sh3/sh3

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 27 01:01:56 UTC 2011

Modified Files:
src/sys/arch/sh3/sh3: exception.c

Log Message:
general_exception: when printing current mode in the panic message,
test "usermode" directly instead of testing for EXP_USER bit.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sh3/sh3/exception.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/sh3/sh3/exception.c
diff -u src/sys/arch/sh3/sh3/exception.c:1.59 src/sys/arch/sh3/sh3/exception.c:1.60
--- src/sys/arch/sh3/sh3/exception.c:1.59	Fri Jan 14 02:06:30 2011
+++ src/sys/arch/sh3/sh3/exception.c	Thu Jan 27 01:01:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exception.c,v 1.59 2011/01/14 02:06:30 rmind Exp $	*/
+/*	$NetBSD: exception.c,v 1.60 2011/01/27 01:01:55 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exception.c,v 1.59 2011/01/14 02:06:30 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exception.c,v 1.60 2011/01/27 01:01:55 uwe Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -257,7 +257,7 @@
 		printf("fatal %s", exp_type[expevt >> 5]);
 	else
 		printf("EXPEVT 0x%03x", expevt);
-	printf(" in %s mode\n", expevt & EXP_USER ? "user" : "kernel");
+	printf(" in %s mode\n", usermode ? "user" : "kernel");
 	printf(" spc %x ssr %x \n", tf->tf_spc, tf->tf_ssr);
 
 	panic("general_exception");



CVS commit: src/sys/arch/sh3/sh3

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 27 00:19:27 UTC 2011

Modified Files:
src/sys/arch/sh3/sh3: core_machdep.c

Log Message:
Include only headers that are actually used.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sh3/sh3/core_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/sh3/sh3/core_machdep.c
diff -u src/sys/arch/sh3/sh3/core_machdep.c:1.3 src/sys/arch/sh3/sh3/core_machdep.c:1.4
--- src/sys/arch/sh3/sh3/core_machdep.c:1.3	Sat Nov 21 17:40:28 2009
+++ src/sys/arch/sh3/sh3/core_machdep.c	Thu Jan 27 00:19:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_machdep.c,v 1.3 2009/11/21 17:40:28 rmind Exp $	*/
+/*	$NetBSD: core_machdep.c,v 1.4 2011/01/27 00:19:27 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -81,30 +81,17 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.3 2009/11/21 17:40:28 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.4 2011/01/27 00:19:27 uwe Exp $");
 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 
-#include 
-
-#include 
-
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
+
 
 /*
  * Dump the machine specific segment at the start of a core dump.



CVS commit: src/sys/arch/sh3/sh3

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 26 23:29:17 UTC 2011

Modified Files:
src/sys/arch/sh3/sh3: sh3_machdep.c

Log Message:
Clear MDP_SSTEP in setregs().


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/sh3/sh3/sh3_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/sh3/sh3/sh3_machdep.c
diff -u src/sys/arch/sh3/sh3/sh3_machdep.c:1.88 src/sys/arch/sh3/sh3/sh3_machdep.c:1.89
--- src/sys/arch/sh3/sh3/sh3_machdep.c:1.88	Fri Jan 14 02:06:31 2011
+++ src/sys/arch/sh3/sh3/sh3_machdep.c	Wed Jan 26 23:29:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sh3_machdep.c,v 1.88 2011/01/14 02:06:31 rmind Exp $	*/
+/*	$NetBSD: sh3_machdep.c,v 1.89 2011/01/26 23:29:16 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.88 2011/01/14 02:06:31 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.89 2011/01/26 23:29:16 uwe Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_memsize.h"
@@ -511,7 +511,7 @@
 {
 	struct trapframe *tf;
 
-	l->l_md.md_flags &= ~MDP_USEDFPU;
+	l->l_md.md_flags &= ~(MDP_USEDFPU | MDP_SSTEP);
 
 	tf = l->l_md.md_regs;
 



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

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 26 23:26:37 UTC 2011

Modified Files:
src/sys/arch/sh3/include: proc.h

Log Message:
Add MDP_SSTEP flag.  Not used yet.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sh3/include/proc.h

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

Modified files:

Index: src/sys/arch/sh3/include/proc.h
diff -u src/sys/arch/sh3/include/proc.h:1.15 src/sys/arch/sh3/include/proc.h:1.16
--- src/sys/arch/sh3/include/proc.h:1.15	Fri Jan 14 02:06:30 2011
+++ src/sys/arch/sh3/include/proc.h	Wed Jan 26 23:26:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.15 2011/01/14 02:06:30 rmind Exp $	*/
+/*	$NetBSD: proc.h,v 1.16 2011/01/26 23:26:37 uwe Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -58,6 +58,7 @@
 
 /* md_flags */
 #define	MDP_USEDFPU	0x0001	/* has used the FPU */
+#define	MDP_SSTEP	0x0002	/* single-stepped with PT_STEP */
 
 struct lwp;
 



CVS commit: src/lib/libc/net

2011-01-26 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Jan 26 22:00:45 UTC 2011

Modified Files:
src/lib/libc/net: nsdispatch.3

Log Message:
Add section 3 for getpwuid_r xref.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/net/nsdispatch.3

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

Modified files:

Index: src/lib/libc/net/nsdispatch.3
diff -u src/lib/libc/net/nsdispatch.3:1.29 src/lib/libc/net/nsdispatch.3:1.30
--- src/lib/libc/net/nsdispatch.3:1.29	Wed Oct 14 17:24:03 2009
+++ src/lib/libc/net/nsdispatch.3	Wed Jan 26 22:00:45 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: nsdispatch.3,v 1.29 2009/10/14 17:24:03 joerg Exp $
+.\"	$NetBSD: nsdispatch.3,v 1.30 2011/01/26 22:00:45 njoly Exp $
 .\"
 .\" Copyright (c) 1997, 1998, 1999, 2004, 2005, 2008
 .\" The NetBSD Foundation, Inc.
@@ -858,7 +858,7 @@
 .Xr errno 2
 on failure.
 .Pp
-.Xr getpwuid_r
+.Xr getpwuid_r 3
 returns 0
 if
 .Fn nsdispatch



CVS commit: src/sys/arch/amd64/amd64

2011-01-26 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Jan 26 21:44:32 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: netbsd32_machdep.c

Log Message:
Do mask the upper 16 bits, when sanity checking fs/gs register values.
Fix my own PR/43842.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/amd64/amd64/netbsd32_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/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.68 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.69
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.68	Wed Nov 17 18:22:17 2010
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Wed Jan 26 21:44:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.68 2010/11/17 18:22:17 dholland Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.69 2011/01/26 21:44:31 njoly Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.68 2010/11/17 18:22:17 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.69 2011/01/26 21:44:31 njoly Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -952,6 +952,12 @@
  * and rely on catching invalid user contexts on exit from the kernel.
  * These functions perform the needed checks.
  */
+
+#define	VALID_FS32(s) \
+(((s) & 0x) == GSEL(GUFS_SEL, SEL_UPL))
+#define	VALID_GS32(s) \
+(((s) & 0x) == GSEL(GUGS_SEL, SEL_UPL))
+
 static int
 check_sigcontext32(struct lwp *l, const struct netbsd32_sigcontext *scp)
 {
@@ -965,10 +971,10 @@
 	!VALID_USER_CSEL32(scp->sc_cs))
 		return EINVAL;
 	if (scp->sc_fs != 0 && !VALID_USER_DSEL32(scp->sc_fs) &&
-	!(scp->sc_fs == GSEL(GUFS_SEL, SEL_UPL) && pcb->pcb_fs != 0))
+	!(VALID_FS32(scp->sc_fs) && pcb->pcb_fs != 0))
 		return EINVAL;
 	if (scp->sc_gs != 0 && !VALID_USER_DSEL32(scp->sc_gs) &&
-	!(scp->sc_gs == GSEL(GUGS_SEL, SEL_UPL) && pcb->pcb_gs != 0))
+	!(VALID_GS32(scp->sc_gs) && pcb->pcb_gs != 0))
 		return EINVAL;
 	if (scp->sc_es != 0 && !VALID_USER_DSEL32(scp->sc_es))
 		return EINVAL;
@@ -994,10 +1000,10 @@
 	!VALID_USER_CSEL32(gr[_REG32_CS]))
 		return EINVAL;
 	if (gr[_REG32_FS] != 0 && !VALID_USER_DSEL32(gr[_REG32_FS]) &&
-	!(gr[_REG32_FS] == GSEL(GUFS_SEL, SEL_UPL) && pcb->pcb_fs != 0))
+	!(VALID_FS32(gr[_REG32_FS]) && pcb->pcb_fs != 0))
 		return EINVAL;
 	if (gr[_REG32_GS] != 0 && !VALID_USER_DSEL32(gr[_REG32_GS]) &&
-	!(gr[_REG32_GS] == GSEL(GUGS_SEL, SEL_UPL) && pcb->pcb_gs != 0))
+	!(VALID_GS32(gr[_REG32_GS]) && pcb->pcb_gs != 0))
 		return EINVAL;
 	if (gr[_REG32_ES] != 0 && !VALID_USER_DSEL32(gr[_REG32_ES]))
 		return EINVAL;



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

2011-01-26 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Jan 26 21:35:14 UTC 2011

Modified Files:
src/sys/arch/powerpc/stand/mkbootimage: Makefile mkbootimage.c

Log Message:
Fix tools build on !NetBSD. Fix printfs to use correct types.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/stand/mkbootimage/Makefile
cvs rdiff -u -r1.13 -r1.14 \
src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.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/stand/mkbootimage/Makefile
diff -u src/sys/arch/powerpc/stand/mkbootimage/Makefile:1.3 src/sys/arch/powerpc/stand/mkbootimage/Makefile:1.4
--- src/sys/arch/powerpc/stand/mkbootimage/Makefile:1.3	Sat Nov  7 17:56:14 2009
+++ src/sys/arch/powerpc/stand/mkbootimage/Makefile	Wed Jan 26 21:35:14 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2009/11/07 17:56:14 skrll Exp $
+#	$NetBSD: Makefile,v 1.4 2011/01/26 21:35:14 joerg Exp $
 
 BINDIR=	/usr/mdec
 PROG=	mkbootimage
@@ -15,7 +15,7 @@
 
 CPPFLAGS= -I${LIBSA} -I${.CURDIR} -I${BFDTOP}/include
 CPPFLAGS+=	-DATTRIBUTE_PACKED=
-DPADD=	${LIBZ}
-LDADD=	-lz
+DPADD+=	${LIBZ}
+LDADD+=	-lz
 
 .include 

Index: src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
diff -u src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c:1.13 src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c:1.14
--- src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c:1.13	Sat Oct 16 05:14:14 2010
+++ src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c	Wed Jan 26 21:35:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkbootimage.c,v 1.13 2010/10/16 05:14:14 kiyohara Exp $	*/
+/*	$NetBSD: mkbootimage.c,v 1.14 2011/01/26 21:35:14 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -527,19 +527,19 @@
 	write(rs6000_fd, (void *)rs6000_magic, RS6000_MAGICSIZE);
 	lenpos = lseek(rs6000_fd, 0, SEEK_CUR);
 	if (verboseflag)
-		printf("wrote magic at pos 0x%x\n", lenpos);
+		printf("wrote magic at pos 0x%lx\n", (unsigned long)lenpos);
 	tmp = sa_htobe32(0);
 	write(rs6000_fd, (void *)&tmp, KERNLENSIZE);
 
 	/* write in the compressed kernel */
 	kstart = lseek(rs6000_fd, 0, SEEK_CUR);
 	if (verboseflag)
-		printf("kernel start at pos 0x%x\n", kstart);
+		printf("kernel start at pos 0x%lx\n", (unsigned long)kstart);
 	kgzlen = gzwrite(gzf, kern_img, kern_stat.st_size);
 	gzclose(gzf);
 	kend = lseek(rs6000_fd, 0, SEEK_CUR);
 	if (verboseflag)
-		printf("kernel end at pos 0x%x\n", kend);
+		printf("kernel end at pos 0x%lx\n", (unsigned long)kend);
 
 	/* jump back to the length position now that we know the length */
 	lseek(rs6000_fd, lenpos, SEEK_SET);



CVS commit: src/sys/arch/i386/stand/lib

2011-01-26 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jan 26 20:59:49 UTC 2011

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Attempt to correct two regressions.
 - avoid Virtualbox's BIOS panicing on 64-bit LBAs
 - MBR-without-disklabel was ignored


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/i386/stand/lib/biosdisk.c

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

Modified files:

Index: src/sys/arch/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.36 src/sys/arch/i386/stand/lib/biosdisk.c:1.37
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.36	Wed Jan  5 22:06:59 2011
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Wed Jan 26 20:59:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.36 2011/01/05 22:06:59 jakllsch Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.37 2011/01/26 20:59:48 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -310,6 +310,10 @@
 	daddr_t gptsector[2];
 	int i, error;
 
+	if (d->ll.type != BIOSDISK_TYPE_HD)
+		/* No GPT on floppy and CD */
+		return -1;
+
 	gptsector[0] = GPT_HDR_BLKNO;
 	if (set_geometry(&d->ll, &ed) == 0 && d->ll.flags & BIOSDISK_INT13EXT) {
 		gptsector[1] = ed.totsec - 1;
@@ -345,11 +349,28 @@
 #endif	/* !NO_GPT */
 
 #ifndef NO_DISKLABEL
+static void
+ingest_label(struct biosdisk *d, struct disklabel *lp)
+{
+	int part;
+
+	memset(d->part, 0, sizeof(d->part));
+
+	for (part = 0; part < lp->d_npartitions; part++) {
+		if (lp->d_partitions[part].p_size == 0)
+			continue;
+		if (lp->d_partitions[part].p_fstype == FS_UNUSED)
+			continue;
+		d->part[part].fstype = lp->d_partitions[part].p_fstype;
+		d->part[part].offset = lp->d_partitions[part].p_offset;
+		d->part[part].size = lp->d_partitions[part].p_size;
+	}
+}
+	
 static int
 check_label(struct biosdisk *d, daddr_t sector)
 {
 	struct disklabel *lp;
-	int part;
 
 	/* find partition in NetBSD disklabel */
 	if (readsects(&d->ll, sector + LABELSECTOR, 1, d->buf, 0)) {
@@ -366,18 +387,7 @@
 		return -1;
 	}
 
-	memset(d->part, 0, sizeof(d->part));
-	for (part = 0; part < lp->d_npartitions; part++) {
-		if (lp->d_partitions[part].p_size == 0)
-			continue;
-		if (lp->d_partitions[part].p_fstype == FS_UNUSED)
-			continue;
-		d->part[part].fstype = lp->d_partitions[part].p_fstype;
-		d->part[part].offset = lp->d_partitions[part].p_offset;
-		d->part[part].size = lp->d_partitions[part].p_size;
-	}
-	
-	d->boff = sector;
+	ingest_label(d, lp);
 
 #ifdef _STANDALONE
 	bi_disk.labelsector = d->boff + LABELSECTOR;
@@ -499,7 +509,7 @@
 	 */
 	/* XXX fill it to make checksum match kernel one */
 	dflt_lbl.d_checksum = dkcksum(&dflt_lbl);
-	memcpy(d->buf, &dflt_lbl, sizeof(dflt_lbl));
+	ingest_label(d, &dflt_lbl);
 	return 0;
 }
 #endif /* NO_DISKLABEL */



CVS commit: src/sys/opencrypto

2011-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 26 19:52:16 UTC 2011

Modified Files:
src/sys/opencrypto: crypto.c

Log Message:
PR/44470: Dr. Wolfgang Stukenbrock: opencrypto kernel implementation may pass
outdated argument to worker


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/opencrypto/crypto.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/opencrypto/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.36 src/sys/opencrypto/crypto.c:1.37
--- src/sys/opencrypto/crypto.c:1.36	Wed Aug 11 07:49:09 2010
+++ src/sys/opencrypto/crypto.c	Wed Jan 26 14:52:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.36 2010/08/11 11:49:09 pgoyette Exp $ */
+/*	$NetBSD: crypto.c,v 1.37 2011/01/26 19:52:16 christos Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.36 2010/08/11 11:49:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.37 2011/01/26 19:52:16 christos Exp $");
 
 #include 
 #include 
@@ -76,7 +76,7 @@
 /* below are kludges for residual code wrtitten to FreeBSD interfaces */
   #define SWI_CRYPTO 17
   #define register_swi(lvl, fn)  \
-  softint_establish(SOFTINT_NET, (void (*)(void*))fn, NULL)
+  softint_establish(SOFTINT_NET, (void (*)(void *))fn, NULL)
   #define unregister_swi(lvl, fn)  softint_disestablish(softintr_cookie)
   #define setsoftcrypto(x) softint_schedule(x)
 
@@ -89,7 +89,7 @@
  */
 static	struct cryptocap *crypto_drivers;
 static	int crypto_drivers_num;
-static	void* softintr_cookie;
+static	void *softintr_cookie;
 
 /*
  * There are two queues for crypto requests; one for symmetric (e.g.
@@ -266,7 +266,7 @@
 
 	softintr_cookie = register_swi(SWI_CRYPTO, cryptointr);
 	error = kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
-	(void (*)(void*))cryptoret, NULL, &cryptothread, "cryptoret");
+	(void (*)(void *))cryptoret, NULL, &cryptothread, "cryptoret");
 	if (error) {
 		printf("crypto_init: cannot start cryptoret thread; error %d",
 			error);
@@ -488,7 +488,7 @@
  */
 int
 crypto_kregister(u_int32_t driverid, int kalg, u_int32_t flags,
-int (*kprocess)(void*, struct cryptkop *, int),
+int (*kprocess)(void *, struct cryptkop *, int),
 void *karg)
 {
 	struct cryptocap *cap;
@@ -534,9 +534,9 @@
 int
 crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen,
 u_int32_t flags,
-int (*newses)(void*, u_int32_t*, struct cryptoini*),
-int (*freeses)(void*, u_int64_t),
-int (*process)(void*, struct cryptop *, int),
+int (*newses)(void *, u_int32_t*, struct cryptoini*),
+int (*freeses)(void *, u_int64_t),
+int (*process)(void *, struct cryptop *, int),
 void *arg)
 {
 	struct cryptocap *cap;
@@ -839,6 +839,7 @@
 		return EINVAL;
 	}
 
+	mutex_spin_enter(&crypto_mtx);
 	for (hid = 0; hid < crypto_drivers_num; hid++) {
 		if ((crypto_drivers[hid].cc_flags & CRYPTOCAP_F_SOFTWARE) &&
 		crypto_devallowsoft == 0)
@@ -851,10 +852,16 @@
 		break;
 	}
 	if (hid < crypto_drivers_num) {
+		int (*process)(void *, struct cryptkop *, int);
+		void *arg;
+
+		process = crypto_drivers[hid].cc_kprocess;
+		arg = crypto_drivers[hid].cc_karg;
+		mutex_spin_exit(&crypto_mtx);
 		krp->krp_hid = hid;
-		error = crypto_drivers[hid].cc_kprocess(
-crypto_drivers[hid].cc_karg, krp, hint);
+		error = (*process)(arg, krp, hint);
 	} else {
+		mutex_spin_exit(&crypto_mtx);
 		error = ENODEV;
 	}
 
@@ -896,7 +903,6 @@
 crypto_invoke(struct cryptop *crp, int hint)
 {
 	u_int32_t hid;
-	int (*process)(void*, struct cryptop *, int);
 
 #ifdef CRYPTO_TIMING
 	if (crypto_timing)
@@ -915,17 +921,24 @@
 	}
 
 	hid = CRYPTO_SESID2HID(crp->crp_sid);
+
+	mutex_spin_enter(&crypto_mtx);
 	if (hid < crypto_drivers_num) {
-		mutex_spin_enter(&crypto_mtx);
+		int (*process)(void *, struct cryptop *, int);
+		void *arg;
+
 		if (crypto_drivers[hid].cc_flags & CRYPTOCAP_F_CLEANUP)
 			crypto_freesession(crp->crp_sid);
 		process = crypto_drivers[hid].cc_process;
+		arg = crypto_drivers[hid].cc_arg;
 		mutex_spin_exit(&crypto_mtx);
-	} else {
-		process = NULL;
-	}
 
-	if (process == NULL) {
+		/*
+		 * Invoke the driver to process the request.
+		 */
+		DPRINTF(("calling process for %p\n", crp));
+		return (*process)(arg, crp, hint);
+	} else {
 		struct cryptodesc *crd;
 		u_int64_t nid = 0;
 
@@ -933,7 +946,6 @@
 		 * Driver has unregistered; migrate the session and return
 		 * an error to the caller so they'll resubmit the op.
 		 */
-		mutex_spin_enter(&crypto_mtx);
 		for (crd = crp->crp_desc; crd->crd_next; crd = crd->crd_next)
 			crd->CRD_INI.cri_next = &(crd->crd_next->CRD_INI);
 
@@ -945,12 +957,6 @@
 
 		crypto_done(crp);
 		return 0;
-	} else {
-		/*
-		 * Invoke the driver to process the request.
-		 */
-		DPRINTF(("calling pro

CVS commit: src/sys/kern

2011-01-26 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Jan 26 19:15:13 UTC 2011

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

Log Message:
fix and cleanup for tvtohz():
-assume (KASSERT) that the timeval given is normalized, and remove
 some partial fixup which I don't see what it is good for
 (I'm ready to back that out if someone tells a reason)
-catch overflows due to conversion of time_t (from tv_sec) to
 integer -- this function doesn't do 64-bit arithmetics (which makes
 sense because relative times which don't fit into 32 bits can be
 considered nonsense here), and before a huge tv_sec could lead to
 a zero hz result, violating the caller's assumptions (in particular
 trigger a diagnostic panic in abstimeout2timo())


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/subr_time.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_time.c
diff -u src/sys/kern/subr_time.c:1.7 src/sys/kern/subr_time.c:1.8
--- src/sys/kern/subr_time.c:1.7	Mon Apr 26 16:26:11 2010
+++ src/sys/kern/subr_time.c	Wed Jan 26 19:15:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_time.c,v 1.7 2010/04/26 16:26:11 rmind Exp $	*/
+/*	$NetBSD: subr_time.c,v 1.8 2011/01/26 19:15:13 drochner Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.7 2010/04/26 16:26:11 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.8 2011/01/26 19:15:13 drochner Exp $");
 
 #include 
 #include 
@@ -89,12 +89,15 @@
 	sec = tv->tv_sec;
 	usec = tv->tv_usec;
 
-	if (usec < 0) {
-		sec--;
-		usec += 100;
-	}
+	KASSERT(usec >= 0 && usec < 100);
+
+	/* catch overflows in conversion time_t->int */
+	if (tv->tv_sec > INT_MAX)
+		return INT_MAX;
+	if (tv->tv_sec < 0)
+		return 0;
 
-	if (sec < 0 || (sec == 0 && usec <= 0)) {
+	if (sec < 0 || (sec == 0 && usec == 0)) {
 		/*
 		 * Would expire now or in the past.  Return 0 ticks.
 		 * This is different from the legacy tvhzto() interface,



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

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 26 19:07:43 UTC 2011

Modified Files:
src/sys/arch/sh3/include: psl.h

Log Message:
Add sh4 PSL_FD - FPU disable bit.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/include/psl.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/sh3/include/psl.h
diff -u src/sys/arch/sh3/include/psl.h:1.10 src/sys/arch/sh3/include/psl.h:1.11
--- src/sys/arch/sh3/include/psl.h:1.10	Fri Jan  4 20:10:12 2008
+++ src/sys/arch/sh3/include/psl.h	Wed Jan 26 19:07:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.10 2008/01/04 20:10:12 uwe Exp $	*/
+/*	$NetBSD: psl.h,v 1.11 2011/01/26 19:07:42 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -45,6 +45,7 @@
 #define	PSL_IMASK	0x00f0	/* Interrupt Mask bit */
 #define	PSL_QBIT	0x0100	/* Q bit */
 #define	PSL_MBIT	0x0200	/* M bit */
+#define	PSL_FD		0x8000	/* FPU Disable bit */
 #define	PSL_BL		0x1000	/* Exception Block bit */
 #define	PSL_RB		0x2000	/* Register Bank bit */
 #define	PSL_MD		0x4000	/* Processor Mode bit */



CVS commit: src/lib/libpthread

2011-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 26 18:48:58 UTC 2011

Modified Files:
src/lib/libpthread: pthread_cancelstub.c

Log Message:
make the code more re-usable


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libpthread/pthread_cancelstub.c

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

Modified files:

Index: src/lib/libpthread/pthread_cancelstub.c
diff -u src/lib/libpthread/pthread_cancelstub.c:1.30 src/lib/libpthread/pthread_cancelstub.c:1.31
--- src/lib/libpthread/pthread_cancelstub.c:1.30	Wed Jan 26 13:11:35 2011
+++ src/lib/libpthread/pthread_cancelstub.c	Wed Jan 26 13:48:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_cancelstub.c,v 1.30 2011/01/26 18:11:35 christos Exp $	*/
+/*	$NetBSD: pthread_cancelstub.c,v 1.31 2011/01/26 18:48:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_cancelstub.c,v 1.30 2011/01/26 18:11:35 christos Exp $");
+__RCSID("$NetBSD: pthread_cancelstub.c,v 1.31 2011/01/26 18:48:57 christos Exp $");
 
 #ifndef lint
 
@@ -474,15 +474,15 @@
 #define STUB(fun) __ssp_weak_name(fun)
 ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
 ssize_t
-_cancelstub_readlink(const char * __restrict path, char * __restrict buf,
+STUB(readlink)(const char * __restrict path, char * __restrict buf,
 size_t bufsiz)
 {
 	return _sys_readlink(path, buf, bufsiz);
 }
 
-char * _sys_getcwd(char *, size_t);
+char *_sys_getcwd(char *, size_t);
 char *
-_cancelstub_getcwd(char *buf, size_t size)
+STUB(getcwd)(char *buf, size_t size)
 {
 	return _sys_getcwd(buf, size);
 }



CVS commit: src/sys/dev

2011-01-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jan 26 18:48:51 UTC 2011

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
Add a driver for the RDC Semiconductor RDC R6040 10/100 Ethernet controller,
as found in the vortex86 SoCs (http://www.vortex86dx.com).
Ported from freebsd.
Not added to amd64's GENERIC because this CPU is 32bit only.

thanks to DM&P Electronics, Inc for providing documentation and sample
devices for this work.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/dev/DEVNAMES

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/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.267 src/sys/dev/DEVNAMES:1.268
--- src/sys/dev/DEVNAMES:1.267	Wed Jan 26 11:29:04 2011
+++ src/sys/dev/DEVNAMES	Wed Jan 26 18:48:51 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.267 2011/01/26 11:29:04 nisimura Exp $
+#	$NetBSD: DEVNAMES,v 1.268 2011/01/26 18:48:51 bouyer Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -1433,6 +1433,7 @@
 vsbus			vax
 vsms			alpha
 vt			i386
+vte			MI
 vtpbc			algor
 vz			vax
 wbsio			MI



CVS commit: src/lib/librumphijack

2011-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 26 18:48:32 UTC 2011

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

Log Message:
make SSP friendly


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

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.20 src/lib/librumphijack/hijack.c:1.21
--- src/lib/librumphijack/hijack.c:1.20	Tue Jan 25 12:37:00 2011
+++ src/lib/librumphijack/hijack.c	Wed Jan 26 13:48:32 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.20 2011/01/25 17:37:00 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.21 2011/01/26 18:48:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,9 @@
  */
 
 #include 
-__RCSID("$NetBSD: hijack.c,v 1.20 2011/01/25 17:37:00 pooka Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.21 2011/01/26 18:48:32 christos Exp $");
+
+#define __ssp_weak_name(fun) _hijack_ ## fun
 
 #include 
 #include 
@@ -853,7 +855,27 @@
 	(int, int),			\
 	(fd, how))
 
-FDCALL(ssize_t, read, DUALCALL_READ,	 \
+#if _FORTIFY_SOURCE > 0
+#define STUB(fun) __ssp_weak_name(fun)
+ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
+ssize_t
+STUB(readlink)(const char * __restrict path, char * __restrict buf,
+size_t bufsiz)
+{
+	return _sys_readlink(path, buf, bufsiz);
+}
+
+char *_sys_getcwd(char *, size_t);
+char *
+STUB(getcwd)(char *buf, size_t size)
+{
+	return _sys_getcwd(buf, size);
+}
+#else
+#define STUB(fun) fun
+#endif
+
+FDCALL(ssize_t, STUB(read), DUALCALL_READ,\
 	(int fd, void *buf, size_t buflen),\
 	(int, void *, size_t),		\
 	(fd, buf, buflen))



CVS commit: src/sys/arch/sh3/sh3

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 26 18:43:30 UTC 2011

Modified Files:
src/sys/arch/sh3/sh3: db_interface.c

Log Message:
BRCR and BAMRA have different format in sh3 and sh4, so there's no
point in using SH_() wrapper to refer to them in code that is already
model-specific.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sh3/sh3/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/sh3/sh3/db_interface.c
diff -u src/sys/arch/sh3/sh3/db_interface.c:1.59 src/sys/arch/sh3/sh3/db_interface.c:1.60
--- src/sys/arch/sh3/sh3/db_interface.c:1.59	Sat Nov 21 17:40:28 2009
+++ src/sys/arch/sh3/sh3/db_interface.c	Wed Jan 26 18:43:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.59 2009/11/21 17:40:28 rmind Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.60 2011/01/26 18:43:30 uwe Exp $	*/
 
 /*-
  * Copyright (C) 2002 UCHIYAMA Yasushi.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.59 2009/11/21 17:40:28 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.60 2011/01/26 18:43:30 uwe Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -232,10 +232,10 @@
 #ifdef SH3
 	if (CPU_IS_SH3) {
 		/* A: compare all address bits */
-		_reg_write_4(SH_(BAMRA), 0x);
+		_reg_write_4(SH3_BAMRA, 0x);
 
 		/* A: break after execution, ignore ASID */
-		_reg_write_4(SH_(BRCR), (UBC_CTL_A_AFTER_INSN
+		_reg_write_4(SH3_BRCR, (UBC_CTL_A_AFTER_INSN
 	 | SH3_UBC_CTL_A_MASK_ASID));
 
 		/* will be written to BBRA before RTE */
@@ -247,10 +247,10 @@
 #ifdef SH4
 	if (CPU_IS_SH4) {
 		/* A: compare all address bits, ignore ASID */
-		_reg_write_1(SH_(BAMRA), SH4_UBC_MASK_NONE | SH4_UBC_MASK_ASID);
+		_reg_write_1(SH4_BAMRA, SH4_UBC_MASK_NONE | SH4_UBC_MASK_ASID);
 
 		/* A: break after execution */
-		_reg_write_2(SH_(BRCR), UBC_CTL_A_AFTER_INSN);
+		_reg_write_2(SH4_BRCR, UBC_CTL_A_AFTER_INSN);
 
 		/* will be written to BBRA before RTE */
 		regs->tf_ubc = UBC_CYCLE_INSN | UBC_CYCLE_READ;



CVS commit: src/sys/dev/mii

2011-01-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jan 26 18:39:25 UTC 2011

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen: Add RDC Semiconductor R6040 10/100 integrated PHY


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/mii/miidevs_data.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/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.101 src/sys/dev/mii/miidevs.h:1.102
--- src/sys/dev/mii/miidevs.h:1.101	Sat Dec 11 18:09:33 2010
+++ src/sys/dev/mii/miidevs.h	Wed Jan 26 18:39:25 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.101 2010/12/11 18:09:33 matt Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.102 2011/01/26 18:39:25 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.98 2010/12/11 18:09:13 matt Exp
+ *	NetBSD: miidevs,v 1.99 2011/01/26 18:39:04 bouyer Exp
  */
 
 /*-
@@ -75,6 +75,7 @@
 #define	MII_OUI_MYSON	0x00c0b4	/* Myson Technology */
 #define	MII_OUI_NATSEMI	0x080017	/* National Semiconductor */
 #define	MII_OUI_PMCSIERRA	0x00e004	/* PMC-Sierra */
+#define	MII_OUI_RDC	0x00d02d	/* RDC Semiconductor */
 #define	MII_OUI_REALTEK	0x00e04c	/* RealTek */
 #define	MII_OUI_QUALSEMI	0x006051	/* Quality Semiconductor */
 #define	MII_OUI_SEEQ	0x00a07d	/* Seeq */
@@ -374,6 +375,9 @@
 #define	MII_MODEL_xxQUALSEMI_QS6612	0x
 #define	MII_STR_xxQUALSEMI_QS6612	"QS6612 10/100 media interface"
 
+/* RDC Semiconductor PHYs */
+#define	MII_MODEL_RDC_R6040	0x0003
+#define	MII_STR_RDC_R6040	"R6040 10/100 media interface"
 /* RealTek PHYs */
 #define	MII_MODEL_yyREALTEK_RTL8201L	0x0020
 #define	MII_STR_yyREALTEK_RTL8201L	"RTL8201L 10/100 media interface"

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.89 src/sys/dev/mii/miidevs_data.h:1.90
--- src/sys/dev/mii/miidevs_data.h:1.89	Sat Dec 11 18:09:33 2010
+++ src/sys/dev/mii/miidevs_data.h	Wed Jan 26 18:39:25 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.89 2010/12/11 18:09:33 matt Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.90 2011/01/26 18:39:25 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.98 2010/12/11 18:09:13 matt Exp
+ *	NetBSD: miidevs,v 1.99 2011/01/26 18:39:04 bouyer Exp
  */
 
 /*-
@@ -145,6 +145,7 @@
  { MII_OUI_xxPMCSIERRA2, MII_MODEL_xxPMCSIERRA2_PM8353, MII_STR_xxPMCSIERRA2_PM8353 },
  { MII_OUI_PMCSIERRA, MII_MODEL_PMCSIERRA_PM8354, MII_STR_PMCSIERRA_PM8354 },
  { MII_OUI_xxQUALSEMI, MII_MODEL_xxQUALSEMI_QS6612, MII_STR_xxQUALSEMI_QS6612 },
+ { MII_OUI_RDC, MII_MODEL_RDC_R6040, MII_STR_RDC_R6040 },
  { MII_OUI_yyREALTEK, MII_MODEL_yyREALTEK_RTL8201L, MII_STR_yyREALTEK_RTL8201L },
  { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8169S, MII_STR_xxREALTEK_RTL8169S },
  { MII_OUI_REALTEK, MII_MODEL_REALTEK_RTL8169S, MII_STR_REALTEK_RTL8169S },



CVS commit: src/sys/dev/mii

2011-01-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jan 26 18:39:04 UTC 2011

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
Add RDC Semiconductor R6040 10/100 integrated PHY


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/mii/miidevs

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/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.98 src/sys/dev/mii/miidevs:1.99
--- src/sys/dev/mii/miidevs:1.98	Sat Dec 11 18:09:13 2010
+++ src/sys/dev/mii/miidevs	Wed Jan 26 18:39:04 2011
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.98 2010/12/11 18:09:13 matt Exp $
+$NetBSD: miidevs,v 1.99 2011/01/26 18:39:04 bouyer Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -68,6 +68,7 @@
 oui MYSON			0x00c0b4	Myson Technology
 oui NATSEMI			0x080017	National Semiconductor
 oui PMCSIERRA			0x00e004	PMC-Sierra
+oui RDC0x00d02d	RDC Semiconductor
 oui REALTEK			0x00e04c	RealTek
 oui QUALSEMI			0x006051	Quality Semiconductor
 oui SEEQ			0x00a07d	Seeq
@@ -259,6 +260,8 @@
 /* Quality Semiconductor PHYs */
 model xxQUALSEMI QS6612		0x QS6612 10/100 media interface
 
+/* RDC Semiconductor PHYs */
+model RDC R6040			0x0003 R6040 10/100 media interface
 /* RealTek PHYs */
 model yyREALTEK RTL8201L	0x0020 RTL8201L 10/100 media interface
 model xxREALTEK RTL8169S	0x0011 RTL8169S/8110S/8211 1000BASE-T media interface



CVS commit: src/sys/dev/pci

2011-01-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jan 26 18:37:06 UTC 2011

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add RDC Semiconductor R6040 10/100 Ethernet


To generate a diff of this commit:
cvs rdiff -u -r1.1055 -r1.1056 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1055 src/sys/dev/pci/pcidevs:1.1056
--- src/sys/dev/pci/pcidevs:1.1055	Tue Jan 11 00:13:03 2011
+++ src/sys/dev/pci/pcidevs	Wed Jan 26 18:37:06 2011
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1055 2011/01/11 00:13:03 dyoung Exp $
+$NetBSD: pcidevs,v 1.1056 2011/01/26 18:37:06 bouyer Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -613,6 +613,7 @@
 vendor I4		0x17cf	I4
 vendor ARECA		0x17d3	Areca
 vendor S2IO		0x17d5	S2io Technologies
+vendor RDC		0x17F3  RDC Semiconductor
 vendor LINKSYS2		0x17fe	Linksys
 vendor RALINK		0x1814	Ralink Technologies
 vendor RMI		0x182e	Raza Microelectronics Inc. (NetLogic)
@@ -3878,6 +3879,9 @@
 /* RATOC Systems products */
 product RATOC	REXPCI31	0x0853	REX PCI-31/33 SCSI
 
+/* RDC Semiconductor products */
+product RDC	R6040		0x6040	RDC R6040 10/100 Ethernet
+
 /* Realtek products */
 product REALTEK RT8029		0x8029	8029 Ethernet
 product REALTEK RT8139D		0x8039	8139D 10/100 Ethernet



CVS commit: src/lib/libpthread

2011-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 26 18:11:35 UTC 2011

Modified Files:
src/lib/libpthread: pthread_cancelstub.c

Log Message:
Moving the ssp check inside the source code does not work properly because
the compiler loses information about the size of the object. So instead of
the hacky #define mess we did before, add a way to inject our function between
the user call and the system call.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libpthread/pthread_cancelstub.c

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

Modified files:

Index: src/lib/libpthread/pthread_cancelstub.c
diff -u src/lib/libpthread/pthread_cancelstub.c:1.29 src/lib/libpthread/pthread_cancelstub.c:1.30
--- src/lib/libpthread/pthread_cancelstub.c:1.29	Tue Jan 25 14:13:26 2011
+++ src/lib/libpthread/pthread_cancelstub.c	Wed Jan 26 13:11:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_cancelstub.c,v 1.29 2011/01/25 19:13:26 christos Exp $	*/
+/*	$NetBSD: pthread_cancelstub.c,v 1.30 2011/01/26 18:11:35 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_cancelstub.c,v 1.29 2011/01/25 19:13:26 christos Exp $");
+__RCSID("$NetBSD: pthread_cancelstub.c,v 1.30 2011/01/26 18:11:35 christos Exp $");
 
 #ifndef lint
 
@@ -50,6 +50,8 @@
  */
 #define __LIBC12_SOURCE__
 
+#define __ssp_weak_name(fun)	_cancelstub_ ## fun
+
 #include 
 #include 
 #include 
@@ -59,12 +61,7 @@
 #include 
 #include 
 #include 
-
-#define read _read
 #include 
-#undef read
-ssize_t  read(int, void *, size_t);
-
 
 #include 
 #include 
@@ -473,16 +470,32 @@
 	return retval;
 }
 
+#if _FORTIFY_SOURCE > 0
+#define STUB(fun) __ssp_weak_name(fun)
+ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
 ssize_t
-read(int d, void *buf, size_t nbytes)
+_cancelstub_readlink(const char * __restrict path, char * __restrict buf,
+size_t bufsiz)
 {
-	ssize_t retval;
-	pthread_t self;
+	return _sys_readlink(path, buf, bufsiz);
+}
 
-#ifdef __ssp_check
-	__ssp_check(buf, nbytes, __ssp_bos0);
+char * _sys_getcwd(char *, size_t);
+char *
+_cancelstub_getcwd(char *buf, size_t size)
+{
+	return _sys_getcwd(buf, size);
+}
+#else
+#define STUB(fun) fun
 #endif
 
+ssize_t
+STUB(read)(int d, void *buf, size_t nbytes)
+{
+	ssize_t retval;
+	pthread_t self;
+
 	self = pthread__self();
 	TESTCANCEL(self);
 	retval = _sys_read(d, buf, nbytes);



CVS commit: src/include/ssp

2011-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 26 18:08:00 UTC 2011

Modified Files:
src/include/ssp: ssp.h

Log Message:
provide a way to override the weak name.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/include/ssp/ssp.h

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

Modified files:

Index: src/include/ssp/ssp.h
diff -u src/include/ssp/ssp.h:1.7 src/include/ssp/ssp.h:1.8
--- src/include/ssp/ssp.h:1.7	Tue Jan 25 14:13:44 2011
+++ src/include/ssp/ssp.h	Wed Jan 26 13:08:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssp.h,v 1.7 2011/01/25 19:13:44 christos Exp $	*/
+/*	$NetBSD: ssp.h,v 1.8 2011/01/26 18:08:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -43,11 +43,13 @@
 # endif
 #endif
 
+#ifndef __ssp_weak_name
 #ifdef _NAMESPACE_H_
 #define __ssp_weak_name(fun) _sys ## fun
 #else
 #define __ssp_weak_name(fun) _sys_ ## fun
 #endif
+#endif
 
 #define __ssp_inline static __inline __attribute__((__always_inline__))
 



CVS commit: src/include/ssp

2011-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 26 18:07:44 UTC 2011

Modified Files:
src/include/ssp: unistd.h

Log Message:
fix readlink prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/include/ssp/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/include/ssp/unistd.h
diff -u src/include/ssp/unistd.h:1.5 src/include/ssp/unistd.h:1.6
--- src/include/ssp/unistd.h:1.5	Wed Jan 19 14:21:29 2011
+++ src/include/ssp/unistd.h	Wed Jan 26 13:07:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.5 2011/01/19 19:21:29 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.6 2011/01/26 18:07:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 __ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \
 (__fd, __buf, __len));
 
-__ssp_redirect(int, readlink, (const char *__restrict __path, \
+__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \
 char *__restrict __buf, size_t __len), (__path, __buf, __len));
 
 __ssp_redirect(char *, getcwd, (char *__buf, size_t __len), (__buf, __len));



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

2011-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jan 26 16:53:18 UTC 2011

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

Log Message:
add entries required by sandpoint


To generate a diff of this commit:
cvs rdiff -u -r1.1281 -r1.1282 src/distrib/sets/lists/man/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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1281 src/distrib/sets/lists/man/mi:1.1282
--- src/distrib/sets/lists/man/mi:1.1281	Wed Jan 26 01:18:46 2011
+++ src/distrib/sets/lists/man/mi	Wed Jan 26 16:53:17 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1281 2011/01/26 01:18:46 pooka Exp $
+# $NetBSD: mi,v 1.1282 2011/01/26 16:53:17 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1425,6 +1425,7 @@
 ./usr/share/man/cat4/rtpphy.0			man-obsolete		obsolete
 ./usr/share/man/cat4/rtw.0			man-sys-catman		.cat
 ./usr/share/man/cat4/rum.0			man-sys-catman		.cat
+./usr/share/man/cat4/sandpoint/satmgr.0			man-sys-catman		.cat
 ./usr/share/man/cat4/satalink.0			man-sys-catman		.cat
 ./usr/share/man/cat4/savagedrm.0		man-sys-catman		.cat
 ./usr/share/man/cat4/sdhc.0			man-sys-catman		.cat
@@ -2668,6 +2669,7 @@
 ./usr/share/man/cat8/rwalld.0			man-netutil-catman	.cat
 ./usr/share/man/cat8/rwhod.0			man-netutil-catman	.cat
 ./usr/share/man/cat8/sa.0			man-sysutil-catman	.cat
+./usr/share/man/cat8/sandpoint/altboot.0	man-sysutil-catman	.cat
 ./usr/share/man/cat8/sandpoint/MAKEDEV.0	man-obsolete		obsolete
 ./usr/share/man/cat8/sandpoint/makedev.0	man-obsolete		obsolete
 ./usr/share/man/cat8/savecore.0			man-sysutil-catman	.cat
@@ -4109,6 +4111,7 @@
 ./usr/share/man/html4/rtk.html			man-sys-htmlman		html
 ./usr/share/man/html4/rtw.html			man-sys-htmlman		html
 ./usr/share/man/html4/rum.html			man-sys-htmlman		html
+./usr/share/man/html4/sandpoint/satmgr.html		man-sys-htmlman		html
 ./usr/share/man/html4/satalink.html		man-sys-htmlman		html
 ./usr/share/man/html4/savagedrm.html		man-sys-htmlman		html
 ./usr/share/man/html4/sdhc.html			man-sys-htmlman		html
@@ -5166,6 +5169,7 @@
 ./usr/share/man/html8/rwalld.html		man-netutil-htmlman	html
 ./usr/share/man/html8/rwhod.html		man-netutil-htmlman	html
 ./usr/share/man/html8/sa.html			man-sysutil-htmlman	html
+./usr/share/man/html8/sandpoint/altboot.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/savecore.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/scache.html		man-postfix-htmlman	postfix,html
 ./usr/share/man/html8/scan_ffs.html		man-sysutil-htmlman	html
@@ -6702,6 +6706,7 @@
 ./usr/share/man/man4/rtpphy.4			man-obsolete		obsolete
 ./usr/share/man/man4/rtw.4			man-sys-man		.man
 ./usr/share/man/man4/rum.4			man-sys-man		.man
+./usr/share/man/man4/sandpoint/satmgr.4			man-sys-man		.man
 ./usr/share/man/man4/satalink.4			man-sys-man		.man
 ./usr/share/man/man4/savagedrm.4		man-sys-man		.man
 ./usr/share/man/man4/sdhc.4			man-sys-man		.man
@@ -7945,6 +7950,7 @@
 ./usr/share/man/man8/rwalld.8			man-netutil-man		.man
 ./usr/share/man/man8/rwhod.8			man-netutil-man		.man
 ./usr/share/man/man8/sa.8			man-sysutil-man		.man
+./usr/share/man/man8/sandpoint/altboot.8	man-sysutils-man	.man
 ./usr/share/man/man8/sandpoint/MAKEDEV.8	man-obsolete		obsolete
 ./usr/share/man/man8/sandpoint/makedev.8	man-obsolete		obsolete
 ./usr/share/man/man8/savecore.8			man-sysutil-man		.man



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

2011-01-26 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Jan 26 16:31:00 UTC 2011

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

Log Message:
Fix build of malta/sbmips.


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

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

Modified files:

Index: src/sys/arch/mips/mips/cache.c
diff -u src/sys/arch/mips/mips/cache.c:1.43 src/sys/arch/mips/mips/cache.c:1.44
--- src/sys/arch/mips/mips/cache.c:1.43	Wed Jan 26 01:18:54 2011
+++ src/sys/arch/mips/mips/cache.c	Wed Jan 26 16:31:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.c,v 1.43 2011/01/26 01:18:54 pooka Exp $	*/
+/*	$NetBSD: cache.c,v 1.44 2011/01/26 16:31:00 uebayasi Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.43 2011/01/26 01:18:54 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.44 2011/01/26 16:31:00 uebayasi Exp $");
 
 #include "opt_cputype.h"
 #include "opt_mips_cache.h"
@@ -186,6 +186,7 @@
 static void mips_config_cache_modern(void);
 #endif
 
+#if defined(MIPS1) || defined(MIPS3) || defined(MIPS4)
 /* no-cache definition */
 static void no_cache_op(void);
 static void no_cache_op_range(vaddr_t va, vsize_t size);
@@ -193,6 +194,7 @@
 /* no-cache implementation */
 static void no_cache_op(void) {}
 static void no_cache_op_range(vaddr_t va, vsize_t size) {}
+#endif
 
 /*
  * mips_dcache_compute_align:
@@ -888,6 +890,7 @@
 	mips_dcache_compute_align();
 }
 
+#if defined(MIPS1) || defined(MIPS3) || defined(MIPS4)
 void
 mips_config_cache_emips(void)
 {
@@ -934,6 +937,7 @@
 		panic("mips_config_cache: unsupported eMIPS");
 	}
 }
+#endif
 
 #ifdef MIPS1
 #ifdef ENABLE_MIPS_TX3900



CVS commit: src

2011-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jan 26 15:00:57 UTC 2011

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base

Log Message:
add sandpoint dirs for man chapter 4, they seem to be required now


To generate a diff of this commit:
cvs rdiff -u -r1.917 -r1.918 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.73 -r1.74 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.917 src/distrib/sets/lists/base/mi:1.918
--- src/distrib/sets/lists/base/mi:1.917	Wed Jan 26 01:18:45 2011
+++ src/distrib/sets/lists/base/mi	Wed Jan 26 15:00:57 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.917 2011/01/26 01:18:45 pooka Exp $
+# $NetBSD: mi,v 1.918 2011/01/26 15:00:57 pooka Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -3326,6 +3326,7 @@
 ./usr/share/man/cat4/pmax			base-man-share
 ./usr/share/man/cat4/pmppc			base-obsolete		obsolete
 ./usr/share/man/cat4/prep			base-man-share
+./usr/share/man/cat4/sandpoint			base-man-share
 ./usr/share/man/cat4/sgimips			base-man-share
 ./usr/share/man/cat4/sparc			base-man-share
 ./usr/share/man/cat4/sparc64			base-man-share
@@ -3450,6 +3451,7 @@
 ./usr/share/man/html4/pmax			base-man-share
 ./usr/share/man/html4/pmppc			base-obsolete		obsolete
 ./usr/share/man/html4/prep			base-man-share
+./usr/share/man/html4/sandpoint			base-man-share
 ./usr/share/man/html4/sgimips			base-man-share
 ./usr/share/man/html4/sparc			base-man-share
 ./usr/share/man/html4/sparc64			base-man-share
@@ -3575,6 +3577,7 @@
 ./usr/share/man/man4/pmax			base-man-share
 ./usr/share/man/man4/pmppc			base-obsolete		obsolete
 ./usr/share/man/man4/prep			base-man-share
+./usr/share/man/man4/sandpoint			base-man-share
 ./usr/share/man/man4/sgimips			base-man-share
 ./usr/share/man/man4/sparc			base-man-share
 ./usr/share/man/man4/sparc64			base-man-share

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.73 src/etc/mtree/NetBSD.dist.base:1.74
--- src/etc/mtree/NetBSD.dist.base:1.73	Wed Jan 26 01:18:47 2011
+++ src/etc/mtree/NetBSD.dist.base	Wed Jan 26 15:00:56 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.73 2011/01/26 01:18:47 pooka Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.74 2011/01/26 15:00:56 pooka Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -718,6 +718,7 @@
 ./usr/share/man/cat4/mvme68k
 ./usr/share/man/cat4/pmax
 ./usr/share/man/cat4/prep
+./usr/share/man/cat4/sandpoint
 ./usr/share/man/cat4/sgimips
 ./usr/share/man/cat4/sparc
 ./usr/share/man/cat4/sparc64
@@ -825,6 +826,7 @@
 ./usr/share/man/man4/mvme68k
 ./usr/share/man/man4/pmax
 ./usr/share/man/man4/prep
+./usr/share/man/man4/sandpoint
 ./usr/share/man/man4/sgimips
 ./usr/share/man/man4/sparc
 ./usr/share/man/man4/sparc64
@@ -932,6 +934,7 @@
 ./usr/share/man/html4/mvme68k
 ./usr/share/man/html4/pmax
 ./usr/share/man/html4/prep
+./usr/share/man/html4/sandpoint
 ./usr/share/man/html4/sgimips
 ./usr/share/man/html4/sparc
 ./usr/share/man/html4/sparc64



CVS commit: src/lib/librumpclient

2011-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jan 26 14:42:41 UTC 2011

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

Log Message:
plug fd leak in reconnect code


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/librumpclient/rumpclient.c

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

Modified files:

Index: src/lib/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.18 src/lib/librumpclient/rumpclient.c:1.19
--- src/lib/librumpclient/rumpclient.c:1.18	Mon Jan 24 17:47:51 2011
+++ src/lib/librumpclient/rumpclient.c	Wed Jan 26 14:42:41 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.18 2011/01/24 17:47:51 pooka Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.19 2011/01/26 14:42:41 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -489,6 +489,7 @@
 	if (kq != -1)
 		host_close(kq);
 	kq = -1;
+	s = -1;
 
 	prevreconmsg = 0;
 	reconretries = 0;
@@ -497,6 +498,9 @@
 	if (clispc.spc_fd != -1)
 		host_close(clispc.spc_fd);
 	clispc.spc_fd = -1;
+	if (s != -1)
+		close(s);
+	s = -1;
 
 	/*
 	 * for reconnect, gate everyone out of the receiver code



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

2011-01-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Jan 26 13:36:49 UTC 2011

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

Log Message:
one more twist to complete newvers_stand.sh transition. Include timestamp
in banner.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/main.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/altboot/Makefile
diff -u src/sys/arch/sandpoint/stand/altboot/Makefile:1.2 src/sys/arch/sandpoint/stand/altboot/Makefile:1.3
--- src/sys/arch/sandpoint/stand/altboot/Makefile:1.2	Sun Jan 23 07:41:38 2011
+++ src/sys/arch/sandpoint/stand/altboot/Makefile	Wed Jan 26 13:36:49 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/01/23 07:41:38 nisimura Exp $
+#	$NetBSD: Makefile,v 1.3 2011/01/26 13:36:49 nisimura Exp $
 
 S=		${.CURDIR}/../../../..
 
@@ -53,7 +53,7 @@
 LIBSA=		${SALIB}
 
 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
-	${HOST_SH} ${S}/conf/newvers_stand.sh -K ${.CURDIR}/version "sandpoint"
+	${HOST_SH} ${S}/conf/newvers_stand.sh -KD ${.CURDIR}/version sandpoint
 	${CC} -c vers.c
 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
 	${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}

Index: src/sys/arch/sandpoint/stand/altboot/main.c
diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.3 src/sys/arch/sandpoint/stand/altboot/main.c:1.4
--- src/sys/arch/sandpoint/stand/altboot/main.c:1.3	Wed Jan 26 13:13:25 2011
+++ src/sys/arch/sandpoint/stand/altboot/main.c	Wed Jan 26 13:36:49 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.3 2011/01/26 13:13:25 phx Exp $ */
+/* $NetBSD: main.c,v 1.4 2011/01/26 13:36:49 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
 int module_open(struct boot_module *);
 
 void main(int, char **);
-extern char bootprog_name[], bootprog_rev[], bootprog_maker[], bootprog_date[];
+extern char bootprog_name[], bootprog_rev[];
 
 int brdtype;
 uint32_t busclock, cpuclock;



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

2011-01-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jan 26 13:14:07 UTC 2011

Modified Files:
src/sys/arch/dreamcast/dev: pvr.c

Log Message:
Add proper prefix to structures.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/dreamcast/dev/pvr.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/dreamcast/dev/pvr.c
diff -u src/sys/arch/dreamcast/dev/pvr.c:1.30 src/sys/arch/dreamcast/dev/pvr.c:1.31
--- src/sys/arch/dreamcast/dev/pvr.c:1.30	Sun Oct 24 13:34:27 2010
+++ src/sys/arch/dreamcast/dev/pvr.c	Wed Jan 26 13:14:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pvr.c,v 1.30 2010/10/24 13:34:27 tsutsui Exp $	*/
+/*	$NetBSD: pvr.c,v 1.31 2011/01/26 13:14:07 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 Marcus Comstedt.
@@ -35,7 +35,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.30 2010/10/24 13:34:27 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.31 2011/01/26 13:14:07 tsutsui Exp $");
 
 #include 
 #include 
@@ -143,7 +143,7 @@
 	int	dc_dispflags;		/* display flags */
 	int	dc_tvsystem;		/* TV broadcast system */
 
-	struct rasops_info rinfo;
+	struct rasops_info dc_rinfo;
 };
 
 #define	PVR_RGBMODE	0x01		/* RGB or composite */
@@ -152,7 +152,7 @@
 struct pvr_softc {
 	device_t sc_dev;
 	struct fb_devconfig *sc_dc;	/* device configuration */
-	int nscreens;
+	int sc_nscreens;
 };
 
 static int	pvr_match(device_t, cfdata_t, void *);
@@ -237,14 +237,14 @@
 	/* Initialize the device. */
 	pvrinit(dc);
 
-	dc->rinfo.ri_flg = 0;
+	dc->dc_rinfo.ri_flg = 0;
 	if (dc == &pvr_console_dc)
-		dc->rinfo.ri_flg |= RI_NO_AUTO;
-	dc->rinfo.ri_depth = dc->dc_depth;
-	dc->rinfo.ri_bits = (void *) dc->dc_videobase;
-	dc->rinfo.ri_width = dc->dc_wid;
-	dc->rinfo.ri_height = dc->dc_ht;
-	dc->rinfo.ri_stride = dc->dc_rowbytes;
+		dc->dc_rinfo.ri_flg |= RI_NO_AUTO;
+	dc->dc_rinfo.ri_depth = dc->dc_depth;
+	dc->dc_rinfo.ri_bits = (void *) dc->dc_videobase;
+	dc->dc_rinfo.ri_width = dc->dc_wid;
+	dc->dc_rinfo.ri_height = dc->dc_ht;
+	dc->dc_rinfo.ri_stride = dc->dc_rowbytes;
 
 	wsfont_init();
 	/* prefer 8 pixel wide font */
@@ -258,19 +258,19 @@
 		return;
 	}
 
-	if (wsfont_lock(cookie, &dc->rinfo.ri_font)) {
+	if (wsfont_lock(cookie, &dc->dc_rinfo.ri_font)) {
 		printf("pvr: unable to lock font\n");
 		return;
 	}
-	dc->rinfo.ri_wsfcookie = cookie;
+	dc->dc_rinfo.ri_wsfcookie = cookie;
 
-	rasops_init(&dc->rinfo, 500, 500);
+	rasops_init(&dc->dc_rinfo, 500, 500);
 
 	/* XXX shouldn't be global */
-	pvr_stdscreen.nrows = dc->rinfo.ri_rows;
-	pvr_stdscreen.ncols = dc->rinfo.ri_cols;
-	pvr_stdscreen.textops = &dc->rinfo.ri_ops;
-	pvr_stdscreen.capabilities = dc->rinfo.ri_caps;
+	pvr_stdscreen.nrows = dc->dc_rinfo.ri_rows;
+	pvr_stdscreen.ncols = dc->dc_rinfo.ri_cols;
+	pvr_stdscreen.textops = &dc->dc_rinfo.ri_ops;
+	pvr_stdscreen.capabilities = dc->dc_rinfo.ri_caps;
 
 	/* XXX yuck */
 	sprintf(pvr_stdscreen_textgeom, "%dx%d", pvr_stdscreen.ncols,
@@ -290,8 +290,8 @@
 	console = pvr_is_console;
 	if (console) {
 		sc->sc_dc = &pvr_console_dc;
-		sc->sc_dc->rinfo.ri_flg &= ~RI_NO_AUTO;
-		sc->nscreens = 1;
+		sc->sc_dc->dc_rinfo.ri_flg &= ~RI_NO_AUTO;
+		sc->sc_nscreens = 1;
 	} else {
 		sc->sc_dc = malloc(sizeof(struct fb_devconfig), M_DEVBUF,
 		M_WAITOK);
@@ -334,7 +334,7 @@
 		return 0;
 
 	case WSDISPLAYIO_LINEBYTES:
-		*(u_int *)data = sc->sc_dc->rinfo.ri_stride;
+		*(u_int *)data = sc->sc_dc->dc_rinfo.ri_stride;
 		return 0;
 
 	case WSDISPLAYIO_GETCMAP:
@@ -409,16 +409,16 @@
 	struct pvr_softc *sc = v;
 	long defattr;
 
-	if (sc->nscreens > 0)
+	if (sc->sc_nscreens > 0)
 		return ENOMEM;
 
-	*cookiep = &sc->sc_dc->rinfo; /* one and only for now */
+	*cookiep = &sc->sc_dc->dc_rinfo; /* one and only for now */
 	*curxp = 0;
 	*curyp = 0;
-	(*sc->sc_dc->rinfo.ri_ops.allocattr)(&sc->sc_dc->rinfo, 0, 0, 0,
+	(*sc->sc_dc->dc_rinfo.ri_ops.allocattr)(&sc->sc_dc->dc_rinfo, 0, 0, 0,
 	&defattr);
 	*attrp = defattr;
-	sc->nscreens++;
+	sc->sc_nscreens++;
 	return 0;
 }
 
@@ -430,7 +430,7 @@
 	if (sc->sc_dc == &pvr_console_dc)
 		panic("pvr_free_screen: console");
 
-	sc->nscreens--;
+	sc->sc_nscreens--;
 }
 
 int
@@ -587,8 +587,8 @@
 	long defattr;
 
 	pvr_getdevconfig(dcp);
-	(*dcp->rinfo.ri_ops.allocattr)(&dcp->rinfo, 0, 0, 0, &defattr);
-	wsdisplay_cnattach(&pvr_stdscreen, &dcp->rinfo, 0, 0, defattr);
+	(*dcp->dc_rinfo.ri_ops.allocattr)(&dcp->dc_rinfo, 0, 0, 0, &defattr);
+	wsdisplay_cnattach(&pvr_stdscreen, &dcp->dc_rinfo, 0, 0, defattr);
 
 	pvr_is_console = 1;
 



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

2011-01-26 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Jan 26 13:13:25 UTC 2011

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

Log Message:
bootprog_maker and bootprog_date are missing since we switched to the
MI newvers_stand.sh script. Remove the refering information line.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/main.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/altboot/main.c
diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.2 src/sys/arch/sandpoint/stand/altboot/main.c:1.3
--- src/sys/arch/sandpoint/stand/altboot/main.c:1.2	Sun Jan 23 07:41:38 2011
+++ src/sys/arch/sandpoint/stand/altboot/main.c	Wed Jan 26 13:13:25 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.2 2011/01/23 07:41:38 nisimura Exp $ */
+/* $NetBSD: main.c,v 1.3 2011/01/26 13:13:25 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -110,10 +110,9 @@
 
 	printf("\n");
 	printf(">> %s altboot, revision %s\n", bootprog_name, bootprog_rev);
-	printf(">> (%s, %s)\n", bootprog_maker, bootprog_date);
 
 	brdprop = brd_lookup(brdtype);
-	printf("%s, cpu %u MHz, bus %u MHz, %dMB SDRAM\n", brdprop->verbose,
+	printf(">> %s, cpu %u MHz, bus %u MHz, %dMB SDRAM\n", brdprop->verbose,
 	cpuclock / 100, busclock / 100, bi_mem.memsize >> 20);
 
 	n = pcilookup(PCI_CLASS_IDE, lata, sizeof(lata)/sizeof(lata[0]));



CVS commit: src/sys/dev

2011-01-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Jan 26 11:29:04 UTC 2011

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
add sandpoint satmgr device node entry.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/sys/dev/DEVNAMES

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/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.266 src/sys/dev/DEVNAMES:1.267
--- src/sys/dev/DEVNAMES:1.266	Mon Jan 24 01:22:49 2011
+++ src/sys/dev/DEVNAMES	Wed Jan 26 11:29:04 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.266 2011/01/24 01:22:49 jakllsch Exp $
+#	$NetBSD: DEVNAMES,v 1.267 2011/01/26 11:29:04 nisimura Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -1150,6 +1150,7 @@
 saost			hpcarm
 satalink		MI
 satlink			MI
+satmgr			sandpoint
 sb			MI
 sbc			mac68k
 sbdsp			MI		Attribute



CVS commit: src/share/man

2011-01-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Jan 26 11:25:51 UTC 2011

Modified Files:
src/share/man/man4: Makefile
src/share/man/man8: Makefile
Added Files:
src/share/man/man4/man4.sandpoint: Makefile satmgr.4
src/share/man/man8/man8.sandpoint: Makefile altboot.8

Log Message:
introduce sandpoint satmgr(4) and altboot(8) man page entries.


To generate a diff of this commit:
cvs rdiff -u -r1.546 -r1.547 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/man4.sandpoint/Makefile \
src/share/man/man4/man4.sandpoint/satmgr.4
cvs rdiff -u -r1.98 -r1.99 src/share/man/man8/Makefile
cvs rdiff -u -r0 -r1.3 src/share/man/man8/man8.sandpoint/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man8/man8.sandpoint/altboot.8

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/Makefile
diff -u src/share/man/man4/Makefile:1.546 src/share/man/man4/Makefile:1.547
--- src/share/man/man4/Makefile:1.546	Wed Jan 26 01:18:48 2011
+++ src/share/man/man4/Makefile	Wed Jan 26 11:25:51 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.546 2011/01/26 01:18:48 pooka Exp $
+#	$NetBSD: Makefile,v 1.547 2011/01/26 11:25:51 nisimura Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -221,8 +221,8 @@
 	man4.evbppc \
 	man4.hp300 man4.hp700 man4.hpcarm man4.hpcmips man4.hpcsh man4.i386 \
 	man4.mac68k man4.macppc man4.mvme68k man4.pmax man4.prep \
-	man4.sgimips man4.sparc man4.sparc64 man4.sun2 man4.sun3 man4.vax \
-	man4.x68k man4.x86
+	man4.sandpoint man4.sgimips man4.sparc man4.sparc64 man4.sun2 \
+	man4.sun3 man4.vax man4.x68k man4.x86
 
 .include 
 .include 

Index: src/share/man/man8/Makefile
diff -u src/share/man/man8/Makefile:1.98 src/share/man/man8/Makefile:1.99
--- src/share/man/man8/Makefile:1.98	Wed Jan 26 01:18:48 2011
+++ src/share/man/man8/Makefile	Wed Jan 26 11:25:51 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.98 2011/01/26 01:18:48 pooka Exp $
+#	$NetBSD: Makefile,v 1.99 2011/01/26 11:25:51 nisimura Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/5/93
 
 MAN=	MAKEDEV.8 MAKEDEV.local.8 afterboot.8 boot.8 compat_30.8 \
@@ -27,7 +27,7 @@
 	man8.cobalt man8.dreamcast man8.emips man8.hp300 man8.hp700 \
 	man8.hpcarm \
 	man8.hpcmips man8.hpcsh man8.i386 man8.mac68k man8.macppc \
-	man8.mvme68k man8.next68k man8.pmax man8.prep \
+	man8.mvme68k man8.next68k man8.pmax man8.prep man8.sandpoint \
 	man8.sgimips man8.sparc man8.sparc64 man8.sun2 man8.sun3 \
 	man8.vax man8.x68k
 

Added files:

Index: src/share/man/man4/man4.sandpoint/Makefile
diff -u /dev/null src/share/man/man4/man4.sandpoint/Makefile:1.1
--- /dev/null	Wed Jan 26 11:25:51 2011
+++ src/share/man/man4/man4.sandpoint/Makefile	Wed Jan 26 11:25:51 2011
@@ -0,0 +1,8 @@
+# 	from: @(#)Makefile	8.2 (Berkeley) 2/16/94
+#	$NetBSD: Makefile,v 1.1 2011/01/26 11:25:51 nisimura Exp $
+
+MAN=	satmgr.4
+MLINKS=
+MANSUBDIR=/sandpoint
+
+.include 
Index: src/share/man/man4/man4.sandpoint/satmgr.4
diff -u /dev/null src/share/man/man4/man4.sandpoint/satmgr.4:1.1
--- /dev/null	Wed Jan 26 11:25:51 2011
+++ src/share/man/man4/man4.sandpoint/satmgr.4	Wed Jan 26 11:25:51 2011
@@ -0,0 +1,80 @@
+.Dd Jan 26, 2011
+.Dt SATMGR 4 sandpoint
+.Os
+.Sh NAME
+.Nm satmgr
+.Nd
+driver for satellite processor, controlling power, front panel LEDs
+and buttons
+.Sh SYNOPSIS
+.Cd "satmgr0 at eumb? unit 0"
+.Cd "satmgr0 at eumb? unit 1"
+.Sh DESCRIPTION
+This driver provides an interface to the
+.Tn NAS
+builtin satellite microprocessor which controls the power, front
+panel LEDs and push buttons. Communication is performed through
+character sequences, whose definition and usage depend on the
+.Tn NAS
+product models.
+.Pp
+The device file
+.Pa /dev/satmgr
+can be written to control the satellite processor and the LEDs.
+Reading it will return single characters for button press events.
+This facility was designed to implement a
+.Tn NAS
+control
+.Tn CGI
+program.
+.Pp
+.Nm
+detects a soft power-off condition, which is triggered by holding
+the front panel power button pressed for several seconds.  This
+driver can optionally invoke
+.Xr powerd 8
+to get a finer control over the system shutdown procedure. It is
+capable of reporting a power-button-pressed event. Refer to the
+.Xr powerd 8
+manual section for more details.
+.Pp
+For
+.Tn "Kurobox/Linkstation"
+.Tn NAS
+products it also provides a way to
+toggle the system watchdog with the
+.Xr sysctl 8
+utility. The usage is:
+.Bd -literal -offset indent
+# sysctl -w machdep.satmgr.hwwdog_enable=1
+# sysctl -w machdep.satmgr.hwwdog_enable=0
+.Ed
+.Pp
+.Tn NAS
+products currently supported by
+.Xr satmgr 4 :
+.Bl -bullet -compact
+.It
+KuroBox
+.It
+Buffalo LinkStation
+.It
+Synology DiskStation
+.El
+.Sh FILES
+.Bl -tag -width /dev/satmgrX -compact
+.It Pa /dev/satmgr
+communication inferface to
+.Nm .
+.It Pa /dev/power
+event notify channel 

CVS commit: src/distrib/utils/sysinst

2011-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jan 26 10:58:20 UTC 2011

Modified Files:
src/distrib/utils/sysinst: defs.h main.c
src/distrib/utils/sysinst/arch/emips: md.h

Log Message:
make this build on non-emips again


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.55 -r1.56 src/distrib/utils/sysinst/main.c
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/sysinst/arch/emips/md.h

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

Modified files:

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.149 src/distrib/utils/sysinst/defs.h:1.150
--- src/distrib/utils/sysinst/defs.h:1.149	Sat Dec  4 14:57:56 2010
+++ src/distrib/utils/sysinst/defs.h	Wed Jan 26 10:58:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.149 2010/12/04 14:57:56 jmmv Exp $	*/
+/*	$NetBSD: defs.h,v 1.150 2011/01/26 10:58:19 pooka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -160,6 +160,11 @@
 #define PI_ISBSDFS(p) ((p)->pi_fstype == FS_BSDLFS || \
 		   (p)->pi_fstype == FS_BSDFFS)
 
+/* non-standard cd0 driver */
+#ifndef CD_NAME
+#define CD_NAME "cd0a"
+#endif
+
 /* Types */
 typedef struct distinfo {
 	const char	*name;

Index: src/distrib/utils/sysinst/main.c
diff -u src/distrib/utils/sysinst/main.c:1.55 src/distrib/utils/sysinst/main.c:1.56
--- src/distrib/utils/sysinst/main.c:1.55	Wed Jan 26 01:18:46 2011
+++ src/distrib/utils/sysinst/main.c	Wed Jan 26 10:58:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.55 2011/01/26 01:18:46 pooka Exp $	*/
+/*	$NetBSD: main.c,v 1.56 2011/01/26 10:58:19 pooka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,10 +82,6 @@
 	int size;
 };
 
-#ifndef CD_NAME
-#define CD_NAME "cd0a"
-#endif
-
 static const struct f_arg fflagopts[] = {
 	{"release", REL, rel, sizeof rel},
 	{"machine", MACH, machine, sizeof machine},

Index: src/distrib/utils/sysinst/arch/emips/md.h
diff -u src/distrib/utils/sysinst/arch/emips/md.h:1.1 src/distrib/utils/sysinst/arch/emips/md.h:1.2
--- src/distrib/utils/sysinst/arch/emips/md.h:1.1	Wed Jan 26 01:18:46 2011
+++ src/distrib/utils/sysinst/arch/emips/md.h	Wed Jan 26 10:58:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.1 2011/01/26 01:18:46 pooka Exp $	*/
+/*	$NetBSD: md.h,v 1.2 2011/01/26 10:58:20 pooka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -87,4 +87,8 @@
 #define MD_SETS_VALID	SET_KERNEL, SET_SYSTEM, SET_X11_NOSERVERS
 
 /* default install CD device is ace1a */
+/* XXX: not pretty */
+#ifdef CD_NAME
+#undef CD_NAME
+#endif
 #define CD_NAME "ace1a"



CVS commit: src/crypto/dist/heimdal/kuser

2011-01-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 26 09:56:52 UTC 2011

Modified Files:
src/crypto/dist/heimdal/kuser: kdestroy.1

Log Message:
Fix typo in Nd. From Ryo HAYASAKA in PR 44462.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/crypto/dist/heimdal/kuser/kdestroy.1

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

Modified files:

Index: src/crypto/dist/heimdal/kuser/kdestroy.1
diff -u src/crypto/dist/heimdal/kuser/kdestroy.1:1.7 src/crypto/dist/heimdal/kuser/kdestroy.1:1.8
--- src/crypto/dist/heimdal/kuser/kdestroy.1:1.7	Sat Mar 22 08:37:03 2008
+++ src/crypto/dist/heimdal/kuser/kdestroy.1	Wed Jan 26 09:56:51 2011
@@ -30,14 +30,14 @@
 .\" SUCH DAMAGE. 
 .\" 
 .\" $Heimdal: kdestroy.1 22071 2007-11-14 20:04:50Z lha $
-.\" $NetBSD: kdestroy.1,v 1.7 2008/03/22 08:37:03 mlelstv Exp $
+.\" $NetBSD: kdestroy.1,v 1.8 2011/01/26 09:56:51 wiz Exp $
 .\"
 .Dd April 27, 2006
 .Dt KDESTROY 1
 .Os
 .Sh NAME
 .Nm kdestroy
-.Nd remove one credental or destroy the current ticket file
+.Nd remove one credential or destroy the current ticket file
 .Sh SYNOPSIS
 .Nm
 .Bk -words



CVS commit: src/share/man/man9

2011-01-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 26 09:53:20 UTC 2011

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

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/KASSERT.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/KASSERT.9
diff -u src/share/man/man9/KASSERT.9:1.10 src/share/man/man9/KASSERT.9:1.11
--- src/share/man/man9/KASSERT.9:1.10	Tue Jan 25 23:46:48 2011
+++ src/share/man/man9/KASSERT.9	Wed Jan 26 09:53:20 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: KASSERT.9,v 1.10 2011/01/25 23:46:48 yamt Exp $
+.\" $NetBSD: KASSERT.9,v 1.11 2011/01/26 09:53:20 wiz Exp $
 .\"
 .\" Copyright (c) 2006 Igor Sobrado
 .\" 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 Janurary 26, 2011
+.Dd January 26, 2011
 .Dt KASSERT 9
 .Os
 .Sh NAME



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

2011-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 26 08:52:27 UTC 2011

Modified Files:
src/sys/arch/macppc/macppc [matt-nb5-pq3]: rbus_machdep.c
src/sys/arch/powerpc/include/oea [matt-nb5-pq3]: bat.h
src/sys/arch/powerpc/oea [matt-nb5-pq3]: genassym.cf oea_machdep.c
ofw_rascons.c pmap.c
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: trap_subr.S

Log Message:
Change battable to have a granularity of 8MB.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.42.1 src/sys/arch/macppc/macppc/rbus_machdep.c
cvs rdiff -u -r1.12 -r1.12.22.1 src/sys/arch/powerpc/include/oea/bat.h
cvs rdiff -u -r1.14.26.2 -r1.14.26.3 src/sys/arch/powerpc/oea/genassym.cf
cvs rdiff -u -r1.46.18.2 -r1.46.18.3 src/sys/arch/powerpc/oea/oea_machdep.c
cvs rdiff -u -r1.2 -r1.2.26.1 src/sys/arch/powerpc/oea/ofw_rascons.c
cvs rdiff -u -r1.61.12.2 -r1.61.12.3 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.65.16.2 -r1.65.16.3 src/sys/arch/powerpc/powerpc/trap_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/macppc/macppc/rbus_machdep.c
diff -u src/sys/arch/macppc/macppc/rbus_machdep.c:1.14 src/sys/arch/macppc/macppc/rbus_machdep.c:1.14.42.1
--- src/sys/arch/macppc/macppc/rbus_machdep.c:1.14	Wed Oct 17 19:55:34 2007
+++ src/sys/arch/macppc/macppc/rbus_machdep.c	Wed Jan 26 08:52:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbus_machdep.c,v 1.14 2007/10/17 19:55:34 garbled Exp $	*/
+/*	$NetBSD: rbus_machdep.c,v 1.14.42.1 2011/01/26 08:52:26 matt Exp $	*/
 
 /*
  * Copyright (c) 1999
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rbus_machdep.c,v 1.14 2007/10/17 19:55:34 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rbus_machdep.c,v 1.14.42.1 2011/01/26 08:52:26 matt Exp $");
 
 #include 
 #include 
@@ -95,8 +95,7 @@
 		size  = 0x1000;
 	}
 
-	battable[start >> 28].batl = BATL(start, BAT_I, BAT_PP_RW);
-	battable[start >> 28].batu = BATU(start, BAT_BL_256M, BAT_Vs);
+	oea_iobat_add(start, BAT_BL_256M);
 
 	return rbus_new_root_delegate(pa->pa_memt, start, size, 0);
 }

Index: src/sys/arch/powerpc/include/oea/bat.h
diff -u src/sys/arch/powerpc/include/oea/bat.h:1.12 src/sys/arch/powerpc/include/oea/bat.h:1.12.22.1
--- src/sys/arch/powerpc/include/oea/bat.h:1.12	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/oea/bat.h	Wed Jan 26 08:52:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bat.h,v 1.12 2008/04/28 20:23:32 martin Exp $	*/
+/*	$NetBSD: bat.h,v 1.12.22.1 2011/01/26 08:52:26 matt Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -194,7 +194,8 @@
 #define	BAT601_VALID_P(batl) \
 	((batl) & BAT601_V)
 
-#define	BAT_VA2IDX(va)	((va) >> ADDR_SR_SHFT)
+#define	BAT_VA2IDX(va)	((va) / (8*1024*1024))
+#define	BAT_IDX2VA(i)	((i) * (8*1024*1024))
 
 #ifdef	_KERNEL
 #ifndef _LOCORE

Index: src/sys/arch/powerpc/oea/genassym.cf
diff -u src/sys/arch/powerpc/oea/genassym.cf:1.14.26.2 src/sys/arch/powerpc/oea/genassym.cf:1.14.26.3
--- src/sys/arch/powerpc/oea/genassym.cf:1.14.26.2	Mon Jan 17 07:45:59 2011
+++ src/sys/arch/powerpc/oea/genassym.cf	Wed Jan 26 08:52:26 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.14.26.2 2011/01/17 07:45:59 matt Exp $
+#	$NetBSD: genassym.cf,v 1.14.26.3 2011/01/26 08:52:26 matt Exp $
 
 #
 # Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -41,6 +41,7 @@
 include 
 include 
 include 
+include 
 
 include 
 
@@ -48,7 +49,9 @@
 include 
 
 include 
+include 
 include 
+include 
 
 define	FRAMELEN	FRAMELEN
 define	FRAME_TF	offsetof(struct ktrapframe, ktf_tf)
@@ -211,6 +214,9 @@
 define	VREG_VRSAVE	offsetof(struct vreg, vrsave)
 define	VREG_VSCR	offsetof(struct vreg, vscr)
 
+define	MSR_PR		31-ilog2(PSL_PR)
+define	BAT_ADDR_SHIFT	ilog2(BAT_IDX2VA(1))
+
 define	L_PCB		offsetof(struct lwp, l_addr)
 define	L_ADDR		offsetof(struct lwp, l_addr)
 define	L_CPU		offsetof(struct lwp, l_cpu)

Index: src/sys/arch/powerpc/oea/oea_machdep.c
diff -u src/sys/arch/powerpc/oea/oea_machdep.c:1.46.18.2 src/sys/arch/powerpc/oea/oea_machdep.c:1.46.18.3
--- src/sys/arch/powerpc/oea/oea_machdep.c:1.46.18.2	Mon Jan 17 07:45:59 2011
+++ src/sys/arch/powerpc/oea/oea_machdep.c	Wed Jan 26 08:52:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: oea_machdep.c,v 1.46.18.2 2011/01/17 07:45:59 matt Exp $	*/
+/*	$NetBSD: oea_machdep.c,v 1.46.18.3 2011/01/26 08:52:26 matt Exp $	*/
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.46.18.2 2011/01/17 07:45:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.46.18.3 2011/01/26 08:52:26 matt Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_compat_netbsd.h"
@@ -101,7 +101,7 @@
 static void trap0(void *);
 
 /* XXXSL: The battable is not initialized to non-zero for PPC_OEA64 and PPC_OEA64_BRIDGE */
-struct bat battable[512];
+struct bat battable[BAT_VA2IDX(0x)+1];
 
 register_t iosrtable[16];	/* I/O segments, for kernel_pmap setup *

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 26 08:51:13 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: asm.h

Log Message:
Init CI_CURPCB too.


To generate a diff of this commit:
cvs rdiff -u -r1.26.26.2 -r1.26.26.3 src/sys/arch/powerpc/include/asm.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/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.26.26.2 src/sys/arch/powerpc/include/asm.h:1.26.26.3
--- src/sys/arch/powerpc/include/asm.h:1.26.26.2	Tue Jan 11 07:10:15 2011
+++ src/sys/arch/powerpc/include/asm.h	Wed Jan 26 08:51:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.26.26.2 2011/01/11 07:10:15 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.26.26.3 2011/01/26 08:51:12 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -182,11 +182,11 @@
 	li	tmp2,-1;		\
 	stint	tmp2,CI_IDEPTH(tmp1);	\
 	li	tmp2,0;			\
-	stptr	tmp2,-CALLFRAMELEN(er);	/* terminate idle stack chain */\
+	stptr	er,CI_CURPCB(tmp1);	\
 	lis	tmp1,_C_LABEL(proc0paddr)@ha;\
 	stptr	er,_C_LABEL(proc0paddr)@l(tmp1);			\
-	addi	er,er,USPACE;		/* stackpointer for proc0 */	\
-	addi	sp,er,-FRAMELEN;	/* stackpointer for proc0 */	\
+	addi	er,er,USPACE;		/* stackpointer for lwp0 */	\
+	addi	sp,er,-(FRAMELEN+CALLFRAMELEN);	/* sp for lwp0 */	\
 		/* er = end of mem reserved for kernel */		\
 	stptru	tmp2,-CALLFRAMELEN(sp)	/* end of stack chain */
 



CVS commit: src/sys/uvm

2011-01-26 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Jan 26 08:49:49 UTC 2011

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

Log Message:
Introducing inner loop prevent us from exiting from the original loop.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/uvm/uvm_pglist.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_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.59 src/sys/uvm/uvm_pglist.c:1.60
--- src/sys/uvm/uvm_pglist.c:1.59	Tue Jan 25 17:22:43 2011
+++ src/sys/uvm/uvm_pglist.c	Wed Jan 26 08:49:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.59 2011/01/25 17:22:43 matt Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.60 2011/01/26 08:49:48 enami Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.59 2011/01/25 17:22:43 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.60 2011/01/26 08:49:48 enami Exp $");
 
 #include 
 #include 
@@ -390,8 +390,9 @@
 	if (high <= ps->avail_start || low >= ps->avail_end)
 		return 0;
 
+again:
 	for (;; try++, pg++) {
-		while (try >= limit) {
+		if (try >= limit) {
 			if (ps->start_hint == 0 || second_pass) {
 try = limit - 1;
 break;
@@ -400,6 +401,7 @@
 			try = max(low, ps->avail_start);
 			limit = min(limit, ps->avail_start + ps->start_hint);
 			pg = &ps->pgs[try - ps->start];
+			goto again;
 		}
 #if defined(DEBUG)
 		{