CVS commit: src/lib/libpthread

2012-08-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug  2 12:43:42 UTC 2012

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

Log Message:
Prefer sysconf to obtain number of CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/lib/libpthread/pthread.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.c
diff -u src/lib/libpthread/pthread.c:1.135 src/lib/libpthread/pthread.c:1.136
--- src/lib/libpthread/pthread.c:1.135	Fri May  4 12:26:33 2012
+++ src/lib/libpthread/pthread.c	Thu Aug  2 12:43:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.135 2012/05/04 12:26:33 joerg Exp $	*/
+/*	$NetBSD: pthread.c,v 1.136 2012/08/02 12:43:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,14 +30,14 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: pthread.c,v 1.135 2012/05/04 12:26:33 joerg Exp $);
+__RCSID($NetBSD: pthread.c,v 1.136 2012/08/02 12:43:41 joerg Exp $);
 
 #define	__EXPOSE_STACK	1
 
 #include sys/param.h
 #include sys/exec_elf.h
 #include sys/mman.h
-#include sys/sysctl.h
+#include sys/lwp.h
 #include sys/lwpctl.h
 #include sys/tls.h
 
@@ -153,21 +153,11 @@ pthread__init(void)
 {
 	pthread_t first;
 	char *p;
-	int i, mib[2];
-	size_t len;
+	int i;
 	extern int __isthreaded;
 
 	pthread__pagesize = (size_t)sysconf(_SC_PAGESIZE);
-
-	mib[0] = CTL_HW;
-	mib[1] = HW_NCPU; 
-
-	len = sizeof(pthread__concurrency);
-	if (sysctl(mib, 2, pthread__concurrency, len, NULL, 0) == -1)
-		err(1, sysctl(hw.ncpu);
-
-	mib[0] = CTL_KERN;
-	mib[1] = KERN_OSREV; 
+	pthread__concurrency = sysconf(_SC_NPROCESSORS_CONF);
 
 	/* Initialize locks first; they're needed elsewhere. */
 	pthread__lockprim_init();



CVS commit: src/sys/arch/powerpc

2012-08-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug  2 13:50:15 UTC 2012

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

