1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*- */
6 * The flat IRQ space is divided into two regions:
7 * 1. A one-to-one mapping of real physical IRQs. This space is only used
8 * if we have physical device-access privilege. This region is at the
9 * start of the IRQ space so that existing device drivers do not need
10 * to be modified to translate physical IRQ numbers into our IRQ space.
11 * 3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These
12 * are bound using the provided bind/unbind functions.
18 #define DYNIRQ_BASE (PIRQ_BASE + NR_PIRQS)
19 #define NR_DYNIRQS 128
21 #define NR_IRQS (NR_PIRQS + NR_DYNIRQS)
23 #define pirq_to_irq(_x) ((_x) + PIRQ_BASE)
24 #define irq_to_pirq(_x) ((_x) - PIRQ_BASE)
26 #define dynirq_to_irq(_x) ((_x) + DYNIRQ_BASE)
27 #define irq_to_dynirq(_x) ((_x) - DYNIRQ_BASE)
29 /* Dynamic binding of event channels and VIRQ sources to Linux IRQ space. */
30 extern void unbind_from_irq(int irq);
32 extern int bind_caller_port_to_irqhandler(unsigned int caller_port,
33 const char *devname, driver_intr_t handler, void *arg,
34 unsigned long irqflags, void **cookiep);
35 extern int bind_listening_port_to_irqhandler(unsigned int remote_domain,
36 const char *devname, driver_intr_t handler, void *arg, unsigned long irqflags,
38 extern int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, const char *devname,
39 driver_intr_t handler, unsigned long irqflags);
40 extern int bind_ipi_to_irqhandler(unsigned int ipi,
43 driver_intr_t handler,
44 unsigned long irqflags);
46 extern int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
47 unsigned int remote_port,
49 driver_intr_t handler,
50 unsigned long irqflags);
54 extern void unbind_from_irqhandler(unsigned int evtchn, void *dev_id);
55 static __inline__ int irq_cannonicalize(int irq)
57 return (irq == 2) ? 9 : irq;
60 extern void disable_irq(unsigned int);
61 extern void disable_irq_nosync(unsigned int);
62 extern void enable_irq(unsigned int);
64 extern void irq_suspend(void);
65 extern void irq_resume(void);
67 extern void idle_block(void);
68 extern int ap_cpu_initclocks(int cpu);
70 #endif /* _XEN_INTR_H_ */