[2/3] x86/asm: add _ASM_BYTES() macro for a .byte ... opcode sequence
diff mbox series

Message ID 20210510090940.924953-3-hpa@zytor.com
State Accepted
Commit d88be187a6e6f3a97dfa7ddc500bb9ca191b3772
Headers show
Series
  • x86/asm: macro improvements in <asm/asm.h>
Related show

Commit Message

H. Peter Anvin May 10, 2021, 9:09 a.m. UTC
From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Make it easy to create a sequence of bytes that can be used in either
assembly proper on in a C asm() statement.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
---
 arch/x86/include/asm/asm.h | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index c80899ac0192..1a1e22297867 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -13,6 +13,8 @@ 
 # define __ASM_FORM_COMMA(x, ...)	" " __stringify(x,##__VA_ARGS__) ","
 #endif
 
+#define _ASM_BYTES(x, ...)	__ASM_FORM(.byte x,##__VA_ARGS__ ;)
+
 #ifndef __x86_64__
 /* 32 bit */
 # define __ASM_SEL(a,b)		__ASM_FORM(a)