PERFORCE change 167965 for review

Alexander Motin mav at FreeBSD.org
Sun Aug 30 07:52:32 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=167965

Change 167965 by mav at mav_mavbook on 2009/08/30 07:51:34

	Separate rtc_lock from clock_lock and make it not spinning.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/amd64/amd64/machdep.c#28 edit
.. //depot/projects/scottl-camlock/src/sys/i386/i386/machdep.c#26 edit
.. //depot/projects/scottl-camlock/src/sys/isa/atrtc.c#3 edit
.. //depot/projects/scottl-camlock/src/sys/isa/rtc.h#5 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/amd64/amd64/machdep.c#28 (text+ko) ====

@@ -1592,6 +1592,7 @@
 	 * initialization can use DELAY().
 	 */
 	i8254_init();
+	atrtc_init();
 
 	/*
 	 * Initialize the console before we print anything out.

==== //depot/projects/scottl-camlock/src/sys/i386/i386/machdep.c#26 (text+ko) ====

@@ -2580,6 +2580,7 @@
 	 * initialization can use DELAY().
 	 */
 	i8254_init();
+	atrtc_init();
 #endif
 	
 	/*
@@ -2834,6 +2835,7 @@
 	 * initialization can use DELAY().
 	 */
 	i8254_init();
+	atrtc_init();
 
 	/*
 	 * Initialize the console before we print anything out.

==== //depot/projects/scottl-camlock/src/sys/isa/atrtc.c#3 (text+ko) ====

@@ -46,11 +46,14 @@
 #include <isa/isavar.h>
 #endif
 
-#define	RTC_LOCK	mtx_lock_spin(&clock_lock)
-#define	RTC_UNLOCK	mtx_unlock_spin(&clock_lock)
+#define	RTC_LOCK_INIT						\
+	mtx_init(&rtc_lock, "rtc", NULL, MTX_NOPROFILE)
+#define	RTC_LOCK	mtx_lock(&rtc_lock)
+#define	RTC_UNLOCK	mtx_unlock(&rtc_lock)
 
 int	atrtcclock_disable = 0;
 
+static  struct mtx rtc_lock;
 static	int	rtc_reg = -1;
 static	u_char	rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF;
 static	u_char	rtc_statusb = RTCSB_24HR;
@@ -59,6 +62,12 @@
  * RTC support routines
  */
 
+void
+atrtc_init(void)
+{
+	RTC_LOCK_INIT;
+}
+
 int
 rtcin(int reg)
 {

==== //depot/projects/scottl-camlock/src/sys/isa/rtc.h#5 (text+ko) ====

@@ -112,9 +112,9 @@
 #define	RTC_CENTURY	0x32	/* current century */
 
 #ifdef _KERNEL
-extern  struct mtx clock_lock;
 extern	int atrtcclock_disable;
 int	atrtc_setup_clock(void);
+void	atrtc_init(void);
 int	rtcin(int reg);
 void	atrtc_start(void);
 void	atrtc_rate(unsigned rate);


More information about the p4-projects mailing list