This commit was generated by cvs2svn to compensate for changes in r517,
[linux-2.6.git] / include / asm-s390 / hardirq.h
1 /*
2  *  include/asm-s390/hardirq.h
3  *
4  *  S390 version
5  *    Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
6  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
7  *               Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
8  *
9  *  Derived from "include/asm-i386/hardirq.h"
10  */
11
12 #ifndef __ASM_HARDIRQ_H
13 #define __ASM_HARDIRQ_H
14
15 #include <linux/config.h>
16 #include <linux/threads.h>
17 #include <linux/sched.h>
18 #include <linux/cache.h>
19 #include <asm/lowcore.h>
20
21 /* irq_cpustat_t is unused currently, but could be converted
22  * into a percpu variable instead of storing softirq_pending
23  * on the lowcore */
24 typedef struct {
25         unsigned int __softirq_pending;
26 } irq_cpustat_t;
27
28 #define local_softirq_pending() (S390_lowcore.softirq_pending)
29
30 /* this is always called with cpu == smp_processor_id() at the moment */
31 static inline __u32
32 softirq_pending(unsigned int cpu)
33 {
34         if (cpu == smp_processor_id())
35                 return local_softirq_pending();
36         return lowcore_ptr[cpu]->softirq_pending;
37 }
38
39 #define __ARCH_IRQ_STAT
40
41 #define HARDIRQ_BITS    8
42
43 extern void account_ticks(struct pt_regs *);
44
45 #define __ARCH_HAS_DO_SOFTIRQ
46
47 #define irq_enter()                                                     \
48 do {                                                                    \
49         (preempt_count() += HARDIRQ_OFFSET);                            \
50 } while(0)
51 #define irq_exit()                                                      \
52 do {                                                                    \
53         preempt_count() -= IRQ_EXIT_OFFSET;                             \
54         if (!in_interrupt() && local_softirq_pending())                 \
55                 /* Use the async. stack for softirq */                  \
56                 do_softirq();                                           \
57         preempt_enable_no_resched();                                    \
58 } while (0)
59
60 #endif /* __ASM_HARDIRQ_H */