Log Message:
Only print fatal trap info if the resulting signal would be uncaught.
(this avoid the messages from libcrypto when it probes for capabilities).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/powerpc/powerpc/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.20 src/sys/arch/powerpc/booke/trap.c:1.21
--- src/sys/arch/powerpc/booke/trap.c:1.20	Wed Aug  1 21:30:22 2012
+++ src/sys/arch/powerpc/booke/trap.c	Thu Aug  2 13:50:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.20 2012/08/01 21:30:22 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.21 2012/08/02 13:50:15 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.20 2012/08/01 21:30:22 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.21 2012/08/02 13:50:15 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -877,7 +877,13 @@ trap(enum ppc_booke_exceptions trap_code
 			ksi.ksi_signo = SIGKILL;
 		}
 		if (rv != 0) {
-			if (cpu_printfataltraps) {
+			/*
+			 * Only print a fatal trap if the signal will be
+			 * uncaught.
+			 */
+			if (cpu_printfataltraps
+			 !sigismember(p-p_sigctx.ps_sigcatch,
+ksi.ksi_signo)) {
 printf(%s: pid %d.%d (%s):
  %s exception in user mode\n,
 __func__, p-p_pid, l-l_lid, p-p_comm,

Index: src/sys/arch/powerpc/powerpc/trap.c
diff -u src/sys/arch/powerpc/powerpc/trap.c:1.146 src/sys/arch/powerpc/powerpc/trap.c:1.147
--- src/sys/arch/powerpc/powerpc/trap.c:1.146	Sun Feb 19 21:06:25 2012
+++ src/sys/arch/powerpc/powerpc/trap.c	Thu Aug  2 13:50:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.146 2012/02/19 21:06:25 rmind Exp $	*/
+/*	$NetBSD: trap.c,v 1.147 2012/08/02 13:50:14 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.146 2012/02/19 21:06:25 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.147 2012/08/02 13:50:14 matt Exp $);
 
 #include opt_altivec.h
 #include opt_ddb.h
@@ -245,7 +245,8 @@ trap(struct trapframe *tf)
 			break;
 		}
 		ci-ci_ev_udsi_fatal.ev_count++;
-		if (cpu_printfataltraps) {
+		if (cpu_printfataltraps
+		 !sigismember(p-p_sigctx.ps_sigcatch, SIGSEGV)) {
 			printf(trap: pid %d.%d (%s): user %s DSI trap @ %#lx 
 			by %#lx (DSISR %#x, err=%d)\n,
 			p-p_pid, l-l_lid, p-p_comm,
@@ -306,7 +307,8 @@ trap(struct trapframe *tf)
 			break;
 		}
 		ci-ci_ev_isi_fatal.ev_count++;
-		if (cpu_printfataltraps) {
+		if (cpu_printfataltraps
+		 !sigismember(p-p_sigctx.ps_sigcatch, SIGSEGV)) {
 			printf(trap: pid %d.%d (%s): user ISI trap @ %#lx 
 			(SRR1=%#lx)\n, p-p_pid, l-l_lid, p-p_comm,
 			tf-tf_srr0, tf-tf_srr1);
@@ -332,7 +334,8 @@ trap(struct trapframe *tf)
 		ci-ci_ev_ali.ev_count++;
 		if (fix_unaligned(l, tf) != 0) {
 			ci-ci_ev_ali_fatal.ev_count++;
-			if (cpu_printfataltraps) {
+			if (cpu_printfataltraps
+			 !sigismember(p-p_sigctx.ps_sigcatch, SIGBUS)) {
 printf(trap: pid %d.%d (%s): user ALI trap @ 
 %#lx by %#lx (DSISR %#x)\n,
 p-p_pid, l-l_lid, p-p_comm,
@@ -356,7 +359,8 @@ trap(struct trapframe *tf)
 		vec_load();
 		break;
 #else
-		if (cpu_printfataltraps) {
+		if (cpu_printfataltraps
+		 !sigismember(p-p_sigctx.ps_sigcatch, SIGILL)) {
 			printf(trap: pid %d.%d (%s): user VEC trap @ %#lx 
 			(SRR1=%#lx)\n,
 			p-p_pid, l-l_lid, p-p_comm,
@@ -372,7 +376,8 @@ trap(struct trapframe *tf)
 #endif
 	case EXC_MCHK|EXC_USER:
 		ci-ci_ev_umchk.ev_count++;
-		if (cpu_printfataltraps) {
+		if (cpu_printfataltraps
+		 !sigismember(p-p_sigctx.ps_sigcatch, SIGBUS)) {
 			printf(trap: pid %d (%s): user MCHK trap @ %#lx 
 			(SRR1=%#lx)\n,
 			p-p_pid, p-p_comm, tf-tf_srr0, tf-tf_srr1);
@@ -416,10 +421,13 @@ trap(struct trapframe *tf)
 ksi.ksi_code = ILL_PRVOPC;
 			} else
 ksi.ksi_code = ILL_ILLOPC;
-			if (cpu_printfataltraps)
+			if (cpu_printfataltraps
+			 !sigismember(p-p_sigctx.ps_sigcatch,
+ksi.ksi_signo)) {
 printf(trap: pid %d.%d (%s): user PGM trap @
  %#lx (SRR1=%#lx)\n, p-p_pid, l-l_lid,
 p-p_comm, tf-tf_srr0, tf-tf_srr1);
+			}
 			(*p-p_emul-e_trapsignal)(l, ksi);
 		}
 		break;



CVS commit: src/sys/arch/vax/vax

2012-08-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug  2 14:03:22 UTC 2012

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

Log Message:
Supress print fatal traps if the process is being debugged of it the signal
will be caught by a signal handler.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/vax/vax/trap.c

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

Modified files:

Index: src/sys/arch/vax/vax/trap.c
diff -u src/sys/arch/vax/vax/trap.c:1.130 src/sys/arch/vax/vax/trap.c:1.131
--- src/sys/arch/vax/vax/trap.c:1.130	Sun Feb 19 21:06:33 2012
+++ src/sys/arch/vax/vax/trap.c	Thu Aug  2 14:03:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.130 2012/02/19 21:06:33 rmind Exp $ */
+/*	$NetBSD: trap.c,v 1.131 2012/08/02 14:03:22 matt Exp $ */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -33,7 +33,7 @@
  /* All bugs are subject to removal without further notice */
 		
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.130 2012/02/19 21:06:33 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.131 2012/08/02 14:03:22 matt Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -327,7 +327,10 @@ if(faultdebug)printf(trap accflt type %
 	}
 	if (trapsig) {
 		ksiginfo_t ksi;
-		if ((sig == SIGSEGV || sig == SIGILL)  cpu_printfataltraps)
+		if ((sig == SIGSEGV || sig == SIGILL)
+		 cpu_printfataltraps
+		 (p-p_slflag  PSL_TRACED) == 0
+		 !sigismember(p-p_sigctx.ps_sigcatch, sig))
 			printf(pid %d.%d (%s): sig %d: type %lx, code %lx, pc %lx, psl %lx\n,
 			   p-p_pid, l-l_lid, p-p_comm, sig, tf-tf_trap,
 			   tf-tf_code, tf-tf_pc, tf-tf_psl);



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

2012-08-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug  2 14:06:34 UTC 2012

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

Log Message:
Also supprese printing fatal traps is the process is being debugged.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/powerpc/powerpc/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/trap.c
diff -u src/sys/arch/powerpc/powerpc/trap.c:1.147 src/sys/arch/powerpc/powerpc/trap.c:1.148
--- src/sys/arch/powerpc/powerpc/trap.c:1.147	Thu Aug  2 13:50:14 2012
+++ src/sys/arch/powerpc/powerpc/trap.c	Thu Aug  2 14:06:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.147 2012/08/02 13:50:14 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.148 2012/08/02 14:06:34 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.147 2012/08/02 13:50:14 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.148 2012/08/02 14:06:34 matt Exp $);
 
 #include opt_altivec.h
 #include opt_ddb.h
@@ -246,6 +246,7 @@ trap(struct trapframe *tf)
 		}
 		ci-ci_ev_udsi_fatal.ev_count++;
 		if (cpu_printfataltraps
+		 (p-p_slflag  PSL_TRACED) == 0
 		 !sigismember(p-p_sigctx.ps_sigcatch, SIGSEGV)) {
 			printf(trap: pid %d.%d (%s): user %s DSI trap @ %#lx 
 			by %#lx (DSISR %#x, err=%d)\n,
@@ -308,6 +309,7 @@ trap(struct trapframe *tf)
 		}
 		ci-ci_ev_isi_fatal.ev_count++;
 		if (cpu_printfataltraps
+		 (p-p_slflag  PSL_TRACED) == 0
 		 !sigismember(p-p_sigctx.ps_sigcatch, SIGSEGV)) {
 			printf(trap: pid %d.%d (%s): user ISI trap @ %#lx 
 			(SRR1=%#lx)\n, p-p_pid, l-l_lid, p-p_comm,
@@ -335,6 +337,7 @@ trap(struct trapframe *tf)
 		if (fix_unaligned(l, tf) != 0) {
 			ci-ci_ev_ali_fatal.ev_count++;
 			if (cpu_printfataltraps
+			 (p-p_slflag  PSL_TRACED) == 0
 			 !sigismember(p-p_sigctx.ps_sigcatch, SIGBUS)) {
 printf(trap: pid %d.%d (%s): user ALI trap @ 
 %#lx by %#lx (DSISR %#x)\n,
@@ -360,6 +363,7 @@ trap(struct trapframe *tf)
 		break;
 #else
 		if (cpu_printfataltraps
+		 (p-p_slflag  PSL_TRACED) == 0
 		 !sigismember(p-p_sigctx.ps_sigcatch, SIGILL)) {
 			printf(trap: pid %d.%d (%s): user VEC trap @ %#lx 
 			(SRR1=%#lx)\n,
@@ -377,6 +381,7 @@ trap(struct trapframe *tf)
 	case EXC_MCHK|EXC_USER:
 		ci-ci_ev_umchk.ev_count++;
 		if (cpu_printfataltraps
+		 (p-p_slflag  PSL_TRACED) == 0
 		 !sigismember(p-p_sigctx.ps_sigcatch, SIGBUS)) {
 			printf(trap: pid %d (%s): user MCHK trap @ %#lx 
 			(SRR1=%#lx)\n,
@@ -422,6 +427,7 @@ trap(struct trapframe *tf)
 			} else
 ksi.ksi_code = ILL_ILLOPC;
 			if (cpu_printfataltraps
+			 (p-p_slflag  PSL_TRACED) == 0
 			 !sigismember(p-p_sigctx.ps_sigcatch,
 ksi.ksi_signo)) {
 printf(trap: pid %d.%d (%s): user PGM trap @



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

2012-08-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug  2 14:07:47 UTC 2012

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

Log Message:
Also supprese printing fatal traps if the process is being debugged.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/booke/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.21 src/sys/arch/powerpc/booke/trap.c:1.22
--- src/sys/arch/powerpc/booke/trap.c:1.21	Thu Aug  2 13:50:15 2012
+++ src/sys/arch/powerpc/booke/trap.c	Thu Aug  2 14:07:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.21 2012/08/02 13:50:15 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.22 2012/08/02 14:07:47 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.21 2012/08/02 13:50:15 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.22 2012/08/02 14:07:47 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -882,6 +882,7 @@ trap(enum ppc_booke_exceptions trap_code
 			 * uncaught.
 			 */
 			if (cpu_printfataltraps
+			 (p-p_slflag  PSL_TRACED) == 0
 			 !sigismember(p-p_sigctx.ps_sigcatch,
 ksi.ksi_signo)) {
 printf(%s: pid %d.%d (%s):



CVS commit: src/sys/arch

2012-08-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug  2 15:56:08 UTC 2012

Modified Files:
src/sys/arch/arm/arm32: genassym.cf
src/sys/arch/arm/at91: at91aic.c at91aicvar.h at91busvar.h
src/sys/arch/arm/ep93xx: ep93xx_intr.c
src/sys/arch/arm/include: cpu.h
src/sys/arch/arm/include/arm32: frame.h
src/sys/arch/arm/ixp12x0: ixp12x0_intr.c
src/sys/arch/arm/xscale: becc_icu.c i80200_icu.c i80200var.h
i80321_icu.c
src/sys/arch/evbarm/iq80310: iq80310_intr.c

Log Message:
Remove irqframe and replace with identical trapframe.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/arm32/genassym.cf
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/at91/at91aic.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91aicvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/at91/at91busvar.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/ep93xx/ep93xx_intr.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/include/arm32/frame.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/ixp12x0/ixp12x0_intr.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/xscale/becc_icu.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/xscale/i80200_icu.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/i80200var.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/xscale/i80321_icu.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/iq80310/iq80310_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/arm/arm32/genassym.cf
diff -u src/sys/arch/arm/arm32/genassym.cf:1.46 src/sys/arch/arm/arm32/genassym.cf:1.47
--- src/sys/arch/arm/arm32/genassym.cf:1.46	Thu Apr  7 10:03:47 2011
+++ src/sys/arch/arm/arm32/genassym.cf	Thu Aug  2 15:56:06 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.46 2011/04/07 10:03:47 matt Exp $
+#	$NetBSD: genassym.cf,v 1.47 2012/08/02 15:56:06 skrll Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -142,8 +142,6 @@ define	TF_R0			offsetof(struct trapframe
 define	TF_R10			offsetof(struct trapframe, tf_r10)
 define	TF_PC			offsetof(struct trapframe, tf_pc)
 
-define	IF_PC			offsetof(struct irqframe, if_pc)
-
 define	PROCSIZE		sizeof(struct proc)
 define	TRAPFRAMESIZE		sizeof(struct trapframe)
 

Index: src/sys/arch/arm/at91/at91aic.c
diff -u src/sys/arch/arm/at91/at91aic.c:1.8 src/sys/arch/arm/at91/at91aic.c:1.9
--- src/sys/arch/arm/at91/at91aic.c:1.8	Fri Nov  4 17:16:38 2011
+++ src/sys/arch/arm/at91/at91aic.c	Thu Aug  2 15:56:06 2012
@@ -1,5 +1,5 @@
-/*	$Id: at91aic.c,v 1.8 2011/11/04 17:16:38 aymeric Exp $	*/
-/*	$NetBSD: at91aic.c,v 1.8 2011/11/04 17:16:38 aymeric Exp $	*/
+/*	$Id: at91aic.c,v 1.9 2012/08/02 15:56:06 skrll Exp $	*/
+/*	$NetBSD: at91aic.c,v 1.9 2012/08/02 15:56:06 skrll Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy.
@@ -362,10 +362,10 @@ at91aic_intr_disestablish(void *cookie)
 #include arm/at91/at91dbgureg.h
 #include arm/at91/at91pdcreg.h
 
-static inline void intr_process(struct intrq *iq, int pcpl, struct irqframe *frame);
+static inline void intr_process(struct intrq *iq, int pcpl, struct trapframe *frame);
 
 static inline void
-intr_process(struct intrq *iq, int pcpl, struct irqframe *frame)
+intr_process(struct intrq *iq, int pcpl, struct trapframe *frame)
 {
 	struct intrhand*	ih;
 	u_int			oldirqstate, intr;
@@ -404,7 +404,7 @@ intr_process(struct intrq *iq, int pcpl,
 }
 
 void
-at91aic_intr_dispatch(struct irqframe *frame)
+at91aic_intr_dispatch(struct trapframe *frame)
 {
 	struct intrq*		iq;
 	int			pcpl = curcpl();

Index: src/sys/arch/arm/at91/at91aicvar.h
diff -u src/sys/arch/arm/at91/at91aicvar.h:1.3 src/sys/arch/arm/at91/at91aicvar.h:1.4
--- src/sys/arch/arm/at91/at91aicvar.h:1.3	Fri Oct 23 06:53:13 2009
+++ src/sys/arch/arm/at91/at91aicvar.h	Thu Aug  2 15:56:06 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: at91aicvar.h,v 1.3 2009/10/23 06:53:13 snj Exp $	*/
+/*	$NetBSD: at91aicvar.h,v 1.4 2012/08/02 15:56:06 skrll Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy
@@ -57,6 +57,6 @@ void at91aic_init(void);
 void *at91aic_intr_establish(int irq, int ipl, int type, int (*ih_func)(void *), void *arg);
 void at91aic_intr_disestablish(void *cookie);
 void at91aic_intr_poll(void *ihp, int flags);
-void at91aic_intr_dispatch(struct irqframe *frame);
+void at91aic_intr_dispatch(struct trapframe *frame);
 
 #endif /* _AT91AICVAR_H_ */

Index: src/sys/arch/arm/at91/at91busvar.h
diff -u src/sys/arch/arm/at91/at91busvar.h:1.4 src/sys/arch/arm/at91/at91busvar.h:1.5
--- src/sys/arch/arm/at91/at91busvar.h:1.4	Fri Jul  1 19:31:16 2011
+++ src/sys/arch/arm/at91/at91busvar.h	Thu Aug  2 15:56:06 2012
@@ -1,5 +1,5 @@
-/*	$Id: at91busvar.h,v 1.4 2011/07/01 19:31:16 dyoung Exp $	*/
-/*	$NetBSD: at91busvar.h,v 1.4 2011/07/01 19:31:16 dyoung Exp $ */
+/*	$Id: at91busvar.h,v 1.5 2012/08/02 15:56:06 skrll Exp $	*/
+/*	$NetBSD: 

CVS commit: src/sys/coda

2012-08-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  2 16:06:59 UTC 2012

Modified Files:
src/sys/coda: coda_namecache.c coda_subr.c coda_subr.h coda_vfsops.c
coda_vnops.c coda_vnops.h

Log Message:
- move debugging functions to vcoda so modules with -DDEBUG link
- fix writing to coda files. this is probably not the right way to do
  this, but it satisfies the locking protocol:
1. Sometimes coda_open() is called with an unlocked vnode which
   does not satisfy the locking protocol. Lock it for now. We
   need to find out why this happens
2. VFS_VGET sometimes returns the container vnode unlocked. What
   is the locking protocol for VFS_VGET? We also lock it here.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/coda/coda_namecache.c
cvs rdiff -u -r1.26 -r1.27 src/sys/coda/coda_subr.c
cvs rdiff -u -r1.8 -r1.9 src/sys/coda/coda_subr.h
cvs rdiff -u -r1.73 -r1.74 src/sys/coda/coda_vfsops.c
cvs rdiff -u -r1.89 -r1.90 src/sys/coda/coda_vnops.c
cvs rdiff -u -r1.15 -r1.16 src/sys/coda/coda_vnops.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/coda/coda_namecache.c
diff -u src/sys/coda/coda_namecache.c:1.24 src/sys/coda/coda_namecache.c:1.25
--- src/sys/coda/coda_namecache.c:1.24	Sat Apr 18 10:58:02 2009
+++ src/sys/coda/coda_namecache.c	Thu Aug  2 12:06:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_namecache.c,v 1.24 2009/04/18 14:58:02 tsutsui Exp $	*/
+/*	$NetBSD: coda_namecache.c,v 1.25 2012/08/02 16:06:58 christos Exp $	*/
 
 /*
  *
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_namecache.c,v 1.24 2009/04/18 14:58:02 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_namecache.c,v 1.25 2012/08/02 16:06:58 christos Exp $);
 
 #include sys/param.h
 #include sys/errno.h
@@ -88,10 +88,7 @@ __KERNEL_RCSID(0, $NetBSD: coda_namecac
 #include coda/coda.h
 #include coda/cnode.h
 #include coda/coda_namecache.h
-
-#ifdef	DEBUG
-#include coda/coda_vnops.h
-#endif
+#include coda/coda_subr.h
 
 /*
  * Declaration of the name cache data structure.
@@ -202,8 +199,8 @@ coda_nc_find(struct cnode *dcp, const ch
 			kauth_cred_getrefcnt(cncp-cred),
 			kauth_cred_geteuid(cncp-cred),
 			kauth_cred_getegid(cncp-cred));
-		print_cred(cred);
-		print_cred(cncp-cred);
+		coda_print_cred(cred);
+		coda_print_cred(cncp-cred);
 	}
 #endif
 	count++;

Index: src/sys/coda/coda_subr.c
diff -u src/sys/coda/coda_subr.c:1.26 src/sys/coda/coda_subr.c:1.27
--- src/sys/coda/coda_subr.c:1.26	Wed Apr 25 23:04:54 2012
+++ src/sys/coda/coda_subr.c	Thu Aug  2 12:06:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_subr.c,v 1.26 2012/04/26 03:04:54 christos Exp $	*/
+/*	$NetBSD: coda_subr.c,v 1.27 2012/08/02 16:06:58 christos Exp $	*/
 
 /*
  *
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.26 2012/04/26 03:04:54 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.27 2012/08/02 16:06:58 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -63,6 +63,7 @@ __KERNEL_RCSID(0, $NetBSD: coda_subr.c,
 #include sys/proc.h
 #include sys/select.h
 #include sys/mount.h
+#include sys/kauth.h
 
 #include coda/coda.h
 #include coda/cnode.h
@@ -98,6 +99,8 @@ int coda_vfsop_print_entry = 0;
 #define IS_DIR(cnode)(cnode.opaque[2]  0x1)
 #endif
 
+struct vnode *coda_ctlvp;
+
 /*
  * Allocate a cnode.
  */
@@ -550,6 +553,24 @@ void coda_debugoff(void)
 coda_vfsop_print_entry = 0;
 }
 
+/* How to print a ucred */
+void
+coda_print_cred(kauth_cred_t cred)
+{
+
+	uint16_t ngroups;
+	int i;
+
+	myprintf((ref %d\tuid %d\n, kauth_cred_getrefcnt(cred),
+		 kauth_cred_geteuid(cred)));
+
+	ngroups = kauth_cred_ngroups(cred);
+	for (i=0; i  ngroups; i++)
+		myprintf((\tgroup %d: (%d)\n, i, kauth_cred_group(cred, i)));
+	myprintf((\n));
+
+}
+
 /*
  * Utilities used by both client and server
  * Standard levels:

Index: src/sys/coda/coda_subr.h
diff -u src/sys/coda/coda_subr.h:1.8 src/sys/coda/coda_subr.h:1.9
--- src/sys/coda/coda_subr.h:1.8	Sun Dec 11 07:19:50 2005
+++ src/sys/coda/coda_subr.h	Thu Aug  2 12:06:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_subr.h,v 1.8 2005/12/11 12:19:50 christos Exp $	*/
+/*	$NetBSD: coda_subr.h,v 1.9 2012/08/02 16:06:58 christos Exp $	*/
 
 /*
  *
@@ -43,5 +43,6 @@ void coda_debugoff(void);
 int  coda_kill(struct mount *whoIam, enum dc_status dcstat);
 void coda_save(struct cnode *cp);
 void coda_unsave(struct cnode *cp);
+void coda_print_cred(kauth_cred_t cred);
 
 

Index: src/sys/coda/coda_vfsops.c
diff -u src/sys/coda/coda_vfsops.c:1.73 src/sys/coda/coda_vfsops.c:1.74
--- src/sys/coda/coda_vfsops.c:1.73	Thu May  3 22:06:27 2012
+++ src/sys/coda/coda_vfsops.c	Thu Aug  2 12:06:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vfsops.c,v 1.73 2012/05/04 02:06:27 christos Exp $	*/
+/*	$NetBSD: coda_vfsops.c,v 1.74 2012/08/02 16:06:58 christos Exp $	*/
 
 /*
 

CVS commit: src/sys/net

2012-08-02 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Aug  2 20:13:24 UTC 2012

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

Log Message:
bpf_filter: remove unnecessary memset(), add a comment.


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

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

Modified files:

Index: src/sys/net/bpf_filter.c
diff -u src/sys/net/bpf_filter.c:1.51 src/sys/net/bpf_filter.c:1.52
--- src/sys/net/bpf_filter.c:1.51	Wed Aug  1 23:24:29 2012
+++ src/sys/net/bpf_filter.c	Thu Aug  2 20:13:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf_filter.c,v 1.51 2012/08/01 23:24:29 rmind Exp $	*/
+/*	$NetBSD: bpf_filter.c,v 1.52 2012/08/02 20:13:24 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.51 2012/08/01 23:24:29 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.52 2012/08/02 20:13:24 rmind Exp $);
 
 #if 0
 #if !(defined(lint) || defined(KERNEL))
@@ -149,7 +149,10 @@ bpf_filter(const struct bpf_insn *pc, co
 		return (u_int)-1;
 	}
 
-	memset(mem, 0, sizeof(mem));
+	/*
+	 * Note: safe to leave memwords uninitialised, as the validation
+	 * step ensures that it will not be read, if it was not written.
+	 */
 	A = 0;
 	X = 0;
 	--pc;



CVS commit: src/sys/dev/pci

2012-08-02 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Aug  3 01:23:33 UTC 2012

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

Log Message:
machfb's memsize is in MB, glyphcache_init expects bytes. doh.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/machfb.c

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

Modified files:

Index: src/sys/dev/pci/machfb.c
diff -u src/sys/dev/pci/machfb.c:1.79 src/sys/dev/pci/machfb.c:1.80
--- src/sys/dev/pci/machfb.c:1.79	Thu Aug  2 00:17:44 2012
+++ src/sys/dev/pci/machfb.c	Fri Aug  3 01:23:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machfb.c,v 1.79 2012/08/02 00:17:44 macallan Exp $	*/
+/*	$NetBSD: machfb.c,v 1.80 2012/08/03 01:23:32 macallan Exp $	*/
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 __KERNEL_RCSID(0, 
-	$NetBSD: machfb.c,v 1.79 2012/08/02 00:17:44 macallan Exp $);
+	$NetBSD: machfb.c,v 1.80 2012/08/03 01:23:32 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -774,13 +774,12 @@ mach64_attach(device_t parent, device_t 
 		mach64_defaultscreen.nrows = ri-ri_rows;
 		mach64_defaultscreen.ncols = ri-ri_cols;
 		glyphcache_init(sc-sc_gc, sc-sc_my_mode-vdisplay + 5,
-			(sc-memsize / sc-sc_my_mode-hdisplay) -
-			sc-sc_my_mode-vdisplay - 5,
-			sc-sc_my_mode-hdisplay,
-			ri-ri_font-fontwidth,
-			ri-ri_font-fontheight,
-			defattr);
-
+		((sc-memsize * 1024 * 1024) / sc-sc_my_mode-hdisplay) -
+		  sc-sc_my_mode-vdisplay - 5,
+		sc-sc_my_mode-hdisplay,
+		ri-ri_font-fontwidth,
+		ri-ri_font-fontheight,
+		defattr);
 		wsdisplay_cnattach(mach64_defaultscreen, ri, 0, 0, defattr);	
 	} else {
 		/*
@@ -795,12 +794,12 @@ mach64_attach(device_t parent, device_t 
 		}
 
 		glyphcache_init(sc-sc_gc, sc-sc_my_mode-vdisplay + 5,
-			(sc-memsize / sc-sc_my_mode-hdisplay) -
-			sc-sc_my_mode-vdisplay - 5,
-			sc-sc_my_mode-hdisplay,
-			ri-ri_font-fontwidth,
-			ri-ri_font-fontheight,
-			defattr);
+		((sc-memsize * 1024 * 1024) / sc-sc_my_mode-hdisplay) -
+		  sc-sc_my_mode-vdisplay - 5,
+		sc-sc_my_mode-hdisplay,
+		ri-ri_font-fontwidth,
+		ri-ri_font-fontheight,
+		defattr);
 	}
 
 	sc-sc_bg = mach64_console_screen.scr_ri.ri_devcmap[WS_DEFAULT_BG];



CVS commit: [matt-nb5-mips64] src/common/lib/libc/arch/mips/atomic

2012-08-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug  3 05:35:14 UTC 2012

Modified Files:
src/common/lib/libc/arch/mips/atomic [matt-nb5-mips64]: membar_ops.S

Log Message:
Add missing .set noreorder


To generate a diff of this commit:
cvs rdiff -u -r1.3.10.2 -r1.3.10.3 \
src/common/lib/libc/arch/mips/atomic/membar_ops.S

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

Modified files:

Index: src/common/lib/libc/arch/mips/atomic/membar_ops.S
diff -u src/common/lib/libc/arch/mips/atomic/membar_ops.S:1.3.10.2 src/common/lib/libc/arch/mips/atomic/membar_ops.S:1.3.10.3
--- src/common/lib/libc/arch/mips/atomic/membar_ops.S:1.3.10.2	Sat Sep  5 18:52:32 2009
+++ src/common/lib/libc/arch/mips/atomic/membar_ops.S	Fri Aug  3 05:35:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: membar_ops.S,v 1.3.10.2 2009/09/05 18:52:32 matt Exp $	*/
+/*	membar_ops.S,v 1.3.10.2 2009/09/05 18:52:32 matt Exp	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -50,6 +50,7 @@
 #endif
 
 	.text
+	.set noreorder
 
 LEAF(_membar_sync)
 	j	ra