]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
MdeModulePkg/MemoryStatusCode: Expose the DXE memory status code table.
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / Smm / MemoryStatusCodeWorker.c
index 78d908b16e8338734dce00843903f803ff5b65fa..6baf2dd0f26066ce4f8d97537646e05f68ce13b5 100644 (file)
@@ -2,11 +2,12 @@
   Runtime memory status code worker.\r
 \r
   Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
   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
   http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                            \r
+\r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
@@ -18,15 +19,17 @@ RUNTIME_MEMORY_STATUSCODE_HEADER  *mSmmMemoryStatusCodeTable;
 \r
 /**\r
   Initialize SMM memory status code table as initialization for memory status code worker\r
\r
-  @retval EFI_SUCCESS  SMM memory status code table successfully initialized.\r
 \r
+  @retval EFI_SUCCESS  SMM memory status code table successfully initialized.\r
+  @retval others       Errors from gSmst->SmmInstallConfigurationTable().\r
 **/\r
 EFI_STATUS\r
 MemoryStatusCodeInitializeWorker (\r
   VOID\r
   )\r
 {\r
+  EFI_STATUS                        Status;\r
+\r
   //\r
   // Allocate SMM memory status code pool.\r
   //\r
@@ -34,14 +37,20 @@ MemoryStatusCodeInitializeWorker (
   ASSERT (mSmmMemoryStatusCodeTable != NULL);\r
 \r
   mSmmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);\r
-  return EFI_SUCCESS;\r
+  Status = gSmst->SmmInstallConfigurationTable (\r
+                    gSmst,\r
+                    &gMemoryStatusCodeRecordGuid,\r
+                    &mSmmMemoryStatusCodeTable,\r
+                    sizeof (mSmmMemoryStatusCodeTable)\r
+                    );\r
+  return Status;\r
 }\r
 \r
 \r
 /**\r
   Report status code into runtime memory. If the runtime pool is full, roll back to the \r
   first record and overwrite it.\r
\r
+\r
   @param  CodeType                Indicates the type of status code being reported.\r
   @param  Value                   Describes the current status of a hardware or software entity.\r
                                   This included information about the class and subclass that is used to\r
@@ -52,7 +61,7 @@ MemoryStatusCodeInitializeWorker (
                                   This parameter allows the status code driver to apply different rules to\r
                                   different callers.\r
   @param  Data                    This optional parameter may be used to pass additional data.\r
\r
+\r
   @retval EFI_SUCCESS             Status code successfully recorded in runtime memory status code table.\r
 \r
 **/\r