From a54595f215d4214fd4bf8611ab2de5ebb1cc5f69 Mon Sep 17 00:00:00 2001 From: jmg Date: Wed, 16 Jul 2003 00:08:43 +0000 Subject: add support for interrupt counting on sparc64. This copies part of the code from i386. The code has a slight bogon that interrupts are counted twice. Once on the ithread dispatch and once on the dispatch for the vector vmstat -i and systat -vm now contains interrupt counts. Reviewed by: jake --- sys/sparc64/include/asmacros.h | 11 +++++++++++ sys/sparc64/include/intr_machdep.h | 1 + 2 files changed, 12 insertions(+) (limited to 'sys/sparc64/include') diff --git a/sys/sparc64/include/asmacros.h b/sys/sparc64/include/asmacros.h index 2fd5143..a0e317b 100644 --- a/sys/sparc64/include/asmacros.h +++ b/sys/sparc64/include/asmacros.h @@ -69,6 +69,17 @@ mov r3, r2 /* + * Atomically increment an u_long in memory. + */ +#define ATOMIC_INC_ULONG(r1, r2, r3) \ + ldx [r1], r2 ; \ +9: add r2, 1, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ + mov r3, r2 + +/* * Atomically clear a number of bits of an integer in memory. */ #define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ diff --git a/sys/sparc64/include/intr_machdep.h b/sys/sparc64/include/intr_machdep.h index 2f9c1ef..9d29730 100644 --- a/sys/sparc64/include/intr_machdep.h +++ b/sys/sparc64/include/intr_machdep.h @@ -33,6 +33,7 @@ #define PIL_MAX (1 << 4) #define IV_MAX (1 << 11) +#define IV_NAMLEN 1024 #define IR_FREE (PIL_MAX * 2) -- cgit v1.1