]> git.proxmox.com Git - mirror_edk2.git/blame - StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c
StandaloneMmPkg: Add CPU driver suitable for ARM Platforms.
[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
12 This program and the accompanying materials\r
13 are licensed and made available under the terms and conditions of the BSD License\r
14 which accompanies this distribution. The full text of the license may be found at\r
15 http://opensource.org/licenses/bsd-license.php\r
16\r
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
19\r
20**/\r
21#include <Library/BaseLib.h>\r
22#include <Library/BaseMemoryLib.h>\r
23#include <Library/DebugLib.h>\r
24//\r
25// Maximum support address used to check input buffer\r
26//\r
27extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;\r
28\r
29/**\r
30 Calculate and save the maximum support address.\r
31\r
32**/\r
33VOID\r
34MmMemLibInternalCalculateMaximumSupportAddress (\r
35 VOID\r
36 )\r
37{\r
38 UINT8 PhysicalAddressBits;\r
39\r
40 PhysicalAddressBits = 36;\r
41\r
42 //\r
43 // Save the maximum support address in one global variable\r
44 //\r
45 mMmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1);\r
46 DEBUG ((DEBUG_INFO, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress));\r
47}\r
48\r
49\r