PERFORCE change 168084 for review

Alexander Motin mav at FreeBSD.org
Wed Sep 2 18:55:06 UTC 2009


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

Change 168084 by mav at mav_mavbook on 2009/09/02 18:54:19

	Revert rtc change. Lock need to be spinning as it is called in
	interrupt filter context. while it would be good to split locks,
	left it for later.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/amd64/amd64/machdep.c#29 edit
.. //depot/projects/scottl-camlock/src/sys/i386/i386/machdep.c#27 edit
.. //depot/projects/scottl-camlock/src/sys/isa/atrtc.c#4 edit
.. //depot/projects/scottl-camlock/src/sys/isa/rtc.h#6 edit

Differences ...

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

@@ -1592,7 +1592,6 @@
 	 * 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#27 (text+ko) ====

@@ -2580,7 +2580,6 @@
 	 * initialization can use DELAY().
 	 */
 	i8254_init();
-	atrtc_init();
 #endif
 	
 	/*
@@ -2835,7 +2834,6 @@
 	 * 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#4 (text+ko) ====

@@ -46,14 +46,11 @@
 #include <isa/isavar.h>
 #endif
 
-#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)
+#define	RTC_LOCK	mtx_lock_spin(&clock_lock)
+#define	RTC_UNLOCK	mtx_unlock_spin(&clock_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;
@@ -62,12 +59,6 @@
  * RTC support routines
  */
 
-void
-atrtc_init(void)
-{
-	RTC_LOCK_INIT;
-}
-
 int
 rtcin(int reg)
 {

==== //depot/projects/scottl-camlock/src/sys/isa/rtc.h#6 (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