提交 d976195c 编写于 作者: J Joerg Roedel

iommu/amd: Add call-back routine for HPET MSI

Add a routine to setup a HPET MSI interrupt for remapping.
Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
上级 0b4d48cb
......@@ -4200,4 +4200,30 @@ static int msi_setup_irq(struct pci_dev *pdev, unsigned int irq,
return 0;
}
static int setup_hpet_msi(unsigned int irq, unsigned int id)
{
struct irq_2_iommu *irte_info;
struct irq_cfg *cfg;
int index, devid;
cfg = irq_get_chip_data(irq);
if (!cfg)
return -EINVAL;
irte_info = &cfg->irq_2_iommu;
devid = get_hpet_devid(id);
if (devid < 0)
return devid;
index = alloc_irq_index(cfg, devid, 1);
if (index < 0)
return index;
irte_info->sub_handle = devid;
irte_info->irte_index = index;
irte_info->iommu = (void *)cfg;
return 0;
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册