From: Andi Kleen Date: Wed, 11 Jan 2006 21:45:18 +0000 (+0100) Subject: [PATCH] x86_64: Support alternative() with a output argument. X-Git-Tag: v2.6.16-rc1~322 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e54d95f73bbc79171802a1983e0c3835676db88;p=linux-2.6 [PATCH] x86_64: Support alternative() with a output argument. Needed for follow on patches Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index a3bca7552e..8027219057 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h @@ -137,6 +137,21 @@ struct alt_instr { "663:\n\t" newinstr "\n664:\n" /* replacement */ \ ".previous" :: "i" (feature), ##input) +/* Like alternative_input, but with a single output argument */ +#define alternative_io(oldinstr, newinstr, feature, output, input...) \ + asm volatile ("661:\n\t" oldinstr "\n662:\n" \ + ".section .altinstructions,\"a\"\n" \ + " .align 8\n" \ + " .quad 661b\n" /* label */ \ + " .quad 663f\n" /* new instruction */ \ + " .byte %c[feat]\n" /* feature bit */ \ + " .byte 662b-661b\n" /* sourcelen */ \ + " .byte 664f-663f\n" /* replacementlen */ \ + ".previous\n" \ + ".section .altinstr_replacement,\"ax\"\n" \ + "663:\n\t" newinstr "\n664:\n" /* replacement */ \ + ".previous" : output : [feat] "i" (feature), ##input) + /* * Clear and set 'TS' bit respectively */