/* return all SMI handler database size on the SMI entry list. */
UINTN GetSmmSmiDatabaseSize(IN LIST_ENTRY *SmiEntryList)
/* return all SMI handler database size on the SMI entry list. */
UINTN GetSmmSmiDatabaseSize(IN LIST_ENTRY *SmiEntryList)
{
  LIST_ENTRY  *ListEntry;
  SMI_ENTRY   *SmiEntry;
  UINTN       Size;
  Size      = 0;
  ListEntry = SmiEntryList;
  for (ListEntry = ListEntry->ForwardLink;
       ListEntry != SmiEntryList;
       ListEntry = ListEntry->ForwardLink)
  {
    SmiEntry = CR (ListEntry, SMI_ENTRY, AllEntries, SMI_ENTRY_SIGNATURE);
    Size    += sizeof (SMM_CORE_SMI_DATABASE_STRUCTURE);
    Size    += GetSmmSmiHandlerSizeOnSmiEntry (SmiEntry);
  }
  return Size;
}