MdeModulePkg:Rename BootMaintenanceManagerLib to BootMaintenanceManagerUiLib

Avoid any confusion,add the keyword "Ui",
user can understand the use of the library clearly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19662 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Dandan Bi
2016-01-19 03:28:46 +00:00
committed by dandanbi
parent fd46e831bc
commit 67013151ba
13 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
/** @file
Utility routines used by boot maintenance modules.
Copyright (c) 2004 - 2015, 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
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.
**/
#include "BootMaintenanceManager.h"
/**
Function deletes the variable specified by VarName and VarGuid.
@param VarName A Null-terminated Unicode string that is
the name of the vendor's variable.
@param VarGuid A unique identifier for the vendor.
@retval EFI_SUCCESS The variable was found and removed
@retval EFI_UNSUPPORTED The variable store was inaccessible
@retval EFI_NOT_FOUND The variable was not found
**/
EFI_STATUS
EfiLibDeleteVariable (
IN CHAR16 *VarName,
IN EFI_GUID *VarGuid
)
{
return gRT->SetVariable (
VarName,
VarGuid,
0,
0,
NULL
);
}
/**
Function is used to determine the number of device path instances
that exist in a device path.
@param DevicePath A pointer to a device path data structure.
@return This function counts and returns the number of device path instances
in DevicePath.
**/
UINTN
EfiDevicePathInstanceCount (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
{
UINTN Count;
UINTN Size;
Count = 0;
while (GetNextDevicePathInstance (&DevicePath, &Size) != NULL) {
Count += 1;
}
return Count;
}
/**
Get a string from the Data Hub record based on
a device path.
@param DevPath The device Path.
@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 *
EfiLibStrFromDatahub (
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
)
{
return NULL;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,440 @@
///** @file
// Boot Maintenance Utility Formset
//
// Copyright (c) 2004 - 2015, 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
// 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.
//
//**/
#include "FormGuid.h"
formset
guid = BOOT_MAINT_FORMSET_GUID,
title = STRING_TOKEN(STR_FORM_MAIN_TITLE),
help = STRING_TOKEN(STR_BOOT_MAINT_MANAGER_HELP),
classguid = gEfiIfrFrontPageGuid,
varstore BMM_FAKE_NV_DATA,
varid = VARSTORE_ID_BOOT_MAINT,
name = BmmData,
guid = BOOT_MAINT_FORMSET_GUID;
form formid = FORM_MAIN_ID,
title = STRING_TOKEN(STR_FORM_MAIN_TITLE);
goto FORM_BOOT_SETUP_ID,
prompt = STRING_TOKEN(STR_FORM_BOOT_SETUP_TITLE),
help = STRING_TOKEN(STR_FORM_BOOT_SETUP_HELP),
flags = INTERACTIVE,
key = FORM_BOOT_SETUP_ID;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
goto FORM_DRIVER_SETUP_ID,
prompt = STRING_TOKEN(STR_FORM_DRIVER_SETUP_TITLE),
help = STRING_TOKEN(STR_FORM_DRIVER_SETUP_HELP),
flags = INTERACTIVE,
key = FORM_DRIVER_SETUP_ID;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
goto FORM_CON_MAIN_ID,
prompt = STRING_TOKEN(STR_FORM_CON_MAIN_TITLE),
help = STRING_TOKEN(STR_FORM_CON_MAIN_HELP),
flags = INTERACTIVE,
key = FORM_CON_MAIN_ID;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
goto FORM_MAIN_ID,
prompt = STRING_TOKEN(STR_BOOT_FROM_FILE),
help = STRING_TOKEN(STR_BOOT_FROM_FILE_HELP),
flags = INTERACTIVE,
key = KEY_VALUE_BOOT_FROM_FILE;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
// label FORM_MAIN_ID;
goto FORM_BOOT_NEXT_ID,
prompt = STRING_TOKEN(STR_FORM_BOOT_NEXT_TITLE),
help = STRING_TOKEN(STR_FORM_BOOT_NEXT_HELP),
flags = INTERACTIVE,
key = FORM_BOOT_NEXT_ID;
goto FORM_TIME_OUT_ID,
prompt = STRING_TOKEN(STR_FORM_TIME_OUT_TITLE),
help = STRING_TOKEN(STR_FORM_TIME_OUT_HELP),
flags = INTERACTIVE,
key = FORM_TIME_OUT_ID;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
text
help = STRING_TOKEN(STR_RESET),
text = STRING_TOKEN(STR_RESET),
flags = INTERACTIVE,
key = FORM_RESET;
label LABEL_BMM_PLATFORM_INFORMATION;
//
// This is where we will dynamically add a Action type op-code to show
// the platform information.
//
//
// This is where we will dynamically add a Action type op-code to show
// the advanced menu.
//
//
// This is where we will dynamically add a Action type op-code to show
// the intel test menu.
//
label LABEL_END;
endform;
form formid = FORM_BOOT_SETUP_ID,
title = STRING_TOKEN(STR_FORM_BOOT_SETUP_TITLE);
goto FORM_MAIN_ID,
prompt = STRING_TOKEN(STR_FORM_GOTO_MAIN),
help = STRING_TOKEN(STR_FORM_GOTO_MAIN);
//flags = INTERACTIVE,
//key = FORM_MAIN_ID;
goto FORM_BOOT_SETUP_ID,
prompt = STRING_TOKEN(STR_FORM_BOOT_ADD_TITLE),
help = STRING_TOKEN(STR_FORM_BOOT_ADD_HELP),
flags = INTERACTIVE,
key = FORM_BOOT_ADD_ID;
goto FORM_BOOT_DEL_ID,
prompt = STRING_TOKEN(STR_FORM_BOOT_DEL_TITLE),
help = STRING_TOKEN(STR_FORM_BOOT_IMMEDIATE_HELP),
flags = INTERACTIVE,
key = FORM_BOOT_DEL_ID;
goto FORM_BOOT_CHG_ID,
prompt = STRING_TOKEN(STR_FORM_BOOT_CHG_TITLE),
help = STRING_TOKEN(STR_FORM_BOOT_IMMEDIATE_HELP),
flags = INTERACTIVE,
key = FORM_BOOT_CHG_ID;
endform;
form formid = FORM_DRIVER_SETUP_ID,
title = STRING_TOKEN(STR_FORM_DRIVER_SETUP_TITLE);
goto FORM_MAIN_ID,
prompt = STRING_TOKEN(STR_FORM_GOTO_MAIN),
help = STRING_TOKEN(STR_FORM_GOTO_MAIN);
//help = STRING_TOKEN(STR_FORM_GOTO_MAIN),
//flags = INTERACTIVE,
//key = FORM_MAIN_ID;
goto FORM_DRV_ADD_ID,
prompt = STRING_TOKEN(STR_FORM_DRV_ADD_TITLE),
help = STRING_TOKEN(STR_FORM_DRV_ADD_HELP),
flags = INTERACTIVE,
key = FORM_DRV_ADD_ID;
goto FORM_DRV_DEL_ID,
prompt = STRING_TOKEN(STR_FORM_DRV_DEL_TITLE),
help = STRING_TOKEN(STR_FORM_NEXT_BOOT_HELP),
flags = INTERACTIVE,
key = FORM_DRV_DEL_ID;
goto FORM_DRV_CHG_ID,
prompt = STRING_TOKEN(STR_FORM_DRV_CHG_TITLE),
help = STRING_TOKEN(STR_FORM_NEXT_BOOT_HELP),
flags = INTERACTIVE,
key = FORM_DRV_CHG_ID;
endform;
form formid = FORM_BOOT_ADD_ID,
title = STRING_TOKEN(STR_FORM_BOOT_ADD_DESC_TITLE);
label FORM_BOOT_ADD_ID;
label LABEL_END;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
string varid = BmmData.BootDescriptionData,
questionid = KEY_VALUE_BOOT_DESCRIPTION,
prompt = STRING_TOKEN(STR_LOAD_OPTION_DESC),
help = STRING_TOKEN(STR_NULL_STRING),
flags = INTERACTIVE,
minsize = 6,
maxsize = 75,
endstring;
string varid = BmmData.BootOptionalData,
questionid = KEY_VALUE_BOOT_OPTION,
prompt = STRING_TOKEN(STR_OPTIONAL_DATA),
help = STRING_TOKEN(STR_NULL_STRING),
flags = INTERACTIVE,
minsize = 0,
maxsize = 120,
endstring;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
text
help = STRING_TOKEN(STR_SAVE_AND_EXIT),
text = STRING_TOKEN(STR_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_VALUE_SAVE_AND_EXIT_BOOT;
text
help = STRING_TOKEN(STR_NO_SAVE_AND_EXIT),
text = STRING_TOKEN(STR_NO_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_VALUE_NO_SAVE_AND_EXIT_BOOT;
endform;
form formid = FORM_BOOT_DEL_ID,
title = STRING_TOKEN(STR_FORM_BOOT_DEL_TITLE);
label FORM_BOOT_DEL_ID;
label LABEL_END;
endform;
form formid = FORM_BOOT_CHG_ID,
title = STRING_TOKEN(STR_FORM_BOOT_CHG_TITLE);
label FORM_BOOT_CHG_ID;
label LABEL_END;
endform;
form formid = FORM_BOOT_NEXT_ID,
title = STRING_TOKEN(STR_FORM_BOOT_NEXT_TITLE);
label FORM_BOOT_NEXT_ID;
label LABEL_END;
endform;
form formid = FORM_TIME_OUT_ID,
title = STRING_TOKEN(STR_FORM_TIME_OUT_TITLE);
label FORM_TIME_OUT_ID;
label LABEL_END;
endform;
form formid = FORM_MEMORY_CHECK_ID,
title = STRING_TOKEN(STR_FORM_MEMORY_CHECK_TITLE);
label FORM_MEMORY_CHECK_ID;
label LABEL_END;
endform;
form formid = FORM_UEFI_OPTIMIZED_BOOT_ID,
title = STRING_TOKEN(STR_FORM_UEFI_OPTIMIZED_BOOT_TITLE);
label FORM_UEFI_OPTIMIZED_BOOT_ID;
label LABEL_END;
endform;
form formid = FORM_DRV_ADD_ID,
title = STRING_TOKEN(STR_FORM_DRV_ADD_TITLE);
goto FORM_MAIN_ID,
prompt = STRING_TOKEN(STR_FORM_GOTO_MAIN),
help = STRING_TOKEN(STR_FORM_GOTO_MAIN);
//flags = INTERACTIVE,
//key = FORM_MAIN_ID;
goto FORM_DRIVER_SETUP_ID,
prompt = STRING_TOKEN(STR_FORM_DRV_ADD_FILE_TITLE),
help = STRING_TOKEN(STR_FORM_DRV_ADD_FILE_TITLE),
flags = INTERACTIVE,
key = FORM_DRV_ADD_FILE_ID;
endform;
form formid = FORM_DRV_ADD_FILE_ID,
title = STRING_TOKEN(STR_FORM_DRV_ADD_DESC_TITLE);
label FORM_DRV_ADD_FILE_ID;
label LABEL_END;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
string varid = BmmData.DriverDescriptionData,
questionid = KEY_VALUE_DRIVER_DESCRIPTION,
prompt = STRING_TOKEN(STR_LOAD_OPTION_DESC),
help = STRING_TOKEN(STR_NULL_STRING),
flags = INTERACTIVE,
minsize = 6,
maxsize = 75,
endstring;
string varid = BmmData.DriverOptionalData,
questionid = KEY_VALUE_DRIVER_OPTION,
prompt = STRING_TOKEN(STR_OPTIONAL_DATA),
help = STRING_TOKEN(STR_NULL_STRING),
flags = INTERACTIVE,
minsize = 0,
maxsize = 120,
endstring;
checkbox varid = BmmData.ForceReconnect,
prompt = STRING_TOKEN(STR_LOAD_OPTION_FORCE_RECON),
help = STRING_TOKEN(STR_LOAD_OPTION_FORCE_RECON),
flags = CHECKBOX_DEFAULT,
key = 0,
endcheckbox;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
text
help = STRING_TOKEN(STR_SAVE_AND_EXIT),
text = STRING_TOKEN(STR_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_VALUE_SAVE_AND_EXIT_DRIVER; //BUGBUB: allow duplicate key in one formset???
text
help = STRING_TOKEN(STR_NO_SAVE_AND_EXIT),
text = STRING_TOKEN(STR_NO_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER;
endform;
form formid = FORM_DRV_DEL_ID,
title = STRING_TOKEN(STR_FORM_DRV_DEL_TITLE);
label FORM_DRV_DEL_ID;
label LABEL_END;
endform;
form formid = FORM_DRV_CHG_ID,
title = STRING_TOKEN(STR_FORM_DRV_CHG_TITLE);
label FORM_DRV_CHG_ID;
label LABEL_END;
endform;
form formid = FORM_CON_MAIN_ID,
title = STRING_TOKEN(STR_FORM_CON_MAIN_TITLE);
goto FORM_MAIN_ID,
prompt = STRING_TOKEN(STR_FORM_GOTO_MAIN),
help = STRING_TOKEN(STR_FORM_GOTO_MAIN);
//flags = INTERACTIVE,
//key = FORM_MAIN_ID;
goto FORM_CON_IN_ID,
prompt = STRING_TOKEN(STR_FORM_CON_IN_TITLE),
help = STRING_TOKEN(STR_FORM_CON_IN_HELP),
flags = INTERACTIVE,
key = FORM_CON_IN_ID;
goto FORM_CON_OUT_ID,
prompt = STRING_TOKEN(STR_FORM_CON_OUT_TITLE),
help = STRING_TOKEN(STR_FORM_CON_OUT_HELP),
flags = INTERACTIVE,
key = FORM_CON_OUT_ID;
goto FORM_CON_ERR_ID,
prompt = STRING_TOKEN(STR_FORM_STD_ERR_TITLE),
help = STRING_TOKEN(STR_FORM_STD_ERR_HELP),
flags = INTERACTIVE,
key = FORM_CON_ERR_ID;
goto FORM_CON_MODE_ID,
prompt = STRING_TOKEN(STR_FORM_MODE_TITLE),
help = STRING_TOKEN(STR_FORM_MODE_HELP),
flags = INTERACTIVE,
key = FORM_CON_MODE_ID;
goto FORM_CON_COM_ID,
prompt = STRING_TOKEN(STR_FORM_COM_TITLE),
help = STRING_TOKEN(STR_FORM_COM_HELP),
flags = INTERACTIVE,
key = FORM_CON_COM_ID;
endform;
form formid = FORM_CON_MODE_ID,
title = STRING_TOKEN(STR_FORM_MODE_TITLE);
label FORM_CON_MODE_ID;
label LABEL_END;
endform;
form formid = FORM_CON_COM_ID,
title = STRING_TOKEN(STR_FORM_COM_TITLE);
label FORM_CON_COM_ID;
label LABEL_END;
endform;
form formid = FORM_CON_COM_SETUP_ID,
title = STRING_TOKEN(STR_CON_COM_SETUP);
label FORM_CON_COM_SETUP_ID;
label LABEL_END;
endform;
form formid = FORM_FILE_SEEK_ID,
title = STRING_TOKEN(STR_FORM_BOOT_ADD_TITLE);
label FORM_FILE_SEEK_ID;
label LABEL_END;
endform;
form formid = FORM_FILE_NEW_SEEK_ID,
title = STRING_TOKEN(STR_FORM_BOOT_ADD_TITLE);
label FORM_FILE_NEW_SEEK_ID;
label LABEL_END;
endform;
form formid = FORM_DRV_ADD_HANDLE_ID,
title = STRING_TOKEN(STR_FORM_DRV_ADD_HANDLE_TITLE);
label FORM_DRV_ADD_HANDLE_ID;
label LABEL_END;
endform;
form formid = FORM_DRV_ADD_HANDLE_DESC_ID,
title = STRING_TOKEN(STR_FORM_DRV_ADD_DESC_TITLE);
label FORM_DRV_ADD_HANDLE_DESC_ID;
label LABEL_END;
endform;
form formid = FORM_CON_IN_ID,
title = STRING_TOKEN(STR_FORM_CON_IN_TITLE);
label FORM_CON_IN_ID;
label LABEL_END;
endform;
form formid = FORM_CON_OUT_ID,
title = STRING_TOKEN(STR_FORM_CON_OUT_TITLE);
label FORM_CON_OUT_ID;
label LABEL_END;
endform;
form formid = FORM_CON_ERR_ID,
title = STRING_TOKEN(STR_FORM_STD_ERR_TITLE);
label FORM_CON_ERR_ID;
label LABEL_END;
endform;
endformset;

View File

@@ -0,0 +1,286 @@
///** @file
// String definitions for Boot Maintenance Utility.
//
// Copyright (c) 2004 - 2015, 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
// 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.
//
//**/
/=#
#langdef en-US "English"
#langdef fr-FR "Français"
#string STR_NULL_STRING #language en-US " "
#language fr-FR " "
#string STR_NONE #language en-US "NONE"
#language fr-FR "NONE"
#string STR_MISSING_STRING #language en-US "Missing String"
#language fr-FR "Missing String"
#string STR_FORM_MAIN_TITLE #language en-US "Boot Maintenance Manager"
#language fr-FR "Boot Maintenance Manager"
#string STR_FORM_BOOT_SETUP_TITLE #language en-US "Boot Options"
#language fr-FR "Boot Options"
#string STR_BOOT_MAINT_MANAGER_HELP #language en-US "This selection will take you to the Boot Maintenance Manager"
#language fr-FR "This selection will take you to the Boot Maintenance Manager"
#string STR_FORM_BOOT_SETUP_HELP #language en-US "Modify system boot options"
#language fr-FR "Modify system boot options"
#string STR_FORM_DRIVER_SETUP_TITLE #language en-US "Driver Options"
#language fr-FR "Driver Options"
#string STR_FORM_DRIVER_SETUP_HELP #language en-US "Modify boot driver options"
#language fr-FR "Modify boot driver options"
#string STR_FORM_BOOT_ADD_TITLE #language en-US "Add Boot Option"
#language fr-FR "Add Boot Option"
#string STR_FORM_BOOT_ADD_HELP #language en-US "Add EFI Application or Removable Fs as Boot Option"
#language fr-FR "Add EFI Application or Removable Fs as Boot Option"
#string STR_FORM_BOOT_DEL_TITLE #language en-US "Delete Boot Option"
#language fr-FR "Delete Boot Option"
#string STR_FORM_BOOT_IMMEDIATE_HELP #language en-US "Will be valid immediately"
#language fr-FR "Will be valid immediately"
#string STR_FORM_BOOT_CHG_TITLE #language en-US "Change Boot Order"
#language fr-FR "Change Boot Order"
#string STR_FORM_DRV_ADD_TITLE #language en-US "Add Driver Option"
#language fr-FR "Add Driver Option"
#string STR_FORM_DRV_ADD_HELP #language en-US "Add .EFI Driver as Driver Option"
#language fr-FR "Add .EFI Driver as Driver Option"
#string STR_FORM_DRV_DEL_TITLE #language en-US "Delete Driver Option"
#language fr-FR "Delete Driver Option"
#string STR_FORM_DRV_CHG_TITLE #language en-US "Change Driver Order"
#language fr-FR "Change Driver Order"
#string STR_FORM_NEXT_BOOT_HELP #language en-US "Will be valid on next boot"
#language fr-FR "Will be valid on next boot"
#string STR_FORM_BOOT_NEXT_TITLE #language en-US "Set Boot Next Value"
#language fr-FR "Set Boot Next Value"
#string STR_FORM_BOOT_NEXT_HELP #language en-US "Modify next boot behavior"
#language fr-FR "Modify next boot behavior"
#string STR_FORM_TIME_OUT_TITLE #language en-US "Set Time Out Value"
#language fr-FR "Set Time Out Value"
#string STR_FORM_TIME_OUT_HELP #language en-US "Modify automatic boot time-out value"
#language fr-FR "Modify automatic boot time-out value"
#string STR_FORM_MEMORY_CHECK_TITLE #language en-US "Set Memory Check Type"
#language fr-FR "Set Memory Check Type"
#string STR_FORM_MEMORY_CHECK_HELP #language en-US "Modify the type of memory checking"
#language fr-FR "Modify the type of memory checking"
#string STR_MEMORY_CHECK_SETUP #language en-US "Memory Check Type"
#language fr-FR "Memory Check Type"
#string STR_MEMORY_CHECK_SETUP_HELP #language en-US "Memory test coverage level. Ignore chooses not to test memory. Quick and Sparse test some memory, and Extensive performs a detailed memory test."
#language fr-FR "Memory test coverage level. Ignore chooses not to test memory. Quick and Sparse test some memory, and Extensive performs a detailed memory test."
#string STR_FORM_UEFI_OPTIMIZED_BOOT_TITLE #language en-US "UEFI Optimized Boot"
#language fr-FR "UEFI Optimized Boot"
#string STR_FORM_UEFI_OPTIMIZED_BOOT_HELP #language en-US "Modify the UEFI Optimized Boot setting"
#language fr-FR "Modify the UEFI Optimized Boot setting"
#string UEFI_OPTIMIZED_BOOT_DESCRIPTION #language en-US "UEFI Optimized Boot"
#language fr-FR "UEFI Optimized Boot"
#string UEFI_OPTIMIZED_BOOT_HELP #language en-US "Check to enable UEFI Optimized Boot"
#language fr-FR "Check to enable UEFI Optimized Boot"
#string STR_FORM_CON_MAIN_TITLE #language en-US "Console Options"
#language fr-FR "Console Options"
#string STR_FORM_CON_MAIN_HELP #language en-US "Modify system console options"
#language fr-FR "Modify system console options"
#string STR_FORM_CON_IN_TITLE #language en-US "Console Input Device Select"
#language fr-FR "Console Input Device Select"
#string STR_FORM_CON_IN_HELP #language en-US "Enable console device as ConIn"
#language fr-FR "Enable console device as ConIn"
#string STR_FORM_SET_FD_ORDER_TITLE #language en-US "Set Legacy Floppy Drive Order"
#language fr-FR "Set Legacy Floppy Drive Order"
#string STR_FORM_SET_HD_ORDER_TITLE #language en-US "Set Legacy HardDisk Drive Order"
#language fr-FR "Set Legacy HardDisk Drive Order"
#string STR_FORM_SET_CD_ORDER_TITLE #language en-US "Set Legacy CD-ROM Drive Order"
#language fr-FR "Set Legacy CD-ROM Drive Order"
#string STR_FORM_SET_NET_ORDER_TITLE #language en-US "Set Legacy NET Drive Order"
#language fr-FR "Set Legacy NET Drive Order"
#string STR_FORM_SET_BEV_ORDER_TITLE #language en-US "Set Legacy BEV Drive Order"
#language fr-FR "Set Legacy BEV Drive Order"
#string STR_FORM_GOTO_SETTING #language en-US "Go Back To Setting Page"
#language fr-FR "Go Back To Setting Page"
#string STR_COM1 #language en-US "COM1"
#language fr-FR "COM1"
#string STR_COM2 #language en-US "COM2"
#language fr-FR "COM2"
#string STR_COM_AS_CONSOLE_OPTION #language en-US "Select this COM port as Console"
#language fr-FR "Select this COM port as Console"
#string STR_FORM_CON_OUT_TITLE #language en-US "Console Output Device Select"
#language fr-FR "Console Output Device Select"
#string STR_FORM_CON_OUT_HELP #language en-US "Enable console device as ConOut"
#language fr-FR "Enable console device as ConOut"
#string STR_FORM_STD_ERR_TITLE #language en-US "Console Standard Error Device Select"
#language fr-FR "Console Standard Error Device Select"
#string STR_FORM_STD_ERR_HELP #language en-US "Enable console device as StdErr"
#language fr-FR "Enable console device as StdErr"
#string STR_FORM_MODE_TITLE #language en-US "Console Output Mode Select"
#language fr-FR "Console Output Mode Select"
#string STR_FORM_MODE_HELP #language en-US "Select Console Output Mode: 80x25, 100x31, etc."
#language fr-FR "Select Console Output Mode: 80x25, 100x31, etc."
#string STR_FORM_COM_TITLE #language en-US "COM Attribute Setup Page"
#language fr-FR "COM Attribute Setup Page"
#string STR_FORM_COM_HELP #language en-US "Setup ComPort BaudRate, DataBits, StopBits, Parity and TerminalType"
#language fr-FR "Setup ComPort BaudRate, DataBits, StopBits, Parity and TerminalType"
#string STR_FORM_DRV_ADD_FILE_TITLE #language en-US "Add Driver Option Using File"
#language fr-FR "Add Driver Option Using File"
#string STR_FORM_DRV_ADD_HANDLE_TITLE #language en-US "Add Driver Option Using Handle"
#language fr-FR "Add Driver Option Using Handle"
#string STR_FORM_BOOT_ADD_DESC_TITLE #language en-US "Modify Boot Option Description"
#language fr-FR "Modify Boot Option Description"
#string STR_FORM_DRV_ADD_DESC_TITLE #language en-US "Modify Driver Option Description"
#language fr-FR "Modify Driver Option Description"
#string STR_NUM_AUTO_BOOT #language en-US "Auto Boot Time-out"
#language fr-FR "Auto Boot Time-out"
#string STR_HLP_AUTO_BOOT #language en-US "Range: 0 to 65535 seconds, 0 means no wait, 65535 means waiting for key"
#language fr-FR "Range: 0 to 65535 seconds, 0 means no wait, 65535 means waiting for key"
#string STR_BOOT_NEXT #language en-US "Boot Next Value"
#language fr-FR "Boot Next Value"
#string STR_BOOT_NEXT_HELP #language en-US "Next boot use this boot option"
#language fr-FR "Next boot use this boot option"
#string STR_LOAD_OPTION_DEVPATH #language en-US "This is the devicepath"
#language fr-FR "This is the devicepath"
#string STR_LOAD_OPTION_DESC #language en-US "Input the description"
#language fr-FR "Input the description"
#string STR_LOAD_OPTION_ACTIVE #language en-US "Load Option Active"
#language fr-FR "Load Option Active"
#string STR_LOAD_OPTION_FORCE_RECON #language en-US "Load Option Reconnect"
#language fr-FR "Load Option Reconnect"
#string STR_SAVE_AND_EXIT #language en-US "Commit Changes and Exit"
#language fr-FR "Commit Changes and Exit"
#string STR_NO_SAVE_AND_EXIT #language en-US "Discard Changes and Exit"
#language fr-FR "Discard Changes and Exit"
#string STR_CON_IN_SETUP #language en-US "Set Console Input Device"
#language fr-FR "Set Console Input Device"
#string STR_CON_OUT_SETUP #language en-US "Set Console Output Device"
#language fr-FR "Set Console Output Device"
#string STR_CON_ERR_SETUP #language en-US "Set Error Output Device"
#language fr-FR "Set Error Output Device"
#string STR_CON_MODE_SETUP #language en-US "Set Console Output Mode"
#language fr-FR "Set Console Output Mode"
#string STR_CON_COM_SETUP #language en-US "Set COM Attributes"
#language fr-FR "Set COM Attributes"
#string STR_COM_TERMI_TYPE #language en-US "Set COM Terminal Type"
#language fr-FR "Set COM Terminal Type"
#string STR_COM_FLOW_CONTROL #language en-US "Set COM Flow Control"
#language fr-FR "Set COM Flow Control"
#string STR_COM_BAUD_RATE #language en-US "Set COM Baud Rate"
#language fr-FR "Set COM Baud Rate"
#string STR_COM_DATA_BITS #language en-US "Set COM Data Bits"
#language fr-FR "Set COM Data Bits"
#string STR_COM_PARITY #language en-US "Set COM Parity"
#language fr-FR "Set COM Parity"
#string STR_COM_STOP_BITS #language en-US "Set COM Stop Bits"
#language fr-FR "Set COM Stop Bits"
#string STR_COM_BAUD_RATE_0 #language en-US "115200"
#language fr-FR "115200"
#string STR_COM_BAUD_RATE_1 #language en-US "57600"
#language fr-FR "57600"
#string STR_COM_BAUD_RATE_2 #language en-US "38400"
#language fr-FR "38400"
#string STR_COM_BAUD_RATE_3 #language en-US "19200"
#language fr-FR "19200"
#string STR_COM_BAUD_RATE_4 #language en-US "9600"
#language fr-FR "9600"
#string STR_COM_BAUD_RATE_5 #language en-US "7200"
#language fr-FR "7200"
#string STR_COM_BAUD_RATE_6 #language en-US "4800"
#language fr-FR "4800"
#string STR_COM_BAUD_RATE_7 #language en-US "3600"
#language fr-FR "3600"
#string STR_COM_BAUD_RATE_8 #language en-US "2400"
#language fr-FR "2400"
#string STR_COM_BAUD_RATE_9 #language en-US "2000"
#language fr-FR "2000"
#string STR_COM_BAUD_RATE_10 #language en-US "1800"
#language fr-FR "1800"
#string STR_COM_BAUD_RATE_11 #language en-US "1200"
#language fr-FR "1200"
#string STR_COM_BAUD_RATE_12 #language en-US "600"
#language fr-FR "600"
#string STR_COM_BAUD_RATE_13 #language en-US "300"
#language fr-FR "300"
#string STR_COM_BAUD_RATE_14 #language en-US "150"
#language fr-FR "150"
#string STR_COM_BAUD_RATE_15 #language en-US "134"
#language fr-FR "134"
#string STR_COM_BAUD_RATE_16 #language en-US "110"
#language fr-FR "110"
#string STR_COM_BAUD_RATE_17 #language en-US "75"
#language fr-FR "75"
#string STR_COM_BAUD_RATE_18 #language en-US "50"
#language fr-FR "50"
#string STR_COM_DATA_BITS_0 #language en-US "5"
#language fr-FR "5"
#string STR_COM_DATA_BITS_1 #language en-US "6"
#language fr-FR "6"
#string STR_COM_DATA_BITS_2 #language en-US "7"
#language fr-FR "7"
#string STR_COM_DATA_BITS_3 #language en-US "8"
#language fr-FR "8"
#string STR_COM_PAR_0 #language en-US "None"
#language fr-FR "None"
#string STR_COM_PAR_1 #language en-US "Even"
#language fr-FR "Even"
#string STR_COM_PAR_2 #language en-US "Odd"
#language fr-FR "Odd"
#string STR_COM_PAR_3 #language en-US "Mark"
#language fr-FR "Mark"
#string STR_COM_PAR_4 #language en-US "Space"
#language fr-FR "Space"
#string STR_COM_STOP_BITS_0 #language en-US "One"
#language fr-FR "One"
#string STR_COM_STOP_BITS_1 #language en-US "One And A Half"
#language fr-FR "One And A Half"
#string STR_COM_STOP_BITS_2 #language en-US "Two"
#language fr-FR "Two"
#string STR_COM_TYPE_0 #language en-US "PC_ANSI"
#language fr-FR "PC_ANSI"
#string STR_COM_TYPE_1 #language en-US "VT_100"
#language fr-FR "VT_100"
#string STR_COM_TYPE_2 #language en-US "VT_100_PLUS"
#language fr-FR "VT_100_PLUS"
#string STR_COM_TYPE_3 #language en-US "VT_UTF8"
#language fr-FR "VT_UTF8"
#string STR_COM_TYPE_4 #language en-US "TTY_TERM"
#language fr-FR "TTY_TERM"
#string STR_RESET #language en-US "Reset System"
#language fr-FR "Reset System"
#string STR_FORM_GOTO_MAIN #language en-US "Go Back To Main Page"
#language fr-FR "Go Back To Main Page"
#string STR_BOOT_FROM_FILE #language en-US "Boot From File"
#language fr-FR "Boot From File"
#string STR_BOOT_FROM_FILE_HELP #language en-US "Boot system from a file or device"
#language fr-FR "Boot system from a file or device"
#string STR_OPTIONAL_DATA #language en-US "Input Optional Data"
#language fr-FR "Input Optional Data"
#string STR_CHANGE_ORDER #language en-US "Change the order"
#language fr-FR "Change the order"
#string STR_BOOT_LEGACY #language en-US "Boot Legacy System"
#language fr-FR "Boot Legacy System"
#string STR_BOOT_LEGACY_HELP #language en-US "Supports boot from legacy FD, HD, CD, PCMCIA, USB, and Network"
#language fr-FR "Supports boot from legacy FD, HD, CD, PCMCIA, USB, and Network"
#string STR_BOOT_LEGACY_FLOPPY #language en-US "Boot From Floppy"
#language fr-FR "Boot From Floppy"
#string STR_BOOT_LEGACY_HARDDRIVE #language en-US "Boot From Hard Drive"
#language fr-FR "Boot From Hard Drive"
#string STR_BOOT_LEGACY_CDROM #language en-US "Boot From CD Rom"
#language fr-FR "Boot From CD Rom"
#string STR_BOOT_LEGACY_PCMCIA #language en-US "Boot From PCMCIA"
#language fr-FR "Boot From PCMCIA"
#string STR_BOOT_LEGACY_USB #language en-US "Boot From USB Device"
#language fr-FR "Boot From USB Device"
#string STR_BOOT_LEGACY_NETWORK #language en-US "Boot From Network"
#language fr-FR "Boot From Network"
#string STR_DISABLE_LEGACY_DEVICE #language en-US "Disabled"
#language fr-FR "Disabled"
#string STR_FILE_EXPLORER_TITLE #language en-US "File Explorer"
#language fr-FR "File Explorer"
#string STR_OUT_OF_BAND_PORT #language fr-FR "Out-Of-Band Mgmt Port"
#language en-US "Out-Of-Band Mgmt Port"
#string STR_HARDWARE_FLOW_CONTROL #language fr-FR "Hardware"
#language en-US "Hardware"
#string STR_NONE_FLOW_CONTROL #language fr-FR "None"
#language en-US "None"
//
// BugBug : need someone to translate these strings to french
//

View File

@@ -0,0 +1,100 @@
## @file
# Boot Maintenance Manager Library used by UiApp.
#
# Copyright (c) 2011 - 2015, 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 that 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.
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = BootMaintenanceManagerLib
MODULE_UNI_FILE = BootMaintenanceManagerLib.uni
FILE_GUID = CA9E4824-4198-4715-AA22-E2935E703A07
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
LIBRARY_CLASS = NULL|DXE_DRIVER UEFI_APPLICATION
CONSTRUCTOR = BootMaintenanceManagerLibConstructor
DESTRUCTOR = BootMaintenanceManagerLibDestructor
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources]
BootMaintenanceManager.h
BootMaintenanceManager.vfr
BootMaintenanceManagerStrings.uni
BootMaintenance.c
FormGuid.h
BootOption.c
ConsoleOption.c
Data.c
Variable.c
UpdatePage.c
BmLib.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
DevicePathLib
BaseLib
UefiRuntimeServicesTableLib
MemoryAllocationLib
UefiLib
UefiBootServicesTableLib
BaseMemoryLib
DebugLib
PrintLib
HiiLib
UefiHiiServicesLib
UefiBootManagerLib
FileExplorerLib
[Guids]
gEfiGlobalVariableGuid ## SOMETIMES_PRODUCES ## Variable:L"BootNext" (The number of next boot option)
## SOMETIMES_PRODUCES ## Variable:L"BootXX" (Boot option variable)
## SOMETIMES_PRODUCES ## Variable:L"PlatformLang" (Platform supported languange in Rfc4646 format)
## SOMETIMES_PRODUCES ## Variable:L"Lang" (Platform supported languange in Iso639 format)
## SOMETIMES_PRODUCES ## Variable:L"KeyXX" (Hotkey option variable)
## PRODUCES ## Variable:L"HwErrRecSupport" (The level of platform supported hardware Error Record Persistence)
## SOMETIMES_PRODUCES ## Variable:L"BootOptionSupport" (The feature supported in boot option menu, value could be: EFI_BOOT_OPTION_SUPPORT_KEY, EFI_BOOT_OPTION_SUPPORT_APP
## SOMETIMES_PRODUCES (not PcdUefiVariableDefaultLangDeprecate)## Variable:L"LangCodes" (Value of PcdUefiVariableDefaultLangCodes)
## PRODUCES ## Variable:L"PlatformLangCodes" (Value of PcdUefiVariableDefaultPlatformLangCodes)
## PRODUCES ## Variable:L"Timeout" (The time out value in second of showing progress bar)
## SOMETIMES_PRODUCES ## Variable:L"BootOrder" (The boot option array)
## SOMETIMES_PRODUCES ## Variable:L"DriverOrder" (The driver order list)
## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device)
## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device)
## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device)
gEfiFileSystemVolumeLabelInfoIdGuid ## CONSUMES ## GUID (Indicate the information type is volume)
gEfiFileInfoGuid ## CONSUMES ## GUID (Indicate the information type is file)
gEfiIfrTianoGuid ## CONSUMES ## GUID (Extended IFR Guid Opcode)
gEfiIfrFrontPageGuid ## CONSUMES ## GUID
gEfiIfrBootMaintenanceGuid ## CONSUMES ## GUID
[Protocols]
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
gEfiLoadFileProtocolGuid ## CONSUMES
gEfiHiiConfigAccessProtocolGuid ## CONSUMES
gEfiSerialIoProtocolGuid ## CONSUMES
gEfiDevicePathToTextProtocolGuid ## CONSUMES
[FeaturePcd]
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow ## CONSUMES

View File

@@ -0,0 +1,26 @@
// /** @file
// Boot Maintenance Manager Library used by UiApp.
//
// Boot Maintenance Manager Library used by UiApp.
//
// Copyright (c) 2015, 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 that 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.
//
// **/
#string STR_MODULE_ABSTRACT
#language en-US
"Boot Maintenance Manager Library used by UiApp."
#string STR_MODULE_DESCRIPTION
#language en-US
"Boot Maintenance Manager Library used by UiApp."

View File

@@ -0,0 +1,984 @@
/** @file
Provide boot option support for Application "BootMaint"
Include file system navigation, system handle selection
Boot option manipulation
Copyright (c) 2004 - 2015, 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
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.
**/
#include "BootMaintenanceManager.h"
///
/// Define the maximum characters that will be accepted.
///
#define MAX_CHAR 480
/**
Create a menu entry by given menu type.
@param MenuType The Menu type to be created.
@retval NULL If failed to create the menu.
@return the new menu entry.
**/
BM_MENU_ENTRY *
BOpt_CreateMenuEntry (
UINTN MenuType
)
{
BM_MENU_ENTRY *MenuEntry;
UINTN ContextSize;
//
// Get context size according to menu type
//
switch (MenuType) {
case BM_LOAD_CONTEXT_SELECT:
ContextSize = sizeof (BM_LOAD_CONTEXT);
break;
case BM_FILE_CONTEXT_SELECT:
ContextSize = sizeof (BM_FILE_CONTEXT);
break;
case BM_CONSOLE_CONTEXT_SELECT:
ContextSize = sizeof (BM_CONSOLE_CONTEXT);
break;
case BM_TERMINAL_CONTEXT_SELECT:
ContextSize = sizeof (BM_TERMINAL_CONTEXT);
break;
case BM_HANDLE_CONTEXT_SELECT:
ContextSize = sizeof (BM_HANDLE_CONTEXT);
break;
default:
ContextSize = 0;
break;
}
if (ContextSize == 0) {
return NULL;
}
//
// Create new menu entry
//
MenuEntry = AllocateZeroPool (sizeof (BM_MENU_ENTRY));
if (MenuEntry == NULL) {
return NULL;
}
MenuEntry->VariableContext = AllocateZeroPool (ContextSize);
if (MenuEntry->VariableContext == NULL) {
FreePool (MenuEntry);
return NULL;
}
MenuEntry->Signature = BM_MENU_ENTRY_SIGNATURE;
MenuEntry->ContextSelection = MenuType;
return MenuEntry;
}
/**
Free up all resource allocated for a BM_MENU_ENTRY.
@param MenuEntry A pointer to BM_MENU_ENTRY.
**/
VOID
BOpt_DestroyMenuEntry (
BM_MENU_ENTRY *MenuEntry
)
{
BM_LOAD_CONTEXT *LoadContext;
BM_FILE_CONTEXT *FileContext;
BM_CONSOLE_CONTEXT *ConsoleContext;
BM_TERMINAL_CONTEXT *TerminalContext;
BM_HANDLE_CONTEXT *HandleContext;
//
// Select by the type in Menu entry for current context type
//
switch (MenuEntry->ContextSelection) {
case BM_LOAD_CONTEXT_SELECT:
LoadContext = (BM_LOAD_CONTEXT *) MenuEntry->VariableContext;
FreePool (LoadContext->FilePathList);
FreePool (LoadContext->LoadOption);
if (LoadContext->OptionalData != NULL) {
FreePool (LoadContext->OptionalData);
}
FreePool (LoadContext);
break;
case BM_FILE_CONTEXT_SELECT:
FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext;
if (!FileContext->IsRoot) {
FreePool (FileContext->DevicePath);
} else {
if (FileContext->FHandle != NULL) {
FileContext->FHandle->Close (FileContext->FHandle);
}
}
if (FileContext->FileName != NULL) {
FreePool (FileContext->FileName);
}
if (FileContext->Info != NULL) {
FreePool (FileContext->Info);
}
FreePool (FileContext);
break;
case BM_CONSOLE_CONTEXT_SELECT:
ConsoleContext = (BM_CONSOLE_CONTEXT *) MenuEntry->VariableContext;
FreePool (ConsoleContext->DevicePath);
FreePool (ConsoleContext);
break;
case BM_TERMINAL_CONTEXT_SELECT:
TerminalContext = (BM_TERMINAL_CONTEXT *) MenuEntry->VariableContext;
FreePool (TerminalContext->DevicePath);
FreePool (TerminalContext);
break;
case BM_HANDLE_CONTEXT_SELECT:
HandleContext = (BM_HANDLE_CONTEXT *) MenuEntry->VariableContext;
FreePool (HandleContext);
break;
default:
break;
}
FreePool (MenuEntry->DisplayString);
if (MenuEntry->HelpString != NULL) {
FreePool (MenuEntry->HelpString);
}
FreePool (MenuEntry);
}
/**
Get the Menu Entry from the list in Menu Entry List.
If MenuNumber is great or equal to the number of Menu
Entry in the list, then ASSERT.
@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 *
BOpt_GetMenuEntry (
BM_MENU_OPTION *MenuOption,
UINTN MenuNumber
)
{
BM_MENU_ENTRY *NewMenuEntry;
UINTN Index;
LIST_ENTRY *List;
ASSERT (MenuNumber < MenuOption->MenuNumber);
List = MenuOption->Head.ForwardLink;
for (Index = 0; Index < MenuNumber; Index++) {
List = List->ForwardLink;
}
NewMenuEntry = CR (List, BM_MENU_ENTRY, Link, BM_MENU_ENTRY_SIGNATURE);
return NewMenuEntry;
}
/**
Free resources allocated in Allocate Rountine.
@param FreeMenu Menu to be freed
**/
VOID
BOpt_FreeMenu (
BM_MENU_OPTION *FreeMenu
)
{
BM_MENU_ENTRY *MenuEntry;
while (!IsListEmpty (&FreeMenu->Head)) {
MenuEntry = CR (
FreeMenu->Head.ForwardLink,
BM_MENU_ENTRY,
Link,
BM_MENU_ENTRY_SIGNATURE
);
RemoveEntryList (&MenuEntry->Link);
BOpt_DestroyMenuEntry (MenuEntry);
}
FreeMenu->MenuNumber = 0;
}
/**
Build the BootOptionMenu according to BootOrder Variable.
This Routine will access the Boot#### to get EFI_LOAD_OPTION.
@param CallbackData The BMM context data.
@return EFI_NOT_FOUND Fail to find "BootOrder" variable.
@return EFI_SUCESS Success build boot option menu.
**/
EFI_STATUS
BOpt_GetBootOptions (
IN BMM_CALLBACK_DATA *CallbackData
)
{
UINTN Index;
UINT16 BootString[10];
UINT8 *LoadOptionFromVar;
UINT8 *LoadOption;
UINTN BootOptionSize;
BOOLEAN BootNextFlag;
UINT16 *BootOrderList;
UINTN BootOrderListSize;
UINT16 *BootNext;
UINTN BootNextSize;
BM_MENU_ENTRY *NewMenuEntry;
BM_LOAD_CONTEXT *NewLoadContext;
UINT8 *LoadOptionPtr;
UINTN StringSize;
UINTN OptionalDataSize;
UINT8 *LoadOptionEnd;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN MenuCount;
UINT8 *Ptr;
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
UINTN BootOptionCount;
MenuCount = 0;
BootOrderListSize = 0;
BootNextSize = 0;
BootOrderList = NULL;
BootNext = NULL;
LoadOptionFromVar = NULL;
BOpt_FreeMenu (&BootOptionMenu);
InitializeListHead (&BootOptionMenu.Head);
//
// Get the BootOrder from the Var
//
GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrderList, &BootOrderListSize);
if (BootOrderList == NULL) {
return EFI_NOT_FOUND;
}
//
// Get the BootNext from the Var
//
GetEfiGlobalVariable2 (L"BootNext", (VOID **) &BootNext, &BootNextSize);
if (BootNext != NULL) {
if (BootNextSize != sizeof (UINT16)) {
FreePool (BootNext);
BootNext = NULL;
}
}
BootOption = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
for (Index = 0; Index < BootOrderListSize / sizeof (UINT16); Index++) {
//
// Don't display the hidden/inactive boot option
//
if (((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) || ((BootOption[Index].Attributes & LOAD_OPTION_ACTIVE) == 0)) {
continue;
}
UnicodeSPrint (BootString, sizeof (BootString), L"Boot%04x", BootOrderList[Index]);
//
// Get all loadoptions from the VAR
//
GetEfiGlobalVariable2 (BootString, (VOID **) &LoadOptionFromVar, &BootOptionSize);
if (LoadOptionFromVar == NULL) {
continue;
}
LoadOption = AllocateZeroPool (BootOptionSize);
if (LoadOption == NULL) {
continue;
}
CopyMem (LoadOption, LoadOptionFromVar, BootOptionSize);
FreePool (LoadOptionFromVar);
if (BootNext != NULL) {
BootNextFlag = (BOOLEAN) (*BootNext == BootOrderList[Index]);
} else {
BootNextFlag = FALSE;
}
NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT);
ASSERT (NULL != NewMenuEntry);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
LoadOptionPtr = LoadOption;
LoadOptionEnd = LoadOption + BootOptionSize;
NewMenuEntry->OptionNumber = BootOrderList[Index];
NewLoadContext->LoadOptionModified = FALSE;
NewLoadContext->Deleted = FALSE;
NewLoadContext->IsBootNext = BootNextFlag;
//
// Is a Legacy Device?
//
Ptr = (UINT8 *) LoadOption;
//
// Attribute = *(UINT32 *)Ptr;
//
Ptr += sizeof (UINT32);
//
// FilePathSize = *(UINT16 *)Ptr;
//
Ptr += sizeof (UINT16);
//
// Description = (CHAR16 *)Ptr;
//
Ptr += StrSize ((CHAR16 *) Ptr);
//
// Now Ptr point to Device Path
//
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;
if ((BBS_DEVICE_PATH == DevicePath->Type) && (BBS_BBS_DP == DevicePath->SubType)) {
NewLoadContext->IsLegacy = TRUE;
} else {
NewLoadContext->IsLegacy = FALSE;
}
//
// LoadOption is a pointer type of UINT8
// for easy use with following LOAD_OPTION
// embedded in this struct
//
NewLoadContext->LoadOption = LoadOption;
NewLoadContext->LoadOptionSize = BootOptionSize;
NewLoadContext->Attributes = *(UINT32 *) LoadOptionPtr;
NewLoadContext->IsActive = (BOOLEAN) (NewLoadContext->Attributes & LOAD_OPTION_ACTIVE);
NewLoadContext->ForceReconnect = (BOOLEAN) (NewLoadContext->Attributes & LOAD_OPTION_FORCE_RECONNECT);
LoadOptionPtr += sizeof (UINT32);
NewLoadContext->FilePathListLength = *(UINT16 *) LoadOptionPtr;
LoadOptionPtr += sizeof (UINT16);
StringSize = StrSize((UINT16*)LoadOptionPtr);
NewLoadContext->Description = AllocateZeroPool (StrSize((UINT16*)LoadOptionPtr));
ASSERT (NewLoadContext->Description != NULL);
StrCpyS (NewLoadContext->Description, StrSize((UINT16*)LoadOptionPtr) / sizeof (UINT16), (UINT16*)LoadOptionPtr);
ASSERT (NewLoadContext->Description != NULL);
NewMenuEntry->DisplayString = NewLoadContext->Description;
NewMenuEntry->DisplayStringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, NewMenuEntry->DisplayString, NULL);
LoadOptionPtr += StringSize;
NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
NewLoadContext->FilePathList,
(EFI_DEVICE_PATH_PROTOCOL *) LoadOptionPtr,
NewLoadContext->FilePathListLength
);
NewMenuEntry->HelpString = UiDevicePathToStr (NewLoadContext->FilePathList);
NewMenuEntry->HelpStringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, NewMenuEntry->HelpString, NULL);
LoadOptionPtr += NewLoadContext->FilePathListLength;
if (LoadOptionPtr < LoadOptionEnd) {
OptionalDataSize = BootOptionSize -
sizeof (UINT32) -
sizeof (UINT16) -
StringSize -
NewLoadContext->FilePathListLength;
NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,
LoadOptionPtr,
OptionalDataSize
);
NewLoadContext->OptionalDataSize = OptionalDataSize;
}
InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link);
MenuCount++;
}
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);
if (BootNext != NULL) {
FreePool (BootNext);
}
if (BootOrderList != NULL) {
FreePool (BootOrderList);
}
BootOptionMenu.MenuNumber = MenuCount;
return EFI_SUCCESS;
}
/**
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.
@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;
UINTN Index;
EFI_STATUS Status;
BM_MENU_ENTRY *NewMenuEntry;
BM_HANDLE_CONTEXT *NewHandleContext;
EFI_HANDLE CurHandle;
UINTN OptionNumber;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFs;
EFI_LOAD_FILE_PROTOCOL *LoadFile;
SimpleFs = NULL;
LoadFile = NULL;
InitializeListHead (&DriverMenu.Head);
//
// At first, get all handles that support Device Path
// protocol which is the basic requirement for
// Driver####
//
Status = gBS->LocateHandleBuffer (
ByProtocol,
&gEfiDevicePathProtocolGuid,
NULL,
&NoDevicePathHandles,
&DevicePathHandle
);
if (EFI_ERROR (Status)) {
return Status;
}
OptionNumber = 0;
for (Index = 0; Index < NoDevicePathHandles; Index++) {
CurHandle = DevicePathHandle[Index];
Status = gBS->HandleProtocol (
CurHandle,
&gEfiSimpleFileSystemProtocolGuid,
(VOID **) &SimpleFs
);
if (Status == EFI_SUCCESS) {
continue;
}
Status = gBS->HandleProtocol (
CurHandle,
&gEfiLoadFileProtocolGuid,
(VOID **) &LoadFile
);
if (Status == EFI_SUCCESS) {
continue;
}
NewMenuEntry = BOpt_CreateMenuEntry (BM_HANDLE_CONTEXT_SELECT);
if (NULL == NewMenuEntry) {
FreePool (DevicePathHandle);
return EFI_OUT_OF_RESOURCES;
}
NewHandleContext = (BM_HANDLE_CONTEXT *) NewMenuEntry->VariableContext;
NewHandleContext->Handle = CurHandle;
NewHandleContext->DevicePath = DevicePathFromHandle (CurHandle);
NewMenuEntry->DisplayString = UiDevicePathToStr (NewHandleContext->DevicePath);
NewMenuEntry->DisplayStringToken = HiiSetString (mBmmCallbackInfo->BmmHiiHandle,0,NewMenuEntry->DisplayString,NULL);
NewMenuEntry->HelpString = NULL;
NewMenuEntry->HelpStringToken = NewMenuEntry->DisplayStringToken;
NewMenuEntry->OptionNumber = OptionNumber;
OptionNumber++;
InsertTailList (&DriverMenu.Head, &NewMenuEntry->Link);
}
if (DevicePathHandle != NULL) {
FreePool (DevicePathHandle);
}
DriverMenu.MenuNumber = OptionNumber;
return EFI_SUCCESS;
}
/**
Get the Option Number that has not been allocated for use.
@param Type The type of Option.
@return The available Option Number.
**/
UINT16
BOpt_GetOptionNumber (
CHAR16 *Type
)
{
UINT16 *OrderList;
UINTN OrderListSize;
UINTN Index;
CHAR16 StrTemp[20];
UINT16 *OptionBuffer;
UINT16 OptionNumber;
UINTN OptionSize;
OrderListSize = 0;
OrderList = NULL;
OptionNumber = 0;
Index = 0;
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"%sOrder", Type);
GetEfiGlobalVariable2 (StrTemp, (VOID **) &OrderList, &OrderListSize);
for (OptionNumber = 0; ; OptionNumber++) {
if (OrderList != NULL) {
for (Index = 0; Index < OrderListSize / sizeof (UINT16); Index++) {
if (OptionNumber == OrderList[Index]) {
break;
}
}
}
if (Index < OrderListSize / sizeof (UINT16)) {
//
// The OptionNumber occurs in the OrderList, continue to use next one
//
continue;
}
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"%s%04x", Type, (UINTN) OptionNumber);
DEBUG((EFI_D_ERROR,"Option = %s\n", StrTemp));
GetEfiGlobalVariable2 (StrTemp, (VOID **) &OptionBuffer, &OptionSize);
if (NULL == OptionBuffer) {
//
// The Boot[OptionNumber] / Driver[OptionNumber] NOT occurs, we found it
//
break;
}
}
return OptionNumber;
}
/**
Get the Option Number for Boot#### that does not used.
@return The available Option Number.
**/
UINT16
BOpt_GetBootOptionNumber (
VOID
)
{
return BOpt_GetOptionNumber (L"Boot");
}
/**
Get the Option Number for Driver#### that does not used.
@return The unused Option Number.
**/
UINT16
BOpt_GetDriverOptionNumber (
VOID
)
{
return BOpt_GetOptionNumber (L"Driver");
}
/**
Build up all DriverOptionMenu
@param CallbackData The BMM context data.
@retval EFI_SUCESS The functin completes successfully.
@retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.
@retval EFI_NOT_FOUND Fail to get "DriverOrder" variable.
**/
EFI_STATUS
BOpt_GetDriverOptions (
IN BMM_CALLBACK_DATA *CallbackData
)
{
UINTN Index;
UINT16 DriverString[12];
UINT8 *LoadOptionFromVar;
UINT8 *LoadOption;
UINTN DriverOptionSize;
UINT16 *DriverOrderList;
UINTN DriverOrderListSize;
BM_MENU_ENTRY *NewMenuEntry;
BM_LOAD_CONTEXT *NewLoadContext;
UINT8 *LoadOptionPtr;
UINTN StringSize;
UINTN OptionalDataSize;
UINT8 *LoadOptionEnd;
DriverOrderListSize = 0;
DriverOrderList = NULL;
DriverOptionSize = 0;
LoadOptionFromVar = NULL;
BOpt_FreeMenu (&DriverOptionMenu);
InitializeListHead (&DriverOptionMenu.Head);
//
// Get the DriverOrder from the Var
//
GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize);
if (DriverOrderList == NULL) {
return EFI_NOT_FOUND;
}
for (Index = 0; Index < DriverOrderListSize / sizeof (UINT16); Index++) {
UnicodeSPrint (
DriverString,
sizeof (DriverString),
L"Driver%04x",
DriverOrderList[Index]
);
//
// Get all loadoptions from the VAR
//
GetEfiGlobalVariable2 (DriverString, (VOID **) &LoadOptionFromVar, &DriverOptionSize);
if (LoadOptionFromVar == NULL) {
continue;
}
LoadOption = AllocateZeroPool (DriverOptionSize);
if (LoadOption == NULL) {
continue;
}
CopyMem (LoadOption, LoadOptionFromVar, DriverOptionSize);
FreePool (LoadOptionFromVar);
NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT);
if (NULL == NewMenuEntry) {
return EFI_OUT_OF_RESOURCES;
}
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
LoadOptionPtr = LoadOption;
LoadOptionEnd = LoadOption + DriverOptionSize;
NewMenuEntry->OptionNumber = DriverOrderList[Index];
NewLoadContext->LoadOptionModified = FALSE;
NewLoadContext->Deleted = FALSE;
NewLoadContext->IsLegacy = FALSE;
//
// LoadOption is a pointer type of UINT8
// for easy use with following LOAD_OPTION
// embedded in this struct
//
NewLoadContext->LoadOption = LoadOption;
NewLoadContext->LoadOptionSize = DriverOptionSize;
NewLoadContext->Attributes = *(UINT32 *) LoadOptionPtr;
NewLoadContext->IsActive = (BOOLEAN) (NewLoadContext->Attributes & LOAD_OPTION_ACTIVE);
NewLoadContext->ForceReconnect = (BOOLEAN) (NewLoadContext->Attributes & LOAD_OPTION_FORCE_RECONNECT);
LoadOptionPtr += sizeof (UINT32);
NewLoadContext->FilePathListLength = *(UINT16 *) LoadOptionPtr;
LoadOptionPtr += sizeof (UINT16);
StringSize = StrSize ((UINT16 *) LoadOptionPtr);
NewLoadContext->Description = AllocateZeroPool (StringSize);
ASSERT (NewLoadContext->Description != NULL);
CopyMem (
NewLoadContext->Description,
(UINT16 *) LoadOptionPtr,
StringSize
);
NewMenuEntry->DisplayString = NewLoadContext->Description;
NewMenuEntry->DisplayStringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, NewMenuEntry->DisplayString, NULL);
LoadOptionPtr += StringSize;
NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
NewLoadContext->FilePathList,
(EFI_DEVICE_PATH_PROTOCOL *) LoadOptionPtr,
NewLoadContext->FilePathListLength
);
NewMenuEntry->HelpString = UiDevicePathToStr (NewLoadContext->FilePathList);
NewMenuEntry->HelpStringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, NewMenuEntry->HelpString, NULL);
LoadOptionPtr += NewLoadContext->FilePathListLength;
if (LoadOptionPtr < LoadOptionEnd) {
OptionalDataSize = DriverOptionSize -
sizeof (UINT32) -
sizeof (UINT16) -
StringSize -
NewLoadContext->FilePathListLength;
NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,
LoadOptionPtr,
OptionalDataSize
);
NewLoadContext->OptionalDataSize = OptionalDataSize;
}
InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);
}
if (DriverOrderList != NULL) {
FreePool (DriverOrderList);
}
DriverOptionMenu.MenuNumber = Index;
return EFI_SUCCESS;
}
/**
Get option number according to Boot#### and BootOrder variable.
The value is saved as #### + 1.
@param CallbackData The BMM context data.
**/
VOID
GetBootOrder (
IN BMM_CALLBACK_DATA *CallbackData
)
{
BMM_FAKE_NV_DATA *BmmConfig;
UINT16 Index;
UINT16 OptionOrderIndex;
UINTN DeviceType;
BM_MENU_ENTRY *NewMenuEntry;
BM_LOAD_CONTEXT *NewLoadContext;
ASSERT (CallbackData != NULL);
DeviceType = (UINTN) -1;
BmmConfig = &CallbackData->BmmFakeNvData;
ZeroMem (BmmConfig->BootOptionOrder, sizeof (BmmConfig->BootOptionOrder));
for (Index = 0, OptionOrderIndex = 0; ((Index < BootOptionMenu.MenuNumber) &&
(OptionOrderIndex < (sizeof (BmmConfig->BootOptionOrder) / sizeof (BmmConfig->BootOptionOrder[0]))));
Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
if (NewLoadContext->IsLegacy) {
if (((BBS_BBS_DEVICE_PATH *) NewLoadContext->FilePathList)->DeviceType != DeviceType) {
DeviceType = ((BBS_BBS_DEVICE_PATH *) NewLoadContext->FilePathList)->DeviceType;
} else {
//
// Only show one legacy boot option for the same device type
// assuming the boot options are grouped by the device type
//
continue;
}
}
BmmConfig->BootOptionOrder[OptionOrderIndex++] = (UINT32) (NewMenuEntry->OptionNumber + 1);
}
}
/**
Get driver option order from globalc DriverOptionMenu.
@param CallbackData The BMM context data.
**/
VOID
GetDriverOrder (
IN BMM_CALLBACK_DATA *CallbackData
)
{
BMM_FAKE_NV_DATA *BmmConfig;
UINT16 Index;
UINT16 OptionOrderIndex;
UINTN DeviceType;
BM_MENU_ENTRY *NewMenuEntry;
BM_LOAD_CONTEXT *NewLoadContext;
ASSERT (CallbackData != NULL);
DeviceType = (UINTN) -1;
BmmConfig = &CallbackData->BmmFakeNvData;
ZeroMem (BmmConfig->DriverOptionOrder, sizeof (BmmConfig->DriverOptionOrder));
for (Index = 0, OptionOrderIndex = 0; ((Index < DriverOptionMenu.MenuNumber) &&
(OptionOrderIndex < (sizeof (BmmConfig->DriverOptionOrder) / sizeof (BmmConfig->DriverOptionOrder[0]))));
Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&DriverOptionMenu, Index);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
if (NewLoadContext->IsLegacy) {
if (((BBS_BBS_DEVICE_PATH *) NewLoadContext->FilePathList)->DeviceType != DeviceType) {
DeviceType = ((BBS_BBS_DEVICE_PATH *) NewLoadContext->FilePathList)->DeviceType;
} else {
//
// Only show one legacy boot option for the same device type
// assuming the boot options are grouped by the device type
//
continue;
}
}
BmmConfig->DriverOptionOrder[OptionOrderIndex++] = (UINT32) (NewMenuEntry->OptionNumber + 1);
}
}
/**
Boot the file specified by the input file path info.
@param FilePath Point to the file path.
@retval TRUE Exit caller function.
@retval FALSE Not exit caller function.
**/
BOOLEAN
BootFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
{
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
CHAR16 *FileName;
FileName = ExtractFileNameFromDevicePath(FilePath);
EfiBootManagerInitializeLoadOption (
&BootOption,
0,
LoadOptionTypeBoot,
LOAD_OPTION_ACTIVE,
FileName,
FilePath,
NULL,
0
);
//
// Since current no boot from removable media directly is allowed */
//
gST->ConOut->ClearScreen (gST->ConOut);
BmmBdsSetConsoleMode (FALSE);
EfiBootManagerBoot (&BootOption);
BmmBdsSetConsoleMode (TRUE);
FreePool(FileName);
EfiBootManagerFreeLoadOption (&BootOption);
return FALSE;
}
/**
Display the form base on the selected file.
@param FilePath Point to the file path.
@param FormId The form need to display.
**/
BOOLEAN
ReSendForm(
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
IN EFI_FORM_ID FormId
)
{
gBootMaintenancePrivate.LoadContext->FilePathList = FilePath;
UpdateOptionPage(&gBootMaintenancePrivate, FormId, FilePath);
gBootMaintenancePrivate.FormBrowser2->SendForm (
gBootMaintenancePrivate.FormBrowser2,
&gBootMaintenancePrivate.BmmHiiHandle,
1,
&mBootMaintGuid,
FormId,
NULL,
NULL
);
return TRUE;
}
/**
Create boot option base on the input file path info.
@param FilePath Point to the file path.
@retval TRUE Exit caller function.
@retval FALSE Not exit caller function.
**/
BOOLEAN
CreateBootOptionFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
{
return ReSendForm(FilePath, FORM_BOOT_ADD_ID);
}
/**
Create driver option base on the input file path info.
@param FilePath Point to the file path.
@retval TRUE Exit caller function.
@retval FALSE Not exit caller function.
**/
BOOLEAN
CreateDriverOptionFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
{
return ReSendForm(FilePath, FORM_DRV_ADD_FILE_ID);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,263 @@
/** @file
Define some data used for Boot Maint
Copyright (c) 2004 - 2015, 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
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.
**/
#include "BootMaintenanceManager.h"
VOID *mStartOpCodeHandle = NULL;
VOID *mEndOpCodeHandle = NULL;
EFI_IFR_GUID_LABEL *mStartLabel = NULL;
EFI_IFR_GUID_LABEL *mEndLabel = NULL;
///
/// Terminal type string token storage
///
UINT16 TerminalType[] = {
STRING_TOKEN(STR_COM_TYPE_0),
STRING_TOKEN(STR_COM_TYPE_1),
STRING_TOKEN(STR_COM_TYPE_2),
STRING_TOKEN(STR_COM_TYPE_3),
STRING_TOKEN(STR_COM_TYPE_4),
};
///
/// Flow Control type string token storage
///
UINT16 mFlowControlType[2] = {
STRING_TOKEN(STR_NONE_FLOW_CONTROL),
STRING_TOKEN(STR_HARDWARE_FLOW_CONTROL)
};
UINT32 mFlowControlValue[2] = {
0,
UART_FLOW_CONTROL_HARDWARE
};
///
/// Console Input Device Selection Menu
///
BM_MENU_OPTION ConsoleInpMenu = {
BM_MENU_OPTION_SIGNATURE,
{NULL},
0
};
///
/// Console Output Device Selection Menu
///
BM_MENU_OPTION ConsoleOutMenu = {
BM_MENU_OPTION_SIGNATURE,
{NULL},
0
};
///
/// Error Output Device Selection Menu
///
BM_MENU_OPTION ConsoleErrMenu = {
BM_MENU_OPTION_SIGNATURE,
{NULL},
0
};
///
/// Boot Option from variable Menu
///
BM_MENU_OPTION BootOptionMenu = {
BM_MENU_OPTION_SIGNATURE,
{NULL},
0
};
///
/// Driver Option from variable menu
///
BM_MENU_OPTION DriverOptionMenu = {
BM_MENU_OPTION_SIGNATURE,
{NULL},
0
};
///
/// Handles in current system selection menu
///
BM_MENU_OPTION DriverMenu = {
BM_MENU_OPTION_SIGNATURE,
{NULL},
0
};
BM_MENU_OPTION TerminalMenu = {
BM_MENU_OPTION_SIGNATURE,
{NULL},
0
};
///
/// Value and string token correspondency for BaudRate
///
COM_ATTR BaudRateList[19] = {
{
115200,
STRING_TOKEN(STR_COM_BAUD_RATE_0)
},
{
57600,
STRING_TOKEN(STR_COM_BAUD_RATE_1)
},
{
38400,
STRING_TOKEN(STR_COM_BAUD_RATE_2)
},
{
19200,
STRING_TOKEN(STR_COM_BAUD_RATE_3)
},
{
9600,
STRING_TOKEN(STR_COM_BAUD_RATE_4)
},
{
7200,
STRING_TOKEN(STR_COM_BAUD_RATE_5)
},
{
4800,
STRING_TOKEN(STR_COM_BAUD_RATE_6)
},
{
3600,
STRING_TOKEN(STR_COM_BAUD_RATE_7)
},
{
2400,
STRING_TOKEN(STR_COM_BAUD_RATE_8)
},
{
2000,
STRING_TOKEN(STR_COM_BAUD_RATE_9)
},
{
1800,
STRING_TOKEN(STR_COM_BAUD_RATE_10)
},
{
1200,
STRING_TOKEN(STR_COM_BAUD_RATE_11)
},
{
600,
STRING_TOKEN(STR_COM_BAUD_RATE_12)
},
{
300,
STRING_TOKEN(STR_COM_BAUD_RATE_13)
},
{
150,
STRING_TOKEN(STR_COM_BAUD_RATE_14)
},
{
134,
STRING_TOKEN(STR_COM_BAUD_RATE_15)
},
{
110,
STRING_TOKEN(STR_COM_BAUD_RATE_16)
},
{
75,
STRING_TOKEN(STR_COM_BAUD_RATE_17)
},
{
50,
STRING_TOKEN(STR_COM_BAUD_RATE_18)
}
};
///
/// Value and string token correspondency for DataBits
///
COM_ATTR DataBitsList[4] = {
{
5,
STRING_TOKEN(STR_COM_DATA_BITS_0)
},
{
6,
STRING_TOKEN(STR_COM_DATA_BITS_1)
},
{
7,
STRING_TOKEN(STR_COM_DATA_BITS_2)
},
{
8,
STRING_TOKEN(STR_COM_DATA_BITS_3)
}
};
///
/// Value and string token correspondency for Parity
///
COM_ATTR ParityList[5] = {
{
NoParity,
STRING_TOKEN(STR_COM_PAR_0)
},
{
EvenParity,
STRING_TOKEN(STR_COM_PAR_1)
},
{
OddParity,
STRING_TOKEN(STR_COM_PAR_2)
},
{
MarkParity,
STRING_TOKEN(STR_COM_PAR_3)
},
{
SpaceParity,
STRING_TOKEN(STR_COM_PAR_4)
}
};
///
/// Value and string token correspondency for Baudreate
///
COM_ATTR StopBitsList[3] = {
{
OneStopBit,
STRING_TOKEN(STR_COM_STOP_BITS_0)
},
{
OneFiveStopBits,
STRING_TOKEN(STR_COM_STOP_BITS_1)
},
{
TwoStopBits,
STRING_TOKEN(STR_COM_STOP_BITS_2)
}
};
///
/// Guid for messaging path, used in Serial port setting.
///
EFI_GUID TerminalTypeGuid[] = {
DEVICE_PATH_MESSAGING_PC_ANSI,
DEVICE_PATH_MESSAGING_VT_100,
DEVICE_PATH_MESSAGING_VT_100_PLUS,
DEVICE_PATH_MESSAGING_VT_UTF8,
EFI_TTY_TERM_GUID
};

View File

@@ -0,0 +1,209 @@
/** @file
Formset guids, form id and VarStore data structure for Boot Maintenance Manager.
Copyright (c) 2004 - 2015, 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
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.
**/
#ifndef _FORM_GUID_H_
#define _FORM_GUID_H_
#define BOOT_MAINT_FORMSET_GUID \
{ \
0x642237c7, 0x35d4, 0x472d, {0x83, 0x65, 0x12, 0xe0, 0xcc, 0xf2, 0x7a, 0x22} \
}
#define FORM_MAIN_ID 0x1001
#define FORM_BOOT_ADD_ID 0x1002
#define FORM_BOOT_DEL_ID 0x1003
#define FORM_BOOT_CHG_ID 0x1004
#define FORM_DRV_ADD_ID 0x1005
#define FORM_DRV_DEL_ID 0x1006
#define FORM_DRV_CHG_ID 0x1007
#define FORM_CON_MAIN_ID 0x1008
#define FORM_CON_IN_ID 0x1009
#define FORM_CON_OUT_ID 0x100A
#define FORM_CON_ERR_ID 0x100B
#define FORM_FILE_SEEK_ID 0x100C
#define FORM_FILE_NEW_SEEK_ID 0x100D
#define FORM_DRV_ADD_FILE_ID 0x100E
#define FORM_DRV_ADD_HANDLE_ID 0x100F
#define FORM_DRV_ADD_HANDLE_DESC_ID 0x1010
#define FORM_BOOT_NEXT_ID 0x1011
#define FORM_TIME_OUT_ID 0x1012
#define FORM_BOOT_SETUP_ID 0x1014
#define FORM_DRIVER_SETUP_ID 0x1015
#define FORM_BOOT_LEGACY_DEVICE_ID 0x1016
#define FORM_CON_COM_ID 0x1017
#define FORM_CON_COM_SETUP_ID 0x1018
#define FORM_BOOT_ADD_DESCRIPTION_ID 0x101F
#define FORM_DRIVER_ADD_FILE_DESCRIPTION_ID 0x1020
#define FORM_CON_MODE_ID 0x1021
#define FORM_MEMORY_CHECK_ID 0x1022
#define FORM_UEFI_OPTIMIZED_BOOT_ID 0x1023
#define FORM_BOOT_FROM_FILE_ID 0x1024
#define MAXIMUM_FORM_ID 0x10FF
#define KEY_VALUE_COM_SET_BAUD_RATE 0x1101
#define KEY_VALUE_COM_SET_DATA_BITS 0x1102
#define KEY_VALUE_COM_SET_STOP_BITS 0x1103
#define KEY_VALUE_COM_SET_PARITY 0x1104
#define KEY_VALUE_COM_SET_TERMI_TYPE 0x1105
#define KEY_VALUE_MAIN_BOOT_NEXT 0x1106
#define KEY_VALUE_BOOT_ADD_DESC_DATA 0x1107
#define KEY_VALUE_BOOT_ADD_OPT_DATA 0x1108
#define KEY_VALUE_DRIVER_ADD_DESC_DATA 0x1109
#define KEY_VALUE_DRIVER_ADD_OPT_DATA 0x110A
#define KEY_VALUE_SAVE_AND_EXIT 0x110B
#define KEY_VALUE_NO_SAVE_AND_EXIT 0x110C
#define KEY_VALUE_BOOT_FROM_FILE 0x110D
#define FORM_RESET 0x110E
#define KEY_VALUE_BOOT_DESCRIPTION 0x110F
#define KEY_VALUE_BOOT_OPTION 0x1110
#define KEY_VALUE_DRIVER_DESCRIPTION 0x1111
#define KEY_VALUE_DRIVER_OPTION 0x1112
#define KEY_VALUE_SAVE_AND_EXIT_BOOT 0x1113
#define KEY_VALUE_NO_SAVE_AND_EXIT_BOOT 0x1114
#define KEY_VALUE_SAVE_AND_EXIT_DRIVER 0x1115
#define KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER 0x1116
#define MAXIMUM_NORMAL_KEY_VALUE 0x11FF
//
// Varstore ID defined for Buffer Storage
//
#define VARSTORE_ID_BOOT_MAINT 0x1000
//
// End Label
//
#define LABEL_BMM_PLATFORM_INFORMATION 0xfffe
#define LABEL_END 0xffff
#define MAX_MENU_NUMBER 100
///
/// This is the structure that will be used to store the
/// question's current value. Use it at initialize time to
/// set default value for each question. When using at run
/// time, this map is returned by the callback function,
/// so dynamically changing the question's value will be
/// possible through this mechanism
///
typedef struct {
//
// Three questions displayed at the main page
// for Timeout, BootNext, Variables respectively
//
UINT16 BootTimeOut;
UINT32 BootNext;
//
// This is the COM1 Attributes value storage
//
UINT8 COM1BaudRate;
UINT8 COM1DataRate;
UINT8 COM1StopBits;
UINT8 COM1Parity;
UINT8 COM1TerminalType;
//
// This is the COM2 Attributes value storage
//
UINT8 COM2BaudRate;
UINT8 COM2DataRate;
UINT8 COM2StopBits;
UINT8 COM2Parity;
UINT8 COM2TerminalType;
//
// Driver Option Add Handle page storage
//
UINT16 DriverAddHandleDesc[MAX_MENU_NUMBER];
UINT16 DriverAddHandleOptionalData[MAX_MENU_NUMBER];
UINT8 DriverAddActive;
UINT8 DriverAddForceReconnect;
//
// Console Input/Output/Errorout using COM port check storage
//
UINT8 ConsoleInputCOM1;
UINT8 ConsoleInputCOM2;
UINT8 ConsoleOutputCOM1;
UINT8 ConsoleOutputCOM2;
UINT8 ConsoleErrorCOM1;
UINT8 ConsoleErrorCOM2;
//
// At most 100 input/output/errorout device for console storage
//
UINT8 ConsoleCheck[MAX_MENU_NUMBER];
//
// At most 100 input/output/errorout device for console storage
//
UINT8 ConsoleInCheck[MAX_MENU_NUMBER];
UINT8 ConsoleOutCheck[MAX_MENU_NUMBER];
UINT8 ConsoleErrCheck[MAX_MENU_NUMBER];
//
// Boot or Driver Option Order storage
// The value is the OptionNumber+1 because the order list value cannot be 0
// Use UINT32 to hold the potential value 0xFFFF+1=0x10000
//
UINT32 BootOptionOrder[MAX_MENU_NUMBER];
UINT32 DriverOptionOrder[MAX_MENU_NUMBER];
//
// Boot or Driver Option Delete storage
//
BOOLEAN BootOptionDel[MAX_MENU_NUMBER];
BOOLEAN DriverOptionDel[MAX_MENU_NUMBER];
BOOLEAN BootOptionDelMark[MAX_MENU_NUMBER];
BOOLEAN DriverOptionDelMark[MAX_MENU_NUMBER];
//
// This is the Terminal Attributes value storage
//
UINT8 COMBaudRate[MAX_MENU_NUMBER];
UINT8 COMDataRate[MAX_MENU_NUMBER];
UINT8 COMStopBits[MAX_MENU_NUMBER];
UINT8 COMParity[MAX_MENU_NUMBER];
UINT8 COMTerminalType[MAX_MENU_NUMBER];
UINT8 COMFlowControl[MAX_MENU_NUMBER];
//
// We use DisableMap array to record the enable/disable state of each boot device
// It should be taken as a bit array, from left to right there are totally 256 bits
// the most left one stands for BBS table item 0, and the most right one stands for item 256
// If the bit is 1, it means the boot device has been disabled.
//
UINT8 DisableMap[32];
//
// Console Output Text Mode
//
UINT16 ConsoleOutMode;
//
// UINT16 PadArea[10];
//
UINT16 BootDescriptionData[MAX_MENU_NUMBER];
UINT16 BootOptionalData[127];
UINT16 DriverDescriptionData[MAX_MENU_NUMBER];
UINT16 DriverOptionalData[127];
BOOLEAN BootOptionChanged;
BOOLEAN DriverOptionChanged;
UINT8 Active;
UINT8 ForceReconnect;
} BMM_FAKE_NV_DATA;
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff