Laszlo, Good catch. I agree it should be
VOID EFIAPI CheckFeatureSupported ( IN OUT VOID *Buffer ); Jeff -----Original Message----- From: Laszlo Ersek [mailto:[email protected]] Sent: Friday, February 19, 2016 4:09 AM To: Kinney, Michael D; [email protected] Cc: Yao, Jiewen; Fan, Jeff Subject: Re: [edk2] [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Add EFIAPI to CheckFeatureSupported() On 02/18/16 20:41, Michael Kinney wrote: > The function CheckFeatureSupported() is used as an EFI_AP_PROCEDURE in > the MP Services Protocol service StartAllAPs(). Any function used as > an EFI_AP_SERVICE must use EFIAPI calling convention. I think "EFI_AP_SERVICE" should be "EFI_AP_PROCEDURE" here. > > Cc: Jeff Fan <[email protected]> > Cc: Jiewen Yao <[email protected]> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Michael Kinney <[email protected]> > --- > UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 3 ++- > UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) EFI_AP_PROCEDURE is defined, in "MdePkg/Include/Pi/PiMultiPhase.h", as: typedef VOID (EFIAPI *EFI_AP_PROCEDURE)( IN OUT VOID *Buffer ); Let's compare the prototype of CheckFeatureSupported() [UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h]: VOID CheckFeatureSupported ( VOID ); The lack of EFIAPI is just one (I'd say: the smaller) problem; the parameter list is incorrect regardless of calling convention. Therefore: > > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c > index ec4ec9b..0279f89 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c > @@ -1,7 +1,7 @@ > /** @file > Enable SMM profile. > > -Copyright (c) 2012 - 2015, Intel Corporation. All rights > reserved.<BR> > +Copyright (c) 2012 - 2016, Intel Corporation. All rights > +reserved.<BR> > This program and the accompanying materials are licensed and made > available under the terms and conditions of the BSD License which > accompanies this distribution. The full text of the license may be > found at @@ -930,6 +930,7 @@ InitSmmProfileInternal ( > > **/ > VOID > +EFIAPI > CheckFeatureSupported ( > VOID > ) Here I propose to fix up the parameter list as well, > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h > b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h > index 4548467..5cb8d7c 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h > @@ -1,7 +1,7 @@ > /** @file > SMM profile header file. > > -Copyright (c) 2012 - 2015, Intel Corporation. All rights > reserved.<BR> > +Copyright (c) 2012 - 2016, Intel Corporation. All rights > +reserved.<BR> > This program and the accompanying materials are licensed and made > available under the terms and conditions of the BSD License which > accompanies this distribution. The full text of the license may be > found at @@ -97,6 +97,7 @@ PageFaultIdtHandlerSmmProfile ( > > **/ > VOID > +EFIAPI > CheckFeatureSupported ( > VOID > ); > here too; *plus* drop the (now unnecessary) cast from: MpServices->StartupAllAPs ( MpServices, (EFI_AP_PROCEDURE) CheckFeatureSupported, TRUE, NULL, 0, NULL, NULL ); in CheckProcessorFeature(). Thanks Laszlo _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

