From 68dbca6c14afab33f30d43c9956b659c15fa6874 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Thu, 25 Dec 2008 09:13:53 +0000 Subject: Code Clean for Driver PlatformDriOverrideDxe and PlatOverMngr application. And Clean PlatDriOver library class. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7121 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Include/Guid/AlternateFvBlock.h | 3 +- MdeModulePkg/Include/Guid/OverrideVariable.h | 3 +- MdeModulePkg/Include/Guid/SystemNvDataGuid.h | 20 ++++--- MdeModulePkg/Include/Library/PlatDriOverLib.h | 66 ++-------------------- .../Include/Protocol/FaultTolerantWriteLite.h | 3 +- MdeModulePkg/Include/VariableFormat.h | 8 +-- 6 files changed, 26 insertions(+), 77 deletions(-) (limited to 'MdeModulePkg/Include') diff --git a/MdeModulePkg/Include/Guid/AlternateFvBlock.h b/MdeModulePkg/Include/Guid/AlternateFvBlock.h index 8731fe862b..a5e81f0750 100644 --- a/MdeModulePkg/Include/Guid/AlternateFvBlock.h +++ b/MdeModulePkg/Include/Guid/AlternateFvBlock.h @@ -1,7 +1,8 @@ /** @file This file defines the Alternate Firmware Volume Block Guid, which is - used to specify that the additional FVB protocol is installed into FVB handle. + used to specify that the full funcationality FVB protocol is installed + that support read, write and erase capability for block devices. Copyright (c) 2006 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials diff --git a/MdeModulePkg/Include/Guid/OverrideVariable.h b/MdeModulePkg/Include/Guid/OverrideVariable.h index e859621fe6..3cd5b0333f 100644 --- a/MdeModulePkg/Include/Guid/OverrideVariable.h +++ b/MdeModulePkg/Include/Guid/OverrideVariable.h @@ -1,5 +1,5 @@ /** @file - This file defines the platform override variable name and variable guid. + This file defines the platform driver override variable name and variable guid. Copyright (c) 2008, Intel Corporation All rights reserved. This program and the accompanying materials @@ -25,5 +25,4 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. extern EFI_GUID gEfiOverrideVariableGuid; - #endif // #ifndef __EFI_OVERRIDE_VARIABLE_GUID_H__ diff --git a/MdeModulePkg/Include/Guid/SystemNvDataGuid.h b/MdeModulePkg/Include/Guid/SystemNvDataGuid.h index 1f9e5e7987..ab45166f02 100644 --- a/MdeModulePkg/Include/Guid/SystemNvDataGuid.h +++ b/MdeModulePkg/Include/Guid/SystemNvDataGuid.h @@ -1,6 +1,8 @@ /** @file - This file defines NvDataHob GUIDs for System Non Volatile HOB entries - in the HOB list and NV system hob entry structure. + This file defines NvData Hob GUIDs for System Non Volatile HOB entries and the corresponding hob data structure. + NvData Hob is used to report the region of the system non volatile data + for the specific purpose, such as FTW region, Error log region. + It also defines NvDataFv GUID used as the signature of FTW working block header. Copyright (c) 2006 - 2008, Intel Corporation @@ -27,13 +29,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /// Hob entry for NV data region /// typedef struct { - EFI_GUID SystemNvDataHobGuid; /// EFI_SYSTEM_NV_DATA_HOB_GUID - EFI_GUID SystemNvDataFvGuid; /// Guid specifies the NvData Fv for the specific purpose, such as FTW, Error Log. - EFI_LBA StartLba; /// The starting logical block index. - UINTN StartLbaOffset; /// Offset into the starting block at which to the start of NvData region. - EFI_LBA EndLba; /// The last logical block index. - UINTN EndLbaOffset; /// Offset into the last block at which to the end of Nvdata region. - UINT32 DataTypeSignature; /// NvData type in the specified NV range. + EFI_GUID SystemNvDataHobGuid; ///> EFI_SYSTEM_NV_DATA_HOB_GUID + EFI_GUID SystemNvDataFvGuid; ///> Guid specifies the NvData Fv for the specific purpose, such as FTW, Error Log. + EFI_LBA StartLba; ///> The starting logical block index. + UINTN StartLbaOffset; ///> Offset into the starting block at which to the start of NvData region. + EFI_LBA EndLba; ///> The last logical block index. + UINTN EndLbaOffset; ///> Offset into the last block at which to the end of Nvdata region. + UINT32 DataTypeSignature; ///> NvData type in the specified NV range. } NV_SYSTEM_DATA_GUID_TYPE; extern EFI_GUID gEfiSystemNvDataHobGuid; diff --git a/MdeModulePkg/Include/Library/PlatDriOverLib.h b/MdeModulePkg/Include/Library/PlatDriOverLib.h index d49d66da2c..8ca8b92839 100644 --- a/MdeModulePkg/Include/Library/PlatDriOverLib.h +++ b/MdeModulePkg/Include/Library/PlatDriOverLib.h @@ -16,30 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef _PLAT_DRI_OVER_LIB_H_ #define _PLAT_DRI_OVER_LIB_H_ -#include #include -#include -#include - -#include - -/** - Install the Platform Driver Override Protocol, and ensure there is only one Platform Driver Override Protocol - in the system. - - @param gPlatformDriverOverride PlatformDriverOverride protocol interface which - needs to be installed - - @retval EFI_ALREADY_STARTED There has been a Platform Driver Override - Protocol in the system, cannot install it again. - @retval EFI_SUCCESS The protocol is installed successfully. - -**/ -EFI_STATUS -EFIAPI -InstallPlatformDriverOverrideProtocol ( - EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *gPlatformDriverOverride - ); /** Free all the mapping database memory resource and initialize the mapping list entry. @@ -57,8 +34,8 @@ FreeMappingDatabase ( ); /** - Read the environment variable(s) that contain the override mappings from Controller Device Path to - a set of Driver Device Paths, and create the mapping database in memory with those variable info. + Read the NV environment variable(s) that contain the override mappings from Controller Device Path to + a set of Driver Device Paths, and create the mapping database in memory to contain these variable info. @param MappingDataBase Mapping database list entry pointer @@ -76,6 +53,7 @@ InitOverridesMapping ( /** Save the memory mapping database into NV environment variable(s). + If MappingDataBase list is empty, then delete all platform override NV variables. @param MappingDataBase Mapping database list entry pointer @@ -92,7 +70,6 @@ SaveOverridesMapping ( /** Retrieves the image handle of the platform override driver for a controller in the system from the memory mapping database. - @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance. @param ControllerHandle The device handle of the controller to check if a driver override exists. @param DriverImageHandle On output, a pointer to the next driver handle. @@ -117,27 +94,14 @@ SaveOverridesMapping ( EFI_STATUS EFIAPI GetDriverFromMapping ( - IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * This, IN EFI_HANDLE ControllerHandle, - IN OUT EFI_HANDLE * DriverImageHandle, - IN LIST_ENTRY * MappingDataBase, + IN OUT EFI_HANDLE *DriverImageHandle, + IN LIST_ENTRY *MappingDataBase, IN EFI_HANDLE CallerImageHandle ); /** - Deletes all environment variable(s) that contain the override mappings from Controller Device Path to - a set of Driver Device Paths. - - @retval EFI_SUCCESS Delete all variable(s) successfully. -**/ -EFI_STATUS -EFIAPI -DeleteOverridesVariables ( - VOID - ); - -/** - Check mapping database whether already has the mapping info which + Check mapping database whether already has the mapping info which records the input Controller to input DriverImage. @param ControllerDevicePath The controller device path is to be check. @@ -214,22 +178,4 @@ DeleteDriverImage ( IN LIST_ENTRY *MappingDataBase ); -/** - Get the first Binding protocol which has the specific image handle - - @param ImageHandle The Image handle - @param BindingHandle The BindingHandle of the found Driver Binding protocol. - If Binding protocol is not found, it is set to NULL. - - @return Pointer into the Binding Protocol interface - @retval NULL The parameter is not valid or the binding protocol is not found. - -**/ -EFI_DRIVER_BINDING_PROTOCOL * -EFIAPI -GetBindingProtocolFromImageHandle ( - IN EFI_HANDLE ImageHandle, - OUT EFI_HANDLE *BindingHandle - ); - #endif diff --git a/MdeModulePkg/Include/Protocol/FaultTolerantWriteLite.h b/MdeModulePkg/Include/Protocol/FaultTolerantWriteLite.h index 368279f68d..d28845da95 100644 --- a/MdeModulePkg/Include/Protocol/FaultTolerantWriteLite.h +++ b/MdeModulePkg/Include/Protocol/FaultTolerantWriteLite.h @@ -43,7 +43,8 @@ typedef struct _EFI_FTW_LITE_PROTOCOL EFI_FTW_LITE_PROTOCOL; @retval EFI_SUCCESS The function completed successfully @retval EFI_ABORTED The function could not complete successfully. - @retval EFI_BAD_BUFFER_SIZE The input data can't fit within the target block. + @retval EFI_BAD_BUFFER_SIZE The input data can't fit within the FTW range. + The write buffer is too large to be supported. @retval EFI_ACCESS_DENIED No writes have been allocated. @retval EFI_OUT_OF_RESOURCES Cannot allocate enough memory resource. @retval EFI_NOT_FOUND Cannot find FVB protocol by handle. diff --git a/MdeModulePkg/Include/VariableFormat.h b/MdeModulePkg/Include/VariableFormat.h index 8efbc79578..7c0bf1a3eb 100644 --- a/MdeModulePkg/Include/VariableFormat.h +++ b/MdeModulePkg/Include/VariableFormat.h @@ -94,10 +94,10 @@ typedef struct { /// /// Variable State flags /// -#define VAR_IN_DELETED_TRANSITION 0xfe /// Variable is in obsolete transistion -#define VAR_DELETED 0xfd /// Variable is obsolete -#define VAR_HEADER_VALID_ONLY 0x7f /// Variable header has been valid -#define VAR_ADDED 0x3f /// Variable has been completely added +#define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transistion +#define VAR_DELETED 0xfd ///< Variable is obsolete +#define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid +#define VAR_ADDED 0x3f ///< Variable has been completely added /// /// Removed -- cgit v1.2.3