This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-i386 / mach-xen / asm / irqflags.h
1 /*
2  * include/asm-i386/irqflags.h
3  *
4  * IRQ flags handling
5  *
6  * This file gets included from lowlevel asm headers too, to provide
7  * wrapped versions of the local_irq_*() APIs, based on the
8  * raw_local_irq_*() functions from the lowlevel headers.
9  */
10 #ifndef _ASM_IRQFLAGS_H
11 #define _ASM_IRQFLAGS_H
12
13 #ifndef __ASSEMBLY__
14
15 #define raw_local_save_flags(flags) \
16                 do { (flags) = __raw_local_save_flags(); } while (0)
17
18 unsigned long __raw_local_save_flags(void);
19 void raw_local_irq_restore(unsigned long flags);
20 void raw_local_irq_disable(void);
21 void raw_local_irq_enable(void);
22
23 /*
24  * Used in the idle loop; sti takes one instruction cycle
25  * to complete:
26  */
27 void raw_safe_halt(void);
28
29 /*
30  * Used when interrupts are already enabled or to
31  * shutdown the processor:
32  */
33 void halt(void);
34
35 static inline int raw_irqs_disabled_flags(unsigned long flags)
36 {
37         return flags != 0;
38 }
39
40 int raw_irqs_disabled(void);
41
42 /*
43  * For spinlocks, etc:
44  */
45 unsigned long __raw_local_irq_save(void);
46 #define raw_local_irq_save(flags) \
47                 do { (flags) = __raw_local_irq_save(); } while (0)
48
49 #endif /* __ASSEMBLY__ */
50
51 /*
52  * Do the CPU's IRQ-state tracing from assembly code. We call a
53  * C function, so save all the C-clobbered registers:
54  */
55 #ifdef CONFIG_TRACE_IRQFLAGS
56
57 # define TRACE_IRQS_ON                          \
58         pushl %eax;                             \
59         pushl %ecx;                             \
60         pushl %edx;                             \
61         call trace_hardirqs_on;                 \
62         popl %edx;                              \
63         popl %ecx;                              \
64         popl %eax;
65
66 # define TRACE_IRQS_OFF                         \
67         pushl %eax;                             \
68         pushl %ecx;                             \
69         pushl %edx;                             \
70         call trace_hardirqs_off;                \
71         popl %edx;                              \
72         popl %ecx;                              \
73         popl %eax;
74
75 #else
76 # define TRACE_IRQS_ON
77 # define TRACE_IRQS_OFF
78 #endif
79
80 #endif