//\r
// Template for an end-of-device path node.\r
//\r
-EFI_DEVICE_PATH_PROTOCOL mEndDevicePath = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_PROTOCOL mUefiDevicePathLibEndDevicePath = {\r
END_DEVICE_PATH_TYPE,\r
END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
{\r
// Search for the end of the device path structure\r
//\r
Start = DevicePath;\r
- while (!EfiIsDevicePathEnd (DevicePath)) {\r
- DevicePath = EfiNextDevicePathNode (DevicePath);\r
+ while (!IsDevicePathEnd (DevicePath)) {\r
+ DevicePath = NextDevicePathNode (DevicePath);\r
}\r
\r
//\r
// Compute the size and add back in the size of the end device path structure\r
//\r
- return ((UINTN) DevicePath - (UINTN) Start) + EfiDevicePathNodeLength (DevicePath);\r
+ return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);\r
}\r
\r
/**\r
// If there's only 1 path, just duplicate it.\r
//\r
if (FirstDevicePath == NULL) {\r
- return DuplicateDevicePath ((SecondDevicePath != NULL) ? SecondDevicePath : &mEndDevicePath);\r
+ return DuplicateDevicePath ((SecondDevicePath != NULL) ? SecondDevicePath : &mUefiDevicePathLibEndDevicePath);\r
}\r
\r
if (SecondDevicePath == NULL) {\r
//\r
Size1 = GetDevicePathSize (FirstDevicePath);\r
Size2 = GetDevicePathSize (SecondDevicePath);\r
- Size = Size1 + Size2 - EFI_END_DEVICE_PATH_LENGTH;\r
+ Size = Size1 + Size2 - END_DEVICE_PATH_LENGTH;\r
\r
NewDevicePath = AllocatePool (Size);\r
\r
// Over write FirstDevicePath EndNode and do the copy\r
//\r
DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath +\r
- (Size1 - EFI_END_DEVICE_PATH_LENGTH));\r
+ (Size1 - END_DEVICE_PATH_LENGTH));\r
CopyMem (DevicePath2, SecondDevicePath, Size2);\r
}\r
\r
UINTN NodeLength;\r
\r
if (DevicePathNode == NULL) {\r
- return DuplicateDevicePath ((DevicePath != NULL) ? DevicePath : &mEndDevicePath);\r
+ return DuplicateDevicePath ((DevicePath != NULL) ? DevicePath : &mUefiDevicePathLibEndDevicePath);\r
}\r
//\r
// Build a Node that has a terminator on it\r
//\r
NodeLength = DevicePathNodeLength (DevicePathNode);\r
\r
- TempDevicePath = AllocatePool (NodeLength + EFI_END_DEVICE_PATH_LENGTH);\r
+ TempDevicePath = AllocatePool (NodeLength + END_DEVICE_PATH_LENGTH);\r
if (TempDevicePath == NULL) {\r
return NULL;\r
}\r
}\r
\r
Node = DevicePath;\r
- while (!EfiIsDevicePathEnd (Node)) {\r
- if (EfiIsDevicePathEndInstance (Node)) {\r
+ while (!IsDevicePathEnd (Node)) {\r
+ if (IsDevicePathEndInstance (Node)) {\r
return TRUE;\r
}\r
\r
- Node = EfiNextDevicePathNode (Node);\r
+ Node = NextDevicePathNode (Node);\r
}\r
\r
return FALSE;\r
IN CONST CHAR16 *FileName\r
)\r
{\r
- UINTN Size;\r
+ UINT16 Size;\r
FILEPATH_DEVICE_PATH *FilePath;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
EFI_DEVICE_PATH_PROTOCOL *FileDevicePath;\r
\r
DevicePath = NULL;\r
\r
- Size = StrSize (FileName);\r
- FileDevicePath = AllocatePool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + EFI_END_DEVICE_PATH_LENGTH);\r
+ Size = (UINT16) StrSize (FileName);\r
+ \r
+ FileDevicePath = AllocatePool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + END_DEVICE_PATH_LENGTH);\r
if (FileDevicePath != NULL) {\r
FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePath;\r
FilePath->Header.Type = MEDIA_DEVICE_PATH;\r