EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions

IntelFrameworkModulePkg/Universal/FirmwareVolume/UpdateDriverDxe/ParseUpdateProfile.c File Reference

#include "UpdateDriver.h"

Go to the source code of this file.

Functions

EFI_STATUS ProfileGetLine (IN UINT8 *Buffer, IN UINTN BufferSize, IN OUT UINT8 *LineBuffer, IN OUT UINTN *LineSize)
VOID ProfileTrim (IN OUT UINT8 *Buffer, IN OUT UINTN *BufferSize)
EFI_STATUS ProfileGetComments (IN UINT8 *Buffer, IN UINTN BufferSize, IN OUT COMMENT_LINE **CommentHead)
EFI_STATUS ProfileGetSection (IN UINT8 *Buffer, IN UINTN BufferSize, IN OUT SECTION_ITEM **SectionHead)
EFI_STATUS ProfileGetEntry (IN UINT8 *Buffer, IN UINTN BufferSize, IN OUT SECTION_ITEM **SectionHead)
VOID FreeAllList (IN SECTION_ITEM *Section, IN COMMENT_LINE *Comment)
EFI_STATUS UpdateGetProfileString (IN SECTION_ITEM *Section, IN UINT8 *SectionName, IN UINT8 *EntryName, OUT UINT8 **EntryValue)
UINTN UpdateAtoi (IN UINT8 *Str)
UINTN UpdateValueToString (IN OUT UINT8 *Buffer, IN INT64 Value)
VOID UpdateStrCatNumber (IN OUT UINT8 *Str, IN UINTN Number)
EFI_STATUS UpdateStringToGuid (IN UINT8 *Str, IN OUT EFI_GUID *Guid)
EFI_STATUS PreProcessDataFile (IN UINT8 *DataBuffer, IN UINTN BufferSize, IN OUT SECTION_ITEM **SectionHead, IN OUT COMMENT_LINE **CommentHead)
EFI_STATUS ParseUpdateDataFile (IN UINT8 *DataBuffer, IN UINTN BufferSize, IN OUT UINTN *NumOfUpdates, IN OUT UPDATE_CONFIG_DATA **UpdateArray)

Detailed Description

Source file for the component update driver. It parse the update configuration file and pass the information to the update driver so that the driver can perform updates accordingly.

Copyright (c) 2002 - 2010, Intel Corporation. All rights reserved.

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.

Definition in file ParseUpdateProfile.c.


Function Documentation

VOID FreeAllList ( IN SECTION_ITEM Section,
IN COMMENT_LINE Comment 
)

Free all comment entry and section entry.

Parameters:
SectionSection entry list.
CommentComment entry list.

Definition at line 437 of file ParseUpdateProfile.c.

EFI_STATUS ParseUpdateDataFile ( IN UINT8 DataBuffer,
IN UINTN  BufferSize,
IN OUT UINTN NumOfUpdates,
IN OUT UPDATE_CONFIG_DATA **  UpdateArray 
)

Parse Config data file to get the updated data array.

Parameters:
DataBufferConfig raw file buffer.
BufferSizeSize of raw buffer.
NumOfUpdatesPointer to the number of update data.
UpdateArrayPointer to the config of update data.
Return values:
EFI_NOT_FOUNDNo config data is found.
EFI_OUT_OF_RESOURCESNo enough memory is allocated.
EFI_SUCCESSParse the config file successfully.

Definition at line 935 of file ParseUpdateProfile.c.

EFI_STATUS PreProcessDataFile ( IN UINT8 DataBuffer,
IN UINTN  BufferSize,
IN OUT SECTION_ITEM **  SectionHead,
IN OUT COMMENT_LINE **  CommentHead 
)

Pre process config data buffer into Section entry list and Comment entry list.

Parameters:
DataBufferConfig raw file buffer.
BufferSizeSize of raw buffer.
SectionHeadPointer to the section entry list.
CommentHeadPointer to the comment entry list.
Return values:
EFI_OUT_OF_RESOURCESNo enough memory is allocated.
EFI_SUCCESSConfig data buffer is preprocessed.

Definition at line 801 of file ParseUpdateProfile.c.

EFI_STATUS ProfileGetComments ( IN UINT8 Buffer,
IN UINTN  BufferSize,
IN OUT COMMENT_LINE **  CommentHead 
)

Insert new comment item into comment head.

