Revision: 17024
http://sourceforge.net/p/edk2/code/17024
Author: vanjeff
Date: 2015-03-09 06:45:26 +0000 (Mon, 09 Mar 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Jeff Fan <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Modified Paths:
--------------
trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c
trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h
Modified: trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c
===================================================================
--- trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c 2015-03-09 06:43:11 UTC (rev
17023)
+++ trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c 2015-03-09 06:45:26 UTC (rev
17024)
@@ -1193,7 +1193,7 @@
UINTN ProcessorNumber;
CPU_DATA_BLOCK *CpuData;
EFI_AP_PROCEDURE Procedure;
- VOID *ProcedureArgument;
+ volatile VOID *ProcedureArgument;
AsmApDoneWithCommonStack ();
@@ -1231,7 +1231,7 @@
if (Procedure != NULL) {
SetApState (CpuData, CpuStateBusy);
- Procedure (ProcedureArgument);
+ Procedure ((VOID*) ProcedureArgument);
GetMpSpinLock (CpuData);
CpuData->Procedure = NULL;
Modified: trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h
===================================================================
--- trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h 2015-03-09 06:43:11 UTC (rev
17023)
+++ trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h 2015-03-09 06:45:26 UTC (rev
17024)
@@ -94,8 +94,8 @@
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;
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits