xref: /optee_os/lib/libutee/include/arm_user_sysreg.h (revision 9fc2442cc66c279cb962c90c4375746fc9b28bb9)
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__
19 static inline __noprof void isb(void)
20 {
21 	asm volatile ("isb");
22 }
23 
24 static inline __noprof uint64_t barrier_read_cntpct(void)
25 {
26 	isb();
27 	return read_cntpct();
28 }
29 #endif
30 
31 #endif /*ARM_USER_SYSREG_H*/
32