]> git.proxmox.com Git - mirror_edk2.git/blame - StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c
StandaloneMmPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / StandaloneMmPkg / Library / StandaloneMmMemLib / AArch64 / StandaloneMmMemLibInternal.c
CommitLineData
880086a2
SV
1/** @file\r
2 Internal ARCH Specific file of MM memory check library.\r
3\r
4 MM memory check library implementation. This library consumes MM_ACCESS_PROTOCOL\r
5 to get MMRAM information. In order to use this library instance, the platform should produce\r
6 all MMRAM range via MM_ACCESS_PROTOCOL, including the range for firmware (like MM Core\r
7 and MM driver) and/or specific dedicated hardware.\r
8\r
9 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
10 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>\r
11\r
86094561 12 SPDX-License-Identifier: BSD-2-Clause-Patent\r
880086a2
SV
13\r
14**/\r
15#include <Library/BaseLib.h>\r
16#include <Library/BaseMemoryLib.h>\r
17#include <Library/DebugLib.h>\r
18//\r
19// Maximum support address used to check input buffer\r
20//\r
21extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;\r
22\r
23/**\r
24 Calculate and save the maximum support address.\r
25\r
26**/\r
27VOID\r
28MmMemLibInternalCalculateMaximumSupportAddress (\r
29 VOID\r
30 )\r
31{\r
32 UINT8 PhysicalAddressBits;\r
33\r
34 PhysicalAddressBits = 36;\r
35\r
36 //\r
37 // Save the maximum support address in one global variable\r
38 //\r
39 mMmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1);\r
40 DEBUG ((DEBUG_INFO, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress));\r
41}\r
42\r
43\r