1 1.2.2.2 martin /* $NetBSD: asm.h,v 1.2.2.2 2020/04/13 08:03:27 martin 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.2.2.2 martin #ifdef __aarch64__ 9 1.2.2.2 martin 10 1.2.2.2 martin #ifdef __ASSEMBLER__ 11 1.2.2.2 martin .macro adrl reg, addr 12 1.2.2.2 martin adrp \reg, \addr 13 1.2.2.2 martin add \reg, \reg, #:lo12:\addr 14 1.2.2.2 martin .endm 15 1.2.2.2 martin #endif 16 1.2.2.2 martin 17 1.2.2.1 christos #define fp x29 18 1.2.2.1 christos #define lr x30 19 1.2.2.1 christos 20 1.2.2.2 martin /* 21 1.2.2.2 martin * Add a speculation barrier after the 'eret'. 22 1.2.2.2 martin * Some aarch64 cpus speculatively execute instructions after 'eret', 23 1.2.2.2 martin * and this potentiates side-channel attacks. 24 1.2.2.2 martin */ 25 1.2.2.2 martin #define ERET \ 26 1.2.2.2 martin eret; dsb sy; isb 27 1.2.2.2 martin 28 1.2.2.2 martin #endif 29 1.2.2.2 martin 30 1.1 matt #endif /* !_AARCH64_ASM_H_ */ 31