]> err.no Git - linux-2.6/blobdiff - arch/x86/lib/delay_64.c
[ARM] 4652/1: pxa: fix a typo of pxa27x usb host clk definition
[linux-2.6] / arch / x86 / lib / delay_64.c
index 0ebbfb9e7c7f8d2b86abeb23f07b0cfbf0ebe56f..45cdd3fbd91c514f38e2c2782f7dbc0dcecd8e90 100644 (file)
@@ -10,7 +10,9 @@
 
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/preempt.h>
 #include <linux/delay.h>
+
 #include <asm/delay.h>
 #include <asm/msr.h>
 
@@ -27,14 +29,15 @@ int read_current_timer(unsigned long *timer_value)
 void __delay(unsigned long loops)
 {
        unsigned bclock, now;
-       
+
+       preempt_disable();              /* TSC's are pre-cpu */
        rdtscl(bclock);
-       do
-       {
+       do {
                rep_nop(); 
                rdtscl(now);
        }
-       while((now-bclock) < loops);
+       while ((now-bclock) < loops);
+       preempt_enable();
 }
 EXPORT_SYMBOL(__delay);