diff options
author | Andi Kleen <ak@suse.de> | 2007-05-02 13:27:10 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:10 -0400 |
commit | b4531e863dbd06b5d336afefdb37483b690dea59 (patch) | |
tree | 31d481e2b1b9727b6ee180ce876b73fbc0983a15 /include | |
parent | 78eea47ac3e256559d97f0c2434928be39cba524 (diff) |
[PATCH] i386: Use X86_EFLAGS_IF in irqflags.h.
Move X86_EFLAGS_IF et al out to a new header: processor-flags.h, so we
can include it from irqflags.h and use it in raw_irqs_disabled_flags().
As a side-effect, we could now use these flags in .S files.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/irqflags.h | 3 | ||||
-rw-r--r-- | include/asm-i386/processor-flags.h | 26 | ||||
-rw-r--r-- | include/asm-i386/processor.h | 22 |
3 files changed, 29 insertions, 22 deletions
diff --git a/include/asm-i386/irqflags.h b/include/asm-i386/irqflags.h index c1cdd094938e..eff8585cb741 100644 --- a/include/asm-i386/irqflags.h +++ b/include/asm-i386/irqflags.h | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | #ifndef _ASM_IRQFLAGS_H | 10 | #ifndef _ASM_IRQFLAGS_H |
11 | #define _ASM_IRQFLAGS_H | 11 | #define _ASM_IRQFLAGS_H |
12 | #include <asm/processor-flags.h> | ||
12 | 13 | ||
13 | #ifndef __ASSEMBLY__ | 14 | #ifndef __ASSEMBLY__ |
14 | static inline unsigned long native_save_fl(void) | 15 | static inline unsigned long native_save_fl(void) |
@@ -119,7 +120,7 @@ static inline unsigned long __raw_local_irq_save(void) | |||
119 | 120 | ||
120 | static inline int raw_irqs_disabled_flags(unsigned long flags) | 121 | static inline int raw_irqs_disabled_flags(unsigned long flags) |
121 | { | 122 | { |
122 | return !(flags & (1 << 9)); | 123 | return !(flags & X86_EFLAGS_IF); |
123 | } | 124 | } |
124 | 125 | ||
125 | static inline int raw_irqs_disabled(void) | 126 | static inline int raw_irqs_disabled(void) |
diff --git a/include/asm-i386/processor-flags.h b/include/asm-i386/processor-flags.h new file mode 100644 index 000000000000..b4711c222e2b --- /dev/null +++ b/include/asm-i386/processor-flags.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef __ASM_I386_PROCESSOR_FLAGS_H | ||
2 | #define __ASM_I386_PROCESSOR_FLAGS_H | ||
3 | /* Various flags defined: can be included from assembler. */ | ||
4 | |||
5 | /* | ||
6 | * EFLAGS bits | ||
7 | */ | ||
8 | #define X86_EFLAGS_CF 0x00000001 /* Carry Flag */ | ||
9 | #define X86_EFLAGS_PF 0x00000004 /* Parity Flag */ | ||
10 | #define X86_EFLAGS_AF 0x00000010 /* Auxillary carry Flag */ | ||
11 | #define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */ | ||
12 | #define X86_EFLAGS_SF 0x00000080 /* Sign Flag */ | ||
13 | #define X86_EFLAGS_TF 0x00000100 /* Trap Flag */ | ||
14 | #define X86_EFLAGS_IF 0x00000200 /* Interrupt Flag */ | ||
15 | #define X86_EFLAGS_DF 0x00000400 /* Direction Flag */ | ||
16 | #define X86_EFLAGS_OF 0x00000800 /* Overflow Flag */ | ||
17 | #define X86_EFLAGS_IOPL 0x00003000 /* IOPL mask */ | ||
18 | #define X86_EFLAGS_NT 0x00004000 /* Nested Task */ | ||
19 | #define X86_EFLAGS_RF 0x00010000 /* Resume Flag */ | ||
20 | #define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */ | ||
21 | #define X86_EFLAGS_AC 0x00040000 /* Alignment Check */ | ||
22 | #define X86_EFLAGS_VIF 0x00080000 /* Virtual Interrupt Flag */ | ||
23 | #define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */ | ||
24 | #define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ | ||
25 | |||
26 | #endif /* __ASM_I386_PROCESSOR_FLAGS_H */ | ||
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 96edfdfe32d1..11838df88603 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/percpu.h> | 21 | #include <asm/percpu.h> |
22 | #include <linux/cpumask.h> | 22 | #include <linux/cpumask.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <asm/processor-flags.h> | ||
24 | 25 | ||
25 | /* flag for disabling the tsc */ | 26 | /* flag for disabling the tsc */ |
26 | extern int tsc_disable; | 27 | extern int tsc_disable; |
@@ -126,27 +127,6 @@ extern void detect_ht(struct cpuinfo_x86 *c); | |||
126 | static inline void detect_ht(struct cpuinfo_x86 *c) {} | 127 | static inline void detect_ht(struct cpuinfo_x86 *c) {} |
127 | #endif | 128 | #endif |
128 | 129 | ||
129 | /* | ||
130 | * EFLAGS bits | ||
131 | */ | ||
132 | #define X86_EFLAGS_CF 0x00000001 /* Carry Flag */ | ||
133 | #define X86_EFLAGS_PF 0x00000004 /* Parity Flag */ | ||
134 | #define X86_EFLAGS_AF 0x00000010 /* Auxillary carry Flag */ | ||
135 | #define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */ | ||
136 | #define X86_EFLAGS_SF 0x00000080 /* Sign Flag */ | ||
137 | #define X86_EFLAGS_TF 0x00000100 /* Trap Flag */ | ||
138 | #define X86_EFLAGS_IF 0x00000200 /* Interrupt Flag */ | ||
139 | #define X86_EFLAGS_DF 0x00000400 /* Direction Flag */ | ||
140 | #define X86_EFLAGS_OF 0x00000800 /* Overflow Flag */ | ||
141 | #define X86_EFLAGS_IOPL 0x00003000 /* IOPL mask */ | ||
142 | #define X86_EFLAGS_NT 0x00004000 /* Nested Task */ | ||
143 | #define X86_EFLAGS_RF 0x00010000 /* Resume Flag */ | ||
144 | #define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */ | ||
145 | #define X86_EFLAGS_AC 0x00040000 /* Alignment Check */ | ||
146 | #define X86_EFLAGS_VIF 0x00080000 /* Virtual Interrupt Flag */ | ||
147 | #define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */ | ||
148 | #define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ | ||
149 | |||
150 | static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, | 130 | static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, |
151 | unsigned int *ecx, unsigned int *edx) | 131 | unsigned int *ecx, unsigned int *edx) |
152 | { | 132 | { |