summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/asm.h
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2025-03-02 17:21:01 -0800
committerIngo Molnar <mingo@kernel.org>2025-03-04 11:21:40 +0100
commit224788b63a2e426b6b82c76456a068a2ab87610f (patch)
tree721d3b66ef0aff46a437370a9c2c8714830ff131 /arch/x86/include/asm/asm.h
parent9064a8e556fa70ccfd9c414350406ed4887d3059 (diff)
x86/alternatives: Simplify alternative_call() interface
Separate the input from the clobbers in preparation for appending the input. Do this in preparation of changing the ASM_CALL_CONSTRAINT primitive. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'arch/x86/include/asm/asm.h')
-rw-r--r--arch/x86/include/asm/asm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 2bec0c89a95c..975ae7a9397e 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -213,6 +213,17 @@ static __always_inline __pure void *rip_rel_ptr(void *p)
/* For C file, we already have NOKPROBE_SYMBOL macro */
+/* Insert a comma if args are non-empty */
+#define COMMA(x...) __COMMA(x)
+#define __COMMA(...) , ##__VA_ARGS__
+
+/*
+ * Combine multiple asm inline constraint args into a single arg for passing to
+ * another macro.
+ */
+#define ASM_OUTPUT(x...) x
+#define ASM_INPUT(x...) x
+
/*
* This output constraint should be used for any inline asm which has a "call"
* instruction. Otherwise the asm may be inserted before the frame pointer