]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Use Memory Allocation Library instance for modules of type DXE_SMM_DRIVER
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Feb 2010 04:04:58 +0000 (04:04 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Feb 2010 04:04:58 +0000 (04:04 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10013 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c
MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf

index 480cb6e5008686ac93eb2edd8a14a9a951bad929..aac19d4e6dd3792ec3f0cb6dbc79e82730684cca 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Report Status Code Library for SMM Phase.\r
 \r
-  Copyright (c)  2009, Intel Corporation<BR>\r
+  Copyright (c)  2009 -2010, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -18,6 +18,7 @@
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/PcdLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 #include <Guid/StatusCodeDataTypeId.h>\r
 #include <Guid/StatusCodeDataTypeDebug.h>\r
@@ -436,15 +437,10 @@ ReportStatusCodeEx (
   ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
   ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
 \r
-  if (gSmst == NULL || gSmst->SmmAllocatePool == NULL || gSmst->SmmFreePool == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
   //\r
   // Allocate space for the Status Code Header and its buffer\r
   //\r
-  StatusCodeData = NULL;\r
-  gSmst->SmmAllocatePool (EfiRuntimeServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);\r
+  StatusCodeData = AllocatePool (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize);\r
   if (StatusCodeData == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
@@ -477,7 +473,7 @@ ReportStatusCodeEx (
   //\r
   // Free the allocated buffer\r
   //\r
-  gSmst->SmmFreePool (StatusCodeData);\r
+  FreePool (StatusCodeData);\r
 \r
   return Status;\r
 }\r
index b8ef3662ce1f19d180ff27d34371a8aaddb52acf..af311ebc5dc4bb6020f4d49d86faaceb15b9445f 100644 (file)
@@ -2,7 +2,7 @@
 #  SMM report status code library\r
 #\r
 #  Retrieve status code and report status code in SMM phase\r
-#  Copyright (c) 2009, Intel Corporation.\r
+#  Copyright (c) 2009 -2010, Intel Corporation.\r
 #\r
 #  All rights reserved. This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -21,8 +21,7 @@
   MODULE_TYPE                    = DXE_SMM_DRIVER\r
   VERSION_STRING                 = 1.0\r
   PI_SPECIFICATION_VERSION       = 0x0001000A\r
-  \r
-  LIBRARY_CLASS                  = ReportStatusCodeLib| DXE_SMM_DRIVER SMM_CORE\r
+  LIBRARY_CLASS                  = ReportStatusCodeLib|DXE_SMM_DRIVER SMM_CORE\r
 \r
 #\r
 # The following information is for reference only and not required by the build tools.\r
@@ -30,7 +29,7 @@
 #  VALID_ARCHITECTURES           = IA32 X64\r
 #\r
 \r
-[Sources.common]\r
+[Sources]\r
   ReportStatusCodeLib.c\r
 \r
 [Packages]\r
@@ -43,6 +42,7 @@
   SmmServicesTableLib\r
   DebugLib\r
   UefiDriverEntryPoint\r
+  MemoryAllocationLib\r
 \r
 [Guids]\r
   gEfiStatusCodeSpecificDataGuid                ## CONSUMES\r
@@ -51,6 +51,5 @@
 [Protocols]\r
   gEfiSmmStatusCodeProtocolGuid                 ## CONSUMES\r
 \r
-[Pcd.common]\r
+[Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask\r
-\r