# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1484  -> 1.1485 
#	include/asm-ia64/delay.h	1.8     -> 1.9    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/24	jbarnes@tomahawk.engr.sgi.com	1.1485
# fix udelay for config_preempt
# --------------------------------------------
#
diff -Nru a/include/asm-ia64/delay.h b/include/asm-ia64/delay.h
--- a/include/asm-ia64/delay.h	Mon Nov 24 14:19:19 2003
+++ b/include/asm-ia64/delay.h	Mon Nov 24 14:19:19 2003
@@ -15,6 +15,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/preempt.h>
 #include <linux/compiler.h>
 
 #include <asm/intrinsics.h>
@@ -81,11 +82,14 @@
 static __inline__ void
 udelay (unsigned long usecs)
 {
-	unsigned long start = ia64_get_itc();
-	unsigned long cycles = usecs*local_cpu_data->cyc_per_usec;
+	unsigned long start, cycles;
 
+	preempt_disable();
+	start = ia64_get_itc();
+	cycles = usecs*local_cpu_data->cyc_per_usec;
 	while (ia64_get_itc() - start < cycles)
 		/* skip */;
+	preempt_enable();
 }
 
 #endif /* _ASM_IA64_DELAY_H */
