diff options
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/system.h | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index f05fbe31576c..f60faccf01fa 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -139,19 +139,36 @@ static inline int cpu_is_xsc3(void) | |||
139 | #define cpu_is_xscale() 1 | 139 | #define cpu_is_xscale() 1 |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | #define set_cr(x) \ | 142 | static inline unsigned int get_cr(void) |
143 | __asm__ __volatile__( \ | 143 | { |
144 | "mcr p15, 0, %0, c1, c0, 0 @ set CR" \ | 144 | unsigned int val; |
145 | : : "r" (x) : "cc") | 145 | asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc"); |
146 | 146 | return val; | |
147 | #define get_cr() \ | 147 | } |
148 | ({ \ | 148 | |
149 | unsigned int __val; \ | 149 | static inline void set_cr(unsigned int val) |
150 | __asm__ __volatile__( \ | 150 | { |
151 | "mrc p15, 0, %0, c1, c0, 0 @ get CR" \ | 151 | asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" |
152 | : "=r" (__val) : : "cc"); \ | 152 | : : "r" (val) : "cc"); |
153 | __val; \ | 153 | } |
154 | }) | 154 | |
155 | #define CPACC_FULL(n) (3 << (n * 2)) | ||
156 | #define CPACC_SVC(n) (1 << (n * 2)) | ||
157 | #define CPACC_DISABLE(n) (0 << (n * 2)) | ||
158 | |||
159 | static inline unsigned int get_copro_access(void) | ||
160 | { | ||
161 | unsigned int val; | ||
162 | asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access" | ||
163 | : "=r" (val) : : "cc"); | ||
164 | return val; | ||
165 | } | ||
166 | |||
167 | static inline void set_copro_access(unsigned int val) | ||
168 | { | ||
169 | asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access" | ||
170 | : : "r" (val) : "cc"); | ||
171 | } | ||
155 | 172 | ||
156 | extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ | 173 | extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ |
157 | extern unsigned long cr_alignment; /* defined in entry-armv.S */ | 174 | extern unsigned long cr_alignment; /* defined in entry-armv.S */ |