X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDisk%2FPartitionDxe%2FPartition.h;h=9fca9f360ee6ec7a03cbdf013137b99b261cbfe1;hp=41307629a80b8d9f642d6d09d7f3dca7ef6e8ba3;hb=e5eed7d3641d71d7ea539e5379ea9c6a5cd97004;hpb=f42be64210ea5ef394835a3c35f0444086537f66 diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h index 41307629a8..9fca9f360e 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h @@ -4,8 +4,8 @@ of the raw block devices media. Currently "El Torito CD-ROM", Legacy MBR, and GPT partition schemes are supported. -Copyright (c) 2006 - 2008, Intel Corporation.
-All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -15,8 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#ifndef _PARTITION_H -#define _PARTITION_H +#ifndef _PARTITION_H_ +#define _PARTITION_H_ #include #include @@ -41,7 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // // Partition private data // -#define PARTITION_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('P', 'a', 'r', 't') +#define PARTITION_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'a', 'r', 't') typedef struct { UINT64 Signature; @@ -85,9 +85,33 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gPartitionComponentName2; (((UINT8 *) a)[2] << 16) | \ (((UINT8 *) a)[3] << 24) ) + +// +// GPT Partition Entry Status +// +typedef struct { + BOOLEAN OutOfRange; + BOOLEAN Overlap; + BOOLEAN OsSpecific; +} EFI_PARTITION_ENTRY_STATUS; + // // Function Prototypes // +/** + Test to see if this driver supports ControllerHandle. Any ControllerHandle + than contains a BlockIo and DiskIo protocol can be supported. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to test + @param RemainingDevicePath Optional parameter use to pick a specific child + device to start. + + @retval EFI_SUCCESS This driver supports this device + @retval EFI_ALREADY_STARTED This driver is already running on this device + @retval other This driver does not support this device + +**/ EFI_STATUS EFIAPI PartitionDriverBindingSupported ( @@ -96,6 +120,21 @@ PartitionDriverBindingSupported ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ); +/** + Start this driver on ControllerHandle by opening a Block IO and Disk IO + protocol, reading Device Path, and creating a child handle with a + Disk IO and device path protocol. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to bind driver to + @param RemainingDevicePath Optional parameter use to pick a specific child + device to start. + + @retval EFI_SUCCESS This driver is added to ControllerHandle + @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle + @retval other This driver does not support this device + +**/ EFI_STATUS EFIAPI PartitionDriverBindingStart ( @@ -104,13 +143,27 @@ PartitionDriverBindingStart ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ); +/** + Stop this driver on ControllerHandle. Support stopping any child handles + created by this driver. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to stop driver on + @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of + children is zero stop the entire bus driver. + @param ChildHandleBuffer List of Child Handles to Stop. + + @retval EFI_SUCCESS This driver is removed ControllerHandle + @retval other This driver was not removed from this device + +**/ EFI_STATUS EFIAPI PartitionDriverBindingStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer ); // @@ -136,7 +189,7 @@ PartitionDriverBindingStop ( languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified - in RFC 3066 or ISO 639-2 language code format. + in RFC 4646 or ISO 639-2 language code format. @param DriverName[out] A pointer to the Unicode string to return. This Unicode string is the name of the @@ -201,7 +254,7 @@ PartitionComponentNameGetDriverName ( languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in - RFC 3066 or ISO 639-2 language code format. + RFC 4646 or ISO 639-2 language code format. @param ControllerName[out] A pointer to the Unicode string to return. This Unicode string is the name of the @@ -243,6 +296,25 @@ PartitionComponentNameGetControllerName ( ); +/** + Create a child handle for a logical block device that represents the + bytes Start to End of the Parent Block IO device. + + @param[in] This Protocol instance pointer + @param[in] ParentHandle Parent Handle for new child + @param[in] ParentDiskIo Parent DiskIo interface + @param[in] ParentBlockIo Parent BlockIo interface + @param[in] ParentDevicePath Parent Device Path + @param[in] DevicePathNode Child Device Path node + @param[in] Start Start Block + @param[in] End End Block + @param[in] BlockSize Child block size + @param[in] InstallEspGuid Flag to install EFI System Partition GUID on handle + + @retval EFI_SUCCESS A child handle was added + @retval other A child handle was not added + +**/ EFI_STATUS PartitionInstallChildHandle ( IN EFI_DRIVER_BINDING_PROTOCOL *This, @@ -251,13 +323,26 @@ PartitionInstallChildHandle ( IN EFI_BLOCK_IO_PROTOCOL *ParentBlockIo, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode, - IN UINT64 Start, - IN UINT64 End, + IN EFI_LBA Start, + IN EFI_LBA End, IN UINT32 BlockSize, IN BOOLEAN InstallEspGuid - ) -; + ); + +/** + Install child handles if the Handle supports GPT partition structure. + @param[in] This - Calling context. + @param[in] Handle - Parent Handle + @param[in] DiskIo - Parent DiskIo interface + @param[in] BlockIo - Parent BlockIo interface + @param[in] DevicePath - Parent Device Path + + @retval EFI_SUCCESS Valid GPT disk + @retval EFI_MEDIA_CHANGED Media changed Detected + @retval other Not a valid GPT disk + +**/ EFI_STATUS PartitionInstallGptChildHandles ( IN EFI_DRIVER_BINDING_PROTOCOL *This, @@ -265,9 +350,23 @@ PartitionInstallGptChildHandles ( IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath - ) -; + ); +/** + Install child handles if the Handle supports El Torito format. + + @param[in] This Calling context. + @param[in] Handle Parent Handle + @param[in] DiskIo Parent DiskIo interface + @param[in] BlockIo Parent BlockIo interface + @param[in] DevicePath Parent Device Path + + + @retval EFI_SUCCESS Child handle(s) was added + @retval EFI_MEDIA_CHANGED Media changed Detected + @retval other no child handle was added + +**/ EFI_STATUS PartitionInstallElToritoChildHandles ( IN EFI_DRIVER_BINDING_PROTOCOL *This, @@ -275,9 +374,22 @@ PartitionInstallElToritoChildHandles ( IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath - ) -; + ); + +/** + Install child handles if the Handle supports MBR format. + + @param This Calling context. + @param Handle Parent Handle. + @param DiskIo Parent DiskIo interface. + @param BlockIo Parent BlockIo interface. + @param DevicePath Parent Device Path. + + @retval EFI_SUCCESS A child handle was added. + @retval EFI_MEDIA_CHANGED Media change was detected. + @retval Others MBR partition was not found. +**/ EFI_STATUS PartitionInstallMbrChildHandles ( IN EFI_DRIVER_BINDING_PROTOCOL *This, @@ -285,8 +397,7 @@ PartitionInstallMbrChildHandles ( IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath - ) -; + ); typedef EFI_STATUS