summaryrefslogtreecommitdiff
path: root/sys/arch/sh
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-06-21 04:37:57 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-06-21 04:37:57 +0000
commit8853e41b7e3ebda92f64465057e72c9f526265f4 (patch)
treef9db7dd53d7cf3ba49e0da780bb0569128d9d73e /sys/arch/sh
parenta25346361a07d79ee61cfa9f2128efbacfc6ca14 (diff)
Attach interrupt counters to intc interrupt sources too, so that clock
interrupts get counted; from mickey
Diffstat (limited to 'sys/arch/sh')
-rw-r--r--sys/arch/sh/include/intr.h5
-rw-r--r--sys/arch/sh/sh/interrupt.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/sys/arch/sh/include/intr.h b/sys/arch/sh/include/intr.h
index 6fdf1e7caf8..e5b4cc0a787 100644
--- a/sys/arch/sh/include/intr.h
+++ b/sys/arch/sh/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.3 2007/05/10 17:59:26 deraadt Exp $ */
+/* $OpenBSD: intr.h,v 1.4 2007/06/21 04:37:54 miod Exp $ */
/* $NetBSD: intr.h,v 1.22 2006/01/24 23:51:42 uwe Exp $ */
/*-
@@ -74,8 +74,9 @@ struct intc_intrhand {
int ih_level; /* SR.I[0:3] value */
int ih_evtcode; /* INTEVT or INTEVT2(SH7709/SH7709A) */
int ih_idx; /* evtcode -> intrhand mapping */
+ int ih_irq;
struct evcount ih_count;
- char *ih_name;
+ const char *ih_name;
};
/* from 0x200 by 0x20 -> from 0 by 1 */
diff --git a/sys/arch/sh/sh/interrupt.c b/sys/arch/sh/sh/interrupt.c
index fb09a5dee27..6003214b62c 100644
--- a/sys/arch/sh/sh/interrupt.c
+++ b/sys/arch/sh/sh/interrupt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interrupt.c,v 1.6 2007/05/29 18:10:43 miod Exp $ */
+/* $OpenBSD: interrupt.c,v 1.7 2007/06/21 04:37:56 miod Exp $ */
/* $NetBSD: interrupt.c,v 1.18 2006/01/25 00:02:57 uwe Exp $ */
/*-
@@ -138,7 +138,11 @@ intc_intr_establish(int evtcode, int trigger, int level,
ih->ih_arg = ih_arg;
ih->ih_level = level << 4; /* convert to SR.IMASK format. */
ih->ih_evtcode = evtcode;
- ih->ih_name = (char *)name; /* XXX strdup? */
+ ih->ih_irq = evtcode >> 5;
+ ih->ih_name = name;
+ if (name)
+ evcount_attach(&ih->ih_count, name, (void *)&ih->ih_irq,
+ &evcount_intr);
/* Map interrupt handler */
EVTCODE_TO_IH_INDEX(evtcode) = ih->ih_idx;
@@ -163,6 +167,8 @@ intc_intr_disestablish(void *arg)
/* Unmap interrupt handler */
EVTCODE_TO_IH_INDEX(evtcode) = 0;
+ if (ih->ih_name)
+ evcount_detach(&ih->ih_count);
intc_free_ih(ih);
}