[edk2] [Patch] Remove the useless code to fix build failure caused by error depend on IntelFrameworkModulePkg.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong eric.d...@intel.com --- .../Application/UiApp/BootMaint/BootOption.c | 58 -- .../Application/UiApp/BootMaint/UpdatePage.c | 29 --- MdeModulePkg/Application/UiApp/Ui.h| 2 - MdeModulePkg/Application/UiApp/UiApp.inf | 4 -- 4 files changed, 93 deletions(-) diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c b/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c index a5bd796..1ad93bf 100644 --- a/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c +++ b/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c @@ -236,17 +236,12 @@ BOpt_FindFileSystem ( BM_MENU_ENTRY *MenuEntry; BM_FILE_CONTEXT *FileContext; UINT16*TempStr; UINTN OptionNumber; VOID *Buffer; - EFI_LEGACY_BIOS_PROTOCOL *LegacyBios; - UINT16DeviceType; - BBS_BBS_DEVICE_PATH BbsDevicePathNode; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; BOOLEAN RemovableMedia; - NoSimpleFsHandles = 0; NoLoadFileHandles = 0; OptionNumber = 0; InitializeListHead (FsOptionMenu.Head); @@ -442,63 +437,10 @@ BOpt_FindFileSystem ( if (NoLoadFileHandles != 0) { FreePool (LoadFileHandle); } // - // Add Legacy Boot Option Support Here - // - Status = gBS-LocateProtocol ( - gEfiLegacyBiosProtocolGuid, - NULL, - (VOID **) LegacyBios - ); - if (!EFI_ERROR (Status)) { - -for (Index = BBS_TYPE_FLOPPY; Index = BBS_TYPE_EMBEDDED_NETWORK; Index++) { - MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT); - if (NULL == MenuEntry) { -return EFI_OUT_OF_RESOURCES; - } - - FileContext = (BM_FILE_CONTEXT *) MenuEntry-VariableContext; - - FileContext-IsRemovableMedia = FALSE; - FileContext-IsLoadFile = TRUE; - FileContext-IsBootLegacy = TRUE; - DeviceType= (UINT16) Index; - BbsDevicePathNode.Header.Type = BBS_DEVICE_PATH; - BbsDevicePathNode.Header.SubType = BBS_BBS_DP; - SetDevicePathNodeLength ( -BbsDevicePathNode.Header, -sizeof (BBS_BBS_DEVICE_PATH) -); - BbsDevicePathNode.DeviceType = DeviceType; - BbsDevicePathNode.StatusFlag = 0; - BbsDevicePathNode.String[0] = 0; - DevicePath = AppendDevicePathNode ( -EndDevicePath, -(EFI_DEVICE_PATH_PROTOCOL *) BbsDevicePathNode -); - - FileContext-DevicePath = DevicePath; - MenuEntry-HelpString = UiDevicePathToStr (FileContext-DevicePath); - - TempStr = MenuEntry-HelpString; - MenuEntry-DisplayString = AllocateZeroPool (MAX_CHAR); - ASSERT (MenuEntry-DisplayString != NULL); - UnicodeSPrint ( -MenuEntry-DisplayString, -MAX_CHAR, -LBoot Legacy [%s], -TempStr -); - MenuEntry-OptionNumber = OptionNumber; - OptionNumber++; - InsertTailList (FsOptionMenu.Head, MenuEntry-Link); -} - } - // // Remember how many file system options are here // FsOptionMenu.MenuNumber = OptionNumber; return EFI_SUCCESS; } diff --git a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c index ea96d13..938912b 100644 --- a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c +++ b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c @@ -230,39 +230,10 @@ UpdateConCOMPage ( } UpdatePageEnd (CallbackData); } -/** - - IsShellNodeDevicePath checks for the Shell device path. - If it's the shell device path then return TRUE otherwise - return FALSE. - - @param DevicePathThe DevicePath to check - - @retval TRUEDevicePath is Shell - @retval FALSE DevicePath is not Shell - -**/ -BOOLEAN -IsShellNodeDevicePath( - IN EFI_DEVICE_PATH_PROTOCOL *FilePath - ) -{ - - EFI_DEVICE_PATH_PROTOCOL *Node; - - for (Node = FilePath; !IsDevicePathEnd(Node); Node = NextDevicePathNode(Node)) - { -if ((DevicePathType (Node) == MEDIA_DEVICE_PATH) (DevicePathSubType (Node) == MEDIA_PIWG_FW_FILE_DP)) { - if (!CompareMem(PcdGetPtr(PcdShellFile), (((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)Node)-FvFileName), sizeof(EFI_GUID))) - return TRUE; -} - } - return FALSE; -} /** Create a list of boot option from global BootOptionMenu. It allow user to delete the boot option. diff --git a/MdeModulePkg/Application/UiApp/Ui.h b/MdeModulePkg/Application/UiApp/Ui.h index 6075b64..7ce7d47 100644 --- a/MdeModulePkg/Application/UiApp/Ui.h +++ b/MdeModulePkg/Application/UiApp/Ui.h @@ -25,11 +25,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
Re: [edk2] [Patch] Remove the useless code to fix build failure caused by error depend on IntelFrameworkModulePkg.
Reviewed-by: Liming Gao liming@intel.com -Original Message- From: Dong, Eric Sent: Friday, July 31, 2015 9:32 AM To: Ni, Ruiyu; Gao, Liming; edk2-devel@lists.01.org Subject: [Patch] Remove the useless code to fix build failure caused by error depend on IntelFrameworkModulePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong eric.d...@intel.com --- .../Application/UiApp/BootMaint/BootOption.c | 58 -- .../Application/UiApp/BootMaint/UpdatePage.c | 29 --- MdeModulePkg/Application/UiApp/Ui.h| 2 - MdeModulePkg/Application/UiApp/UiApp.inf | 4 -- 4 files changed, 93 deletions(-) diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c b/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c index a5bd796..1ad93bf 100644 --- a/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c +++ b/MdeModulePkg/Application/UiApp/BootMaint/BootOption.c @@ -236,17 +236,12 @@ BOpt_FindFileSystem ( BM_MENU_ENTRY *MenuEntry; BM_FILE_CONTEXT *FileContext; UINT16*TempStr; UINTN OptionNumber; VOID *Buffer; - EFI_LEGACY_BIOS_PROTOCOL *LegacyBios; - UINT16DeviceType; - BBS_BBS_DEVICE_PATH BbsDevicePathNode; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; BOOLEAN RemovableMedia; - NoSimpleFsHandles = 0; NoLoadFileHandles = 0; OptionNumber = 0; InitializeListHead (FsOptionMenu.Head); @@ -442,63 +437,10 @@ BOpt_FindFileSystem ( if (NoLoadFileHandles != 0) { FreePool (LoadFileHandle); } // - // Add Legacy Boot Option Support Here - // - Status = gBS-LocateProtocol ( - gEfiLegacyBiosProtocolGuid, - NULL, - (VOID **) LegacyBios - ); - if (!EFI_ERROR (Status)) { - -for (Index = BBS_TYPE_FLOPPY; Index = BBS_TYPE_EMBEDDED_NETWORK; Index++) { - MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT); - if (NULL == MenuEntry) { -return EFI_OUT_OF_RESOURCES; - } - - FileContext = (BM_FILE_CONTEXT *) MenuEntry-VariableContext; - - FileContext-IsRemovableMedia = FALSE; - FileContext-IsLoadFile = TRUE; - FileContext-IsBootLegacy = TRUE; - DeviceType= (UINT16) Index; - BbsDevicePathNode.Header.Type = BBS_DEVICE_PATH; - BbsDevicePathNode.Header.SubType = BBS_BBS_DP; - SetDevicePathNodeLength ( -BbsDevicePathNode.Header, -sizeof (BBS_BBS_DEVICE_PATH) -); - BbsDevicePathNode.DeviceType = DeviceType; - BbsDevicePathNode.StatusFlag = 0; - BbsDevicePathNode.String[0] = 0; - DevicePath = AppendDevicePathNode ( -EndDevicePath, -(EFI_DEVICE_PATH_PROTOCOL *) BbsDevicePathNode -); - - FileContext-DevicePath = DevicePath; - MenuEntry-HelpString = UiDevicePathToStr (FileContext-DevicePath); - - TempStr = MenuEntry-HelpString; - MenuEntry-DisplayString = AllocateZeroPool (MAX_CHAR); - ASSERT (MenuEntry-DisplayString != NULL); - UnicodeSPrint ( -MenuEntry-DisplayString, -MAX_CHAR, -LBoot Legacy [%s], -TempStr -); - MenuEntry-OptionNumber = OptionNumber; - OptionNumber++; - InsertTailList (FsOptionMenu.Head, MenuEntry-Link); -} - } - // // Remember how many file system options are here // FsOptionMenu.MenuNumber = OptionNumber; return EFI_SUCCESS; } diff --git a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c index ea96d13..938912b 100644 --- a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c +++ b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c @@ -230,39 +230,10 @@ UpdateConCOMPage ( } UpdatePageEnd (CallbackData); } -/** - - IsShellNodeDevicePath checks for the Shell device path. - If it's the shell device path then return TRUE otherwise - return FALSE. - - @param DevicePathThe DevicePath to check - - @retval TRUEDevicePath is Shell - @retval FALSE DevicePath is not Shell - -**/ -BOOLEAN -IsShellNodeDevicePath( - IN EFI_DEVICE_PATH_PROTOCOL *FilePath - ) -{ - - EFI_DEVICE_PATH_PROTOCOL *Node; - - for (Node = FilePath; !IsDevicePathEnd(Node); Node = NextDevicePathNode(Node)) - { -if ((DevicePathType (Node) == MEDIA_DEVICE_PATH) (DevicePathSubType (Node) == MEDIA_PIWG_FW_FILE_DP)) { - if (!CompareMem(PcdGetPtr(PcdShellFile), (((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)Node)-FvFileName), sizeof(EFI_GUID))) - return TRUE; -} - } - return FALSE; -} /** Create a list of boot option from global BootOptionMenu. It allow user to delete the boot option.