/*++\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
BootOption.c\r
- \r
+\r
Abstract:\r
\r
Provide boot option support for Application "BootMaint"\r
Include file system navigation, system handle selection\r
\r
Boot option manipulation\r
- \r
+\r
Revision History\r
\r
--*/\r
Menu type\r
\r
Returns:\r
- NULL Cannot allocate memory for current menu \r
+ NULL Cannot allocate memory for current menu\r
entry\r
Others A valid pointer pointing to the allocated\r
memory pool for current menu entry\r
)\r
/*++\r
Rountine Description :\r
- Use this routine to get one particular menu entry in specified \r
+ Use this routine to get one particular menu entry in specified\r
menu\r
\r
Arguments :\r
- MenuOption The menu that we will search \r
+ MenuOption The menu that we will search\r
\r
MenuNumber The menunubmer that we want\r
\r
protocol, Load File protocol.\r
\r
Building up the FileSystem Menu for user selection\r
- All file system will be stored in FsOptionMenu \r
+ All file system will be stored in FsOptionMenu\r
for future use.\r
\r
Arguments:\r
//\r
// If block IO exists check to see if it's remobable media\r
//\r
- RemovableMedia = BlkIo->Media->RemovableMedia; \r
+ RemovableMedia = BlkIo->Media->RemovableMedia;\r
}\r
\r
//\r
//\r
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);\r
if (NULL == MenuEntry) {\r
- SafeFreePool (SimpleFsHandle); \r
+ SafeFreePool (SimpleFsHandle);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext;\r
- \r
+\r
FileContext->Handle = SimpleFsHandle[Index];\r
MenuEntry->OptionNumber = Index;\r
FileContext->FHandle = EfiLibOpenRoot (FileContext->Handle);\r
TempStr\r
);\r
OptionNumber++;\r
- InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link); \r
+ InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link);\r
}\r
}\r
\r
for (Index = 0; Index < NoLoadFileHandles; Index++) {\r
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);\r
if (NULL == MenuEntry) {\r
- SafeFreePool (LoadFileHandle); \r
+ SafeFreePool (LoadFileHandle);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
\r
Returns:\r
VOID\r
- \r
+\r
--*/\r
{\r
BM_MENU_ENTRY *MenuEntry;\r
)\r
/*++\r
Routine Description:\r
- \r
+\r
Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().\r
- \r
+\r
Arguments:\r
None\r
\r
Returns:\r
The device info of legacy device.\r
- \r
+\r
--*/\r
{\r
BM_MENU_ENTRY *NewMenuEntry;\r
/*++\r
\r
Routine Description:\r
- \r
+\r
Build the BootOptionMenu according to BootOrder Variable.\r
- This Routine will access the Boot#### to get EFI_LOAD_OPTION \r
- \r
+ This Routine will access the Boot#### to get EFI_LOAD_OPTION\r
+\r
Arguments:\r
None\r
\r
Returns:\r
The number of the Var Boot####\r
- \r
+\r
--*/\r
{\r
UINTN Index;\r
/*++\r
\r
Routine Description\r
- Check whether current FileName point to a valid \r
+ Check whether current FileName point to a valid\r
Efi Image File.\r
\r
Arguments:\r
Returns:\r
TRUE - Is Efi Image\r
FALSE - Not a valid Efi Image\r
- \r
+\r
--*/\r
{\r
//\r
{\r
EFI_STATUS Status;\r
EFI_FILE_HANDLE File;\r
- \r
+\r
File = (EFI_FILE_HANDLE)FileHandle;\r
Status = File->SetPosition (File, FileOffset);\r
if (EFI_ERROR (Status)) {\r
\r
Routine Description:\r
Check whether current FileName point to a valid Efi Application\r
- \r
+\r
Arguments:\r
Dir - Pointer to current Directory\r
FileName - Pointer to current File name.\r
- \r
+\r
Returns:\r
TRUE - Is a valid Efi Application\r
FALSE - not a valid Efi Application\r
- \r
+\r
--*/\r
{\r
EFI_STATUS Status;\r
in current system environment\r
All valid handles in the system except those consume SimpleFs, LoadFile\r
are stored in DriverMenu for future use.\r
- \r
+\r
Arguments:\r
None\r
\r
/*++\r
\r
Routine Description:\r
- Get the Option Number that does not used \r
- \r
+ Get the Option Number that does not used\r
+\r
Arguments:\r
\r
Returns:\r
The Option Number\r
- \r
+\r
--*/\r
{\r
BM_MENU_ENTRY *NewMenuEntry;\r
&gEfiGlobalVariableGuid,\r
&OptionSize\r
);\r
- if (NULL == OptionBuffer) \r
+ if (NULL == OptionBuffer)\r
break;\r
}\r
}\r
/*++\r
\r
Routine Description:\r
- Get the Option Number that does not used \r
- \r
+ Get the Option Number that does not used\r
+\r
Arguments:\r
\r
Returns:\r
The Option Number\r
- \r
+\r
--*/\r
{\r
BM_MENU_ENTRY *NewMenuEntry;\r
\r
Routine Description:\r
Build up all DriverOptionMenu\r
- \r
+\r
Arguments:\r
\r
Returns:\r
The Option Number\r
- \r
+\r
--*/\r
{\r
UINTN Index;\r
Routine Description:\r
Wrap original FreePool gBS call\r
in order to decrease code length\r
- \r
+\r
Arguments:\r
\r
Returns:\r
--*/\r
{\r
if (Buffer != NULL) {\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
Buffer = NULL;\r
}\r
}\r