Module Name:    src
Committed By:   matt
Date:           Fri Jul 27 05:36:13 UTC 2012

Modified Files:
        src/sys/arch/amiga/amiga: machdep.c
        src/sys/arch/arm/arm32: intr.c
        src/sys/arch/arm/include/arm32: psl.h
        src/sys/arch/atari/atari: machdep.c
        src/sys/arch/cesfic/cesfic: machdep.c
        src/sys/arch/hp300/hp300: machdep.c
        src/sys/arch/hpcarm/hpcarm: intr.c
        src/sys/arch/hpcarm/include: intr.h
        src/sys/arch/luna68k/luna68k: machdep.c
        src/sys/arch/m68k/include: psl.h
        src/sys/arch/mac68k/mac68k: machdep.c
        src/sys/arch/mvme68k/mvme68k: machdep.c
        src/sys/arch/news68k/news68k: machdep.c
        src/sys/arch/next68k/next68k: machdep.c
        src/sys/arch/sparc/include: intr.h
        src/sys/arch/sparc/sparc: machdep.c
        src/sys/arch/sparc64/include: intr.h
        src/sys/arch/sparc64/sparc64: machdep.c
        src/sys/arch/sun2/sun2: machdep.c
        src/sys/arch/sun3/sun3: machdep.c
        src/sys/arch/sun3/sun3x: machdep.c
        src/sys/arch/x68k/x68k: machdep.c
        src/sys/kern: kern_sleepq.c kern_synch.c

Log Message:
Remove safepri and use IPL_SAFEPRI instead.  This may be defined in a MD
header file (if not, a value of 0 is assmued).


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/sys/arch/amiga/amiga/machdep.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/arm32/intr.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/arm32/psl.h
cvs rdiff -u -r1.173 -r1.174 src/sys/arch/atari/atari/machdep.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/cesfic/cesfic/machdep.c
cvs rdiff -u -r1.224 -r1.225 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hpcarm/hpcarm/intr.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hpcarm/include/intr.h
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/luna68k/luna68k/machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/m68k/include/psl.h
cvs rdiff -u -r1.343 -r1.344 src/sys/arch/mac68k/mac68k/machdep.c
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/next68k/next68k/machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc/include/intr.h
cvs rdiff -u -r1.319 -r1.320 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sparc64/include/intr.h
cvs rdiff -u -r1.267 -r1.268 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sun2/sun2/machdep.c
cvs rdiff -u -r1.204 -r1.205 src/sys/arch/sun3/sun3/machdep.c
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/sun3/sun3x/machdep.c
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/x68k/x68k/machdep.c
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_sleepq.c
cvs rdiff -u -r1.301 -r1.302 src/sys/kern/kern_synch.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/amiga/amiga/machdep.c
diff -u src/sys/arch/amiga/amiga/machdep.c:1.237 src/sys/arch/amiga/amiga/machdep.c:1.238
--- src/sys/arch/amiga/amiga/machdep.c:1.237	Thu Dec 15 14:25:12 2011
+++ src/sys/arch/amiga/amiga/machdep.c	Fri Jul 27 05:36:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.237 2011/12/15 14:25:12 phx Exp $	*/
+/*	$NetBSD: machdep.c,v 1.238 2012/07/27 05:36:09 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -48,7 +48,7 @@
 #include "opt_m68k_arch.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.237 2011/12/15 14:25:12 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.238 2012/07/27 05:36:09 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -138,11 +138,6 @@ int	machineid;
 int	maxmem;			/* max memory per process */
 int	physmem = MAXMEM;	/* max supported memory, changes to actual */
 
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
 extern  int   freebufspace;
 extern	u_int lowram;
 

