[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1218353792-3355-33-git-send-email-yhlu.kernel@gmail.com>
Date: Sun, 10 Aug 2008 00:36:21 -0700
From: Yinghai Lu <yhlu.kernel@...il.com>
To: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Dhaval Giani <dhaval@...ux.vnet.ibm.com>,
Mike Travis <travis@....com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, Yinghai Lu <yhlu.kernel@...il.com>
Subject: [PATCH 32/43] add irq_desc_without_new
Signed-off-by: Yinghai Lu <yhlu.kernel@...il.com>
---
include/linux/irq.h | 13 +++++++++++++
kernel/irq/handle.c | 27 ++++++++++++++++++++++++---
2 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index e98bc00..c13e645 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -191,10 +191,23 @@ struct irq_desc {
} ____cacheline_internodealigned_in_smp;
extern struct irq_desc *irq_desc(unsigned int irq);
+extern struct irq_desc *irq_desc_without_new(unsigned int irq);
+
+#ifndef CONFIG_HAVE_SPARSE_IRQ
+
#ifndef CONFIG_HAVE_DYN_ARRAY
/* could be removed if we get rid of all irq_desc reference */
extern struct irq_desc irq_descX[NR_IRQS];
+#else
+extern struct irq_desc *irq_descX;
#endif
+
+#else
+
+extern struct irq_desc *irq_descX;
+
+#endif
+
#define kstat_irqs_this_cpu(DESC) \
((DESC)->kstat_irqs[smp_processor_id()])
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 6e7f759..91924b8 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -111,7 +111,6 @@ static void init_kstat_irqs(struct irq_desc *desc, int nr_desc, int nr)
}
}
-
static void __init init_work(void *data)
{
struct dyn_array *da = data;
@@ -148,9 +147,27 @@ static int __init parse_nr_irq_desc(char *arg)
early_param("nr_irq_desc", parse_nr_irq_desc);
-static struct irq_desc *irq_descX;
+struct irq_desc *irq_descX;
DEFINE_DYN_ARRAY(irq_descX, sizeof(struct irq_desc), nr_irq_desc, PAGE_SIZE, init_work);
+struct irq_desc *irq_desc_without_new(unsigned int irq)
+{
+ struct irq_desc *desc;
+
+ BUG_ON(irq == -1U);
+
+ desc = &irq_descX[0];
+ while (desc) {
+ if (desc->irq == irq)
+ return desc;
+
+ if (desc->irq == -1U)
+ return NULL;
+
+ desc = desc->next;
+ }
+ return NULL;
+}
struct irq_desc *irq_desc(unsigned int irq)
{
struct irq_desc *desc, *desc_pri;
@@ -208,7 +225,7 @@ struct irq_desc *irq_desc(unsigned int irq)
}
#else
-static struct irq_desc *irq_descX;
+struct irq_desc *irq_descX;
DEFINE_DYN_ARRAY(irq_descX, sizeof(struct irq_desc), nr_irqs, PAGE_SIZE, init_work);
#endif
@@ -238,6 +255,10 @@ struct irq_desc *irq_desc(unsigned int irq)
return NULL;
}
+struct irq_desc *irq_desc_without_new(unsigned int irq)
+{
+ return irq_desc(irq);
+}
#endif
/*
--
1.5.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists