Please try the following updating to check if compiling error gone. Index: CpuMp.c =================================================================== --- CpuMp.c (revision 17009) +++ CpuMp.c (working copy) @@ -1157,7 +1157,7 @@ UINTN ProcessorNumber; CPU_DATA_BLOCK *CpuData; EFI_AP_PROCEDURE Procedure; - VOID *ProcedureArgument; + volatile VOID *ProcedureArgument; AsmApDoneWithCommonStack (); @@ -1190,7 +1190,7 @@ ReleaseMpSpinLock (CpuData); if (Procedure != NULL) { - Procedure (ProcedureArgument); + Procedure ((VOID *) ProcedureArgument); GetMpSpinLock (CpuData); CpuData->Procedure = NULL; Index: CpuMp.h =================================================================== --- CpuMp.h (revision 17009) +++ CpuMp.h (working copy) @@ -93,8 +93,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;
Jeff -----Original Message----- From: Chen Fan [mailto:chen.fan.f...@cn.fujitsu.com] Sent: Thursday, March 05, 2015 1:07 PM To: Fan, Jeff; edk2-devel@lists.sourceforge.net Cc: Justen, Jordan L Subject: Re: [v3 4/4] UefiCpuPkg/MpSerivce: add volatile qualifiers On 03/05/2015 01:09 PM, Fan, Jeff wrote: > Please align the volatile's position as below. > + volatile EFI_AP_PROCEDURE Procedure; > + volatile VOID* Parameter; For Parameter should: VOID* volatile Parameter; otherwise, will cause compile error. UefiCpuPkg/CpuDxe/CpuMp.c:1228:23: error: assignment discards 'volatile' qualifier from pointer target type Thanks, Chen > > -----Original Message----- > From: Chen Fan [mailto:chen.fan.f...@cn.fujitsu.com] > Sent: Thursday, March 05, 2015 11:55 AM > To: edk2-devel@lists.sourceforge.net > Cc: Fan, Jeff; Justen, Jordan L > Subject: [v3 4/4] 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.f...@cn.fujitsu.com> > --- > UefiCpuPkg/CpuDxe/CpuMp.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/UefiCpuPkg/CpuDxe/CpuMp.h b/UefiCpuPkg/CpuDxe/CpuMp.h index > cb3460f..deafbc7 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; > + VOID* volatile Parameter; > BOOLEAN *Finished; > INTN Timeout; > EFI_EVENT WaitEvent; > -- > 1.9.3 > > . > ------------------------------------------------------------------------------ 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-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel