diff options
author | Andi Kleen <ak@suse.de> | 2006-01-11 16:45:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-11 22:04:57 -0500 |
commit | 6e54d95f73bbc79171802a1983e0c3835676db88 (patch) | |
tree | 83b5ff3175f0b3fe445912cfaa98318d8b3ee24a /include/asm-x86_64/system.h | |
parent | 737c5c3bde5641af9c24e3a60366674af72a43ef (diff) |
[PATCH] x86_64: Support alternative() with a output argument.
Needed for follow on patches
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-x86_64/system.h')
-rw-r--r-- | include/asm-x86_64/system.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index a3bca7552e14..80272190570e 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -137,6 +137,21 @@ struct alt_instr { | |||
137 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | 137 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ |
138 | ".previous" :: "i" (feature), ##input) | 138 | ".previous" :: "i" (feature), ##input) |
139 | 139 | ||
140 | /* Like alternative_input, but with a single output argument */ | ||
141 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | ||
142 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
143 | ".section .altinstructions,\"a\"\n" \ | ||
144 | " .align 8\n" \ | ||
145 | " .quad 661b\n" /* label */ \ | ||
146 | " .quad 663f\n" /* new instruction */ \ | ||
147 | " .byte %c[feat]\n" /* feature bit */ \ | ||
148 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
149 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
150 | ".previous\n" \ | ||
151 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
152 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
153 | ".previous" : output : [feat] "i" (feature), ##input) | ||
154 | |||
140 | /* | 155 | /* |
141 | * Clear and set 'TS' bit respectively | 156 | * Clear and set 'TS' bit respectively |
142 | */ | 157 | */ |