/* This function sets the attributes for the memory region specified by BaseAddress and Length from their current attributes to the attributes specified by Attributes. */
EFI_STATUS SmmSetMemoryAttributes(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
/* This function sets the attributes for the memory region specified by BaseAddress and Length from their current attributes to the attributes specified by Attributes. */
EFI_STATUS SmmSetMemoryAttributes(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
{
  UINTN  PageTableBase;
  PageTableBase = AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64;
  return SmmSetMemoryAttributesEx (PageTableBase, mPagingMode, BaseAddress, Length, Attributes);
}