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

MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h

Go to the documentation of this file.
00001 
00018 #ifndef _PARTITION_H_ 
00019 #define _PARTITION_H_ 
00020 
00021 #include <Uefi.h>
00022 #include <Protocol/BlockIo.h>
00023 #include <Protocol/BlockIo2.h>
00024 #include <Guid/Gpt.h>
00025 #include <Protocol/ComponentName.h>
00026 #include <Protocol/DevicePath.h>
00027 #include <Protocol/DriverBinding.h>
00028 #include <Protocol/DiskIo.h>
00029 #include <Library/DebugLib.h>
00030 #include <Library/UefiDriverEntryPoint.h>
00031 #include <Library/BaseLib.h>
00032 #include <Library/UefiLib.h>
00033 #include <Library/BaseMemoryLib.h>
00034 #include <Library/MemoryAllocationLib.h>
00035 #include <Library/UefiBootServicesTableLib.h>
00036 #include <Library/DevicePathLib.h>
00037 
00038 #include <IndustryStandard/Mbr.h>
00039 #include <IndustryStandard/ElTorito.h>
00040 
00041 
00042 //
00043 // Partition private data
00044 //
00045 #define PARTITION_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('P', 'a', 'r', 't')
00046 typedef struct {
00047   UINT64                    Signature;
00048 
00049   EFI_HANDLE                Handle;
00050   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
00051   EFI_BLOCK_IO_PROTOCOL     BlockIo;
00052   EFI_BLOCK_IO2_PROTOCOL    BlockIo2;
00053   EFI_BLOCK_IO_MEDIA        Media;
00054   EFI_BLOCK_IO_MEDIA        Media2;//For BlockIO2
00055 
00056   EFI_DISK_IO_PROTOCOL      *DiskIo;
00057   EFI_BLOCK_IO_PROTOCOL     *ParentBlockIo;
00058   EFI_BLOCK_IO2_PROTOCOL    *ParentBlockIo2;
00059   UINT64                    Start;
00060   UINT64                    End;
00061   UINT32                    BlockSize;
00062 
00063   EFI_GUID                  *EspGuid;
00064 
00065 } PARTITION_PRIVATE_DATA;
00066 
00067 #define PARTITION_DEVICE_FROM_BLOCK_IO_THIS(a)  CR (a, PARTITION_PRIVATE_DATA, BlockIo, PARTITION_PRIVATE_DATA_SIGNATURE)
00068 #define PARTITION_DEVICE_FROM_BLOCK_IO2_THIS(a) CR (a, PARTITION_PRIVATE_DATA, BlockIo2, PARTITION_PRIVATE_DATA_SIGNATURE)
00069 
00070 //
00071 // Global Variables
00072 //
00073 extern EFI_DRIVER_BINDING_PROTOCOL   gPartitionDriverBinding;
00074 extern EFI_COMPONENT_NAME_PROTOCOL   gPartitionComponentName;
00075 extern EFI_COMPONENT_NAME2_PROTOCOL  gPartitionComponentName2;
00076 
00077 //
00078 // Extract INT32 from char array
00079 //
00080 #define UNPACK_INT32(a) (INT32)( (((UINT8 *) a)[0] <<  0) |    \
00081                                  (((UINT8 *) a)[1] <<  8) |    \
00082                                  (((UINT8 *) a)[2] << 16) |    \
00083                                  (((UINT8 *) a)[3] << 24) )
00084 
00085 //
00086 // Extract UINT32 from char array
00087 //
00088 #define UNPACK_UINT32(a) (UINT32)( (((UINT8 *) a)[0] <<  0) |    \
00089                                    (((UINT8 *) a)[1] <<  8) |    \
00090                                    (((UINT8 *) a)[2] << 16) |    \
00091                                    (((UINT8 *) a)[3] << 24) )
00092 
00093 
00094 //
00095 // GPT Partition Entry Status
00096 //
00097 typedef struct {
00098   BOOLEAN OutOfRange;
00099   BOOLEAN Overlap;
00100   BOOLEAN OsSpecific;
00101 } EFI_PARTITION_ENTRY_STATUS;
00102 
00103 //
00104 // Function Prototypes
00105 //
00120 EFI_STATUS
00121 EFIAPI
00122 PartitionDriverBindingSupported (
00123   IN EFI_DRIVER_BINDING_PROTOCOL  *This,
00124   IN EFI_HANDLE                   ControllerHandle,
00125   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath
00126   );
00127 
00143 EFI_STATUS
00144 EFIAPI
00145 PartitionDriverBindingStart (
00146   IN EFI_DRIVER_BINDING_PROTOCOL  *This,
00147   IN EFI_HANDLE                   ControllerHandle,
00148   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath
00149   );
00150 
00165 EFI_STATUS
00166 EFIAPI
00167 PartitionDriverBindingStop (
00168   IN  EFI_DRIVER_BINDING_PROTOCOL   *This,
00169   IN  EFI_HANDLE                    ControllerHandle,
00170   IN  UINTN                         NumberOfChildren,
00171   IN  EFI_HANDLE                    *ChildHandleBuffer
00172   );
00173 
00174 //
00175 // EFI Component Name Functions
00176 //
00216 EFI_STATUS
00217 EFIAPI
00218 PartitionComponentNameGetDriverName (
00219   IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
00220   IN  CHAR8                        *Language,
00221   OUT CHAR16                       **DriverName
00222   );
00223 
00224 
00293 EFI_STATUS
00294 EFIAPI
00295 PartitionComponentNameGetControllerName (
00296   IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,
00297   IN  EFI_HANDLE                                      ControllerHandle,
00298   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
00299   IN  CHAR8                                           *Language,
00300   OUT CHAR16                                          **ControllerName
00301   );
00302 
00303 
00324 EFI_STATUS
00325 PartitionInstallChildHandle (
00326   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,
00327   IN  EFI_HANDLE                   ParentHandle,
00328   IN  EFI_DISK_IO_PROTOCOL         *ParentDiskIo,
00329   IN  EFI_BLOCK_IO_PROTOCOL        *ParentBlockIo,
00330   IN  EFI_BLOCK_IO2_PROTOCOL       *ParentBlockIo2,
00331   IN  EFI_DEVICE_PATH_PROTOCOL     *ParentDevicePath,
00332   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePathNode,
00333   IN  EFI_LBA                      Start,
00334   IN  EFI_LBA                      End,
00335   IN  UINT32                       BlockSize,
00336   IN  BOOLEAN                      InstallEspGuid
00337   );
00338 
00355 EFI_STATUS
00356 PartitionInstallGptChildHandles (
00357   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,
00358   IN  EFI_HANDLE                   Handle,
00359   IN  EFI_DISK_IO_PROTOCOL         *DiskIo,
00360   IN  EFI_BLOCK_IO_PROTOCOL        *BlockIo,
00361   IN  EFI_BLOCK_IO2_PROTOCOL       *BlockIo2,
00362   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath
00363   );
00364 
00381 EFI_STATUS
00382 PartitionInstallElToritoChildHandles (
00383   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,
00384   IN  EFI_HANDLE                   Handle,
00385   IN  EFI_DISK_IO_PROTOCOL         *DiskIo,
00386   IN  EFI_BLOCK_IO_PROTOCOL        *BlockIo,
00387   IN  EFI_BLOCK_IO2_PROTOCOL       *BlockIo2,
00388   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath
00389   );
00390 
00406 EFI_STATUS
00407 PartitionInstallMbrChildHandles (
00408   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,
00409   IN  EFI_HANDLE                   Handle,
00410   IN  EFI_DISK_IO_PROTOCOL         *DiskIo,
00411   IN  EFI_BLOCK_IO_PROTOCOL        *BlockIo,
00412   IN  EFI_BLOCK_IO2_PROTOCOL       *BlockIo2,
00413   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath
00414   );
00415 
00416 typedef
00417 EFI_STATUS
00418 (*PARTITION_DETECT_ROUTINE) (
00419   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,
00420   IN  EFI_HANDLE                   Handle,
00421   IN  EFI_DISK_IO_PROTOCOL         *DiskIo,
00422   IN  EFI_BLOCK_IO_PROTOCOL        *BlockIo,
00423   IN  EFI_BLOCK_IO2_PROTOCOL       *BlockIo2,
00424   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath
00425   );
00426 
00427 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines