MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
partition content and validate the GPT table and GPT entry.
|
||||
|
||||
Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, 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
|
||||
@@ -101,7 +101,7 @@ PartitionRestoreGptTable (
|
||||
|
||||
@param[in] PartHeader Partition table header structure
|
||||
@param[in] PartEntry The partition entry array
|
||||
@param[out] PEntryStatus the partition entry status array
|
||||
@param[out] PEntryStatus the partition entry status array
|
||||
recording the status of each partition
|
||||
|
||||
**/
|
||||
@@ -698,7 +698,7 @@ Done:
|
||||
|
||||
@param[in] PartHeader Partition table header structure
|
||||
@param[in] PartEntry The partition entry array
|
||||
@param[out] PEntryStatus the partition entry status array
|
||||
@param[out] PEntryStatus the partition entry status array
|
||||
recording the status of each partition
|
||||
|
||||
**/
|
||||
@@ -736,7 +736,7 @@ PartitionCheckGptEntry (
|
||||
|
||||
if ((Entry->Attributes & BIT1) != 0) {
|
||||
//
|
||||
// If Bit 1 is set, this indicate that this is an OS specific GUID partition.
|
||||
// If Bit 1 is set, this indicate that this is an OS specific GUID partition.
|
||||
//
|
||||
PEntryStatus[Index1].OsSpecific = TRUE;
|
||||
}
|
||||
|
@@ -3,17 +3,17 @@
|
||||
|
||||
MBR - Master Boot Record is in the first sector of a partitioned hard disk.
|
||||
The MBR supports four partitions per disk. The MBR also contains legacy
|
||||
code that is not run on an EFI system. The legacy code reads the
|
||||
first sector of the active partition into memory and
|
||||
code that is not run on an EFI system. The legacy code reads the
|
||||
first sector of the active partition into memory and
|
||||
|
||||
BPB - BIOS Parameter Block is in the first sector of a FAT file system.
|
||||
The BPB contains information about the FAT file system. The BPB is
|
||||
BPB - BIOS Parameter Block is in the first sector of a FAT file system.
|
||||
The BPB contains information about the FAT file system. The BPB is
|
||||
always on the first sector of a media. The first sector also contains
|
||||
the legacy boot strap code.
|
||||
|
||||
Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
|
||||
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, 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
|
||||
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
@param Mbr Parent Handle.
|
||||
@param LastLba Last Lba address on the device.
|
||||
|
||||
|
||||
@retval TRUE Mbr is a Valid MBR.
|
||||
@retval FALSE Mbr is not a Valid MBR.
|
||||
|
||||
@@ -76,7 +76,7 @@ PartitionValidMbr (
|
||||
// return FALSE since no block devices on a system are implemented
|
||||
// with INT 13h
|
||||
//
|
||||
|
||||
|
||||
DEBUG((EFI_D_INFO, "PartitionValidMbr: Bad MBR partition size EndingLBA(%1x) > LastLBA(%1x)\n", EndingLBA, LastLba));
|
||||
|
||||
return FALSE;
|
||||
@@ -113,7 +113,7 @@ PartitionValidMbr (
|
||||
@param[in] BlockIo Parent BlockIo interface.
|
||||
@param[in] BlockIo2 Parent BlockIo2 interface.
|
||||
@param[in] 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.
|
||||
@@ -215,9 +215,9 @@ PartitionInstallMbrChildHandles (
|
||||
if (Mbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION) {
|
||||
//
|
||||
// This is the guard MBR for the GPT. If you ever see a GPT disk with zero partitions you can get here.
|
||||
// We can not produce an MBR BlockIo for this device as the MBR spans the GPT headers. So formating
|
||||
// We can not produce an MBR BlockIo for this device as the MBR spans the GPT headers. So formating
|
||||
// this BlockIo would corrupt the GPT structures and require a recovery that would corrupt the format
|
||||
// that corrupted the GPT partition.
|
||||
// that corrupted the GPT partition.
|
||||
//
|
||||
continue;
|
||||
}
|
||||
|
@@ -27,8 +27,8 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = {
|
||||
PartitionDriverBindingStart,
|
||||
PartitionDriverBindingStop,
|
||||
//
|
||||
// Grub4Dos copies the BPB of the first partition to the MBR. If the
|
||||
// DriverBindingStart() of the Fat driver gets run before that of Partition
|
||||
// Grub4Dos copies the BPB of the first partition to the MBR. If the
|
||||
// DriverBindingStart() of the Fat driver gets run before that of Partition
|
||||
// driver only the first partition can be recognized.
|
||||
// Let the driver binding version of Partition driver be higher than that of
|
||||
// Fat driver to make sure the DriverBindingStart() of the Partition driver
|
||||
@@ -40,7 +40,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = {
|
||||
};
|
||||
|
||||
//
|
||||
// Prioritized function list to detect partition table.
|
||||
// Prioritized function list to detect partition table.
|
||||
//
|
||||
PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
|
||||
PartitionInstallGptChildHandles,
|
||||
@@ -82,7 +82,7 @@ PartitionDriverBindingSupported (
|
||||
//
|
||||
if (RemainingDevicePath != NULL) {
|
||||
//
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// if yes, go on checking other conditions
|
||||
//
|
||||
if (!IsDevicePathEnd (RemainingDevicePath)) {
|
||||
@@ -205,13 +205,13 @@ PartitionDriverBindingStart (
|
||||
EFI_TPL OldTpl;
|
||||
|
||||
BlockIo2 = NULL;
|
||||
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
//
|
||||
// Check RemainingDevicePath validation
|
||||
//
|
||||
if (RemainingDevicePath != NULL) {
|
||||
//
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// if yes, return EFI_SUCCESS
|
||||
//
|
||||
if (IsDevicePathEnd (RemainingDevicePath)) {
|
||||
@@ -333,12 +333,12 @@ PartitionDriverBindingStart (
|
||||
// driver. So don't try to close them. Otherwise, we will break the dependency
|
||||
// between the controller and the driver set up before.
|
||||
//
|
||||
// In the case that when the media changes on a device it will Reinstall the
|
||||
// In the case that when the media changes on a device it will Reinstall the
|
||||
// BlockIo interaface. This will cause a call to our Stop(), and a subsequent
|
||||
// reentrant call to our Start() successfully. We should leave the device open
|
||||
// when this happen. The "media change" case includes either the status is
|
||||
// EFI_MEDIA_CHANGED or it is a "media" to "no media" change.
|
||||
//
|
||||
// EFI_MEDIA_CHANGED or it is a "media" to "no media" change.
|
||||
//
|
||||
if (EFI_ERROR (Status) &&
|
||||
!EFI_ERROR (OpenStatus) &&
|
||||
Status != EFI_MEDIA_CHANGED &&
|
||||
@@ -351,7 +351,7 @@ PartitionDriverBindingStart (
|
||||
);
|
||||
//
|
||||
// Close Parent DiskIo2 if has.
|
||||
//
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDiskIo2ProtocolGuid,
|
||||
@@ -430,7 +430,7 @@ PartitionDriverBindingStop (
|
||||
);
|
||||
//
|
||||
// Close Parent BlockIO2 if has.
|
||||
//
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDiskIo2ProtocolGuid,
|
||||
@@ -467,7 +467,7 @@ PartitionDriverBindingStop (
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
);
|
||||
|
||||
|
||||
Private = PARTITION_DEVICE_FROM_BLOCK_IO_THIS (BlockIo);
|
||||
@@ -893,7 +893,7 @@ PartitionCreateAccessTask (
|
||||
|
||||
/**
|
||||
Read BufferSize bytes from Lba into Buffer.
|
||||
|
||||
|
||||
This function reads the requested number of blocks from the device. All the
|
||||
blocks are read, or an error is returned.
|
||||
If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_or EFI_MEDIA_CHANGED is returned and
|
||||
@@ -901,13 +901,13 @@ PartitionCreateAccessTask (
|
||||
not be signaled.
|
||||
|
||||
@param[in] This Indicates a pointer to the calling context.
|
||||
@param[in] MediaId Id of the media, changes every time the media is
|
||||
@param[in] MediaId Id of the media, changes every time the media is
|
||||
replaced.
|
||||
@param[in] Lba The starting Logical Block Address to read from.
|
||||
@param[in, out] Token A pointer to the token associated with the transaction.
|
||||
@param[in] BufferSize Size of Buffer, must be a multiple of device block size.
|
||||
@param[out] Buffer A pointer to the destination buffer for the data. The
|
||||
caller is responsible for either having implicit or
|
||||
@param[in, out] Token A pointer to the token associated with the transaction.
|
||||
@param[in] BufferSize Size of Buffer, must be a multiple of device block size.
|
||||
@param[out] Buffer A pointer to the destination buffer for the data. The
|
||||
caller is responsible for either having implicit or
|
||||
explicit ownership of the buffer.
|
||||
|
||||
@retval EFI_SUCCESS The read request was queued if Token->Event is
|
||||
@@ -919,7 +919,7 @@ PartitionCreateAccessTask (
|
||||
@retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
|
||||
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the
|
||||
intrinsic block size of the device.
|
||||
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
|
||||
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
|
||||
or the buffer is not on proper alignment.
|
||||
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
|
||||
of resources.
|
||||
@@ -994,7 +994,7 @@ PartitionReadBlocksEx (
|
||||
@retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
|
||||
@retval EFI_DEVICE_ERROR The device reported an error while performing the write.
|
||||
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
|
||||
@retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
|
||||
@retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
|
||||
or the buffer is not on proper alignment.
|
||||
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
|
||||
of resources.
|
||||
@@ -1026,7 +1026,7 @@ PartitionWriteBlocksEx (
|
||||
if (Offset + BufferSize > Private->End) {
|
||||
return ProbeMediaStatusEx (Private->DiskIo2, MediaId, EFI_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
|
||||
if ((Token != NULL) && (Token->Event != NULL)) {
|
||||
Task = PartitionCreateAccessTask (Token);
|
||||
if (Task == NULL) {
|
||||
@@ -1046,10 +1046,10 @@ PartitionWriteBlocksEx (
|
||||
|
||||
/**
|
||||
Flush the Block Device.
|
||||
|
||||
|
||||
If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED
|
||||
is returned and non-blocking I/O is being used, the Event associated with
|
||||
this request will not be signaled.
|
||||
this request will not be signaled.
|
||||
|
||||
@param[in] This Indicates a pointer to the calling context.
|
||||
@param[in, out] Token A pointer to the token associated with the transaction
|
||||
@@ -1160,7 +1160,7 @@ PartitionInstallChildHandle (
|
||||
// Set the BlockIO into Private Data.
|
||||
//
|
||||
Private->BlockIo.Revision = ParentBlockIo->Revision;
|
||||
|
||||
|
||||
Private->BlockIo.Media = &Private->Media;
|
||||
CopyMem (Private->BlockIo.Media, ParentBlockIo->Media, sizeof (EFI_BLOCK_IO_MEDIA));
|
||||
|
||||
@@ -1180,7 +1180,7 @@ PartitionInstallChildHandle (
|
||||
Private->BlockIo2.Reset = PartitionResetEx;
|
||||
Private->BlockIo2.ReadBlocksEx = PartitionReadBlocksEx;
|
||||
Private->BlockIo2.WriteBlocksEx = PartitionWriteBlocksEx;
|
||||
Private->BlockIo2.FlushBlocksEx = PartitionFlushBlocksEx;
|
||||
Private->BlockIo2.FlushBlocksEx = PartitionFlushBlocksEx;
|
||||
}
|
||||
|
||||
Private->Media.IoAlign = 0;
|
||||
@@ -1234,7 +1234,7 @@ PartitionInstallChildHandle (
|
||||
}
|
||||
|
||||
//
|
||||
// Create the new handle.
|
||||
// Create the new handle.
|
||||
//
|
||||
Private->Handle = NULL;
|
||||
if (Private->DiskIo2 != NULL) {
|
||||
@@ -1252,7 +1252,7 @@ PartitionInstallChildHandle (
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
} else {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&Private->Handle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
@@ -1291,9 +1291,9 @@ PartitionInstallChildHandle (
|
||||
/**
|
||||
The user Entry Point for module Partition. The user code starts with this function.
|
||||
|
||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param[in] SystemTable A pointer to the EFI System Table.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||
@retval other Some error occurs when executing this entry point.
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/** @file
|
||||
Partition driver that produces logical BlockIo devices from a physical
|
||||
Partition driver that produces logical BlockIo devices from a physical
|
||||
BlockIo device. The logical BlockIo devices are based on the format
|
||||
of the raw block devices media. Currently "El Torito CD-ROM", UDF, Legacy
|
||||
MBR, and GPT partition schemes are supported.
|
||||
|
||||
Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, 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
|
||||
@@ -16,8 +16,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 <Uefi.h>
|
||||
#include <Protocol/BlockIo.h>
|
||||
@@ -431,7 +431,7 @@ PartitionInstallElToritoChildHandles (
|
||||
@param[in] BlockIo Parent BlockIo interface.
|
||||
@param[in] BlockIo2 Parent BlockIo2 interface.
|
||||
@param[in] 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.
|
||||
|
@@ -11,15 +11,15 @@
|
||||
# This external input must be validated carefully to avoid security issue like
|
||||
# buffer overflow, integer overflow.
|
||||
#
|
||||
# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2006 - 2018, 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
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
|
@@ -5,19 +5,19 @@
|
||||
// the bytes from Start to End of the Parent Block I/O device.
|
||||
// The partition of physical BlockIo device supported is one of legacy MBR, GPT,
|
||||
// and "El Torito" partitions.
|
||||
//
|
||||
//
|
||||
// Caution: This module requires additional review when modified.
|
||||
// This driver will have external input - disk partition.
|
||||
// This external input must be validated carefully to avoid security issue like
|
||||
// buffer overflow, integer overflow.
|
||||
//
|
||||
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2006 - 2018, 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
|
||||
// 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.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// PartitionDxe Localized Strings and Content
|
||||
//
|
||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2013 - 2018, 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
|
||||
@@ -13,8 +13,8 @@
|
||||
//
|
||||
// **/
|
||||
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
"Partition DXE Driver"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user