Index: src/sys/arch/arm/arm32/intr.c
diff -u src/sys/arch/arm/arm32/intr.c:1.32 src/sys/arch/arm/arm32/intr.c:1.33
--- src/sys/arch/arm/arm32/intr.c:1.32	Mon Dec 20 00:25:27 2010
+++ src/sys/arch/arm/arm32/intr.c	Fri Jul 27 05:36:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.32 2010/12/20 00:25:27 matt Exp $	*/
+/*	$NetBSD: intr.c,v 1.33 2012/07/27 05:36:09 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.32 2010/12/20 00:25:27 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.33 2012/07/27 05:36:09 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,7 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.3
 #include <arm/arm32/machdep.h>
  
 u_int spl_masks[NIPL];
-int safepri = IPL_NONE;
 
 extern u_int irqmasks[];
 

Index: src/sys/arch/arm/include/arm32/psl.h
diff -u src/sys/arch/arm/include/arm32/psl.h:1.18 src/sys/arch/arm/include/arm32/psl.h:1.19
--- src/sys/arch/arm/include/arm32/psl.h:1.18	Thu Jan 29 20:54:52 2009
+++ src/sys/arch/arm/include/arm32/psl.h	Fri Jul 27 05:36:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.18 2009/01/29 20:54:52 nonaka Exp $	*/
+/*	$NetBSD: psl.h,v 1.19 2012/07/27 05:36:09 matt Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -62,6 +62,8 @@
 #define splsched()	raisespl(IPL_SCHED)
 #define splhigh()	raisespl(IPL_HIGH)
 
+#define	IPL_SAFEPRI	IPL_NONE		/* for kern_sleepq.c */
+
 #ifdef _KERNEL
 #ifndef _LOCORE
 int raisespl	(int);

Index: src/sys/arch/atari/atari/machdep.c
diff -u src/sys/arch/atari/atari/machdep.c:1.173 src/sys/arch/atari/atari/machdep.c:1.174
--- src/sys/arch/atari/atari/machdep.c:1.173	Mon Dec 12 19:03:08 2011
+++ src/sys/arch/atari/atari/machdep.c	Fri Jul 27 05:36:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.173 2011/12/12 19:03:08 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.174 2012/07/27 05:36:10 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.173 2011/12/12 19:03:08 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.174 2012/07/27 05:36:10 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -113,11 +113,6 @@ void *	msgbufaddr;
 vaddr_t	msgbufpa;
 
 int	physmem = MAXMEM;	/* max supported memory, changes to actual */
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
 extern  int   freebufspace;
 extern	u_int lowram;
 

Index: src/sys/arch/cesfic/cesfic/machdep.c
diff -u src/sys/arch/cesfic/cesfic/machdep.c:1.62 src/sys/arch/cesfic/cesfic/machdep.c:1.63
--- src/sys/arch/cesfic/cesfic/machdep.c:1.62	Sun Feb 12 16:34:07 2012
+++ src/sys/arch/cesfic/cesfic/machdep.c	Fri Jul 27 05:36:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.62 2012/02/12 16:34:07 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.63 2012/07/27 05:36:10 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.62 2012/02/12 16:34:07 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.63 2012/07/27 05:36:10 matt Exp $");
 
 #include "opt_bufcache.h"
 #include "opt_ddb.h"
@@ -120,11 +120,6 @@ struct vm_map *phys_map = NULL;
  */
 /*int	maxmem;*/			/* max memory per process */
 int	physmem = MAXMEM;	/* max supported memory, changes to actual */
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
 
 extern	u_int lowram;
 

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.224 src/sys/arch/hp300/hp300/machdep.c:1.225
--- src/sys/arch/hp300/hp300/machdep.c:1.224	Mon Dec 12 19:03:09 2011
+++ src/sys/arch/hp300/hp300/machdep.c	Fri Jul 27 05:36:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.224 2011/12/12 19:03:09 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.225 2012/07/27 05:36:10 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.224 2011/12/12 19:03:09 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.225 2012/07/27 05:36:10 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -130,11 +130,6 @@ vaddr_t	bootinfo_va;
 
 int	maxmem;			/* max memory per process */
 int	physmem = MAXMEM;	/* max supported memory, changes to actual */
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
 
 extern	u_int lowram;
 extern	short exframesize[];

Index: src/sys/arch/hpcarm/hpcarm/intr.c
diff -u src/sys/arch/hpcarm/hpcarm/intr.c:1.18 src/sys/arch/hpcarm/hpcarm/intr.c:1.19
--- src/sys/arch/hpcarm/hpcarm/intr.c:1.18	Mon Dec 20 00:25:33 2010
+++ src/sys/arch/hpcarm/hpcarm/intr.c	Fri Jul 27 05:36:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.18 2010/12/20 00:25:33 matt Exp $	*/
+/*	$NetBSD: intr.c,v 1.19 2012/07/27 05:36:10 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.18 2010/12/20 00:25:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.19 2012/07/27 05:36:10 matt Exp $");
 
 #include "opt_irqstats.h"
 #include "opt_cputypes.h"
@@ -106,7 +106,6 @@ void    set_spl_masks(void);
 
 u_int spl_masks[_SPL_LEVELS + 1];
 u_int spl_smasks[_SPL_LEVELS];
-int safepri = _SPL_0;
 
 #ifdef __HAVE_FAST_SOFTINTS
 /* Handle software interrupts */

