2 Internal include file for the dummy Legacy Region 2 Protocol implementation.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __DUMMY_LEGACY_REGION2_H__
10 #define __DUMMY_LEGACY_REGION2_H__
12 #include <Protocol/LegacyRegion2.h>
13 #include <Library/DebugLib.h>
14 #include <Library/UefiBootServicesTableLib.h>
17 Modify the hardware to allow (decode) or disallow (not decode) memory reads in a region.
19 If the On parameter evaluates to TRUE, this function enables memory reads in the address range
20 Start to (Start + Length - 1).
21 If the On parameter evaluates to FALSE, this function disables memory reads in the address range
22 Start to (Start + Length - 1).
24 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.
25 @param Start[in] The beginning of the physical address of the region whose attributes
27 @param Length[in] The number of bytes of memory whose attributes should be modified.
28 The actual number of bytes modified may be greater than the number
30 @param Granularity[out] The number of bytes in the last region affected. This may be less
31 than the total number of bytes affected if the starting address
32 was not aligned to a region's starting address or if the length
33 was greater than the number of bytes in the first region.
34 @param On[in] Decode / Non-Decode flag.
36 @retval EFI_SUCCESS The region's attributes were successfully modified.
37 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
43 IN EFI_LEGACY_REGION2_PROTOCOL
*This
,
46 OUT UINT32
*Granularity
,
51 Modify the hardware to disallow memory writes in a region.
53 This function changes the attributes of a memory range to not allow writes.
55 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.
56 @param Start[in] The beginning of the physical address of the region whose
57 attributes should be modified.
58 @param Length[in] The number of bytes of memory whose attributes should be modified.
59 The actual number of bytes modified may be greater than the number
61 @param Granularity[out] The number of bytes in the last region affected. This may be less
62 than the total number of bytes affected if the starting address was
63 not aligned to a region's starting address or if the length was
64 greater than the number of bytes in the first region.
66 @retval EFI_SUCCESS The region's attributes were successfully modified.
67 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
73 IN EFI_LEGACY_REGION2_PROTOCOL
*This
,
76 OUT UINT32
*Granularity
80 Modify the hardware to disallow memory attribute changes in a region.
82 This function makes the attributes of a region read only. Once a region is boot-locked with this
83 function, the read and write attributes of that region cannot be changed until a power cycle has
84 reset the boot-lock attribute. Calls to Decode(), Lock() and Unlock() will have no effect.
86 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.
87 @param Start[in] The beginning of the physical address of the region whose
88 attributes should be modified.
89 @param Length[in] The number of bytes of memory whose attributes should be modified.
90 The actual number of bytes modified may be greater than the number
92 @param Granularity[out] The number of bytes in the last region affected. This may be less
93 than the total number of bytes affected if the starting address was
94 not aligned to a region's starting address or if the length was
95 greater than the number of bytes in the first region.
97 @retval EFI_SUCCESS The region's attributes were successfully modified.
98 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
99 @retval EFI_UNSUPPORTED The chipset does not support locking the configuration registers in
100 a way that will not affect memory regions outside the legacy memory
106 LegacyRegion2BootLock (
107 IN EFI_LEGACY_REGION2_PROTOCOL
*This
,
110 OUT UINT32
*Granularity
114 Modify the hardware to allow memory writes in a region.
116 This function changes the attributes of a memory range to allow writes.
118 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.
119 @param Start[in] The beginning of the physical address of the region whose
120 attributes should be modified.
121 @param Length[in] The number of bytes of memory whose attributes should be modified.
122 The actual number of bytes modified may be greater than the number
124 @param Granularity[out] The number of bytes in the last region affected. This may be less
125 than the total number of bytes affected if the starting address was
126 not aligned to a region's starting address or if the length was
127 greater than the number of bytes in the first region.
129 @retval EFI_SUCCESS The region's attributes were successfully modified.
130 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
135 LegacyRegion2Unlock (
136 IN EFI_LEGACY_REGION2_PROTOCOL
*This
,
139 OUT UINT32
*Granularity
143 Get region information for the attributes of the Legacy Region.
145 This function is used to discover the granularity of the attributes for the memory in the legacy
146 region. Each attribute may have a different granularity and the granularity may not be the same
147 for all memory ranges in the legacy region.
149 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.
150 @param DescriptorCount[out] The number of region descriptor entries returned in the Descriptor
152 @param Descriptor[out] A pointer to a pointer used to return a buffer where the legacy
153 region information is deposited. This buffer will contain a list of
154 DescriptorCount number of region descriptors. This function will
155 provide the memory for the buffer.
157 @retval EFI_SUCCESS The region's attributes were successfully modified.
158 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
163 LegacyRegionGetInfo (
164 IN EFI_LEGACY_REGION2_PROTOCOL
*This
,
165 OUT UINT32
*DescriptorCount
,
166 OUT EFI_LEGACY_REGION_DESCRIPTOR
**Descriptor