/* This function returns if there is need to split page entry. */
PAGE_ATTRIBUTE NeedSplitPage(IN PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 *PageEntry, IN PAGE_ATTRIBUTE PageAttribute)
/* This function returns if there is need to split page entry. */
PAGE_ATTRIBUTE NeedSplitPage(IN PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 *PageEntry, IN PAGE_ATTRIBUTE PageAttribute)
{
  UINT64  PageEntryLength;
  PageEntryLength = PageAttributeToLength (PageAttribute);
  if (((BaseAddress & (PageEntryLength - 1)) == 0) && (Length >= PageEntryLength)) {
    return PageNone;
  }
  if (((BaseAddress & PAGING_2M_MASK) != 0) || (Length < SIZE_2MB)) {
    return Page4K;
  }
  return Page2M;
}