Index: src/sys/arch/hpcarm/include/intr.h
diff -u src/sys/arch/hpcarm/include/intr.h:1.16 src/sys/arch/hpcarm/include/intr.h:1.17
--- src/sys/arch/hpcarm/include/intr.h:1.16	Sun Jun 10 13:15:24 2012
+++ src/sys/arch/hpcarm/include/intr.h	Fri Jul 27 05:36:10 2012
@@ -1,4 +1,4 @@
-/* 	$NetBSD: intr.h,v 1.16 2012/06/10 13:15:24 skrll Exp $	*/
+/* 	$NetBSD: intr.h,v 1.17 2012/07/27 05:36:10 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark Brinicombe.
@@ -49,6 +49,8 @@
 
 #define NIPL		8
 
+#define	IPL_SAFEPRI	_SPL_0
+
 #define	IST_UNUSABLE	-1	/* interrupt cannot be used */
 #define	IST_NONE	0	/* none (dummy) */
 #define	IST_PULSE	1	/* pulsed */

Index: src/sys/arch/luna68k/luna68k/machdep.c
diff -u src/sys/arch/luna68k/luna68k/machdep.c:1.89 src/sys/arch/luna68k/luna68k/machdep.c:1.90
--- src/sys/arch/luna68k/luna68k/machdep.c:1.89	Mon Dec 12 19:03:10 2011
+++ src/sys/arch/luna68k/luna68k/machdep.c	Fri Jul 27 05:36:10 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.89 2011/12/12 19:03:10 mrg Exp $ */
+/* $NetBSD: machdep.c,v 1.90 2012/07/27 05:36:10 matt Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.89 2011/12/12 19:03:10 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.90 2012/07/27 05:36:10 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -104,11 +104,6 @@ struct vm_map *phys_map = NULL;
 
 int	maxmem;			/* max memory per process */
 int	physmem;		/* set by locore */
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
 
 extern	u_int lowram;
 

Index: src/sys/arch/m68k/include/psl.h
diff -u src/sys/arch/m68k/include/psl.h:1.14 src/sys/arch/m68k/include/psl.h:1.15
--- src/sys/arch/m68k/include/psl.h:1.14	Wed May  6 21:37:40 2009
+++ src/sys/arch/m68k/include/psl.h	Fri Jul 27 05:36:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.14 2009/05/06 21:37:40 mhitch Exp $	*/
+/*	$NetBSD: psl.h,v 1.15 2012/07/27 05:36:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -69,6 +69,8 @@
 
 #if defined(_KERNEL) && !defined(_LOCORE)
 
+#define	IPL_SAFEPRI	PSL_LOWIPL	/* for kern_sleepq.c */
+
 /*
  * spl functions; platform-specific code must define spl0 and splx().
  */

Index: src/sys/arch/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.343 src/sys/arch/mac68k/mac68k/machdep.c:1.344
--- src/sys/arch/mac68k/mac68k/machdep.c:1.343	Fri Jan 27 18:52:57 2012
+++ src/sys/arch/mac68k/mac68k/machdep.c	Fri Jul 27 05:36:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.343 2012/01/27 18:52:57 para Exp $	*/
+/*	$NetBSD: machdep.c,v 1.344 2012/07/27 05:36:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.343 2012/01/27 18:52:57 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.344 2012/07/27 05:36:11 matt Exp $");
 
 #include "opt_adb.h"
 #include "opt_ddb.h"
@@ -194,12 +194,6 @@ int	maxmem;			/* max memory per process 
 int	physmem = MAXMEM;	/* max supported memory, changes to actual */
 
 /*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
-
-/*
  * Extent maps to manage all memory space, including I/O ranges.  Allocate
  * storage for 8 regions in each, initially.  Later, iomem_malloc_safe
  * will indicate that it's safe to use malloc() to dynamically allocate

Index: src/sys/arch/mvme68k/mvme68k/machdep.c
diff -u src/sys/arch/mvme68k/mvme68k/machdep.c:1.150 src/sys/arch/mvme68k/mvme68k/machdep.c:1.151
--- src/sys/arch/mvme68k/mvme68k/machdep.c:1.150	Mon Dec 12 19:03:10 2011
+++ src/sys/arch/mvme68k/mvme68k/machdep.c	Fri Jul 27 05:36:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.150 2011/12/12 19:03:10 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.151 2012/07/27 05:36:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.150 2011/12/12 19:03:10 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.151 2012/07/27 05:36:11 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_m060sp.h"
@@ -127,12 +127,6 @@ int	maxmem;			/* max memory per process 
 int	physmem;		/* size of physical memory */
 
 /*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
-
-/*
  * The driver for the ethernet chip appropriate to the
  * platform (lance or i82586) will use this variable
  * to size the chip's packet buffer.

Index: src/sys/arch/news68k/news68k/machdep.c
diff -u src/sys/arch/news68k/news68k/machdep.c:1.98 src/sys/arch/news68k/news68k/machdep.c:1.99
--- src/sys/arch/news68k/news68k/machdep.c:1.98	Mon Dec 12 19:03:11 2011
+++ src/sys/arch/news68k/news68k/machdep.c	Fri Jul 27 05:36:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.98 2011/12/12 19:03:11 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.99 2012/07/27 05:36:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.98 2011/12/12 19:03:11 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.99 2012/07/27 05:36:11 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -112,11 +112,6 @@ struct vm_map *phys_map = NULL;
 
 int	maxmem;			/* max memory per process */
 int	physmem = MAXMEM;	/* max supported memory, changes to actual */
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
 
 extern paddr_t avail_start, avail_end;
 extern int end, *esym;

