TianoCore EDK2 master
Loading...
Searching...
No Matches
LegacyRegion2.c
Go to the documentation of this file.
1
15#include <LegacyRegion2.h>
16
17EFI_HANDLE mLegacyRegion2Handle = NULL;
18
19EFI_LEGACY_REGION2_PROTOCOL mLegacyRegion2 = {
25};
26
52EFIAPI
55 IN UINT32 Start,
56 IN UINT32 Length,
57 OUT UINT32 *Granularity,
58 IN BOOLEAN *On
59 )
60{
61 if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
62 return EFI_INVALID_PARAMETER;
63 }
64
65 ASSERT (Granularity != NULL);
66 *Granularity = 0;
67 return EFI_SUCCESS;
68}
69
91EFIAPI
94 IN UINT32 Start,
95 IN UINT32 Length,
96 OUT UINT32 *Granularity
97 )
98{
99 if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
100 return EFI_INVALID_PARAMETER;
101 }
102
103 ASSERT (Granularity != NULL);
104 *Granularity = 0;
105 return EFI_SUCCESS;
106}
107
134EFIAPI
137 IN UINT32 Start,
138 IN UINT32 Length,
139 OUT UINT32 *Granularity
140 )
141{
142 if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
143 return EFI_INVALID_PARAMETER;
144 }
145
146 return EFI_UNSUPPORTED;
147}
148
170EFIAPI
173 IN UINT32 Start,
174 IN UINT32 Length,
175 OUT UINT32 *Granularity
176 )
177{
178 if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
179 return EFI_INVALID_PARAMETER;
180 }
181
182 ASSERT (Granularity != NULL);
183 *Granularity = 0;
184 return EFI_SUCCESS;
185}
186
207EFIAPI
210 OUT UINT32 *DescriptorCount,
212 )
213{
214 return EFI_UNSUPPORTED;
215}
216
227EFIAPI
229 IN EFI_HANDLE ImageHandle,
230 IN EFI_SYSTEM_TABLE *SystemTable
231 )
232{
233 EFI_STATUS Status;
234
235 //
236 // Make sure the Legacy Region 2 Protocol is not already installed in the system
237 //
238 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiLegacyRegion2ProtocolGuid);
239
240 //
241 // Install the protocol on a new handle.
242 //
243 Status = gBS->InstallMultipleProtocolInterfaces (
244 &mLegacyRegion2Handle,
245 &gEfiLegacyRegion2ProtocolGuid,
246 &mLegacyRegion2,
247 NULL
248 );
249 ASSERT_EFI_ERROR (Status);
250
251 return EFI_SUCCESS;
252}
EFI_STATUS EFIAPI LegacyRegion2Lock(IN EFI_LEGACY_REGION2_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity)
Definition: LegacyRegion2.c:92
EFI_STATUS EFIAPI LegacyRegion2Unlock(IN EFI_LEGACY_REGION2_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity)
EFI_STATUS EFIAPI LegacyRegion2Install(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI LegacyRegion2BootLock(IN EFI_LEGACY_REGION2_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity)
EFI_STATUS EFIAPI LegacyRegionGetInfo(IN EFI_LEGACY_REGION2_PROTOCOL *This, OUT UINT32 *DescriptorCount, OUT EFI_LEGACY_REGION_DESCRIPTOR **Descriptor)
EFI_STATUS EFIAPI LegacyRegion2Decode(IN EFI_LEGACY_REGION2_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity, IN BOOLEAN *On)
Definition: LegacyRegion2.c:53
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
Definition: DebugLib.h:535
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS