From df2c2112b00b8b0e6e15f493c2b3592c0d109f1b Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 18 May 2014 01:18:42 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.freebsd.org/base/stable/10@266388 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/arm/arm/machdep.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index 8a57e2228..2b7c38699 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -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 -- 2.45.0