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