Index: src/sys/arch/next68k/next68k/machdep.c
diff -u src/sys/arch/next68k/next68k/machdep.c:1.106 src/sys/arch/next68k/next68k/machdep.c:1.107
--- src/sys/arch/next68k/next68k/machdep.c:1.106	Mon Dec 12 19:03:11 2011
+++ src/sys/arch/next68k/next68k/machdep.c	Fri Jul 27 05:36:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.106 2011/12/12 19:03:11 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.107 2012/07/27 05:36:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1998 Darrin B. Jewell
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.106 2011/12/12 19:03:11 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.107 2012/07/27 05:36:11 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -132,12 +132,6 @@ paddr_t msgbufpa;		/* PA of message buff
 int	maxmem;			/* max memory per process */
 int	physmem;		/* size of physical memory */
 
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
-
 extern	u_int lowram;
 extern	short exframesize[];
 

Index: src/sys/arch/sparc/include/intr.h
diff -u src/sys/arch/sparc/include/intr.h:1.11 src/sys/arch/sparc/include/intr.h:1.12
--- src/sys/arch/sparc/include/intr.h:1.11	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/include/intr.h	Fri Jul 27 05:36:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.11 2008/04/28 20:23:36 martin Exp $ */
+/*	$NetBSD: intr.h,v 1.12 2012/07/27 05:36:11 matt Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -61,6 +61,12 @@
 
 #define	IPL_ZS		IPL_HIGH
 
+/*
+ * IPL_SAFEPRI is a safe priority for sleep to set for a spin-wait
+ * during autoconfiguration or after a panic.
+ */
+#define	IPL_SAFEPRI	0
+
 #if defined(_KERNEL) && !defined(_LOCORE)
 void *
 sparc_softintr_establish(int level, void (*fun)(void *), void *arg);

Index: src/sys/arch/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.319 src/sys/arch/sparc/sparc/machdep.c:1.320
--- src/sys/arch/sparc/sparc/machdep.c:1.319	Mon May 21 14:15:18 2012
+++ src/sys/arch/sparc/sparc/machdep.c	Fri Jul 27 05:36:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.319 2012/05/21 14:15:18 martin Exp $ */
+/*	$NetBSD: machdep.c,v 1.320 2012/07/27 05:36:12 matt Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.319 2012/05/21 14:15:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.320 2012/07/27 05:36:12 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
@@ -146,12 +146,6 @@ int	physmem;
 kmutex_t fpu_mtx;
 
 /*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int   safepri = 0;
-
-/*
  * dvmamap24 is used to manage DVMA memory for devices that have the upper
  * eight address bits wired to all-ones (e.g. `le' and `ie')
  */

