Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47fd705287e9377acd2a4cee9aeeea02867d2e54
Commit:     47fd705287e9377acd2a4cee9aeeea02867d2e54
Parent:     02828845dda5ccf921ab2557c6ca17b6e7fc70e2
Author:     Russell King <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 13 18:33:53 2006 +0000
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Wed Dec 13 18:33:53 2006 +0000

    [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 <[EMAIL PROTECTED]>
---
 include/asm-arm/system.h |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index f60facc..e160aeb 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -173,6 +173,26 @@ static inline void set_copro_access(unsigned int val)
 extern unsigned long cr_no_alignment;  /* defined in entry-armv.S */
 extern unsigned long cr_alignment;     /* defined in entry-armv.S */
 
+#ifndef CONFIG_SMP
+static inline void adjust_cr(unsigned long mask, unsigned long set)
+{
+       unsigned long flags, cr;
+
+       mask &= ~CR_A;
+
+       set &= mask;
+
+       local_irq_save(flags);
+
+       cr_no_alignment = (cr_no_alignment & ~mask) | set;
+       cr_alignment = (cr_alignment & ~mask) | set;
+
+       set_cr((get_cr() & ~mask) | set);
+
+       local_irq_restore(flags);
+}
+#endif
+
 #define UDBG_UNDEFINED (1 << 0)
 #define UDBG_SYSCALL   (1 << 1)
 #define UDBG_BADABORT  (1 << 2)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to