X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDisk%2FPartitionDxe%2FPartition.h;h=d0d0d52a25965d12bebeefa8ae9dfaf0dbab47cf;hb=7eb05636e7edcad6958f8d4d36f073ea64edc919;hp=854020c104697a1c9acbca1a7a61835a7e3dee53;hpb=d38a0f446fbb13a7969294cc6665ee7c789d9fc2;p=mirror_edk2.git
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
index 854020c104..d0d0d52a25 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
@@ -4,19 +4,19 @@
of the raw block devices media. Currently "El Torito CD-ROM", Legacy
MBR, and GPT partition schemes are supported.
- Copyright (c) 2006 - 2007, 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
+Copyright (c) 2006 - 2008, 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
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+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 @@
//
// 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,32 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gPartitionComponentName2;
(((UINT8 *) a)[2] << 16) | \
(((UINT8 *) a)[3] << 24) )
+
+//
+// GPT Partition Entry Status
+//
+typedef struct {
+ BOOLEAN OutOfRange;
+ BOOLEAN Overlap;
+} 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 +119,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 +142,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
);
//
@@ -243,6 +295,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 +322,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 +349,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 +373,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 +396,7 @@ PartitionInstallMbrChildHandles (
IN EFI_DISK_IO_PROTOCOL *DiskIo,
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-;
+ );
typedef
EFI_STATUS