summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2005-03-02 10:55:56 +0000
committermarius <marius@FreeBSD.org>2005-03-02 10:55:56 +0000
commit23e41858b86816463c90700a995ce27b92c7896f (patch)
tree18f91e33a6b1844466278c27181215a80fc208e2
parent8ec4560902e824bd3ee45a2c3252b666d1ede6b3 (diff)
downloadFreeBSD-src-23e41858b86816463c90700a995ce27b92c7896f.zip
FreeBSD-src-23e41858b86816463c90700a995ce27b92c7896f.tar.gz
Assorted style fixes and minor changes:
- Use FBSDID. - Use uintXX_t instead of u_intXX_t. - Be consistent with white-space. - Mark some globals as static. - Add a missing prototype. - Remove a unused variable. - etc.
-rw-r--r--sys/sparc64/sparc64/intr_machdep.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c
index c9ba8ea..24e0187 100644
--- a/sys/sparc64/sparc64/intr_machdep.c
+++ b/sys/sparc64/sparc64/intr_machdep.c
@@ -56,10 +56,11 @@
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* form: src/sys/i386/isa/intr_machdep.c,v 1.57 2001/07/20
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/queue.h>
@@ -78,13 +79,13 @@
CTASSERT((1 << IV_SHIFT) == sizeof(struct intr_vector));
ih_func_t *intr_handlers[PIL_MAX];
-u_int16_t pil_countp[PIL_MAX];
+uint16_t pil_countp[PIL_MAX];
-struct intr_vector intr_vectors[IV_MAX];
-u_long intr_stray_count[IV_MAX];
-u_int16_t intr_countp[IV_MAX];
+struct intr_vector intr_vectors[IV_MAX];
+uint16_t intr_countp[IV_MAX];
+static u_long intr_stray_count[IV_MAX];
-char *pil_names[] = {
+static char *pil_names[] = {
"stray",
"low", /* PIL_LOW */
"ithrd", /* PIL_ITHREAD */
@@ -97,10 +98,11 @@ char *pil_names[] = {
};
/* protect the intr_vectors table */
-static struct mtx intr_table_lock;
+static struct mtx intr_table_lock;
-static void intr_stray_level(struct trapframe *tf);
-static void intr_stray_vector(void *cookie);
+static void intr_stray_level(struct trapframe *);
+static void intr_stray_vector(void *);
+static void update_intrname(int, const char *, int);
/*
* not MPSAFE
@@ -180,6 +182,7 @@ intr_setup(int pri, ih_func_t *ihf, int vec, iv_func_t *ivf, void *iva)
static void
intr_stray_level(struct trapframe *tf)
{
+
printf("stray level interrupt %ld\n", tf->tf_level);
}
@@ -241,8 +244,8 @@ inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
{
struct intr_vector *iv;
struct ithd *ithd; /* descriptor for the IRQ */
+ struct ithd *orphan;
int errcode = 0;
- int created_ithd = 0;
/*
* Work around a race where more than one CPU may be registering
@@ -260,11 +263,8 @@ inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
mtx_lock_spin(&intr_table_lock);
if (iv->iv_ithd == NULL) {
iv->iv_ithd = ithd;
- created_ithd++;
mtx_unlock_spin(&intr_table_lock);
} else {
- struct ithd *orphan;
-
orphan = ithd;
ithd = iv->iv_ithd;
mtx_unlock_spin(&intr_table_lock);
@@ -307,12 +307,11 @@ inthand_remove(int vec, void *cookie)
*/
iv = &intr_vectors[vec];
mtx_lock_spin(&intr_table_lock);
- if (iv->iv_ithd == NULL) {
+ if (iv->iv_ithd == NULL)
intr_setup(PIL_ITHREAD, intr_fast, vec,
intr_stray_vector, iv);
- } else {
+ else
intr_setup(PIL_LOW, intr_fast, vec, sched_ithd, iv);
- }
mtx_unlock_spin(&intr_table_lock);
}
return (error);
OpenPOWER on IntegriCloud