1 | /** @file
|
---|
2 | Internal ARCH Specific file of MM memory check library.
|
---|
3 |
|
---|
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.
|
---|
8 |
|
---|
9 | Copyright (c) 2015 - 2024, Intel Corporation. All rights reserved.<BR>
|
---|
10 | Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
|
---|
11 |
|
---|
12 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
13 |
|
---|
14 | **/
|
---|
15 | #include "StandaloneMmMemLibInternal.h"
|
---|
16 | //
|
---|
17 | // Maximum support address used to check input buffer
|
---|
18 | //
|
---|
19 | extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | Calculate and save the maximum support address.
|
---|
23 |
|
---|
24 | **/
|
---|
25 | VOID
|
---|
26 | MmMemLibCalculateMaximumSupportAddress (
|
---|
27 | VOID
|
---|
28 | )
|
---|
29 | {
|
---|
30 | mMmMemLibInternalMaximumSupportAddress = MAX_ALLOC_ADDRESS;
|
---|
31 |
|
---|
32 | DEBUG ((DEBUG_INFO, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress));
|
---|
33 | }
|
---|
34 |
|
---|
35 | /**
|
---|
36 | Initialize valid non-Mmram Ranges from Resource HOB.
|
---|
37 |
|
---|
38 | **/
|
---|
39 | VOID
|
---|
40 | MmMemLibInitializeValidNonMmramRanges (
|
---|
41 | VOID
|
---|
42 | )
|
---|
43 | {
|
---|
44 | // Not implemented for AARCH64.
|
---|
45 | }
|
---|
46 |
|
---|
47 | /**
|
---|
48 | Deinitialize cached non-Mmram Ranges.
|
---|
49 |
|
---|
50 | **/
|
---|
51 | VOID
|
---|
52 | MmMemLibFreeValidNonMmramRanges (
|
---|
53 | VOID
|
---|
54 | )
|
---|
55 | {
|
---|
56 | // Not implemented for AARCH64.
|
---|
57 | }
|
---|
58 |
|
---|
59 | /**
|
---|
60 | This function check if the buffer is valid non-MMRAM memory range.
|
---|
61 |
|
---|
62 | @param[in] Buffer The buffer start address to be checked.
|
---|
63 | @param[in] Length The buffer length to be checked.
|
---|
64 |
|
---|
65 | @retval TRUE This buffer is valid non-MMRAM memory range.
|
---|
66 | @retval FALSE This buffer is not valid non-MMRAM memory range.
|
---|
67 | **/
|
---|
68 | BOOLEAN
|
---|
69 | MmMemLibIsValidNonMmramRange (
|
---|
70 | IN EFI_PHYSICAL_ADDRESS Buffer,
|
---|
71 | IN UINT64 Length
|
---|
72 | )
|
---|
73 | {
|
---|
74 | return TRUE;
|
---|
75 | }
|
---|