diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-08-06 21:05:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-08-06 21:05:51 +0000 |
commit | 1aa4c63de5d4385b4e4c5bf0a5ad52eb1a0c729e (patch) | |
tree | 8dafa57f09118e9492be97bb7eb20a27b6f1b61f | |
parent | 01fe942fb8b37e9470c5963551efebfd980db1c1 (diff) |
Only compile RM7000 performance counter support if defined(RM7K_PERFCNTR).
This code needs to be cleaned up, and made more generic to work with other
processors counters as well.
-rw-r--r-- | sys/arch/mips64/mips64/interrupt.c | 4 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/trap.c | 10 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/machdep.c | 6 |
3 files changed, 15 insertions, 5 deletions
diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c index 16e5c79ce89..97aaedc3519 100644 --- a/sys/arch/mips64/mips64/interrupt.c +++ b/sys/arch/mips64/mips64/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.40 2009/06/10 18:05:31 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.41 2009/08/06 21:05:49 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -165,10 +165,12 @@ interrupt(struct trap_frame *trapframe) soft_count.ec_count++; } +#ifdef RM7K_PERFCNTR if (cause & CR_INT_PERF) { rm7k_perfintr(trapframe); cause &= ~CR_INT_PERF; } +#endif for (i = 0; i <= last_low_int; i++) { intrmask_t active; diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index 3cb3ce5b097..a0f44b6bd86 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.43 2009/06/10 18:05:31 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.44 2009/08/06 21:05:49 miod Exp $ */ /* tracked to 1.23 */ /* @@ -712,10 +712,12 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr if ((int)trapframe->cause & CR_BR_DELAY) va += 4; printf("watch exception @ %p\n", va); +#ifdef RM7K_PERFCNTR if (rm7k_watchintr(trapframe)) { /* Return to user, don't add any more overhead */ return; } +#endif i = SIGTRAP; typ = TRAP_BRKPT; break; @@ -739,6 +741,7 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr } else { locr0->pc += 4; } +#ifdef RM7K_PERFCNTR if (instr == 0x040c0000) { /* Performance cntr trap */ int result; @@ -747,8 +750,9 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr locr0->v0 = -result; /* Return to user, don't add any more overhead */ return; - } - else { + } else +#endif + { i = SIGEMT; /* Stuff it with something for now */ typ = 0; } diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c index af07a9de93b..3cb3c3c2679 100644 --- a/sys/arch/sgi/sgi/machdep.c +++ b/sys/arch/sgi/sgi/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.76 2009/08/02 16:28:39 beck Exp $ */ +/* $OpenBSD: machdep.c,v 1.77 2009/08/06 21:05:50 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -1137,6 +1137,8 @@ atoi(const char *s, int b, const char **o) return val; } +#ifdef RM7K_PERFCNTR + /* * RM7000 Performance counter support. */ @@ -1206,6 +1208,8 @@ rm7k_watchintr(trapframe) return(0); } +#endif /* RM7K_PERFCNTR */ + #ifdef DEBUG /* * Dump TLB contents. |