]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Compatibility/LegacyRegion2OnLegacyRegionThunk/LegacyRegion2OnLegacyRegionThunk.h
Maintainers.txt: Remove EdkCompatibilityPkg information
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / LegacyRegion2OnLegacyRegionThunk / LegacyRegion2OnLegacyRegionThunk.h
CommitLineData
650efd74 1/** @file\r
2 Internal include file for the Legacy Region 2 Protocol thunk driver.\r
3\r
584d5652
HT
4Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
650efd74 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __LEGACY_REGION2_ON_LEGACY_REGION_H__\r
16#define __LEGACY_REGION2_ON_LEGACY_REGION_H__\r
17\r
18#include <Protocol/LegacyRegion2.h>\r
19#include <Protocol/LegacyRegion.h>\r
20\r
21#include <Library/DebugLib.h>\r
22#include <Library/UefiBootServicesTableLib.h>\r
23\r
24/**\r
25 Modify the hardware to allow (decode) or disallow (not decode) memory reads in a region.\r
26\r
27 If the On parameter evaluates to TRUE, this function enables memory reads in the address range \r
28 Start to (Start + Length - 1).\r
29 If the On parameter evaluates to FALSE, this function disables memory reads in the address range \r
30 Start to (Start + Length - 1).\r
31\r
32 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.\r
33 @param Start[in] The beginning of the physical address of the region whose attributes\r
34 should be modified.\r
35 @param Length[in] The number of bytes of memory whose attributes should be modified.\r
36 The actual number of bytes modified may be greater than the number\r
37 specified.\r
38 @param Granularity[out] The number of bytes in the last region affected. This may be less\r
39 than the total number of bytes affected if the starting address\r
40 was not aligned to a region's starting address or if the length\r
41 was greater than the number of bytes in the first region.\r
42 @param On[in] Decode / Non-Decode flag.\r
43\r
44 @retval EFI_SUCCESS The region's attributes were successfully modified.\r
45 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.\r
46\r
47**/\r
48EFI_STATUS\r
49EFIAPI\r
50LegacyRegion2Decode (\r
51 IN EFI_LEGACY_REGION2_PROTOCOL *This,\r
52 IN UINT32 Start,\r
53 IN UINT32 Length,\r
54 OUT UINT32 *Granularity,\r
55 IN BOOLEAN *On\r
56 );\r
57\r
58/**\r
59 Modify the hardware to disallow memory writes in a region.\r
60\r
61 This function changes the attributes of a memory range to not allow writes.\r
62\r
63 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.\r
64 @param Start[in] The beginning of the physical address of the region whose\r
65 attributes should be modified.\r
66 @param Length[in] The number of bytes of memory whose attributes should be modified.\r
67 The actual number of bytes modified may be greater than the number\r
68 specified.\r
69 @param Granularity[out] The number of bytes in the last region affected. This may be less\r
70 than the total number of bytes affected if the starting address was\r
71 not aligned to a region's starting address or if the length was\r
72 greater than the number of bytes in the first region.\r
73\r
74 @retval EFI_SUCCESS The region's attributes were successfully modified.\r
75 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.\r
76\r
77**/\r
78EFI_STATUS\r
79EFIAPI\r
80LegacyRegion2Lock (\r
81 IN EFI_LEGACY_REGION2_PROTOCOL *This,\r
82 IN UINT32 Start,\r
83 IN UINT32 Length,\r
84 OUT UINT32 *Granularity\r
85 );\r
86\r
87/**\r
88 Modify the hardware to disallow memory attribute changes in a region.\r
89\r
90 This function makes the attributes of a region read only. Once a region is boot-locked with this \r
91 function, the read and write attributes of that region cannot be changed until a power cycle has\r
92 reset the boot-lock attribute. Calls to Decode(), Lock() and Unlock() will have no effect.\r
93\r
94 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.\r
95 @param Start[in] The beginning of the physical address of the region whose\r
96 attributes should be modified.\r
97 @param Length[in] The number of bytes of memory whose attributes should be modified.\r
98 The actual number of bytes modified may be greater than the number\r
99 specified.\r
100 @param Granularity[out] The number of bytes in the last region affected. This may be less\r
101 than the total number of bytes affected if the starting address was\r
102 not aligned to a region's starting address or if the length was\r
103 greater than the number of bytes in the first region.\r
104\r
105 @retval EFI_SUCCESS The region's attributes were successfully modified.\r
106 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.\r
107 @retval EFI_UNSUPPORTED The chipset does not support locking the configuration registers in\r
108 a way that will not affect memory regions outside the legacy memory\r
109 region.\r
110\r
111**/\r
112EFI_STATUS\r
113EFIAPI\r
114LegacyRegion2BootLock (\r
115 IN EFI_LEGACY_REGION2_PROTOCOL *This,\r
116 IN UINT32 Start,\r
117 IN UINT32 Length,\r
118 OUT UINT32 *Granularity\r
119 );\r
120\r
121/**\r
122 Modify the hardware to allow memory writes in a region.\r
123\r
124 This function changes the attributes of a memory range to allow writes. \r
125\r
126 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.\r
127 @param Start[in] The beginning of the physical address of the region whose\r
128 attributes should be modified.\r
129 @param Length[in] The number of bytes of memory whose attributes should be modified.\r
130 The actual number of bytes modified may be greater than the number\r
131 specified.\r
132 @param Granularity[out] The number of bytes in the last region affected. This may be less\r
133 than the total number of bytes affected if the starting address was\r
134 not aligned to a region's starting address or if the length was\r
135 greater than the number of bytes in the first region.\r
136\r
137 @retval EFI_SUCCESS The region's attributes were successfully modified.\r
138 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.\r
139\r
140**/\r
141EFI_STATUS\r
142EFIAPI\r
143LegacyRegion2Unlock (\r
144 IN EFI_LEGACY_REGION2_PROTOCOL *This,\r
145 IN UINT32 Start,\r
146 IN UINT32 Length,\r
147 OUT UINT32 *Granularity\r
148 );\r
149\r
150/**\r
151 Get region information for the attributes of the Legacy Region.\r
152\r
153 This function is used to discover the granularity of the attributes for the memory in the legacy \r
154 region. Each attribute may have a different granularity and the granularity may not be the same\r
155 for all memory ranges in the legacy region. \r
156\r
157 @param This[in] Indicates the EFI_LEGACY_REGION_PROTOCOL instance.\r
158 @param DescriptorCount[out] The number of region descriptor entries returned in the Descriptor\r
159 buffer.\r
160 @param Descriptor[out] A pointer to a pointer used to return a buffer where the legacy\r
161 region information is deposited. This buffer will contain a list of\r
162 DescriptorCount number of region descriptors. This function will\r
163 provide the memory for the buffer.\r
164\r
165 @retval EFI_SUCCESS The region's attributes were successfully modified.\r
166 @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.\r
167\r
168**/\r
169EFI_STATUS\r
170EFIAPI\r
171LegacyRegionGetInfo (\r
172 IN EFI_LEGACY_REGION2_PROTOCOL *This,\r
173 OUT UINT32 *DescriptorCount,\r
174 OUT EFI_LEGACY_REGION_DESCRIPTOR **Descriptor\r
175 );\r
176\r
177#endif\r