From 33f413f0d6d7620843717bbe1f22bf8d054a478f Mon Sep 17 00:00:00 2001 From: Chen Fan Date: Mon, 9 Mar 2015 06:45:26 +0000 Subject: 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 Reviewed-by: Jeff Fan Reviewed-by: Jordan Justen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17024 6f19259b-4bc3-4df7-8a09-765794883524 --- UefiCpuPkg/CpuDxe/CpuMp.c | 4 ++-- UefiCpuPkg/CpuDxe/CpuMp.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'UefiCpuPkg') diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index e5d2f5f7e..fa0ef37b9 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 cb3460f35..021b80821 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; -- cgit v1.2.3