15#define MAX_LINE_LENGTH 512
40 CHAR8 Entry[MAX_LINE_LENGTH];
51 if (Context ==
NULL) {
52 return EFI_INVALID_PARAMETER;
64 if (EFI_ERROR (Status) || (Num == 0)) {
65 DEBUG ((DEBUG_ERROR,
"NumOfUpdate not found\n"));
70 ConfigHeader->NumOfUpdates = Num;
72 if (*UpdateArray ==
NULL) {
74 return EFI_OUT_OF_RESOURCES;
77 for (Index = 0; Index < ConfigHeader->NumOfUpdates; Index++) {
95 if (EFI_ERROR (Status) || (SectionName ==
NULL)) {
96 DEBUG ((DEBUG_ERROR,
"[%d] %a not found\n", Index, Entry));
105 (*UpdateArray)[Index].Index = Index;
116 if (EFI_ERROR (Status)) {
118 DEBUG ((DEBUG_ERROR,
"[%d] FirmwareType not found\n", Index));
119 return EFI_NOT_FOUND;
122 (*UpdateArray)[Index].FirmwareType = (PLATFORM_FIRMWARE_TYPE)Num;
133 if (EFI_ERROR (Status)) {
135 DEBUG ((DEBUG_ERROR,
"[%d] AddressType not found\n", Index));
136 return EFI_NOT_FOUND;
139 (*UpdateArray)[Index].AddressType = (FLASH_ADDRESS_TYPE)Num;
150 if (EFI_ERROR (Status)) {
152 DEBUG ((DEBUG_ERROR,
"[%d] BaseAddress not found\n", Index));
153 return EFI_NOT_FOUND;
167 if (EFI_ERROR (Status)) {
169 DEBUG ((DEBUG_ERROR,
"[%d] FileGuid not found\n", Index));
170 return EFI_NOT_FOUND;
173 CopyGuid (&((*UpdateArray)[Index].FileGuid), &FileGuid);
184 if (EFI_ERROR (Status)) {
186 DEBUG ((DEBUG_ERROR,
"[%d] Length not found\n", Index));
187 return EFI_NOT_FOUND;
190 (*UpdateArray)[Index].Length = (
UINTN)Num;
201 if (EFI_ERROR (Status)) {
203 DEBUG ((DEBUG_ERROR,
"[%d] ImageOffset not found\n", Index));
204 return EFI_NOT_FOUND;
207 (*UpdateArray)[Index].ImageOffset = (
UINTN)Num;
UINTN EFIAPI AsciiStrnLenS(IN CONST CHAR8 *String, IN UINTN MaxSize)
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI CloseIniFile(IN VOID *Context)
EFI_STATUS EFIAPI GetStringFromDataFile(IN VOID *Context, IN CHAR8 *SectionName, IN CHAR8 *EntryName, OUT CHAR8 **EntryValue)
EFI_STATUS EFIAPI GetGuidFromDataFile(IN VOID *Context, IN CHAR8 *SectionName, IN CHAR8 *EntryName, OUT EFI_GUID *Guid)
EFI_STATUS EFIAPI GetHexUintnFromDataFile(IN VOID *Context, IN CHAR8 *SectionName, IN CHAR8 *EntryName, OUT UINTN *Data)
VOID *EFIAPI OpenIniFile(IN UINT8 *DataBuffer, IN UINTN BufferSize)
EFI_STATUS EFIAPI GetHexUint64FromDataFile(IN VOID *Context, IN CHAR8 *SectionName, IN CHAR8 *EntryName, OUT UINT64 *Data)
EFI_STATUS EFIAPI GetDecimalUintnFromDataFile(IN VOID *Context, IN CHAR8 *SectionName, IN CHAR8 *EntryName, OUT UINTN *Data)
RETURN_STATUS EFIAPI AsciiValueToStringS(IN OUT CHAR8 *Buffer, IN UINTN BufferSize, IN UINTN Flags, IN INT64 Value, IN UINTN Width)
#define DEBUG(Expression)
EFI_STATUS ParseUpdateDataFile(IN UINT8 *DataBuffer, IN UINTN BufferSize, IN OUT CONFIG_HEADER *ConfigHeader, IN OUT UPDATE_CONFIG_DATA **UpdateArray)
UINT64 EFI_PHYSICAL_ADDRESS