kernel/eka/nkernsmp/dfcs.cpp
changeset 90 947f0dc9f7a8
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kernel/eka/nkernsmp/dfcs.cpp	Tue Feb 02 01:24:03 2010 +0200
+++ b/kernel/eka/nkernsmp/dfcs.cpp	Fri Apr 16 16:24:37 2010 +0300
@@ -765,6 +765,23 @@
 						}
 					ss->iExIDfcLock.UnlockOnly();
 					if (kick)
+						{
+						TScheduler& s = TheScheduler;
+						TUint32 cpuMask = 1u<<cpu;
+						if (!(s.iThreadAcceptCpus & cpuMask))	// deal with case where target CPU is shutting down or has already shut down
+							{
+							TInt irq = s.iGenIPILock.LockIrqSave();
+							if (!(s.iIpiAcceptCpus & cpuMask))
+								{
+								s.iCCReactivateCpus |= cpuMask;
+								kick = FALSE;
+								}
+							s.iGenIPILock.UnlockIrqRestore(irq);
+							if (!kick)
+								s.iCCReactivateDfc.DoEnque();	// arrange for target CPU to be powered on
+							}
+						}
+					if (kick)
 						send_resched_ipi(cpu);
 					NKern::EnableAllInterrupts();	// let interrupts in
 					if (orig >= 8)