/* Report status code into runtime memory. If the runtime pool is full, roll back to the first record and overwrite it. */
EFI_STATUS EFIAPI MemoryStatusCodeReportWorker(IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL)
/* Report status code into runtime memory. If the runtime pool is full, roll back to the first record and overwrite it. */
EFI_STATUS EFIAPI MemoryStatusCodeReportWorker(IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL)
{
  MEMORY_STATUSCODE_RECORD  *Record;
  Record = (MEMORY_STATUSCODE_RECORD *)(mMmMemoryStatusCodeTable + 1);
  Record = &Record[mMmMemoryStatusCodeTable->RecordIndex++];
  Record->CodeType = CodeType;
  Record->Value    = Value;
  Record->Instance = Instance;
  mMmMemoryStatusCodeTable->NumberOfRecords++;
  if (mMmMemoryStatusCodeTable->RecordIndex == mMmMemoryStatusCodeTable->MaxRecordsNumber) {
    mMmMemoryStatusCodeTable->RecordIndex = 0;
  }
  return EFI_SUCCESS;
}