MdeModulePkg: SmmReportStatusCodeLib: ReportStatusCodeLib in StandaloneMm
This change added support of StandaloneMm for ReportStatusCodeLib. It adds a new instance of ReportStatusCodeLib for MM_STANDALONE type, and abstracts the references of gMmst and gSmst functionalities into separate files in order to link in proper Service Table for SMM core/drivers. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/** @file
|
||||
Report Status Code Library for SMM Phase.
|
||||
Report Status Code Library for MM Phase.
|
||||
|
||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/SmmServicesTableLib.h>
|
||||
#include <Library/MmServicesTableLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
@ -16,10 +16,12 @@
|
||||
|
||||
#include <Guid/StatusCodeDataTypeId.h>
|
||||
#include <Guid/StatusCodeDataTypeDebug.h>
|
||||
#include <Protocol/SmmStatusCode.h>
|
||||
#include <Protocol/MmStatusCode.h>
|
||||
|
||||
EFI_SMM_REPORT_STATUS_CODE mReportStatusCode = NULL;
|
||||
EFI_SMM_STATUS_CODE_PROTOCOL *mStatusCodeProtocol = NULL;
|
||||
#include "ReportStatusCodeLib.h"
|
||||
|
||||
EFI_MM_REPORT_STATUS_CODE mReportStatusCode = NULL;
|
||||
EFI_MM_STATUS_CODE_PROTOCOL *mStatusCodeProtocol = NULL;
|
||||
|
||||
|
||||
/**
|
||||
@ -29,14 +31,14 @@ EFI_SMM_STATUS_CODE_PROTOCOL *mStatusCodeProtocol = NULL;
|
||||
NULL is returned if no status code service is available.
|
||||
|
||||
**/
|
||||
EFI_SMM_REPORT_STATUS_CODE
|
||||
EFI_MM_REPORT_STATUS_CODE
|
||||
InternalGetReportStatusCode (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gSmst->SmmLocateProtocol (&gEfiSmmStatusCodeProtocolGuid, NULL, (VOID**)&mStatusCodeProtocol);
|
||||
Status = InternalLocateProtocol (&gEfiMmStatusCodeProtocolGuid, NULL, (VOID**)&mStatusCodeProtocol);
|
||||
if (!EFI_ERROR (Status) && mStatusCodeProtocol != NULL) {
|
||||
return mStatusCodeProtocol->ReportStatusCode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user