1 1.6 skrll /* $NetBSD: asm.h,v 1.6 2020/01/19 16:12:56 skrll 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.6 skrll 10 1.6 skrll #ifdef __ASSEMBLER__ 11 1.6 skrll .macro adrl reg, addr 12 1.6 skrll adrp \reg, \addr 13 1.6 skrll add \reg, \reg, #:lo12:\addr 14 1.6 skrll .endm 15 1.6 skrll #endif 16 1.6 skrll 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