summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Fan <chen.fan.fnst@cn.fujitsu.com>2014-09-28 06:22:03 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-28 06:22:03 +0000
commit5152f6426cb80b70eb7c39e372105e050946eb85 (patch)
tree273a07d5a4065b7c28b77ca8cd308089d7a41abc
parent1a160a74a54002e7e49d391f19bbcf1142978a45 (diff)
EmulatorPkg/MpService: Check Processor State when Set Procedure
Due to the state of processor could be set blocked by SingleThread parameter, so we ought to add a READY state check, only let the processor in READY state to invoke procedure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16185 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--EmulatorPkg/CpuRuntimeDxe/MpService.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/EmulatorPkg/CpuRuntimeDxe/MpService.c b/EmulatorPkg/CpuRuntimeDxe/MpService.c
index 866028b4c..5ddd4e761 100644
--- a/EmulatorPkg/CpuRuntimeDxe/MpService.c
+++ b/EmulatorPkg/CpuRuntimeDxe/MpService.c
@@ -465,7 +465,13 @@ CpuMpServicesStartupAllAps (
continue;
}
- SetApProcedure (ProcessorData, Procedure, ProcedureArgument);
+ gThread->MutexLock (ProcessorData->StateLock);
+ ProcessorState = ProcessorData->State;
+ gThread->MutexUnlock (ProcessorData->StateLock);
+
+ if (ProcessorState == CPU_STATE_READY) {
+ SetApProcedure (ProcessorData, Procedure, ProcedureArgument);
+ }
}
//