Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | #ifndef _ASM_HW_IRQ_H |
2 | #define _ASM_HW_IRQ_H |
||
3 | |||
4 | /* |
||
5 | * linux/include/asm/hw_irq.h |
||
6 | * |
||
7 | * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar |
||
8 | * |
||
9 | * moved some of the old arch/i386/kernel/irq.h to here. VY |
||
10 | * |
||
11 | * IRQ/IPI changes taken from work by Thomas Radke |
||
12 | * <tomsoft@informatik.tu-chemnitz.de> |
||
13 | */ |
||
14 | |||
15 | #include <linux/config.h> |
||
16 | #include <linux/profile.h> |
||
17 | #include <asm/atomic.h> |
||
18 | #include <asm/irq.h> |
||
19 | #include <asm/sections.h> |
||
20 | |||
21 | /* |
||
22 | * Various low-level irq details needed by irq.c, process.c, |
||
23 | * time.c, io_apic.c and smp.c |
||
24 | * |
||
25 | * Interrupt entry/exit code at both C and assembly level |
||
26 | */ |
||
27 | |||
28 | extern u8 irq_vector[NR_IRQ_VECTORS]; |
||
29 | #define IO_APIC_VECTOR(irq) ((int)irq_vector[irq]) |
||
30 | |||
31 | extern void (*interrupt[NR_IRQS])(void); |
||
32 | |||
33 | #ifdef CONFIG_SMP |
||
34 | asmlinkage void reschedule_interrupt(void); |
||
35 | asmlinkage void invalidate_interrupt(void); |
||
36 | asmlinkage void call_function_interrupt(void); |
||
37 | #endif |
||
38 | |||
39 | #ifdef CONFIG_X86_LOCAL_APIC |
||
40 | asmlinkage void apic_timer_interrupt(void); |
||
41 | asmlinkage void error_interrupt(void); |
||
42 | asmlinkage void spurious_interrupt(void); |
||
43 | asmlinkage void thermal_interrupt(struct pt_regs); |
||
44 | #endif |
||
45 | |||
46 | void mask_irq(unsigned int irq); |
||
47 | void unmask_irq(unsigned int irq); |
||
48 | void disable_8259A_irq(unsigned int irq); |
||
49 | void enable_8259A_irq(unsigned int irq); |
||
50 | int i8259A_irq_pending(unsigned int irq); |
||
51 | void make_8259A_irq(unsigned int irq); |
||
52 | void init_8259A(int aeoi); |
||
53 | void FASTCALL(send_IPI_self(int vector)); |
||
54 | void init_VISWS_APIC_irqs(void); |
||
55 | void setup_IO_APIC(void); |
||
56 | void disable_IO_APIC(void); |
||
57 | void print_IO_APIC(void); |
||
58 | int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); |
||
59 | void send_IPI(int dest, int vector); |
||
60 | void setup_ioapic_dest(cpumask_t mask); |
||
61 | |||
62 | extern unsigned long io_apic_irqs; |
||
63 | |||
64 | extern atomic_t irq_err_count; |
||
65 | extern atomic_t irq_mis_count; |
||
66 | |||
67 | #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) |
||
68 | |||
69 | /* |
||
70 | * The profiling function is SMP safe. (nothing can mess |
||
71 | * around with "current", and the profiling counters are |
||
72 | * updated with atomic operations). This is especially |
||
73 | * useful with a profiling multiplier != 1 |
||
74 | */ |
||
75 | static inline void x86_do_profile(struct pt_regs * regs) |
||
76 | { |
||
77 | unsigned long eip; |
||
78 | extern unsigned long prof_cpu_mask; |
||
79 | |||
80 | profile_hook(regs); |
||
81 | |||
82 | if (user_mode(regs)) |
||
83 | return; |
||
84 | |||
85 | if (!prof_buffer) |
||
86 | return; |
||
87 | |||
88 | eip = regs->eip; |
||
89 | |||
90 | /* |
||
91 | * Only measure the CPUs specified by /proc/irq/prof_cpu_mask. |
||
92 | * (default is all CPUs.) |
||
93 | */ |
||
94 | if (!((1<<smp_processor_id()) & prof_cpu_mask)) |
||
95 | return; |
||
96 | |||
97 | eip -= (unsigned long)_stext; |
||
98 | eip >>= prof_shift; |
||
99 | /* |
||
100 | * Don't ignore out-of-bounds EIP values silently, |
||
101 | * put them into the last histogram slot, so if |
||
102 | * present, they will show up as a sharp peak. |
||
103 | */ |
||
104 | if (eip > prof_len-1) |
||
105 | eip = prof_len-1; |
||
106 | atomic_inc((atomic_t *)&prof_buffer[eip]); |
||
107 | } |
||
108 | |||
109 | #if defined(CONFIG_X86_IO_APIC) |
||
110 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) |
||
111 | { |
||
112 | if (IO_APIC_IRQ(i)) |
||
113 | send_IPI_self(IO_APIC_VECTOR(i)); |
||
114 | } |
||
115 | #else |
||
116 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} |
||
117 | #endif |
||
118 | |||
119 | #endif /* _ASM_HW_IRQ_H */ |