This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-x86_64 / mach-xen / asm / irqflags.h
1 /*
2  * include/asm-x86_64/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  * Interrupt control:
16  */
17
18 unsigned long __raw_local_save_flags(void);
19 #define raw_local_save_flags(flags) \
20                 do { (flags) = __raw_local_save_flags(); } while (0)
21
22 void raw_local_irq_restore(unsigned long flags);
23 void raw_local_irq_disable(void);
24 void raw_local_irq_enable(void);
25
26 static inline int raw_irqs_disabled_flags(unsigned long flags)
27 {
28         return flags != 0;
29 }
30
31 /*
32  * For spinlocks, etc.:
33  */
34
35 unsigned long __raw_local_irq_save(void);
36
37 #define raw_local_irq_save(flags) \
38                 do { (flags) = __raw_local_irq_save(); } while (0)
39
40 int raw_irqs_disabled(void);
41
42 /*
43  * Used in the idle loop; sti takes one instruction cycle
44  * to complete:
45  */
46 void raw_safe_halt(void);
47
48
49 /*
50  * Used when interrupts are already enabled or to
51  * shutdown the processor:
52  */
53 void halt(void);
54
55 #else /* __ASSEMBLY__: */
56 # ifdef CONFIG_TRACE_IRQFLAGS
57 #  define TRACE_IRQS_ON         call trace_hardirqs_on_thunk
58 #  define TRACE_IRQS_OFF        call trace_hardirqs_off_thunk
59 # else
60 #  define TRACE_IRQS_ON
61 #  define TRACE_IRQS_OFF
62 # endif
63 #endif
64
65 #endif