1 /* Automatically generated, do not edit */
2 #ifndef __ARM32_USER_SYSREG_H
3 #define __ARM32_USER_SYSREG_H
4 #include <compiler.h>
5 /* Based on register description in */
6 /* ARM Architecture Reference Manual */
7 /* ARMv7-A and ARMv7-R edition */
8 /* Issue C.c */
9
10 /* B8.2 Generic Timer registers summary */
11
12 /* Counter Frequency register */
read_cntfrq(void)13 static inline __noprof uint32_t read_cntfrq(void)
14 {
15 uint32_t v;
16
17 asm volatile ("mrc p15, 0, %0, c14, c0, 0" : "=r" (v));
18
19 return v;
20 }
21
22 /* Counter Frequency register */
write_cntfrq(uint32_t v)23 static inline __noprof void write_cntfrq(uint32_t v)
24 {
25 asm volatile ("mcr p15, 0, %0, c14, c0, 0" : : "r" (v));
26 }
27
28 /* Physical Count register */
read_cntpct(void)29 static inline __noprof uint64_t read_cntpct(void)
30 {
31 uint64_t v;
32
33 asm volatile ("mrrc p15, 0, %Q0, %R0, c14" : "=r" (v));
34
35 return v;
36 }
37
38 /* Physical Count register */
write_cntpct(uint64_t v)39 static inline __noprof void write_cntpct(uint64_t v)
40 {
41 asm volatile ("mcrr p15, 0, %Q0, %R0, c14" : : "r" (v));
42 }
43 #endif /*__ARM32_USER_SYSREG_H*/
44