aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/system.h')
-rw-r--r--include/asm-arm/system.h52
1 files changed, 36 insertions, 16 deletions
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index f05fbe31576c..aa223fc546af 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -73,6 +73,7 @@
73#ifndef __ASSEMBLY__ 73#ifndef __ASSEMBLY__
74 74
75#include <linux/linkage.h> 75#include <linux/linkage.h>
76#include <linux/irqflags.h>
76 77
77struct thread_info; 78struct thread_info;
78struct task_struct; 79struct task_struct;
@@ -139,23 +140,44 @@ static inline int cpu_is_xsc3(void)
139#define cpu_is_xscale() 1 140#define cpu_is_xscale() 1
140#endif 141#endif
141 142
142#define set_cr(x) \
143 __asm__ __volatile__( \
144 "mcr p15, 0, %0, c1, c0, 0 @ set CR" \
145 : : "r" (x) : "cc")
146
147#define get_cr() \
148 ({ \
149 unsigned int __val; \
150 __asm__ __volatile__( \
151 "mrc p15, 0, %0, c1, c0, 0 @ get CR" \
152 : "=r" (__val) : : "cc"); \
153 __val; \
154 })
155
156extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ 143extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
157extern unsigned long cr_alignment; /* defined in entry-armv.S */ 144extern unsigned long cr_alignment; /* defined in entry-armv.S */
158 145
146static inline unsigned int get_cr(void)
147{
148 unsigned int val;
149 asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
150 return val;
151}
152
153static inline void set_cr(unsigned int val)
154{
155 asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
156 : : "r" (val) : "cc");
157}
158
159#ifndef CONFIG_SMP
160extern void adjust_cr(unsigned long mask, unsigned long set);
161#endif
162
163#define CPACC_FULL(n) (3 << (n * 2))
164#define CPACC_SVC(n) (1 << (n * 2))
165#define CPACC_DISABLE(n) (0 << (n * 2))
166
167static inline unsigned int get_copro_access(void)
168{
169 unsigned int val;
170 asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"
171 : "=r" (val) : : "cc");
172 return val;
173}
174
175static inline void set_copro_access(unsigned int val)
176{
177 asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
178 : : "r" (val) : "cc");
179}
180
159#define UDBG_UNDEFINED (1 << 0) 181#define UDBG_UNDEFINED (1 << 0)
160#define UDBG_SYSCALL (1 << 1) 182#define UDBG_SYSCALL (1 << 1)
161#define UDBG_BADABORT (1 << 2) 183#define UDBG_BADABORT (1 << 2)
@@ -211,8 +233,6 @@ static inline void sched_cacheflush(void)
211{ 233{
212} 234}
213 235
214#include <linux/irqflags.h>
215
216#ifdef CONFIG_SMP 236#ifdef CONFIG_SMP
217 237
218#define smp_mb() mb() 238#define smp_mb() mb()