From 21bc8faa446b20edb610c7f2c2e9500fa0bca2f9 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 23 Dec 2004 20:34:18 +0000 Subject: [PATCH] Add a simple 'intrcnt_add' function that other MD code can use to add a single named counter to the interrupt counts without having to fake up an entire interrupt source. --- sys/i386/i386/intr_machdep.c | 11 +++++++++++ sys/i386/include/intr_machdep.h | 1 + 2 files changed, 12 insertions(+) diff --git a/sys/i386/i386/intr_machdep.c b/sys/i386/i386/intr_machdep.c index 97a3748979b9..0c5f6af80e44 100644 --- a/sys/i386/i386/intr_machdep.c +++ b/sys/i386/i386/intr_machdep.c @@ -286,6 +286,17 @@ intrcnt_register(struct intsrc *is) is->is_straycount = &intrcnt[is->is_index + 1]; } +void +intrcnt_add(const char *name, u_long **countp) +{ + + mtx_lock_spin(&intr_table_lock); + *countp = &intrcnt[intrcnt_index]; + intrcnt_setname(name, intrcnt_index); + intrcnt_index++; + mtx_unlock_spin(&intr_table_lock); +} + static void intr_init(void *dummy __unused) { diff --git a/sys/i386/include/intr_machdep.h b/sys/i386/include/intr_machdep.h index af9e6725287e..a9880636a302 100644 --- a/sys/i386/include/intr_machdep.h +++ b/sys/i386/include/intr_machdep.h @@ -100,6 +100,7 @@ int intr_register_source(struct intsrc *isrc); int intr_remove_handler(void *cookie); void intr_resume(void); void intr_suspend(void); +void intrcnt_add(const char *name, u_long **countp); #endif /* !LOCORE */ #endif /* _KERNEL */