import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / alpha / kernel / irq_impl.h
1 /*
2  *      linux/arch/alpha/kernel/irq_impl.h
3  *
4  *      Copyright (C) 1995 Linus Torvalds
5  *      Copyright (C) 1998, 2000 Richard Henderson
6  *
7  * This file contains declarations and inline functions for interfacing
8  * with the IRQ handling routines in irq.c.
9  */
10
11 #include <linux/interrupt.h>
12 #include <linux/irq.h>
13
14
15 #define RTC_IRQ    8
16
17 extern void isa_device_interrupt(unsigned long, struct pt_regs *);
18 extern void isa_no_iack_sc_device_interrupt(unsigned long, struct pt_regs *);
19 extern void srm_device_interrupt(unsigned long, struct pt_regs *);
20 extern void pyxis_device_interrupt(unsigned long, struct pt_regs *);
21
22 extern struct irqaction timer_irqaction;
23 extern struct irqaction isa_cascade_irqaction;
24 extern struct irqaction timer_cascade_irqaction;
25 extern struct irqaction halt_switch_irqaction;
26
27 extern void init_srm_irqs(long, unsigned long);
28 extern void init_pyxis_irqs(unsigned long);
29 extern void init_rtc_irq(void);
30
31 extern void common_init_isa_dma(void);
32
33 extern void i8259a_enable_irq(unsigned int);
34 extern void i8259a_disable_irq(unsigned int);
35 extern void i8259a_mask_and_ack_irq(unsigned int);
36 extern unsigned int i8259a_startup_irq(unsigned int);
37 extern void i8259a_end_irq(unsigned int);
38 extern struct hw_interrupt_type i8259a_irq_type;
39 extern void init_i8259a_irqs(void);
40
41 extern void handle_irq(int irq, struct pt_regs * regs);
42
43 extern unsigned long prof_cpu_mask;
44
45 static inline void
46 alpha_do_profile(unsigned long pc)
47 {
48         extern char _stext;
49
50         if (!prof_buffer)
51                 return;
52
53         /*
54          * Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
55          * (default is all CPUs.)
56          */
57         if (!((1<<smp_processor_id()) & prof_cpu_mask))
58                 return;
59
60         pc -= (unsigned long) &_stext;
61         pc >>= prof_shift;
62         /*
63          * Don't ignore out-of-bounds PC values silently,
64          * put them into the last histogram slot, so if
65          * present, they will show up as a sharp peak.
66          */
67         if (pc > prof_len - 1)
68                 pc = prof_len - 1;
69         atomic_inc((atomic_t *)&prof_buffer[pc]);
70 }