lkml.org 
[lkml]   [2014]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 20/26] genirq: Provide irq_is_allocated()
Another proper interface to replace Xen hackery. No idea why Xen needs
this, but I'm not masochistic enough to understand that mess.

Not-Yet-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
kernel/irq/irqdesc.c | 11 +++++++++++
1 file changed, 11 insertions(+)

Index: tip/kernel/irq/irqdesc.c
===================================================================
--- tip.orig/kernel/irq/irqdesc.c
+++ tip/kernel/irq/irqdesc.c
@@ -390,6 +390,17 @@ err:
EXPORT_SYMBOL_GPL(__irq_alloc_descs);

/**
+ * irq_is_allocated - query whether an irq desc is allocated for an irq number
+ * @irq: irq number
+ *
+ * Returns a momentary racy snapshot of the allocation state
+ */
+bool irq_is_allocated(unsigned int irq)
+{
+ return irq < nr_irqs && test_bit(irq, allocated_irqs);
+}
+
+/**
* irq_reserve_irqs - mark irqs allocated
* @from: mark from irq number
* @cnt: number of irqs to mark



\
 
 \ /
  Last update: 2014-02-24 00:01    [W:0.409 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site