Home | History | Annotate | Line # | Download | only in include
asm.h revision 1.5.2.1
      1  1.5.2.1        ad /* $NetBSD: asm.h,v 1.5.2.1 2020/01/25 22:38:36 ad Exp $ */
      2      1.1      matt 
      3      1.1      matt #ifndef _AARCH64_ASM_H_
      4      1.1      matt #define _AARCH64_ASM_H_
      5      1.1      matt 
      6      1.1      matt #include <arm/asm.h>
      7      1.1      matt 
      8      1.4     joerg #ifdef __aarch64__
      9  1.5.2.1        ad 
     10  1.5.2.1        ad #ifdef __ASSEMBLER__
     11  1.5.2.1        ad .macro	adrl 	reg, addr
     12  1.5.2.1        ad 	adrp	\reg, \addr
     13  1.5.2.1        ad 	add	\reg, \reg, #:lo12:\addr
     14  1.5.2.1        ad .endm
     15  1.5.2.1        ad #endif
     16  1.5.2.1        ad 
     17      1.3  christos #define	fp	x29
     18      1.3  christos #define	lr	x30
     19      1.5       ryo 
     20      1.5       ryo /*
     21      1.5       ryo  * Add a speculation barrier after the 'eret'.
     22      1.5       ryo  * Some aarch64 cpus speculatively execute instructions after 'eret',
     23      1.5       ryo  * and this potentiates side-channel attacks.
     24      1.5       ryo  */
     25      1.5       ryo #define	ERET	\
     26      1.5       ryo 	eret; dsb sy; isb
     27      1.5       ryo 
     28      1.4     joerg #endif
     29      1.3  christos 
     30      1.1      matt #endif /* !_AARCH64_ASM_H_ */
     31