/* The function will check if page table entry should be splitted to smaller granularity. */
BOOLEAN ToSplitPageTable(IN EFI_PHYSICAL_ADDRESS Address, IN UINTN Size, IN EFI_PHYSICAL_ADDRESS StackBase, IN UINTN StackSize, IN EFI_PHYSICAL_ADDRESS GhcbBase, IN UINTN GhcbSize)
/* The function will check if page table entry should be splitted to smaller granularity. */
BOOLEAN ToSplitPageTable(IN EFI_PHYSICAL_ADDRESS Address, IN UINTN Size, IN EFI_PHYSICAL_ADDRESS StackBase, IN UINTN StackSize, IN EFI_PHYSICAL_ADDRESS GhcbBase, IN UINTN GhcbSize)
{
  if (IsNullDetectionEnabled () && (Address == 0)) {
    return TRUE;
  }
  if ((Address < StackBase + StackSize) && ((Address + Size) > StackBase)) {
    return TRUE;
  }
  if (GhcbBase != 0) {
    if ((Address < GhcbBase + GhcbSize) && ((Address + Size) > GhcbBase)) {
      return TRUE;
    }
  }
  return FALSE;
}