/* Return if the PE image section is aligned. */
BOOLEAN IsMemoryProtectionSectionAligned(IN UINT32 SectionAlignment, IN EFI_MEMORY_TYPE MemoryType)
/* Return if the PE image section is aligned. */
BOOLEAN IsMemoryProtectionSectionAligned(IN UINT32 SectionAlignment, IN EFI_MEMORY_TYPE MemoryType)
{
  UINT32  PageAlignment;
  switch (MemoryType) {
    case EfiRuntimeServicesCode:
    case EfiACPIMemoryNVS:
      PageAlignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
      break;
    case EfiRuntimeServicesData:
    case EfiACPIReclaimMemory:
      ASSERT (FALSE);
      PageAlignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
      break;
    case EfiBootServicesCode:
    case EfiLoaderCode:
    case EfiReservedMemoryType:
      PageAlignment = EFI_PAGE_SIZE;
      break;
    default:
      ASSERT (FALSE);
      PageAlignment = EFI_PAGE_SIZE;
      break;
  }
  if ((SectionAlignment & (PageAlignment - 1)) != 0) {
    return FALSE;
  } else {
    return TRUE;
  }
}