MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / asm-sparc / hardirq.h
blob548b44167a9d6ada684a3be0d11bc411a2874ced
1 /* hardirq.h: 32-bit Sparc hard IRQ support.
3 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
4 * Copyright (C) 1998-2000 Anton Blanchard (anton@samba.org)
5 */
7 #ifndef __SPARC_HARDIRQ_H
8 #define __SPARC_HARDIRQ_H
10 #include <linux/config.h>
11 #include <linux/threads.h>
12 #include <linux/spinlock.h>
13 #include <linux/cache.h>
15 /* entry.S is sensitive to the offsets of these fields */ /* XXX P3 Is it? */
16 typedef struct {
17 unsigned int __softirq_pending;
18 } ____cacheline_aligned irq_cpustat_t;
20 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
23 * We put the hardirq and softirq counter into the preemption
24 * counter. The bitmask has the following meaning:
26 * - bits 0-7 are the preemption count (max preemption depth: 256)
27 * - bits 8-15 are the softirq count (max # of softirqs: 256)
28 * - bits 16-23 are the hardirq count (max # of hardirqs: 256)
30 * - ( bit 26 is the PREEMPT_ACTIVE flag. )
32 * PREEMPT_MASK: 0x000000ff
33 * SOFTIRQ_MASK: 0x0000ff00
34 * HARDIRQ_MASK: 0x00ff0000
37 #define PREEMPT_BITS 8
38 #define SOFTIRQ_BITS 8
39 #define HARDIRQ_BITS 8
41 #define PREEMPT_SHIFT 0
42 #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
43 #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
45 #define irq_enter() (preempt_count() += HARDIRQ_OFFSET)
46 #define irq_exit() \
47 do { \
48 preempt_count() -= IRQ_EXIT_OFFSET; \
49 if (!in_interrupt() && softirq_pending(smp_processor_id())) \
50 do_softirq(); \
51 preempt_enable_no_resched(); \
52 } while (0)
54 #endif /* __SPARC_HARDIRQ_H */