]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
Use Memory Allocation Library instance for modules of type DXE_SMM_DRIVER
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / Smm / MemoryStatusCodeWorker.c
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