summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/include/asm/system.h')
-rw-r--r--arch/arm/include/asm/system.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 7a40b56acd..b8c1b4ea74 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -133,14 +133,16 @@ enum dcache_option {
static inline unsigned int current_el(void)
{
- unsigned int el;
+ unsigned long el;
+
asm volatile("mrs %0, CurrentEL" : "=r" (el) : : "cc");
- return el >> 2;
+ return 3 & (el >> 2);
}
static inline unsigned int get_sctlr(void)
{
- unsigned int el, val;
+ unsigned int el;
+ unsigned long val;
el = current_el();
if (el == 1)
@@ -153,7 +155,7 @@ static inline unsigned int get_sctlr(void)
return val;
}
-static inline void set_sctlr(unsigned int val)
+static inline void set_sctlr(unsigned long val)
{
unsigned int el;