EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2.c

Go to the documentation of this file.
00001 
00021 #include <LegacyRegion2.h>
00022 
00023 EFI_HANDLE   mLegacyRegion2Handle = NULL;
00024 
00025 EFI_LEGACY_REGION2_PROTOCOL  mLegacyRegion2 = {
00026   LegacyRegion2Decode,
00027   LegacyRegion2Lock,
00028   LegacyRegion2BootLock,
00029   LegacyRegion2Unlock,
00030   LegacyRegionGetInfo
00031 };
00032 
00057 EFI_STATUS
00058 EFIAPI
00059 LegacyRegion2Decode (
00060   IN  EFI_LEGACY_REGION2_PROTOCOL  *This,
00061   IN  UINT32                       Start,
00062   IN  UINT32                       Length,
00063   OUT UINT32                       *Granularity,
00064   IN  BOOLEAN                      *On
00065   )
00066 {
00067   if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
00068     return EFI_INVALID_PARAMETER;
00069   }
00070 
00071   ASSERT (Granularity != NULL);
00072   *Granularity = 0;
00073   return EFI_SUCCESS;
00074 }
00075 
00096 EFI_STATUS
00097 EFIAPI
00098 LegacyRegion2Lock (
00099   IN  EFI_LEGACY_REGION2_PROTOCOL *This,
00100   IN  UINT32                      Start,
00101   IN  UINT32                      Length,
00102   OUT UINT32                      *Granularity
00103   )
00104 {
00105   if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
00106     return EFI_INVALID_PARAMETER;
00107   }
00108 
00109   ASSERT (Granularity != NULL);
00110   *Granularity = 0;
00111   return EFI_SUCCESS;
00112 }
00113 
00139 EFI_STATUS
00140 EFIAPI
00141 LegacyRegion2BootLock (
00142   IN  EFI_LEGACY_REGION2_PROTOCOL         *This,
00143   IN  UINT32                              Start,
00144   IN  UINT32                              Length,
00145   OUT UINT32                              *Granularity
00146   )
00147 {
00148   if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
00149     return EFI_INVALID_PARAMETER;
00150   }
00151 
00152   return EFI_UNSUPPORTED;
00153 }
00154 
00175 EFI_STATUS
00176 EFIAPI
00177 LegacyRegion2Unlock (
00178   IN  EFI_LEGACY_REGION2_PROTOCOL  *This,
00179   IN  UINT32                       Start,
00180   IN  UINT32                       Length,
00181   OUT UINT32                       *Granularity
00182   )
00183 {
00184   if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
00185     return EFI_INVALID_PARAMETER;
00186   }
00187 
00188   ASSERT (Granularity != NULL);
00189   *Granularity = 0;
00190   return EFI_SUCCESS;
00191 }
00192 
00212 EFI_STATUS
00213 EFIAPI
00214 LegacyRegionGetInfo (
00215   IN  EFI_LEGACY_REGION2_PROTOCOL   *This,
00216   OUT UINT32                        *DescriptorCount,
00217   OUT EFI_LEGACY_REGION_DESCRIPTOR  **Descriptor
00218   )
00219 {
00220   return EFI_UNSUPPORTED;
00221 }
00222 
00232 EFI_STATUS
00233 EFIAPI
00234 LegacyRegion2Install (
00235   IN EFI_HANDLE        ImageHandle,
00236   IN EFI_SYSTEM_TABLE  *SystemTable
00237   )
00238 {
00239   EFI_STATUS  Status;
00240   
00241   //
00242   // Make sure the Legacy Region 2 Protocol is not already installed in the system
00243   //
00244   ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiLegacyRegion2ProtocolGuid);
00245   
00246   //
00247   // Install the protocol on a new handle.
00248   //
00249   Status = gBS->InstallMultipleProtocolInterfaces (
00250                   &mLegacyRegion2Handle,
00251                   &gEfiLegacyRegion2ProtocolGuid, &mLegacyRegion2,
00252                   NULL
00253                   );
00254   ASSERT_EFI_ERROR (Status);
00255 
00256   return EFI_SUCCESS;
00257 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines