Clean up BootMaint module in BdsDxe.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5444 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2008-07-10 09:00:40 +00:00
parent 2ab6330e7e
commit dce655e8bf
12 changed files with 1081 additions and 1139 deletions

View File

@ -77,6 +77,10 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
#
#This dependency is because of gEfiLegacyBiosProtocolGuid and gEfiDataHubProtocolGuid. It may be removed if a Library class is created to
#abstract away definition in Framework specification or PI spec incorporates the Legacy Booting Protocols and Data Hub Protocols.
#
IntelFrameworkPkg/IntelFrameworkPkg.dec
@ -120,7 +124,6 @@
gEfiHiiStringProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSimpleFileSystemProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiLoadFileProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiCpuIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiBdsArchProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDataHubProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiGenericMemTestProtocolGuid # PROTOCOL ALWAYS_CONSUMED
@ -136,7 +139,6 @@
gEfiFormBrowser2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSerialIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiAcpiS3SaveProtocolGuid
[FeaturePcd.common]
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDepricate

View File

@ -16,13 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "BBSsupport.h"
EFI_DEVICE_PATH_PROTOCOL EndDevicePath[] = {
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
END_DEVICE_PATH_LENGTH,
0
};
/**
Translate the first n characters of an Ascii string to
@ -291,7 +284,7 @@ BdsCreateLegacyBootOption (
//
UnicodeToAscii (BootDesc, StrSize (BootDesc), HelpString);
StringLen = AsciiStrLen (HelpString);
NewBbsDevPathNode = EfiAllocateZeroPool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen);
NewBbsDevPathNode = AllocateZeroPool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen);
if (NewBbsDevPathNode == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -320,7 +313,7 @@ BdsCreateLegacyBootOption (
sizeof (BBS_TABLE) +
sizeof (UINT16);
Buffer = EfiAllocateZeroPool (BufferSize);
Buffer = AllocateZeroPool (BufferSize);
if (Buffer == NULL) {
FreePool (NewBbsDevPathNode);
FreePool (CurrentBbsDevPath);
@ -369,7 +362,7 @@ BdsCreateLegacyBootOption (
SafeFreePool (Buffer);
Buffer = NULL;
NewBootOrderList = EfiAllocateZeroPool (*BootOrderListSize + sizeof (UINT16));
NewBootOrderList = AllocateZeroPool (*BootOrderListSize + sizeof (UINT16));
if (NULL == NewBootOrderList) {
FreePool (NewBbsDevPathNode);
FreePool (CurrentBbsDevPath);
@ -963,7 +956,7 @@ BdsCreateDevOrder (
TotalSize += (HeaderSize + sizeof (UINT16) * NETCount);
TotalSize += (HeaderSize + sizeof (UINT16) * BEVCount);
DevOrder = EfiAllocateZeroPool (TotalSize);
DevOrder = AllocateZeroPool (TotalSize);
if (NULL == DevOrder) {
return EFI_OUT_OF_RESOURCES;
}
@ -1151,7 +1144,7 @@ BdsUpdateLegacyDevOrder (
TotalSize += (HeaderSize + NETCount * sizeof (UINT16));
TotalSize += (HeaderSize + BEVCount * sizeof (UINT16));
NewDevOrder = EfiAllocateZeroPool (TotalSize);
NewDevOrder = AllocateZeroPool (TotalSize);
if (NULL == NewDevOrder) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Bugbug: Candidate for a PCD entries
//
#define MAX_BBS_ENTRIES 0x100
/**
EDES_TODO: Add function description.
@ -30,8 +32,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@return EDES_TODO: Add description for return value
**/
#define MAX_BBS_ENTRIES 0x100
VOID
BdsBuildLegacyDevNameString (
IN BBS_TABLE *CurBBSEntry,

View File

@ -14,43 +14,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "BootMaint.h"
/**
Wrap original AllocatePool gBS call
and ZeroMem gBS call into a single
function in order to decrease code length
@param Size The size to allocate
@return Valid pointer to the allocated buffer
@retval Null for failure
**/
VOID *
EfiAllocateZeroPool (
IN UINTN Size
)
{
EFI_STATUS Status;
VOID *Ptr;
Status = gBS->AllocatePool (EfiBootServicesData, Size, &Ptr);
if (EFI_ERROR (Status)) {
Ptr = NULL;
return Ptr;
}
ZeroMem (Ptr, Size);
return Ptr;
}
/**
Find the first instance of this Protocol
in the system and return it's interface
@param ProtocolGuid - Provides the protocol to search for
@param Interface - On return, a pointer to the first interface
@param ProtocolGuid Provides the protocol to search for
@param Interface On return, a pointer to the first interface
that matches ProtocolGuid
@retval EFI_SUCCESS A protocol instance matching ProtocolGuid was found
@ -131,6 +102,7 @@ EfiLibOpenRoot (
@retval TRUE if the buffer was reallocated and the caller
should try the API again.
@retval FALSE The caller should not call this function again.
**/
BOOLEAN
@ -156,7 +128,7 @@ EfiGrowBuffer (
SafeFreePool (*Buffer);
*Buffer = EfiAllocateZeroPool (BufferSize);
*Buffer = AllocateZeroPool (BufferSize);
if (*Buffer != NULL) {
TryAgain = TRUE;
@ -179,11 +151,12 @@ EfiGrowBuffer (
Function returns the value of the specified variable.
@param Name - A Null-terminated Unicode string that is
@param Name A Null-terminated Unicode string that is
the name of the vendor's variable.
@param VendorGuid - A unique identifier for the vendor.
@param VendorGuid A unique identifier for the vendor.
@return The payload of the variable.
@retval NULL If the variable can't be read.
**/
VOID *
@ -244,7 +217,8 @@ EfiLibDeleteVariable (
@param FHand The file handle.
@return A pointer to a buffer with file information or NULL is returned
@return A pointer to a buffer with file information.
@retval NULL is returned if failed to get Vaolume Label Info.
**/
EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *
@ -282,7 +256,7 @@ EfiLibFileSystemVolumeLabelInfo (
@param Src The source.
@return A new string which is duplicated copy of the source.
@retval NULL If there is not enought memory.
@retval NULL If there is not enough memory.
**/
CHAR16 *
@ -294,7 +268,7 @@ EfiStrDuplicate (
UINTN Size;
Size = StrSize (Src);
Dest = EfiAllocateZeroPool (Size);
Dest = AllocateZeroPool (Size);
ASSERT (Dest != NULL);
if (Dest != NULL) {
CopyMem (Dest, Src, Size);
@ -348,7 +322,7 @@ EfiLibFileInfo (
that exist in a device path.
@param DevicePath - A pointer to a device path data structure.
@param DevicePath A pointer to a device path data structure.
@return This function counts and returns the number of device path instances
in DevicePath.
@ -378,9 +352,8 @@ EfiDevicePathInstanceCount (
@param OldSize - The size of the current buffer.
@param NewSize - The size of the new buffer.
@retval EFI_SUCEESS The requested number of bytes were allocated.
@retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.
@retval EFI_INVALID_PARAMETER The buffer was invalid.
@return The newly allocated buffer.
@retval NULL Allocation failed.
**/
VOID *
@ -394,7 +367,7 @@ EfiReallocatePool (
NewPool = NULL;
if (NewSize != 0) {
NewPool = EfiAllocateZeroPool (NewSize);
NewPool = AllocateZeroPool (NewSize);
}
if (OldPool != NULL) {
@ -450,6 +423,7 @@ TimeCompare (
@return A string located from the Data Hub records based on
the device path.
@retval NULL If failed to get the String from Data Hub.
**/
UINT16 *

View File

@ -17,6 +17,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Bds.h"
#include "FrontPage.h"
EFI_DEVICE_PATH_PROTOCOL EndDevicePath[] = {
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
END_DEVICE_PATH_LENGTH,
0
};
EFI_GUID EfiLegacyDevOrderGuid = EFI_LEGACY_DEV_ORDER_VARIABLE_GUID;
EFI_GUID mBootMaintGuid = BOOT_MAINT_FORMSET_GUID;
EFI_GUID mFileExplorerGuid = FILE_EXPLORE_FORMSET_GUID;
@ -54,9 +62,9 @@ FreeAllMenu (
Create string tokens for a menu from its help strings and display strings
@param CallbackData EDES_TODO: Add parameter description
@param HiiHandle - Hii Handle of the package to be updated.
@param MenuOption - The Menu whose string tokens need to be created
@param CallbackData The BMM context data.
@param HiiHandle Hii Handle of the package to be updated.
@param MenuOption The Menu whose string tokens need to be created
@retval EFI_SUCCESS string tokens created successfully
@retval others contain some errors
@ -723,12 +731,13 @@ Error:
}
/**
EDES_TODO: Add function description.
Discard all changes done to the BMM pages such as Boot Order change,
Driver order change.
@param Private EDES_TODO: Add parameter description
@param CurrentFakeNVMap EDES_TODO: Add parameter description
@param Private The BMM context data.
@param CurrentFakeNVMap The current Fack NV Map.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -803,7 +812,7 @@ InitializeBM (
//
// Create CallbackData structures for Driver Callback
//
BmmCallbackInfo = EfiAllocateZeroPool (sizeof (BMM_CALLBACK_DATA));
BmmCallbackInfo = AllocateZeroPool (sizeof (BMM_CALLBACK_DATA));
if (BmmCallbackInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -811,7 +820,7 @@ InitializeBM (
//
// Create LoadOption in BmmCallbackInfo for Driver Callback
//
Ptr = EfiAllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY));
Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY));
if (Ptr == NULL) {
SafeFreePool (BmmCallbackInfo);
return EFI_OUT_OF_RESOURCES;
@ -917,7 +926,7 @@ InitializeBM (
// Allocate space for creation of Buffer
//
gUpdateData.BufferSize = UPDATE_DATA_SIZE;
gUpdateData.Data = EfiAllocateZeroPool (UPDATE_DATA_SIZE);
gUpdateData.Data = AllocateZeroPool (UPDATE_DATA_SIZE);
if (gUpdateData.Data == NULL) {
SafeFreePool (BmmCallbackInfo->LoadContext);
SafeFreePool (BmmCallbackInfo);
@ -1031,11 +1040,11 @@ InitializeBM (
}
/**
EDES_TODO: Add function description.
Initialized all Menu Option List.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -1060,11 +1069,11 @@ InitAllMenu (
}
/**
EDES_TODO: Add function description.
Free up all Menu Option list.
@param VOID EDES_TODO: Add parameter description
@param VOID
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -1085,9 +1094,9 @@ FreeAllMenu (
Intialize all the string depositories.
@param VOID EDES_TODO: Add parameter description
@param VOID
EDES_TODO: Description incomplete None.
@return VOID
**/
VOID
@ -1096,7 +1105,7 @@ InitializeStringDepository (
)
{
STRING_DEPOSITORY *StringDepository;
StringDepository = EfiAllocateZeroPool (sizeof (STRING_DEPOSITORY) * STRING_DEPOSITORY_NUMBER);
StringDepository = AllocateZeroPool (sizeof (STRING_DEPOSITORY) * STRING_DEPOSITORY_NUMBER);
FileOptionStrDepository = StringDepository++;
ConsoleOptionStrDepository = StringDepository++;
BootOptionStrDepository = StringDepository++;
@ -1136,7 +1145,7 @@ GetStringTokenFromDepository (
//
// If there is no usable node in the list, update the list.
//
NextListNode = EfiAllocateZeroPool (sizeof (STRING_LIST_NODE));
NextListNode = AllocateZeroPool (sizeof (STRING_LIST_NODE));
HiiLibNewString (CallbackData->BmmHiiHandle, &(NextListNode->StringToken), L" ");
ASSERT (NextListNode->StringToken != 0);
@ -1159,9 +1168,9 @@ GetStringTokenFromDepository (
Reclaim string depositories by moving the current node pointer to list head..
@param VOID EDES_TODO: Add parameter description
@param VOID
EDES_TODO: Description incomplete None.
@return VOID
**/
VOID
@ -1183,9 +1192,9 @@ ReclaimStringDepository (
Release resource for all the string depositories.
@param VOID EDES_TODO: Add parameter description
@param VOID
EDES_TODO: Description incomplete None.
@return VOID
**/
VOID
@ -1223,9 +1232,10 @@ CleanUpStringDepository (
Start boot maintenance manager
@param VOID EDES_TODO: Add parameter description
@param VOID
@return EDES_TODO: Add description for return value
@retval EFI_SUCCESS If BMM is invoked successfully.
@return Other value if BMM return unsuccessfully.
**/
EFI_STATUS
@ -1272,9 +1282,11 @@ BdsStartBootMaint (
Dispatch BMM formset and FileExplorer formset.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@retval EFI_SUCCESS If function complete successfully.
@retturn Other value if the Setup Browser process BMM's pages and
return unsuccessfully.
**/
EFI_STATUS
@ -1335,3 +1347,58 @@ FormSetDispatcher (
return Status;
}
/**
Deletete the Boot Option from EFI Variable. The Boot Order Arrray
is also updated.
@param OptionNumber EDES_TODO: Add parameter description
@param BootOrder The Boot Order array.
@param BootOrderSize The size of the Boot Order Array.
@return Other value if the Boot Option specified by OptionNumber is not deleteed succesfully.
@retval EFI_SUCCESS If function return successfully.
**/
EFI_STATUS
BdsDeleteBootOption (
IN UINTN OptionNumber,
IN OUT UINT16 *BootOrder,
IN OUT UINTN *BootOrderSize
)
{
UINT16 BootOption[100];
UINTN Index;
EFI_STATUS Status;
UINTN Index2Del;
Status = EFI_SUCCESS;
Index2Del = 0;
UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", OptionNumber);
Status = EfiLibDeleteVariable (BootOption, &gEfiGlobalVariableGuid);
//
// adjust boot order array
//
for (Index = 0; Index < *BootOrderSize / sizeof (UINT16); Index++) {
if (BootOrder[Index] == OptionNumber) {
Index2Del = Index;
break;
}
}
if (Index != *BootOrderSize / sizeof (UINT16)) {
for (Index = 0; Index < *BootOrderSize / sizeof (UINT16) - 1; Index++) {
if (Index >= Index2Del) {
BootOrder[Index] = BootOrder[Index + 1];
}
}
*BootOrderSize -= sizeof (UINT16);
}
return Status;
}

File diff suppressed because it is too large Load Diff

View File

@ -20,15 +20,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "BBSsupport.h"
/**
EDES_TODO: Add function description.
Create a menu entry give a Menu type.
@param MenuType Use this parameter to identify current
Menu type
@param MenuType The Menu type to be created.
EDES_TODO: Incomplete Descriptions NULL Cannot allocate memory for current menu
EDES_TODO: Incomplete Descriptions entry
EDES_TODO: Incomplete Descriptions Others A valid pointer pointing to the allocated
EDES_TODO: Incomplete Descriptions memory pool for current menu entry
@retval NULL If failed to create the menu.
@return The menu.
**/
BM_MENU_ENTRY *
@ -74,12 +72,12 @@ BOpt_CreateMenuEntry (
return NULL;
}
MenuEntry = EfiAllocateZeroPool (sizeof (BM_MENU_ENTRY));
MenuEntry = AllocateZeroPool (sizeof (BM_MENU_ENTRY));
if (NULL == MenuEntry) {
return MenuEntry;
}
MenuEntry->VariableContext = EfiAllocateZeroPool (ContextSize);
MenuEntry->VariableContext = AllocateZeroPool (ContextSize);
if (NULL == MenuEntry->VariableContext) {
SafeFreePool (MenuEntry);
MenuEntry = NULL;
@ -92,11 +90,11 @@ BOpt_CreateMenuEntry (
}
/**
EDES_TODO: Add function description.
Free up all resource allocated for a BM_MENU_ENTRY.
@param MenuEntry EDES_TODO: Add parameter description
@param MenuEntry A pointer to BM_MENU_ENTRY.
@return EDES_TODO: Add description for return value
@retval VOID
**/
VOID
@ -173,12 +171,15 @@ BOpt_DestroyMenuEntry (
}
/**
EDES_TODO: Add function description.
Get the Menu Entry from the list in Menu Entry List.
@param MenuOption EDES_TODO: Add parameter description
@param MenuNumber EDES_TODO: Add parameter description
If MenuNumber is great or equal to the number of Menu
Entry in the list, then ASSERT.
@return EDES_TODO: Add description for return value
@param MenuOption The Menu Entry List to read the menu entry.
@param MenuNumber The index of Menu Entry.
@return The Menu Entry.
**/
BM_MENU_ENTRY *
@ -191,9 +192,7 @@ BOpt_GetMenuEntry (
UINTN Index;
LIST_ENTRY *List;
if (MenuNumber >= MenuOption->MenuNumber) {
return NULL;
}
ASSERT (MenuNumber < MenuOption->MenuNumber);
List = MenuOption->Head.ForwardLink;
for (Index = 0; Index < MenuNumber; Index++) {
@ -206,7 +205,10 @@ BOpt_GetMenuEntry (
}
/**
EDES_TODO: Add function description.
This function build the FsOptionMenu list which records all
available file system in the system. They includes all instances
of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, all instances of EFI_LOAD_FILE_SYSTEM
and all type of legacy boot device.
@param CallbackData BMM context data
@ -273,7 +275,7 @@ BOpt_FindFileSystem (
// Issue a dummy read to trigger reinstall of BlockIo protocol for removable media
//
if (BlkIo->Media->RemovableMedia) {
Buffer = EfiAllocateZeroPool (BlkIo->Media->BlockSize);
Buffer = AllocateZeroPool (BlkIo->Media->BlockSize);
if (NULL == Buffer) {
SafeFreePool (BlkIoHandle);
return EFI_OUT_OF_RESOURCES;
@ -372,7 +374,7 @@ BOpt_FindFileSystem (
}
TempStr = MenuEntry->HelpString;
MenuEntry->DisplayString = EfiAllocateZeroPool (MAX_CHAR);
MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);
ASSERT (MenuEntry->DisplayString != NULL);
UnicodeSPrint (
MenuEntry->DisplayString,
@ -419,7 +421,7 @@ BOpt_FindFileSystem (
MenuEntry->HelpString = DevicePathToStr (FileContext->DevicePath);
TempStr = MenuEntry->HelpString;
MenuEntry->DisplayString = EfiAllocateZeroPool (MAX_CHAR);
MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);
ASSERT (MenuEntry->DisplayString != NULL);
UnicodeSPrint (
MenuEntry->DisplayString,
@ -478,7 +480,7 @@ BOpt_FindFileSystem (
MenuEntry->HelpString = DevicePathToStr (FileContext->DevicePath);
TempStr = MenuEntry->HelpString;
MenuEntry->DisplayString = EfiAllocateZeroPool (MAX_CHAR);
MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);
ASSERT (MenuEntry->DisplayString != NULL);
UnicodeSPrint (
MenuEntry->DisplayString,
@ -498,22 +500,18 @@ BOpt_FindFileSystem (
return EFI_SUCCESS;
}
/**
Free resources allocated in Allocate Rountine
@param FreeMenu Menu to be freed
@return VOID
**/
VOID
BOpt_FreeMenu (
BM_MENU_OPTION *FreeMenu
)
/*++
Routine Description
Free resources allocated in Allocate Rountine
Arguments:
FreeMenu Menu to be freed
Returns:
VOID
--*/
{
BM_MENU_ENTRY *MenuEntry;
while (!IsListEmpty (&FreeMenu->Head)) {
@ -528,26 +526,22 @@ Returns:
}
}
/**
Find files under current directory
All files and sub-directories in current directory
will be stored in DirectoryMenu for future use.
@param FileOption Pointer for Dir to explore.
@retval TRUE Get files from current dir successfully.
@retval FALSE Can't get files from current dir.
**/
EFI_STATUS
BOpt_FindFiles (
IN BMM_CALLBACK_DATA *CallbackData,
IN BM_MENU_ENTRY *MenuEntry
)
/*++
Routine Description
Find files under current directory
All files and sub-directories in current directory
will be stored in DirectoryMenu for future use.
Arguments:
FileOption -- Pointer for Dir to explore
Returns:
TRUE -- Get files from current dir successfully
FALSE -- Can't get files from current dir
--*/
{
EFI_FILE_HANDLE NewDir;
EFI_FILE_HANDLE Dir;
@ -597,7 +591,7 @@ Returns:
);
DirBufferSize = sizeof (EFI_FILE_INFO) + 1024;
DirInfo = EfiAllocateZeroPool (DirBufferSize);
DirInfo = AllocateZeroPool (DirBufferSize);
if (DirInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -659,7 +653,7 @@ Returns:
if (NewFileContext->IsDir) {
BufferSize = StrLen (DirInfo->FileName) * 2 + 6;
NewMenuEntry->DisplayString = EfiAllocateZeroPool (BufferSize);
NewMenuEntry->DisplayString = AllocateZeroPool (BufferSize);
UnicodeSPrint (
NewMenuEntry->DisplayString,
@ -687,22 +681,19 @@ Returns:
return EFI_SUCCESS;
}
/**
Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().
@param VOID
@retval EFI_SUCCESS The function complete successfully.
@retval EFI_OUT_OF_RESOURCES No enough memory to complete this function.
**/
EFI_STATUS
BOpt_GetLegacyOptions (
VOID
)
/*++
Routine Description:
Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().
Arguments:
None
Returns:
The device info of legacy device.
--*/
{
BM_MENU_ENTRY *NewMenuEntry;
BM_LEGACY_DEVICE_CONTEXT *NewLegacyDevContext;
@ -780,7 +771,7 @@ Returns:
sizeof (DescString),
DescString
);
NewLegacyDevContext->Description = EfiAllocateZeroPool (StrSize (DescString));
NewLegacyDevContext->Description = AllocateZeroPool (StrSize (DescString));
if (NULL == NewLegacyDevContext->Description) {
break;
}
@ -830,6 +821,14 @@ Returns:
return EFI_SUCCESS;
}
/**
Free out resouce allocated from Legacy Boot Options.
@param VOID.
@return VOID.
**/
VOID
BOpt_FreeLegacyOptions (
VOID
@ -842,24 +841,20 @@ BOpt_FreeLegacyOptions (
BOpt_FreeMenu (&LegacyBEVMenu);
}
/**
Build the BootOptionMenu according to BootOrder Variable.
This Routine will access the Boot#### to get EFI_LOAD_OPTION.
@param None
@return The number of the Var Boot####.
**/
EFI_STATUS
BOpt_GetBootOptions (
IN BMM_CALLBACK_DATA *CallbackData
)
/*++
Routine Description:
Build the BootOptionMenu according to BootOrder Variable.
This Routine will access the Boot#### to get EFI_LOAD_OPTION
Arguments:
None
Returns:
The number of the Var Boot####
--*/
{
UINTN Index;
UINT16 BootString[10];
@ -929,7 +924,7 @@ Returns:
continue;
}
LoadOption = EfiAllocateZeroPool (BootOptionSize);
LoadOption = AllocateZeroPool (BootOptionSize);
if (LoadOption == NULL) {
continue;
}
@ -1014,7 +1009,7 @@ Returns:
LoadOptionPtr += sizeof (UINT16);
StringSize = StrSize ((UINT16 *) LoadOptionPtr);
NewLoadContext->Description = EfiAllocateZeroPool (StringSize);
NewLoadContext->Description = AllocateZeroPool (StringSize);
ASSERT (NewLoadContext->Description != NULL);
CopyMem (
NewLoadContext->Description,
@ -1025,7 +1020,7 @@ Returns:
LoadOptionPtr += StringSize;
NewLoadContext->FilePathList = EfiAllocateZeroPool (NewLoadContext->FilePathListLength);
NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
NewLoadContext->FilePathList,
@ -1051,7 +1046,7 @@ Returns:
StringSize -
NewLoadContext->FilePathListLength;
NewLoadContext->OptionalData = EfiAllocateZeroPool (OptionalDataSize);
NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,
@ -1072,46 +1067,22 @@ Returns:
return MenuCount;
}
CHAR16 *
BdsStrCpy (
OUT CHAR16 *Destination,
IN CONST CHAR16 *Source
)
{
CHAR16 *ReturnValue;
/**
//
// Destination cannot be NULL
//
ASSERT (Destination != NULL);
Append file name to existing file name.
ReturnValue = Destination;
while (*Source != L'\0') {
*(Destination++) = *(Source++);
}
*Destination = 0;
return ReturnValue;
}
@param Str1 The existing file name
@param Str2 The file name to be appended
@return Allocate a new string to hold the appended result.
Caller is responsible to free the returned string.
**/
CHAR16 *
BOpt_AppendFileName (
IN CHAR16 *Str1,
IN CHAR16 *Str2
)
/*++
Routine Description
Append file name to existing file name.
Arguments:
Str1 - existing file name
Str2 - file name to be appended
Returns:
Allocate a new string to hold the appended result.
Caller is responsible to free the returned string.
--*/
{
UINTN Size1;
UINTN Size2;
@ -1121,7 +1092,7 @@ Returns:
Size1 = StrSize (Str1);
Size2 = StrSize (Str2);
Str = EfiAllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));
Str = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));
ASSERT (Str != NULL);
StrCat (Str, Str1);
@ -1140,13 +1111,13 @@ Returns:
// DO NOT convert the .. if it is at the end of the string. This will
// break the .. behavior in changing directories.
//
BdsStrCpy (LastSlash, Ptr + 3);
StrCpy (LastSlash, Ptr + 3);
Ptr = LastSlash;
} else if (*Ptr == '\\' && *(Ptr + 1) == '.' && *(Ptr + 2) == '\\') {
//
// Convert a "\.\" to a "\"
//
BdsStrCpy (Ptr, Ptr + 2);
StrCpy (Ptr, Ptr + 2);
Ptr = LastSlash;
} else if (*Ptr == '\\') {
LastSlash = Ptr;
@ -1158,24 +1129,21 @@ Returns:
return Str;
}
/**
Check whether current FileName point to a valid
Efi Image File.
@param FileName File need to be checked.
@retval TRUE Is Efi Image
@retval FALSE Not a valid Efi Image
**/
BOOLEAN
BOpt_IsEfiImageName (
IN UINT16 *FileName
)
/*++
Routine Description
Check whether current FileName point to a valid
Efi Image File.
Arguments:
FileName - File need to be checked.
Returns:
TRUE - Is Efi Image
FALSE - Not a valid Efi Image
--*/
{
//
// Search for ".efi" extension
@ -1203,25 +1171,22 @@ Returns:
return FALSE;
}
/**
Check whether current FileName point to a valid Efi Application
@param Dir Pointer to current Directory
@param FileName Pointer to current File name.
@retval TRUE Is a valid Efi Application
@retval FALSE not a valid Efi Application
**/
BOOLEAN
BOpt_IsEfiApp (
IN EFI_FILE_HANDLE Dir,
IN UINT16 *FileName
)
/*++
Routine Description:
Check whether current FileName point to a valid Efi Application
Arguments:
Dir - Pointer to current Directory
FileName - Pointer to current File name.
Returns:
TRUE - Is a valid Efi Application
FALSE - not a valid Efi Application
--*/
{
UINTN BufferSize;
EFI_IMAGE_DOS_HEADER DosHdr;
@ -1270,26 +1235,23 @@ Returns:
}
}
EFI_STATUS
BOpt_FindDrivers (
VOID
)
/*++
/**
Routine Description
Find drivers that will be added as Driver#### variables from handles
in current system environment
All valid handles in the system except those consume SimpleFs, LoadFile
are stored in DriverMenu for future use.
Arguments:
None
@param VOID
Returns:
EFI_SUCCESS
Others
@retval EFI_SUCCESS The function complets successfully.
@return Other value if failed to build the DriverMenu.
--*/
**/
EFI_STATUS
BOpt_FindDrivers (
VOID
)
{
UINTN NoDevicePathHandles;
EFI_HANDLE *DevicePathHandle;
@ -1327,10 +1289,6 @@ Returns:
for (Index = 0; Index < NoDevicePathHandles; Index++) {
CurHandle = DevicePathHandle[Index];
//
// Check whether this handle support
// driver binding
//
Status = gBS->HandleProtocol (
CurHandle,
&gEfiSimpleFileSystemProtocolGuid,
@ -1371,21 +1329,19 @@ Returns:
return EFI_SUCCESS;
}
/**
Get the Option Number that has not been allocated for use.
@param VOID
@return The available Option Number.
**/
UINT16
BOpt_GetBootOptionNumber (
VOID
)
/*++
Routine Description:
Get the Option Number that does not used
Arguments:
Returns:
The Option Number
--*/
{
BM_MENU_ENTRY *NewMenuEntry;
UINT16 *BootOrderList;
@ -1423,15 +1379,16 @@ Returns:
}
if (Found) {
UnicodeSPrint (StrTemp, 100, L"Boot%04x", Index);
DEBUG((DEBUG_ERROR,"INdex= %s\n", StrTemp));
OptionBuffer = BdsLibGetVariableAndSize (
StrTemp,
&gEfiGlobalVariableGuid,
&OptionSize
);
if (NULL == OptionBuffer)
break;
UnicodeSPrint (StrTemp, 100, L"Boot%04x", Index);
DEBUG((DEBUG_ERROR,"INdex= %s\n", StrTemp));
OptionBuffer = BdsLibGetVariableAndSize (
StrTemp,
&gEfiGlobalVariableGuid,
&OptionSize
);
if (NULL == OptionBuffer) {
break;
}
}
}
//
@ -1448,21 +1405,19 @@ Returns:
return Number;
}
/**
Get the Option Number that is not in use.
@param VOID
@return The unused Option Number.
**/
UINT16
BOpt_GetDriverOptionNumber (
VOID
)
/*++
Routine Description:
Get the Option Number that does not used
Arguments:
Returns:
The Option Number
--*/
{
BM_MENU_ENTRY *NewMenuEntry;
UINT16 *DriverOrderList;
@ -1514,21 +1469,21 @@ Returns:
return Number;
}
/**
Build up all DriverOptionMenu
@param CallbackData The BMM context data.
@return EFI_SUCESS The functin completes successfully.
@retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.
**/
EFI_STATUS
BOpt_GetDriverOptions (
IN BMM_CALLBACK_DATA *CallbackData
)
/*++
Routine Description:
Build up all DriverOptionMenu
Arguments:
Returns:
The Option Number
--*/
{
UINTN Index;
UINT16 DriverString[12];
@ -1579,7 +1534,7 @@ Returns:
continue;
}
LoadOption = EfiAllocateZeroPool (DriverOptionSize);
LoadOption = AllocateZeroPool (DriverOptionSize);
if (LoadOption == NULL) {
continue;
}
@ -1619,7 +1574,7 @@ Returns:
LoadOptionPtr += sizeof (UINT16);
StringSize = StrSize ((UINT16 *) LoadOptionPtr);
NewLoadContext->Description = EfiAllocateZeroPool (StringSize);
NewLoadContext->Description = AllocateZeroPool (StringSize);
ASSERT (NewLoadContext->Description != NULL);
CopyMem (
NewLoadContext->Description,
@ -1630,7 +1585,7 @@ Returns:
LoadOptionPtr += StringSize;
NewLoadContext->FilePathList = EfiAllocateZeroPool (NewLoadContext->FilePathListLength);
NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
NewLoadContext->FilePathList,
@ -1656,7 +1611,7 @@ Returns:
StringSize -
NewLoadContext->FilePathListLength;
NewLoadContext->OptionalData = EfiAllocateZeroPool (OptionalDataSize);
NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,

View File

@ -15,11 +15,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "BootMaint.h"
/**
EDES_TODO: Add function description.
Function creates a device path data structure that identically matches the
device path passed in.
@param DevPath EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@param DevPath A pointer to a device path data structure.
@return The new copy of DevPath is created to identically match the input.
@retval NULL Otherwise, NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
@ -28,11 +31,12 @@ DevicePathInstanceDup (
);
/**
EDES_TODO: Add function description.
Update Com Ports attributes from DevicePath
@param DevicePath EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@param DevicePath DevicePath that contains Com ports
@retval EFI_SUCCESS The update is successful.
**/
EFI_STATUS
@ -41,18 +45,21 @@ UpdateComAttributeFromVariable (
);
/**
EDES_TODO: Add function description.
Update the multi-instance device path of Terminal Device based on
the global TerminalMenu. If ChangeTernimal is TRUE, the terminal
device path in the Terminal Device in TerminalMenu is also updated.
@param DevicePath EDES_TODO: Add parameter description
@param ChangeTerminal EDES_TODO: Add parameter description
@param DevicePath The multi-instance device path.
@param ChangeTerminal TRUE, then device path in the Terminal Device
in TerminalMenu is also updated; FALSE, no update.
@return EDES_TODO: Add description for return value
@return EFI_SUCCESS The function completes successfully.
**/
EFI_STATUS
ChangeTerminalDevicePath (
EFI_DEVICE_PATH_PROTOCOL *DevicePath,
BOOLEAN ChangeTerminal
IN BOOLEAN ChangeTerminal
)
{
EFI_DEVICE_PATH_PROTOCOL *Node;
@ -78,9 +85,6 @@ ChangeTerminalDevicePath (
}
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Com);
if (NULL == NewMenuEntry) {
return EFI_NOT_FOUND;
}
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node) == MSG_UART_DP)) {
@ -162,16 +166,18 @@ ChangeTerminalDevicePath (
}
/**
EDES_TODO: Add function description.
Update the device path that describing a terminal device
based on the new BaudRate, Data Bits, parity and Stop Bits
set.
@param DevicePath EDES_TODO: Add parameter description
@param DevicePath
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
ChangeVariableDevicePath (
EFI_DEVICE_PATH_PROTOCOL *DevicePath
IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
{
EFI_DEVICE_PATH_PROTOCOL *Node;
@ -237,8 +243,8 @@ ChangeVariableDevicePath (
Retrieve ACPI UID of UART from device path
@param Handle EDES_TODO: Add parameter description
@param AcpiUid EDES_TODO: Add parameter description
@param Handle The handle for the UART device.
@param AcpiUid The ACPI UID on output.
@retval TRUE Find valid UID from device path
@retval FALSE Can't find
@ -287,7 +293,7 @@ RetrieveUartUid (
@param Handles EFI_SERIAL_IO_PROTOCOL handle buffer
@param NoHandles EFI_SERIAL_IO_PROTOCOL handle count
EDES_TODO: Incomplete Descriptions None
@retval VOID
**/
VOID
@ -328,13 +334,15 @@ SortedUartHandle (
}
/**
EDES_TODO: Add function description.
Test whether DevicePath is a valid Terminal
@param DevicePath EDES_TODO: Add parameter description
@param Termi EDES_TODO: Add parameter description
@param Com EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@param DevicePath DevicePath to be checked
@param Termi If DevicePath is valid Terminal, terminal type is returned.
@param Com If DevicePath is valid Terminal, Com Port type is returned.
@retval TRUE If DevicePath point to a Terminal.
@retval FALSE If DevicePath does not point to a Terminal.
**/
BOOLEAN
@ -511,7 +519,7 @@ LocateSerialIo (
Vendor.Header.SubType = MSG_VENDOR_DP;
for (Index2 = 0; Index2 < 4; Index2++) {
CopyMem (&Vendor.Guid, &Guid[Index2], sizeof (EFI_GUID));
CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));
SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));
NewDevicePath = AppendDevicePathNode (
NewTerminalContext->DevicePath,
@ -550,7 +558,7 @@ LocateSerialIo (
@param DevicePath DevicePath that contains Com ports
@return EDES_TODO: Add description for return value
@retval EFI_SUCCESS The update is successful.
**/
EFI_STATUS
@ -672,8 +680,8 @@ UpdateComAttributeFromVariable (
@param DevPath A pointer to a device path data structure.
EDES_TODO: Incomplete Descriptions The new copy of DevPath is created to identically match the input.
EDES_TODO: Incomplete Descriptions Otherwise, NULL is returned.
@return The new copy of DevPath is created to identically match the input.
@retval NULL Otherwise, NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
@ -698,7 +706,7 @@ DevicePathInstanceDup (
//
NewDevPath = NULL;
if (Size != 0) {
NewDevPath = EfiAllocateZeroPool (Size);
NewDevPath = AllocateZeroPool (Size);
ASSERT (NewDevPath != NULL);
}
@ -714,11 +722,18 @@ DevicePathInstanceDup (
}
/**
EDES_TODO: Add function description.
Build up Console Menu based on types passed in. The type can
be BM_CONSOLE_IN_CONTEXT_SELECT, BM_CONSOLE_OUT_CONTEXT_SELECT
and BM_CONSOLE_ERR_CONTEXT_SELECT.
@param ConsoleMenuType EDES_TODO: Add parameter description
@param ConsoleMenuType Can be BM_CONSOLE_IN_CONTEXT_SELECT, BM_CONSOLE_OUT_CONTEXT_SELECT
and BM_CONSOLE_ERR_CONTEXT_SELECT.
@return EDES_TODO: Add description for return value
@retval EFI_UNSUPPORTED The type passed in is not in the 3 types defined.
@retval EFI_NOT_FOUND If the EFI Variable defined in UEFI spec with name "ConOutDev",
"ConInDev" or "ConErrDev" doesn't exists.
@retval EFI_OUT_OF_RESOURCES Not enough resource to complete the operations.
@retval EFI_SUCCESS Function completes successfully.
**/
EFI_STATUS
@ -796,7 +811,7 @@ GetConsoleMenu (
AllCount = EfiDevicePathInstanceCount (AllDevicePath);
ConsoleMenu->MenuNumber = 0;
//
// Following is menu building up for Console Out Devices
// Following is menu building up for Console Devices selected.
//
MultiDevicePath = AllDevicePath;
Index2 = 0;
@ -844,10 +859,9 @@ GetConsoleMenu (
Build up ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu
@param VOID EDES_TODO: Add parameter description
@param VOID
EDES_TODO: Incomplete Descriptions EFI_SUCCESS
EDES_TODO: Incomplete Descriptions Others
@retval EFI_SUCCESS The function always complete successfully.
**/
EFI_STATUS
@ -867,9 +881,7 @@ GetAllConsoles (
@param VOID EDES_TODO: Add parameter description
EDES_TODO: Incomplete Descriptions EFI_SUCCESS
EDES_TODO: Incomplete Descriptions Others
@retval EFI_SUCCESS The function always complete successfully.
**/
EFI_STATUS
FreeAllConsoles (
@ -888,11 +900,11 @@ FreeAllConsoles (
@param DevicePath DevicePath to be checked
@param Termi If is terminal, give its type
@param Com If is Com Port, give its type
@param Termi If DevicePath is valid Terminal, terminal type is returned.
@param Com If DevicePath is valid Terminal, Com Port type is returned.
@retval TRUE If DevicePath point to a Terminal
FALSE
@retval TRUE If DevicePath point to a Terminal.
@retval FALSE If DevicePath does not point to a Terminal.
**/
BOOLEAN
@ -929,19 +941,19 @@ IsTerminalDevicePath (
//
CopyMem (&TempGuid, &Vendor->Guid, sizeof (EFI_GUID));
if (CompareGuid (&TempGuid, &Guid[0])) {
if (CompareGuid (&TempGuid, &TerminalTypeGuid[0])) {
*Termi = PC_ANSI;
IsTerminal = TRUE;
} else {
if (CompareGuid (&TempGuid, &Guid[1])) {
if (CompareGuid (&TempGuid, &TerminalTypeGuid[1])) {
*Termi = VT_100;
IsTerminal = TRUE;
} else {
if (CompareGuid (&TempGuid, &Guid[2])) {
if (CompareGuid (&TempGuid, &TerminalTypeGuid[2])) {
*Termi = VT_100_PLUS;
IsTerminal = TRUE;
} else {
if (CompareGuid (&TempGuid, &Guid[3])) {
if (CompareGuid (&TempGuid, &TerminalTypeGuid[3])) {
*Termi = VT_UTF8;
IsTerminal = TRUE;
} else {
@ -971,9 +983,9 @@ IsTerminalDevicePath (
Get mode number according to column and row
@param CallbackData BMM_CALLBACK_DATA
@param CallbackData The BMM context data.
EDES_TODO: Incomplete Descriptions None.
@return VOID
**/
VOID

View File

@ -307,7 +307,7 @@ COM_ATTR StopBitsList[3] = {
//
// Guid for messaging path, used in Serial port setting.
//
EFI_GUID Guid[4] = {
EFI_GUID TerminalTypeGuid[4] = {
DEVICE_PATH_MESSAGING_PC_ANSI,
DEVICE_PATH_MESSAGING_VT_100,
DEVICE_PATH_MESSAGING_VT_100_PLUS,

View File

@ -18,10 +18,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Update the File Explore page.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@param MenuOption Pointer to menu options to display.
EDES_TODO: Incomplete Descriptions None.
@return VOID
**/
VOID
@ -212,6 +212,15 @@ UpdateFileExplorer (
/**
This function processes the results of changes in configuration.
When user select a interactive opcode, this callback will be triggered.
Based on the Question(QuestionId) that triggers the callback, the corresponding
actions is performed. It handles:
1) the addition of boot option.
2) the addition of driver option.
3) exit from file browser
4) update of file content if a dir is selected.
5) boot the file if a file is selected in "boot from file"
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.

View File

@ -1,5 +1,5 @@
/** @file
Dynamically Update the pages
Dynamically update the pages.
Copyright (c) 2004 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@ -17,10 +17,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
Refresh the global UpdateData structure.
@param VOID
@param VOID EDES_TODO: Add parameter description
EDES_TODO: Incomplete Descriptions None.
@return VOID
**/
VOID
@ -32,11 +31,13 @@ RefreshUpdateData (
}
/**
EDES_TODO: Add function description.
Add a "Go back to main page" tag in front of the form when there are no
"Apply changes" and "Discard changes" tags in the end of the form.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -64,11 +65,12 @@ UpdatePageStart (
}
/**
EDES_TODO: Add function description.
Create the "Apply changes" and "Discard changes" tags. And
ensure user can return to the main page.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -121,12 +123,14 @@ UpdatePageEnd (
}
/**
EDES_TODO: Add function description.
Clean up the dynamic opcode at label and form specified by
both LabelId.
@param LabelId EDES_TODO: Add parameter description
@param CallbackData EDES_TODO: Add parameter description
@param LabelId It is both the Form ID and Label ID for
opcode deletion.
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -151,11 +155,13 @@ CleanUpPage (
}
/**
EDES_TODO: Add function description.
Boot a file selected by user at File Expoloer of BMM.
@param FileContext EDES_TODO: Add parameter description
@param FileContext The file context data, which contains the device path
of the file to be boot from.
@return EDES_TODO: Add description for return value
@retval EFI_SUCCESS The function completed successfull.
@retun Other value if the boot from the file fails.
**/
EFI_STATUS
@ -192,11 +198,12 @@ BootThisFile (
}
/**
EDES_TODO: Add function description.
Create a list of Goto Opcode for all terminal devices logged
by TerminaMenu. This list will be inserted to form FORM_CON_COM_SETUP_ID.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -229,11 +236,12 @@ UpdateConCOMPage (
}
/**
EDES_TODO: Add function description.
Create a lit of boot option from global BootOptionMenu. It
allow user to delete the boot option.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -276,11 +284,11 @@ UpdateBootDelPage (
}
/**
EDES_TODO: Add function description.
Create a lit of driver option from global DriverMenu.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -312,11 +320,13 @@ UpdateDrvAddHandlePage (
}
/**
EDES_TODO: Add function description.
Create a lit of driver option from global DriverOptionMenu. It
allow user to delete the driver option.
@param CallbackData EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@param CallbackData The BMM context data.
@return VOID
**/
VOID
@ -357,11 +367,12 @@ UpdateDrvDelPage (
}
/**
EDES_TODO: Add function description.
Prepare the page to allow user to add description for
a Driver Option.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -431,9 +442,9 @@ UpdateDriverAddHandleDescPage (
@param UpdatePageId EDES_TODO: Add parameter description
@param ConsoleMenu EDES_TODO: Add parameter description
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -510,13 +521,14 @@ UpdateConsolePage (
}
/**
EDES_TODO: Add function description.
Update the page's NV Map if user has changed the order
a list. This list can be Boot Order or Driver Order.
@param UpdatePageId EDES_TODO: Add parameter description
@param OptionMenu EDES_TODO: Add parameter description
@param CallbackData EDES_TODO: Add parameter description
@param UpdatePageId The form ID to be updated.
@param OptionMenu The new list.
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -538,7 +550,7 @@ UpdateOrderPage (
ZeroMem (CallbackData->BmmFakeNvData.OptionOrder, 100);
IfrOptionList = EfiAllocateZeroPool (sizeof (IFR_OPTION) * OptionMenu->MenuNumber);
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * OptionMenu->MenuNumber);
if (NULL == IfrOptionList) {
return ;
}
@ -580,11 +592,12 @@ UpdateOrderPage (
}
/**
EDES_TODO: Add function description.
Create the dynamic page to allow user to set
the "BootNext" vaule.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -606,7 +619,7 @@ UpdateBootNextPage (
CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, &BootOptionMenu);
if (NumberOfOptions > 0) {
IfrOptionList = EfiAllocateZeroPool ((NumberOfOptions + 1) * sizeof (IFR_OPTION));
IfrOptionList = AllocateZeroPool ((NumberOfOptions + 1) * sizeof (IFR_OPTION));
ASSERT (IfrOptionList);
@ -653,11 +666,12 @@ UpdateBootNextPage (
}
/**
EDES_TODO: Add function description.
Create the dynamic page to allow user to set
the "TimeOut" vaule.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -697,9 +711,9 @@ UpdateTimeOutPage (
Refresh the text mode page
@param CallbackData BMM_CALLBACK_DATA
@param CallbackData The BMM context data.
EDES_TODO: Incomplete Descriptions None.
@return VOID
**/
VOID
@ -744,10 +758,10 @@ UpdateConModePage (
return;
}
IfrOptionList = EfiAllocateZeroPool (sizeof (IFR_OPTION) * ValidMode);
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * ValidMode);
ASSERT(IfrOptionList != NULL);
ModeToken = EfiAllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode);
ModeToken = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode);
ASSERT(ModeToken != NULL);
//
@ -802,11 +816,13 @@ UpdateConModePage (
}
/**
EDES_TODO: Add function description.
Create the dynamic page which allows user to
set the property such as Baud Rate, Data Bits,
Parity, Stop Bits, Terminal Type.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -835,12 +851,12 @@ UpdateTerminalPage (
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
IfrOptionList = EfiAllocateZeroPool (sizeof (IFR_OPTION) * 19);
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * 19);
if (IfrOptionList == NULL) {
return ;
}
for (Index = 0; Index < 19; Index++) {
for (Index = 0; Index < sizeof (BaudRateList) / sizeof (BaudRateList [0]); Index++) {
CheckFlags = 0;
if (NewTerminalContext->BaudRate == (UINT64) (BaudRateList[Index].Value)) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
@ -866,7 +882,7 @@ UpdateTerminalPage (
&gUpdateData
);
for (Index = 0; Index < 4; Index++) {
for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {
CheckFlags = 0;
if (NewTerminalContext->DataBits == DataBitsList[Index].Value) {
@ -893,7 +909,7 @@ UpdateTerminalPage (
&gUpdateData
);
for (Index = 0; Index < 5; Index++) {
for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {
CheckFlags = 0;
if (NewTerminalContext->Parity == ParityList[Index].Value) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
@ -919,7 +935,7 @@ UpdateTerminalPage (
&gUpdateData
);
for (Index = 0; Index < 3; Index++) {
for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {
CheckFlags = 0;
if (NewTerminalContext->StopBits == StopBitsList[Index].Value) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
@ -976,12 +992,13 @@ UpdateTerminalPage (
}
/**
EDES_TODO: Add function description.
Dispatch the correct update page function to call based on
the UpdatePageId.
@param UpdatePageId EDES_TODO: Add parameter description
@param CallbackData EDES_TODO: Add parameter description
@param UpdatePageId The form ID.
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -1018,13 +1035,15 @@ UpdatePageBody (
}
/**
EDES_TODO: Add function description.
Get the index number (#### in Boot####) for the boot option pointed to a BBS legacy device type
specified by DeviceType.
@param DeviceType EDES_TODO: Add parameter description
@param OptionIndex EDES_TODO: Add parameter description
@param OptionSize EDES_TODO: Add parameter description
@param DeviceType The legacy device type. It can be floppy, network, harddisk, cdrom,
etc.
@param OptionIndex Returns the index number (#### in Boot####).
@param OptionSize Return the size of the Boot### variable.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID *
@ -1100,12 +1119,13 @@ GetLegacyBootOptionVar (
}
/**
EDES_TODO: Add function description.
Create a dynamic page so that Legacy Device boot order
can be set for specified device type.
@param UpdatePageId EDES_TODO: Add parameter description
@param CallbackData EDES_TODO: Add parameter description
@param UpdatePageId The form ID. It also spefies the legacy device type.
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -1210,7 +1230,7 @@ UpdateSetLegacyDeviceOrderPage (
CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, OptionMenu);
IfrOptionList = EfiAllocateZeroPool (sizeof (IFR_OPTION) * (OptionMenu->MenuNumber + 1));
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * (OptionMenu->MenuNumber + 1));
if (NULL == IfrOptionList) {
return ;
}
@ -1304,12 +1324,12 @@ UpdateSetLegacyDeviceOrderPage (
}
/**
EDES_TODO: Add function description.
Dispatch the display to the next page based on NewPageId.
@param Private EDES_TODO: Add parameter description
@param NewPageId EDES_TODO: Add parameter description
@param Private The BMM context data.
@param NewPageId The original page ID.
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID

View File

@ -22,8 +22,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@param VOID EDES_TODO: Add parameter description
EDES_TODO: Incomplete Descriptions EFI_SUCCESS
EDES_TODO: Incomplete Descriptions Others
@retval EFI_SUCCESS If all boot load option EFI Variables corresponding to
BM_LOAD_CONTEXT marked for deletion is deleted
@return Others If failed to update the "BootOrder" variable after deletion.
**/
EFI_STATUS
@ -87,10 +88,11 @@ Var_DelBootOption (
scratch by content from BootOptionMenu is needed.
@param VOID EDES_TODO: Add parameter description
@param VOID
EDES_TODO: Incomplete Descriptions EFI_SUCCESS
EDES_TODO: Incomplete Descriptions Others
@retval EFI_SUCCESS The boot order is updated successfully.
@return EFI_STATUS other than EFI_SUCCESS if failed to
Set the "BootOrder" EFI Variable.
**/
EFI_STATUS
@ -138,7 +140,7 @@ Var_ChangeBootOrder (
BootOrderListSize = BootOptionMenu.MenuNumber;
if (BootOrderListSize > 0) {
BootOrderList = EfiAllocateZeroPool (BootOrderListSize * sizeof (UINT16));
BootOrderList = AllocateZeroPool (BootOrderListSize * sizeof (UINT16));
ASSERT (BootOrderList != NULL);
BootOrderListPtr = BootOrderList;
@ -178,10 +180,11 @@ Var_ChangeBootOrder (
make sure DriverOrder is in valid state.
@param VOID EDES_TODO: Add parameter description
@param VOID
EDES_TODO: Incomplete Descriptions EFI_SUCCESS
EDES_TODO: Incomplete Descriptions Others
@retval EFI_SUCCESS Load Option is successfully updated.
@return Other value than EFI_SUCCESS if failed to update "Driver Order" EFI
Variable.
**/
EFI_STATUS
@ -238,10 +241,11 @@ Var_DelDriverOption (
needed.
@param VOID EDES_TODO: Add parameter description
@param VOID
EDES_TODO: Incomplete Descriptions EFI_SUCCESS
EDES_TODO: Incomplete Descriptions Others
@retval EFI_SUCCESS The driver order is updated successfully.
@return EFI_STATUS other than EFI_SUCCESS if failed to
Set the "DriverOrder" EFI Variable.
**/
EFI_STATUS
@ -280,7 +284,7 @@ Var_ChangeDriverOrder (
DriverOrderListSize = DriverOptionMenu.MenuNumber;
if (DriverOrderListSize > 0) {
DriverOrderList = EfiAllocateZeroPool (DriverOrderListSize * sizeof (UINT16));
DriverOrderList = AllocateZeroPool (DriverOrderListSize * sizeof (UINT16));
ASSERT (DriverOrderList != NULL);
DriverOrderListPtr = DriverOrderList;
@ -315,11 +319,13 @@ Var_ChangeDriverOrder (
}
/**
EDES_TODO: Add function description.
Update the device path of "ConOut", "ConIn" and "ErrOut"
based on the new BaudRate, Data Bits, parity and Stop Bits
set.
@param VOID EDES_TODO: Add parameter description
@param VOID
@return EDES_TODO: Add description for return value
@return VOID
**/
VOID
@ -373,13 +379,26 @@ Var_UpdateAllConsoleOption (
}
/**
EDES_TODO: Add function description.
This function delete and build multi-instance device path for
specified type of console device.
@param ConsoleName EDES_TODO: Add parameter description
@param ConsoleMenu EDES_TODO: Add parameter description
@param UpdatePageId EDES_TODO: Add parameter description
This function clear the EFI variable defined by ConsoleName and
gEfiGlobalVariableGuid. It then build the multi-instance device
path by appending the device path of the Console (In/Out/Err) instance
in ConsoleMenu. Then it scan all corresponding console device by
scanning Terminal (built from device supporting Serial I/O instances)
devices in TerminalMenu. At last, it save a EFI variable specifed
by ConsoleName and gEfiGlobalVariableGuid.
@return EDES_TODO: Add description for return value
@param ConsoleName The name for the console device type. They are
usually "ConIn", "ConOut" and "ErrOut".
@param ConsoleMenu The console memu which is a list of console devices.
@param UpdatePageId The flag specifying which type of console device
to be processed.
@retval EFI_SUCCESS The function complete successfully.
@return The EFI variable can be saved. See gRT->SetVariable
for detail return information.
**/
EFI_STATUS
@ -406,13 +425,10 @@ Var_UpdateConsoleOption (
};
//
// First add all console input device to it from console input menu
// First add all console input device from console input menu
//
for (Index = 0; Index < ConsoleMenu->MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (ConsoleMenu, Index);
if (NULL == NewMenuEntry) {
return EFI_NOT_FOUND;
}
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
if (NewConsoleContext->IsActive) {
@ -425,9 +441,6 @@ Var_UpdateConsoleOption (
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
if (NULL == NewMenuEntry) {
return EFI_NOT_FOUND;
}
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
if (((NewTerminalContext->IsConIn != 0) && (UpdatePageId == FORM_CON_IN_ID)) ||
@ -438,7 +451,7 @@ Var_UpdateConsoleOption (
Vendor.Header.SubType = MSG_VENDOR_DP;
CopyMem (
&Vendor.Guid,
&Guid[NewTerminalContext->TerminalType],
&TerminalTypeGuid[NewTerminalContext->TerminalType],
sizeof (EFI_GUID)
);
SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));
@ -473,12 +486,15 @@ Var_UpdateConsoleOption (
}
/**
EDES_TODO: Add function description.
This function delete and build multi-instance device path ConIn
console device.
@param VOID EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@param VOID
@retval EFI_SUCCESS The function complete successfully.
@return The EFI variable can be saved. See gRT->SetVariable
for detail return information.
**/
EFI_STATUS
Var_UpdateConsoleInpOption (
@ -489,12 +505,15 @@ Var_UpdateConsoleInpOption (
}
/**
EDES_TODO: Add function description.
This function delete and build multi-instance device path ConOut
console device.
@param VOID EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@param VOID
@retval EFI_SUCCESS The function complete successfully.
@return The EFI variable can be saved. See gRT->SetVariable
for detail return information.
**/
EFI_STATUS
Var_UpdateConsoleOutOption (
@ -505,12 +524,15 @@ Var_UpdateConsoleOutOption (
}
/**
EDES_TODO: Add function description.
This function delete and build multi-instance device path ErrOut
console device.
@param VOID EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@param VOID
@retval EFI_SUCCESS The function complete successfully.
@return The EFI variable can be saved. See gRT->SetVariable
for detail return information.
**/
EFI_STATUS
Var_UpdateErrorOutOption (
@ -521,15 +543,19 @@ Var_UpdateErrorOutOption (
}
/**
EDES_TODO: Add function description.
This function create a currently loaded Drive Option from
the BMM. It then appends this Driver Option to the end of
the "DriverOrder" list. It append this Driver Opotion to the end
of DriverOptionMenu.
@param CallbackData EDES_TODO: Add parameter description
@param HiiHandle EDES_TODO: Add parameter description
@param DescriptionData EDES_TODO: Add parameter description
@param OptionalData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@param HiiHandle The HII handle associated with the BMM formset.
@param DescriptionData The description of this driver option.
@param OptionalData The optional load option.
@param ForceReconnect EDES_TODO: Add parameter description
@return EDES_TODO: Add description for return value
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
@retval EFI_SUCCESS If function completes successfully.
**/
EFI_STATUS
@ -576,7 +602,7 @@ Var_UpdateDriverOption (
BufferSize += StrSize (OptionalData);
}
Buffer = EfiAllocateZeroPool (BufferSize);
Buffer = AllocateZeroPool (BufferSize);
if (NULL == Buffer) {
return EFI_OUT_OF_RESOURCES;
}
@ -607,7 +633,7 @@ Var_UpdateDriverOption (
StrSize (DescriptionData)
);
NewLoadContext->Description = EfiAllocateZeroPool (StrSize (DescriptionData));
NewLoadContext->Description = AllocateZeroPool (StrSize (DescriptionData));
ASSERT (NewLoadContext->Description != NULL);
NewMenuEntry->DisplayString = NewLoadContext->Description;
CopyMem (
@ -623,7 +649,7 @@ Var_UpdateDriverOption (
GetDevicePathSize (CallbackData->LoadContext->FilePathList)
);
NewLoadContext->FilePathList = EfiAllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList));
NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList));
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
@ -669,7 +695,7 @@ Var_UpdateDriverOption (
&gEfiGlobalVariableGuid,
&DriverOrderListSize
);
NewDriverOrderList = EfiAllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
ASSERT (NewDriverOrderList != NULL);
CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;
@ -698,14 +724,19 @@ Var_UpdateDriverOption (
}
/**
EDES_TODO: Add function description.
This function create a currently loaded Boot Option from
the BMM. It then appends this Boot Option to the end of
the "BootOrder" list. It also append this Boot Opotion to the end
of BootOptionMenu.
@param CallbackData EDES_TODO: Add parameter description
@param NvRamMap EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@param NvRamMap The file explorer formset internal state.
@return EDES_TODO: Add description for return value
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
@retval EFI_SUCCESS If function completes successfully.
**/
EFI_STATUS
Var_UpdateBootOption (
IN BMM_CALLBACK_DATA *CallbackData,
@ -742,7 +773,7 @@ Var_UpdateBootOption (
BufferSize += StrSize (NvRamMap->OptionalData);
}
Buffer = EfiAllocateZeroPool (BufferSize);
Buffer = AllocateZeroPool (BufferSize);
if (NULL == Buffer) {
return EFI_OUT_OF_RESOURCES;
}
@ -773,7 +804,7 @@ Var_UpdateBootOption (
StrSize (NvRamMap->DescriptionData)
);
NewLoadContext->Description = EfiAllocateZeroPool (StrSize (NvRamMap->DescriptionData));
NewLoadContext->Description = AllocateZeroPool (StrSize (NvRamMap->DescriptionData));
ASSERT (NewLoadContext->Description != NULL);
NewMenuEntry->DisplayString = NewLoadContext->Description;
@ -790,7 +821,7 @@ Var_UpdateBootOption (
GetDevicePathSize (CallbackData->LoadContext->FilePathList)
);
NewLoadContext->FilePathList = EfiAllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList));
NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList));
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
@ -834,7 +865,7 @@ Var_UpdateBootOption (
&BootOrderListSize
);
NewBootOrderList = EfiAllocateZeroPool (BootOrderListSize + sizeof (UINT16));
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
ASSERT (NewBootOrderList != NULL);
CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
NewBootOrderList[BootOrderListSize / sizeof (UINT16)] = Index;
@ -865,11 +896,16 @@ Var_UpdateBootOption (
}
/**
EDES_TODO: Add function description.
This function update the "BootNext" EFI Variable. If there is
no "BootNex" specified in BMM, this EFI Variable is deleted.
It also update the BMM context data specified the "BootNext"
vaule.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@retval EFI_SUCCESS The function complete successfully.
@return The EFI variable can be saved. See gRT->SetVariable
for detail return information.
**/
EFI_STATUS
@ -887,9 +923,7 @@ Var_UpdateBootNext (
CurrentFakeNVMap = &CallbackData->BmmFakeNvData;
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
if (NULL == NewMenuEntry) {
return EFI_NOT_FOUND;
}
ASSERT (NULL != NewMenuEntry);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
NewLoadContext->IsBootNext = FALSE;
@ -904,9 +938,7 @@ Var_UpdateBootNext (
&BootOptionMenu,
CurrentFakeNVMap->BootNext
);
if (NULL == NewMenuEntry) {
return EFI_NOT_FOUND;
}
ASSERT (NewMenuEntry != NULL);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
Status = gRT->SetVariable (
@ -922,11 +954,16 @@ Var_UpdateBootNext (
}
/**
EDES_TODO: Add function description.
This function update the "BootOrder" EFI Variable based on
BMM Formset's NV map. It then refresh BootOptionMenu
with the new "BootOrder" list.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@retval EFI_SUCCESS The function complete successfully.
@retval EFI_SUCCESS Not enough memory to complete the function.
@return The EFI variable can be saved. See gRT->SetVariable
for detail return information.
**/
EFI_STATUS
@ -939,7 +976,6 @@ Var_UpdateBootOrder (
UINT16 *BootOrderList;
UINT16 *NewBootOrderList;
UINTN BootOrderListSize;
UINT8 *Map;
BootOrderList = NULL;
BootOrderListSize = 0;
@ -953,15 +989,11 @@ Var_UpdateBootOrder (
&BootOrderListSize
);
NewBootOrderList = EfiAllocateZeroPool (BootOrderListSize);
NewBootOrderList = AllocateZeroPool (BootOrderListSize);
if (NewBootOrderList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
Map = EfiAllocateZeroPool (BootOrderListSize / sizeof (UINT16));
if (Map == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
// If exists, delete it to hold new BootOrder
//
@ -982,7 +1014,6 @@ Var_UpdateBootOrder (
);
SafeFreePool (BootOrderList);
SafeFreePool (NewBootOrderList);
SafeFreePool (Map);
if (EFI_ERROR (Status)) {
return Status;
}
@ -995,11 +1026,16 @@ Var_UpdateBootOrder (
}
/**
EDES_TODO: Add function description.
This function update the "DriverOrder" EFI Variable based on
BMM Formset's NV map. It then refresh DriverOptionMenu
with the new "DriverOrder" list.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The BMM context data.
@return EDES_TODO: Add description for return value
@retval EFI_SUCCESS The function complete successfully.
@retval EFI_SUCCESS Not enough memory to complete the function.
@return The EFI variable can be saved. See gRT->SetVariable
for detail return information.
**/
EFI_STATUS
@ -1025,7 +1061,7 @@ Var_UpdateDriverOrder (
&DriverOrderListSize
);
NewDriverOrderList = EfiAllocateZeroPool (DriverOrderListSize);
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize);
if (NewDriverOrderList == NULL) {
return EFI_OUT_OF_RESOURCES;
@ -1060,11 +1096,14 @@ Var_UpdateDriverOrder (
}
/**
EDES_TODO: Add function description.
Update the legacy BBS boot option. L"LegacyDevOrder" and EfiLegacyDevOrderGuid EFI Variable
is udpated with the new Legacy Boot order. The EFI Variable of "Boot####" and gEfiGlobalVariableGuid
is also updated.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The context data for BMM.
@return EDES_TODO: Add description for return value
@return EFI_SUCCESS The function completed successfully.
@retval EFI_NOT_FOUND If L"LegacyDevOrder" and EfiLegacyDevOrderGuid EFI Variable can be found.
**/
EFI_STATUS
@ -1178,7 +1217,7 @@ Var_UpdateBBSOption (
return EFI_NOT_FOUND;
}
NewOrder = (UINT16 *) EfiAllocateZeroPool (DevOrder->Length - sizeof (UINT16));
NewOrder = (UINT16 *) AllocateZeroPool (DevOrder->Length - sizeof (UINT16));
if (NULL == NewOrder) {
SafeFreePool (VarData);
return EFI_OUT_OF_RESOURCES;
@ -1262,7 +1301,7 @@ Var_UpdateBBSOption (
Ptr += sizeof (UINT16);
Ptr += StrSize ((CHAR16 *) Ptr);
NewOptionPtr = EfiAllocateZeroPool (NewOptionSize);
NewOptionPtr = AllocateZeroPool (NewOptionSize);
if (NULL == NewOptionPtr) {
return EFI_OUT_OF_RESOURCES;
}
@ -1364,11 +1403,12 @@ Var_UpdateBBSOption (
}
/**
EDES_TODO: Add function description.
Update the Text Mode of Console.
@param CallbackData EDES_TODO: Add parameter description
@param CallbackData The context data for BMM.
@return EDES_TODO: Add description for return value
@retval EFI_SUCCSS If the Text Mode of Console is updated.
@return Other value if the Text Mode of Console is not updated.
**/
EFI_STATUS