43 if ((Length > mMmMemLibInternalMaximumSupportAddress) ||
44 (Buffer > mMmMemLibInternalMaximumSupportAddress) ||
45 ((Length != 0) && (Buffer > (mMmMemLibInternalMaximumSupportAddress - (Length - 1)))))
52 "MmIsBufferOutsideMmValid: Overflow: Buffer (0x%lx) - Length (0x%lx), MaximumSupportAddress (0x%lx)\n",
55 mMmMemLibInternalMaximumSupportAddress
83 OUT VOID *DestinationBuffer,
89 DEBUG ((DEBUG_ERROR,
"MmCopyMemToMmram: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
90 return EFI_SECURITY_VIOLATION;
93 CopyMem (DestinationBuffer, SourceBuffer, Length);
117 OUT VOID *DestinationBuffer,
125 "MmCopyMemFromMmram: Security Violation: Destination (0x%x), Length (0x%x)\n",
129 return EFI_SECURITY_VIOLATION;
132 CopyMem (DestinationBuffer, SourceBuffer, Length);
157 OUT VOID *DestinationBuffer,
165 "MmCopyMem: Security Violation: Destination (0x%x), Length (0x%x)\n",
169 return EFI_SECURITY_VIOLATION;
173 DEBUG ((DEBUG_ERROR,
"MmCopyMem: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
174 return EFI_SECURITY_VIOLATION;
177 CopyMem (DestinationBuffer, SourceBuffer, Length);
206 DEBUG ((DEBUG_ERROR,
"MmSetMem: Security Violation: Source (0x%x), Length (0x%x)\n", Buffer, Length));
207 return EFI_SECURITY_VIOLATION;
210 SetMem (Buffer, Length, Value);
BOOLEAN MmMemLibIsValidNonMmramRange(IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length)
VOID MmMemLibInitializeValidNonMmramRanges(VOID)
VOID MmMemLibFreeValidNonMmramRanges(VOID)
VOID MmMemLibCalculateMaximumSupportAddress(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
#define DEBUG(Expression)
EFI_STATUS EFIAPI MmCopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS EFIAPI MmCopyMemFromMmram(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI MmIsBufferOutsideMmValid(IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length)
EFI_STATUS EFIAPI MemLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *MmSystemTable)
EFI_STATUS EFIAPI MmSetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
EFI_STATUS EFIAPI MmCopyMemToMmram(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS EFIAPI MemLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *MmSystemTable)
UINT64 EFI_PHYSICAL_ADDRESS