diff options
author | Paul Mackerras <paulus@samba.org> | 2006-08-31 01:45:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-08-31 01:45:48 -0400 |
commit | aa43f77939c97bf9d3580c6a5e71a5a40290e451 (patch) | |
tree | 095c0b8b3da4b6554a3f8ef4b39240a5d9216d4d /include/asm-x86_64/alternative.h | |
parent | 2818c5dec5e28d65d52afbb7695bbbafe6377ee5 (diff) | |
parent | 4c15343167b5febe7bb0ba96aad5bef42ae94d3b (diff) |
Merge branch 'merge'
Diffstat (limited to 'include/asm-x86_64/alternative.h')
-rw-r--r-- | include/asm-x86_64/alternative.h | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h index aa67bfd1b3c..a584826cc57 100644 --- a/include/asm-x86_64/alternative.h +++ b/include/asm-x86_64/alternative.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <asm/cpufeature.h> | ||
7 | 8 | ||
8 | struct alt_instr { | 9 | struct alt_instr { |
9 | u8 *instr; /* original instruction */ | 10 | u8 *instr; /* original instruction */ |
@@ -102,9 +103,6 @@ static inline void alternatives_smp_switch(int smp) {} | |||
102 | /* | 103 | /* |
103 | * Alternative inline assembly for SMP. | 104 | * Alternative inline assembly for SMP. |
104 | * | 105 | * |
105 | * alternative_smp() takes two versions (SMP first, UP second) and is | ||
106 | * for more complex stuff such as spinlocks. | ||
107 | * | ||
108 | * The LOCK_PREFIX macro defined here replaces the LOCK and | 106 | * The LOCK_PREFIX macro defined here replaces the LOCK and |
109 | * LOCK_PREFIX macros used everywhere in the source tree. | 107 | * LOCK_PREFIX macros used everywhere in the source tree. |
110 | * | 108 | * |
@@ -124,21 +122,6 @@ static inline void alternatives_smp_switch(int smp) {} | |||
124 | */ | 122 | */ |
125 | 123 | ||
126 | #ifdef CONFIG_SMP | 124 | #ifdef CONFIG_SMP |
127 | #define alternative_smp(smpinstr, upinstr, args...) \ | ||
128 | asm volatile ("661:\n\t" smpinstr "\n662:\n" \ | ||
129 | ".section .smp_altinstructions,\"a\"\n" \ | ||
130 | " .align 8\n" \ | ||
131 | " .quad 661b\n" /* label */ \ | ||
132 | " .quad 663f\n" /* new instruction */ \ | ||
133 | " .byte 0x66\n" /* X86_FEATURE_UP */ \ | ||
134 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
135 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
136 | ".previous\n" \ | ||
137 | ".section .smp_altinstr_replacement,\"awx\"\n" \ | ||
138 | "663:\n\t" upinstr "\n" /* replacement */ \ | ||
139 | "664:\n\t.fill 662b-661b,1,0x42\n" /* space for original */ \ | ||
140 | ".previous" : args) | ||
141 | |||
142 | #define LOCK_PREFIX \ | 125 | #define LOCK_PREFIX \ |
143 | ".section .smp_locks,\"a\"\n" \ | 126 | ".section .smp_locks,\"a\"\n" \ |
144 | " .align 8\n" \ | 127 | " .align 8\n" \ |
@@ -147,8 +130,6 @@ static inline void alternatives_smp_switch(int smp) {} | |||
147 | "661:\n\tlock; " | 130 | "661:\n\tlock; " |
148 | 131 | ||
149 | #else /* ! CONFIG_SMP */ | 132 | #else /* ! CONFIG_SMP */ |
150 | #define alternative_smp(smpinstr, upinstr, args...) \ | ||
151 | asm volatile (upinstr : args) | ||
152 | #define LOCK_PREFIX "" | 133 | #define LOCK_PREFIX "" |
153 | #endif | 134 | #endif |
154 | 135 | ||