2 Internal ARCH Specific file of MM memory check library.
4 MM memory check library implementation. This library consumes MM_ACCESS_PROTOCOL
5 to get MMRAM information. In order to use this library instance, the platform should produce
6 all MMRAM range via MM_ACCESS_PROTOCOL, including the range for firmware (like MM Core
7 and MM driver) and/or specific dedicated hardware.
9 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
10 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
12 SPDX-License-Identifier: BSD-2-Clause-Patent
15 #include <Library/BaseLib.h>
16 #include <Library/BaseMemoryLib.h>
17 #include <Library/DebugLib.h>
19 // Maximum support address used to check input buffer
21 extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress
;
24 Calculate and save the maximum support address.
28 MmMemLibInternalCalculateMaximumSupportAddress (
32 UINT8 PhysicalAddressBits
;
34 PhysicalAddressBits
= 36;
37 // Save the maximum support address in one global variable
39 mMmMemLibInternalMaximumSupportAddress
= (EFI_PHYSICAL_ADDRESS
)(UINTN
)(LShiftU64 (1, PhysicalAddressBits
) - 1);
40 DEBUG ((DEBUG_INFO
, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress
));