UpdateDriver.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Common defines and definitions for a component update driver.
Copyright (c) 2002 - 2010, 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
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 _EFI_UPDATE_DRIVER_H_
#define _EFI_UPDATE_DRIVER_H_
#include <PiDxe.h>
#include <Protocol/LoadedImage.h>
#include <Guid/CapsuleDataFile.h>
#include <Protocol/FaultTolerantWrite.h>
#include <Protocol/FirmwareVolumeBlock.h>
#include <Protocol/FirmwareVolume2.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DxeServicesTableLib.h>
#include <Library/PrintLib.h>
#include <Library/DevicePathLib.h>
extern EFI_HII_HANDLE gHiiHandle;
typedef enum {
UpdateWholeFV = 0, // 0, update whole FV
UpdateFvFile, // 1, update a set of FV files asynchronously
UpdateFvRange, // 2, update part of FV or flash
typedef struct {
typedef struct _SECTION_ITEM SECTION_ITEM;
struct _SECTION_ITEM {
};
typedef struct _COMMENT_LINE COMMENT_LINE;
struct _COMMENT_LINE {
};
typedef struct {
#define MAX_LINE_LENGTH 512
#define EFI_D_UPDATE EFI_D_ERROR
#define MIN_ALIGNMENT_SIZE 4
#define ALIGN_SIZE(a) ((a % MIN_ALIGNMENT_SIZE) ? MIN_ALIGNMENT_SIZE - (a % MIN_ALIGNMENT_SIZE) : 0)
/**
Parse Config data file to get the updated data array.
@param DataBuffer Config raw file buffer.
@param BufferSize Size of raw buffer.
@param NumOfUpdates Pointer to the number of update data.
@param UpdateArray Pointer to the config of update data.
@retval EFI_NOT_FOUND No config data is found.
@retval EFI_OUT_OF_RESOURCES No enough memory is allocated.
@retval EFI_SUCCESS Parse the config file successfully.
**/
);
/**
Update the whole FV image, and reinsall FVB protocol for the updated FV image.
@param FvbHandle Handle of FVB protocol for the updated flash range.
@param FvbProtocol FVB protocol.
@param ConfigData Config data on updating driver.
@param ImageBuffer Image buffer to be updated.
@param ImageSize Image size.
@retval EFI_INVALID_PARAMETER Update type is not UpdateWholeFV.
Or Image size is not same to the size of whole FV.
@retval EFI_OUT_OF_RESOURCES No enoug memory is allocated.
@retval EFI_SUCCESS FV image is updated, and its FVB protocol is reinstalled.
**/
);
/**
Update certain file in the FV.
@param FvbHandle Handle of FVB protocol for the updated flash range.
@param FvbProtocol FVB protocol.
@param ConfigData Config data on updating driver.
@param ImageBuffer Image buffer to be updated.
@param ImageSize Image size.
@param FileType FFS file type.
@param FileAttributes FFS file attribute
@retval EFI_INVALID_PARAMETER Update type is not UpdateFvFile.
Or Image size is not same to the size of whole FV.
@retval EFI_UNSUPPORTED PEIM FFS is unsupported to be updated.
@retval EFI_SUCCESS The FFS file is added into FV.
**/
);
/**
Update the buffer into flash area in fault tolerant write method.
@param ImageBuffer Image buffer to be updated.
@param SizeLeft Size of the image buffer.
@param UpdatedSize Size of the updated buffer.
@param ConfigData Config data on updating driver.
@param FlashAddress Flash address to be updated as start address.
@param FvbProtocol FVB protocol.
@param FvbHandle Handle of FVB protocol for the updated flash range.
@retval EFI_SUCCESS Buffer data is updated into flash.
@retval EFI_INVALID_PARAMETER Base flash address is not in FVB flash area.
@retval EFI_NOT_FOUND FTW protocol doesn't exist.
@retval EFI_OUT_OF_RESOURCES No enough backup space.
@retval EFI_ABORTED Error happen when update flash area.
**/
);
/**
Directly update the buffer into flash area without fault tolerant write method.
@param ImageBuffer Image buffer to be updated.
@param SizeLeft Size of the image buffer.
@param UpdatedSize Size of the updated buffer.
@param FlashAddress Flash address to be updated as start address.
@param FvbProtocol FVB protocol.
@param FvbHandle Handle of FVB protocol for the updated flash range.
@retval EFI_SUCCESS Buffer data is updated into flash.
@retval EFI_INVALID_PARAMETER Base flash address is not in FVB flash area.
@retval EFI_OUT_OF_RESOURCES No enough backup space.
**/
);
#endif