summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/disp/thread.c21
-rw-r--r--usr/src/uts/common/io/avintr.c4
-rw-r--r--usr/src/uts/common/sys/avintr.h4
-rw-r--r--usr/src/uts/common/sys/cpuvar.h14
4 files changed, 18 insertions, 25 deletions
diff --git a/usr/src/uts/common/disp/thread.c b/usr/src/uts/common/disp/thread.c
index 2b45b8d8ab..740d247672 100644
--- a/usr/src/uts/common/disp/thread.c
+++ b/usr/src/uts/common/disp/thread.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1708,25 +1708,6 @@ tsd_realloc(void *old, size_t osize, size_t nsize)
}
/*
- * Check to see if an interrupt thread might be active at a given ipl.
- * If so return true.
- * We must be conservative--it is ok to give a false yes, but a false no
- * will cause disaster. (But if the situation changes after we check it is
- * ok--the caller is trying to ensure that an interrupt routine has been
- * exited).
- * This is used when trying to remove an interrupt handler from an autovector
- * list in avintr.c.
- */
-int
-intr_active(struct cpu *cp, int level)
-{
- if (level <= LOCK_LEVEL)
- return (cp->cpu_thread != cp->cpu_dispthread);
- else
- return (CPU_ON_INTR(cp));
-}
-
-/*
* Return non-zero if an interrupt is being serviced.
*/
int
diff --git a/usr/src/uts/common/io/avintr.c b/usr/src/uts/common/io/avintr.c
index 30ef137660..43b6c1025b 100644
--- a/usr/src/uts/common/io/avintr.c
+++ b/usr/src/uts/common/io/avintr.c
@@ -476,7 +476,7 @@ rem_avintr(void *intr_id, int lvl, avfunc xxintr, int vect)
* seen each cpu not executing an interrupt at that level--so we know our
* change has taken effect completely (no old state in registers, etc).
*/
-void
+static void
wait_till_seen(int ipl)
{
int cpu_in_chain, cix;
@@ -489,7 +489,7 @@ wait_till_seen(int ipl)
for (cix = 0; cix < NCPU; cix++) {
cpup = cpu[cix];
if (cpup != NULL && CPU_IN_SET(cpus_to_check, cix)) {
- if (intr_active(cpup, ipl)) {
+ if (INTR_ACTIVE(cpup, ipl)) {
cpu_in_chain = 1;
} else {
CPUSET_DEL(cpus_to_check, cix);
diff --git a/usr/src/uts/common/sys/avintr.h b/usr/src/uts/common/sys/avintr.h
index 05078c36cd..28b95fb348 100644
--- a/usr/src/uts/common/sys/avintr.h
+++ b/usr/src/uts/common/sys/avintr.h
@@ -19,14 +19,13 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_AVINTR_H
#define _SYS_AVINTR_H
-#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mutex.h>
#include <sys/dditypes.h>
@@ -97,7 +96,6 @@ extern int rem_avsoftintr(void *intr_id, int lvl, avfunc xxintr);
extern int av_softint_movepri(void *intr_id, int old_lvl);
extern void update_avsoftintr_args(void *intr_id, int lvl, caddr_t arg2);
extern void rem_avintr(void *intr_id, int lvl, avfunc xxintr, int vect);
-extern void wait_till_seen(int ipl);
extern uint_t softlevel1(caddr_t, caddr_t);
#endif /* _KERNEL */
diff --git a/usr/src/uts/common/sys/cpuvar.h b/usr/src/uts/common/sys/cpuvar.h
index 99829bbb03..1493aa6a33 100644
--- a/usr/src/uts/common/sys/cpuvar.h
+++ b/usr/src/uts/common/sys/cpuvar.h
@@ -268,6 +268,20 @@ extern cpu_core_t cpu_core[];
#define CPU_ON_INTR(cpup) ((cpup)->cpu_intr_actv >> (LOCK_LEVEL + 1))
/*
+ * Check to see if an interrupt thread might be active at a given ipl.
+ * If so return true.
+ * We must be conservative--it is ok to give a false yes, but a false no
+ * will cause disaster. (But if the situation changes after we check it is
+ * ok--the caller is trying to ensure that an interrupt routine has been
+ * exited).
+ * This is used when trying to remove an interrupt handler from an autovector
+ * list in avintr.c.
+ */
+#define INTR_ACTIVE(cpup, level) \
+ ((level) <= LOCK_LEVEL ? \
+ ((cpup)->cpu_intr_actv & (1 << (level))) : (CPU_ON_INTR(cpup)))
+
+/*
* CPU_PSEUDO_RANDOM() returns a per CPU value that changes each time one
* looks at it. It's meant as a cheap mechanism to be incorporated in routines
* wanting to avoid biasing, but where true randomness isn't needed (just