[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.ch...@amd.com>

> -----Original Message-----
> From: Wei6 Xu <wei6...@intel.com>
> Sent: Tuesday, October 31, 2023 11:08 AM
> To: devel@edk2.groups.io
> Cc: Wei6 Xu <wei6...@intel.com>; Chang, Abner <abner.ch...@amd.com>;
> Nate DeSimone <nathaniel.l.desim...@intel.com>; Liming Gao
> <gaolim...@byosoft.com.cn>
> Subject: [PATCH edk2-platforms 1/1] IpmiFeaturePkg/SmmIpmiBaseLib:
> Support Standalone MM.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Add MM_STANDALONE type support for SmmIpmiBaseLib instance. Replace
> Smst
> with Mmst. Remove unused UefiBootServicesTableLib reference.
>
> Cc: Abner Chang <abner.ch...@amd.com>
> Cc: Nate DeSimone <nathaniel.l.desim...@intel.com>
> Cc: Liming Gao <gaolim...@byosoft.com.cn>
> Signed-off-by: Wei6 Xu <wei6...@intel.com>
> ---
>  .../Library/SmmIpmiBaseLib/SmmIpmiBaseLib.c     | 17 ++++++++---------
>  .../Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf   |  5 ++---
>  2 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.c
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.c
> index 6282adc269f8..1c618e48abee 100644
> ---
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.c
> +++
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.c
> @@ -6,11 +6,10 @@
>    SPDX-License-Identifier: BSD-2-Clause-Patent
>  **/
>
> -#include <PiDxe.h>
> +#include <PiMm.h>
>  #include <Protocol/IpmiTransportProtocol.h>
>  #include <Library/IpmiBaseLib.h>
> -#include <Library/UefiBootServicesTableLib.h>
> -#include <Library/SmmServicesTableLib.h>
> +#include <Library/MmServicesTableLib.h>
>  #include <Library/DebugLib.h>
>
>  STATIC IPMI_TRANSPORT     *mIpmiTransport = NULL;
> @@ -37,7 +36,7 @@ NotifyIpmiTransportCallback (
>    EFI_STATUS  Status;
>    Status = EFI_SUCCESS;
>    if (mIpmiTransport == NULL) {
> -    Status = gSmst->SmmLocateProtocol (
> +    Status = gMmst->MmLocateProtocol (
>                        &gSmmIpmiTransportProtocolGuid,
>                        NULL,
>                        (VOID **) &mIpmiTransport
> @@ -60,15 +59,15 @@ InitializeIpmiBase (
>  {
>    EFI_STATUS  Status;
>    if (mIpmiTransport == NULL) {
> -    Status = gSmst->SmmLocateProtocol (
> +    Status = gMmst->MmLocateProtocol (
>                        &gSmmIpmiTransportProtocolGuid,
>                        NULL,
>                        (VOID **) &mIpmiTransport
>                        );
>      if (EFI_ERROR (Status)) {
> -      Status = gSmst->SmmRegisterProtocolNotify (
> +      Status = gMmst->MmRegisterProtocolNotify (
>                          &gSmmIpmiTransportProtocolGuid,
> -                        (EFI_SMM_NOTIFY_FN) NotifyIpmiTransportCallback,
> +                        (EFI_MM_NOTIFY_FN) NotifyIpmiTransportCallback,
>                          &mEfiIpmiProtocolNotifyReg
>                          );
>      }
> @@ -127,7 +126,7 @@ Returns:
>  {
>    EFI_STATUS  Status;
>
> -  Status = gSmst->SmmLocateProtocol (&gSmmIpmiTransportProtocolGuid,
> NULL, (VOID **) &mIpmiTransport);
> +  Status = gMmst->MmLocateProtocol (&gSmmIpmiTransportProtocolGuid,
> NULL, (VOID **) &mIpmiTransport);
>    if (EFI_ERROR (Status)) {
>      ASSERT_EFI_ERROR (Status);
>      return Status;
> @@ -164,7 +163,7 @@ GetBmcStatus (
>  {
>    EFI_STATUS  Status;
>
> -  Status = gSmst->SmmLocateProtocol (&gSmmIpmiTransportProtocolGuid,
> NULL, (VOID **) &mIpmiTransport);
> +  Status = gMmst->MmLocateProtocol (&gSmmIpmiTransportProtocolGuid,
> NULL, (VOID **) &mIpmiTransport);
>    if (EFI_ERROR (Status)) {
>      ASSERT_EFI_ERROR (Status);
>      return Status;
> diff --git
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.inf
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.inf
> index 7ea688fc165f..cf6b91c471fc 100644
> ---
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.inf
> +++
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmi
> BaseLib/SmmIpmiBaseLib.inf
> @@ -11,7 +11,7 @@
>    FILE_GUID                      = 2B5AD78E-5CF8-45d2-B2AC-749A09425911
>    MODULE_TYPE                    = DXE_SMM_DRIVER
>    VERSION_STRING                 = 1.0
> -  LIBRARY_CLASS                  = IpmiBaseLib|DXE_SMM_DRIVER SMM_CORE
> +  LIBRARY_CLASS                  = IpmiBaseLib|DXE_SMM_DRIVER SMM_CORE
> MM_STANDALONE
>
>  [sources]
>    SmmIpmiBaseLib.c
> @@ -21,9 +21,8 @@
>    IpmiFeaturePkg/IpmiFeaturePkg.dec
>
>  [LibraryClasses]
> -  UefiBootServicesTableLib
>    DebugLib
> -  SmmServicesTableLib
> +  MmServicesTableLib
>
>  [Protocols]
>    gSmmIpmiTransportProtocolGuid
> --
> 2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110502): https://edk2.groups.io/g/devel/message/110502
Mute This Topic: https://groups.io/mt/102290796/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to