]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Allow multiple inputs in alternative_input
authorZwane Mwaikambo <zwane@linuxpower.ca>
Tue, 19 Oct 2004 01:11:08 +0000 (18:11 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 19 Oct 2004 01:11:08 +0000 (18:11 -0700)
I had to use the following patch to allow multiple arguments to be passed
down to the asm stub for alternative_input whilst writing alternatives for
mwait code, it seems like a simple enough fix.

Signed-off-by: Zwane Mwaikambo <zwane@linuxpower.ca>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-i386/system.h
include/asm-x86_64/system.h

index d4bb72a58ad5248a0c813b465ef1a271267ab93f..9bb0f63ff64e2916edc178c97898e91ca62b022b 100644 (file)
@@ -321,7 +321,7 @@ struct alt_instr {
  * If you use variable sized constraints like "m" or "g" in the 
  * replacement maake sure to pad to the worst case length.
  */
-#define alternative_input(oldinstr, newinstr, feature, input)                  \
+#define alternative_input(oldinstr, newinstr, feature, input...)               \
        asm volatile ("661:\n\t" oldinstr "\n662:\n"                            \
                      ".section .altinstructions,\"a\"\n"                       \
                      "  .align 4\n"                                            \
@@ -333,7 +333,7 @@ struct alt_instr {
                      ".previous\n"                                             \
                      ".section .altinstr_replacement,\"ax\"\n"                 \
                      "663:\n\t" newinstr "\n664:\n"   /* replacement */        \
-                     ".previous" :: "i" (feature), input)  
+                     ".previous" :: "i" (feature), ##input)
 
 /*
  * Force strict CPU ordering.
index 6671eb65500bbf9216e5b2cc7baf9fc468863afa..55ac71fd4a60b5913c126dda5d5f2dd3e4746257 100644 (file)
@@ -123,7 +123,7 @@ struct alt_instr {
  * If you use variable sized constraints like "m" or "g" in the 
  * replacement maake sure to pad to the worst case length.
  */
-#define alternative_input(oldinstr, newinstr, feature, input)          \
+#define alternative_input(oldinstr, newinstr, feature, input...)       \
        asm volatile ("661:\n\t" oldinstr "\n662:\n"                    \
                      ".section .altinstructions,\"a\"\n"               \
                      "  .align 8\n"                                    \
@@ -135,7 +135,7 @@ struct alt_instr {
                      ".previous\n"                                     \
                      ".section .altinstr_replacement,\"ax\"\n"         \
                      "663:\n\t" newinstr "\n664:\n"   /* replacement */ \
-                     ".previous" :: "i" (feature), input)
+                     ".previous" :: "i" (feature), ##input)
 
 /*
  * Clear and set 'TS' bit respectively