summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/barrier.h
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2016-09-06 18:40:23 +0300
committerWill Deacon <will.deacon@arm.com>2016-09-09 20:12:28 +0300
commitf99a250cb6a3b301b101b4c0f5fcb80593bba6dc (patch)
treef22f51a75b8215b43807ba2186ec8f9e0a9d5827 /arch/arm64/include/asm/barrier.h
parent8a71f0c656e0521867931eecff54eb3a35ca65a7 (diff)
downloadlinux-f99a250cb6a3b301b101b4c0f5fcb80593bba6dc.tar.xz
arm64: barriers: introduce nops and __nops macros for NOP sequences
NOP sequences tend to get used for padding out alternative sections and uarch-specific pipeline flushes in errata workarounds. This patch adds macros for generating these sequences as both inline asm blocks, but also as strings suitable for embedding in other asm blocks directly. Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/barrier.h')
-rw-r--r--arch/arm64/include/asm/barrier.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
index 4eea7f618dce..4e0497f581a0 100644
--- a/arch/arm64/include/asm/barrier.h
+++ b/arch/arm64/include/asm/barrier.h
@@ -20,6 +20,9 @@
#ifndef __ASSEMBLY__
+#define __nops(n) ".rept " #n "\nnop\n.endr\n"
+#define nops(n) asm volatile(__nops(n))
+
#define sev() asm volatile("sev" : : : "memory")
#define wfe() asm volatile("wfe" : : : "memory")
#define wfi() asm volatile("wfi" : : : "memory")