aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-12-08 10:22:20 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-12-08 11:05:26 -0500
commitefe90d273b6f365d37c0f82fbbd68a40982c3265 (patch)
treea065719ebabfd6fa8b41e5a01fc5ff0c7ad3e80c /include/asm-arm
parentc99767974ebd2a719d849fdeaaa1674456f5283f (diff)
[ARM] Handle HWCAP_VFP in VFP support code
Don't set HWCAP_VFP in the processor support file; not only does it depend on the processor features, but it also depends on the support code being present. Therefore, only set it if the support code detects that we have a VFP coprocessor attached. Also, move the VFP handling of the coprocessor access register into the VFP support code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/system.h43
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) \ 142static 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; \ 149static 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
159static 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
167static 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
156extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ 173extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
157extern unsigned long cr_alignment; /* defined in entry-armv.S */ 174extern unsigned long cr_alignment; /* defined in entry-armv.S */