diff options
author | Chen Fan <chen.fan.fnst@cn.fujitsu.com> | 2015-03-09 06:45:26 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-03-09 06:45:26 +0000 |
commit | 33f413f0d6d7620843717bbe1f22bf8d054a478f (patch) | |
tree | e74d40ec04ca5657d6765761bb46ffa7dc48404b | |
parent | 68f06742379437e412f9699cc3c82421f4684b67 (diff) | |
download | edk2-33f413f0d6d7620843717bbe1f22bf8d054a478f.tar.gz edk2-33f413f0d6d7620843717bbe1f22bf8d054a478f.tar.bz2 edk2-33f413f0d6d7620843717bbe1f22bf8d054a478f.zip |
UefiCpuPkg/MpSerivce: add volatile qualifiers
For avoid the compiler optimizing the code, we let Parameter and Procedure in CpuData volatile.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17024 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | UefiCpuPkg/CpuDxe/CpuMp.c | 4 | ||||
-rw-r--r-- | UefiCpuPkg/CpuDxe/CpuMp.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index e5d2f5f7e2..fa0ef37b92 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/UefiCpuPkg/CpuDxe/CpuMp.c @@ -1193,7 +1193,7 @@ ProcessorToIdleState ( UINTN ProcessorNumber;
CPU_DATA_BLOCK *CpuData;
EFI_AP_PROCEDURE Procedure;
- VOID *ProcedureArgument;
+ volatile VOID *ProcedureArgument;
AsmApDoneWithCommonStack ();
@@ -1231,7 +1231,7 @@ ProcessorToIdleState ( if (Procedure != NULL) {
SetApState (CpuData, CpuStateBusy);
- Procedure (ProcedureArgument);
+ Procedure ((VOID*) ProcedureArgument);
GetMpSpinLock (CpuData);
CpuData->Procedure = NULL;
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.h b/UefiCpuPkg/CpuDxe/CpuMp.h index cb3460f355..021b80821e 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.h +++ b/UefiCpuPkg/CpuDxe/CpuMp.h @@ -94,8 +94,8 @@ typedef struct { INTN LockSelf;
volatile CPU_STATE State;
- EFI_AP_PROCEDURE Procedure;
- VOID *Parameter;
+ volatile EFI_AP_PROCEDURE Procedure;
+ volatile VOID* Parameter;
BOOLEAN *Finished;
INTN Timeout;
EFI_EVENT WaitEvent;
|