This source file includes following definitions.
- get_cr
- set_cr
1
2
3
4
5
6
7 #ifndef __UNICORE_HWDEF_COPRO_H__
8 #define __UNICORE_HWDEF_COPRO_H__
9
10
11
12
13 #define CR_M (1 << 0)
14 #define CR_A (1 << 1)
15 #define CR_D (1 << 2)
16 #define CR_I (1 << 3)
17 #define CR_B (1 << 4)
18 #define CR_T (1 << 5)
19 #define CR_V (1 << 13)
20
21 #ifndef __ASSEMBLY__
22
23 #define vectors_high() (cr_alignment & CR_V)
24
25 extern unsigned long cr_no_alignment;
26 extern unsigned long cr_alignment;
27
28 static inline unsigned int get_cr(void)
29 {
30 unsigned int val;
31 asm("movc %0, p0.c1, #0" : "=r" (val) : : "cc");
32 return val;
33 }
34
35 static inline void set_cr(unsigned int val)
36 {
37 asm volatile("movc p0.c1, %0, #0" : : "r" (val) : "cc");
38 isb();
39 }
40
41 extern void adjust_cr(unsigned long mask, unsigned long set);
42
43 #endif
44
45 #endif