1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2019, Linaro Limited 4 */ 5 #ifndef ARM_USER_SYSREG_H 6 #define ARM_USER_SYSREG_H 7 8 #include <util.h> 9 10 #ifdef ARM32 11 #include <arm32_user_sysreg.h> 12 #endif 13 14 #ifdef ARM64 15 #include <arm64_user_sysreg.h> 16 #endif 17 18 #ifndef __ASSEMBLER__ isb(void)19static inline __noprof void isb(void) 20 { 21 asm volatile ("isb"); 22 } 23 barrier_read_counter_timer(void)24static inline __noprof uint64_t barrier_read_counter_timer(void) 25 { 26 isb(); 27 #ifdef CFG_CORE_SEL2_SPMC 28 return read_cntvct(); 29 #else 30 return read_cntpct(); 31 #endif 32 } 33 #endif 34 35 #endif /*ARM_USER_SYSREG_H*/ 36