]>
Commit | Line | Data |
---|---|---|
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 | |
21 | extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;\r | |
22 | \r | |
23 | /**\r | |
24 | Calculate and save the maximum support address.\r | |
25 | \r | |
26 | **/\r | |
27 | VOID\r | |
28 | MmMemLibInternalCalculateMaximumSupportAddress (\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 | |
037ccb09 KQ |
43 | /**\r |
44 | Initialize cached Mmram Ranges from HOB.\r | |
45 | \r | |
46 | @retval EFI_UNSUPPORTED The routine is unable to extract MMRAM information.\r | |
47 | @retval EFI_SUCCESS MmRanges are populated successfully.\r | |
48 | \r | |
49 | **/\r | |
50 | EFI_STATUS\r | |
51 | MmMemLibInternalPopulateMmramRanges (\r | |
52 | VOID\r | |
53 | )\r | |
54 | {\r | |
55 | // Not implemented for AARCH64.\r | |
56 | return EFI_SUCCESS;\r | |
57 | }\r | |
58 | \r | |
59 | /**\r | |
60 | Deinitialize cached Mmram Ranges.\r | |
61 | \r | |
62 | **/\r | |
63 | VOID\r | |
64 | MmMemLibInternalFreeMmramRanges (\r | |
65 | VOID\r | |
66 | )\r | |
67 | {\r | |
68 | // Not implemented for AARCH64.\r | |
69 | }\r | |
880086a2 | 70 | \r |