diff options
author | Chen Fan <chen.fan.fnst@cn.fujitsu.com> | 2014-09-28 06:22:03 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-09-28 06:22:03 +0000 |
commit | 5152f6426cb80b70eb7c39e372105e050946eb85 (patch) | |
tree | 273a07d5a4065b7c28b77ca8cd308089d7a41abc /EmulatorPkg | |
parent | 1a160a74a54002e7e49d391f19bbcf1142978a45 (diff) | |
download | edk2-5152f6426cb80b70eb7c39e372105e050946eb85.zip edk2-5152f6426cb80b70eb7c39e372105e050946eb85.tar.gz edk2-5152f6426cb80b70eb7c39e372105e050946eb85.tar.bz2 |
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
Diffstat (limited to 'EmulatorPkg')
-rw-r--r-- | EmulatorPkg/CpuRuntimeDxe/MpService.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/EmulatorPkg/CpuRuntimeDxe/MpService.c b/EmulatorPkg/CpuRuntimeDxe/MpService.c index 866028b..5ddd4e7 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);
+ }
}
//
|