GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / sparc / include / asm / irqflags_64.h
blobbfa1ea45b4cdb893ee9814e077c9fafdda3daff8
1 /*
2 * include/asm/irqflags.h
4 * IRQ flags handling
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
13 #include <asm/pil.h>
15 #ifndef __ASSEMBLY__
17 static inline unsigned long __raw_local_save_flags(void)
19 unsigned long flags;
21 __asm__ __volatile__(
22 "rdpr %%pil, %0"
23 : "=r" (flags)
26 return flags;
29 #define raw_local_save_flags(flags) \
30 do { (flags) = __raw_local_save_flags(); } while (0)
32 static inline void raw_local_irq_restore(unsigned long flags)
34 __asm__ __volatile__(
35 "wrpr %0, %%pil"
36 : /* no output */
37 : "r" (flags)
38 : "memory"
42 static inline void raw_local_irq_disable(void)
44 __asm__ __volatile__(
45 "wrpr %0, %%pil"
46 : /* no outputs */
47 : "i" (PIL_NORMAL_MAX)
48 : "memory"
52 static inline void raw_local_irq_enable(void)
54 __asm__ __volatile__(
55 "wrpr 0, %%pil"
56 : /* no outputs */
57 : /* no inputs */
58 : "memory"
62 static inline int raw_irqs_disabled_flags(unsigned long flags)
64 return (flags > 0);
67 static inline int raw_irqs_disabled(void)
69 unsigned long flags = __raw_local_save_flags();
71 return raw_irqs_disabled_flags(flags);
75 * For spinlocks, etc:
77 static inline unsigned long __raw_local_irq_save(void)
79 unsigned long flags, tmp;
81 /* Disable interrupts to PIL_NORMAL_MAX unless we already
82 * are using PIL_NMI, in which case PIL_NMI is retained.
84 * The only values we ever program into the %pil are 0,
85 * PIL_NORMAL_MAX and PIL_NMI.
87 * Since PIL_NMI is the largest %pil value and all bits are
88 * set in it (0xf), it doesn't matter what PIL_NORMAL_MAX
89 * actually is.
91 __asm__ __volatile__(
92 "rdpr %%pil, %0\n\t"
93 "or %0, %2, %1\n\t"
94 "wrpr %1, 0x0, %%pil"
95 : "=r" (flags), "=r" (tmp)
96 : "i" (PIL_NORMAL_MAX)
97 : "memory"
100 return flags;
103 #define raw_local_irq_save(flags) \
104 do { (flags) = __raw_local_irq_save(); } while (0)
106 #endif /* (__ASSEMBLY__) */
108 #endif /* !(_ASM_IRQFLAGS_H) */