patch-2.4.5 linux/arch/ppc/kernel/chrp_time.c

Next file: linux/arch/ppc/kernel/entry.S
Previous file: linux/arch/ppc/kernel/chrp_setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/arch/ppc/kernel/chrp_time.c linux/arch/ppc/kernel/chrp_time.c
@@ -1,4 +1,7 @@
 /*
+ * BK Id: SCCS/s.chrp_time.c 1.7 05/17/01 18:14:21 cort
+ */
+/*
  *  linux/arch/i386/kernel/time.c
  *
  *  Copyright (C) 1991, 1992, 1995  Linus Torvalds
@@ -29,6 +32,8 @@
 #include <asm/init.h>
 #include <asm/time.h>
 
+extern spinlock_t rtc_lock;
+
 static int nvram_as1 = NVRAM_AS1;
 static int nvram_as0 = NVRAM_AS0;
 static int nvram_data = NVRAM_DATA;
@@ -74,6 +79,7 @@
 	unsigned char save_control, save_freq_select;
 	struct rtc_time tm;
 
+	spin_lock(&rtc_lock);
 	to_tm(nowtime, &tm);
 
 	save_control = chrp_cmos_clock_read(RTC_CONTROL); /* tell the clock it's being set */
@@ -112,6 +118,7 @@
 
 	if ( (time_state == TIME_ERROR) || (time_state == TIME_BAD) )
 		time_state = TIME_OK;
+	spin_unlock(&rtc_lock);
 	return 0;
 }
 

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