\r
#include "BootMaint.h"\r
\r
-/**\r
- Function creates a device path data structure that identically matches the\r
- device path passed in.\r
-\r
- @param DevPath A pointer to a device path data structure.\r
-\r
- @return The new copy of DevPath is created to identically match the input.\r
- @retval NULL Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-DevicePathInstanceDup (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- );\r
-\r
/**\r
Update Com Ports attributes from DevicePath\r
\r
\r
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;\r
CopyMem (&NewMenuEntry->OptionNumber, &Acpi->UID, sizeof (UINT32));\r
- NewTerminalContext->DevicePath = DevicePathInstanceDup (DevicePath);\r
+ NewTerminalContext->DevicePath = DuplicateDevicePath (DevicePath);\r
//\r
// BugBug: I have no choice, calling EfiLibStrFromDatahub will hang the system!\r
// coz' the misc data for each platform is not correct, actually it's the device path stored in\r
/**\r
Update Com Ports attributes from DevicePath\r
\r
-\r
@param DevicePath DevicePath that contains Com ports\r
\r
@retval EFI_SUCCESS The update is successful.\r
return EFI_SUCCESS;\r
}\r
\r
-/**\r
- Function creates a device path data structure that identically matches the\r
- device path passed in.\r
-\r
-\r
- @param DevPath A pointer to a device path data structure.\r
-\r
- @return The new copy of DevPath is created to identically match the input.\r
- @retval NULL Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-DevicePathInstanceDup (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- )\r
-{\r
- EFI_DEVICE_PATH_PROTOCOL *NewDevPath;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePathInst;\r
- EFI_DEVICE_PATH_PROTOCOL *Temp;\r
- UINT8 *Ptr;\r
- UINTN Size;\r
-\r
- //\r
- // get the size of an instance from the input\r
- //\r
- Temp = DevPath;\r
- DevicePathInst = GetNextDevicePathInstance (&Temp, &Size);\r
-\r
- //\r
- // Make a copy and set proper end type\r
- //\r
- NewDevPath = NULL;\r
- if (Size != 0) {\r
- NewDevPath = AllocateZeroPool (Size);\r
- ASSERT (NewDevPath != NULL);\r
- }\r
-\r
- if (NewDevPath != NULL) {\r
- CopyMem (NewDevPath, DevicePathInst, Size);\r
- Ptr = (UINT8 *) NewDevPath;\r
- Ptr += Size - sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
- Temp = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;\r
- SetDevicePathEndNode (Temp);\r
- }\r
-\r
- return NewDevPath;\r
-}\r
-\r
/**\r
Build up Console Menu based on types passed in. The type can\r
be BM_CONSOLE_IN_CONTEXT_SELECT, BM_CONSOLE_OUT_CONTEXT_SELECT\r
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;\r
NewMenuEntry->OptionNumber = Index2;\r
\r
- NewConsoleContext->DevicePath = DevicePathInstanceDup (DevicePathInst);\r
+ NewConsoleContext->DevicePath = DuplicateDevicePath (DevicePathInst);\r
NewMenuEntry->DisplayString = EfiLibStrFromDatahub (NewConsoleContext->DevicePath);\r
if (NULL == NewMenuEntry->DisplayString) {\r
NewMenuEntry->DisplayString = DevicePathToStr (NewConsoleContext->DevicePath);\r