From 300240b62bf138afba3b427d04111e75c01659c0 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Tue, 16 Feb 2010 04:04:58 +0000 Subject: [PATCH] Use Memory Allocation Library instance for modules of type DXE_SMM_DRIVER git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10013 6f19259b-4bc3-4df7-8a09-765794883524 --- .../SmmReportStatusCodeLib/ReportStatusCodeLib.c | 12 ++++-------- .../SmmReportStatusCodeLib.inf | 11 +++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c index 480cb6e500..aac19d4e6d 100644 --- a/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c @@ -1,7 +1,7 @@ /** @file Report Status Code Library for SMM Phase. - Copyright (c) 2009, Intel Corporation
+ Copyright (c) 2009 -2010, Intel Corporation
All rights reserved. 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 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -436,15 +437,10 @@ ReportStatusCodeEx ( ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0))); ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0))); - if (gSmst == NULL || gSmst->SmmAllocatePool == NULL || gSmst->SmmFreePool == NULL) { - return EFI_UNSUPPORTED; - } - // // Allocate space for the Status Code Header and its buffer // - StatusCodeData = NULL; - gSmst->SmmAllocatePool (EfiRuntimeServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData); + StatusCodeData = AllocatePool (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize); if (StatusCodeData == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -477,7 +473,7 @@ ReportStatusCodeEx ( // // Free the allocated buffer // - gSmst->SmmFreePool (StatusCodeData); + FreePool (StatusCodeData); return Status; } diff --git a/MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf b/MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf index b8ef3662ce..af311ebc5d 100644 --- a/MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf +++ b/MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf @@ -2,7 +2,7 @@ # SMM report status code library # # Retrieve status code and report status code in SMM phase -# Copyright (c) 2009, Intel Corporation. +# Copyright (c) 2009 -2010, Intel Corporation. # # All rights reserved. This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -21,8 +21,7 @@ MODULE_TYPE = DXE_SMM_DRIVER VERSION_STRING = 1.0 PI_SPECIFICATION_VERSION = 0x0001000A - - LIBRARY_CLASS = ReportStatusCodeLib| DXE_SMM_DRIVER SMM_CORE + LIBRARY_CLASS = ReportStatusCodeLib|DXE_SMM_DRIVER SMM_CORE # # The following information is for reference only and not required by the build tools. @@ -30,7 +29,7 @@ # VALID_ARCHITECTURES = IA32 X64 # -[Sources.common] +[Sources] ReportStatusCodeLib.c [Packages] @@ -43,6 +42,7 @@ SmmServicesTableLib DebugLib UefiDriverEntryPoint + MemoryAllocationLib [Guids] gEfiStatusCodeSpecificDataGuid ## CONSUMES @@ -51,6 +51,5 @@ [Protocols] gEfiSmmStatusCodeProtocolGuid ## CONSUMES -[Pcd.common] +[Pcd] gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask -