]> 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:06:46 +0000 (04:06 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Feb 2010 04:06:46 +0000 (04:06 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10014 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c
MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.h
MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf
MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf

index 5e7cd1850cb8242d2df362aa636e6a2248fde137..37ebc05934d63bc3aa011d613ad2003df56ee23f 100644 (file)
@@ -2,7 +2,7 @@
   Report Status Code Router Driver which produces SMM Report Stataus Code Handler Protocol\r
   and SMM Status Code Protocol.\r
 \r
-  Copyright (c) 2009, Intel Corporation\r
+  Copyright (c) 2009 -2010, Intel Corporation\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
@@ -54,9 +54,8 @@ Register (
   IN EFI_SMM_RSC_HANDLER_CALLBACK   Callback\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
-  LIST_ENTRY                        *Link;\r
-  SMM_RSC_HANDLER_CALLBACK_ENTRY    *CallbackEntry;\r
+  LIST_ENTRY                      *Link;\r
+  SMM_RSC_HANDLER_CALLBACK_ENTRY  *CallbackEntry;\r
 \r
   if (Callback == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -72,13 +71,7 @@ Register (
     }\r
   }\r
 \r
-  Status = gSmst->SmmAllocatePool (\r
-                    EfiRuntimeServicesData,\r
-                    sizeof (SMM_RSC_HANDLER_CALLBACK_ENTRY),\r
-                    (VOID**)&CallbackEntry\r
-                    );\r
-\r
-  ASSERT_EFI_ERROR(Status);\r
+  CallbackEntry = (SMM_RSC_HANDLER_CALLBACK_ENTRY *)AllocatePool (sizeof (SMM_RSC_HANDLER_CALLBACK_ENTRY));\r
   ASSERT (CallbackEntry != NULL);\r
 \r
   CallbackEntry->Signature          = SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE;\r
@@ -122,7 +115,7 @@ Unregister (
       // If the function is found in list, delete it and return.\r
       //\r
       RemoveEntryList (&CallbackEntry->Node);\r
-      gSmst->SmmFreePool (CallbackEntry);\r
+      FreePool (CallbackEntry);\r
       return EFI_SUCCESS;\r
     }\r
   }\r
index d3017b4b6efc23d1401926bfb1b3100db8dab0ea..d272448e3573914ea882f2d8aacba9d562fe8389 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal include file for Report Status Code Router Driver.\r
 \r
-  Copyright (c) 2009, Intel Corporation\r
+  Copyright (c) 2009 - 2010, Intel Corporation\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
@@ -25,6 +25,7 @@
 #include <Library/PcdLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/SmmServicesTableLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 #define SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE  SIGNATURE_32 ('s', 'h', 'c', 'e')\r
 \r
index 233058974c6f665b9b6c9b057a2fde023ebac07e..d3ca177c17715093f67013d6400b335221c2562b 100644 (file)
@@ -20,7 +20,6 @@
   FILE_GUID                      = A6885402-D022-4b0e-A509-4711B90F2A39\r
   MODULE_TYPE                    = DXE_SMM_DRIVER\r
   PI_SPECIFICATION_VERSION       = 0x0001000A\r
-  \r
   ENTRY_POINT                    = GenericStatusCodeSmmEntry\r
 \r
 #\r
 #  VALID_ARCHITECTURES           = IA32 X64\r
 #\r
 \r
-[Sources.common]\r
+[Sources]\r
   ReportStatusCodeRouterSmm.c\r
   ReportStatusCodeRouterSmm.h\r
 \r
-\r
 [Packages]\r
   MdePkg/MdePkg.dec\r
   MdeModulePkg/MdeModulePkg.dec\r
@@ -44,6 +42,7 @@
   DebugLib\r
   BaseLib\r
   SynchronizationLib\r
+  MemoryAllocationLib\r
 \r
 [Protocols]\r
   gEfiSmmRscHandlerProtocolGuid               ## PRODUCES\r
index 5672ebcd0ca4cd25ac96e95b4308c24ab4c65adb..57ebe5618174512f0aa0f1b88cd10ae9bca0dde7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Runtime memory status code worker.\r
 \r
-  Copyright (c) 2006 - 2009, Intel Corporation                                                         \r
+  Copyright (c) 2006 - 2010, Intel Corporation                                                         \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
@@ -27,24 +27,13 @@ MemoryStatusCodeInitializeWorker (
   VOID\r
   )\r
 {\r
-  EFI_STATUS  Status;\r
   //\r
   // Allocate SMM memory status code pool.\r
   //\r
-  Status = gSmst->SmmAllocatePool (\r
-                       EfiRuntimeServicesData,\r
-                       sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024,\r
-                       (VOID**)&mSmmMemoryStatusCodeTable\r
-                       );\r
-\r
-  ASSERT_EFI_ERROR(Status);\r
+  mSmmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024);\r
   ASSERT (mSmmMemoryStatusCodeTable != NULL);\r
 \r
-  mSmmMemoryStatusCodeTable->RecordIndex      = 0;\r
-  mSmmMemoryStatusCodeTable->NumberOfRecords  = 0;\r
-  mSmmMemoryStatusCodeTable->MaxRecordsNumber = \r
-    (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);\r
-\r
+  mSmmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);\r
   return EFI_SUCCESS;\r
 }\r
 \r
index 3127a8cd13c8036658d9f007bf34175f0b0257c6..325452769c092eb37b8e9f4ada2e404faa861ef5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal include file for Status Code Handler Driver.\r
 \r
-  Copyright (c) 2009, Intel Corporation\r
+  Copyright (c) 2009 - 2010, Intel Corporation\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
@@ -29,6 +29,7 @@
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/SmmServicesTableLib.h>\r
 #include <Library/SerialPortLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 //\r
 // Runtime memory status code worker definition\r
index b0846f23d1a3016cdbdc92e43a6c6c8f2328f9f4..6963022526bf938fdfd84f3fc22fe428902b25ae 100644 (file)
@@ -2,7 +2,7 @@
 #  Status Code Handler Driver which produces general handlers and hook them\r
 #  onto the SMM status code router.\r
 #\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
@@ -20,7 +20,6 @@
   FILE_GUID                      = 79CD78D8-6EDC-4978-BD02-3299C387AB17\r
   MODULE_TYPE                    = DXE_SMM_DRIVER\r
   PI_SPECIFICATION_VERSION       = 0x0001000A\r
-  \r
   ENTRY_POINT                    = StatusCodeHandlerSmmEntry\r
 \r
 #\r
@@ -29,7 +28,7 @@
 #  VALID_ARCHITECTURES           = IA32 X64\r
 #\r
 \r
-[Sources.common]\r
+[Sources]\r
   StatusCodeHandlerSmm.c\r
   StatusCodeHandlerSmm.h\r
   SerialStatusCodeWorker.c\r
@@ -48,6 +47,7 @@
   ReportStatusCodeLib\r
   DebugLib\r
   SynchronizationLib\r
+  MemoryAllocationLib\r
 \r
 [Guids]\r
   gMemoryStatusCodeRecordGuid                   ## CONSUMES ## HOB\r