/* Retrieves the attribute of the first page entry in the translation table. */
STATIC UINT64 GetFirstPageAttribute(IN UINT64 *FirstLevelTableAddress, IN UINTN TableLevel)
/* Retrieves the attribute of the first page entry in the translation table. */
STATIC UINT64 GetFirstPageAttribute(IN UINT64 *FirstLevelTableAddress, IN UINTN TableLevel)
{
  UINT64  FirstEntry;
  FirstEntry = *FirstLevelTableAddress;
  if ((TableLevel != 3) && ((FirstEntry & TT_TYPE_MASK) == TT_TYPE_TABLE_ENTRY)) {
    return GetFirstPageAttribute ((UINT64 *)(FirstEntry & TT_ADDRESS_MASK_DESCRIPTION_TABLE), TableLevel + 1);
  } else if (((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY) ||
             ((TableLevel == 3) && ((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY_LEVEL3)))
  {
    return FirstEntry & TT_ATTRIBUTES_MASK;
  } else {
    return INVALID_ENTRY;
  }
}