|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC PATCH v2 12/22] xen/arm: its: Update irq descriptor for LPIs support
From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
Introduce new fields in arch_irq_desc for to hold
virtual irq number and pointer to its device.
Also introduced helper function to read and update
device pointer in arch_irq_desc
Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
---
xen/arch/arm/irq.c | 26 ++++++++++++++++++++++++++
xen/include/asm-arm/irq.h | 4 ++++
2 files changed, 30 insertions(+)
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index cb9c99b..d02f4cf 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -89,6 +89,8 @@ static int __cpuinit init_local_irq_data(void)
init_one_irq_desc(desc);
desc->irq = irq;
desc->action = NULL;
+ desc->arch.dev = NULL;
+ desc->arch.virq = 0;
/* PPIs are included in local_irqs, we copy the IRQ type from
* local_irqs_type when bringing up local IRQ for this CPU in
@@ -104,6 +106,30 @@ static int __cpuinit init_local_irq_data(void)
return 0;
}
+int irq_set_desc_data(unsigned int irq, struct its_device *d)
+{
+ unsigned long flags;
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ spin_lock_irqsave(&desc->lock, flags);
+ desc->arch.dev = d;
+ spin_unlock_irqrestore(&desc->lock, flags);
+
+ return 0;
+}
+
+struct its_device *irq_get_desc_data(struct irq_desc *desc)
+{
+ unsigned long flags;
+ struct its_device *dev;
+
+ spin_lock_irqsave(&desc->lock, flags);
+ dev = desc->arch.dev;
+ spin_unlock_irqrestore(&desc->lock, flags);
+
+ return dev;
+}
+
void __init init_IRQ(void)
{
int irq;
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index 435dfcd..f091739 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -17,6 +17,8 @@ struct arch_pirq
struct arch_irq_desc {
int eoi_cpu;
unsigned int type;
+ unsigned int virq;
+ struct its_device *dev;
};
#define NR_LOCAL_IRQS 32
@@ -47,6 +49,8 @@ void arch_move_irqs(struct vcpu *v);
/* Set IRQ type for an SPI */
int irq_set_spi_type(unsigned int spi, unsigned int type);
+int irq_set_desc_data(unsigned int irq, struct its_device *d);
+struct its_device *irq_get_desc_data(struct irq_desc *d);
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);
--
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 |