Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2014 01:18:42 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r266388 - stable/10/sys/arm/arm
Message-ID:  <201405180118.s4I1Ig7O052378@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405180118.s4I1Ig7O052378>