genirq: Add new IPI irqdomain flags
authorQais Yousef <[email protected]>
Tue, 8 Dec 2015 13:20:12 +0000 (13:20 +0000)
committerThomas Gleixner <[email protected]>
Thu, 25 Feb 2016 09:56:55 +0000 (10:56 +0100)
These flags will be used to identify an IPI domain. We have two flavours of
IPI implementations:

IRQ_DOMAIN_FLAG_IPI_PER_CPU: Each CPU has its own virq and hwirq
IRQ_DOMAIN_FLAG_IPI_SINGLE : A single virq and hwirq for all CPUs

Signed-off-by: Qais Yousef <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: Qais Yousef <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
include/linux/irqdomain.h

index 04579d9fbce4f3b5c0a8484116500ee3034b93f7..9bb0a9cfc1c4434ccf802db09574fba7e4532e81 100644 (file)
@@ -172,6 +172,12 @@ enum {
        /* Core calls alloc/free recursive through the domain hierarchy. */
        IRQ_DOMAIN_FLAG_AUTO_RECURSIVE  = (1 << 1),
 
+       /* Irq domain is an IPI domain with virq per cpu */
+       IRQ_DOMAIN_FLAG_IPI_PER_CPU     = (1 << 2),
+
+       /* Irq domain is an IPI domain with single virq */
+       IRQ_DOMAIN_FLAG_IPI_SINGLE      = (1 << 3),
+
        /*
         * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved
         * for implementation specific purposes and ignored by the
@@ -400,6 +406,22 @@ static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
 {
        return domain->flags & IRQ_DOMAIN_FLAG_HIERARCHY;
 }
+
+static inline bool irq_domain_is_ipi(struct irq_domain *domain)
+{
+       return domain->flags &
+               (IRQ_DOMAIN_FLAG_IPI_PER_CPU | IRQ_DOMAIN_FLAG_IPI_SINGLE);
+}
+
+static inline bool irq_domain_is_ipi_per_cpu(struct irq_domain *domain)
+{
+       return domain->flags & IRQ_DOMAIN_FLAG_IPI_PER_CPU;
+}
+
+static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
+{
+       return domain->flags & IRQ_DOMAIN_FLAG_IPI_SINGLE;
+}
 #else  /* CONFIG_IRQ_DOMAIN_HIERARCHY */
 static inline void irq_domain_activate_irq(struct irq_data *data) { }
 static inline void irq_domain_deactivate_irq(struct irq_data *data) { }
@@ -413,6 +435,21 @@ static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
 {
        return false;
 }
+
+static inline bool irq_domain_is_ipi(struct irq_domain *domain)
+{
+       return false;
+}
+
+static inline bool irq_domain_is_ipi_per_cpu(struct irq_domain *domain)
+{
+       return false;
+}
+
+static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
+{
+       return false;
+}
 #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
 
 #else /* CONFIG_IRQ_DOMAIN */