1 /******************************************************************************
4 * Communication via Xen event channels.
6 * Copyright (c) 2002-2005, K A Fraser
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation; or, when distributed
11 * separately from the Linux kernel or incorporated into other
12 * software packages, subject to the following license:
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this source file (the "Software"), to deal in the Software without
16 * restriction, including without limitation the rights to use, copy, modify,
17 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18 * and to permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
33 #include <linux/config.h>
34 #include <linux/module.h>
35 #include <linux/irq.h>
36 #include <linux/interrupt.h>
37 #include <linux/sched.h>
38 #include <linux/kernel_stat.h>
39 #include <linux/version.h>
40 #include <asm/atomic.h>
41 #include <asm/system.h>
42 #include <asm/ptrace.h>
43 #include <asm/synch_bitops.h>
44 #include <xen/evtchn.h>
45 #include <xen/interface/event_channel.h>
46 #include <xen/interface/physdev.h>
47 #include <asm/hypervisor.h>
48 #include <linux/mc146818rtc.h> /* RTC_IRQ */
51 * This lock protects updates to the following mapping and reference-count
52 * arrays. The lock does not need to be acquired to read the mapping tables.
54 static DEFINE_SPINLOCK(irq_mapping_update_lock);
56 /* IRQ <-> event-channel mappings. */
57 static int evtchn_to_irq[NR_EVENT_CHANNELS] = {
58 [0 ... NR_EVENT_CHANNELS-1] = -1 };
60 /* Packed IRQ information: binding type, sub-type index, and event channel. */
61 static u32 irq_info[NR_IRQS];
64 enum { IRQT_UNBOUND, IRQT_PIRQ, IRQT_VIRQ, IRQT_IPI, IRQT_EVTCHN };
66 /* Constructor for packed IRQ information. */
67 static inline u32 mk_irq_info(u32 type, u32 index, u32 evtchn)
69 return ((type << 24) | (index << 16) | evtchn);
72 /* Convenient shorthand for packed representation of an unbound IRQ. */
73 #define IRQ_UNBOUND mk_irq_info(IRQT_UNBOUND, 0, 0)
76 * Accessors for packed IRQ information.
79 static inline unsigned int evtchn_from_irq(int irq)
81 return (u16)(irq_info[irq]);
84 static inline unsigned int index_from_irq(int irq)
86 return (u8)(irq_info[irq] >> 16);
89 static inline unsigned int type_from_irq(int irq)
91 return (u8)(irq_info[irq] >> 24);
94 /* IRQ <-> VIRQ mapping. */
95 DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]) = {[0 ... NR_VIRQS-1] = -1};
97 /* IRQ <-> IPI mapping. */
101 DEFINE_PER_CPU(int, ipi_to_irq[NR_IPIS]) = {[0 ... NR_IPIS-1] = -1};
103 /* Reference counts for bindings to IRQs. */
104 static int irq_bindcount[NR_IRQS];
106 /* Bitmap indicating which PIRQs require Xen to be notified on unmask. */
107 static unsigned long pirq_needs_eoi[NR_PIRQS/sizeof(unsigned long)];
111 static u8 cpu_evtchn[NR_EVENT_CHANNELS];
112 static unsigned long cpu_evtchn_mask[NR_CPUS][NR_EVENT_CHANNELS/BITS_PER_LONG];
114 static inline unsigned long active_evtchns(unsigned int cpu, shared_info_t *sh,
117 return (sh->evtchn_pending[idx] &
118 cpu_evtchn_mask[cpu][idx] &
119 ~sh->evtchn_mask[idx]);
122 static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
124 int irq = evtchn_to_irq[chn];
127 set_native_irq_info(irq, cpumask_of_cpu(cpu));
129 clear_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu_evtchn[chn]]);
130 set_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu]);
131 cpu_evtchn[chn] = cpu;
134 static void init_evtchn_cpu_bindings(void)
138 /* By default all event channels notify CPU#0. */
139 for (i = 0; i < NR_IRQS; i++)
140 set_native_irq_info(i, cpumask_of_cpu(0));
142 memset(cpu_evtchn, 0, sizeof(cpu_evtchn));
143 memset(cpu_evtchn_mask[0], ~0, sizeof(cpu_evtchn_mask[0]));
146 static inline unsigned int cpu_from_evtchn(unsigned int evtchn)
148 return cpu_evtchn[evtchn];
153 static inline unsigned long active_evtchns(unsigned int cpu, shared_info_t *sh,
156 return (sh->evtchn_pending[idx] & ~sh->evtchn_mask[idx]);
159 static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
163 static void init_evtchn_cpu_bindings(void)
167 static inline unsigned int cpu_from_evtchn(unsigned int evtchn)
174 /* Upcall to generic IRQ layer. */
176 extern fastcall unsigned int do_IRQ(struct pt_regs *regs);
177 void __init xen_init_IRQ(void);
178 void __init init_IRQ(void)
183 #if defined (__i386__)
184 static inline void exit_idle(void) {}
185 #define IRQ_REG orig_eax
186 #elif defined (__x86_64__)
187 #include <asm/idle.h>
188 #define IRQ_REG orig_rax
190 #define do_IRQ(irq, regs) do { \
191 (regs)->IRQ_REG = ~(irq); \
196 /* Xen will never allocate port zero for any purpose. */
197 #define VALID_EVTCHN(chn) ((chn) != 0)
200 * Force a proper event-channel callback from Xen after clearing the
201 * callback mask. We do this in a very simple manner, by making a call
202 * down into Xen. The pending flag will be checked by Xen on return.
204 void force_evtchn_callback(void)
206 (void)HYPERVISOR_xen_version(0, NULL);
208 /* Not a GPL symbol: used in ubiquitous macros, so too restrictive. */
209 EXPORT_SYMBOL(force_evtchn_callback);
211 /* NB. Interrupts are disabled on entry. */
212 asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
214 unsigned long l1, l2;
215 unsigned int l1i, l2i, port;
216 int irq, cpu = smp_processor_id();
217 shared_info_t *s = HYPERVISOR_shared_info;
218 vcpu_info_t *vcpu_info = &s->vcpu_info[cpu];
220 vcpu_info->evtchn_upcall_pending = 0;
222 #ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */
223 /* Clear master pending flag /before/ clearing selector flag. */
226 l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
231 while ((l2 = active_evtchns(cpu, s, l1i)) != 0) {
234 port = (l1i * BITS_PER_LONG) + l2i;
235 if ((irq = evtchn_to_irq[port]) != -1)
239 evtchn_device_upcall(port);
245 static int find_unbound_irq(void)
249 /* Only allocate from dynirq range */
250 for (irq = DYNIRQ_BASE; irq < NR_IRQS; irq++)
251 if (irq_bindcount[irq] == 0)
255 panic("No available IRQ to bind to: increase NR_IRQS!\n");
260 static int bind_evtchn_to_irq(unsigned int evtchn)
264 spin_lock(&irq_mapping_update_lock);
266 if ((irq = evtchn_to_irq[evtchn]) == -1) {
267 irq = find_unbound_irq();
268 evtchn_to_irq[evtchn] = irq;
269 irq_info[irq] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);
272 irq_bindcount[irq]++;
274 spin_unlock(&irq_mapping_update_lock);
279 static int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
281 struct evtchn_bind_virq bind_virq;
284 spin_lock(&irq_mapping_update_lock);
286 if ((irq = per_cpu(virq_to_irq, cpu)[virq]) == -1) {
287 bind_virq.virq = virq;
288 bind_virq.vcpu = cpu;
289 if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq,
292 evtchn = bind_virq.port;
294 irq = find_unbound_irq();
295 evtchn_to_irq[evtchn] = irq;
296 irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
298 per_cpu(virq_to_irq, cpu)[virq] = irq;
300 bind_evtchn_to_cpu(evtchn, cpu);
303 irq_bindcount[irq]++;
305 spin_unlock(&irq_mapping_update_lock);
310 static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
312 struct evtchn_bind_ipi bind_ipi;
315 spin_lock(&irq_mapping_update_lock);
317 if ((irq = per_cpu(ipi_to_irq, cpu)[ipi]) == -1) {
319 if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
322 evtchn = bind_ipi.port;
324 irq = find_unbound_irq();
325 evtchn_to_irq[evtchn] = irq;
326 irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn);
328 per_cpu(ipi_to_irq, cpu)[ipi] = irq;
330 bind_evtchn_to_cpu(evtchn, cpu);
333 irq_bindcount[irq]++;
335 spin_unlock(&irq_mapping_update_lock);
340 static void unbind_from_irq(unsigned int irq)
342 struct evtchn_close close;
343 int evtchn = evtchn_from_irq(irq);
345 spin_lock(&irq_mapping_update_lock);
347 if ((--irq_bindcount[irq] == 0) && VALID_EVTCHN(evtchn)) {
349 if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
352 switch (type_from_irq(irq)) {
354 per_cpu(virq_to_irq, cpu_from_evtchn(evtchn))
355 [index_from_irq(irq)] = -1;
358 per_cpu(ipi_to_irq, cpu_from_evtchn(evtchn))
359 [index_from_irq(irq)] = -1;
365 /* Closed ports are implicitly re-bound to VCPU0. */
366 bind_evtchn_to_cpu(evtchn, 0);
368 evtchn_to_irq[evtchn] = -1;
369 irq_info[irq] = IRQ_UNBOUND;
372 spin_unlock(&irq_mapping_update_lock);
375 int bind_evtchn_to_irqhandler(
377 irqreturn_t (*handler)(int, void *, struct pt_regs *),
378 unsigned long irqflags,
385 irq = bind_evtchn_to_irq(evtchn);
386 retval = request_irq(irq, handler, irqflags, devname, dev_id);
388 unbind_from_irq(irq);
394 EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
396 int bind_virq_to_irqhandler(
399 irqreturn_t (*handler)(int, void *, struct pt_regs *),
400 unsigned long irqflags,
407 irq = bind_virq_to_irq(virq, cpu);
408 retval = request_irq(irq, handler, irqflags, devname, dev_id);
410 unbind_from_irq(irq);
416 EXPORT_SYMBOL_GPL(bind_virq_to_irqhandler);
418 int bind_ipi_to_irqhandler(
421 irqreturn_t (*handler)(int, void *, struct pt_regs *),
422 unsigned long irqflags,
429 irq = bind_ipi_to_irq(ipi, cpu);
430 retval = request_irq(irq, handler, irqflags, devname, dev_id);
432 unbind_from_irq(irq);
438 EXPORT_SYMBOL_GPL(bind_ipi_to_irqhandler);
440 void unbind_from_irqhandler(unsigned int irq, void *dev_id)
442 free_irq(irq, dev_id);
443 unbind_from_irq(irq);
445 EXPORT_SYMBOL_GPL(unbind_from_irqhandler);
447 /* Rebind an evtchn so that it gets delivered to a specific cpu */
448 static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
450 struct evtchn_bind_vcpu bind_vcpu;
451 int evtchn = evtchn_from_irq(irq);
453 if (!VALID_EVTCHN(evtchn))
456 /* Send future instances of this interrupt to other vcpu. */
457 bind_vcpu.port = evtchn;
458 bind_vcpu.vcpu = tcpu;
461 * If this fails, it usually just indicates that we're dealing with a
462 * virq or IPI channel, which don't actually need to be rebound. Ignore
463 * it, but don't do the xenlinux-level rebind in that case.
465 if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_vcpu, &bind_vcpu) >= 0)
466 bind_evtchn_to_cpu(evtchn, tcpu);
470 static void set_affinity_irq(unsigned irq, cpumask_t dest)
472 unsigned tcpu = first_cpu(dest);
473 rebind_irq_to_cpu(irq, tcpu);
477 * Interface to generic handling in irq.c
480 static unsigned int startup_dynirq(unsigned int irq)
482 int evtchn = evtchn_from_irq(irq);
484 if (VALID_EVTCHN(evtchn))
485 unmask_evtchn(evtchn);
489 static void shutdown_dynirq(unsigned int irq)
491 int evtchn = evtchn_from_irq(irq);
493 if (VALID_EVTCHN(evtchn))
497 static void enable_dynirq(unsigned int irq)
499 int evtchn = evtchn_from_irq(irq);
501 if (VALID_EVTCHN(evtchn))
502 unmask_evtchn(evtchn);
505 static void disable_dynirq(unsigned int irq)
507 int evtchn = evtchn_from_irq(irq);
509 if (VALID_EVTCHN(evtchn))
513 static void ack_dynirq(unsigned int irq)
515 int evtchn = evtchn_from_irq(irq);
517 move_native_irq(irq);
519 if (VALID_EVTCHN(evtchn)) {
521 clear_evtchn(evtchn);
525 static void end_dynirq(unsigned int irq)
527 int evtchn = evtchn_from_irq(irq);
529 if (VALID_EVTCHN(evtchn) && !(irq_desc[irq].status & IRQ_DISABLED))
530 unmask_evtchn(evtchn);
533 static struct hw_interrupt_type dynirq_type = {
544 static inline void pirq_unmask_notify(int pirq)
546 struct physdev_eoi eoi = { .irq = pirq };
547 if (unlikely(test_bit(pirq, &pirq_needs_eoi[0])))
548 (void)HYPERVISOR_physdev_op(PHYSDEVOP_eoi, &eoi);
551 static inline void pirq_query_unmask(int pirq)
553 struct physdev_irq_status_query irq_status;
554 irq_status.irq = pirq;
555 (void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status);
556 clear_bit(pirq, &pirq_needs_eoi[0]);
557 if (irq_status.flags & XENIRQSTAT_needs_eoi)
558 set_bit(pirq, &pirq_needs_eoi[0]);
562 * On startup, if there is no action associated with the IRQ then we are
563 * probing. In this case we should not share with others as it will confuse us.
565 #define probing_irq(_irq) (irq_desc[(_irq)].action == NULL)
567 static unsigned int startup_pirq(unsigned int irq)
569 struct evtchn_bind_pirq bind_pirq;
570 int evtchn = evtchn_from_irq(irq);
572 if (VALID_EVTCHN(evtchn))
575 bind_pirq.pirq = irq;
576 /* NB. We are happy to share unless we are probing. */
577 bind_pirq.flags = probing_irq(irq) ? 0 : BIND_PIRQ__WILL_SHARE;
578 if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq) != 0) {
579 if (!probing_irq(irq))
580 printk(KERN_INFO "Failed to obtain physical IRQ %d\n",
584 evtchn = bind_pirq.port;
586 pirq_query_unmask(irq_to_pirq(irq));
588 evtchn_to_irq[evtchn] = irq;
589 bind_evtchn_to_cpu(evtchn, 0);
590 irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, evtchn);
593 unmask_evtchn(evtchn);
594 pirq_unmask_notify(irq_to_pirq(irq));
599 static void shutdown_pirq(unsigned int irq)
601 struct evtchn_close close;
602 int evtchn = evtchn_from_irq(irq);
604 if (!VALID_EVTCHN(evtchn))
610 if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
613 bind_evtchn_to_cpu(evtchn, 0);
614 evtchn_to_irq[evtchn] = -1;
615 irq_info[irq] = IRQ_UNBOUND;
618 static void enable_pirq(unsigned int irq)
620 int evtchn = evtchn_from_irq(irq);
622 if (VALID_EVTCHN(evtchn)) {
623 unmask_evtchn(evtchn);
624 pirq_unmask_notify(irq_to_pirq(irq));
628 static void disable_pirq(unsigned int irq)
630 int evtchn = evtchn_from_irq(irq);
632 if (VALID_EVTCHN(evtchn))
636 static void ack_pirq(unsigned int irq)
638 int evtchn = evtchn_from_irq(irq);
640 move_native_irq(irq);
642 if (VALID_EVTCHN(evtchn)) {
644 clear_evtchn(evtchn);
648 static void end_pirq(unsigned int irq)
650 int evtchn = evtchn_from_irq(irq);
652 if (VALID_EVTCHN(evtchn) && !(irq_desc[irq].status & IRQ_DISABLED)) {
653 unmask_evtchn(evtchn);
654 pirq_unmask_notify(irq_to_pirq(irq));
658 static struct hw_interrupt_type pirq_type = {
669 int irq_ignore_unhandled(unsigned int irq)
671 struct physdev_irq_status_query irq_status = { .irq = irq };
673 if (!is_running_on_xen())
676 (void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status);
677 return !!(irq_status.flags & XENIRQSTAT_shared);
680 void resend_irq_on_evtchn(struct hw_interrupt_type *h, unsigned int i)
682 int evtchn = evtchn_from_irq(i);
683 shared_info_t *s = HYPERVISOR_shared_info;
684 if (!VALID_EVTCHN(evtchn))
686 BUG_ON(!synch_test_bit(evtchn, &s->evtchn_mask[0]));
687 synch_set_bit(evtchn, &s->evtchn_pending[0]);
690 void notify_remote_via_irq(int irq)
692 int evtchn = evtchn_from_irq(irq);
694 if (VALID_EVTCHN(evtchn))
695 notify_remote_via_evtchn(evtchn);
697 EXPORT_SYMBOL_GPL(notify_remote_via_irq);
699 void mask_evtchn(int port)
701 shared_info_t *s = HYPERVISOR_shared_info;
702 synch_set_bit(port, &s->evtchn_mask[0]);
704 EXPORT_SYMBOL_GPL(mask_evtchn);
706 void unmask_evtchn(int port)
708 shared_info_t *s = HYPERVISOR_shared_info;
709 unsigned int cpu = smp_processor_id();
710 vcpu_info_t *vcpu_info = &s->vcpu_info[cpu];
712 BUG_ON(!irqs_disabled());
714 /* Slow path (hypercall) if this is a non-local port. */
715 if (unlikely(cpu != cpu_from_evtchn(port))) {
716 struct evtchn_unmask unmask = { .port = port };
717 (void)HYPERVISOR_event_channel_op(EVTCHNOP_unmask, &unmask);
721 synch_clear_bit(port, &s->evtchn_mask[0]);
724 * The following is basically the equivalent of 'hw_resend_irq'. Just
725 * like a real IO-APIC we 'lose the interrupt edge' if the channel is
728 if (synch_test_bit(port, &s->evtchn_pending[0]) &&
729 !synch_test_and_set_bit(port / BITS_PER_LONG,
730 &vcpu_info->evtchn_pending_sel))
731 vcpu_info->evtchn_upcall_pending = 1;
733 EXPORT_SYMBOL_GPL(unmask_evtchn);
735 void irq_resume(void)
737 struct evtchn_bind_virq bind_virq;
738 struct evtchn_bind_ipi bind_ipi;
739 int cpu, pirq, virq, ipi, irq, evtchn;
741 init_evtchn_cpu_bindings();
743 /* New event-channel space is not 'live' yet. */
744 for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++)
747 /* Check that no PIRQs are still bound. */
748 for (pirq = 0; pirq < NR_PIRQS; pirq++)
749 BUG_ON(irq_info[pirq_to_irq(pirq)] != IRQ_UNBOUND);
751 /* Secondary CPUs must have no VIRQ or IPI bindings. */
752 for_each_possible_cpu(cpu) {
755 for (virq = 0; virq < NR_VIRQS; virq++)
756 BUG_ON(per_cpu(virq_to_irq, cpu)[virq] != -1);
757 for (ipi = 0; ipi < NR_IPIS; ipi++)
758 BUG_ON(per_cpu(ipi_to_irq, cpu)[ipi] != -1);
761 /* No IRQ <-> event-channel mappings. */
762 for (irq = 0; irq < NR_IRQS; irq++)
763 irq_info[irq] &= ~0xFFFF; /* zap event-channel binding */
764 for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++)
765 evtchn_to_irq[evtchn] = -1;
767 /* Primary CPU: rebind VIRQs automatically. */
768 for (virq = 0; virq < NR_VIRQS; virq++) {
769 if ((irq = per_cpu(virq_to_irq, 0)[virq]) == -1)
772 BUG_ON(irq_info[irq] != mk_irq_info(IRQT_VIRQ, virq, 0));
774 /* Get a new binding from Xen. */
775 bind_virq.virq = virq;
777 if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq,
780 evtchn = bind_virq.port;
782 /* Record the new mapping. */
783 evtchn_to_irq[evtchn] = irq;
784 irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
787 unmask_evtchn(evtchn);
790 /* Primary CPU: rebind IPIs automatically. */
791 for (ipi = 0; ipi < NR_IPIS; ipi++) {
792 if ((irq = per_cpu(ipi_to_irq, 0)[ipi]) == -1)
795 BUG_ON(irq_info[irq] != mk_irq_info(IRQT_IPI, ipi, 0));
797 /* Get a new binding from Xen. */
799 if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
802 evtchn = bind_ipi.port;
804 /* Record the new mapping. */
805 evtchn_to_irq[evtchn] = irq;
806 irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn);
809 unmask_evtchn(evtchn);
813 void __init xen_init_IRQ(void)
817 init_evtchn_cpu_bindings();
819 /* No event channels are 'live' right now. */
820 for (i = 0; i < NR_EVENT_CHANNELS; i++)
823 /* No IRQ -> event-channel mappings. */
824 for (i = 0; i < NR_IRQS; i++)
825 irq_info[i] = IRQ_UNBOUND;
827 /* Dynamic IRQ space is currently unbound. Zero the refcnts. */
828 for (i = 0; i < NR_DYNIRQS; i++) {
829 irq_bindcount[dynirq_to_irq(i)] = 0;
831 irq_desc[dynirq_to_irq(i)].status = IRQ_DISABLED;
832 irq_desc[dynirq_to_irq(i)].action = NULL;
833 irq_desc[dynirq_to_irq(i)].depth = 1;
834 irq_desc[dynirq_to_irq(i)].handler = &dynirq_type;
837 /* Phys IRQ space is statically bound (1:1 mapping). Nail refcnts. */
838 for (i = 0; i < NR_PIRQS; i++) {
839 irq_bindcount[pirq_to_irq(i)] = 1;
842 /* If not domain 0, force our RTC driver to fail its probe. */
843 if ((i == RTC_IRQ) &&
844 !(xen_start_info->flags & SIF_INITDOMAIN))
848 irq_desc[pirq_to_irq(i)].status = IRQ_DISABLED;
849 irq_desc[pirq_to_irq(i)].action = NULL;
850 irq_desc[pirq_to_irq(i)].depth = 1;
851 irq_desc[pirq_to_irq(i)].handler = &pirq_type;