summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2021-02-02 17:10:49 +0100
committerVasily Gorbik <gor@linux.ibm.com>2021-02-09 15:57:06 +0100
commit80841ad8d4ca3e91d90e18b4fa0cc1c925e9fad1 (patch)
tree11e9c8d1dd5196ff7582d02dfb13ff31afb4f7a2 /arch/s390/include/asm
parents390/entry: use cpu alternative for stck/stckf (diff)
downloadlinux-80841ad8d4ca3e91d90e18b4fa0cc1c925e9fad1.tar.xz
linux-80841ad8d4ca3e91d90e18b4fa0cc1c925e9fad1.zip
s390/alternatives: add alternative_input() / alternative_io()
Add support for alternative inline assemblies with input and output arguments. This is consistent to x86. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm')
-rw-r--r--arch/s390/include/asm/alternative.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/s390/include/asm/alternative.h b/arch/s390/include/asm/alternative.h
index 1c8a38f762a3..d3880ca764ee 100644
--- a/arch/s390/include/asm/alternative.h
+++ b/arch/s390/include/asm/alternative.h
@@ -145,6 +145,22 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
asm_inline volatile(ALTERNATIVE_2(oldinstr, altinstr1, facility1, \
altinstr2, facility2) ::: "memory")
+/* Alternative inline assembly with input. */
+#define alternative_input(oldinstr, newinstr, feature, input...) \
+ asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, feature) \
+ : : input)
+
+/* Like alternative_input, but with a single output argument */
+#define alternative_io(oldinstr, altinstr, facility, output, input...) \
+ asm_inline volatile(ALTERNATIVE(oldinstr, altinstr, facility) \
+ : output : input)
+
+/* Use this macro if more than one output parameter is needed. */
+#define ASM_OUTPUT2(a...) a
+
+/* Use this macro if clobbers are needed without inputs. */
+#define ASM_NO_INPUT_CLOBBER(clobber...) : clobber
+
#endif /* __ASSEMBLY__ */
#endif /* _ASM_S390_ALTERNATIVE_H */