[PATCH 10/20] x86/alternative: Add alternative_2_io()

Josh Poimboeuf posted 20 patches 9 months, 1 week ago
[PATCH 10/20] x86/alternative: Add alternative_2_io()
Posted by Josh Poimboeuf 9 months, 1 week ago
Make an ALTERNATIVE_2() version of alternative_io().

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 arch/x86/include/asm/alternative.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index 870b1633e1e0..0acbb013e7ae 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -231,6 +231,14 @@ static inline int alternatives_text_reserved(void *start, void *end)
 			    : input							\
 			    : "memory", ## clobbers)
 
+#define alternative_2_io(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2,		\
+			 output, input, clobbers...)					\
+	asm_inline volatile(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1,		\
+					  newinstr2, ft_flags2)				\
+			    : output							\
+			    : input							\
+			    : "memory", ## clobbers)
+
 /*
  * Like alternative_io, but for replacing a direct call with another one.
  *
-- 
2.48.1