Skip to content

x86/asm: macro improvements in <asm/asm.h>

H. Peter Anvin lkml 1 version Applied

Status from this message: The following commit has been merged into the x86/asm branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3x86/asm: have the __ASM_FORM macros handle commas in argumentsarch/x86/include/asm/asm.h+10 -110 replies
2/3x86/asm: add _ASM_BYTES() macro for a .byte ... opcode sequencearch/x86/include/asm/asm.h+2 -00 replies
3/3x86/asm: use _ASM_BYTES() in <asm/nops.h>arch/x86/include/asm/nops.h tools/arch/x86/include/asm/asm.h tools/arch/x86/include/asm/nops.h+209 -280 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] x86/asm: macro improvements in <asm/asm.h>

From: "H. Peter Anvin (Intel)" <[email protected]>

This patchset adds the following improvements to <asm/asm.h>:

1. Makes the __ASM_FORM() macros accept arguments with commas. This allows the __ASM_FORM() macros to be used directly in header files for macros that can be used from either C or assembly, even for instructions that have multiple operands.
2. Add an _ASM_BYTES() macro for the delicate job of hand-crafting instructions out of bytes.
3. Replace the _ASM_MK_NOPS() macro in <asm/nops.h> with _ASM_BYTES().

The change to the tools/ directory is mainly because <asm/nops.h> now depends on <asm/asm.h>.

---

 arch/x86/include/asm/asm.h        |  23 ++---
 arch/x86/include/asm/nops.h       |  24 ++---
 tools/arch/x86/include/asm/asm.h  | 189 ++++++++++++++++++++++++++++++++++++++
 tools/arch/x86/include/asm/nops.h |  24 ++---
 4 files changed, 221 insertions(+), 39 deletions(-)