patch-2.3.34 linux/arch/i386/kernel/smp.c

Next file: linux/arch/i386/kernel/vm86.c
Previous file: linux/arch/i386/kernel/setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.33/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 
 #include <linux/mm.h>
+#include <linux/spinlock.h>
 #include <linux/kernel_stat.h>
 #include <linux/smp_lock.h>
 #include <linux/irq.h>
@@ -638,11 +639,18 @@
  */
 static unsigned int __init get_8254_timer_count(void)
 {
+	extern rwlock_t xtime_lock;
+	unsigned long flags;
+
 	unsigned int count;
 
+	write_lock_irqsave(&xtime_lock, flags);
+
 	outb_p(0x00, 0x43);
 	count = inb_p(0x40);
 	count |= inb_p(0x40) << 8;
+
+	write_unlock_irqrestore(&xtime_lock, flags);
 
 	return count;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)