MdeModulePkg/PartitionDxe: Add impl of Partition Information Protocol
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
of the raw block devices media. Currently "El Torito CD-ROM", Legacy
|
||||
MBR, and GPT partition schemes are supported.
|
||||
|
||||
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
@@ -514,6 +514,8 @@ PartitionDriverBindingStop (
|
||||
&Private->BlockIo,
|
||||
&gEfiBlockIo2ProtocolGuid,
|
||||
&Private->BlockIo2,
|
||||
&gEfiPartitionInfoProtocolGuid,
|
||||
&Private->PartitionInfo,
|
||||
Private->EspGuid,
|
||||
NULL,
|
||||
NULL
|
||||
@@ -526,6 +528,8 @@ PartitionDriverBindingStop (
|
||||
Private->DevicePath,
|
||||
&gEfiBlockIoProtocolGuid,
|
||||
&Private->BlockIo,
|
||||
&gEfiPartitionInfoProtocolGuid,
|
||||
&Private->PartitionInfo,
|
||||
Private->EspGuid,
|
||||
NULL,
|
||||
NULL
|
||||
@@ -1092,10 +1096,10 @@ PartitionFlushBlocksEx (
|
||||
@param[in] ParentBlockIo2 Parent BlockIo2 interface.
|
||||
@param[in] ParentDevicePath Parent Device Path.
|
||||
@param[in] DevicePathNode Child Device Path node.
|
||||
@param[in] PartitionInfo Child Partition Information interface.
|
||||
@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.
|
||||
@@ -1111,10 +1115,10 @@ PartitionInstallChildHandle (
|
||||
IN EFI_BLOCK_IO2_PROTOCOL *ParentBlockIo2,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
|
||||
IN EFI_PARTITION_INFO_PROTOCOL *PartitionInfo,
|
||||
IN EFI_LBA Start,
|
||||
IN EFI_LBA End,
|
||||
IN UINT32 BlockSize,
|
||||
IN BOOLEAN InstallEspGuid
|
||||
IN UINT32 BlockSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@@ -1203,7 +1207,12 @@ PartitionInstallChildHandle (
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
if (InstallEspGuid) {
|
||||
//
|
||||
// Set the PartitionInfo into Private Data.
|
||||
//
|
||||
CopyMem (&Private->PartitionInfo, PartitionInfo, sizeof (EFI_PARTITION_INFO_PROTOCOL));
|
||||
|
||||
if ((PartitionInfo->System == 1)) {
|
||||
Private->EspGuid = &gEfiPartTypeSystemPartGuid;
|
||||
} else {
|
||||
//
|
||||
@@ -1225,6 +1234,8 @@ PartitionInstallChildHandle (
|
||||
&Private->BlockIo,
|
||||
&gEfiBlockIo2ProtocolGuid,
|
||||
&Private->BlockIo2,
|
||||
&gEfiPartitionInfoProtocolGuid,
|
||||
&Private->PartitionInfo,
|
||||
Private->EspGuid,
|
||||
NULL,
|
||||
NULL
|
||||
@@ -1236,6 +1247,8 @@ PartitionInstallChildHandle (
|
||||
Private->DevicePath,
|
||||
&gEfiBlockIoProtocolGuid,
|
||||
&Private->BlockIo,
|
||||
&gEfiPartitionInfoProtocolGuid,
|
||||
&Private->PartitionInfo,
|
||||
Private->EspGuid,
|
||||
NULL,
|
||||
NULL
|
||||
|
Reference in New Issue
Block a user