[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC PATCH 4/23] VIOMMU: Add get irq info callback to convert irq remapping request
This patch is to add get_irq_info callback for platform implementation to convert irq remapping request to irq info (E,G vector, dest, dest_mode and so on). Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx> --- xen/common/viommu.c | 11 +++++++++++ xen/include/asm-arm/viommu.h | 4 ++++ xen/include/asm-x86/viommu.h | 8 ++++++++ xen/include/xen/viommu.h | 4 ++++ 4 files changed, 27 insertions(+) diff --git a/xen/common/viommu.c b/xen/common/viommu.c index 62c66db..dbec692 100644 --- a/xen/common/viommu.c +++ b/xen/common/viommu.c @@ -98,6 +98,17 @@ int viommu_handle_irq_request(struct domain *d, return info->ops->handle_irq_request(d, request); } +int viommu_get_irq_info(struct domain *d, struct irq_remapping_request *request, + struct irq_remapping_info *irq_info) +{ + struct viommu_info *info = &d->viommu; + + if ( !info || !info->ops || !info->ops->get_irq_info) + return -EINVAL; + + return info->ops->get_irq_info(d, request, irq_info); +} + /* * Local variables: * mode: C diff --git a/xen/include/asm-arm/viommu.h b/xen/include/asm-arm/viommu.h index 6a81ecb..6ce4e0a 100644 --- a/xen/include/asm-arm/viommu.h +++ b/xen/include/asm-arm/viommu.h @@ -22,6 +22,10 @@ #include <xen/viommu.h> +struct irq_remapping_info +{ +}; + struct irq_remapping_request { }; diff --git a/xen/include/asm-x86/viommu.h b/xen/include/asm-x86/viommu.h index b6e01a5..43e446e 100644 --- a/xen/include/asm-x86/viommu.h +++ b/xen/include/asm-x86/viommu.h @@ -23,6 +23,14 @@ #include <xen/viommu.h> #include <asm/types.h> +struct irq_remapping_info +{ + u8 vector; + u32 dest; + u32 dest_mode:1; + u32 delivery_mode:3; +}; + struct irq_remapping_request { u8 type; diff --git a/xen/include/xen/viommu.h b/xen/include/xen/viommu.h index 246b29d..d733012 100644 --- a/xen/include/xen/viommu.h +++ b/xen/include/xen/viommu.h @@ -42,6 +42,8 @@ struct viommu_ops { int (*destroy)(struct viommu *viommu); int (*handle_irq_request)(struct domain *d, struct irq_remapping_request *request); + int (*get_irq_info)(struct domain *d, struct irq_remapping_request *request, + struct irq_remapping_info *info); }; struct viommu_info { @@ -56,6 +58,8 @@ int viommu_destroy(struct domain *d, u32 viommu_id); u64 viommu_query_caps(struct domain *d); int viommu_handle_irq_request(struct domain *d, struct irq_remapping_request *request); +int viommu_get_irq_info(struct domain *d, struct irq_remapping_request *request, + struct irq_remapping_info *irq_info); #endif /* __XEN_VIOMMU_H__ */ -- 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |