ia64/xen-unstable

view xen/include/asm-x86/irq.h @ 19197:9e3be0660c1e

Cleanup naming for ia64 and x86 interrupt handling functions

- Append '_IRQ' to AUTO_ASSIGN, NEVER_ASSIGN, and FREE_TO_ASSIGN
- Rename {request,setup}_irq to {request,setup}_irq_vector
- Rename free_irq to release_irq_vector
- Add {request,setup,release}_irq wrappers for their
{request,setup,release}_irq_vector counterparts
- Added generic irq_to_vector inline for ia64
- Changed ia64 to use the new naming scheme

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 12 10:48:55 2009 +0000 (2009-02-12)
parents e15d25401309
children 1695a86b3d7c
line source
1 #ifndef _ASM_HW_IRQ_H
2 #define _ASM_HW_IRQ_H
4 /* (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar */
6 #include <xen/config.h>
7 #include <asm/atomic.h>
8 #include <irq_vectors.h>
10 #define IO_APIC_IRQ(irq) (((irq) >= 16) || ((1<<(irq)) & io_apic_irqs))
11 #define IO_APIC_VECTOR(irq) (irq_vector[irq])
13 #define LEGACY_VECTOR(irq) ((irq) + FIRST_LEGACY_VECTOR)
14 #define LEGACY_IRQ_FROM_VECTOR(vec) ((vec) - FIRST_LEGACY_VECTOR)
16 #define irq_to_vector(irq) \
17 (IO_APIC_IRQ(irq) ? IO_APIC_VECTOR(irq) : LEGACY_VECTOR(irq))
18 #define vector_to_irq(vec) (vector_irq[vec])
20 extern int vector_irq[NR_VECTORS];
21 extern u8 irq_vector[NR_IRQS];
23 #define platform_legacy_irq(irq) ((irq) < 16)
25 fastcall void event_check_interrupt(void);
26 fastcall void invalidate_interrupt(void);
27 fastcall void call_function_interrupt(void);
28 fastcall void apic_timer_interrupt(void);
29 fastcall void error_interrupt(void);
30 fastcall void pmu_apic_interrupt(void);
31 fastcall void spurious_interrupt(void);
32 fastcall void thermal_interrupt(void);
33 fastcall void cmci_interrupt(void);
35 void disable_8259A_irq(unsigned int irq);
36 void enable_8259A_irq(unsigned int irq);
37 int i8259A_irq_pending(unsigned int irq);
38 void init_8259A(int aeoi);
39 int i8259A_suspend(void);
40 int i8259A_resume(void);
42 void setup_IO_APIC(void);
43 void disable_IO_APIC(void);
44 void print_IO_APIC(void);
45 void setup_ioapic_dest(void);
47 extern unsigned long io_apic_irqs;
49 extern atomic_t irq_err_count;
50 extern atomic_t irq_mis_count;
52 int pirq_shared(struct domain *d , int irq);
54 int map_domain_pirq(struct domain *d, int pirq, int vector, int type,
55 void *data);
56 int unmap_domain_pirq(struct domain *d, int pirq);
57 int get_free_pirq(struct domain *d, int type, int index);
58 void free_domain_pirqs(struct domain *d);
60 #define domain_irq_to_vector(d, irq) ((d)->arch.pirq_vector[irq] ?: \
61 IO_APIC_IRQ(irq) ? 0 : LEGACY_VECTOR(irq))
62 #define domain_vector_to_irq(d, vec) ((d)->arch.vector_pirq[vec] ?: \
63 ((vec) < FIRST_LEGACY_VECTOR || \
64 (vec) > LAST_LEGACY_VECTOR) ? \
65 0 : LEGACY_IRQ_FROM_VECTOR(vec))
67 int pirq_guest_force_unbind(struct domain *d, int irq);
69 #endif /* _ASM_HW_IRQ_H */