diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/irqflags.h | 29 | ||||
-rw-r--r-- | include/asm-x86/linkage.h | 35 | ||||
-rw-r--r-- | include/asm-x86/nops.h | 20 |
3 files changed, 73 insertions, 11 deletions
diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h index 92021c1ffa3a..0e2292483b35 100644 --- a/include/asm-x86/irqflags.h +++ b/include/asm-x86/irqflags.h | |||
@@ -70,6 +70,26 @@ static inline void raw_local_irq_restore(unsigned long flags) | |||
70 | native_restore_fl(flags); | 70 | native_restore_fl(flags); |
71 | } | 71 | } |
72 | 72 | ||
73 | #ifdef CONFIG_X86_VSMP | ||
74 | |||
75 | /* | ||
76 | * Interrupt control for the VSMP architecture: | ||
77 | */ | ||
78 | |||
79 | static inline void raw_local_irq_disable(void) | ||
80 | { | ||
81 | unsigned long flags = __raw_local_save_flags(); | ||
82 | raw_local_irq_restore((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC); | ||
83 | } | ||
84 | |||
85 | static inline void raw_local_irq_enable(void) | ||
86 | { | ||
87 | unsigned long flags = __raw_local_save_flags(); | ||
88 | raw_local_irq_restore((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC)); | ||
89 | } | ||
90 | |||
91 | #else | ||
92 | |||
73 | static inline void raw_local_irq_disable(void) | 93 | static inline void raw_local_irq_disable(void) |
74 | { | 94 | { |
75 | native_irq_disable(); | 95 | native_irq_disable(); |
@@ -80,6 +100,8 @@ static inline void raw_local_irq_enable(void) | |||
80 | native_irq_enable(); | 100 | native_irq_enable(); |
81 | } | 101 | } |
82 | 102 | ||
103 | #endif | ||
104 | |||
83 | /* | 105 | /* |
84 | * Used in the idle loop; sti takes one instruction cycle | 106 | * Used in the idle loop; sti takes one instruction cycle |
85 | * to complete: | 107 | * to complete: |
@@ -137,10 +159,17 @@ static inline unsigned long __raw_local_irq_save(void) | |||
137 | #define raw_local_irq_save(flags) \ | 159 | #define raw_local_irq_save(flags) \ |
138 | do { (flags) = __raw_local_irq_save(); } while (0) | 160 | do { (flags) = __raw_local_irq_save(); } while (0) |
139 | 161 | ||
162 | #ifdef CONFIG_X86_VSMP | ||
163 | static inline int raw_irqs_disabled_flags(unsigned long flags) | ||
164 | { | ||
165 | return !(flags & X86_EFLAGS_IF) || (flags & X86_EFLAGS_AC); | ||
166 | } | ||
167 | #else | ||
140 | static inline int raw_irqs_disabled_flags(unsigned long flags) | 168 | static inline int raw_irqs_disabled_flags(unsigned long flags) |
141 | { | 169 | { |
142 | return !(flags & X86_EFLAGS_IF); | 170 | return !(flags & X86_EFLAGS_IF); |
143 | } | 171 | } |
172 | #endif | ||
144 | 173 | ||
145 | static inline int raw_irqs_disabled(void) | 174 | static inline int raw_irqs_disabled(void) |
146 | { | 175 | { |
diff --git a/include/asm-x86/linkage.h b/include/asm-x86/linkage.h index 31739c7d66a9..c048353f4b85 100644 --- a/include/asm-x86/linkage.h +++ b/include/asm-x86/linkage.h | |||
@@ -8,12 +8,45 @@ | |||
8 | 8 | ||
9 | #ifdef CONFIG_X86_32 | 9 | #ifdef CONFIG_X86_32 |
10 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) | 10 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) |
11 | #define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret)) | ||
12 | /* | 11 | /* |
13 | * For 32-bit UML - mark functions implemented in assembly that use | 12 | * For 32-bit UML - mark functions implemented in assembly that use |
14 | * regparm input parameters: | 13 | * regparm input parameters: |
15 | */ | 14 | */ |
16 | #define asmregparm __attribute__((regparm(3))) | 15 | #define asmregparm __attribute__((regparm(3))) |
16 | |||
17 | /* | ||
18 | * Make sure the compiler doesn't do anything stupid with the | ||
19 | * arguments on the stack - they are owned by the *caller*, not | ||
20 | * the callee. This just fools gcc into not spilling into them, | ||
21 | * and keeps it from doing tailcall recursion and/or using the | ||
22 | * stack slots for temporaries, since they are live and "used" | ||
23 | * all the way to the end of the function. | ||
24 | * | ||
25 | * NOTE! On x86-64, all the arguments are in registers, so this | ||
26 | * only matters on a 32-bit kernel. | ||
27 | */ | ||
28 | #define asmlinkage_protect(n, ret, args...) \ | ||
29 | __asmlinkage_protect##n(ret, ##args) | ||
30 | #define __asmlinkage_protect_n(ret, args...) \ | ||
31 | __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args) | ||
32 | #define __asmlinkage_protect0(ret) \ | ||
33 | __asmlinkage_protect_n(ret) | ||
34 | #define __asmlinkage_protect1(ret, arg1) \ | ||
35 | __asmlinkage_protect_n(ret, "g" (arg1)) | ||
36 | #define __asmlinkage_protect2(ret, arg1, arg2) \ | ||
37 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2)) | ||
38 | #define __asmlinkage_protect3(ret, arg1, arg2, arg3) \ | ||
39 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3)) | ||
40 | #define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \ | ||
41 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ | ||
42 | "g" (arg4)) | ||
43 | #define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \ | ||
44 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ | ||
45 | "g" (arg4), "g" (arg5)) | ||
46 | #define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \ | ||
47 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ | ||
48 | "g" (arg4), "g" (arg5), "g" (arg6)) | ||
49 | |||
17 | #endif | 50 | #endif |
18 | 51 | ||
19 | #ifdef CONFIG_X86_ALIGNMENT_16 | 52 | #ifdef CONFIG_X86_ALIGNMENT_16 |
diff --git a/include/asm-x86/nops.h b/include/asm-x86/nops.h index e3b2bce0aff8..b3930ae539b3 100644 --- a/include/asm-x86/nops.h +++ b/include/asm-x86/nops.h | |||
@@ -73,16 +73,7 @@ | |||
73 | #define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" | 73 | #define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" |
74 | #define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" | 74 | #define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" |
75 | 75 | ||
76 | #if defined(CONFIG_MK8) | 76 | #if defined(CONFIG_MK7) |
77 | #define ASM_NOP1 K8_NOP1 | ||
78 | #define ASM_NOP2 K8_NOP2 | ||
79 | #define ASM_NOP3 K8_NOP3 | ||
80 | #define ASM_NOP4 K8_NOP4 | ||
81 | #define ASM_NOP5 K8_NOP5 | ||
82 | #define ASM_NOP6 K8_NOP6 | ||
83 | #define ASM_NOP7 K8_NOP7 | ||
84 | #define ASM_NOP8 K8_NOP8 | ||
85 | #elif defined(CONFIG_MK7) | ||
86 | #define ASM_NOP1 K7_NOP1 | 77 | #define ASM_NOP1 K7_NOP1 |
87 | #define ASM_NOP2 K7_NOP2 | 78 | #define ASM_NOP2 K7_NOP2 |
88 | #define ASM_NOP3 K7_NOP3 | 79 | #define ASM_NOP3 K7_NOP3 |
@@ -100,6 +91,15 @@ | |||
100 | #define ASM_NOP6 P6_NOP6 | 91 | #define ASM_NOP6 P6_NOP6 |
101 | #define ASM_NOP7 P6_NOP7 | 92 | #define ASM_NOP7 P6_NOP7 |
102 | #define ASM_NOP8 P6_NOP8 | 93 | #define ASM_NOP8 P6_NOP8 |
94 | #elif defined(CONFIG_X86_64) | ||
95 | #define ASM_NOP1 K8_NOP1 | ||
96 | #define ASM_NOP2 K8_NOP2 | ||
97 | #define ASM_NOP3 K8_NOP3 | ||
98 | #define ASM_NOP4 K8_NOP4 | ||
99 | #define ASM_NOP5 K8_NOP5 | ||
100 | #define ASM_NOP6 K8_NOP6 | ||
101 | #define ASM_NOP7 K8_NOP7 | ||
102 | #define ASM_NOP8 K8_NOP8 | ||
103 | #else | 103 | #else |
104 | #define ASM_NOP1 GENERIC_NOP1 | 104 | #define ASM_NOP1 GENERIC_NOP1 |
105 | #define ASM_NOP2 GENERIC_NOP2 | 105 | #define ASM_NOP2 GENERIC_NOP2 |