svn commit: r266388 - stable/10/sys/arm/arm

Ian Lepore ian at FreeBSD.org
Sun May 18 01:18:43 UTC 2014


Author: ian
Date: Sun May 18 01:18:42 2014
New Revision: 266388
URL: http://svnweb.freebsd.org/changeset/base/266388

Log:
  MFC 265913, 265914:
  
    Interrupts need to be disabled on entry to cpu_sleep() for ARM.  Given
    that and the need to be in a critical section when switching to idleclock
    mode for event timers, use spinlock_enter()/exit() to achieve both needs.
  
    Clean up some style nits.

Modified:
  stable/10/sys/arm/arm/machdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/arm/arm/machdep.c
==============================================================================
--- stable/10/sys/arm/arm/machdep.c	Sun May 18 00:55:26 2014	(r266387)
+++ stable/10/sys/arm/arm/machdep.c	Sun May 18 01:18:42 2014	(r266388)
@@ -424,24 +424,20 @@ void
 cpu_idle(int busy)
 {
 	
-	CTR2(KTR_SPARE2, "cpu_idle(%d) at %d",
-	    busy, curcpu);
+	CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu);
+	spinlock_enter();
 #ifndef NO_EVENTTIMERS
-	if (!busy) {
-		critical_enter();
+	if (!busy)
 		cpu_idleclock();
-	}
 #endif
 	if (!sched_runnable())
 		cpu_sleep(0);
 #ifndef NO_EVENTTIMERS
-	if (!busy) {
+	if (!busy)
 		cpu_activeclock();
-		critical_exit();
-	}
 #endif
-	CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done",
-	    busy, curcpu);
+	spinlock_exit();
+	CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu);
 }
 
 int


More information about the svn-src-all mailing list