mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
xen: remap GSIs as pirqs when running as initial domain
Implement xen_register_gsi to setup the correct triggering and polarity properties of a gsi. Implement xen_register_pirq to register a particular gsi as pirq and receive interrupts as events. Call xen_setup_pirqs to register all the legacy ISA irqs as pirqs. Signed-off-by: Jeremy Fitzhardinge <[email protected]> Signed-off-by: Stefano Stabellini <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]>
This commit is contained in:
parent
6b0661a5e6
commit
38aa66fcb7
4 changed files with 165 additions and 0 deletions
|
|
@ -681,6 +681,8 @@ out:
|
|||
int xen_destroy_irq(int irq)
|
||||
{
|
||||
struct irq_desc *desc;
|
||||
struct physdev_unmap_pirq unmap_irq;
|
||||
struct irq_info *info = info_for_irq(irq);
|
||||
int rc = -ENOENT;
|
||||
|
||||
spin_lock(&irq_mapping_update_lock);
|
||||
|
|
@ -689,6 +691,15 @@ int xen_destroy_irq(int irq)
|
|||
if (!desc)
|
||||
goto out;
|
||||
|
||||
if (xen_initial_domain()) {
|
||||
unmap_irq.pirq = info->u.pirq.gsi;
|
||||
unmap_irq.domid = DOMID_SELF;
|
||||
rc = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap_irq);
|
||||
if (rc) {
|
||||
printk(KERN_WARNING "unmap irq failed %d\n", rc);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
irq_info[irq] = mk_unbound_info();
|
||||
|
||||
irq_free_desc(irq);
|
||||
|
|
@ -1425,5 +1436,7 @@ void __init xen_init_IRQ(void)
|
|||
pci_xen_hvm_init();
|
||||
} else {
|
||||
irq_ctx_init(smp_processor_id());
|
||||
if (xen_initial_domain())
|
||||
xen_setup_pirqs();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue