Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: use get_cr() rather than cr_alignment

Rather than reading the cr_alignment variable, use get_cr() to read
directly from the hardware instead. We have two places where this
occurs, neither of them are performance critical.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+8 -3
+6 -1
arch/arm/include/asm/cp15.h
··· 42 42 #ifndef __ASSEMBLY__ 43 43 44 44 #if __LINUX_ARM_ARCH__ >= 4 45 - #define vectors_high() (cr_alignment & CR_V) 45 + #define vectors_high() (get_cr() & CR_V) 46 46 #else 47 47 #define vectors_high() (0) 48 48 #endif ··· 112 112 */ 113 113 #define cr_no_alignment UL(0) 114 114 #define cr_alignment UL(0) 115 + 116 + static inline unsigned long get_cr(void) 117 + { 118 + return 0; 119 + } 115 120 116 121 #endif /* ifdef CONFIG_CPU_CP15 / else */ 117 122
+1 -1
arch/arm/kernel/setup.c
··· 590 590 591 591 pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", 592 592 cpu_name, read_cpuid_id(), read_cpuid_id() & 15, 593 - proc_arch[cpu_architecture()], cr_alignment); 593 + proc_arch[cpu_architecture()], get_cr()); 594 594 595 595 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c", 596 596 list->arch_name, ENDIANNESS);
+1 -1
arch/arm/mm/alignment.c
··· 91 91 /* Return true if and only if the ARMv6 unaligned access model is in use. */ 92 92 static bool cpu_is_v6_unaligned(void) 93 93 { 94 - return cpu_architecture() >= CPU_ARCH_ARMv6 && (cr_alignment & CR_U); 94 + return cpu_architecture() >= CPU_ARCH_ARMv6 && get_cr() & CR_U; 95 95 } 96 96 97 97 static int safe_usermode(int new_usermode, bool warn)