]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLibStandaloneMm.c
MdeModulePkg/VarCheckPolicyLib: implement standalone MM version
[mirror_edk2.git] / MdeModulePkg / Library / VarCheckPolicyLib / VarCheckPolicyLibStandaloneMm.c
1 /** @file -- VarCheckPolicyLibStandaloneMm.c
2 This is an instance of a VarCheck lib constructor for Standalone MM.
3
4 Copyright (c) Microsoft Corporation. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <Library/StandaloneMmMemLib.h>
10
11 #include "VarCheckPolicyLib.h"
12
13 /**
14 Standalone MM constructor function of VarCheckPolicyLib to invoke common
15 constructor routine.
16
17 @param[in] ImageHandle The firmware allocated handle for the EFI image.
18 @param[in] SystemTable A pointer to the EFI System Table.
19
20 @retval EFI_SUCCESS The constructor executed correctly.
21
22 **/
23 EFI_STATUS
24 EFIAPI
25 VarCheckPolicyLibStandaloneConstructor (
26 IN EFI_HANDLE ImageHandle,
27 IN EFI_MM_SYSTEM_TABLE *SystemTable
28 )
29 {
30 return VarCheckPolicyLibCommonConstructor ();
31 }
32
33 /**
34 This function is wrapper function to validate the buffer.
35
36 @param Buffer The buffer start address to be checked.
37 @param Length The buffer length to be checked.
38
39 @retval TRUE This buffer is valid per processor architectureand not overlap with MMRAM.
40 @retval FALSE This buffer is not valid per processor architecture or overlap with MMRAM.
41 **/
42 BOOLEAN
43 EFIAPI
44 VarCheckPolicyIsBufferOutsideValid (
45 IN EFI_PHYSICAL_ADDRESS Buffer,
46 IN UINT64 Length
47 )
48 {
49 return MmIsBufferOutsideMmValid (Buffer, Length);
50 }