xref: /netbsd-src/sys/arch/aarch64/include/asm.h (revision 5dd36a3bc8bf2a9dec29ceb6349550414570c447)
1 /* $NetBSD: asm.h,v 1.6 2020/01/19 16:12:56 skrll Exp $ */
2 
3 #ifndef _AARCH64_ASM_H_
4 #define _AARCH64_ASM_H_
5 
6 #include <arm/asm.h>
7 
8 #ifdef __aarch64__
9 
10 #ifdef __ASSEMBLER__
11 .macro	adrl 	reg, addr
12 	adrp	\reg, \addr
13 	add	\reg, \reg, #:lo12:\addr
14 .endm
15 #endif
16 
17 #define	fp	x29
18 #define	lr	x30
19 
20 /*
21  * Add a speculation barrier after the 'eret'.
22  * Some aarch64 cpus speculatively execute instructions after 'eret',
23  * and this potentiates side-channel attacks.
24  */
25 #define	ERET	\
26 	eret; dsb sy; isb
27 
28 #endif
29 
30 #endif /* !_AARCH64_ASM_H_ */
31