mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
UiApp code split from IntelFrameworkModulePkg/Universal/BdsDxe driver.
This is the UI part of the old BdsDxe driver, also remove the legacy boot option related code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18111 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6ed41dadaa
commit
143f0b1de8
352
MdeModulePkg/Application/UiApp/BootMaint/Bm.vfr
Normal file
352
MdeModulePkg/Application/UiApp/BootMaint/Bm.vfr
Normal file
@ -0,0 +1,352 @@
|
||||
///** @file
|
||||
//
|
||||
// Boot Maintenance Utility Formset
|
||||
//
|
||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// 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;
|
||||
|
||||
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;
|
369
MdeModulePkg/Application/UiApp/BootMaint/BmLib.c
Normal file
369
MdeModulePkg/Application/UiApp/BootMaint/BmLib.c
Normal file
@ -0,0 +1,369 @@
|
||||
/** @file
|
||||
Utility routines used by boot maintenance modules.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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;
|
||||
}
|
BIN
MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
Normal file
BIN
MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
Normal file
Binary file not shown.
1407
MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
Normal file
1407
MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
Normal file
File diff suppressed because it is too large
Load Diff
1478
MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
Normal file
1478
MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
Normal file
File diff suppressed because it is too large
Load Diff
1527
MdeModulePkg/Application/UiApp/BootMaint/BootOption.c
Normal file
1527
MdeModulePkg/Application/UiApp/BootMaint/BootOption.c
Normal file
File diff suppressed because it is too large
Load Diff
995
MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
Normal file
995
MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
Normal file
@ -0,0 +1,995 @@
|
||||
/** @file
|
||||
handles console redirection from boot manager
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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"
|
||||
|
||||
|
||||
/**
|
||||
Function compares a device path data structure to that of all the nodes of a
|
||||
second device path instance.
|
||||
|
||||
@param Multi A pointer to a multi-instance device path data
|
||||
structure.
|
||||
@param Single A pointer to a single-instance device path data
|
||||
structure.
|
||||
|
||||
@retval TRUE If the Single device path is contained within Multi device path.
|
||||
@retval FALSE The Single device path is not match within Multi device path.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
MatchDevicePaths (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *Multi,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *Single
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePathInst;
|
||||
UINTN Size;
|
||||
|
||||
if (Multi == NULL || Single == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DevicePath = Multi;
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
|
||||
//
|
||||
// Search for the match of 'Single' in 'Multi'
|
||||
//
|
||||
while (DevicePathInst != NULL) {
|
||||
//
|
||||
// If the single device path is found in multiple device paths,
|
||||
// return success
|
||||
//
|
||||
if (CompareMem (Single, DevicePathInst, Size) == 0) {
|
||||
FreePool (DevicePathInst);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
FreePool (DevicePathInst);
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Check whether the device path node is ISA Serial Node.
|
||||
|
||||
@param Acpi Device path node to be checked
|
||||
|
||||
@retval TRUE It's ISA Serial Node.
|
||||
@retval FALSE It's NOT ISA Serial Node.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsIsaSerialNode (
|
||||
IN ACPI_HID_DEVICE_PATH *Acpi
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) (
|
||||
(DevicePathType (Acpi) == ACPI_DEVICE_PATH) &&
|
||||
(DevicePathSubType (Acpi) == ACPI_DP) &&
|
||||
(ReadUnaligned32 (&Acpi->HID) == EISA_PNP_ID (0x0501))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Update Com Ports attributes from DevicePath
|
||||
|
||||
@param DevicePath DevicePath that contains Com ports
|
||||
|
||||
@retval EFI_SUCCESS The update is successful.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UpdateComAttributeFromVariable (
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
);
|
||||
|
||||
/**
|
||||
Update the multi-instance device path of Terminal Device based on
|
||||
the global TerminalMenu. If ChangeTernimal is TRUE, the terminal
|
||||
device path in the Terminal Device in TerminalMenu is also updated.
|
||||
|
||||
@param DevicePath The multi-instance device path.
|
||||
@param ChangeTerminal TRUE, then device path in the Terminal Device
|
||||
in TerminalMenu is also updated; FALSE, no update.
|
||||
|
||||
@return EFI_SUCCESS The function completes successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ChangeTerminalDevicePath (
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN BOOLEAN ChangeTerminal
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node;
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node1;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
UART_DEVICE_PATH *Uart;
|
||||
UART_DEVICE_PATH *Uart1;
|
||||
UINTN Com;
|
||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
|
||||
Node = DevicePath;
|
||||
Node = NextDevicePathNode (Node);
|
||||
Com = 0;
|
||||
while (!IsDevicePathEnd (Node)) {
|
||||
Acpi = (ACPI_HID_DEVICE_PATH *) Node;
|
||||
if (IsIsaSerialNode (Acpi)) {
|
||||
CopyMem (&Com, &Acpi->UID, sizeof (UINT32));
|
||||
}
|
||||
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Com);
|
||||
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node) == MSG_UART_DP)) {
|
||||
Uart = (UART_DEVICE_PATH *) Node;
|
||||
CopyMem (
|
||||
&Uart->BaudRate,
|
||||
&NewTerminalContext->BaudRate,
|
||||
sizeof (UINT64)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart->DataBits,
|
||||
&NewTerminalContext->DataBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart->Parity,
|
||||
&NewTerminalContext->Parity,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart->StopBits,
|
||||
&NewTerminalContext->StopBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
//
|
||||
// Change the device path in the ComPort
|
||||
//
|
||||
if (ChangeTerminal) {
|
||||
Node1 = NewTerminalContext->DevicePath;
|
||||
Node1 = NextDevicePathNode (Node1);
|
||||
while (!IsDevicePathEnd (Node1)) {
|
||||
if ((DevicePathType (Node1) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node1) == MSG_UART_DP)) {
|
||||
Uart1 = (UART_DEVICE_PATH *) Node1;
|
||||
CopyMem (
|
||||
&Uart1->BaudRate,
|
||||
&NewTerminalContext->BaudRate,
|
||||
sizeof (UINT64)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart1->DataBits,
|
||||
&NewTerminalContext->DataBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart1->Parity,
|
||||
&NewTerminalContext->Parity,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart1->StopBits,
|
||||
&NewTerminalContext->StopBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
break;
|
||||
}
|
||||
//
|
||||
// end if
|
||||
//
|
||||
Node1 = NextDevicePathNode (Node1);
|
||||
}
|
||||
//
|
||||
// end while
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Node = NextDevicePathNode (Node);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Update the device path that describing a terminal device
|
||||
based on the new BaudRate, Data Bits, parity and Stop Bits
|
||||
set.
|
||||
|
||||
@param DevicePath terminal device's path
|
||||
|
||||
**/
|
||||
VOID
|
||||
ChangeVariableDevicePath (
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
UART_DEVICE_PATH *Uart;
|
||||
UINTN Com;
|
||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
|
||||
Node = DevicePath;
|
||||
Node = NextDevicePathNode (Node);
|
||||
Com = 0;
|
||||
while (!IsDevicePathEnd (Node)) {
|
||||
Acpi = (ACPI_HID_DEVICE_PATH *) Node;
|
||||
if (IsIsaSerialNode (Acpi)) {
|
||||
CopyMem (&Com, &Acpi->UID, sizeof (UINT32));
|
||||
}
|
||||
|
||||
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node) == MSG_UART_DP)) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (
|
||||
&TerminalMenu,
|
||||
Com
|
||||
);
|
||||
ASSERT (NewMenuEntry != NULL);
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
Uart = (UART_DEVICE_PATH *) Node;
|
||||
CopyMem (
|
||||
&Uart->BaudRate,
|
||||
&NewTerminalContext->BaudRate,
|
||||
sizeof (UINT64)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart->DataBits,
|
||||
&NewTerminalContext->DataBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart->Parity,
|
||||
&NewTerminalContext->Parity,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart->StopBits,
|
||||
&NewTerminalContext->StopBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
}
|
||||
|
||||
Node = NextDevicePathNode (Node);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Retrieve ACPI UID of UART from device path
|
||||
|
||||
@param Handle The handle for the UART device.
|
||||
@param AcpiUid The ACPI UID on output.
|
||||
|
||||
@retval TRUE Find valid UID from device path
|
||||
@retval FALSE Can't find
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
RetrieveUartUid (
|
||||
IN EFI_HANDLE Handle,
|
||||
IN OUT UINT32 *AcpiUid
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
Handle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &DevicePath
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Acpi = NULL;
|
||||
for (; !IsDevicePathEnd (DevicePath); DevicePath = NextDevicePathNode (DevicePath)) {
|
||||
if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (DevicePath) == MSG_UART_DP)) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
// Acpi points to the node before the Uart node
|
||||
//
|
||||
Acpi = (ACPI_HID_DEVICE_PATH *) DevicePath;
|
||||
}
|
||||
|
||||
if ((Acpi != NULL) && IsIsaSerialNode (Acpi)) {
|
||||
if (AcpiUid != NULL) {
|
||||
CopyMem (AcpiUid, &Acpi->UID, sizeof (UINT32));
|
||||
}
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Sort Uart handles array with Acpi->UID from low to high.
|
||||
|
||||
@param Handles EFI_SERIAL_IO_PROTOCOL handle buffer
|
||||
@param NoHandles EFI_SERIAL_IO_PROTOCOL handle count
|
||||
**/
|
||||
VOID
|
||||
SortedUartHandle (
|
||||
IN EFI_HANDLE *Handles,
|
||||
IN UINTN NoHandles
|
||||
)
|
||||
{
|
||||
UINTN Index1;
|
||||
UINTN Index2;
|
||||
UINTN Position;
|
||||
UINT32 AcpiUid1;
|
||||
UINT32 AcpiUid2;
|
||||
UINT32 TempAcpiUid;
|
||||
EFI_HANDLE TempHandle;
|
||||
|
||||
for (Index1 = 0; Index1 < NoHandles-1; Index1++) {
|
||||
if (!RetrieveUartUid (Handles[Index1], &AcpiUid1)) {
|
||||
continue;
|
||||
}
|
||||
TempHandle = Handles[Index1];
|
||||
Position = Index1;
|
||||
TempAcpiUid = AcpiUid1;
|
||||
|
||||
for (Index2 = Index1+1; Index2 < NoHandles; Index2++) {
|
||||
if (!RetrieveUartUid (Handles[Index2], &AcpiUid2)) {
|
||||
continue;
|
||||
}
|
||||
if (AcpiUid2 < TempAcpiUid) {
|
||||
TempAcpiUid = AcpiUid2;
|
||||
TempHandle = Handles[Index2];
|
||||
Position = Index2;
|
||||
}
|
||||
}
|
||||
Handles[Position] = Handles[Index1];
|
||||
Handles[Index1] = TempHandle;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Test whether DevicePath is a valid Terminal
|
||||
|
||||
|
||||
@param DevicePath DevicePath to be checked
|
||||
@param Termi If DevicePath is valid Terminal, terminal type is returned.
|
||||
@param Com If DevicePath is valid Terminal, Com Port type is returned.
|
||||
|
||||
@retval TRUE If DevicePath point to a Terminal.
|
||||
@retval FALSE If DevicePath does not point to a Terminal.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsTerminalDevicePath (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
OUT TYPE_OF_TERMINAL *Termi,
|
||||
OUT UINTN *Com
|
||||
);
|
||||
|
||||
/**
|
||||
Build a list containing all serial devices.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The function complete successfully.
|
||||
@retval EFI_UNSUPPORTED No serial ports present.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
LocateSerialIo (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
UINTN Index2;
|
||||
UINTN NoHandles;
|
||||
EFI_HANDLE *Handles;
|
||||
EFI_STATUS Status;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_SERIAL_IO_PROTOCOL *SerialIo;
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node;
|
||||
EFI_DEVICE_PATH_PROTOCOL *OutDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *InpDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *ErrDevicePath;
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||
EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
|
||||
VENDOR_DEVICE_PATH Vendor;
|
||||
|
||||
//
|
||||
// Get all handles that have SerialIo protocol installed
|
||||
//
|
||||
InitializeListHead (&TerminalMenu.Head);
|
||||
TerminalMenu.MenuNumber = 0;
|
||||
Status = gBS->LocateHandleBuffer (
|
||||
ByProtocol,
|
||||
&gEfiSerialIoProtocolGuid,
|
||||
NULL,
|
||||
&NoHandles,
|
||||
&Handles
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// No serial ports present
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Sort Uart handles array with Acpi->UID from low to high
|
||||
// then Terminal menu can be built from low Acpi->UID to high Acpi->UID
|
||||
//
|
||||
SortedUartHandle (Handles, NoHandles);
|
||||
|
||||
for (Index = 0; Index < NoHandles; Index++) {
|
||||
//
|
||||
// Check to see whether the handle has DevicePath Protocol installed
|
||||
//
|
||||
gBS->HandleProtocol (
|
||||
Handles[Index],
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &DevicePath
|
||||
);
|
||||
|
||||
Acpi = NULL;
|
||||
for (Node = DevicePath; !IsDevicePathEnd (Node); Node = NextDevicePathNode (Node)) {
|
||||
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node) == MSG_UART_DP)) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
// Acpi points to the node before Uart node
|
||||
//
|
||||
Acpi = (ACPI_HID_DEVICE_PATH *) Node;
|
||||
}
|
||||
|
||||
if ((Acpi != NULL) && IsIsaSerialNode (Acpi)) {
|
||||
NewMenuEntry = BOpt_CreateMenuEntry (BM_TERMINAL_CONTEXT_SELECT);
|
||||
if (NewMenuEntry == NULL) {
|
||||
FreePool (Handles);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
CopyMem (&NewMenuEntry->OptionNumber, &Acpi->UID, sizeof (UINT32));
|
||||
NewTerminalContext->DevicePath = DuplicateDevicePath (DevicePath);
|
||||
//
|
||||
// BugBug: I have no choice, calling EfiLibStrFromDatahub will hang the system!
|
||||
// coz' the misc data for each platform is not correct, actually it's the device path stored in
|
||||
// datahub which is not completed, so a searching for end of device path will enter a
|
||||
// dead-loop.
|
||||
//
|
||||
NewMenuEntry->DisplayString = EfiLibStrFromDatahub (DevicePath);
|
||||
if (NULL == NewMenuEntry->DisplayString) {
|
||||
NewMenuEntry->DisplayString = UiDevicePathToStr (DevicePath);
|
||||
}
|
||||
|
||||
NewMenuEntry->HelpString = NULL;
|
||||
|
||||
gBS->HandleProtocol (
|
||||
Handles[Index],
|
||||
&gEfiSerialIoProtocolGuid,
|
||||
(VOID **) &SerialIo
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&NewTerminalContext->BaudRate,
|
||||
&SerialIo->Mode->BaudRate,
|
||||
sizeof (UINT64)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&NewTerminalContext->DataBits,
|
||||
&SerialIo->Mode->DataBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&NewTerminalContext->Parity,
|
||||
&SerialIo->Mode->Parity,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&NewTerminalContext->StopBits,
|
||||
&SerialIo->Mode->StopBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
InsertTailList (&TerminalMenu.Head, &NewMenuEntry->Link);
|
||||
TerminalMenu.MenuNumber++;
|
||||
}
|
||||
}
|
||||
if (Handles != NULL) {
|
||||
FreePool (Handles);
|
||||
}
|
||||
|
||||
//
|
||||
// Get L"ConOut", L"ConIn" and L"ErrOut" from the Var
|
||||
//
|
||||
OutDevicePath = GetEfiGlobalVariable (L"ConOut");
|
||||
InpDevicePath = GetEfiGlobalVariable (L"ConIn");
|
||||
ErrDevicePath = GetEfiGlobalVariable (L"ErrOut");
|
||||
if (OutDevicePath != NULL) {
|
||||
UpdateComAttributeFromVariable (OutDevicePath);
|
||||
}
|
||||
|
||||
if (InpDevicePath != NULL) {
|
||||
UpdateComAttributeFromVariable (InpDevicePath);
|
||||
}
|
||||
|
||||
if (ErrDevicePath != NULL) {
|
||||
UpdateComAttributeFromVariable (ErrDevicePath);
|
||||
}
|
||||
|
||||
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
|
||||
if (NULL == NewMenuEntry) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
|
||||
NewTerminalContext->TerminalType = 0;
|
||||
NewTerminalContext->IsConIn = FALSE;
|
||||
NewTerminalContext->IsConOut = FALSE;
|
||||
NewTerminalContext->IsStdErr = FALSE;
|
||||
|
||||
Vendor.Header.Type = MESSAGING_DEVICE_PATH;
|
||||
Vendor.Header.SubType = MSG_VENDOR_DP;
|
||||
|
||||
for (Index2 = 0; Index2 < 4; Index2++) {
|
||||
CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));
|
||||
SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));
|
||||
NewDevicePath = AppendDevicePathNode (
|
||||
NewTerminalContext->DevicePath,
|
||||
(EFI_DEVICE_PATH_PROTOCOL *) &Vendor
|
||||
);
|
||||
if (NewMenuEntry->HelpString != NULL) {
|
||||
FreePool (NewMenuEntry->HelpString);
|
||||
}
|
||||
//
|
||||
// NewMenuEntry->HelpString = UiDevicePathToStr (NewDevicePath);
|
||||
// NewMenuEntry->DisplayString = NewMenuEntry->HelpString;
|
||||
//
|
||||
NewMenuEntry->HelpString = NULL;
|
||||
|
||||
if (MatchDevicePaths (OutDevicePath, NewDevicePath)) {
|
||||
NewTerminalContext->IsConOut = TRUE;
|
||||
NewTerminalContext->TerminalType = (UINT8) Index2;
|
||||
}
|
||||
|
||||
if (MatchDevicePaths (InpDevicePath, NewDevicePath)) {
|
||||
NewTerminalContext->IsConIn = TRUE;
|
||||
NewTerminalContext->TerminalType = (UINT8) Index2;
|
||||
}
|
||||
|
||||
if (MatchDevicePaths (ErrDevicePath, NewDevicePath)) {
|
||||
NewTerminalContext->IsStdErr = TRUE;
|
||||
NewTerminalContext->TerminalType = (UINT8) Index2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Update Com Ports attributes from DevicePath
|
||||
|
||||
@param DevicePath DevicePath that contains Com ports
|
||||
|
||||
@retval EFI_SUCCESS The update is successful.
|
||||
@retval EFI_NOT_FOUND Can not find specific menu entry
|
||||
**/
|
||||
EFI_STATUS
|
||||
UpdateComAttributeFromVariable (
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node;
|
||||
EFI_DEVICE_PATH_PROTOCOL *SerialNode;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
UART_DEVICE_PATH *Uart;
|
||||
UART_DEVICE_PATH *Uart1;
|
||||
UINTN TerminalNumber;
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||
UINTN Index;
|
||||
|
||||
Node = DevicePath;
|
||||
Node = NextDevicePathNode (Node);
|
||||
TerminalNumber = 0;
|
||||
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
|
||||
while (!IsDevicePathEnd (Node)) {
|
||||
Acpi = (ACPI_HID_DEVICE_PATH *) Node;
|
||||
if (IsIsaSerialNode (Acpi)) {
|
||||
CopyMem (&TerminalNumber, &Acpi->UID, sizeof (UINT32));
|
||||
}
|
||||
|
||||
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node) == MSG_UART_DP)) {
|
||||
Uart = (UART_DEVICE_PATH *) Node;
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, TerminalNumber);
|
||||
if (NULL == NewMenuEntry) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
CopyMem (
|
||||
&NewTerminalContext->BaudRate,
|
||||
&Uart->BaudRate,
|
||||
sizeof (UINT64)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&NewTerminalContext->DataBits,
|
||||
&Uart->DataBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&NewTerminalContext->Parity,
|
||||
&Uart->Parity,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&NewTerminalContext->StopBits,
|
||||
&Uart->StopBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
SerialNode = NewTerminalContext->DevicePath;
|
||||
SerialNode = NextDevicePathNode (SerialNode);
|
||||
while (!IsDevicePathEnd (SerialNode)) {
|
||||
if ((DevicePathType (SerialNode) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (SerialNode) == MSG_UART_DP)) {
|
||||
//
|
||||
// Update following device paths according to
|
||||
// previous acquired uart attributes
|
||||
//
|
||||
Uart1 = (UART_DEVICE_PATH *) SerialNode;
|
||||
CopyMem (
|
||||
&Uart1->BaudRate,
|
||||
&NewTerminalContext->BaudRate,
|
||||
sizeof (UINT64)
|
||||
);
|
||||
|
||||
CopyMem (
|
||||
&Uart1->DataBits,
|
||||
&NewTerminalContext->DataBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
CopyMem (
|
||||
&Uart1->Parity,
|
||||
&NewTerminalContext->Parity,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
CopyMem (
|
||||
&Uart1->StopBits,
|
||||
&NewTerminalContext->StopBits,
|
||||
sizeof (UINT8)
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
SerialNode = NextDevicePathNode (SerialNode);
|
||||
}
|
||||
//
|
||||
// end while
|
||||
//
|
||||
}
|
||||
|
||||
Node = NextDevicePathNode (Node);
|
||||
}
|
||||
//
|
||||
// end while
|
||||
//
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Build up Console Menu based on types passed in. The type can
|
||||
be BM_CONSOLE_IN_CONTEXT_SELECT, BM_CONSOLE_OUT_CONTEXT_SELECT
|
||||
and BM_CONSOLE_ERR_CONTEXT_SELECT.
|
||||
|
||||
@param ConsoleMenuType Can be BM_CONSOLE_IN_CONTEXT_SELECT, BM_CONSOLE_OUT_CONTEXT_SELECT
|
||||
and BM_CONSOLE_ERR_CONTEXT_SELECT.
|
||||
|
||||
@retval EFI_UNSUPPORTED The type passed in is not in the 3 types defined.
|
||||
@retval EFI_NOT_FOUND If the EFI Variable defined in UEFI spec with name "ConOutDev",
|
||||
"ConInDev" or "ConErrDev" doesn't exists.
|
||||
@retval EFI_OUT_OF_RESOURCES Not enough resource to complete the operations.
|
||||
@retval EFI_SUCCESS Function completes successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetConsoleMenu (
|
||||
IN UINTN ConsoleMenuType
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *AllDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *MultiDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePathInst;
|
||||
UINTN Size;
|
||||
UINTN AllCount;
|
||||
UINTN Index;
|
||||
UINTN Index2;
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
BM_CONSOLE_CONTEXT *NewConsoleContext;
|
||||
TYPE_OF_TERMINAL Terminal;
|
||||
UINTN Com;
|
||||
BM_MENU_OPTION *ConsoleMenu;
|
||||
|
||||
DevicePath = NULL;
|
||||
AllDevicePath = NULL;
|
||||
AllCount = 0;
|
||||
switch (ConsoleMenuType) {
|
||||
case BM_CONSOLE_IN_CONTEXT_SELECT:
|
||||
ConsoleMenu = &ConsoleInpMenu;
|
||||
DevicePath = GetEfiGlobalVariable (L"ConIn");
|
||||
AllDevicePath = GetEfiGlobalVariable (L"ConInDev");
|
||||
break;
|
||||
|
||||
case BM_CONSOLE_OUT_CONTEXT_SELECT:
|
||||
ConsoleMenu = &ConsoleOutMenu;
|
||||
DevicePath = GetEfiGlobalVariable (L"ConOut");
|
||||
AllDevicePath = GetEfiGlobalVariable (L"ConOutDev");
|
||||
break;
|
||||
|
||||
case BM_CONSOLE_ERR_CONTEXT_SELECT:
|
||||
ConsoleMenu = &ConsoleErrMenu;
|
||||
DevicePath = GetEfiGlobalVariable (L"ErrOut");
|
||||
AllDevicePath = GetEfiGlobalVariable (L"ErrOutDev");
|
||||
break;
|
||||
|
||||
default:
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if (NULL == AllDevicePath) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
InitializeListHead (&ConsoleMenu->Head);
|
||||
|
||||
AllCount = EfiDevicePathInstanceCount (AllDevicePath);
|
||||
ConsoleMenu->MenuNumber = 0;
|
||||
//
|
||||
// Following is menu building up for Console Devices selected.
|
||||
//
|
||||
MultiDevicePath = AllDevicePath;
|
||||
Index2 = 0;
|
||||
for (Index = 0; Index < AllCount; Index++) {
|
||||
DevicePathInst = GetNextDevicePathInstance (&MultiDevicePath, &Size);
|
||||
|
||||
NewMenuEntry = BOpt_CreateMenuEntry (BM_CONSOLE_CONTEXT_SELECT);
|
||||
if (NULL == NewMenuEntry) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
NewMenuEntry->OptionNumber = Index2;
|
||||
|
||||
NewConsoleContext->DevicePath = DuplicateDevicePath (DevicePathInst);
|
||||
ASSERT (NewConsoleContext->DevicePath != NULL);
|
||||
NewMenuEntry->DisplayString = EfiLibStrFromDatahub (NewConsoleContext->DevicePath);
|
||||
if (NULL == NewMenuEntry->DisplayString) {
|
||||
NewMenuEntry->DisplayString = UiDevicePathToStr (NewConsoleContext->DevicePath);
|
||||
}
|
||||
|
||||
NewConsoleContext->IsTerminal = IsTerminalDevicePath (
|
||||
NewConsoleContext->DevicePath,
|
||||
&Terminal,
|
||||
&Com
|
||||
);
|
||||
|
||||
NewConsoleContext->IsActive = MatchDevicePaths (
|
||||
DevicePath,
|
||||
NewConsoleContext->DevicePath
|
||||
);
|
||||
|
||||
if (NewConsoleContext->IsTerminal) {
|
||||
BOpt_DestroyMenuEntry (NewMenuEntry);
|
||||
} else {
|
||||
Index2++;
|
||||
ConsoleMenu->MenuNumber++;
|
||||
InsertTailList (&ConsoleMenu->Head, &NewMenuEntry->Link);
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Build up ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu
|
||||
|
||||
@retval EFI_SUCCESS The function always complete successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetAllConsoles (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
GetConsoleMenu (BM_CONSOLE_IN_CONTEXT_SELECT);
|
||||
GetConsoleMenu (BM_CONSOLE_OUT_CONTEXT_SELECT);
|
||||
GetConsoleMenu (BM_CONSOLE_ERR_CONTEXT_SELECT);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Free ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu
|
||||
|
||||
@retval EFI_SUCCESS The function always complete successfully.
|
||||
**/
|
||||
EFI_STATUS
|
||||
FreeAllConsoles (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
BOpt_FreeMenu (&ConsoleOutMenu);
|
||||
BOpt_FreeMenu (&ConsoleInpMenu);
|
||||
BOpt_FreeMenu (&ConsoleErrMenu);
|
||||
BOpt_FreeMenu (&TerminalMenu);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Test whether DevicePath is a valid Terminal
|
||||
|
||||
|
||||
@param DevicePath DevicePath to be checked
|
||||
@param Termi If DevicePath is valid Terminal, terminal type is returned.
|
||||
@param Com If DevicePath is valid Terminal, Com Port type is returned.
|
||||
|
||||
@retval TRUE If DevicePath point to a Terminal.
|
||||
@retval FALSE If DevicePath does not point to a Terminal.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsTerminalDevicePath (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
OUT TYPE_OF_TERMINAL *Termi,
|
||||
OUT UINTN *Com
|
||||
)
|
||||
{
|
||||
BOOLEAN IsTerminal;
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node;
|
||||
VENDOR_DEVICE_PATH *Vendor;
|
||||
UART_DEVICE_PATH *Uart;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
|
||||
IsTerminal = FALSE;
|
||||
|
||||
Uart = NULL;
|
||||
Vendor = NULL;
|
||||
Acpi = NULL;
|
||||
for (Node = DevicePath; !IsDevicePathEnd (Node); Node = NextDevicePathNode (Node)) {
|
||||
//
|
||||
// Vendor points to the node before the End node
|
||||
//
|
||||
Vendor = (VENDOR_DEVICE_PATH *) Node;
|
||||
|
||||
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node) == MSG_UART_DP)) {
|
||||
Uart = (UART_DEVICE_PATH *) Node;
|
||||
}
|
||||
|
||||
if (Uart == NULL) {
|
||||
//
|
||||
// Acpi points to the node before the UART node
|
||||
//
|
||||
Acpi = (ACPI_HID_DEVICE_PATH *) Node;
|
||||
}
|
||||
}
|
||||
|
||||
if (Vendor == NULL ||
|
||||
DevicePathType (Vendor) != MESSAGING_DEVICE_PATH ||
|
||||
DevicePathSubType (Vendor) != MSG_VENDOR_DP ||
|
||||
Uart == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// There are four kinds of Terminal types
|
||||
// check to see whether this devicepath
|
||||
// is one of that type
|
||||
//
|
||||
if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[0])) {
|
||||
*Termi = TerminalTypePcAnsi;
|
||||
IsTerminal = TRUE;
|
||||
} else {
|
||||
if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[1])) {
|
||||
*Termi = TerminalTypeVt100;
|
||||
IsTerminal = TRUE;
|
||||
} else {
|
||||
if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[2])) {
|
||||
*Termi = TerminalTypeVt100Plus;
|
||||
IsTerminal = TRUE;
|
||||
} else {
|
||||
if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[3])) {
|
||||
*Termi = TerminalTypeVtUtf8;
|
||||
IsTerminal = TRUE;
|
||||
} else {
|
||||
IsTerminal = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsTerminal) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((Acpi != NULL) && IsIsaSerialNode (Acpi)) {
|
||||
CopyMem (Com, &Acpi->UID, sizeof (UINT32));
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Get mode number according to column and row
|
||||
|
||||
@param CallbackData The BMM context data.
|
||||
**/
|
||||
VOID
|
||||
GetConsoleOutMode (
|
||||
IN BMM_CALLBACK_DATA *CallbackData
|
||||
)
|
||||
{
|
||||
UINTN Col;
|
||||
UINTN Row;
|
||||
UINTN CurrentCol;
|
||||
UINTN CurrentRow;
|
||||
UINTN Mode;
|
||||
UINTN MaxMode;
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
|
||||
|
||||
ConOut = gST->ConOut;
|
||||
MaxMode = (UINTN) (ConOut->Mode->MaxMode);
|
||||
|
||||
CurrentCol = PcdGet32 (PcdSetupConOutColumn);
|
||||
CurrentRow = PcdGet32 (PcdSetupConOutRow);
|
||||
for (Mode = 0; Mode < MaxMode; Mode++) {
|
||||
Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (CurrentCol == Col && CurrentRow == Row) {
|
||||
CallbackData->BmmFakeNvData.ConsoleOutMode = (UINT16) Mode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
274
MdeModulePkg/Application/UiApp/BootMaint/Data.c
Normal file
274
MdeModulePkg/Application/UiApp/BootMaint/Data.c
Normal file
@ -0,0 +1,274 @@
|
||||
/** @file
|
||||
Define some data used for Boot Maint
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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),
|
||||
};
|
||||
|
||||
///
|
||||
/// 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[4] = {
|
||||
DEVICE_PATH_MESSAGING_PC_ANSI,
|
||||
DEVICE_PATH_MESSAGING_VT_100,
|
||||
DEVICE_PATH_MESSAGING_VT_100_PLUS,
|
||||
DEVICE_PATH_MESSAGING_VT_UTF8
|
||||
};
|
123
MdeModulePkg/Application/UiApp/BootMaint/FE.vfr
Normal file
123
MdeModulePkg/Application/UiApp/BootMaint/FE.vfr
Normal file
@ -0,0 +1,123 @@
|
||||
///** @file
|
||||
//
|
||||
// File Explorer Formset
|
||||
//
|
||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// 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.DescriptionData,
|
||||
prompt = STRING_TOKEN(STR_LOAD_OPTION_DESC),
|
||||
help = STRING_TOKEN(STR_NULL_STRING),
|
||||
minsize = 6,
|
||||
maxsize = 75,
|
||||
endstring;
|
||||
|
||||
string varid = FeData.OptionalData,
|
||||
prompt = STRING_TOKEN(STR_OPTIONAL_DATA),
|
||||
help = STRING_TOKEN(STR_NULL_STRING),
|
||||
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.DescriptionData,
|
||||
prompt = STRING_TOKEN(STR_LOAD_OPTION_DESC),
|
||||
help = STRING_TOKEN(STR_NULL_STRING),
|
||||
minsize = 6,
|
||||
maxsize = 75,
|
||||
endstring;
|
||||
|
||||
string varid = FeData.OptionalData,
|
||||
prompt = STRING_TOKEN(STR_OPTIONAL_DATA),
|
||||
help = STRING_TOKEN(STR_NULL_STRING),
|
||||
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;
|
327
MdeModulePkg/Application/UiApp/BootMaint/FileExplorer.c
Normal file
327
MdeModulePkg/Application/UiApp/BootMaint/FileExplorer.c
Normal file
@ -0,0 +1,327 @@
|
||||
/** @file
|
||||
File explorer related functions.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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;
|
||||
} else {
|
||||
FormId = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
|
||||
}
|
||||
|
||||
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 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);
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
||||
|
||||
//
|
||||
// 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 || QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) {
|
||||
//
|
||||
// Apply changes and exit formset
|
||||
//
|
||||
if (FileExplorerStateAddBootOption == Private->FeCurrentState) {
|
||||
Status = Var_UpdateBootOption (Private, NvRamMap);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
BOpt_GetBootOptions (Private);
|
||||
CreateMenuStringToken (Private, Private->FeHiiHandle, &BootOptionMenu);
|
||||
} else if (FileExplorerStateAddDriverOptionState == Private->FeCurrentState) {
|
||||
Status = Var_UpdateDriverOption (
|
||||
Private,
|
||||
Private->FeHiiHandle,
|
||||
NvRamMap->DescriptionData,
|
||||
NvRamMap->OptionalData,
|
||||
NvRamMap->ForceReconnect
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
BOpt_GetDriverOptions (Private);
|
||||
CreateMenuStringToken (Private, Private->FeHiiHandle, &DriverOptionMenu);
|
||||
}
|
||||
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
|
||||
} else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_BOOT || QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER) {
|
||||
//
|
||||
// Discard changes and exit formset
|
||||
//
|
||||
NvRamMap->OptionalData[0] = 0x0000;
|
||||
NvRamMap->DescriptionData[0] = 0x0000;
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
204
MdeModulePkg/Application/UiApp/BootMaint/FormGuid.h
Normal file
204
MdeModulePkg/Application/UiApp/BootMaint/FormGuid.h
Normal file
@ -0,0 +1,204 @@
|
||||
/** @file
|
||||
Formset guids, form id and VarStore data structure for Boot Maintenance Manager.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 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];
|
||||
|
||||
//
|
||||
// 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];
|
||||
|
||||
//
|
||||
// This is the Terminal Attributes value storage
|
||||
//
|
||||
UINT8 COMBaudRate;
|
||||
UINT8 COMDataRate;
|
||||
UINT8 COMStopBits;
|
||||
UINT8 COMParity;
|
||||
UINT8 COMTerminalType;
|
||||
|
||||
//
|
||||
// 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 DescriptionData[75];
|
||||
UINT16 OptionalData[127];
|
||||
UINT8 Active;
|
||||
UINT8 ForceReconnect;
|
||||
} FILE_EXPLORER_NV_DATA;
|
||||
|
||||
#endif
|
||||
|
1194
MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
Normal file
1194
MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
Normal file
File diff suppressed because it is too large
Load Diff
1068
MdeModulePkg/Application/UiApp/BootMaint/Variable.c
Normal file
1068
MdeModulePkg/Application/UiApp/BootMaint/Variable.c
Normal file
File diff suppressed because it is too large
Load Diff
385
MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
Normal file
385
MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
Normal file
@ -0,0 +1,385 @@
|
||||
/** @file
|
||||
The platform boot manager reference implementation
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
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;
|
||||
|
||||
DeviceType = (UINT16) -1;
|
||||
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
//
|
||||
// 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);
|
||||
HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : "));
|
||||
ASSERT (HelpString != NULL);
|
||||
StrCat (HelpString, L"Device Path : ");
|
||||
StrCat (HelpString, 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);
|
||||
}
|
112
MdeModulePkg/Application/UiApp/BootMngr/BootManager.h
Normal file
112
MdeModulePkg/Application/UiApp/BootMngr/BootManager.h
Normal file
@ -0,0 +1,112 @@
|
||||
/** @file
|
||||
The platform boot manager reference implement
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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
|
BIN
MdeModulePkg/Application/UiApp/BootMngr/BootManagerStrings.uni
Normal file
BIN
MdeModulePkg/Application/UiApp/BootMngr/BootManagerStrings.uni
Normal file
Binary file not shown.
50
MdeModulePkg/Application/UiApp/BootMngr/BootManagerVfr.Vfr
Normal file
50
MdeModulePkg/Application/UiApp/BootMngr/BootManagerVfr.Vfr
Normal file
@ -0,0 +1,50 @@
|
||||
///** @file
|
||||
//
|
||||
// Browser formset.
|
||||
//
|
||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// 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;
|
796
MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.c
Normal file
796
MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.c
Normal file
@ -0,0 +1,796 @@
|
||||
/** @file
|
||||
The platform device manager reference implementation
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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;
|
||||
StrCpy(String, 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);
|
||||
}
|
||||
|
155
MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.h
Normal file
155
MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.h
Normal file
@ -0,0 +1,155 @@
|
||||
/** @file
|
||||
The platform device manager reference implement
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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.
102
MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManagerVfr.Vfr
Normal file
102
MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManagerVfr.Vfr
Normal file
@ -0,0 +1,102 @@
|
||||
///** @file
|
||||
//
|
||||
// Device Manager formset.
|
||||
//
|
||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// 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;
|
||||
|
@ -0,0 +1,45 @@
|
||||
///** @file
|
||||
//
|
||||
// Driver Health formset.
|
||||
//
|
||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// 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;
|
51
MdeModulePkg/Application/UiApp/FormsetGuid.h
Normal file
51
MdeModulePkg/Application/UiApp/FormsetGuid.h
Normal file
@ -0,0 +1,51 @@
|
||||
/** @file
|
||||
FrontPage routines to handle the callbacks and browser calls
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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
|
1601
MdeModulePkg/Application/UiApp/FrontPage.c
Normal file
1601
MdeModulePkg/Application/UiApp/FrontPage.c
Normal file
File diff suppressed because it is too large
Load Diff
278
MdeModulePkg/Application/UiApp/FrontPage.h
Normal file
278
MdeModulePkg/Application/UiApp/FrontPage.h
Normal file
@ -0,0 +1,278 @@
|
||||
/** @file
|
||||
FrontPage routines to handle the callbacks and browser calls
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 _FRONT_PAGE_H_
|
||||
#define _FRONT_PAGE_H_
|
||||
|
||||
#include "DeviceMngr/DeviceManager.h"
|
||||
#include "BootMaint/BootMaint.h"
|
||||
#include "BootMngr/BootManager.h"
|
||||
#include "String.h"
|
||||
|
||||
#include <Protocol/BootLogo.h>
|
||||
//
|
||||
// These are the VFR compiler generated data representing our VFR data.
|
||||
//
|
||||
extern UINT8 FrontPageVfrBin[];
|
||||
|
||||
extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;
|
||||
|
||||
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.
|
||||
//
|
||||
#define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001
|
||||
|
||||
//
|
||||
// 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 FRONT_PAGE_KEY_RESET 0X7654
|
||||
|
||||
#define LABEL_SELECT_LANGUAGE 0x1000
|
||||
#define LABEL_PLATFORM_INFORMATION 0x1001
|
||||
#define LABEL_END 0xffff
|
||||
|
||||
#define FRONT_PAGE_FORMSET_GUID \
|
||||
{ \
|
||||
0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \
|
||||
}
|
||||
|
||||
#define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
|
||||
//
|
||||
// HII relative handles
|
||||
//
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
EFI_HANDLE DriverHandle;
|
||||
EFI_STRING_ID *LanguageToken;
|
||||
|
||||
//
|
||||
// Produced protocols
|
||||
//
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
||||
} FRONT_PAGE_CALLBACK_DATA;
|
||||
|
||||
|
||||
#define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \
|
||||
CR (a, \
|
||||
FRONT_PAGE_CALLBACK_DATA, \
|
||||
ConfigAccess, \
|
||||
FRONT_PAGE_CALLBACK_DATA_SIGNATURE \
|
||||
)
|
||||
|
||||
/**
|
||||
This function allows a caller to extract the current configuration for one
|
||||
or more named elements from the target driver.
|
||||
|
||||
|
||||
@param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
|
||||
@param Request - A null-terminated Unicode string in <ConfigRequest> format.
|
||||
@param Progress - On return, points to a character in the Request string.
|
||||
Points to the string's null terminator if request was successful.
|
||||
Points to the most recent '&' before the first failing name/value
|
||||
pair (or the beginning of the string if the failure is in the
|
||||
first name/value pair) if the request was not successful.
|
||||
@param Results - A null-terminated Unicode string in <ConfigAltResp> format which
|
||||
has all values filled in for the names in the Request string.
|
||||
String to be allocated by the called function.
|
||||
|
||||
@retval EFI_SUCCESS The Results is filled with the requested values.
|
||||
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
|
||||
@retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
|
||||
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FakeExtractConfig (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Request,
|
||||
OUT EFI_STRING *Progress,
|
||||
OUT EFI_STRING *Results
|
||||
);
|
||||
|
||||
/**
|
||||
This function processes the results of changes in configuration.
|
||||
|
||||
|
||||
@param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
|
||||
@param Configuration - A null-terminated Unicode string in <ConfigResp> format.
|
||||
@param Progress - A pointer to a string filled in with the offset of the most
|
||||
recent '&' before the first failing name/value pair (or the
|
||||
beginning 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 is processed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Configuration is NULL.
|
||||
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FakeRouteConfig (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Configuration,
|
||||
OUT EFI_STRING *Progress
|
||||
);
|
||||
|
||||
/**
|
||||
This function processes the results of changes in configuration.
|
||||
|
||||
|
||||
@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.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FrontPageCallback (
|
||||
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
|
||||
);
|
||||
|
||||
/**
|
||||
Initialize HII information for the FrontPage
|
||||
|
||||
@retval EFI_SUCCESS The operation is successful.
|
||||
@retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitializeFrontPage (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Acquire the string associated with the ProducerGuid and return it.
|
||||
|
||||
|
||||
@param ProducerGuid - The Guid to search the HII database for
|
||||
@param Token - The token value of the string to extract
|
||||
@param String - The string that is extracted
|
||||
|
||||
@retval EFI_SUCCESS The function returns EFI_SUCCESS always.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetProducerString (
|
||||
IN EFI_GUID *ProducerGuid,
|
||||
IN EFI_STRING_ID Token,
|
||||
OUT CHAR16 **String
|
||||
);
|
||||
|
||||
/**
|
||||
This function is the main entry of the UI entry.
|
||||
The function will present the main menu of the system UI.
|
||||
|
||||
@param ConnectAllHappened Caller passes the value to UI to avoid unnecessary connect-all.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
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.
|
||||
|
||||
@param Handle The HII handle.
|
||||
|
||||
@retval NULL Fail to get the device path string.
|
||||
@return PathString Get the device path string.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
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_
|
||||
|
BIN
MdeModulePkg/Application/UiApp/FrontPageStrings.uni
Normal file
BIN
MdeModulePkg/Application/UiApp/FrontPageStrings.uni
Normal file
Binary file not shown.
149
MdeModulePkg/Application/UiApp/FrontPageVfr.Vfr
Normal file
149
MdeModulePkg/Application/UiApp/FrontPageVfr.Vfr
Normal file
@ -0,0 +1,149 @@
|
||||
///** @file
|
||||
//
|
||||
// Browser formset.
|
||||
//
|
||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// 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 { 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_END 0xffff
|
||||
|
||||
formset
|
||||
guid = FORMSET_GUID,
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
|
||||
help = STRING_TOKEN(STR_NULL_STRING),
|
||||
classguid = FORMSET_GUID,
|
||||
|
||||
form formid = FRONT_PAGE_FORM_ID,
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE);
|
||||
|
||||
banner
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_COMPUTER_MODEL),
|
||||
line 1,
|
||||
align left;
|
||||
|
||||
banner
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_CPU_MODEL),
|
||||
line 2,
|
||||
align left;
|
||||
|
||||
banner
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_CPU_SPEED),
|
||||
line 2,
|
||||
align right;
|
||||
|
||||
banner
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_BIOS_VERSION),
|
||||
line 3,
|
||||
align left;
|
||||
|
||||
banner
|
||||
title = STRING_TOKEN(STR_FRONT_PAGE_MEMORY_SIZE),
|
||||
line 3,
|
||||
align right;
|
||||
|
||||
// banner
|
||||
// title = STRING_TOKEN(STR_FRONT_PAGE_BANNER_0_LEFT),
|
||||
// line 0,
|
||||
// align left;
|
||||
|
||||
// banner
|
||||
// title = STRING_TOKEN(STR_FRONT_PAGE_BANNER_0_RIGHT),
|
||||
// line 0,
|
||||
// align right;
|
||||
|
||||
// banner
|
||||
// title = STRING_TOKEN(STR_FRONT_PAGE_BANNER_1_LEFT),
|
||||
// line 1,
|
||||
// align left;
|
||||
|
||||
// banner
|
||||
// title = STRING_TOKEN(STR_FRONT_PAGE_BANNER_1_RIGHT),
|
||||
// line 1,
|
||||
// align right;
|
||||
|
||||
// banner
|
||||
// title = STRING_TOKEN(STR_FRONT_PAGE_BANNER_2_LEFT),
|
||||
// line 2,
|
||||
// align left;
|
||||
|
||||
// banner
|
||||
// title = STRING_TOKEN(STR_FRONT_PAGE_BANNER_3_LEFT),
|
||||
// line 3,
|
||||
// align left;
|
||||
|
||||
|
||||
text
|
||||
help = STRING_TOKEN(STR_CONTINUE_HELP),
|
||||
text = STRING_TOKEN(STR_CONTINUE_PROMPT),
|
||||
flags = INTERACTIVE,
|
||||
key = FRONT_PAGE_KEY_CONTINUE;
|
||||
|
||||
label LABEL_SELECT_LANGUAGE;
|
||||
//
|
||||
// This is where we will dynamically add a OneOf type op-code to select
|
||||
// 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;
|
||||
|
||||
endform;
|
||||
|
||||
endformset;
|
309
MdeModulePkg/Application/UiApp/Language.c
Normal file
309
MdeModulePkg/Application/UiApp/Language.c
Normal file
@ -0,0 +1,309 @@
|
||||
/** @file
|
||||
Language settings
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 "Language.h"
|
||||
#include "FrontPage.h"
|
||||
|
||||
EFI_GUID mFontPackageGuid = {
|
||||
0x78941450, 0x90ab, 0x4fb1, {0xb7, 0x5f, 0x58, 0x92, 0x14, 0xe2, 0x4a, 0xc}
|
||||
};
|
||||
|
||||
#define NARROW_GLYPH_NUMBER 8
|
||||
#define WIDE_GLYPH_NUMBER 75
|
||||
|
||||
typedef struct {
|
||||
///
|
||||
/// This 4-bytes total array length is required by HiiAddPackages()
|
||||
///
|
||||
UINT32 Length;
|
||||
|
||||
//
|
||||
// This is the Font package definition
|
||||
//
|
||||
EFI_HII_PACKAGE_HEADER Header;
|
||||
UINT16 NumberOfNarrowGlyphs;
|
||||
UINT16 NumberOfWideGlyphs;
|
||||
EFI_NARROW_GLYPH NarrowArray[NARROW_GLYPH_NUMBER];
|
||||
EFI_WIDE_GLYPH WideArray[WIDE_GLYPH_NUMBER];
|
||||
} FONT_PACK_BIN;
|
||||
|
||||
FONT_PACK_BIN mFontBin = {
|
||||
sizeof (FONT_PACK_BIN),
|
||||
{
|
||||
sizeof (FONT_PACK_BIN) - sizeof (UINT32),
|
||||
EFI_HII_PACKAGE_SIMPLE_FONTS,
|
||||
},
|
||||
NARROW_GLYPH_NUMBER,
|
||||
0,
|
||||
{ // Narrow Glyphs
|
||||
{
|
||||
0x05d0,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x4E,
|
||||
0x6E,
|
||||
0x62,
|
||||
0x32,
|
||||
0x32,
|
||||
0x3C,
|
||||
0x68,
|
||||
0x4C,
|
||||
0x4C,
|
||||
0x46,
|
||||
0x76,
|
||||
0x72,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
},
|
||||
{
|
||||
0x05d1,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x78,
|
||||
0x7C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x7E,
|
||||
0x7E,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
},
|
||||
{
|
||||
0x05d2,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x78,
|
||||
0x7C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x1C,
|
||||
0x3E,
|
||||
0x66,
|
||||
0x66,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
},
|
||||
{
|
||||
0x05d3,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x7E,
|
||||
0x7E,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
},
|
||||
{
|
||||
0x05d4,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x7C,
|
||||
0x7E,
|
||||
0x06,
|
||||
0x06,
|
||||
0x06,
|
||||
0x06,
|
||||
0x66,
|
||||
0x66,
|
||||
0x66,
|
||||
0x66,
|
||||
0x66,
|
||||
0x66,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
},
|
||||
{
|
||||
0x05d5,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x3C,
|
||||
0x3C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x0C,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
},
|
||||
{
|
||||
0x05d6,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x38,
|
||||
0x38,
|
||||
0x1E,
|
||||
0x1E,
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
},
|
||||
{
|
||||
0x0000,
|
||||
0x00,
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
Routine to export glyphs to the HII database. This is in addition to whatever is defined in the Graphics Console driver.
|
||||
|
||||
**/
|
||||
EFI_HII_HANDLE
|
||||
ExportFonts (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return HiiAddPackages (
|
||||
&mFontPackageGuid,
|
||||
gImageHandle,
|
||||
&mFontBin,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Get next language from language code list (with separator ';').
|
||||
|
||||
If LangCode is NULL, then ASSERT.
|
||||
If Lang is NULL, then ASSERT.
|
||||
|
||||
@param LangCode On input: point to first language in the list. On
|
||||
output: point to next language in the list, or
|
||||
NULL if no more language in the list.
|
||||
@param Lang The first language in the list.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
GetNextLanguage (
|
||||
IN OUT CHAR8 **LangCode,
|
||||
OUT CHAR8 *Lang
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
CHAR8 *StringPtr;
|
||||
|
||||
ASSERT (LangCode != NULL);
|
||||
ASSERT (*LangCode != NULL);
|
||||
ASSERT (Lang != NULL);
|
||||
|
||||
Index = 0;
|
||||
StringPtr = *LangCode;
|
||||
while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {
|
||||
Index++;
|
||||
}
|
||||
|
||||
CopyMem (Lang, StringPtr, Index);
|
||||
Lang[Index] = 0;
|
||||
|
||||
if (StringPtr[Index] == ';') {
|
||||
Index++;
|
||||
}
|
||||
*LangCode = StringPtr + Index;
|
||||
}
|
48
MdeModulePkg/Application/UiApp/Language.h
Normal file
48
MdeModulePkg/Application/UiApp/Language.h
Normal file
@ -0,0 +1,48 @@
|
||||
/** @file
|
||||
Language setting
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 _LANGUAGE_H_
|
||||
#define _LANGUAGE_H_
|
||||
|
||||
#include "String.h"
|
||||
|
||||
/**
|
||||
Get next language from language code list (with separator ';').
|
||||
|
||||
If LangCode is NULL, then ASSERT.
|
||||
If Lang is NULL, then ASSERT.
|
||||
|
||||
@param LangCode On input: point to first language in the list. On
|
||||
output: point to next language in the list, or
|
||||
NULL if no more language in the list.
|
||||
@param Lang The first language in the list.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
GetNextLanguage (
|
||||
IN OUT CHAR8 **LangCode,
|
||||
OUT CHAR8 *Lang
|
||||
);
|
||||
|
||||
/**
|
||||
Routine to export glyphs to the HII database. This is in addition to whatever is defined in the Graphics Console driver.
|
||||
|
||||
**/
|
||||
EFI_HII_HANDLE
|
||||
ExportFonts (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif // _LANGUAGE_H_
|
67
MdeModulePkg/Application/UiApp/String.c
Normal file
67
MdeModulePkg/Application/UiApp/String.c
Normal file
@ -0,0 +1,67 @@
|
||||
/** @file
|
||||
String support
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 "Ui.h"
|
||||
#include "Language.h"
|
||||
#include "FrontPage.h"
|
||||
|
||||
EFI_HII_HANDLE gStringPackHandle;
|
||||
|
||||
EFI_GUID mUiStringPackGuid = {
|
||||
0x136a3048, 0x752a, 0x4bf6, { 0xa7, 0x57, 0x9, 0x36, 0x11, 0x95, 0x38, 0xed }
|
||||
};
|
||||
|
||||
/**
|
||||
Initialize HII global accessor for string support.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InitializeStringSupport (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
gStringPackHandle = HiiAddPackages (
|
||||
&mUiStringPackGuid,
|
||||
gImageHandle,
|
||||
UiAppStrings,
|
||||
NULL
|
||||
);
|
||||
ASSERT (gStringPackHandle != NULL);
|
||||
}
|
||||
|
||||
VOID
|
||||
UninitializeStringSupport (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
HiiRemovePackages (gStringPackHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
Get string by string id from HII Interface
|
||||
|
||||
|
||||
@param Id String ID.
|
||||
|
||||
@retval CHAR16 * String from ID.
|
||||
@retval NULL If error occurs.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
GetStringById (
|
||||
IN EFI_STRING_ID Id
|
||||
)
|
||||
{
|
||||
return HiiGetString (gStringPackHandle, Id, NULL);
|
||||
}
|
76
MdeModulePkg/Application/UiApp/String.h
Normal file
76
MdeModulePkg/Application/UiApp/String.h
Normal file
@ -0,0 +1,76 @@
|
||||
/** @file
|
||||
String support
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 _STRING_H_
|
||||
#define _STRING_H_
|
||||
|
||||
extern EFI_HII_HANDLE gStringPackHandle;
|
||||
|
||||
//
|
||||
// This is the VFR compiler generated header file which defines the
|
||||
// string identifiers.
|
||||
//
|
||||
|
||||
extern UINT8 BdsDxeStrings[];
|
||||
|
||||
//
|
||||
// String Definition Guid for BDS Platform
|
||||
//
|
||||
#define EFI_BDS_PLATFORM_GUID \
|
||||
{ \
|
||||
0x7777E939, 0xD57E, 0x4DCB, 0xA0, 0x8E, 0x64, 0xD7, 0x98, 0x57, 0x1E, 0x0F \
|
||||
}
|
||||
|
||||
/**
|
||||
Get string by string id from HII Interface
|
||||
|
||||
|
||||
@param Id String ID.
|
||||
|
||||
@retval CHAR16 * String from ID.
|
||||
@retval NULL If error occurs.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
GetStringById (
|
||||
IN EFI_STRING_ID Id
|
||||
);
|
||||
|
||||
/**
|
||||
Initialize HII global accessor for string support.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InitializeStringSupport (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
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_
|
BIN
MdeModulePkg/Application/UiApp/Strings.uni
Normal file
BIN
MdeModulePkg/Application/UiApp/Strings.uni
Normal file
Binary file not shown.
179
MdeModulePkg/Application/UiApp/Ui.h
Normal file
179
MdeModulePkg/Application/UiApp/Ui.h
Normal file
@ -0,0 +1,179 @@
|
||||
/** @file
|
||||
FrontPage routines to handle the callbacks and browser calls
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 _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/HiiSetupEnter.h>
|
||||
#include <Guid/HiiBootMaintenanceFormset.h>
|
||||
|
||||
#include <Protocol/LoadFile.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/LegacyBios.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)
|
||||
|
||||
///
|
||||
/// HII specific Vendor Device Path definition.
|
||||
///
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
} HII_VENDOR_DEVICE_PATH;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
//
|
||||
//The interface functions related to the Setup Browser Reset Reminder feature
|
||||
//
|
||||
/**
|
||||
Enable the setup browser reset reminder feature.
|
||||
This routine is used in a platform tip. If the platform policy needs the feature, use the routine to enable it.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
EnableResetReminderFeature (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Disable the setup browser reset reminder feature.
|
||||
This routine is used in a platform tip. If the platform policy does not want the feature, use the routine to disable it.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
DisableResetReminderFeature (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Record the info that a reset is required.
|
||||
A module boolean variable is used to record whether a reset is required.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
EnableResetRequired (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Record the info that no reset is required.
|
||||
A module boolean variable is used to record whether a reset is required.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
DisableResetRequired (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Check whether platform policy enables the reset reminder feature. The default is enabled.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
IsResetReminderFeatureEnable (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Check if the user changed any option setting that needs a system reset to be effective.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
IsResetRequired (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Check whether a reset is needed, and finish the reset reminder feature.
|
||||
If a reset is needed, pop up a menu to notice user, and finish the feature
|
||||
according to the user selection.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
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
|
143
MdeModulePkg/Application/UiApp/UiApp.inf
Normal file
143
MdeModulePkg/Application/UiApp/UiApp.inf
Normal file
@ -0,0 +1,143 @@
|
||||
## @file
|
||||
# UiApp module is driver for BDS phase.
|
||||
#
|
||||
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# 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.
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = UiApp
|
||||
FILE_GUID = 462CAA21-7614-4503-836E-8AB6F4662331
|
||||
MODULE_TYPE = UEFI_APPLICATION
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = InitializeUserInterface
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
[Sources]
|
||||
FrontPage.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
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
DevicePathLib
|
||||
BaseLib
|
||||
HobLib
|
||||
UefiRuntimeServicesTableLib
|
||||
ReportStatusCodeLib
|
||||
MemoryAllocationLib
|
||||
UefiLib
|
||||
UefiBootServicesTableLib
|
||||
BaseMemoryLib
|
||||
DebugLib
|
||||
PrintLib
|
||||
HiiLib
|
||||
UefiApplicationEntryPoint
|
||||
PcdLib
|
||||
UefiHiiServicesLib
|
||||
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
|
||||
|
||||
[Protocols]
|
||||
gEfiSimpleFileSystemProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiLoadFileProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiSmbiosProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiGenericMemTestProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiLegacyBiosProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## PROTOCOL SOMETIMES_CONSUMES
|
||||
gEfiBlockIoProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiGraphicsOutputProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES
|
||||
gEfiSimpleTextInputExProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiHiiConfigAccessProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiFormBrowser2ProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiSerialIoProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiDevicePathProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiPciIoProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiDevicePathToTextProtocolGuid ## PROTOCOL CONSUMES
|
||||
gEfiBootLogoProtocolGuid ## PROTOCOL CONSUMES
|
||||
|
||||
[FeaturePcd]
|
||||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
|
||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
|
29
MdeModulePkg/Include/Guid/HiiBootMaintenanceFormset.h
Normal file
29
MdeModulePkg/Include/Guid/HiiBootMaintenanceFormset.h
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
/** @file
|
||||
Guid definition for Boot Maintainence Formset.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
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 __HII_BOOT_MAINTENANCE_FORMSET_H__
|
||||
#define __HII_BOOT_MAINTENANCE_FORMSET_H__
|
||||
|
||||
///
|
||||
/// Guid define to group the item show on the Boot Menaintenance Manager Menu.
|
||||
///
|
||||
#define EFI_IFR_BOOT_MAINTENANCE_GUID \
|
||||
{ 0xb2dedc91, 0xd59f, 0x48d2, { 0x89, 0x8a, 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 } }
|
||||
|
||||
|
||||
extern EFI_GUID gEfiIfrBootMaintenanceGuid;
|
||||
|
||||
#endif
|
@ -309,6 +309,9 @@
|
||||
## Include/Guid/TtyTerm.h
|
||||
gEfiTtyTermGuid = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 }}
|
||||
|
||||
## Include/Guid/HiiBootMaintenanceFormset.h
|
||||
gEfiIfrBootMaintenanceGuid = { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89, 0x8a, 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }}
|
||||
|
||||
[Ppis]
|
||||
## Include/Ppi/AtaController.h
|
||||
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
|
||||
|
@ -280,6 +280,7 @@
|
||||
|
||||
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
|
||||
MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
|
||||
MdeModulePkg/Application/UiApp/UiApp.inf
|
||||
MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
|
||||
MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.inf
|
||||
MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
|
||||
|
Loading…
x
Reference in New Issue
Block a user