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:
Hao Wu
2017-06-20 10:51:53 +08:00
parent bce72b5837
commit 3a3d62d2e6
6 changed files with 132 additions and 85 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Decode an El Torito formatted CD-ROM
Copyright (c) 2006 - 2016, 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
@@ -44,22 +44,23 @@ PartitionInstallElToritoChildHandles (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
{
EFI_STATUS Status;
UINT64 VolDescriptorOffset;
UINT32 Lba2KB;
EFI_BLOCK_IO_MEDIA *Media;
CDROM_VOLUME_DESCRIPTOR *VolDescriptor;
ELTORITO_CATALOG *Catalog;
UINTN Check;
UINTN Index;
UINTN BootEntry;
UINTN MaxIndex;
UINT16 *CheckBuffer;
CDROM_DEVICE_PATH CdDev;
UINT32 SubBlockSize;
UINT32 SectorCount;
EFI_STATUS Found;
UINT32 VolSpaceSize;
EFI_STATUS Status;
UINT64 VolDescriptorOffset;
UINT32 Lba2KB;
EFI_BLOCK_IO_MEDIA *Media;
CDROM_VOLUME_DESCRIPTOR *VolDescriptor;
ELTORITO_CATALOG *Catalog;
UINTN Check;
UINTN Index;
UINTN BootEntry;
UINTN MaxIndex;
UINT16 *CheckBuffer;
CDROM_DEVICE_PATH CdDev;
UINT32 SubBlockSize;
UINT32 SectorCount;
EFI_STATUS Found;
UINT32 VolSpaceSize;
EFI_PARTITION_INFO_PROTOCOL PartitionInfo;
Found = EFI_NOT_FOUND;
Media = BlockIo->Media;
@@ -248,6 +249,10 @@ PartitionInstallElToritoChildHandles (
);
}
ZeroMem (&PartitionInfo, sizeof (EFI_PARTITION_INFO_PROTOCOL));
PartitionInfo.Revision = EFI_PARTITION_INFO_PROTOCOL_REVISION;
PartitionInfo.Type = PARTITION_TYPE_OTHER;
Status = PartitionInstallChildHandle (
This,
Handle,
@@ -257,10 +262,10 @@ PartitionInstallElToritoChildHandles (
BlockIo2,
DevicePath,
(EFI_DEVICE_PATH_PROTOCOL *) &CdDev,
&PartitionInfo,
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize),
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize) + CdDev.PartitionSize - 1,
SubBlockSize,
FALSE
SubBlockSize
);
if (!EFI_ERROR (Status)) {
Found = EFI_SUCCESS;