Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4585eaff authored by Russell King's avatar Russell King
Browse files

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7668fd57
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
#ifndef __ASSEMBLY__

#if __LINUX_ARM_ARCH__ >= 4
#define vectors_high()	(cr_alignment & CR_V)
#define vectors_high()	(get_cr() & CR_V)
#else
#define vectors_high()	(0)
#endif
@@ -113,6 +113,11 @@ static inline void set_copro_access(unsigned int val)
#define cr_no_alignment	UL(0)
#define cr_alignment	UL(0)

static inline unsigned long get_cr(void)
{
	return 0;
}

#endif /* ifdef CONFIG_CPU_CP15 / else */

#endif /* ifndef __ASSEMBLY__ */
+1 −1
Original line number Diff line number Diff line
@@ -590,7 +590,7 @@ static void __init setup_processor(void)

	pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
		cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
		proc_arch[cpu_architecture()], cr_alignment);
		proc_arch[cpu_architecture()], get_cr());

	snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
		 list->arch_name, ENDIANNESS);
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ core_param(alignment, ai_usermode, int, 0600);
/* Return true if and only if the ARMv6 unaligned access model is in use. */
static bool cpu_is_v6_unaligned(void)
{
	return cpu_architecture() >= CPU_ARCH_ARMv6 && (cr_alignment & CR_U);
	return cpu_architecture() >= CPU_ARCH_ARMv6 && get_cr() & CR_U;
}

static int safe_usermode(int new_usermode, bool warn)