Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41a30537 authored by Will Deacon's avatar Will Deacon Committed by Amit Pundir
Browse files

BACKPORT: 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: default avatarWill Deacon <will.deacon@arm.com>

Bug: 31432001
Change-Id: I7f82b677a065ede302a763d39ffcc3fef83f8fbe
(cherry picked from commit f99a250cb6a3b301b101b4c0f5fcb80593bba6dc)
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent f284b02c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -108,6 +108,15 @@
	dmb	\opt
	.endm

/*
 * NOP sequence
 */
	.macro	nops, num
	.rept	\num
	nop
	.endr
	.endm

#define USER(l, x...)				\
9999:	x;					\
	.section __ex_table,"a";		\
+3 −0
Original line number Diff line number Diff line
@@ -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")