Messages in this thread Patch in this message | | | Date | Mon, 3 Aug 1998 10:16:38 -0400 (EDT) | From | Phillip Ezolt <> | Subject | Alpha Performance Counters Try 2. |
| |
Hi, Last week I posted patches to enable use of the Alpha/Performance counters on Linux. After some immensely helpful suggestions / modifications from Richard Henderson, I have the following patch. (Much cleaner and simpler than the original patch.)
Once again, it adds the wrperfmon call to alpha system.h. Currently it simply exports a function pointer which contains the address of the handler for performance interrupt. The user can change that value to whatever function he/she chooses.
Cheers, Phil
diff -u --recursive --new-file linux/arch/alpha/kernel/alpha_ksyms.c linux-perf/arch/alpha/kernel/alpha_ksyms.c --- linux/arch/alpha/kernel/alpha_ksyms.c Mon Jul 20 19:00:02 1998 +++ linux-perf/arch/alpha/kernel/alpha_ksyms.c Fri Jul 31 08:57:55 1998 @@ -48,6 +48,7 @@ EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL(screen_info); +EXPORT_SYMBOL(perf_irq); /* platform dependent support */ EXPORT_SYMBOL(_inb); diff -u --recursive --new-file linux/arch/alpha/kernel/irq.c linux-perf/arch/alpha/kernel/irq.c --- linux/arch/alpha/kernel/irq.c Wed Jun 24 17:30:08 1998 +++ linux-perf/arch/alpha/kernel/irq.c Fri Jul 31 11:46:59 1998 @@ -116,6 +116,15 @@ #define IRQ_TO_MASK(irq) (irq) #endif /* CONFIG_ALPHA_SABLE */ + + +static void dummy_perf(unsigned long vector, struct pt_regs *regs) +{ + printk(KERN_CRIT "Performance counter interrupt!\n"); +} + +void (*perf_irq)(unsigned long, struct pt_regs *) = dummy_perf; + /* * Update the hardware with the irq mask passed in MASK. The function * exploits the fact that it is known that only bit IRQ has changed. @@ -1753,8 +1762,8 @@ #endif return; case 4: - printk("Performance counter interrupt\n"); - break; + perf_irq(vector, ®s); + return; default: printk("Hardware intr %ld %lx? Huh?\n", type, vector); } diff -u --recursive --new-file linux/include/asm-alpha/irq.h linux-perf/include/asm-alpha/irq.h --- linux/include/asm-alpha/irq.h Sat Apr 18 01:04:44 1998 +++ linux-perf/include/asm-alpha/irq.h Fri Jul 31 11:24:18 1998 @@ -64,4 +64,6 @@ extern void disable_irq(unsigned int); extern void enable_irq(unsigned int); +extern void (*perf_irq)(unsigned long, struct pt_regs *); + #endif diff -u --recursive --new-file linux/include/asm-alpha/system.h linux-perf/include/asm-alpha/system.h --- linux/include/asm-alpha/system.h Mon Mar 30 03:21:41 1998 +++ linux-perf/include/asm-alpha/system.h Fri Jul 31 14:34:31 1998 @@ -114,6 +114,22 @@ #define draina() \ __asm__ __volatile__ ("call_pal %0" : : "i" (PAL_draina) : "memory") +static inline unsigned long +wrperfmon(unsigned long perf_fun, unsigned long arg) +{ + register unsigned long __r0 __asm__("$0"); + register unsigned long __r16 __asm__("$16"); + register unsigned long __r17 __asm__("$17"); + __r16 = perf_fun; + __r17 = arg; + __asm__ __volatile__("call_pal %1" + : "=r"(__r0) + : "i"(PAL_wrperfmon), "r"(__r16), "r"(__r17) + : "$1", "$22", "$23", "$24", "$25", "$26"); + return __r0; +} + + #define call_pal1(palno,arg) \ ({ \ register unsigned long __r0 __asm__("$0"); \
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |