From 7b911d96d02d3bc58f0a6952c7c4b374e55d8ff5 Mon Sep 17 00:00:00 2001 From: Zwane Mwaikambo Date: Mon, 18 Oct 2004 18:11:08 -0700 Subject: [PATCH] [PATCH] Allow multiple inputs in alternative_input 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/system.h | 4 ++-- include/asm-x86_64/system.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index d4bb72a58ad52..9bb0f63ff64e2 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -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. diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index 6671eb65500bb..55ac71fd4a60b 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h @@ -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 -- 2.53.0