Commit bbc8d77db655be61a21d7623428c46c578a866d3

Authored by Rob Herring
Committed by Nicolas Pitre
1 parent 62158f817a

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>

Showing 2 changed files with 14 additions and 14 deletions Side-by-side Diff

arch/arm/include/asm/cp15.h
... ... @@ -61,6 +61,20 @@
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
drivers/cpuidle/cpuidle-calxeda.c
... ... @@ -37,20 +37,6 @@
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);