EFI_STATUS\r
BdsLoadOptionFileSystemCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
);\r
EFI_STATUS\r
BdsLoadOptionMemMapCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
);\r
EFI_STATUS\r
BdsLoadOptionPxeCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
);\r
EFI_STATUS\r
BdsLoadOptionTftpCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
);\r
EFI_STATUS\r
BdsLoadOptionFileSystemCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
)\r
\r
BootFilePathSize = StrSize (BootFilePath);\r
if (BootFilePathSize == 2) {\r
- *DevicePathNode = NULL;\r
+ *DevicePathNodes = NULL;\r
return EFI_NOT_FOUND;\r
}\r
\r
// Create the FilePath Device Path node\r
- FilePathDevicePath = (FILEPATH_DEVICE_PATH*)AllocatePool(SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize);\r
+ FilePathDevicePath = (FILEPATH_DEVICE_PATH*)AllocatePool(SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize + END_DEVICE_PATH_LENGTH);\r
FilePathDevicePath->Header.Type = MEDIA_DEVICE_PATH;\r
FilePathDevicePath->Header.SubType = MEDIA_FILEPATH_DP;\r
SetDevicePathNodeLength (FilePathDevicePath, SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize);\r
CopyMem (FilePathDevicePath->PathName, BootFilePath, BootFilePathSize);\r
+ SetDevicePathEndNode ((VOID*)((UINTN)FilePathDevicePath + SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize));\r
\r
if (BootType != NULL || Attributes != NULL) {\r
Status = BootDeviceGetType (FilePathDevicePath->PathName, BootType, Attributes);\r
if (EFI_ERROR(Status)) {\r
FreePool (FilePathDevicePath);\r
} else {\r
- *DevicePathNode = (EFI_DEVICE_PATH_PROTOCOL*)FilePathDevicePath;\r
+ *DevicePathNodes = (EFI_DEVICE_PATH_PROTOCOL*)FilePathDevicePath;\r
}\r
\r
return Status;\r
EFI_STATUS\r
BdsLoadOptionMemMapCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
)\r
if (EFI_ERROR(Status)) {\r
FreePool (MemMapDevicePath);\r
} else {\r
- *DevicePathNode = (EFI_DEVICE_PATH_PROTOCOL*)MemMapDevicePath;\r
+ *DevicePathNodes = (EFI_DEVICE_PATH_PROTOCOL*)MemMapDevicePath;\r
}\r
\r
return Status;\r
EFI_STATUS\r
BdsLoadOptionPxeCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
)\r
{\r
- *DevicePathNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
- SetDevicePathEndNode (*DevicePathNode);\r
+ *DevicePathNodes = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
+ SetDevicePathEndNode (*DevicePathNodes);\r
*BootType = BDS_LOADER_EFI_APPLICATION;\r
return EFI_SUCCESS;\r
}\r
EFI_STATUS\r
BdsLoadOptionTftpCreateDevicePath (\r
IN CHAR16* FileName,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes,\r
OUT ARM_BDS_LOADER_TYPE *BootType,\r
OUT UINT32 *Attributes\r
)\r
}\r
\r
// Allocate the memory for the IPv4 + File Path Device Path Nodes\r
- IPv4DevicePathNode = (IPv4_DEVICE_PATH*)AllocatePool(sizeof(IPv4_DEVICE_PATH) + SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize);\r
+ IPv4DevicePathNode = (IPv4_DEVICE_PATH*)AllocatePool(sizeof(IPv4_DEVICE_PATH) + SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize + END_DEVICE_PATH_LENGTH);\r
\r
// Create the IPv4 Device Path\r
IPv4DevicePathNode->Header.Type = MESSAGING_DEVICE_PATH;\r
SetDevicePathNodeLength (FilePathDevicePath, SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize);\r
CopyMem (FilePathDevicePath->PathName, BootFilePath, BootFilePathSize);\r
\r
+ // Set the End Device Path Node\r
+ SetDevicePathEndNode ((VOID*)((UINTN)FilePathDevicePath + SIZE_OF_FILEPATH_DEVICE_PATH + BootFilePathSize));\r
+\r
if (BootType != NULL || Attributes != NULL) {\r
Status = BootDeviceGetType (NULL, BootType, Attributes);\r
}\r
if (EFI_ERROR(Status)) {\r
FreePool (IPv4DevicePathNode);\r
} else {\r
- *DevicePathNode = (EFI_DEVICE_PATH_PROTOCOL*)IPv4DevicePathNode;\r
+ *DevicePathNodes = (EFI_DEVICE_PATH_PROTOCOL*)IPv4DevicePathNode;\r
}\r
\r
return Status;\r