Parameters:
BufferComment buffer to be added.
BufferSizeSize of comment buffer.
CommentHeadComment Item head entry.
Return values:
EFI_OUT_OF_RESOURCESNo enough memory is allocated.
EFI_SUCCESSNew comment item is inserted.

Definition at line 180 of file ParseUpdateProfile.c.

EFI_STATUS ProfileGetEntry ( IN UINT8 Buffer,
IN UINTN  BufferSize,
IN OUT SECTION_ITEM **  SectionHead 
)

Add new section entry and entry value into Section head.

Parameters:
BufferSection entry data buffer.
BufferSizeSize of section entry.
SectionHeadSection item head entry.
Return values:
EFI_OUT_OF_RESOURCESNo enough memory is allocated.
EFI_SUCCESSSection entry is NULL or Section entry is added.

Definition at line 309 of file ParseUpdateProfile.c.

EFI_STATUS ProfileGetLine ( IN UINT8 Buffer,
IN UINTN  BufferSize,
IN OUT UINT8 LineBuffer,
IN OUT UINTN LineSize 
)

Copy one line data from buffer data to the line buffer.

Parameters:
BufferBuffer data.
BufferSizeBuffer Size.
LineBufferLine buffer to store the found line data.
LineSizeOn input, size of the input line buffer. On output, size of the actual line buffer.
Return values:
EFI_BUFFER_TOO_SMALLThe size of input line buffer is not enough.
EFI_SUCCESSCopy line data into the line buffer.

Definition at line 35 of file ParseUpdateProfile.c.

EFI_STATUS ProfileGetSection ( IN UINT8 Buffer,
IN UINTN  BufferSize,
IN OUT SECTION_ITEM **  SectionHead 
)

Add new section item into Section head.

Parameters:
BufferSection item data buffer.
BufferSizeSize of section item.
SectionHeadSection item head entry.
Return values:
EFI_OUT_OF_RESOURCESNo enough memory is allocated.
EFI_SUCCESSSection item is NULL or Section item is added.

Definition at line 223 of file ParseUpdateProfile.c.

VOID ProfileTrim ( IN OUT UINT8 Buffer,
IN OUT UINTN BufferSize 
)

Trim Buffer by removing all CR, LF, TAB, and SPACE chars in its head and tail.

Parameters:
BufferOn input, buffer data to be trimed. On output, the trimmed buffer.
BufferSizeOn input, size of original buffer data. On output, size of the trimmed buffer.

Definition at line 96 of file ParseUpdateProfile.c.

UINTN UpdateAtoi ( IN UINT8 Str)

Convert the dec or hex ascii string to value.

Parameters:
Strascii string to be converted.
Returns:
the converted value.

Definition at line 523 of file ParseUpdateProfile.c.

EFI_STATUS UpdateGetProfileString ( IN SECTION_ITEM Section,
IN UINT8 SectionName,
IN UINT8 EntryName,
OUT UINT8 **  EntryValue 
)

Get section entry value.

Parameters:
SectionSection entry list.
SectionNameSection name.
EntryNameSection entry name.
EntryValuePoint to the got entry value.
Return values:
EFI_NOT_FOUNDSection is not found.
EFI_SUCCESSSection entry value is got.

Definition at line 485 of file ParseUpdateProfile.c.

VOID UpdateStrCatNumber ( IN OUT UINT8 Str,
IN UINTN  Number 
)

Convert the input value to a ascii string, and concatenates this string to the input string.

Parameters:
StrPointer to a Null-terminated ASCII string.
NumberThe unsgned value to convert to a string.

Definition at line 633 of file ParseUpdateProfile.c.

EFI_STATUS UpdateStringToGuid ( IN UINT8 Str,
IN OUT EFI_GUID Guid 
)

Convert the input ascii string into GUID value.

Parameters:
StrAscii GUID string to be converted.
GuidPointer to the converted GUID value.
Return values:
EFI_OUT_OF_RESOURCESNo enough memory is allocated.
EFI_NOT_FOUNDThe input ascii string is not a valid GUID format string.
EFI_SUCCESSGUID value is got.

Definition at line 663 of file ParseUpdateProfile.c.

UINTN UpdateValueToString ( IN OUT UINT8 Buffer,
IN INT64  Value 
)

Converts a decimal value to a Null-terminated ascii string.

Parameters:
BufferPointer to the output buffer for the produced Null-terminated ASCII string.
ValueThe 64-bit sgned value to convert to a string.
Returns:
The number of ASCII characters in Buffer not including the Null-terminator.

Definition at line 578 of file ParseUpdateProfile.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines