[ARM] Provide a method to alter the control register

i.MX needs to tweak the control register to support CPU frequency
scaling. Rather than have folk blindly try and change the control
register by writing to it and then wondering why it doesn't work,
provide a method (which is safe for UP only, and therefore only
available for UP) to achieve this.

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

authored by Russell King and committed by Russell King 47fd7052 02828845

+20
+20
include/asm-arm/system.h
··· 173 173 extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ 174 174 extern unsigned long cr_alignment; /* defined in entry-armv.S */ 175 175 176 + #ifndef CONFIG_SMP 177 + static inline void adjust_cr(unsigned long mask, unsigned long set) 178 + { 179 + unsigned long flags, cr; 180 + 181 + mask &= ~CR_A; 182 + 183 + set &= mask; 184 + 185 + local_irq_save(flags); 186 + 187 + cr_no_alignment = (cr_no_alignment & ~mask) | set; 188 + cr_alignment = (cr_alignment & ~mask) | set; 189 + 190 + set_cr((get_cr() & ~mask) | set); 191 + 192 + local_irq_restore(flags); 193 + } 194 + #endif 195 + 176 196 #define UDBG_UNDEFINED (1 << 0) 177 197 #define UDBG_SYSCALL (1 << 1) 178 198 #define UDBG_BADABORT (1 << 2)