/* Get max physical adrress supported by specific page mode */
UINT64 GetMaxAddress(IN PAGING_MODE Mode)
/* Get max physical adrress supported by specific page mode */
UINT64 GetMaxAddress(IN PAGING_MODE Mode)
{
  switch (Mode) {
    case Paging32bit:
    case PagingPae:
      return SIZE_4GB;
    case Paging4Level:
    case Paging4Level1GB:
    case Paging5Level:
    case Paging5Level1GB:
      return 1ull << MIN (12 + (Mode >> 8) * 9, 52);
    default:
      ASSERT (0);
      return 0;
  }
}