]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkModulePkg BdsDxe: Remove redundant functions
authorshenglei <shenglei.zhang@intel.com>
Wed, 8 Aug 2018 02:29:00 +0000 (10:29 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 24 Aug 2018 05:46:18 +0000 (22:46 -0700)
The redundant functions which are never called have been
removed. They are GetProducerString,ChangeVariableDevicePath,
EfiReallocatePool,Var_UpdateAllConsoleOption and BOpt_IsEfiApp.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h

index d27113c01544588f655a1d84fe82f45b2d699aa7..a7ff449557ef0ae4eeb6b57acb466341f525f06b 100644 (file)
@@ -323,42 +323,6 @@ EfiDevicePathInstanceCount (
   return Count;\r
 }\r
 \r
-/**\r
-  Adjusts the size of a previously allocated buffer.\r
-\r
-\r
-  @param OldPool         - A pointer to the buffer whose size is being adjusted.\r
-  @param OldSize         - The size of the current buffer.\r
-  @param NewSize         - The size of the new buffer.\r
-\r
-  @return   The newly allocated buffer.\r
-  @retval   NULL  Allocation failed.\r
-\r
-**/\r
-VOID *\r
-EfiReallocatePool (\r
-  IN VOID                 *OldPool,\r
-  IN UINTN                OldSize,\r
-  IN UINTN                NewSize\r
-  )\r
-{\r
-  VOID  *NewPool;\r
-\r
-  NewPool = NULL;\r
-  if (NewSize != 0) {\r
-    NewPool = AllocateZeroPool (NewSize);\r
-  }\r
-\r
-  if (OldPool != NULL) {\r
-    if (NewPool != NULL) {\r
-      CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
-    }\r
-\r
-    FreePool (OldPool);\r
-  }\r
-\r
-  return NewPool;\r
-}\r
 \r
 /**\r
   Get a string from the Data Hub record based on\r
index bdd22c8e7513e2b2d160c57622fd05c6db6981dc..b3b905d7ef66a9f2a640b1f7161f8c9dd1e3734e 100644 (file)
@@ -548,22 +548,6 @@ BOpt_IsEfiImageName (
   IN UINT16  *FileName\r
   );\r
 \r
-/**\r
-\r
-  Check whether current FileName point to a valid Efi Application\r
-\r
-  @param Dir       Pointer to current Directory\r
-  @param FileName  Pointer to current File name.\r
-\r
-  @retval TRUE      Is a valid Efi Application\r
-  @retval FALSE     not a valid Efi Application\r
-\r
-**/\r
-BOOLEAN\r
-BOpt_IsEfiApp (\r
-  IN EFI_FILE_HANDLE Dir,\r
-  IN UINT16          *FileName\r
-  );\r
 \r
 /**\r
 \r
@@ -702,18 +686,6 @@ FreeAllConsoles (
   VOID\r
   );\r
 \r
-/**\r
-  Update the device path that describing a terminal device\r
-  based on the new BaudRate, Data Bits, parity and Stop Bits\r
-  set.\r
-\r
-  @param DevicePath     The devicepath protocol instance wanted to be updated.\r
-\r
-**/\r
-VOID\r
-ChangeVariableDevicePath (\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  );\r
 \r
 /**\r
   Update the multi-instance device path of Terminal Device based on\r
@@ -875,15 +847,6 @@ Var_UpdateErrorOutOption (
   VOID\r
   );\r
 \r
-/**\r
-  Update the device path of "ConOut", "ConIn" and "ErrOut" based on the new BaudRate, Data Bits,\r
-  parity and stop Bits set.\r
-\r
-**/\r
-VOID\r
-Var_UpdateAllConsoleOption (\r
-  VOID\r
-  );\r
 \r
 /**\r
   This function update the "BootNext" EFI Variable. If there is no "BootNex" specified in BMM,\r
@@ -1154,22 +1117,6 @@ EfiLibFileInfo (
   IN EFI_FILE_HANDLE      FHand\r
   );\r
 \r
-/**\r
-  Adjusts the size of a previously allocated buffer.\r
-\r
-  @param OldPool         A pointer to the buffer whose size is being adjusted.\r
-  @param OldSize         The size of the current buffer.\r
-  @param NewSize         The size of the new buffer.\r
-\r
-  @return   The newly allocated buffer. if NULL, allocation failed.\r
-\r
-**/\r
-VOID*\r
-EfiReallocatePool (\r
-  IN VOID                 *OldPool,\r
-  IN UINTN                OldSize,\r
-  IN UINTN                NewSize\r
-  );\r
 \r
 /**\r
   Function deletes the variable specified by VarName and VarGuid.\r
index 895f13f21435a7eddc080330e0499782d32576f1..c4a0e17f3bf1b21f3dc175570b26618b3a1b2288 100644 (file)
@@ -1192,69 +1192,7 @@ BOpt_IsEfiImageName (
   return FALSE;\r
 }\r
 \r
-/**\r
-\r
-  Check whether current FileName point to a valid Efi Application\r
-\r
-  @param Dir       Pointer to current Directory\r
-  @param FileName  Pointer to current File name.\r
-\r
-  @retval TRUE      Is a valid Efi Application\r
-  @retval FALSE     not a valid Efi Application\r
-\r
-**/\r
-BOOLEAN\r
-BOpt_IsEfiApp (\r
-  IN EFI_FILE_HANDLE Dir,\r
-  IN UINT16          *FileName\r
-  )\r
-{\r
-  UINTN                       BufferSize;\r
-  EFI_IMAGE_DOS_HEADER        DosHdr;\r
-  UINT16                      Subsystem;\r
-  EFI_FILE_HANDLE             File;\r
-  EFI_STATUS                  Status;\r
-  EFI_IMAGE_OPTIONAL_HEADER_UNION PeHdr;\r
-\r
-  Status = Dir->Open (Dir, &File, FileName, EFI_FILE_MODE_READ, 0);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return FALSE;\r
-  }\r
-\r
-  BufferSize = sizeof (EFI_IMAGE_DOS_HEADER);\r
-  File->Read (File, &BufferSize, &DosHdr);\r
-  if (DosHdr.e_magic != EFI_IMAGE_DOS_SIGNATURE) {\r
-    File->Close (File);\r
-    return FALSE;\r
-  }\r
 \r
-  File->SetPosition (File, DosHdr.e_lfanew);\r
-  BufferSize = sizeof (EFI_IMAGE_OPTIONAL_HEADER_UNION);\r
-  File->Read (File, &BufferSize, &PeHdr);\r
-  if (PeHdr.Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {\r
-    File->Close (File);\r
-    return FALSE;\r
-  }\r
-  //\r
-  // Determine PE type and read subsytem\r
-  //\r
-  if (PeHdr.Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\r
-    Subsystem = PeHdr.Pe32.OptionalHeader.Subsystem;\r
-  } else if (PeHdr.Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {\r
-    Subsystem = PeHdr.Pe32Plus.OptionalHeader.Subsystem;\r
-  } else {\r
-    return FALSE;\r
-  }\r
-\r
-  if (Subsystem == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) {\r
-    File->Close (File);\r
-    return TRUE;\r
-  } else {\r
-    File->Close (File);\r
-    return FALSE;\r
-  }\r
-}\r
 \r
 /**\r
 \r
index 964d8850efe5026cb994803aa97c1f2de47bd299..33b53bf3b673c33dbc1dc0cd9cac8720021932d4 100644 (file)
@@ -218,71 +218,7 @@ ChangeTerminalDevicePath (
 \r
 }\r
 \r
-/**\r
-  Update the device path that describing a terminal device\r
-  based on the new BaudRate, Data Bits, parity and Stop Bits\r
-  set.\r
-\r
-  @param DevicePath terminal device's path\r
-\r
-**/\r
-VOID\r
-ChangeVariableDevicePath (\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-{\r
-  EFI_DEVICE_PATH_PROTOCOL  *Node;\r
-  ACPI_HID_DEVICE_PATH      *Acpi;\r
-  UART_DEVICE_PATH          *Uart;\r
-  UINTN                     Com;\r
-  BM_TERMINAL_CONTEXT       *NewTerminalContext;\r
-  BM_MENU_ENTRY             *NewMenuEntry;\r
 \r
-  Node  = DevicePath;\r
-  Node  = NextDevicePathNode (Node);\r
-  Com   = 0;\r
-  while (!IsDevicePathEnd (Node)) {\r
-    Acpi = (ACPI_HID_DEVICE_PATH *) Node;\r
-    if (IsIsaSerialNode (Acpi)) {\r
-      CopyMem (&Com, &Acpi->UID, sizeof (UINT32));\r
-    }\r
-\r
-    if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (Node) == MSG_UART_DP)) {\r
-      NewMenuEntry = BOpt_GetMenuEntry (\r
-                      &TerminalMenu,\r
-                      Com\r
-                      );\r
-      ASSERT (NewMenuEntry != NULL);\r
-      NewTerminalContext  = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;\r
-      Uart                = (UART_DEVICE_PATH *) Node;\r
-      CopyMem (\r
-        &Uart->BaudRate,\r
-        &NewTerminalContext->BaudRate,\r
-        sizeof (UINT64)\r
-        );\r
-\r
-      CopyMem (\r
-        &Uart->DataBits,\r
-        &NewTerminalContext->DataBits,\r
-        sizeof (UINT8)\r
-        );\r
-\r
-      CopyMem (\r
-        &Uart->Parity,\r
-        &NewTerminalContext->Parity,\r
-        sizeof (UINT8)\r
-        );\r
-\r
-      CopyMem (\r
-        &Uart->StopBits,\r
-        &NewTerminalContext->StopBits,\r
-        sizeof (UINT8)\r
-        );\r
-    }\r
-\r
-    Node = NextDevicePathNode (Node);\r
-  }\r
-}\r
 \r
 /**\r
   Retrieve ACPI UID of UART from device path\r
index ea798fab9ded426cf542226b613dd8547fb2cb7e..2a7bdb13a80e53e6f13e6c9f49fd4490698945ed 100644 (file)
@@ -312,70 +312,7 @@ Var_ChangeDriverOrder (
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  Update the device path of "ConOut", "ConIn" and "ErrOut"\r
-  based on the new BaudRate, Data Bits, parity and Stop Bits\r
-  set.\r
-\r
-**/\r
-VOID\r
-Var_UpdateAllConsoleOption (\r
-  VOID\r
-  )\r
-{\r
-  EFI_DEVICE_PATH_PROTOCOL  *OutDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  *InpDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  *ErrDevicePath;\r
-  EFI_STATUS                Status;\r
 \r
-  OutDevicePath = EfiLibGetVariable (L"ConOut", &gEfiGlobalVariableGuid);\r
-  InpDevicePath = EfiLibGetVariable (L"ConIn", &gEfiGlobalVariableGuid);\r
-  ErrDevicePath = EfiLibGetVariable (L"ErrOut", &gEfiGlobalVariableGuid);\r
-  if (OutDevicePath != NULL) {\r
-    ChangeVariableDevicePath (OutDevicePath);\r
-    Status = gRT->SetVariable (\r
-                    L"ConOut",\r
-                    &gEfiGlobalVariableGuid,\r
-                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
-                    GetDevicePathSize (OutDevicePath),\r
-                    OutDevicePath\r
-                    );\r
-    //\r
-    // Changing variable without increasing its size with current variable implementation shouldn't fail.\r
-    //\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  if (InpDevicePath != NULL) {\r
-    ChangeVariableDevicePath (InpDevicePath);\r
-    Status = gRT->SetVariable (\r
-                    L"ConIn",\r
-                    &gEfiGlobalVariableGuid,\r
-                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
-                    GetDevicePathSize (InpDevicePath),\r
-                    InpDevicePath\r
-                    );\r
-    //\r
-    // Changing variable without increasing its size with current variable implementation shouldn't fail.\r
-    //\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  if (ErrDevicePath != NULL) {\r
-    ChangeVariableDevicePath (ErrDevicePath);\r
-    Status = gRT->SetVariable (\r
-                    L"ErrOut",\r
-                    &gEfiGlobalVariableGuid,\r
-                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
-                    GetDevicePathSize (ErrDevicePath),\r
-                    ErrDevicePath\r
-                    );\r
-    //\r
-    // Changing variable without increasing its size with current variable implementation shouldn't fail.\r
-    //\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-}\r
 \r
 /**\r
   This function delete and build multi-instance device path for\r
index bdf63eabbf3ec3315b9d1eb6af64a4d59d7bea90..46fdc53f2b87801128c01c3f8c2b568fb44aecca 100644 (file)
@@ -569,35 +569,6 @@ CallFrontPage (
   return Status;\r
 }\r
 \r
-/**\r
-  Acquire the string associated with the ProducerGuid and return it.\r
-\r
-\r
-  @param ProducerGuid    The Guid to search the HII database for\r
-  @param Token           The token value of the string to extract\r
-  @param String          The string that is extracted\r
-\r
-  @retval  EFI_SUCCESS  The function returns EFI_SUCCESS always.\r
-\r
-**/\r
-EFI_STATUS\r
-GetProducerString (\r
-  IN      EFI_GUID                  *ProducerGuid,\r
-  IN      EFI_STRING_ID             Token,\r
-  OUT     CHAR16                    **String\r
-  )\r
-{\r
-  EFI_STRING      TmpString;\r
-\r
-  TmpString = HiiGetPackageString (ProducerGuid, Token, NULL);\r
-  if (TmpString == NULL) {\r
-    *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));\r
-  } else {\r
-    *String = TmpString;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
 \r
 /**\r
   Convert Processor Frequency Data to a string.\r
index bc2c0612d0495630361d56a1a361e15c8078f80d..7e6290fd62b82f07029fbc869b0e6a84baf64010 100644 (file)
@@ -198,23 +198,6 @@ InitializeFrontPage (
   IN BOOLEAN    InitializeHiiData\r
   );\r
 \r
-/**\r
-  Acquire the string associated with the ProducerGuid and return it.\r
-\r
-\r
-  @param ProducerGuid    - The Guid to search the HII database for\r
-  @param Token           - The token value of the string to extract\r
-  @param String          - The string that is extracted\r
-\r
-  @retval  EFI_SUCCESS  The function returns EFI_SUCCESS always.\r
-\r
-**/\r
-EFI_STATUS\r
-GetProducerString (\r
-  IN      EFI_GUID                  *ProducerGuid,\r
-  IN      EFI_STRING_ID             Token,\r
-  OUT     CHAR16                    **String\r
-  );\r
 \r
 /**\r
   This function is the main entry of the platform setup entry.\r