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

ARM: introduce common set_auxcr/get_auxcr functions

Move the private set_auxcr/get_auxcr functions from
drivers/cpuidle/cpuidle-calxeda.c so they can be used across platforms.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>

authored by

Rob Herring and committed by
Nicolas Pitre
bbc8d77d 62158f81

+14 -14
+14
arch/arm/include/asm/cp15.h
··· 61 61 isb(); 62 62 } 63 63 64 + static inline unsigned int get_auxcr(void) 65 + { 66 + unsigned int val; 67 + asm("mrc p15, 0, %0, c1, c0, 1 @ get AUXCR" : "=r" (val)); 68 + return val; 69 + } 70 + 71 + static inline void set_auxcr(unsigned int val) 72 + { 73 + asm volatile("mcr p15, 0, %0, c1, c0, 1 @ set AUXCR" 74 + : : "r" (val)); 75 + isb(); 76 + } 77 + 64 78 #ifndef CONFIG_SMP 65 79 extern void adjust_cr(unsigned long mask, unsigned long set); 66 80 #endif
-14
drivers/cpuidle/cpuidle-calxeda.c
··· 37 37 extern void highbank_set_cpu_jump(int cpu, void *jump_addr); 38 38 extern void *scu_base_addr; 39 39 40 - static inline unsigned int get_auxcr(void) 41 - { 42 - unsigned int val; 43 - asm("mrc p15, 0, %0, c1, c0, 1 @ get AUXCR" : "=r" (val) : : "cc"); 44 - return val; 45 - } 46 - 47 - static inline void set_auxcr(unsigned int val) 48 - { 49 - asm volatile("mcr p15, 0, %0, c1, c0, 1 @ set AUXCR" 50 - : : "r" (val) : "cc"); 51 - isb(); 52 - } 53 - 54 40 static noinline void calxeda_idle_restore(void) 55 41 { 56 42 set_cr(get_cr() | CR_C);