Index: src/sys/arch/sparc64/include/intr.h
diff -u src/sys/arch/sparc64/include/intr.h:1.30 src/sys/arch/sparc64/include/intr.h:1.31
--- src/sys/arch/sparc64/include/intr.h:1.30	Wed Apr 13 03:24:28 2011
+++ src/sys/arch/sparc64/include/intr.h	Fri Jul 27 05:36:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.30 2011/04/13 03:24:28 mrg Exp $ */
+/*	$NetBSD: intr.h,v 1.31 2012/07/27 05:36:12 matt Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -56,6 +56,12 @@
 #define	IPL_PAUSE	13		/* pause cpu */
 #define	IPL_FDSOFT	PIL_FDSOFT	/* floppy */
 
+/*
+ * IPL_SAFEPRI is a safe priority for sleep to set for a spin-wait
+ * during autoconfiguration or after a panic.
+ */
+#define	IPL_SAFEPRI	IPL_NONE
+
 #ifndef _LOCORE
 void fpusave_lwp(struct lwp *, bool);
 #endif	/* _LOCORE */

Index: src/sys/arch/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.267 src/sys/arch/sparc64/sparc64/machdep.c:1.268
--- src/sys/arch/sparc64/sparc64/machdep.c:1.267	Mon May 21 14:15:18 2012
+++ src/sys/arch/sparc64/sparc64/machdep.c	Fri Jul 27 05:36:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.267 2012/05/21 14:15:18 martin Exp $ */
+/*	$NetBSD: machdep.c,v 1.268 2012/07/27 05:36:12 matt Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.267 2012/05/21 14:15:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.268 2012/07/27 05:36:12 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -169,12 +169,6 @@ extern	void *msgbufaddr;
 #define MAX_DMA_SEGS	20
 #endif
 
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int   safepri = 0;
-
 void	dumpsys(void);
 void	stackdump(void);
 

Index: src/sys/arch/sun2/sun2/machdep.c
diff -u src/sys/arch/sun2/sun2/machdep.c:1.72 src/sys/arch/sun2/sun2/machdep.c:1.73
--- src/sys/arch/sun2/sun2/machdep.c:1.72	Fri Jan 27 18:53:03 2012
+++ src/sys/arch/sun2/sun2/machdep.c	Fri Jul 27 05:36:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.72 2012/01/27 18:53:03 para Exp $	*/
+/*	$NetBSD: machdep.c,v 1.73 2012/07/27 05:36:12 matt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -149,7 +149,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.72 2012/01/27 18:53:03 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.73 2012/07/27 05:36:12 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -241,12 +241,6 @@ void *	msgbufaddr;
 /* Virtual page frame for /dev/mem (see mem.c) */
 vaddr_t vmmap;
 
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
-
 /* Soft copy of the enable register. */
 volatile u_short enable_reg_soft = ENABLE_REG_SOFT_UNDEF;
 

Index: src/sys/arch/sun3/sun3/machdep.c
diff -u src/sys/arch/sun3/sun3/machdep.c:1.204 src/sys/arch/sun3/sun3/machdep.c:1.205
--- src/sys/arch/sun3/sun3/machdep.c:1.204	Mon Dec 12 19:03:12 2011
+++ src/sys/arch/sun3/sun3/machdep.c	Fri Jul 27 05:36:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.204 2011/12/12 19:03:12 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.205 2012/07/27 05:36:12 matt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.204 2011/12/12 19:03:12 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.205 2012/07/27 05:36:12 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -159,12 +159,6 @@ void *	msgbufaddr;
 /* Virtual page frame for /dev/mem (see mem.c) */
 vaddr_t vmmap;
 
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
-
 /* Our private scratch page for dumping the MMU. */
 static vaddr_t dumppage;
 

Index: src/sys/arch/sun3/sun3x/machdep.c
diff -u src/sys/arch/sun3/sun3x/machdep.c:1.131 src/sys/arch/sun3/sun3x/machdep.c:1.132
--- src/sys/arch/sun3/sun3x/machdep.c:1.131	Mon Dec 12 19:03:12 2011
+++ src/sys/arch/sun3/sun3x/machdep.c	Fri Jul 27 05:36:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.131 2011/12/12 19:03:12 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.132 2012/07/27 05:36:12 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.131 2011/12/12 19:03:12 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.132 2012/07/27 05:36:12 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -119,12 +119,6 @@ void *	msgbufaddr;
 /* Virtual page frame for /dev/mem (see mem.c) */
 vaddr_t vmmap;
 
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
-
 u_char cpu_machine_id = 0;
 const char *cpu_string = NULL;
 int cpu_has_vme = 0;

