The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [patch 4/8] irq code: Add coherence test for PREEMPT_ACTIVE
@ 2005-05-27  0:38 blaisorblade
  2005-05-27  1:06 ` Blaisorblade
  0 siblings, 1 reply; 6+ messages in thread
From: blaisorblade @ 2005-05-27  0:38 UTC (permalink / raw)
  To: akpm; +Cc: jdike, linux-kernel, user-mode-linux-devel, blaisorblade


After porting this fixlet to UML:

http://linux.bkbits.net:8080/linux-2.5/cset@41791ab52lfMuF2i3V-eTIGRBbDYKQ

, I've also added a warning which should refuse compilation with insane values
for PREEMPT_ACTIVE... maybe we should simply move PREEMPT_ACTIVE out of
architectures using GENERIC_IRQS.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 linux-2.6.git-paolo/include/linux/hardirq.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN include/linux/hardirq.h~coherence-test-preempt-active include/linux/hardirq.h
--- linux-2.6.git/include/linux/hardirq.h~coherence-test-preempt-active	2005-05-25 00:59:11.000000000 +0200
+++ linux-2.6.git-paolo/include/linux/hardirq.h	2005-05-25 00:59:26.000000000 +0200
@@ -43,13 +43,17 @@
 #define __IRQ_MASK(x)	((1UL << (x))-1)
 
 #define PREEMPT_MASK	(__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
 #define SOFTIRQ_MASK	(__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
+#define HARDIRQ_MASK	(__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
 
 #define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
 #define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
 #define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
 
+#if PREEMPT_ACTIVE < (1 << (HARDIRQ_SHIFT + HARDIRQ_BITS))
+#error PREEMPT_ACTIVE is too low!
+#endif
+
 #define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
 #define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
 #define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
_

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-05-28 11:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-27  0:38 [patch 4/8] irq code: Add coherence test for PREEMPT_ACTIVE blaisorblade
2005-05-27  1:06 ` Blaisorblade
2005-05-27  3:31   ` Paul Mundt
2005-05-28 11:21     ` Blaisorblade
2005-05-27 13:33   ` David Howells
2005-05-28 11:19     ` Blaisorblade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox