[PATCH] irq code: Add coherence test for PREEMPT_ACTIVE
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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
37053cc84d
commit
8f28e8fa46
@ -43,13 +43,17 @@
|
|||||||
#define __IRQ_MASK(x) ((1UL << (x))-1)
|
#define __IRQ_MASK(x) ((1UL << (x))-1)
|
||||||
|
|
||||||
#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
|
#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 SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
|
||||||
|
#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
|
||||||
|
|
||||||
#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
|
#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
|
||||||
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
|
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
|
||||||
#define HARDIRQ_OFFSET (1UL << HARDIRQ_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 hardirq_count() (preempt_count() & HARDIRQ_MASK)
|
||||||
#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
|
#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
|
||||||
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
|
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user