@@ -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)
{
@@ -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 )
@@ -277,6 +277,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);
@@ -18,6 +18,13 @@ struct arch_irq_desc {
unsigned int type;
};
+struct msi_desc {
+#ifdef CONFIG_HAS_GICV3
+ unsigned int eventID;
+ struct its_device *dev;
+#endif
+};
+
#define NR_LOCAL_IRQS 32
/* Number of SGIs + PPIs + SPIs */
#define NR_ITLINES 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 */
/*