[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v6 08/31] xen/arm: ITS: Introduce msi_desc for LPIs
From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx> Define msi_desc structure for arm and introduce helper functions to access msi_desc member variables. Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx> --- xen/arch/arm/gic-v3-its.c | 28 ++++++++++++++++++++++++++++ xen/arch/arm/irq.c | 12 ++++++++++++ xen/include/asm-arm/gic-its.h | 4 ++++ xen/include/asm-arm/irq.h | 9 +++++++++ 4 files changed, 53 insertions(+) diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c index 88cc89d..e70c21a 100644 --- a/xen/arch/arm/gic-v3-its.c +++ b/xen/arch/arm/gic-v3-its.c @@ -109,6 +109,34 @@ static void dump_cmd(const its_cmd_block *cmd) static void dump_cmd(const its_cmd_block *cmd) { } #endif +void irqdesc_set_lpi_event(struct irq_desc *desc, unsigned id) +{ + ASSERT(spin_is_locked(&desc->lock)); + + irq_get_msi_desc(desc)->eventID = id; +} + +unsigned int irqdesc_get_lpi_event(struct irq_desc *desc) +{ + ASSERT(spin_is_locked(&desc->lock)); + + return irq_get_msi_desc(desc)->eventID; +} + +struct its_device *irqdesc_get_its_device(struct irq_desc *desc) +{ + ASSERT(spin_is_locked(&desc->lock)); + + return irq_get_msi_desc(desc)->dev; +} + +void irqdesc_set_its_device(struct irq_desc *desc, struct its_device *dev) +{ + ASSERT(spin_is_locked(&desc->lock)); + + irq_get_msi_desc(desc)->dev = dev; +} + static struct its_collection *dev_event_to_col(struct its_device *dev, u32 event) { diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index d8080c7..24c4f24 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -143,6 +143,18 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc) return irq_get_guest_info(desc)->d; } +void irq_set_msi_desc(struct irq_desc *desc, struct msi_desc *msi) +{ + desc->msi_desc = msi; +} + +struct msi_desc *irq_get_msi_desc(struct irq_desc *desc) +{ + ASSERT(desc->msi_desc != NULL); + + return desc->msi_desc; +} + void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask) { if ( desc != NULL ) diff --git a/xen/include/asm-arm/gic-its.h b/xen/include/asm-arm/gic-its.h index 70e7f54..25c2176 100644 --- a/xen/include/asm-arm/gic-its.h +++ b/xen/include/asm-arm/gic-its.h @@ -271,6 +271,10 @@ struct its_device { struct rb_node node; }; +void irqdesc_set_lpi_event(struct irq_desc *desc, unsigned id); +unsigned int irqdesc_get_lpi_event(struct irq_desc *desc); +struct its_device *irqdesc_get_its_device(struct irq_desc *desc); +void irqdesc_set_its_device(struct irq_desc *desc, struct its_device *dev); int its_init(struct rdist_prop *rdists); int its_cpu_init(void); diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h index cbdc1ab..bddd1ea 100644 --- a/xen/include/asm-arm/irq.h +++ b/xen/include/asm-arm/irq.h @@ -18,6 +18,13 @@ struct arch_irq_desc { unsigned int type; }; +struct msi_desc { +#ifdef HAS_GICV3 + unsigned int eventID; + struct its_device *dev; +#endif +}; + #define NR_LOCAL_IRQS 32 /* Number of SGIs+PPIs+SPIs */ #define NR_LINE_IRQS 1024 @@ -56,6 +63,8 @@ int irq_set_spi_type(unsigned int spi, unsigned int type); int platform_get_irq(const struct dt_device_node *device, int index); void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask); +void irq_set_msi_desc(struct irq_desc *desc, struct msi_desc *msi); +struct msi_desc *irq_get_msi_desc(struct irq_desc *desc); #endif /* _ASM_HW_IRQ_H */ /* -- 1.7.9.5 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |