ARM: domains: move initial domain setting value to asm/domains.h
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 21 Aug 2015 08:23:26 +0000 (09:23 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 21 Aug 2015 12:55:51 +0000 (13:55 +0100)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/domain.h
arch/arm/kernel/head.S

index 045b9b453bcdc1e8ad9091d8ac0c972ab56ed44d..4218f88e8f7e0cae1b3b015a27b8900829f2aa15 100644 (file)
 #define domain_mask(dom)       ((3) << (2 * (dom)))
 #define domain_val(dom,type)   ((type) << (2 * (dom)))
 
+#define DACR_INIT \
+       (domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
+        domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
+        domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \
+        domain_val(DOMAIN_IO, DOMAIN_CLIENT))
+
 #ifndef __ASSEMBLY__
 
 static inline unsigned int get_domain(void)
index bd755d97e459d77ff05cc8a1264f336c58c1b598..d56e5e9a9e1ecb45bccc9446f2bab3d479135250 100644 (file)
@@ -461,10 +461,7 @@ __enable_mmu:
 #ifdef CONFIG_ARM_LPAE
        mcrr    p15, 0, r4, r5, c2              @ load TTBR0
 #else
-       mov     r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
-                     domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
-                     domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \
-                     domain_val(DOMAIN_IO, DOMAIN_CLIENT))
+       mov     r5, #DACR_INIT
        mcr     p15, 0, r5, c3, c0, 0           @ load domain access register
        mcr     p15, 0, r4, c2, c0, 0           @ load page table pointer
 #endif