de7e476ff7a9507ac44833da6918e7397492147f
[linux-2.6.git] / include / asm-alpha / hardirq.h
1 #ifndef _ALPHA_HARDIRQ_H
2 #define _ALPHA_HARDIRQ_H
3
4 #include <linux/config.h>
5 #include <linux/threads.h>
6 #include <linux/cache.h>
7
8
9 /* entry.S is sensitive to the offsets of these fields */
10 typedef struct {
11         unsigned long __softirq_pending;
12         unsigned int __syscall_count;
13         unsigned long idle_timestamp;
14         struct task_struct * __ksoftirqd_task;
15 } ____cacheline_aligned irq_cpustat_t;
16
17 #include <linux/irq_cpustat.h>  /* Standard mappings for irq_cpustat_t above */
18
19 #define HARDIRQ_BITS    12
20
21 /*
22  * The hardirq mask has to be large enough to have
23  * space for potentially nestable IRQ sources in the system
24  * to nest on a single CPU. On Alpha, interrupts are masked at the CPU
25  * by IPL as well as at the system level. We only have 8 IPLs (UNIX PALcode)
26  * so we really only have 8 nestable IRQs, but allow some overhead
27  */
28 #if (1 << HARDIRQ_BITS) < 16
29 #error HARDIRQ_BITS is too low!
30 #endif
31
32 #define irq_enter()             (preempt_count() += HARDIRQ_OFFSET)
33 #define irq_exit()                                              \
34 do {                                                            \
35                 preempt_count() -= IRQ_EXIT_OFFSET;             \
36                 if (!in_interrupt() &&                          \
37                     softirq_pending(smp_processor_id()))        \
38                         do_softirq();                           \
39                 preempt_enable_no_resched();                    \
40 } while (0)
41
42 #endif /* _ALPHA_HARDIRQ_H */