Index: src/sys/arch/x68k/x68k/machdep.c
diff -u src/sys/arch/x68k/x68k/machdep.c:1.183 src/sys/arch/x68k/x68k/machdep.c:1.184
--- src/sys/arch/x68k/x68k/machdep.c:1.183	Wed May 16 07:32:30 2012
+++ src/sys/arch/x68k/x68k/machdep.c	Fri Jul 27 05:36:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.183 2012/05/16 07:32:30 isaki Exp $	*/
+/*	$NetBSD: machdep.c,v 1.184 2012/07/27 05:36:12 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.183 2012/05/16 07:32:30 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.184 2012/07/27 05:36:12 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -124,12 +124,6 @@ extern int end, *esym;
 int	maxmem;			/* max memory per process */
 int	physmem = MAXMEM;	/* max supported memory, changes to actual */
 
-/*
- * safepri is a safe priority for sleep to set for a spin-wait
- * during autoconfiguration or after a panic.
- */
-int	safepri = PSL_LOWIPL;
-
 /* prototypes for local functions */
 void	identifycpu(void);
 void	initcpu(void);

Index: src/sys/kern/kern_sleepq.c
diff -u src/sys/kern/kern_sleepq.c:1.46 src/sys/kern/kern_sleepq.c:1.47
--- src/sys/kern/kern_sleepq.c:1.46	Sun Feb 19 21:06:54 2012
+++ src/sys/kern/kern_sleepq.c	Fri Jul 27 05:36:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sleepq.c,v 1.46 2012/02/19 21:06:54 rmind Exp $	*/
+/*	$NetBSD: kern_sleepq.c,v 1.47 2012/07/27 05:36:13 matt Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -35,11 +35,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.46 2012/02/19 21:06:54 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.47 2012/07/27 05:36:13 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/cpu.h>
+#include <sys/intr.h>
 #include <sys/pool.h>
 #include <sys/proc.h> 
 #include <sys/resourcevar.h>
@@ -48,6 +49,19 @@ __KERNEL_RCSID(0, "$NetBSD: kern_sleepq.
 #include <sys/sleepq.h>
 #include <sys/ktrace.h>
 
+/*
+ * for sleepq_abort:
+ * During autoconfiguration or after a panic, a sleep will simply lower the
+ * priority briefly to allow interrupts, then return.  The priority to be
+ * used (IPL_SAFEPRI) is machine-dependent, thus this value is initialized and
+ * maintained in the machine-dependent layers.  This priority will typically
+ * be 0, or the lowest priority that is safe for use on the interrupt stack;
+ * it can be made higher to block network software interrupts after panics.
+ */
+#ifndef	IPL_SAFEPRI
+#define	IPL_SAFEPRI	0
+#endif
+
 static int	sleepq_sigtoerror(lwp_t *, int);
 
 /* General purpose sleep table, used by mtsleep() and condition variables. */
@@ -396,11 +410,10 @@ sleepq_sigtoerror(lwp_t *l, int sig)
 int
 sleepq_abort(kmutex_t *mtx, int unlock)
 { 
-	extern int safepri;
 	int s;
 
 	s = splhigh();
-	splx(safepri);
+	splx(IPL_SAFEPRI);
 	splx(s);
 	if (mtx != NULL && unlock != 0)
 		mutex_exit(mtx);

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.301 src/sys/kern/kern_synch.c:1.302
--- src/sys/kern/kern_synch.c:1.301	Sat Apr 21 22:38:25 2012
+++ src/sys/kern/kern_synch.c	Fri Jul 27 05:36:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.301 2012/04/21 22:38:25 rmind Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.302 2012/07/27 05:36:13 matt Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.301 2012/04/21 22:38:25 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.302 2012/07/27 05:36:13 matt Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -137,20 +137,6 @@ static struct evcnt	kpreempt_ev_crit	__c
 static struct evcnt	kpreempt_ev_klock	__cacheline_aligned;
 static struct evcnt	kpreempt_ev_immed	__cacheline_aligned;
 
-/*
- * During autoconfiguration or after a panic, a sleep will simply lower the
- * priority briefly to allow interrupts, then return.  The priority to be
- * used (safepri) is machine-dependent, thus this value is initialized and
- * maintained in the machine-dependent layers.  This priority will typically
- * be 0, or the lowest priority that is safe for use on the interrupt stack;
- * it can be made higher to block network software interrupts after panics.
- */
-#ifdef IPL_SAFEPRI
-int	safepri = IPL_SAFEPRI;
-#else
-int	safepri;
-#endif
-
 void
 synch_init(void)
 {

Reply via email to