mirror of https://github.com/acidanthera/audk.git
MdeModulePkg:Refine the UiApp
Use new created libraries(Boot Manager,Device Manager,Boot Maintenance Manager) in UiApp.So remove and refine relative code in UiApp.And update the Nt32Pkg.dsc and MdeModulePkg.dsc. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18924 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4af04335ac
commit
ce7690e267
|
@ -1,360 +0,0 @@
|
|||
///** @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_NULL_STRING),
|
||||
classguid = BOOT_MAINT_FORMSET_GUID,
|
||||
|
||||
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
|
||||
formsetguid = FILE_EXPLORE_FORMSET_GUID,
|
||||
formid = 0,
|
||||
question = 0,
|
||||
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
|
||||
formsetguid = FILE_EXPLORE_FORMSET_GUID,
|
||||
formid = 0,
|
||||
question = 0,
|
||||
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_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
|
||||
formsetguid = FILE_EXPLORE_FORMSET_GUID,
|
||||
formid = 0,
|
||||
question = 0,
|
||||
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_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;
|
|
@ -1,369 +0,0 @@
|
|||
/** @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 "BootMaint.h"
|
||||
|
||||
/**
|
||||
|
||||
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
|
||||
that matches ProtocolGuid
|
||||
|
||||
@retval EFI_SUCCESS A protocol instance matching ProtocolGuid was found
|
||||
@retval EFI_NOT_FOUND No protocol instances were found that match ProtocolGuid
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EfiLibLocateProtocol (
|
||||
IN EFI_GUID *ProtocolGuid,
|
||||
OUT VOID **Interface
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
ProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) Interface
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Function opens and returns a file handle to the root directory of a volume.
|
||||
|
||||
@param DeviceHandle A handle for a device
|
||||
|
||||
@return A valid file handle or NULL is returned
|
||||
|
||||
**/
|
||||
EFI_FILE_HANDLE
|
||||
EfiLibOpenRoot (
|
||||
IN EFI_HANDLE DeviceHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Volume;
|
||||
EFI_FILE_HANDLE File;
|
||||
|
||||
File = NULL;
|
||||
|
||||
//
|
||||
// File the file system interface to the device
|
||||
//
|
||||
Status = gBS->HandleProtocol (
|
||||
DeviceHandle,
|
||||
&gEfiSimpleFileSystemProtocolGuid,
|
||||
(VOID *) &Volume
|
||||
);
|
||||
|
||||
//
|
||||
// Open the root directory of the volume
|
||||
//
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = Volume->OpenVolume (
|
||||
Volume,
|
||||
&File
|
||||
);
|
||||
}
|
||||
//
|
||||
// Done
|
||||
//
|
||||
return EFI_ERROR (Status) ? NULL : File;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Helper function called as part of the code needed
|
||||
to allocate the proper sized buffer for various
|
||||
EFI interfaces.
|
||||
|
||||
|
||||
@param Status Current status
|
||||
@param Buffer Current allocated buffer, or NULL
|
||||
@param BufferSize Current buffer size needed
|
||||
|
||||
@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
|
||||
EfiGrowBuffer (
|
||||
IN OUT EFI_STATUS *Status,
|
||||
IN OUT VOID **Buffer,
|
||||
IN UINTN BufferSize
|
||||
)
|
||||
{
|
||||
BOOLEAN TryAgain;
|
||||
|
||||
//
|
||||
// If this is an initial request, buffer will be null with a new buffer size
|
||||
//
|
||||
if ((*Buffer == NULL) && (BufferSize != 0)) {
|
||||
*Status = EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
//
|
||||
// If the status code is "buffer too small", resize the buffer
|
||||
//
|
||||
TryAgain = FALSE;
|
||||
if (*Status == EFI_BUFFER_TOO_SMALL) {
|
||||
|
||||
if (*Buffer != NULL) {
|
||||
FreePool (*Buffer);
|
||||
}
|
||||
|
||||
*Buffer = AllocateZeroPool (BufferSize);
|
||||
|
||||
if (*Buffer != NULL) {
|
||||
TryAgain = TRUE;
|
||||
} else {
|
||||
*Status = EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
}
|
||||
//
|
||||
// If there's an error, free the buffer
|
||||
//
|
||||
if (!TryAgain && EFI_ERROR (*Status) && (*Buffer != NULL)) {
|
||||
FreePool (*Buffer);
|
||||
*Buffer = NULL;
|
||||
}
|
||||
|
||||
return TryAgain;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
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 gets the file system information from an open file descriptor,
|
||||
and stores it in a buffer allocated from pool.
|
||||
|
||||
|
||||
@param FHand The file handle.
|
||||
|
||||
@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 *
|
||||
EfiLibFileSystemVolumeLabelInfo (
|
||||
IN EFI_FILE_HANDLE FHand
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_SYSTEM_VOLUME_LABEL *Buffer;
|
||||
UINTN BufferSize;
|
||||
//
|
||||
// Initialize for GrowBuffer loop
|
||||
//
|
||||
Buffer = NULL;
|
||||
BufferSize = SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL + 200;
|
||||
|
||||
//
|
||||
// Call the real function
|
||||
//
|
||||
while (EfiGrowBuffer (&Status, (VOID **) &Buffer, BufferSize)) {
|
||||
Status = FHand->GetInfo (
|
||||
FHand,
|
||||
&gEfiFileSystemVolumeLabelInfoIdGuid,
|
||||
&BufferSize,
|
||||
Buffer
|
||||
);
|
||||
}
|
||||
|
||||
return Buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
Duplicate a string.
|
||||
|
||||
@param Src The source.
|
||||
|
||||
@return A new string which is duplicated copy of the source.
|
||||
@retval NULL If there is not enough memory.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
EfiStrDuplicate (
|
||||
IN CHAR16 *Src
|
||||
)
|
||||
{
|
||||
CHAR16 *Dest;
|
||||
UINTN Size;
|
||||
|
||||
Size = StrSize (Src);
|
||||
Dest = AllocateZeroPool (Size);
|
||||
ASSERT (Dest != NULL);
|
||||
if (Dest != NULL) {
|
||||
CopyMem (Dest, Src, Size);
|
||||
}
|
||||
|
||||
return Dest;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Function gets the file information from an open file descriptor, and stores it
|
||||
in a buffer allocated from pool.
|
||||
|
||||
@param FHand File Handle.
|
||||
|
||||
@return A pointer to a buffer with file information or NULL is returned
|
||||
|
||||
**/
|
||||
EFI_FILE_INFO *
|
||||
EfiLibFileInfo (
|
||||
IN EFI_FILE_HANDLE FHand
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_INFO *Buffer;
|
||||
UINTN BufferSize;
|
||||
|
||||
//
|
||||
// Initialize for GrowBuffer loop
|
||||
//
|
||||
Buffer = NULL;
|
||||
BufferSize = SIZE_OF_EFI_FILE_INFO + 200;
|
||||
|
||||
//
|
||||
// Call the real function
|
||||
//
|
||||
while (EfiGrowBuffer (&Status, (VOID **) &Buffer, BufferSize)) {
|
||||
Status = FHand->GetInfo (
|
||||
FHand,
|
||||
&gEfiFileInfoGuid,
|
||||
&BufferSize,
|
||||
Buffer
|
||||
);
|
||||
}
|
||||
|
||||
return Buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
Adjusts the size of a previously allocated buffer.
|
||||
|
||||
|
||||
@param OldPool - A pointer to the buffer whose size is being adjusted.
|
||||
@param OldSize - The size of the current buffer.
|
||||
@param NewSize - The size of the new buffer.
|
||||
|
||||
@return The newly allocated buffer.
|
||||
@retval NULL Allocation failed.
|
||||
|
||||
**/
|
||||
VOID *
|
||||
EfiReallocatePool (
|
||||
IN VOID *OldPool,
|
||||
IN UINTN OldSize,
|
||||
IN UINTN NewSize
|
||||
)
|
||||
{
|
||||
VOID *NewPool;
|
||||
|
||||
NewPool = NULL;
|
||||
if (NewSize != 0) {
|
||||
NewPool = AllocateZeroPool (NewSize);
|
||||
}
|
||||
|
||||
if (OldPool != NULL) {
|
||||
if (NewPool != NULL) {
|
||||
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
|
||||
}
|
||||
|
||||
FreePool (OldPool);
|
||||
}
|
||||
|
||||
return NewPool;
|
||||
}
|
||||
|
||||
/**
|
||||
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;
|
||||
}
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,289 +0,0 @@
|
|||
/** @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 "BootMaint.h"
|
||||
|
||||
VOID *mStartOpCodeHandle = NULL;
|
||||
VOID *mEndOpCodeHandle = NULL;
|
||||
EFI_IFR_GUID_LABEL *mStartLabel = NULL;
|
||||
EFI_IFR_GUID_LABEL *mEndLabel = NULL;
|
||||
|
||||
STRING_DEPOSITORY *FileOptionStrDepository;
|
||||
STRING_DEPOSITORY *ConsoleOptionStrDepository;
|
||||
STRING_DEPOSITORY *BootOptionStrDepository;
|
||||
STRING_DEPOSITORY *BootOptionHelpStrDepository;
|
||||
STRING_DEPOSITORY *DriverOptionStrDepository;
|
||||
STRING_DEPOSITORY *DriverOptionHelpStrDepository;
|
||||
STRING_DEPOSITORY *TerminalStrDepository;
|
||||
|
||||
///
|
||||
/// 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
|
||||
};
|
||||
|
||||
///
|
||||
/// File system selection menu
|
||||
///
|
||||
BM_MENU_OPTION FsOptionMenu = {
|
||||
BM_MENU_OPTION_SIGNATURE,
|
||||
{NULL},
|
||||
0
|
||||
};
|
||||
|
||||
///
|
||||
/// 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
|
||||
};
|
||||
|
||||
///
|
||||
/// Files and sub-directories in current directory menu
|
||||
///
|
||||
BM_MENU_OPTION DirectoryMenu = {
|
||||
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
|
||||
};
|
|
@ -1,131 +0,0 @@
|
|||
///** @file
|
||||
//
|
||||
// File Explorer 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 = FILE_EXPLORE_FORMSET_GUID,
|
||||
title = STRING_TOKEN(STR_FILE_EXPLORER_TITLE),
|
||||
help = STRING_TOKEN(STR_NULL_STRING),
|
||||
classguid = FILE_EXPLORE_FORMSET_GUID,
|
||||
|
||||
varstore FILE_EXPLORER_NV_DATA,
|
||||
varid = VARSTORE_ID_BOOT_MAINT,
|
||||
name = FeData,
|
||||
guid = FILE_EXPLORE_FORMSET_GUID;
|
||||
|
||||
form formid = FORM_FILE_EXPLORER_ID,
|
||||
title = STRING_TOKEN(STR_FILE_EXPLORER_TITLE);
|
||||
|
||||
label FORM_FILE_EXPLORER_ID;
|
||||
label LABEL_END;
|
||||
endform;
|
||||
|
||||
form formid = FORM_BOOT_ADD_DESCRIPTION_ID,
|
||||
title = STRING_TOKEN(STR_FORM_BOOT_ADD_DESC_TITLE);
|
||||
|
||||
label FORM_BOOT_ADD_DESCRIPTION_ID;
|
||||
label LABEL_END;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_NULL_STRING);
|
||||
|
||||
string varid = FeData.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 = FeData.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),
|
||||
text = STRING_TOKEN(STR_NULL_STRING),
|
||||
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),
|
||||
text = STRING_TOKEN(STR_NULL_STRING),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_VALUE_NO_SAVE_AND_EXIT_BOOT;
|
||||
|
||||
endform;
|
||||
|
||||
form formid = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID,
|
||||
title = STRING_TOKEN(STR_FORM_DRV_ADD_DESC_TITLE);
|
||||
|
||||
label FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
|
||||
label LABEL_END;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_NULL_STRING);
|
||||
|
||||
string varid = FeData.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 = FeData.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 = FeData.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),
|
||||
text = STRING_TOKEN(STR_NULL_STRING),
|
||||
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),
|
||||
text = STRING_TOKEN(STR_NULL_STRING),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER;
|
||||
|
||||
endform;
|
||||
|
||||
endformset;
|
|
@ -1,449 +0,0 @@
|
|||
/** @file
|
||||
File explorer related functions.
|
||||
|
||||
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 "BootMaint.h"
|
||||
|
||||
/**
|
||||
Update the File Explore page.
|
||||
|
||||
@param CallbackData The BMM context data.
|
||||
@param MenuOption Pointer to menu options to display.
|
||||
|
||||
**/
|
||||
VOID
|
||||
UpdateFileExplorePage (
|
||||
IN BMM_CALLBACK_DATA *CallbackData,
|
||||
BM_MENU_OPTION *MenuOption
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
BM_FILE_CONTEXT *NewFileContext;
|
||||
EFI_FORM_ID FormId;
|
||||
|
||||
NewMenuEntry = NULL;
|
||||
NewFileContext = NULL;
|
||||
FormId = 0;
|
||||
|
||||
RefreshUpdateData ();
|
||||
mStartLabel->Number = FORM_FILE_EXPLORER_ID;
|
||||
|
||||
for (Index = 0; Index < MenuOption->MenuNumber; Index++) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (MenuOption, Index);
|
||||
NewFileContext = (BM_FILE_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
|
||||
if (NewFileContext->IsBootLegacy) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((NewFileContext->IsDir) || (FileExplorerStateBootFromFile == CallbackData->FeCurrentState)) {
|
||||
//
|
||||
// Create Text opcode for directory, also create Text opcode for file in FileExplorerStateBootFromFile.
|
||||
//
|
||||
HiiCreateActionOpCode (
|
||||
mStartOpCodeHandle,
|
||||
(UINT16) (FILE_OPTION_OFFSET + Index),
|
||||
NewMenuEntry->DisplayStringToken,
|
||||
STRING_TOKEN (STR_NULL_STRING),
|
||||
EFI_IFR_FLAG_CALLBACK,
|
||||
0
|
||||
);
|
||||
} else {
|
||||
//
|
||||
// Create Goto opcode for file in FileExplorerStateAddBootOption or FileExplorerStateAddDriverOptionState.
|
||||
//
|
||||
if (FileExplorerStateAddBootOption == CallbackData->FeCurrentState) {
|
||||
FormId = FORM_BOOT_ADD_DESCRIPTION_ID;
|
||||
} else if (FileExplorerStateAddDriverOptionState == CallbackData->FeCurrentState) {
|
||||
FormId = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
|
||||
}
|
||||
|
||||
HiiCreateGotoOpCode (
|
||||
mStartOpCodeHandle,
|
||||
FormId,
|
||||
NewMenuEntry->DisplayStringToken,
|
||||
STRING_TOKEN (STR_NULL_STRING),
|
||||
EFI_IFR_FLAG_CALLBACK,
|
||||
(UINT16) (FILE_OPTION_OFFSET + Index)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
HiiUpdateForm (
|
||||
CallbackData->FeHiiHandle,
|
||||
&mFileExplorerGuid,
|
||||
FORM_FILE_EXPLORER_ID,
|
||||
mStartOpCodeHandle, // Label FORM_FILE_EXPLORER_ID
|
||||
mEndOpCodeHandle // LABEL_END
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Update the file explower page with the refershed file system.
|
||||
|
||||
|
||||
@param CallbackData BMM context data
|
||||
@param KeyValue Key value to identify the type of data to expect.
|
||||
|
||||
@retval TRUE Inform the caller to create a callback packet to exit file explorer.
|
||||
@retval FALSE Indicate that there is no need to exit file explorer.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
UpdateFileExplorer (
|
||||
IN BMM_CALLBACK_DATA *CallbackData,
|
||||
IN UINT16 KeyValue
|
||||
)
|
||||
{
|
||||
UINT16 FileOptionMask;
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
BM_FILE_CONTEXT *NewFileContext;
|
||||
EFI_FORM_ID FormId;
|
||||
BOOLEAN ExitFileExplorer;
|
||||
EFI_STATUS Status;
|
||||
|
||||
NewMenuEntry = NULL;
|
||||
NewFileContext = NULL;
|
||||
ExitFileExplorer = FALSE;
|
||||
|
||||
FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue);
|
||||
|
||||
if (FileExplorerDisplayUnknown == CallbackData->FeDisplayContext) {
|
||||
//
|
||||
// First in, display file system.
|
||||
//
|
||||
BOpt_FreeMenu (&FsOptionMenu);
|
||||
BOpt_FindFileSystem (CallbackData);
|
||||
CreateMenuStringToken (CallbackData, CallbackData->FeHiiHandle, &FsOptionMenu);
|
||||
|
||||
UpdateFileExplorePage (CallbackData, &FsOptionMenu);
|
||||
|
||||
CallbackData->FeDisplayContext = FileExplorerDisplayFileSystem;
|
||||
} else {
|
||||
if (FileExplorerDisplayFileSystem == CallbackData->FeDisplayContext) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&FsOptionMenu, FileOptionMask);
|
||||
} else if (FileExplorerDisplayDirectory == CallbackData->FeDisplayContext) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&DirectoryMenu, FileOptionMask);
|
||||
}
|
||||
|
||||
NewFileContext = (BM_FILE_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
|
||||
if (NewFileContext->IsDir ) {
|
||||
CallbackData->FeDisplayContext = FileExplorerDisplayDirectory;
|
||||
|
||||
RemoveEntryList (&NewMenuEntry->Link);
|
||||
BOpt_FreeMenu (&DirectoryMenu);
|
||||
Status = BOpt_FindFiles (CallbackData, NewMenuEntry);
|
||||
if (EFI_ERROR (Status)) {
|
||||
ExitFileExplorer = TRUE;
|
||||
goto exit;
|
||||
}
|
||||
CreateMenuStringToken (CallbackData, CallbackData->FeHiiHandle, &DirectoryMenu);
|
||||
BOpt_DestroyMenuEntry (NewMenuEntry);
|
||||
|
||||
UpdateFileExplorePage (CallbackData, &DirectoryMenu);
|
||||
|
||||
} else {
|
||||
switch (CallbackData->FeCurrentState) {
|
||||
case FileExplorerStateBootFromFile:
|
||||
//
|
||||
// Here boot from file
|
||||
//
|
||||
BootThisFile (NewFileContext);
|
||||
ExitFileExplorer = TRUE;
|
||||
break;
|
||||
|
||||
case FileExplorerStateAddBootOption:
|
||||
case FileExplorerStateAddDriverOptionState:
|
||||
if (FileExplorerStateAddBootOption == CallbackData->FeCurrentState) {
|
||||
FormId = FORM_BOOT_ADD_DESCRIPTION_ID;
|
||||
if (!CallbackData->FeFakeNvData.BootOptionChanged) {
|
||||
ZeroMem (CallbackData->FeFakeNvData.BootDescriptionData, sizeof (CallbackData->FeFakeNvData.BootDescriptionData));
|
||||
ZeroMem (CallbackData->FeFakeNvData.BootOptionalData, sizeof (CallbackData->FeFakeNvData.BootOptionalData));
|
||||
}
|
||||
} else {
|
||||
FormId = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
|
||||
if (!CallbackData->FeFakeNvData.DriverOptionChanged) {
|
||||
ZeroMem (CallbackData->FeFakeNvData.DriverDescriptionData, sizeof (CallbackData->FeFakeNvData.DriverDescriptionData));
|
||||
ZeroMem (CallbackData->FeFakeNvData.DriverOptionalData, sizeof (CallbackData->FeFakeNvData.DriverOptionalData));
|
||||
}
|
||||
}
|
||||
|
||||
CallbackData->MenuEntry = NewMenuEntry;
|
||||
CallbackData->LoadContext->FilePathList = ((BM_FILE_CONTEXT *) (CallbackData->MenuEntry->VariableContext))->DevicePath;
|
||||
|
||||
//
|
||||
// Create Subtitle op-code for the display string of the option.
|
||||
//
|
||||
RefreshUpdateData ();
|
||||
mStartLabel->Number = FormId;
|
||||
|
||||
HiiCreateSubTitleOpCode (
|
||||
mStartOpCodeHandle,
|
||||
NewMenuEntry->DisplayStringToken,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
HiiUpdateForm (
|
||||
CallbackData->FeHiiHandle,
|
||||
&mFileExplorerGuid,
|
||||
FormId,
|
||||
mStartOpCodeHandle, // Label FormId
|
||||
mEndOpCodeHandle // LABEL_END
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
exit:
|
||||
return ExitFileExplorer;
|
||||
}
|
||||
|
||||
/**
|
||||
This function applies changes in a driver's configuration.
|
||||
Input is a Configuration, which has the routing data for this
|
||||
driver followed by name / value configuration pairs. The driver
|
||||
must apply those pairs to its configurable storage. If the
|
||||
driver's configuration is stored in a linear block of data
|
||||
and the driver's name / value pairs are in <BlockConfig>
|
||||
format, it may use the ConfigToBlock helper function (above) to
|
||||
simplify the job. Currently not implemented.
|
||||
|
||||
@param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
|
||||
@param[in] Configuration A null-terminated Unicode string in
|
||||
<ConfigString> format.
|
||||
@param[out] Progress A pointer to a string filled in with the
|
||||
offset of the most recent '&' before the
|
||||
first failing name / value pair (or the
|
||||
beginn ing of the string if the failure
|
||||
is in the first name / value pair) or
|
||||
the terminating NULL if all was
|
||||
successful.
|
||||
|
||||
@retval EFI_SUCCESS The results have been distributed or are
|
||||
awaiting distribution.
|
||||
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the
|
||||
parts of the results that must be
|
||||
stored awaiting possible future
|
||||
protocols.
|
||||
@retval EFI_INVALID_PARAMETERS Passing in a NULL for the
|
||||
Results parameter would result
|
||||
in this type of error.
|
||||
@retval EFI_NOT_FOUND Target for the specified routing data
|
||||
was not found.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FileExplorerRouteConfig (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Configuration,
|
||||
OUT EFI_STRING *Progress
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN BufferSize;
|
||||
EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
|
||||
FILE_EXPLORER_NV_DATA *FeData;
|
||||
BMM_CALLBACK_DATA *Private;
|
||||
|
||||
if (Progress == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
*Progress = Configuration;
|
||||
|
||||
if (Configuration == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Check routing data in <ConfigHdr>.
|
||||
// Note: there is no name for Name/Value storage, only GUID will be checked
|
||||
//
|
||||
if (!HiiIsConfigHdrMatch (Configuration, &mFileExplorerGuid, mFileExplorerStorageName)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiHiiConfigRoutingProtocolGuid,
|
||||
NULL,
|
||||
(VOID**) &ConfigRouting
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Private = FE_CALLBACK_DATA_FROM_THIS (This);
|
||||
//
|
||||
// Get Buffer Storage data from EFI variable
|
||||
//
|
||||
BufferSize = sizeof (FILE_EXPLORER_NV_DATA );
|
||||
FeData = &Private->FeFakeNvData;
|
||||
|
||||
//
|
||||
// Convert <ConfigResp> to buffer data by helper function ConfigToBlock()
|
||||
//
|
||||
Status = ConfigRouting->ConfigToBlock (
|
||||
ConfigRouting,
|
||||
Configuration,
|
||||
(UINT8 *) FeData,
|
||||
&BufferSize,
|
||||
Progress
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if (FeData->BootDescriptionData[0] != 0x00 || FeData->BootOptionalData[0] != 0x00) {
|
||||
Status = Var_UpdateBootOption (Private, FeData);
|
||||
Private->FeFakeNvData.BootOptionChanged = FALSE;
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
BOpt_GetBootOptions (Private);
|
||||
CreateMenuStringToken (Private, Private->FeHiiHandle, &BootOptionMenu);
|
||||
}
|
||||
|
||||
if (FeData->DriverDescriptionData[0] != 0x00 || FeData->DriverOptionalData[0] != 0x00) {
|
||||
Status = Var_UpdateDriverOption (
|
||||
Private,
|
||||
Private->FeHiiHandle,
|
||||
FeData->DriverDescriptionData,
|
||||
FeData->DriverOptionalData,
|
||||
FeData->ForceReconnect
|
||||
);
|
||||
Private->FeFakeNvData.DriverOptionChanged = FALSE;
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
BOpt_GetDriverOptions (Private);
|
||||
CreateMenuStringToken (Private, Private->FeHiiHandle, &DriverOptionMenu);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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.
|
||||
@param Action Specifies the type of action taken by the browser.
|
||||
@param QuestionId A unique value which is sent to the original exporting driver
|
||||
so that it can identify the type of data to expect.
|
||||
@param Type The type of value for the question.
|
||||
@param Value A pointer to the data being sent to the original exporting driver.
|
||||
@param ActionRequest On return, points to the action requested by the callback function.
|
||||
|
||||
@retval EFI_SUCCESS The callback successfully handled the action.
|
||||
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
|
||||
@retval EFI_DEVICE_ERROR The variable could not be saved.
|
||||
@retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
|
||||
@retval EFI_INVALID_PARAMETER If paramter Value or ActionRequest is NULL.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FileExplorerCallback (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN EFI_BROWSER_ACTION Action,
|
||||
IN EFI_QUESTION_ID QuestionId,
|
||||
IN UINT8 Type,
|
||||
IN EFI_IFR_TYPE_VALUE *Value,
|
||||
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
|
||||
)
|
||||
{
|
||||
BMM_CALLBACK_DATA *Private;
|
||||
FILE_EXPLORER_NV_DATA *NvRamMap;
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||
//
|
||||
// Do nothing for other UEFI Action. Only do call back when data is changed.
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
Private = FE_CALLBACK_DATA_FROM_THIS (This);
|
||||
|
||||
//
|
||||
// Retrieve uncommitted data from Form Browser
|
||||
//
|
||||
NvRamMap = &Private->FeFakeNvData;
|
||||
HiiGetBrowserData (&mFileExplorerGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA), (UINT8 *) NvRamMap);
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGED) {
|
||||
if ((Value == NULL) || (ActionRequest == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT){
|
||||
NvRamMap->BootOptionChanged = FALSE;
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
|
||||
} else if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER){
|
||||
NvRamMap->DriverOptionChanged = FALSE;
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
|
||||
} else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_BOOT) {
|
||||
//
|
||||
// Discard changes and exit formset
|
||||
//
|
||||
NvRamMap->BootOptionalData[0] = 0x0000;
|
||||
NvRamMap->BootDescriptionData[0] = 0x0000;
|
||||
NvRamMap->BootOptionChanged = FALSE;
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
|
||||
} else if ( QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER){
|
||||
NvRamMap->BootOptionalData[0] = 0x0000;
|
||||
NvRamMap->BootDescriptionData[0] = 0x0000;
|
||||
NvRamMap->DriverOptionChanged = FALSE;
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
|
||||
} else if (QuestionId == KEY_VALUE_BOOT_DESCRIPTION || QuestionId == KEY_VALUE_BOOT_OPTION){
|
||||
NvRamMap->BootOptionChanged = TRUE;
|
||||
} else if (QuestionId == KEY_VALUE_DRIVER_DESCRIPTION || QuestionId == KEY_VALUE_DRIVER_OPTION){
|
||||
NvRamMap->DriverOptionChanged = TRUE;
|
||||
} else if (QuestionId < FILE_OPTION_OFFSET) {
|
||||
//
|
||||
// Exit File Explorer formset
|
||||
//
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
|
||||
}
|
||||
} else if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||
if (Value == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (QuestionId >= FILE_OPTION_OFFSET) {
|
||||
UpdateFileExplorer (Private, QuestionId);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Pass changed uncommitted data back to Form Browser
|
||||
//
|
||||
HiiSetBrowserData (&mFileExplorerGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA), (UINT8 *) NvRamMap, NULL);
|
||||
|
||||
return Status;
|
||||
}
|
|
@ -1,223 +0,0 @@
|
|||
/** @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 FILE_EXPLORE_FORMSET_GUID \
|
||||
{ \
|
||||
0x1f2d63e1, 0xfebd, 0x4dc7, {0x9c, 0xc5, 0xba, 0x2b, 0x1c, 0xef, 0x9c, 0x5b} \
|
||||
}
|
||||
|
||||
#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_FILE_EXPLORER_ID 0x101E
|
||||
#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 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 MAXIMUM_NORMAL_KEY_VALUE 0x11FF
|
||||
|
||||
//
|
||||
// Varstore ID defined for Buffer Storage
|
||||
//
|
||||
#define VARSTORE_ID_BOOT_MAINT 0x1000
|
||||
#define VARSTORE_ID_FILE_EXPLORER 0x1001
|
||||
|
||||
//
|
||||
// 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;
|
||||
UINT16 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];
|
||||
//
|
||||
} BMM_FAKE_NV_DATA;
|
||||
|
||||
//
|
||||
// Key used by File Explorer forms
|
||||
//
|
||||
#define KEY_VALUE_SAVE_AND_EXIT_BOOT 0x1000
|
||||
#define KEY_VALUE_NO_SAVE_AND_EXIT_BOOT 0x1001
|
||||
#define KEY_VALUE_SAVE_AND_EXIT_DRIVER 0x1002
|
||||
#define KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER 0x1003
|
||||
|
||||
///
|
||||
/// This is the data structure used by File Explorer formset
|
||||
///
|
||||
typedef struct {
|
||||
UINT16 BootDescriptionData[MAX_MENU_NUMBER];
|
||||
UINT16 BootOptionalData[127];
|
||||
UINT16 DriverDescriptionData[MAX_MENU_NUMBER];
|
||||
UINT16 DriverOptionalData[127];
|
||||
BOOLEAN BootOptionChanged;
|
||||
BOOLEAN DriverOptionChanged;
|
||||
UINT8 Active;
|
||||
UINT8 ForceReconnect;
|
||||
} FILE_EXPLORER_NV_DATA;
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,399 +0,0 @@
|
|||
/** @file
|
||||
The platform boot manager reference implementation
|
||||
|
||||
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 "BootManager.h"
|
||||
|
||||
EFI_GUID mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID;
|
||||
CHAR16 *mDeviceTypeStr[] = {
|
||||
L"Legacy BEV",
|
||||
L"Legacy Floppy",
|
||||
L"Legacy Hard Drive",
|
||||
L"Legacy CD ROM",
|
||||
L"Legacy PCMCIA",
|
||||
L"Legacy USB",
|
||||
L"Legacy Embedded Network",
|
||||
L"Legacy Unknown Device"
|
||||
};
|
||||
|
||||
|
||||
HII_VENDOR_DEVICE_PATH mBootManagerHiiVendorDevicePath = {
|
||||
{
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
}
|
||||
},
|
||||
//
|
||||
// {1DDDBE15-481D-4d2b-8277-B191EAF66525}
|
||||
//
|
||||
{ 0x1dddbe15, 0x481d, 0x4d2b, { 0x82, 0x77, 0xb1, 0x91, 0xea, 0xf6, 0x65, 0x25 } }
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BOOT_MANAGER_CALLBACK_DATA gBootManagerPrivate = {
|
||||
BOOT_MANAGER_CALLBACK_DATA_SIGNATURE,
|
||||
NULL,
|
||||
NULL,
|
||||
{
|
||||
FakeExtractConfig,
|
||||
FakeRouteConfig,
|
||||
BootManagerCallback
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
This call back function is registered with Boot Manager formset.
|
||||
When user selects a boot option, this call back function will
|
||||
be triggered. The boot option is saved for later processing.
|
||||
|
||||
|
||||
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
|
||||
@param Action Specifies the type of action taken by the browser.
|
||||
@param QuestionId A unique value which is sent to the original exporting driver
|
||||
so that it can identify the type of data to expect.
|
||||
@param Type The type of value for the question.
|
||||
@param Value A pointer to the data being sent to the original exporting driver.
|
||||
@param ActionRequest On return, points to the action requested by the callback function.
|
||||
|
||||
@retval EFI_SUCCESS The callback successfully handled the action.
|
||||
@retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerCallback (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN EFI_BROWSER_ACTION Action,
|
||||
IN EFI_QUESTION_ID QuestionId,
|
||||
IN UINT8 Type,
|
||||
IN EFI_IFR_TYPE_VALUE *Value,
|
||||
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
||||
UINTN BootOptionCount;
|
||||
UINT16 KeyCount;
|
||||
EFI_INPUT_KEY Key;
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION Option;
|
||||
|
||||
if (Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||
//
|
||||
// Do nothing for other UEFI Action. Only do call back when data is changed.
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if ((Value == NULL) || (ActionRequest == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Initialize the key count
|
||||
//
|
||||
KeyCount = 0;
|
||||
Option.Attributes = 0;
|
||||
BootOption = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
|
||||
|
||||
for (Index = 0; Index < BootOptionCount; Index++) {
|
||||
KeyCount++;
|
||||
|
||||
EfiBootManagerInitializeLoadOption (
|
||||
&Option,
|
||||
BootOption[Index].OptionNumber,
|
||||
BootOption[Index].OptionType,
|
||||
BootOption[Index].Attributes,
|
||||
BootOption[Index].Description,
|
||||
BootOption[Index].FilePath,
|
||||
BootOption[Index].OptionalData,
|
||||
BootOption[Index].OptionalDataSize
|
||||
);
|
||||
|
||||
//
|
||||
// Is this device the one chosen?
|
||||
//
|
||||
if (KeyCount == QuestionId) {
|
||||
//
|
||||
// Clear the screen before.
|
||||
//
|
||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
||||
gST->ConOut->ClearScreen (gST->ConOut);
|
||||
//
|
||||
// Check any reset required change is applied? if yes, reset system
|
||||
//
|
||||
SetupResetReminder();
|
||||
//
|
||||
// Parse the selected option.
|
||||
//
|
||||
BdsSetConsoleMode(FALSE);
|
||||
EfiBootManagerBoot (&Option);
|
||||
BdsSetConsoleMode(TRUE);
|
||||
|
||||
if (EFI_ERROR (Option.Status)) {
|
||||
gST->ConOut->OutputString (
|
||||
gST->ConOut,
|
||||
GetStringById (STRING_TOKEN (STR_ANY_KEY_CONTINUE))
|
||||
);
|
||||
gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Register HII packages to HII database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InitializeBootManager (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (!gConnectAllHappened){
|
||||
EfiBootManagerConnectAll();
|
||||
gConnectAllHappened = TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// Install Device Path Protocol and Config Access protocol to driver handle
|
||||
//
|
||||
gBootManagerPrivate.DriverHandle = NULL;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&gBootManagerPrivate.DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mBootManagerHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&gBootManagerPrivate.ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Publish our HII data
|
||||
//
|
||||
gBootManagerPrivate.HiiHandle = HiiAddPackages (
|
||||
&mBootManagerGuid,
|
||||
gBootManagerPrivate.DriverHandle,
|
||||
BootManagerVfrBin,
|
||||
UiAppStrings,
|
||||
NULL
|
||||
);
|
||||
ASSERT(gBootManagerPrivate.HiiHandle != NULL);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Enumerate possible boot options.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EnumerateBootOptions (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN Index;
|
||||
EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
||||
UINTN BootOptionCount;
|
||||
EFI_STRING_ID Token;
|
||||
CHAR16 *HelpString;
|
||||
EFI_STRING_ID HelpToken;
|
||||
UINT16 *TempStr;
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
UINTN TempSize;
|
||||
VOID *StartOpCodeHandle;
|
||||
VOID *EndOpCodeHandle;
|
||||
EFI_IFR_GUID_LABEL *StartLabel;
|
||||
EFI_IFR_GUID_LABEL *EndLabel;
|
||||
UINT16 DeviceType;
|
||||
BOOLEAN IsLegacyOption;
|
||||
BOOLEAN NeedEndOp;
|
||||
UINT16 KeyInput;
|
||||
UINTN DestMax;
|
||||
|
||||
DeviceType = (UINT16) -1;
|
||||
|
||||
Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// for better user experience
|
||||
// 1. User changes HD configuration (e.g.: unplug HDD), here we have a chance to remove the HDD boot option
|
||||
// 2. User enables/disables UEFI PXE, here we have a chance to add/remove EFI Network boot option
|
||||
//
|
||||
EfiBootManagerRefreshAllBootOption ();
|
||||
|
||||
BootOption = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
|
||||
|
||||
HiiHandle = gBootManagerPrivate.HiiHandle;
|
||||
|
||||
//
|
||||
// Allocate space for creation of UpdateData Buffer
|
||||
//
|
||||
StartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||
ASSERT (StartOpCodeHandle != NULL);
|
||||
|
||||
EndOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||
ASSERT (EndOpCodeHandle != NULL);
|
||||
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the start opcode
|
||||
//
|
||||
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
StartLabel->Number = LABEL_BOOT_OPTION;
|
||||
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the end opcode
|
||||
//
|
||||
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
EndLabel->Number = LABEL_BOOT_OPTION_END;
|
||||
|
||||
KeyInput = 0;
|
||||
NeedEndOp = FALSE;
|
||||
for (Index = 0; Index < BootOptionCount; Index++) {
|
||||
//
|
||||
// At this stage we are creating a menu entry, thus the Keys are reproduceable
|
||||
//
|
||||
KeyInput++;
|
||||
|
||||
//
|
||||
// Don't display the hidden/inactive boot option
|
||||
//
|
||||
if (((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) || ((BootOption[Index].Attributes & LOAD_OPTION_ACTIVE) == 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Don't display myself
|
||||
//
|
||||
if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Group the legacy boot option in the sub title created dynamically
|
||||
//
|
||||
IsLegacyOption = (BOOLEAN) (
|
||||
(DevicePathType (BootOption[Index].FilePath) == BBS_DEVICE_PATH) &&
|
||||
(DevicePathSubType (BootOption[Index].FilePath) == BBS_BBS_DP)
|
||||
);
|
||||
|
||||
if (!IsLegacyOption && NeedEndOp) {
|
||||
NeedEndOp = FALSE;
|
||||
HiiCreateEndOpCode (StartOpCodeHandle);
|
||||
}
|
||||
|
||||
if (IsLegacyOption && DeviceType != ((BBS_BBS_DEVICE_PATH *) BootOption[Index].FilePath)->DeviceType) {
|
||||
if (NeedEndOp) {
|
||||
HiiCreateEndOpCode (StartOpCodeHandle);
|
||||
}
|
||||
|
||||
DeviceType = ((BBS_BBS_DEVICE_PATH *) BootOption[Index].FilePath)->DeviceType;
|
||||
Token = HiiSetString (
|
||||
HiiHandle,
|
||||
0,
|
||||
mDeviceTypeStr[
|
||||
MIN (DeviceType & 0xF, sizeof (mDeviceTypeStr) / sizeof (mDeviceTypeStr[0]) - 1)
|
||||
],
|
||||
NULL
|
||||
);
|
||||
HiiCreateSubTitleOpCode (StartOpCodeHandle, Token, 0, 0, 1);
|
||||
NeedEndOp = TRUE;
|
||||
}
|
||||
|
||||
ASSERT (BootOption[Index].Description != NULL);
|
||||
|
||||
Token = HiiSetString (HiiHandle, 0, BootOption[Index].Description, NULL);
|
||||
|
||||
TempStr = UiDevicePathToStr (BootOption[Index].FilePath);
|
||||
TempSize = StrSize (TempStr);
|
||||
DestMax = (TempSize + StrSize (L"Device Path : ")) / sizeof(CHAR16);
|
||||
HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : "));
|
||||
ASSERT (HelpString != NULL);
|
||||
StrCatS (HelpString, DestMax, L"Device Path : ");
|
||||
StrCatS (HelpString, DestMax, TempStr);
|
||||
|
||||
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);
|
||||
|
||||
HiiCreateActionOpCode (
|
||||
StartOpCodeHandle,
|
||||
KeyInput,
|
||||
Token,
|
||||
HelpToken,
|
||||
EFI_IFR_FLAG_CALLBACK,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
if (NeedEndOp) {
|
||||
HiiCreateEndOpCode (StartOpCodeHandle);
|
||||
}
|
||||
|
||||
HiiUpdateForm (
|
||||
HiiHandle,
|
||||
&mBootManagerGuid,
|
||||
BOOT_MANAGER_FORM_ID,
|
||||
StartOpCodeHandle,
|
||||
EndOpCodeHandle
|
||||
);
|
||||
|
||||
HiiFreeOpCodeHandle (StartOpCodeHandle);
|
||||
HiiFreeOpCodeHandle (EndOpCodeHandle);
|
||||
|
||||
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Remove the installed packages from the HII Database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
FreeBootManager (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
gBootManagerPrivate.DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mBootManagerHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&gBootManagerPrivate.ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
HiiRemovePackages (gBootManagerPrivate.HiiHandle);
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
/** @file
|
||||
The platform boot manager reference implement
|
||||
|
||||
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 _EFI_BOOT_MANAGER_H_
|
||||
#define _EFI_BOOT_MANAGER_H_
|
||||
|
||||
#include "Ui.h"
|
||||
#include "FrontPage.h"
|
||||
|
||||
//
|
||||
// These are defined as the same with vfr file
|
||||
//
|
||||
#define BOOT_MANAGER_FORMSET_GUID \
|
||||
{ \
|
||||
0x847bc3fe, 0xb974, 0x446d, {0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b} \
|
||||
}
|
||||
|
||||
#define BOOT_MANAGER_FORM_ID 0x1000
|
||||
|
||||
#define LABEL_BOOT_OPTION 0x00
|
||||
#define LABEL_BOOT_OPTION_END 0x01
|
||||
|
||||
//
|
||||
// These are the VFR compiler generated data representing our VFR data.
|
||||
//
|
||||
extern UINT8 BootManagerVfrBin[];
|
||||
|
||||
#define BOOT_MANAGER_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('B', 'M', 'C', 'B')
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
|
||||
//
|
||||
// HII relative handles
|
||||
//
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
EFI_HANDLE DriverHandle;
|
||||
|
||||
//
|
||||
// Produced protocols
|
||||
//
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
||||
} BOOT_MANAGER_CALLBACK_DATA;
|
||||
|
||||
/**
|
||||
This call back function is registered with Boot Manager formset.
|
||||
When user selects a boot option, this call back function will
|
||||
be triggered. The boot option is saved for later processing.
|
||||
|
||||
|
||||
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
|
||||
@param Action Specifies the type of action taken by the browser.
|
||||
@param QuestionId A unique value which is sent to the original exporting driver
|
||||
so that it can identify the type of data to expect.
|
||||
@param Type The type of value for the question.
|
||||
@param Value A pointer to the data being sent to the original exporting driver.
|
||||
@param ActionRequest On return, points to the action requested by the callback function.
|
||||
|
||||
@retval EFI_SUCCESS The callback successfully handled the action.
|
||||
@retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerCallback (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN EFI_BROWSER_ACTION Action,
|
||||
IN EFI_QUESTION_ID QuestionId,
|
||||
IN UINT8 Type,
|
||||
IN EFI_IFR_TYPE_VALUE *Value,
|
||||
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
|
||||
);
|
||||
|
||||
/**
|
||||
Register HII packages to HII database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InitializeBootManager (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Enumerate possible boot options.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EnumerateBootOptions (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Remove the installed packages from the HII Database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
FreeBootManager (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
Binary file not shown.
|
@ -1,50 +0,0 @@
|
|||
///** @file
|
||||
//
|
||||
// Browser 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.
|
||||
//
|
||||
//**/
|
||||
|
||||
#define FORMSET_GUID { 0x847bc3fe, 0xb974, 0x446d, 0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b }
|
||||
|
||||
#define BOOT_MANAGER_FORM_ID 0x1000
|
||||
|
||||
#define LABEL_BOOT_OPTION 0x00
|
||||
#define LABEL_BOOT_OPTION_END 0x01
|
||||
|
||||
#define BOOT_MANAGER_CLASS 0x00
|
||||
#define BOOT_MANAGER_SUBCLASS 0x00
|
||||
|
||||
formset
|
||||
guid = FORMSET_GUID,
|
||||
title = STRING_TOKEN(STR_BM_BANNER),
|
||||
help = STRING_TOKEN(STR_LAST_STRING),
|
||||
classguid = FORMSET_GUID,
|
||||
|
||||
form formid = BOOT_MANAGER_FORM_ID,
|
||||
title = STRING_TOKEN(STR_BM_BANNER);
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_LAST_STRING);
|
||||
subtitle text = STRING_TOKEN(STR_BOOT_OPTION_BANNER);
|
||||
subtitle text = STRING_TOKEN(STR_LAST_STRING);
|
||||
|
||||
//
|
||||
// This is where we will dynamically add choices for the Boot Manager
|
||||
//
|
||||
label LABEL_BOOT_OPTION;
|
||||
label LABEL_BOOT_OPTION_END;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_LAST_STRING);
|
||||
subtitle text = STRING_TOKEN(STR_HELP_FOOTER);
|
||||
|
||||
endform;
|
||||
|
||||
endformset;
|
|
@ -1,796 +0,0 @@
|
|||
/** @file
|
||||
The platform device manager reference implementation
|
||||
|
||||
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 "DeviceManager.h"
|
||||
|
||||
DEVICE_MANAGER_CALLBACK_DATA gDeviceManagerPrivate = {
|
||||
DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE,
|
||||
NULL,
|
||||
NULL,
|
||||
{
|
||||
FakeExtractConfig,
|
||||
FakeRouteConfig,
|
||||
DeviceManagerCallback
|
||||
}
|
||||
};
|
||||
|
||||
#define MAX_MAC_ADDRESS_NODE_LIST_LEN 10
|
||||
|
||||
EFI_GUID mDeviceManagerGuid = DEVICE_MANAGER_FORMSET_GUID;
|
||||
|
||||
//
|
||||
// Which Mac Address string is select
|
||||
// it will decide what menu need to show in the NETWORK_DEVICE_FORM_ID form.
|
||||
//
|
||||
EFI_STRING mSelectedMacAddrString;
|
||||
|
||||
//
|
||||
// The Mac Address show in the NETWORK_DEVICE_LIST_FORM_ID
|
||||
//
|
||||
MAC_ADDRESS_NODE_LIST mMacDeviceList;
|
||||
|
||||
DEVICE_MANAGER_MENU_ITEM mDeviceManagerMenuItemTable[] = {
|
||||
{ STRING_TOKEN (STR_DISK_DEVICE), EFI_DISK_DEVICE_CLASS },
|
||||
{ STRING_TOKEN (STR_VIDEO_DEVICE), EFI_VIDEO_DEVICE_CLASS },
|
||||
{ STRING_TOKEN (STR_NETWORK_DEVICE), EFI_NETWORK_DEVICE_CLASS },
|
||||
{ STRING_TOKEN (STR_INPUT_DEVICE), EFI_INPUT_DEVICE_CLASS },
|
||||
{ STRING_TOKEN (STR_ON_BOARD_DEVICE), EFI_ON_BOARD_DEVICE_CLASS },
|
||||
{ STRING_TOKEN (STR_OTHER_DEVICE), EFI_OTHER_DEVICE_CLASS }
|
||||
};
|
||||
|
||||
HII_VENDOR_DEVICE_PATH mDeviceManagerHiiVendorDevicePath = {
|
||||
{
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
}
|
||||
},
|
||||
//
|
||||
// {102579A0-3686-466e-ACD8-80C087044F4A}
|
||||
//
|
||||
{ 0x102579a0, 0x3686, 0x466e, { 0xac, 0xd8, 0x80, 0xc0, 0x87, 0x4, 0x4f, 0x4a } }
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
This function is invoked if user selected a interactive opcode from Device Manager's
|
||||
Formset. If user set VBIOS, the new value is saved to EFI variable.
|
||||
|
||||
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
|
||||
@param Action Specifies the type of action taken by the browser.
|
||||
@param QuestionId A unique value which is sent to the original exporting driver
|
||||
so that it can identify the type of data to expect.
|
||||
@param Type The type of value for the question.
|
||||
@param Value A pointer to the data being sent to the original exporting driver.
|
||||
@param ActionRequest On return, points to the action requested by the callback function.
|
||||
|
||||
@retval EFI_SUCCESS The callback successfully handled the action.
|
||||
@retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DeviceManagerCallback (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN EFI_BROWSER_ACTION Action,
|
||||
IN EFI_QUESTION_ID QuestionId,
|
||||
IN UINT8 Type,
|
||||
IN EFI_IFR_TYPE_VALUE *Value,
|
||||
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
|
||||
)
|
||||
{
|
||||
UINTN CurIndex;
|
||||
|
||||
if (Action != EFI_BROWSER_ACTION_CHANGING) {
|
||||
//
|
||||
// Do nothing for other UEFI Action. Only do call back when data is changed.
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if ((Value == NULL) || (ActionRequest == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {
|
||||
//
|
||||
// If user select the mac address, need to record mac address string to support next form show.
|
||||
//
|
||||
for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) {
|
||||
if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) {
|
||||
mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL);
|
||||
}
|
||||
}
|
||||
CreateDeviceManagerForm(NETWORK_DEVICE_FORM_ID);
|
||||
} else if(QuestionId == QUESTION_NETWORK_DEVICE_ID){
|
||||
CreateDeviceManagerForm(NETWORK_DEVICE_LIST_FORM_ID);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Get the mac address string from the device path.
|
||||
if the device path has the vlan, get the vanid also.
|
||||
|
||||
@param MacAddressNode Device path begin with mac address
|
||||
@param PBuffer Output string buffer contain mac address.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
GetMacAddressString(
|
||||
IN MAC_ADDR_DEVICE_PATH *MacAddressNode,
|
||||
OUT CHAR16 **PBuffer
|
||||
)
|
||||
{
|
||||
UINTN HwAddressSize;
|
||||
UINTN Index;
|
||||
UINT8 *HwAddress;
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node;
|
||||
UINT16 VlanId;
|
||||
CHAR16 *String;
|
||||
UINTN BufferLen;
|
||||
|
||||
VlanId = 0;
|
||||
String = NULL;
|
||||
ASSERT(MacAddressNode != NULL);
|
||||
|
||||
HwAddressSize = sizeof (EFI_MAC_ADDRESS);
|
||||
if (MacAddressNode->IfType == 0x01 || MacAddressNode->IfType == 0x00) {
|
||||
HwAddressSize = 6;
|
||||
}
|
||||
|
||||
//
|
||||
// The output format is MAC:XX:XX:XX:...\XXXX
|
||||
// The size is the Number size + ":" size + Vlan size(\XXXX) + End
|
||||
//
|
||||
BufferLen = (4 + 2 * HwAddressSize + (HwAddressSize - 1) + 5 + 1) * sizeof (CHAR16);
|
||||
String = AllocateZeroPool (BufferLen);
|
||||
if (String == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*PBuffer = String;
|
||||
StrCpyS(String, BufferLen / sizeof (CHAR16), L"MAC:");
|
||||
String += 4;
|
||||
|
||||
//
|
||||
// Convert the MAC address into a unicode string.
|
||||
//
|
||||
HwAddress = &MacAddressNode->MacAddress.Addr[0];
|
||||
for (Index = 0; Index < HwAddressSize; Index++) {
|
||||
String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, *(HwAddress++), 2);
|
||||
if (Index < HwAddressSize - 1) {
|
||||
*String++ = L':';
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// If VLAN is configured, it will need extra 5 characters like "\0005".
|
||||
// Plus one unicode character for the null-terminator.
|
||||
//
|
||||
Node = (EFI_DEVICE_PATH_PROTOCOL *)MacAddressNode;
|
||||
while (!IsDevicePathEnd (Node)) {
|
||||
if (Node->Type == MESSAGING_DEVICE_PATH && Node->SubType == MSG_VLAN_DP) {
|
||||
VlanId = ((VLAN_DEVICE_PATH *) Node)->VlanId;
|
||||
}
|
||||
Node = NextDevicePathNode (Node);
|
||||
}
|
||||
|
||||
if (VlanId != 0) {
|
||||
*String++ = L'\\';
|
||||
String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, VlanId, 4);
|
||||
}
|
||||
|
||||
//
|
||||
// Null terminate the Unicode string
|
||||
//
|
||||
*String = L'\0';
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Save question id and prompt id to the mac device list.
|
||||
If the same mac address has saved yet, no need to add more.
|
||||
|
||||
@param MacAddrString Mac address string.
|
||||
|
||||
@retval EFI_SUCCESS Add the item is successful.
|
||||
@return Other values if failed to Add the item.
|
||||
**/
|
||||
BOOLEAN
|
||||
AddIdToMacDeviceList (
|
||||
IN EFI_STRING MacAddrString
|
||||
)
|
||||
{
|
||||
MENU_INFO_ITEM *TempDeviceList;
|
||||
UINTN Index;
|
||||
EFI_STRING StoredString;
|
||||
EFI_STRING_ID PromptId;
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
|
||||
HiiHandle = gDeviceManagerPrivate.HiiHandle;
|
||||
TempDeviceList = NULL;
|
||||
|
||||
for (Index = 0; Index < mMacDeviceList.CurListLen; Index ++) {
|
||||
StoredString = HiiGetString (HiiHandle, mMacDeviceList.NodeList[Index].PromptId, NULL);
|
||||
if (StoredString == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Already has save the same mac address to the list.
|
||||
//
|
||||
if (StrCmp (MacAddrString, StoredString) == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
PromptId = HiiSetString(HiiHandle, 0, MacAddrString, NULL);
|
||||
//
|
||||
// If not in the list, save it.
|
||||
//
|
||||
if (mMacDeviceList.MaxListLen > mMacDeviceList.CurListLen + 1) {
|
||||
mMacDeviceList.NodeList[mMacDeviceList.CurListLen].PromptId = PromptId;
|
||||
mMacDeviceList.NodeList[mMacDeviceList.CurListLen].QuestionId = (EFI_QUESTION_ID) (mMacDeviceList.CurListLen + NETWORK_DEVICE_LIST_KEY_OFFSET);
|
||||
} else {
|
||||
mMacDeviceList.MaxListLen += MAX_MAC_ADDRESS_NODE_LIST_LEN;
|
||||
if (mMacDeviceList.CurListLen != 0) {
|
||||
TempDeviceList = (MENU_INFO_ITEM *)AllocateCopyPool (sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen, (VOID *)mMacDeviceList.NodeList);
|
||||
} else {
|
||||
TempDeviceList = (MENU_INFO_ITEM *)AllocatePool (sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen);
|
||||
}
|
||||
|
||||
if (TempDeviceList == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
TempDeviceList[mMacDeviceList.CurListLen].PromptId = PromptId;
|
||||
TempDeviceList[mMacDeviceList.CurListLen].QuestionId = (EFI_QUESTION_ID) (mMacDeviceList.CurListLen + NETWORK_DEVICE_LIST_KEY_OFFSET);
|
||||
|
||||
if (mMacDeviceList.CurListLen > 0) {
|
||||
FreePool(mMacDeviceList.NodeList);
|
||||
}
|
||||
|
||||
mMacDeviceList.NodeList = TempDeviceList;
|
||||
}
|
||||
mMacDeviceList.CurListLen ++;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Check the devcie path, try to find whether it has mac address path.
|
||||
|
||||
In this function, first need to check whether this path has mac address path.
|
||||
second, when the mac address device path has find, also need to deicide whether
|
||||
need to add this mac address relate info to the menu.
|
||||
|
||||
@param *Node Input device which need to be check.
|
||||
@param NextShowFormId FormId Which need to be show.
|
||||
@param *NeedAddItem Whether need to add the menu in the network device list.
|
||||
|
||||
@retval TRUE Has mac address device path.
|
||||
@retval FALSE NOT Has mac address device path.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsMacAddressDevicePath (
|
||||
IN VOID *Node,
|
||||
IN EFI_FORM_ID NextShowFormId,
|
||||
OUT BOOLEAN *NeedAddItem
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
CHAR16 *Buffer;
|
||||
BOOLEAN ReturnVal;
|
||||
|
||||
ASSERT (Node != NULL);
|
||||
*NeedAddItem = FALSE;
|
||||
ReturnVal = FALSE;
|
||||
Buffer = NULL;
|
||||
|
||||
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) Node;
|
||||
|
||||
//
|
||||
// find the partition device path node
|
||||
//
|
||||
while (!IsDevicePathEnd (DevicePath)) {
|
||||
if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
|
||||
(DevicePathSubType (DevicePath) == MSG_MAC_ADDR_DP)) {
|
||||
ReturnVal = TRUE;
|
||||
|
||||
if (DEVICE_MANAGER_FORM_ID == NextShowFormId) {
|
||||
*NeedAddItem = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!GetMacAddressString((MAC_ADDR_DEVICE_PATH*)DevicePath, &Buffer)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (NETWORK_DEVICE_FORM_ID == NextShowFormId) {
|
||||
if (StrCmp (Buffer, mSelectedMacAddrString) == 0) {
|
||||
*NeedAddItem = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (NETWORK_DEVICE_LIST_FORM_ID == NextShowFormId) {
|
||||
//
|
||||
// Same handle may has two network child handle, so the questionid
|
||||
// has the offset of SAME_HANDLE_KEY_OFFSET.
|
||||
//
|
||||
if (AddIdToMacDeviceList (Buffer)) {
|
||||
*NeedAddItem = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
DevicePath = NextDevicePathNode (DevicePath);
|
||||
}
|
||||
|
||||
if (Buffer != NULL) {
|
||||
FreePool (Buffer);
|
||||
}
|
||||
|
||||
return ReturnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
Check to see if the device path is for the network device.
|
||||
|
||||
@param Handle The HII handle which include the mac address device path.
|
||||
@param NextShowFormId The FormId of the form which will be show next time.
|
||||
@param ItemCount The new add Mac address item count.
|
||||
|
||||
@retval TRUE Need to add new item in the menu.
|
||||
@return FALSE Do not need to add the menu about the network.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsNeedAddNetworkMenu (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_FORM_ID NextShowFormId,
|
||||
OUT UINTN *ItemCount
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN EntryCount;
|
||||
UINTN Index;
|
||||
EFI_HII_HANDLE HiiDeviceManagerHandle;
|
||||
EFI_HANDLE DriverHandle;
|
||||
EFI_HANDLE ControllerHandle;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *TmpDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *ChildDevicePath;
|
||||
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
|
||||
BOOLEAN IsNeedAdd;
|
||||
|
||||
HiiDeviceManagerHandle = gDeviceManagerPrivate.HiiHandle;
|
||||
IsNeedAdd = FALSE;
|
||||
OpenInfoBuffer = NULL;
|
||||
if ((Handle == NULL) || (ItemCount == NULL)) {
|
||||
return FALSE;
|
||||
}
|
||||
*ItemCount = 0;
|
||||
|
||||
Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
//
|
||||
// Get the device path by the got Driver handle .
|
||||
//
|
||||
Status = gBS->HandleProtocol (DriverHandle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
TmpDevicePath = DevicePath;
|
||||
|
||||
//
|
||||
// Check whether this device path include mac address device path.
|
||||
// If this path has mac address path, get the value whether need
|
||||
// add this info to the menu and return.
|
||||
// Else check more about the child handle devcie path.
|
||||
//
|
||||
if (IsMacAddressDevicePath(TmpDevicePath, NextShowFormId,&IsNeedAdd)) {
|
||||
if ((NETWORK_DEVICE_LIST_FORM_ID == NextShowFormId) && IsNeedAdd) {
|
||||
(*ItemCount) = 1;
|
||||
}
|
||||
return IsNeedAdd;
|
||||
}
|
||||
|
||||
//
|
||||
// Search whether this path is the controller path, not he child handle path.
|
||||
// And the child handle has the network devcie connected.
|
||||
//
|
||||
TmpDevicePath = DevicePath;
|
||||
Status = gBS->LocateDevicePath(&gEfiDevicePathProtocolGuid, &TmpDevicePath, &ControllerHandle);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!IsDevicePathEnd (TmpDevicePath)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve the list of agents that are consuming the specific protocol
|
||||
// on ControllerHandle.
|
||||
// The buffer point by OpenInfoBuffer need be free at this function.
|
||||
//
|
||||
Status = gBS->OpenProtocolInformation (
|
||||
ControllerHandle,
|
||||
&gEfiPciIoProtocolGuid,
|
||||
&OpenInfoBuffer,
|
||||
&EntryCount
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Inspect if ChildHandle is one of the agents.
|
||||
//
|
||||
Status = EFI_UNSUPPORTED;
|
||||
for (Index = 0; Index < EntryCount; Index++) {
|
||||
//
|
||||
// Query all the children created by the controller handle's driver
|
||||
//
|
||||
if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
||||
Status = gBS->OpenProtocol (
|
||||
OpenInfoBuffer[Index].ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &ChildDevicePath,
|
||||
NULL,
|
||||
NULL,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Check whether this device path include mac address device path.
|
||||
//
|
||||
if (!IsMacAddressDevicePath(ChildDevicePath, NextShowFormId,&IsNeedAdd)) {
|
||||
//
|
||||
// If this path not has mac address path, check the other.
|
||||
//
|
||||
continue;
|
||||
} else {
|
||||
//
|
||||
// If need to update the NETWORK_DEVICE_LIST_FORM, try to get more.
|
||||
//
|
||||
if ((NETWORK_DEVICE_LIST_FORM_ID == NextShowFormId)) {
|
||||
if (IsNeedAdd) {
|
||||
(*ItemCount) += 1;
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
//
|
||||
// If need to update other form, return whether need to add to the menu.
|
||||
//
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Done:
|
||||
if (OpenInfoBuffer != NULL) {
|
||||
FreePool (OpenInfoBuffer);
|
||||
}
|
||||
return IsNeedAdd;
|
||||
}
|
||||
|
||||
/**
|
||||
This function registers HII packages to HII database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InitializeDeviceManager (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (!gConnectAllHappened){
|
||||
EfiBootManagerConnectAll();
|
||||
gConnectAllHappened = TRUE;
|
||||
}
|
||||
|
||||
gDeviceManagerPrivate.DriverHandle = NULL;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&gDeviceManagerPrivate.DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mDeviceManagerHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&gDeviceManagerPrivate.ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Publish our HII data.
|
||||
//
|
||||
gDeviceManagerPrivate.HiiHandle = HiiAddPackages (
|
||||
&mDeviceManagerGuid,
|
||||
gDeviceManagerPrivate.DriverHandle,
|
||||
DeviceManagerVfrBin,
|
||||
UiAppStrings,
|
||||
NULL
|
||||
);
|
||||
ASSERT (gDeviceManagerPrivate.HiiHandle != NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the installed packages from the HII Database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
FreeDeviceManager(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
gDeviceManagerPrivate.DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mDeviceManagerHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&gDeviceManagerPrivate.ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
HiiRemovePackages (gDeviceManagerPrivate.HiiHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
Dynamic create Hii information for Device Manager.
|
||||
|
||||
@param NextShowFormId The FormId which need to be show.
|
||||
|
||||
**/
|
||||
VOID
|
||||
CreateDeviceManagerForm(
|
||||
IN EFI_FORM_ID NextShowFormId
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
EFI_STRING String;
|
||||
EFI_STRING_ID Token;
|
||||
EFI_STRING_ID TokenHelp;
|
||||
EFI_HII_HANDLE *HiiHandles;
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
UINTN SkipCount;
|
||||
EFI_STRING_ID FormSetTitle;
|
||||
EFI_STRING_ID FormSetHelp;
|
||||
EFI_GUID FormSetGuid;
|
||||
VOID *StartOpCodeHandle;
|
||||
VOID *EndOpCodeHandle;
|
||||
EFI_IFR_GUID_LABEL *StartLabel;
|
||||
EFI_IFR_GUID_LABEL *EndLabel;
|
||||
BOOLEAN AddNetworkMenu;
|
||||
UINTN AddItemCount;
|
||||
UINTN NewStringLen;
|
||||
EFI_STRING NewStringTitle;
|
||||
CHAR16 *DevicePathStr;
|
||||
EFI_STRING_ID DevicePathId;
|
||||
|
||||
HiiHandle = gDeviceManagerPrivate.HiiHandle;
|
||||
AddNetworkMenu = FALSE;
|
||||
AddItemCount = 0;
|
||||
|
||||
//
|
||||
// If need show the Network device list form, clear the old save list first.
|
||||
//
|
||||
if ((NextShowFormId == NETWORK_DEVICE_LIST_FORM_ID) && (mMacDeviceList.CurListLen > 0)) {
|
||||
mMacDeviceList.CurListLen = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Update the network device form titile.
|
||||
//
|
||||
if (NextShowFormId == NETWORK_DEVICE_FORM_ID) {
|
||||
String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NULL);
|
||||
NewStringLen = StrLen(mSelectedMacAddrString) * 2;
|
||||
NewStringLen += (StrLen(String) + 2) * 2;
|
||||
NewStringTitle = AllocatePool (NewStringLen);
|
||||
UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString);
|
||||
HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL);
|
||||
FreePool (String);
|
||||
FreePool (NewStringTitle);
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate space for creation of UpdateData Buffer
|
||||
//
|
||||
StartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||
ASSERT (StartOpCodeHandle != NULL);
|
||||
|
||||
EndOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||
ASSERT (EndOpCodeHandle != NULL);
|
||||
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the start opcode
|
||||
//
|
||||
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
//
|
||||
// According to the next show Form id(mNextShowFormId) to decide which form need to update.
|
||||
//
|
||||
StartLabel->Number = (UINT16) (LABEL_FORM_ID_OFFSET + NextShowFormId);
|
||||
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the end opcode
|
||||
//
|
||||
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
EndLabel->Number = LABEL_END;
|
||||
|
||||
//
|
||||
// Get all the Hii handles
|
||||
//
|
||||
HiiHandles = HiiGetHiiHandles (NULL);
|
||||
ASSERT (HiiHandles != NULL);
|
||||
|
||||
//
|
||||
// Search for formset of each class type
|
||||
//
|
||||
SkipCount = 0;
|
||||
for (Index = 0; HiiHandles[Index] != NULL; Index++) {
|
||||
//
|
||||
// The QuestionId in the form which will call the driver form has this asssumption.
|
||||
// QuestionId = Handle Index + NETWORK_DEVICE_LIST_KEY_OFFSET;
|
||||
// Different QuestionId at least has the section of NETWORK_DEVICE_LIST_KEY_OFFSET.
|
||||
//
|
||||
ASSERT(Index < MAX_KEY_SECTION_LEN);
|
||||
if (!ExtractDisplayedHiiFormFromHiiHandle (HiiHandles[Index], &gEfiHiiPlatformSetupFormsetGuid, SkipCount, &FormSetTitle, &FormSetHelp, &FormSetGuid)) {
|
||||
SkipCount = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
String = HiiGetString (HiiHandles[Index], FormSetTitle, NULL);
|
||||
if (String == NULL) {
|
||||
String = HiiGetString (HiiHandle, STR_MISSING_STRING, NULL);
|
||||
ASSERT (String != NULL);
|
||||
}
|
||||
Token = HiiSetString (HiiHandle, 0, String, NULL);
|
||||
FreePool (String);
|
||||
|
||||
String = HiiGetString (HiiHandles[Index], FormSetHelp, NULL);
|
||||
if (String == NULL) {
|
||||
String = HiiGetString (HiiHandle, STR_MISSING_STRING, NULL);
|
||||
ASSERT (String != NULL);
|
||||
}
|
||||
TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);
|
||||
FreePool (String);
|
||||
|
||||
//
|
||||
// Network device process
|
||||
//
|
||||
if (IsNeedAddNetworkMenu (HiiHandles[Index], NextShowFormId,&AddItemCount)) {
|
||||
if (NextShowFormId == DEVICE_MANAGER_FORM_ID) {
|
||||
//
|
||||
// Only show one menu item "Network Config" in the device manger form.
|
||||
//
|
||||
if (!AddNetworkMenu) {
|
||||
AddNetworkMenu = TRUE;
|
||||
HiiCreateGotoOpCode (
|
||||
StartOpCodeHandle,
|
||||
NETWORK_DEVICE_LIST_FORM_ID,
|
||||
STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_TITLE),
|
||||
STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_HELP),
|
||||
EFI_IFR_FLAG_CALLBACK,
|
||||
(EFI_QUESTION_ID) QUESTION_NETWORK_DEVICE_ID
|
||||
);
|
||||
}
|
||||
} else if (NextShowFormId == NETWORK_DEVICE_LIST_FORM_ID) {
|
||||
//
|
||||
// In network device list form, same mac address device only show one menu.
|
||||
//
|
||||
while (AddItemCount > 0) {
|
||||
HiiCreateGotoOpCode (
|
||||
StartOpCodeHandle,
|
||||
NETWORK_DEVICE_FORM_ID,
|
||||
mMacDeviceList.NodeList[mMacDeviceList.CurListLen - AddItemCount].PromptId,
|
||||
STRING_TOKEN (STR_NETWORK_DEVICE_HELP),
|
||||
EFI_IFR_FLAG_CALLBACK,
|
||||
mMacDeviceList.NodeList[mMacDeviceList.CurListLen - AddItemCount].QuestionId
|
||||
);
|
||||
AddItemCount -= 1;
|
||||
}
|
||||
} else if (NextShowFormId == NETWORK_DEVICE_FORM_ID) {
|
||||
//
|
||||
// In network device form, only the selected mac address device need to be show.
|
||||
//
|
||||
DevicePathStr = ExtractDevicePathFromHiiHandle(HiiHandles[Index]);
|
||||
DevicePathId = 0;
|
||||
if (DevicePathStr != NULL){
|
||||
DevicePathId = HiiSetString (HiiHandle, 0, DevicePathStr, NULL);
|
||||
FreePool(DevicePathStr);
|
||||
}
|
||||
HiiCreateGotoExOpCode (
|
||||
StartOpCodeHandle,
|
||||
0,
|
||||
Token,
|
||||
TokenHelp,
|
||||
0,
|
||||
(EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),
|
||||
0,
|
||||
&FormSetGuid,
|
||||
DevicePathId
|
||||
);
|
||||
}
|
||||
} else {
|
||||
//
|
||||
//
|
||||
// Not network device process, only need to show at device manger form.
|
||||
//
|
||||
if (NextShowFormId == DEVICE_MANAGER_FORM_ID) {
|
||||
DevicePathStr = ExtractDevicePathFromHiiHandle(HiiHandles[Index]);
|
||||
DevicePathId = 0;
|
||||
if (DevicePathStr != NULL){
|
||||
DevicePathId = HiiSetString (HiiHandle, 0, DevicePathStr, NULL);
|
||||
FreePool(DevicePathStr);
|
||||
}
|
||||
HiiCreateGotoExOpCode (
|
||||
StartOpCodeHandle,
|
||||
0,
|
||||
Token,
|
||||
TokenHelp,
|
||||
0,
|
||||
(EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),
|
||||
0,
|
||||
&FormSetGuid,
|
||||
DevicePathId
|
||||
);
|
||||
}
|
||||
}
|
||||
//
|
||||
//One packagelist may has more than one form package,
|
||||
//Index-- means keep current HiiHandle and still extract from the packagelist,
|
||||
//SkipCount++ means skip the formset which was found before in the same form package.
|
||||
//
|
||||
SkipCount++;
|
||||
Index--;
|
||||
}
|
||||
|
||||
HiiUpdateForm (
|
||||
HiiHandle,
|
||||
&mDeviceManagerGuid,
|
||||
NextShowFormId,
|
||||
StartOpCodeHandle,
|
||||
EndOpCodeHandle
|
||||
);
|
||||
|
||||
HiiFreeOpCodeHandle (StartOpCodeHandle);
|
||||
HiiFreeOpCodeHandle (EndOpCodeHandle);
|
||||
FreePool (HiiHandles);
|
||||
}
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
/** @file
|
||||
The platform device manager reference implement
|
||||
|
||||
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 _DEVICE_MANAGER_H_
|
||||
#define _DEVICE_MANAGER_H_
|
||||
|
||||
#include "Ui.h"
|
||||
#include "FrontPage.h"
|
||||
#include <Protocol/PciIo.h>
|
||||
|
||||
//
|
||||
// These are defined as the same with vfr file
|
||||
//
|
||||
#define DEVICE_MANAGER_FORMSET_GUID \
|
||||
{ \
|
||||
0x3ebfa8e6, 0x511d, 0x4b5b, {0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27} \
|
||||
}
|
||||
|
||||
#define LABEL_DEVICES_LIST 0x1100
|
||||
#define LABEL_NETWORK_DEVICE_LIST_ID 0x1101
|
||||
#define LABEL_NETWORK_DEVICE_ID 0x1102
|
||||
#define LABEL_END 0xffff
|
||||
#define LABEL_FORM_ID_OFFSET 0x0100
|
||||
|
||||
#define LABEL_VBIOS 0x0040
|
||||
|
||||
#define DEVICE_MANAGER_FORM_ID 0x1000
|
||||
#define NETWORK_DEVICE_LIST_FORM_ID 0x1001
|
||||
#define NETWORK_DEVICE_FORM_ID 0x1002
|
||||
#define DEVICE_KEY_OFFSET 0x4000
|
||||
#define NETWORK_DEVICE_LIST_KEY_OFFSET 0x2000
|
||||
#define DEVICE_MANAGER_KEY_VBIOS 0x3000
|
||||
#define MAX_KEY_SECTION_LEN 0x1000
|
||||
|
||||
#define QUESTION_NETWORK_DEVICE_ID 0x3FFF
|
||||
//
|
||||
// These are the VFR compiler generated data representing our VFR data.
|
||||
//
|
||||
extern UINT8 DeviceManagerVfrBin[];
|
||||
|
||||
#define DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('D', 'M', 'C', 'B')
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
|
||||
///
|
||||
/// Device Manager HII relative handles
|
||||
///
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
|
||||
EFI_HANDLE DriverHandle;
|
||||
|
||||
///
|
||||
/// Device Manager Produced protocols
|
||||
///
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
||||
|
||||
///
|
||||
/// Configuration data
|
||||
///
|
||||
UINT8 VideoBios;
|
||||
} DEVICE_MANAGER_CALLBACK_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_STRING_ID PromptId;
|
||||
EFI_QUESTION_ID QuestionId;
|
||||
}MENU_INFO_ITEM;
|
||||
|
||||
typedef struct {
|
||||
UINTN CurListLen;
|
||||
UINTN MaxListLen;
|
||||
MENU_INFO_ITEM *NodeList;
|
||||
} MAC_ADDRESS_NODE_LIST;
|
||||
|
||||
#define DEVICE_MANAGER_CALLBACK_DATA_FROM_THIS(a) \
|
||||
CR (a, \
|
||||
DEVICE_MANAGER_CALLBACK_DATA, \
|
||||
ConfigAccess, \
|
||||
DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE \
|
||||
)
|
||||
typedef struct {
|
||||
EFI_STRING_ID StringId;
|
||||
UINT16 Class;
|
||||
} DEVICE_MANAGER_MENU_ITEM;
|
||||
|
||||
/**
|
||||
This function is invoked if user selected a interactive opcode from Device Manager's
|
||||
Formset. If user set VBIOS, the new value is saved to EFI variable.
|
||||
|
||||
|
||||
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
|
||||
@param Action Specifies the type of action taken by the browser.
|
||||
@param QuestionId A unique value which is sent to the original exporting driver
|
||||
so that it can identify the type of data to expect.
|
||||
@param Type The type of value for the question.
|
||||
@param Value A pointer to the data being sent to the original exporting driver.
|
||||
@param ActionRequest On return, points to the action requested by the callback function.
|
||||
|
||||
@retval EFI_SUCCESS The callback successfully handled the action.
|
||||
@retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DeviceManagerCallback (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN EFI_BROWSER_ACTION Action,
|
||||
IN EFI_QUESTION_ID QuestionId,
|
||||
IN UINT8 Type,
|
||||
IN EFI_IFR_TYPE_VALUE *Value,
|
||||
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
|
||||
);
|
||||
|
||||
/**
|
||||
This function registers HII packages to HII database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InitializeDeviceManager (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Remove the installed packages from the HII Database.
|
||||
|
||||
**/
|
||||
VOID
|
||||
FreeDeviceManager(
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Dynamic create Hii information for Device Manager.
|
||||
|
||||
@param NextShowFormId The FormId which need to be show.
|
||||
|
||||
**/
|
||||
VOID
|
||||
CreateDeviceManagerForm(
|
||||
IN EFI_FORM_ID NextShowFormId
|
||||
);
|
||||
|
||||
#endif
|
Binary file not shown.
|
@ -1,102 +0,0 @@
|
|||
///** @file
|
||||
//
|
||||
// Device Manager 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.
|
||||
//
|
||||
//**/
|
||||
|
||||
#define FORMSET_GUID { 0x3ebfa8e6, 0x511d, 0x4b5b, 0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27 }
|
||||
|
||||
#define EFI_DISK_DEVICE_CLASS 0x0001
|
||||
#define EFI_VIDEO_DEVICE_CLASS 0x0002
|
||||
#define EFI_NETWORK_DEVICE_CLASS 0x0004
|
||||
#define EFI_INPUT_DEVICE_CLASS 0x0008
|
||||
#define EFI_ON_BOARD_DEVICE_CLASS 0x0010
|
||||
#define EFI_OTHER_DEVICE_CLASS 0x0020
|
||||
#define LABEL_VBIOS 0x0040
|
||||
#define LABEL_DEVICES_LIST 0x1100
|
||||
#define LABEL_NETWORK_DEVICE_LIST_ID 0x1101
|
||||
#define LABEL_NETWORK_DEVICE_ID 0x1102
|
||||
#define LABEL_END 0xffff
|
||||
|
||||
#define DEVICE_MANAGER_CLASS 0x0000
|
||||
#define FRONT_PAGE_SUBCLASS 0x0003
|
||||
|
||||
#define DEVICE_MANAGER_FORM_ID 0x1000
|
||||
#define NETWORK_DEVICE_LIST_FORM_ID 0x1001
|
||||
#define NETWORK_DEVICE_FORM_ID 0x1002
|
||||
|
||||
formset
|
||||
guid = FORMSET_GUID,
|
||||
title = STRING_TOKEN(STR_EDKII_MENU_TITLE),
|
||||
help = STRING_TOKEN(STR_EMPTY_STRING),
|
||||
classguid = FORMSET_GUID,
|
||||
|
||||
form formid = DEVICE_MANAGER_FORM_ID,
|
||||
title = STRING_TOKEN(STR_EDKII_MENU_TITLE);
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_DEVICES_LIST);
|
||||
//
|
||||
// This is where devices get added to the device manager hierarchy
|
||||
//
|
||||
label EFI_DISK_DEVICE_CLASS;
|
||||
// label LABEL_END; // Since next opcode is a label, so this one could be omitted to save code size
|
||||
|
||||
label EFI_VIDEO_DEVICE_CLASS;
|
||||
// label LABEL_END;
|
||||
|
||||
label EFI_NETWORK_DEVICE_CLASS;
|
||||
// label LABEL_END;
|
||||
|
||||
label EFI_INPUT_DEVICE_CLASS;
|
||||
// label LABEL_END;
|
||||
|
||||
label EFI_ON_BOARD_DEVICE_CLASS;
|
||||
// label LABEL_END;
|
||||
|
||||
// label EFI_OTHER_DEVICE_CLASS;
|
||||
|
||||
label LABEL_DEVICES_LIST;
|
||||
label LABEL_END;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_EMPTY_STRING);
|
||||
|
||||
label LABEL_VBIOS;
|
||||
label LABEL_END;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_EMPTY_STRING);
|
||||
subtitle text = STRING_TOKEN(STR_EXIT_STRING);
|
||||
|
||||
endform;
|
||||
|
||||
form formid = NETWORK_DEVICE_LIST_FORM_ID,
|
||||
title = STRING_TOKEN(STR_FORM_NETWORK_DEVICE_LIST_TITLE);
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_NETWORK_DEVICE_LIST_STRING);
|
||||
|
||||
label LABEL_NETWORK_DEVICE_LIST_ID;
|
||||
label LABEL_END;
|
||||
subtitle text = STRING_TOKEN(STR_EMPTY_STRING);
|
||||
subtitle text = STRING_TOKEN(STR_EXIT_STRING);
|
||||
endform;
|
||||
|
||||
form formid = NETWORK_DEVICE_FORM_ID,
|
||||
title = STRING_TOKEN(STR_FORM_NETWORK_DEVICE_TITLE);
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_NETWORK_DEVICE_STRING);
|
||||
|
||||
label LABEL_NETWORK_DEVICE_ID;
|
||||
label LABEL_END;
|
||||
subtitle text = STRING_TOKEN(STR_EMPTY_STRING);
|
||||
subtitle text = STRING_TOKEN(STR_EXIT_STRING);
|
||||
endform;
|
||||
endformset;
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
///** @file
|
||||
//
|
||||
// Driver Health 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.
|
||||
//
|
||||
//**/
|
||||
|
||||
#define DRIVER_HEALTH_FORMSET_GUID { 0xf76e0a70, 0xb5ed, 0x4c38, 0xac, 0x9a, 0xe5, 0xf5, 0x4b, 0xf1, 0x6e, 0x34 }
|
||||
|
||||
#define LABEL_DRIVER_HEALTH 0x2000
|
||||
#define LABEL_DRIVER_HEALTH_END 0x2001
|
||||
#define LABEL_DRIVER_HEALTH_REAPIR_ALL 0x3000
|
||||
#define LABEL_DRIVER_HEALTH_REAPIR_ALL_END 0x3001
|
||||
|
||||
#define DRIVER_HEALTH_FORM_ID 0x1003
|
||||
|
||||
formset
|
||||
guid = DRIVER_HEALTH_FORMSET_GUID,
|
||||
title = STRING_TOKEN(STR_DH_BANNER),
|
||||
help = STRING_TOKEN(STR_EMPTY_STRING),
|
||||
classguid = DRIVER_HEALTH_FORMSET_GUID,
|
||||
|
||||
form formid = DRIVER_HEALTH_FORM_ID,
|
||||
title = STRING_TOKEN(STR_DH_BANNER);
|
||||
|
||||
label LABEL_DRIVER_HEALTH;
|
||||
label LABEL_DRIVER_HEALTH_END;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_LAST_STRING);
|
||||
label LABEL_DRIVER_HEALTH_REAPIR_ALL;
|
||||
label LABEL_DRIVER_HEALTH_REAPIR_ALL_END;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_LAST_STRING);
|
||||
subtitle text = STRING_TOKEN(STR_HELP_FOOTER);
|
||||
subtitle text = STRING_TOKEN(STR_LAST_STRING);
|
||||
endform;
|
||||
endformset;
|
|
@ -1,51 +0,0 @@
|
|||
/** @file
|
||||
FrontPage routines to handle the callbacks and browser calls
|
||||
|
||||
Copyright (c) 2013 - 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 _FORMSET_GUID_H_
|
||||
#define _FORMSET_GUID_H_
|
||||
|
||||
#include "BootMaint/FormGuid.h"
|
||||
|
||||
#define FRONT_PAGE_FORMSET_GUID { 0x9e0c30bc, 0x3f06, 0x4ba6, 0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }
|
||||
|
||||
// Used by Boot manager form
|
||||
#define BOOT_MANAGER_FORMSET_GUID { 0x847bc3fe, 0xb974, 0x446d, 0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b }
|
||||
|
||||
#define BOOT_MANAGER_FORM_ID 0x1000
|
||||
|
||||
|
||||
// Used by Device manager form.
|
||||
#define DEVICE_MANAGER_FORMSET_GUID { 0x3ebfa8e6, 0x511d, 0x4b5b, 0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27 }
|
||||
|
||||
#define DEVICE_MANAGER_FORM_ID 0x2000
|
||||
#define NETWORK_DEVICE_LIST_FORM_ID 0x2001
|
||||
#define NETWORK_DEVICE_FORM_ID 0x2002
|
||||
|
||||
#define DEVICE_KEY_OFFSET 0x2000
|
||||
#define NETWORK_DEVICE_LIST_KEY_OFFSET 0x2100
|
||||
#define MAX_KEY_SECTION_LEN 0x0100
|
||||
|
||||
#define QUESTION_NETWORK_DEVICE_ID 0x2FFF
|
||||
|
||||
#define LABEL_DEVICES_LIST 0x2100
|
||||
#define LABEL_NETWORK_DEVICE_LIST_ID 0x2101
|
||||
#define LABEL_NETWORK_DEVICE_ID 0x2102
|
||||
#define LABEL_END 0xffff
|
||||
#define LABEL_FORM_ID_OFFSET 0x0100
|
||||
#define LABEL_VBIOS 0x0040
|
||||
|
||||
|
||||
#endif
|
|
@ -16,12 +16,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include "Language.h"
|
||||
#define MAX_STRING_LEN 200
|
||||
|
||||
EFI_GUID mFrontPageGuid = FRONT_PAGE_FORMSET_GUID;
|
||||
EFI_GUID mFrontPageGuid = FRONT_PAGE_FORMSET_GUID;
|
||||
|
||||
BOOLEAN gConnectAllHappened = FALSE;
|
||||
BOOLEAN mFeaturerSwitch = TRUE;
|
||||
BOOLEAN mResetRequired = FALSE;
|
||||
BOOLEAN mEnterBmm = FALSE;
|
||||
|
||||
EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;
|
||||
CHAR8 *mLanguageString;
|
||||
|
@ -153,14 +152,7 @@ FakeRouteConfig (
|
|||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*Progress = Configuration;
|
||||
if (!HiiIsConfigHdrMatch (Configuration, &mBootMaintGuid, mBootMaintStorageName)
|
||||
&& !HiiIsConfigHdrMatch (Configuration, &mFileExplorerGuid, mFileExplorerStorageName)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
*Progress = Configuration + StrLen (Configuration);
|
||||
return EFI_SUCCESS;
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -381,17 +373,7 @@ FrontPageCallback (
|
|||
UINTN Index;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
//Chech whether exit from BMM and reenter frontpage,if yes,reclaim string depositories
|
||||
//
|
||||
if (Action == EFI_BROWSER_ACTION_FORM_OPEN){
|
||||
if (mEnterBmm){
|
||||
ReclaimStringDepository();
|
||||
mEnterBmm = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||
if (Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||
//
|
||||
// Do nothing for other UEFI Action. Only do call back when data is changed.
|
||||
//
|
||||
|
@ -449,42 +431,6 @@ FrontPageCallback (
|
|||
InitializeLanguage();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||
if (Value == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// The first 4 entries in the Front Page are to be GUARANTEED to remain constant so IHV's can
|
||||
// describe to their customers in documentation how to find their setup information (namely
|
||||
// under the device manager and specific buckets)
|
||||
//
|
||||
switch (QuestionId) {
|
||||
case FRONT_PAGE_KEY_BOOT_MANAGER:
|
||||
//
|
||||
// Boot Manager
|
||||
//
|
||||
EnumerateBootOptions ();
|
||||
break;
|
||||
|
||||
case FRONT_PAGE_KEY_DEVICE_MANAGER:
|
||||
//
|
||||
// Device Manager
|
||||
//
|
||||
CreateDeviceManagerForm(DEVICE_MANAGER_FORM_ID);
|
||||
break;
|
||||
|
||||
case FRONT_PAGE_KEY_BOOT_MAINTAIN:
|
||||
//
|
||||
// Boot Maintenance Manager
|
||||
//
|
||||
InitializeBM ();
|
||||
mEnterBmm = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -493,6 +439,157 @@ FrontPageCallback (
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Update front page form base on the ClassGuid in the formset in other modules.
|
||||
|
||||
**/
|
||||
VOID
|
||||
UpdateFrontPageForm (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
VOID *StartOpCodeHandle;
|
||||
VOID *EndOpCodeHandle;
|
||||
EFI_IFR_GUID_LABEL *StartLabel;
|
||||
EFI_IFR_GUID_LABEL *EndLabel;
|
||||
UINTN Index;
|
||||
EFI_STRING String;
|
||||
EFI_STRING_ID Token;
|
||||
EFI_STRING_ID TokenHelp;
|
||||
EFI_HII_HANDLE *HiiHandles;
|
||||
EFI_GUID FormSetGuid;
|
||||
CHAR16 *DevicePathStr;
|
||||
EFI_STRING_ID DevicePathId;
|
||||
EFI_IFR_FORM_SET *Buffer;
|
||||
UINTN BufferSize;
|
||||
UINT8 ClassGuidNum;
|
||||
EFI_GUID *ClassGuid;
|
||||
UINTN TempSize;
|
||||
UINT8 *Ptr;
|
||||
|
||||
TempSize =0;
|
||||
BufferSize = 0;
|
||||
Buffer = NULL;
|
||||
|
||||
HiiHandle = gFrontPagePrivate.HiiHandle;
|
||||
|
||||
//
|
||||
// Allocate space for creation of UpdateData Buffer
|
||||
//
|
||||
StartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||
ASSERT (StartOpCodeHandle != NULL);
|
||||
|
||||
EndOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||
ASSERT (EndOpCodeHandle != NULL);
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the start opcode
|
||||
//
|
||||
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
StartLabel->Number = LABEL_PLATFORM_INFORMATION;
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the end opcode
|
||||
//
|
||||
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
EndLabel->Number = LABEL_END;
|
||||
|
||||
//
|
||||
// Get all the Hii handles
|
||||
//
|
||||
HiiHandles = HiiGetHiiHandles (NULL);
|
||||
ASSERT (HiiHandles != NULL);
|
||||
//
|
||||
// Search for formset of each class type
|
||||
//
|
||||
for (Index = 0; HiiHandles[Index] != NULL; Index++) {
|
||||
Status = HiiGetFormSetFromHiiHandle(HiiHandles[Index], &Buffer,&BufferSize);
|
||||
if (EFI_ERROR (Status)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Ptr = (UINT8 *)Buffer;
|
||||
while(TempSize < BufferSize) {
|
||||
TempSize += ((EFI_IFR_OP_HEADER *) Ptr)->Length;
|
||||
|
||||
if (((EFI_IFR_OP_HEADER *) Ptr)->Length <= OFFSET_OF (EFI_IFR_FORM_SET, Flags)){
|
||||
Ptr += ((EFI_IFR_OP_HEADER *) Ptr)->Length;
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Find Class Guid
|
||||
//
|
||||
ClassGuidNum = (UINT8) (((EFI_IFR_FORM_SET *)Ptr)->Flags & 0x3);
|
||||
ClassGuid = (EFI_GUID *) (VOID *)(Ptr + sizeof (EFI_IFR_FORM_SET));
|
||||
while (ClassGuidNum-- > 0) {
|
||||
if (CompareGuid (&gEfiIfrFrontPageGuid, ClassGuid) == 0){
|
||||
ClassGuid ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
String = HiiGetString (HiiHandles[Index], ((EFI_IFR_FORM_SET *)Ptr)->FormSetTitle, NULL);
|
||||
if (String == NULL) {
|
||||
String = HiiGetString (HiiHandle, STRING_TOKEN (STR_MISSING_STRING), NULL);
|
||||
ASSERT (String != NULL);
|
||||
}
|
||||
Token = HiiSetString (HiiHandle, 0, String, NULL);
|
||||
FreePool (String);
|
||||
|
||||
String = HiiGetString (HiiHandles[Index], ((EFI_IFR_FORM_SET *)Ptr)->Help, NULL);
|
||||
|
||||
if (String == NULL) {
|
||||
String = HiiGetString (HiiHandle, STRING_TOKEN (STR_MISSING_STRING), NULL);
|
||||
ASSERT (String != NULL);
|
||||
}
|
||||
TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);
|
||||
FreePool (String);
|
||||
|
||||
FormSetGuid = ((EFI_IFR_FORM_SET *)Ptr)->Guid;
|
||||
|
||||
DevicePathStr = ExtractDevicePathFromHiiHandle(HiiHandles[Index]);
|
||||
DevicePathId = 0;
|
||||
if (DevicePathStr != NULL){
|
||||
DevicePathId = HiiSetString (HiiHandle, 0, DevicePathStr, NULL);
|
||||
FreePool (DevicePathStr);
|
||||
}
|
||||
HiiCreateGotoExOpCode (
|
||||
StartOpCodeHandle,
|
||||
0,
|
||||
Token,
|
||||
TokenHelp,
|
||||
0,
|
||||
(EFI_QUESTION_ID) (Index + FRONT_PAGE_KEY_OFFSET),
|
||||
0,
|
||||
&FormSetGuid,
|
||||
DevicePathId
|
||||
);
|
||||
break;
|
||||
}
|
||||
Ptr += ((EFI_IFR_OP_HEADER *) Ptr)->Length;
|
||||
}
|
||||
|
||||
FreePool(Buffer);
|
||||
Buffer = NULL;
|
||||
TempSize = 0;
|
||||
BufferSize = 0;
|
||||
}
|
||||
|
||||
HiiUpdateForm (
|
||||
HiiHandle,
|
||||
&mFrontPageGuid,
|
||||
FRONT_PAGE_FORM_ID,
|
||||
StartOpCodeHandle,
|
||||
EndOpCodeHandle
|
||||
);
|
||||
|
||||
HiiFreeOpCodeHandle (StartOpCodeHandle);
|
||||
HiiFreeOpCodeHandle (EndOpCodeHandle);
|
||||
FreePool (HiiHandles);
|
||||
}
|
||||
|
||||
/**
|
||||
Initialize HII information for the FrontPage
|
||||
|
||||
|
@ -507,7 +604,6 @@ InitializeFrontPage (
|
|||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Locate Hii relative protocols
|
||||
//
|
||||
|
@ -552,6 +648,11 @@ InitializeFrontPage (
|
|||
//
|
||||
InitializeLanguage ();
|
||||
|
||||
//
|
||||
//Updata Front Page form
|
||||
//
|
||||
UpdateFrontPageForm();
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -1208,15 +1309,9 @@ UiEntry (
|
|||
}
|
||||
|
||||
InitializeFrontPage ();
|
||||
InitializeDeviceManager ();
|
||||
InitializeBootManager ();
|
||||
InitBootMaintenance();
|
||||
|
||||
CallFrontPage ();
|
||||
|
||||
FreeBMPackage ();
|
||||
FreeBootManager ();
|
||||
FreeDeviceManager ();
|
||||
FreeFrontPage ();
|
||||
|
||||
if (mLanguageString != NULL) {
|
||||
|
@ -1246,10 +1341,7 @@ ExtractDevicePathFromHiiHandle (
|
|||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE DriverHandle;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *PathToText;
|
||||
CHAR16 *NewString;
|
||||
|
||||
|
||||
ASSERT (Handle != NULL);
|
||||
|
||||
if (Handle == NULL) {
|
||||
|
@ -1257,174 +1349,12 @@ ExtractDevicePathFromHiiHandle (
|
|||
}
|
||||
|
||||
Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the device path by the got Driver handle .
|
||||
//
|
||||
Status = gBS->HandleProtocol (DriverHandle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDevicePathToTextProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &PathToText
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// Get device path string.
|
||||
//
|
||||
NewString = PathToText->ConvertDevicePathToText(DevicePath, FALSE, FALSE);
|
||||
return ConvertDevicePathToText(DevicePathFromHandle (DriverHandle), FALSE, FALSE);
|
||||
|
||||
return NewString;
|
||||
}
|
||||
|
||||
/**
|
||||
Extract the displayed formset for given HII handle and class guid.
|
||||
|
||||
@param Handle The HII handle.
|
||||
@param SetupClassGuid The class guid specifies which form set will be displayed.
|
||||
@param SkipCount Skip some formsets which has processed before.
|
||||
@param FormSetTitle Formset title string.
|
||||
@param FormSetHelp Formset help string.
|
||||
@param FormSetGuid Formset Guid.
|
||||
|
||||
@retval TRUE The formset for given HII handle will be displayed.
|
||||
@return FALSE The formset for given HII handle will not be displayed.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
ExtractDisplayedHiiFormFromHiiHandle (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_GUID *SetupClassGuid,
|
||||
IN UINTN SkipCount,
|
||||
OUT EFI_STRING_ID *FormSetTitle,
|
||||
OUT EFI_STRING_ID *FormSetHelp,
|
||||
OUT EFI_GUID *FormSetGuid
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN BufferSize;
|
||||
EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
|
||||
UINT8 *Package;
|
||||
UINT8 *OpCodeData;
|
||||
UINT32 Offset;
|
||||
UINT32 Offset2;
|
||||
UINT32 PackageListLength;
|
||||
EFI_HII_PACKAGE_HEADER PackageHeader;
|
||||
EFI_GUID *ClassGuid;
|
||||
UINT8 ClassGuidNum;
|
||||
BOOLEAN FoundAndSkip;
|
||||
|
||||
ASSERT (Handle != NULL);
|
||||
ASSERT (SetupClassGuid != NULL && FormSetTitle != NULL && FormSetHelp != NULL && FormSetGuid != NULL);
|
||||
|
||||
*FormSetTitle = 0;
|
||||
*FormSetHelp = 0;
|
||||
ClassGuidNum = 0;
|
||||
ClassGuid = NULL;
|
||||
FoundAndSkip = FALSE;
|
||||
|
||||
//
|
||||
// Get HII PackageList
|
||||
//
|
||||
BufferSize = 0;
|
||||
HiiPackageList = NULL;
|
||||
Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList);
|
||||
//
|
||||
// Handle is a invalid handle. Check if Handle is corrupted.
|
||||
//
|
||||
ASSERT (Status != EFI_NOT_FOUND);
|
||||
//
|
||||
// The return status should always be EFI_BUFFER_TOO_SMALL as input buffer's size is 0.
|
||||
//
|
||||
ASSERT (Status == EFI_BUFFER_TOO_SMALL);
|
||||
|
||||
HiiPackageList = AllocatePool (BufferSize);
|
||||
ASSERT (HiiPackageList != NULL);
|
||||
|
||||
Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Get Form package from this HII package List
|
||||
//
|
||||
Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
|
||||
PackageListLength = ReadUnaligned32 (&HiiPackageList->PackageLength);
|
||||
|
||||
while (Offset < PackageListLength) {
|
||||
Package = ((UINT8 *) HiiPackageList) + Offset;
|
||||
CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||
Offset += PackageHeader.Length;
|
||||
|
||||
if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
|
||||
//
|
||||
// Search FormSet Opcode in this Form Package
|
||||
//
|
||||
Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);
|
||||
while (Offset2 < PackageHeader.Length) {
|
||||
OpCodeData = Package + Offset2;
|
||||
Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;
|
||||
|
||||
if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {
|
||||
if (((EFI_IFR_OP_HEADER *) OpCodeData)->Length > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
|
||||
//
|
||||
// Find FormSet OpCode
|
||||
//
|
||||
ClassGuidNum = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);
|
||||
ClassGuid = (EFI_GUID *) (VOID *)(OpCodeData + sizeof (EFI_IFR_FORM_SET));
|
||||
while (ClassGuidNum-- > 0) {
|
||||
if (CompareGuid (SetupClassGuid, ClassGuid)) {
|
||||
//
|
||||
// Check whether need to skip the formset.
|
||||
//
|
||||
if (SkipCount != 0) {
|
||||
SkipCount--;
|
||||
FoundAndSkip = TRUE;
|
||||
break;
|
||||
}
|
||||
CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
|
||||
CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
|
||||
CopyGuid (FormSetGuid, (CONST EFI_GUID *)(&((EFI_IFR_FORM_SET *) OpCodeData)->Guid));
|
||||
FreePool (HiiPackageList);
|
||||
return TRUE;
|
||||
}
|
||||
ClassGuid ++;
|
||||
}
|
||||
if (FoundAndSkip) {
|
||||
break;
|
||||
}
|
||||
} else if (CompareGuid (SetupClassGuid, &gEfiHiiPlatformSetupFormsetGuid)) {
|
||||
//
|
||||
// Check whether need to skip the formset.
|
||||
//
|
||||
if (SkipCount != 0) {
|
||||
SkipCount--;
|
||||
break;
|
||||
}
|
||||
CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
|
||||
CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
|
||||
CopyGuid (FormSetGuid, (CONST EFI_GUID *)(&((EFI_IFR_FORM_SET *) OpCodeData)->Guid));
|
||||
FreePool (HiiPackageList);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FreePool (HiiPackageList);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1566,39 +1496,3 @@ SetupResetReminder (
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
This function converts an input device structure to a Unicode string.
|
||||
|
||||
@param DevPath A pointer to the device path structure.
|
||||
|
||||
@return A new allocated Unicode string that represents the device path.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
UiDevicePathToStr (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *ToText;
|
||||
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
|
||||
|
||||
if (DevPath == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDevicePathToTextProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &DevPathToText
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ToText = DevPathToText->ConvertDevicePathToText (
|
||||
DevPath,
|
||||
FALSE,
|
||||
TRUE
|
||||
);
|
||||
ASSERT (ToText != NULL);
|
||||
return ToText;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
FrontPage routines to handle the callbacks and browser calls
|
||||
Head file for front page.
|
||||
|
||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
|
@ -15,14 +15,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef _FRONT_PAGE_H_
|
||||
#define _FRONT_PAGE_H_
|
||||
|
||||
#include "DeviceMngr/DeviceManager.h"
|
||||
#include "BootMaint/BootMaint.h"
|
||||
#include "BootMngr/BootManager.h"
|
||||
#include "String.h"
|
||||
#include "Ui.h"
|
||||
|
||||
#include <Protocol/BootLogo.h>
|
||||
//
|
||||
// These are the VFR compiler generated data representing our VFR data.
|
||||
// These is the VFR compiler generated data representing our VFR data.
|
||||
//
|
||||
extern UINT8 FrontPageVfrBin[];
|
||||
|
||||
|
@ -32,11 +30,6 @@ extern BOOLEAN gConnectAllHappened;
|
|||
|
||||
#define SMBIOS_TYPE4_CPU_SOCKET_POPULATED BIT6
|
||||
|
||||
///
|
||||
/// The size of a 3 character ISO639 language code.
|
||||
///
|
||||
#define ISO_639_2_ENTRY_SIZE 3
|
||||
|
||||
//
|
||||
// This is the VFR compiler generated header file which defines the
|
||||
// string identifiers.
|
||||
|
@ -47,15 +40,10 @@ extern BOOLEAN gConnectAllHappened;
|
|||
// These are defined as the same with vfr file
|
||||
//
|
||||
#define FRONT_PAGE_FORM_ID 0x1000
|
||||
#define INVALID_FORM_ID 0x0FFF
|
||||
|
||||
#define FRONT_PAGE_KEY_SECTION 0x1000
|
||||
#define FRONT_PAGE_KEY_OFFSET 0x4000
|
||||
#define FRONT_PAGE_KEY_CONTINUE 0x1000
|
||||
#define FRONT_PAGE_KEY_LANGUAGE 0x1234
|
||||
#define FRONT_PAGE_KEY_BOOT_MANAGER 0x1064
|
||||
#define FRONT_PAGE_KEY_DEVICE_MANAGER 0x8567
|
||||
#define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876
|
||||
|
||||
#define LABEL_SELECT_LANGUAGE 0x1000
|
||||
#define LABEL_PLATFORM_INFORMATION 0x1001
|
||||
|
@ -219,30 +207,6 @@ UiEntry (
|
|||
IN BOOLEAN ConnectAllHappened
|
||||
);
|
||||
|
||||
/**
|
||||
Extract the displayed formset for given HII handle and class guid.
|
||||
|
||||
@param Handle The HII handle.
|
||||
@param SetupClassGuid The class guid specifies which form set will be displayed.
|
||||
@param SkipCount Skip some formsets which has processed before.
|
||||
@param FormSetTitle Formset title string.
|
||||
@param FormSetHelp Formset help string.
|
||||
@param FormSetGuid Formset Guid.
|
||||
|
||||
@retval TRUE The formset for given HII handle will be displayed.
|
||||
@return FALSE The formset for given HII handle will not be displayed.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
ExtractDisplayedHiiFormFromHiiHandle (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_GUID *SetupClassGuid,
|
||||
IN UINTN SkipCount,
|
||||
OUT EFI_STRING_ID *FormSetTitle,
|
||||
OUT EFI_STRING_ID *FormSetHelp,
|
||||
OUT EFI_GUID *FormSetGuid
|
||||
);
|
||||
|
||||
/**
|
||||
Extract device path for given HII handle and class guid.
|
||||
|
||||
|
@ -257,21 +221,5 @@ ExtractDevicePathFromHiiHandle (
|
|||
IN EFI_HII_HANDLE Handle
|
||||
);
|
||||
|
||||
/**
|
||||
This function will change video resolution and text mode
|
||||
according to defined setup mode or defined boot mode
|
||||
|
||||
@param IsSetupMode Indicate mode is changed to setup mode or boot mode.
|
||||
|
||||
@retval EFI_SUCCESS Mode is changed successfully.
|
||||
@retval Others Mode failed to be changed.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BdsSetConsoleMode (
|
||||
BOOLEAN IsSetupMode
|
||||
);
|
||||
|
||||
#endif // _FRONT_PAGE_H_
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
///** @file
|
||||
//
|
||||
// Browser formset.
|
||||
// Front page formset.
|
||||
//
|
||||
// Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
|
@ -14,33 +14,20 @@
|
|||
//**/
|
||||
|
||||
#define FORMSET_GUID { 0x9e0c30bc, 0x3f06, 0x4ba6, 0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }
|
||||
#include "FormsetGuid.h"
|
||||
|
||||
#define FRONT_PAGE_CLASS 0x0000
|
||||
#define FRONT_PAGE_SUBCLASS 0x0002
|
||||
|
||||
#define FRONT_PAGE_FORM_ID 0x1000
|
||||
|
||||
#define FRONT_PAGE_ITEM_ONE 0x0001
|
||||
#define FRONT_PAGE_ITEM_TWO 0x0002
|
||||
#define FRONT_PAGE_ITEM_THREE 0x0003
|
||||
#define FRONT_PAGE_ITEM_FOUR 0x0004
|
||||
#define FRONT_PAGE_ITEM_FIVE 0x0005
|
||||
|
||||
#define FRONT_PAGE_KEY_CONTINUE 0x1000
|
||||
#define FRONT_PAGE_KEY_LANGUAGE 0x1234
|
||||
#define FRONT_PAGE_KEY_BOOT_MANAGER 0x1064
|
||||
#define FRONT_PAGE_KEY_DEVICE_MANAGER 0x8567
|
||||
#define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876
|
||||
|
||||
#define LABEL_SELECT_LANGUAGE 0x1000
|
||||
#define LABEL_TIMEOUT 0x2000
|
||||
#define LABEL_PLATFORM_INFORMATION 0x1001
|
||||
#define LABEL_END 0xffff
|
||||
|
||||
formset
|
||||
guid = FORMSET_GUID,
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
|
||||
help = STRING_TOKEN(STR_NULL_STRING),
|
||||
help = STRING_TOKEN(STR_EMPTY_STRING ),
|
||||
classguid = FORMSET_GUID,
|
||||
|
||||
form formid = FRONT_PAGE_FORM_ID,
|
||||
|
@ -114,35 +101,13 @@ formset
|
|||
// Languages from the currently available choices
|
||||
//
|
||||
label LABEL_END;
|
||||
|
||||
goto
|
||||
formsetguid = DEVICE_MANAGER_FORMSET_GUID,
|
||||
formid = 0,
|
||||
question = 0,
|
||||
prompt = STRING_TOKEN(STR_EDKII_MENU),
|
||||
help = STRING_TOKEN(STR_EDKII_MENU_HELP),
|
||||
flags = INTERACTIVE,
|
||||
key = FRONT_PAGE_KEY_DEVICE_MANAGER;
|
||||
|
||||
|
||||
goto
|
||||
formsetguid = BOOT_MANAGER_FORMSET_GUID ,
|
||||
formid = 0,
|
||||
question = 0,
|
||||
prompt = STRING_TOKEN(STR_BOOT_MANAGER),
|
||||
help = STRING_TOKEN(STR_BOOT_MANAGER_HELP),
|
||||
flags = INTERACTIVE,
|
||||
key = FRONT_PAGE_KEY_BOOT_MANAGER;
|
||||
|
||||
|
||||
goto
|
||||
formsetguid = BOOT_MAINT_FORMSET_GUID,
|
||||
formid = 0,
|
||||
question = 0,
|
||||
prompt = STRING_TOKEN(STR_BOOT_MAINT_MANAGER),
|
||||
help = STRING_TOKEN(STR_BOOT_MAINT_MANAGER_HELP),
|
||||
flags = INTERACTIVE,
|
||||
key = FRONT_PAGE_KEY_BOOT_MAINTAIN;
|
||||
label LABEL_PLATFORM_INFORMATION;
|
||||
//
|
||||
// This is where we will dynamically add a Action type op-code to show
|
||||
// the platform information.
|
||||
//
|
||||
label LABEL_END;
|
||||
|
||||
endform;
|
||||
|
||||
|
|
|
@ -65,16 +65,4 @@ UninitializeStringSupport (
|
|||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Call the browser and display the front page
|
||||
|
||||
@return Status code that will be returned by
|
||||
EFI_FORM_BROWSER2_PROTOCOL.SendForm ().
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CallFrontPage (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif // _STRING_H_
|
||||
|
|
Binary file not shown.
|
@ -16,58 +16,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef _BDS_MODULE_H_
|
||||
#define _BDS_MODULE_H_
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <IndustryStandard/PeImage.h>
|
||||
#include <IndustryStandard/SmBios.h>
|
||||
|
||||
#include <Guid/MdeModuleHii.h>
|
||||
#include <Guid/FileSystemVolumeLabelInfo.h>
|
||||
#include <Guid/HiiPlatformSetupFormset.h>
|
||||
#include <Guid/GlobalVariable.h>
|
||||
#include <Guid/CapsuleVendor.h>
|
||||
#include <Guid/StatusCodeDataTypeId.h>
|
||||
#include <Guid/FileInfo.h>
|
||||
#include <Guid/HiiBootMaintenanceFormset.h>
|
||||
|
||||
#include <Protocol/LoadFile.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/HiiConfigRouting.h>
|
||||
#include <Protocol/Smbios.h>
|
||||
#include <Protocol/UgaDraw.h>
|
||||
#include <Protocol/BlockIo.h>
|
||||
#include <Protocol/GenericMemoryTest.h>
|
||||
#include <Protocol/FormBrowser2.h>
|
||||
#include <Protocol/HiiConfigAccess.h>
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
#include <Protocol/SimpleFileSystem.h>
|
||||
#include <Protocol/HiiDatabase.h>
|
||||
#include <Protocol/HiiString.h>
|
||||
#include <Protocol/SerialIo.h>
|
||||
#include <Protocol/SimpleTextInEx.h>
|
||||
#include <Protocol/DriverHealth.h>
|
||||
#include <Protocol/DevicePathToText.h>
|
||||
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/PerformanceLib.h>
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Library/HobLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/CapsuleLib.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/UefiHiiServicesLib.h>
|
||||
|
||||
#include <Library/UefiBootManagerLib.h>
|
||||
|
||||
#pragma pack(1)
|
||||
|
@ -163,16 +130,4 @@ SetupResetReminder (
|
|||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
This function converts an input device structure to a Unicode string.
|
||||
|
||||
@param DevPath A pointer to the device path structure.
|
||||
|
||||
@return A new allocated Unicode string that represents the device path.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
UiDevicePathToStr (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -29,38 +29,14 @@
|
|||
|
||||
[Sources]
|
||||
FrontPage.h
|
||||
Language.h
|
||||
String.h
|
||||
Ui.h
|
||||
BootMngr/BootManager.h
|
||||
BootMaint/BootMaint.h
|
||||
BootMaint/FormGuid.h
|
||||
|
||||
DeviceMngr/DeviceManager.h
|
||||
DeviceMngr/DeviceManagerVfr.Vfr
|
||||
DeviceMngr/DeviceManagerStrings.uni
|
||||
DeviceMngr/DeviceManager.c
|
||||
BootMngr/BootManagerVfr.Vfr
|
||||
BootMngr/BootManagerStrings.uni
|
||||
BootMngr/BootManager.c
|
||||
BootMaint/FE.vfr
|
||||
BootMaint/FileExplorer.c
|
||||
BootMaint/BootMaint.c
|
||||
BootMaint/UpdatePage.c
|
||||
BootMaint/Variable.c
|
||||
BootMaint/Data.c
|
||||
BootMaint/ConsoleOption.c
|
||||
BootMaint/BootOption.c
|
||||
BootMaint/BmLib.c
|
||||
BootMaint/Bm.vfr
|
||||
BootMaint/Bmstring.uni
|
||||
FrontPageVfr.Vfr
|
||||
FrontPageStrings.uni
|
||||
Strings.uni
|
||||
FrontPage.c
|
||||
String.c
|
||||
String.h
|
||||
Language.c
|
||||
Language.h
|
||||
FormsetGuid.h
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
@ -69,7 +45,6 @@
|
|||
[LibraryClasses]
|
||||
DevicePathLib
|
||||
BaseLib
|
||||
HobLib
|
||||
UefiRuntimeServicesTableLib
|
||||
ReportStatusCodeLib
|
||||
MemoryAllocationLib
|
||||
|
@ -85,67 +60,26 @@
|
|||
UefiBootManagerLib
|
||||
|
||||
[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)
|
||||
gEfiHiiPlatformSetupFormsetGuid ## CONSUMES ## GUID (Indicate the formset class guid to be displayed)
|
||||
gEfiIfrTianoGuid ## CONSUMES ## GUID (Extended IFR Guid Opcode)
|
||||
gEfiHiiDriverHealthFormsetGuid ## CONSUMES ## GUID (Indicate the Driver Health formset class guid to be displayed)
|
||||
gEfiIfrBootMaintenanceGuid ## CONSUMES ## GUID
|
||||
|
||||
gEfiIfrFrontPageGuid ## CONSUMES ## GUID
|
||||
|
||||
[Protocols]
|
||||
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
|
||||
gEfiLoadFileProtocolGuid ## CONSUMES
|
||||
gEfiSmbiosProtocolGuid ## CONSUMES
|
||||
gEfiGenericMemTestProtocolGuid ## CONSUMES
|
||||
gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES
|
||||
gEfiBlockIoProtocolGuid ## CONSUMES
|
||||
gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES
|
||||
gEfiSimpleTextInputExProtocolGuid ## CONSUMES
|
||||
gEfiHiiConfigAccessProtocolGuid ## CONSUMES
|
||||
gEfiFormBrowser2ProtocolGuid ## CONSUMES
|
||||
gEfiSerialIoProtocolGuid ## CONSUMES
|
||||
gEfiDevicePathProtocolGuid ## CONSUMES
|
||||
gEfiPciIoProtocolGuid ## CONSUMES
|
||||
gEfiDevicePathToTextProtocolGuid ## CONSUMES
|
||||
gEfiBootLogoProtocolGuid ## CONSUMES
|
||||
gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES
|
||||
|
||||
[FeaturePcd]
|
||||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes ## CONSUMES
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang ## SOMETIMES_CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## PRODUCES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## PRODUCES
|
||||
## CONSUMES
|
||||
## PRODUCES
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## PRODUCES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## PRODUCES
|
||||
## CONSUMES
|
||||
## SOMETIMES_PRODUCES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn
|
||||
## CONSUMES
|
||||
## SOMETIMES_PRODUCES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn ## CONSUMES ## SOMETIMES_PRODUCES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow ## CONSUMES ## SOMETIMES_PRODUCES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString ## CONSUMES
|
||||
|
||||
[UserExtensions.TianoCore."ExtraFiles"]
|
||||
UiAppExtra.uni
|
||||
UiFrontPageAppExtra.uni
|
||||
|
|
Binary file not shown.
|
@ -293,7 +293,12 @@
|
|||
|
||||
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
|
||||
MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
|
||||
MdeModulePkg/Application/UiApp/UiApp.inf
|
||||
MdeModulePkg/Application/UiApp/UiApp.inf{
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/DeviceManagerLib/DeviceManagerLib.inf
|
||||
NULL|MdeModulePkg/Library/BootManagerLib/BootManagerLib.inf
|
||||
NULL|MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf
|
||||
}
|
||||
MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
|
||||
MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.inf
|
||||
MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
|
||||
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
||||
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
|
||||
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
|
||||
#
|
||||
# Generic Modules
|
||||
|
@ -446,7 +447,12 @@
|
|||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.inf
|
||||
}
|
||||
MdeModulePkg/Application/UiApp/UiApp.inf
|
||||
MdeModulePkg/Application/UiApp/UiApp.inf{
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/DeviceManagerLib/DeviceManagerLib.inf
|
||||
NULL|MdeModulePkg/Library/BootManagerLib/BootManagerLib.inf
|
||||
NULL|MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf
|
||||
}
|
||||
MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
|
||||
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
||||
MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
|
||||
|
|
Loading…
Reference in New Issue