summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
diff options
context:
space:
mode:
authorKun Qin <kun.q@outlook.com>2020-12-31 01:56:51 -0800
committerKun Qin <kun.q@outlook.com>2021-02-01 10:01:03 -0800
commit8a09cdd7be72c7b7fb48d03f2597187d1595e949 (patch)
treeb328a128f43fe1412c925ff4828b36c4b626d93e /MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
parent5625c1fdf7258888fc26ddebe8353d3e5240701b (diff)
downloadedk2-8a09cdd7be72c7b7fb48d03f2597187d1595e949.tar.gz
edk2-8a09cdd7be72c7b7fb48d03f2597187d1595e949.tar.bz2
edk2-8a09cdd7be72c7b7fb48d03f2597187d1595e949.zip
MdeModulePkg: StatusCodeHandler: StatusCodeHandler driver in StandaloneMm
This change added support of StandaloneMm for StatusCodeHandler. It adds a new instance of StatusCodeHandler of MM_STANDALONE type, and abstracts the driver entrypoint into separate files, replaced gSmst with gMmst, and switched to MM version of RscHandlerProtocol. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c')
-rw-r--r--MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
index c9b43fd246..14bac8ec3c 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
@@ -7,15 +7,15 @@
**/
-#include "StatusCodeHandlerSmm.h"
+#include "StatusCodeHandlerMm.h"
-RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;
+RUNTIME_MEMORY_STATUSCODE_HEADER *mMmMemoryStatusCodeTable;
/**
- Initialize SMM memory status code table as initialization for memory status code worker
+ Initialize MM memory status code table as initialization for memory status code worker
- @retval EFI_SUCCESS SMM memory status code table successfully initialized.
- @retval others Errors from gSmst->SmmInstallConfigurationTable().
+ @retval EFI_SUCCESS MM memory status code table successfully initialized.
+ @retval others Errors from gMmst->MmInstallConfigurationTable().
**/
EFI_STATUS
MemoryStatusCodeInitializeWorker (
@@ -25,17 +25,17 @@ MemoryStatusCodeInitializeWorker (
EFI_STATUS Status;
//
- // Allocate SMM memory status code pool.
+ // Allocate MM memory status code pool.
//
- mSmmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024);
- ASSERT (mSmmMemoryStatusCodeTable != NULL);
+ mMmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024);
+ ASSERT (mMmMemoryStatusCodeTable != NULL);
- mSmmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
- Status = gSmst->SmmInstallConfigurationTable (
- gSmst,
+ mMmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
+ Status = gMmst->MmInstallConfigurationTable (
+ gMmst,
&gMemoryStatusCodeRecordGuid,
- &mSmmMemoryStatusCodeTable,
- sizeof (mSmmMemoryStatusCodeTable)
+ &mMmMemoryStatusCodeTable,
+ sizeof (mMmMemoryStatusCodeTable)
);
return Status;
}
@@ -74,8 +74,8 @@ MemoryStatusCodeReportWorker (
//
// Locate current record buffer.
//
- Record = (MEMORY_STATUSCODE_RECORD *) (mSmmMemoryStatusCodeTable + 1);
- Record = &Record[mSmmMemoryStatusCodeTable->RecordIndex++];
+ Record = (MEMORY_STATUSCODE_RECORD *) (mMmMemoryStatusCodeTable + 1);
+ Record = &Record[mMmMemoryStatusCodeTable->RecordIndex++];
//
// Save status code.
@@ -92,12 +92,12 @@ MemoryStatusCodeReportWorker (
// so the first record is pointed by record index.
// If it is less then max number, index of the first record is zero.
//
- mSmmMemoryStatusCodeTable->NumberOfRecords++;
- if (mSmmMemoryStatusCodeTable->RecordIndex == mSmmMemoryStatusCodeTable->MaxRecordsNumber) {
+ mMmMemoryStatusCodeTable->NumberOfRecords++;
+ if (mMmMemoryStatusCodeTable->RecordIndex == mMmMemoryStatusCodeTable->MaxRecordsNumber) {
//
// Wrap around record index.
//
- mSmmMemoryStatusCodeTable->RecordIndex = 0;
+ mMmMemoryStatusCodeTable->RecordIndex = 0;
}
return EFI_SUCCESS;