Lines Matching defs:evtchn

28  * evtchn.c
120 * and the IRQ for /dev/xen/evtchn. The IRQ types are:
143 * This is a one-time IRQ used by /dev/xen/evtchn. Unlike other IRQs, we
144 * have a one-IRQ to many-evtchn mapping. We only track evtchn->irq for
146 * We enforce that IRQT_DEV_EVTCHN's representative evtchn (->ii_evtchn)
148 * accidentally attempting to use the illegal evtchn 0.
251 /* ensure evtchn is masked till we're ready to use it */
261 xen_close_evtchn(int evtchn)
266 close.port = evtchn;
288 xen_bind_vcpu(int evtchn, int cpu)
294 bind.port = evtchn;
313 /* unmask an evtchn and send upcall to appropriate vcpu if pending bit is set */
315 xen_evtchn_unmask(int evtchn)
319 unmask.port = evtchn;
325 update_evtchn_affinity(int evtchn)
330 ASSERT(evtchn_to_irq[evtchn] != INVALID_IRQ);
340 if (CPU_IN_SET(evtchn_cpus[evtchn], cp->cpu_id))
341 SET_EVTCHN_BIT(evtchn, cpe->evt_affinity);
343 CLEAR_EVTCHN_BIT(evtchn, cpe->evt_affinity);
349 bind_evtchn_to_cpuset(int evtchn, cpuset_t cpus)
351 ASSERT(evtchn_to_irq[evtchn] != INVALID_IRQ);
353 CPUSET_ZERO(evtchn_cpus[evtchn]);
354 CPUSET_OR(evtchn_cpus[evtchn], cpus);
355 update_evtchn_affinity(evtchn);
359 clear_evtchn_affinity(int evtchn)
361 CPUSET_ZERO(evtchn_cpus[evtchn]);
362 update_evtchn_affinity(evtchn);
366 alloc_irq_evtchn(int irq, int index, int evtchn, int cpu)
372 ipi_info[index].mi_evtchns[cpu] = evtchn;
376 virq_info[index].mi_evtchns[cpu] = evtchn;
380 irqp->ii_u.evtchn = evtchn;
384 evtchn_to_irq[evtchn] = irq;
393 bind_evtchn_to_cpuset(evtchn, tcpus);
398 alloc_irq(int type, int index, int evtchn, int cpu)
422 alloc_irq_evtchn(irq, index, evtchn, cpu);
429 int evtchn;
436 evtchn = ipi_info[irqp->ii_u.index].mi_evtchns[CPU->cpu_id];
439 evtchn = virq_info[irqp->ii_u.index].mi_evtchns[CPU->cpu_id];
442 evtchn = irqp->ii_u.evtchn;
446 return (evtchn);
498 int evtchn = irq_evtchn(&irq_info[irq]);
504 ec_unmask_evtchn(evtchn);
513 ec_bind_vcpu(int evtchn, int cpu)
516 xen_bind_vcpu(evtchn, cpu);
526 int evtchn;
530 * Test if this PIRQ is already bound to an evtchn,
535 if (irqp->ii_u.evtchn == INVALID_EVTCHN) {
536 evtchn = xen_bind_pirq(irq);
541 irqp->ii_u.evtchn = evtchn;
543 evtchn_to_irq[evtchn] = irq;
553 *cpusp = evtchn_cpus[irqp->ii_u.evtchn];
580 unbind_evtchn(&irqp->ii_u.evtchn);
610 int evtchn, tcpu;
631 evtchn = irq_evtchn(irqp);
633 xen_bind_vcpu(evtchn, tcpu);
635 bind_evtchn_to_cpuset(evtchn, dest);
678 ec_bind_evtchn_to_irq(int evtchn)
682 ASSERT(evtchn_to_irq[evtchn] == INVALID_IRQ);
684 (void) alloc_irq(IRQT_EVTCHN, 0, evtchn, -1);
687 return (evtchn_to_irq[evtchn]);
694 int evtchn;
700 err = xen_bind_virq(virq, cpu, &evtchn);
703 ASSERT(evtchn_to_irq[evtchn] == INVALID_IRQ);
706 virqp->mi_irq = alloc_irq(IRQT_VIRQ, virq, evtchn, cpu);
708 alloc_irq_evtchn(virqp->mi_irq, virq, evtchn, cpu);
719 int evtchn;
727 evtchn = xen_bind_ipi(cpu);
729 ASSERT(evtchn_to_irq[evtchn] == INVALID_IRQ);
732 ipip->mi_irq = alloc_irq(IRQT_IPI, ipl, evtchn, cpu);
734 alloc_irq_evtchn(ipip->mi_irq, ipl, evtchn, cpu);
738 * Unmask the new evtchn so that it can be seen by the target cpu
741 ec_unmask_evtchn(evtchn);
773 if (irqp->ii_u.evtchn == 0)
789 CPU_IN_SET(evtchn_cpus[irqp->ii_u.evtchn], cpu));
814 ec_irq_add_evtchn(int irq, int evtchn)
823 alloc_irq_evtchn(irq, 0, evtchn, 0);
828 irq_info[irq].ii_u.evtchn = 0;
833 ec_irq_rm_evtchn(int irq, int evtchn)
835 ushort_t ec = evtchn;
844 * Allocate an /dev/xen/evtchn IRQ. See the big comment at the top
864 * Force the evtchn to zero for the special evtchn device irq
866 irqp->ii_u.evtchn = 0;
893 * Spin till we are the one to mask the evtchn
894 * Ensures no one else can be servicing this evtchn.
914 int evtchn = irq_evtchn(&irq_info[irq]);
916 return (ec_evtchn_pending(evtchn));
923 int evtchn;
930 evtchn = irq_evtchn(irqp);
932 ASSERT(EVTCHN_MASKED(evtchn));
933 ec_clear_evtchn(evtchn);
961 int evtchn;
971 if ((evtchn = irq_evtchn(irqp)) != 0)
972 ec_unmask_evtchn(evtchn);
984 ec_wait_on_evtchn(int evtchn, int (*check_func)(void *), void *arg)
997 ports[0] = evtchn;
999 ec_clear_evtchn(evtchn);
1080 if (irqp->ii_u.evtchn != 0)
1090 * The debug irq is special, we only have one evtchn and irq but we allow all
1097 int evtchn = virqp->mi_evtchns[0];
1101 ASSERT(evtchn != 0);
1106 virqp->mi_evtchns[i] = evtchn;
1108 bind_evtchn_to_cpuset(evtchn, tset);
1115 int evtchn;
1124 err = xen_bind_virq(virq, i, &evtchn);
1127 virqp->mi_evtchns[i] = evtchn;
1128 evtchn_to_irq[evtchn] = virqp->mi_irq;
1130 bind_evtchn_to_cpuset(evtchn, tcpus);
1131 ec_unmask_evtchn(evtchn);
1151 int evtchn;
1156 evtchn = xen_bind_ipi(i);
1157 ipip->mi_evtchns[i] = evtchn;
1158 evtchn_to_irq[evtchn] = ipip->mi_irq;
1160 bind_evtchn_to_cpuset(evtchn, tcpus);
1161 ec_unmask_evtchn(evtchn);
1302 * We require the evtchn driver to install a handler
1564 int evtchn;
1567 evtchn = irq_evtchn(irqp);
1568 (void) ec_mask_evtchn(evtchn);
1569 return (evtchn_owner[evtchn]);
1582 uint_t evtchn, evi, bit;
1587 * The evtchn must be masked
1589 evtchn = irq_evtchn(irqp);
1590 ASSERT(EVTCHN_MASKED(evtchn));
1591 evi = evtchn >> EVTCHN_SHIFT;
1592 bit = evtchn & (1ul << EVTCHN_SHIFT) - 1;