\r
#include "DevicePath.h"\r
\r
+/**\r
+ Returns the size of a device path in bytes.\r
+\r
+ This function returns the size, in bytes, of the device path data structure specified by\r
+ DevicePath including the end of device path node. If DevicePath is NULL, then 0 is returned.\r
+\r
+ @param DevicePath A pointer to a device path data structure.\r
+\r
+ @return The size of a device path in bytes.\r
+\r
+**/\r
UINTN\r
+EFIAPI\r
GetDevicePathSizeProtocolInterface (\r
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
)\r
-/*++\r
+{\r
+ return GetDevicePathSize (DevicePath);\r
+}\r
\r
- Routine Description:\r
- Returns the size of the device path, in bytes.\r
\r
- Arguments:\r
- DevicePath - Points to the start of the EFI device path.\r
+/**\r
+ Creates a new device path by appending a second device path to a first device path.\r
\r
- Returns:\r
- Size - Size of the specified device path, in bytes, including the end-of-path tag.\r
+ This function allocates space for a new copy of the device path specified by DevicePath. If\r
+ DevicePath is NULL, then NULL is returned. If the memory is successfully allocated, then the\r
+ contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
+ is returned. Otherwise, NULL is returned.\r
\r
---*/\r
-{\r
- return GetDevicePathSize (DevicePath);\r
-}\r
+ @param DevicePath A pointer to a device path data structure.\r
+\r
+ @return A pointer to the duplicated device path.\r
\r
+**/\r
EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
DuplicateDevicePathProtocolInterface (\r
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
)\r
-/*++\r
+{\r
+ return DuplicateDevicePath (DevicePath);\r
+}\r
\r
- Routine Description:\r
- Create a duplicate of the specified path.\r
+/**\r
+ Creates a new device path by appending a second device path to a first device path.\r
\r
- Arguments:\r
- DevicePath - Points to the source EFI device path.\r
+ This function creates a new device path by appending a copy of SecondDevicePath to a copy of\r
+ FirstDevicePath in a newly allocated buffer. Only the end-of-device-path device node from\r
+ SecondDevicePath is retained. The newly created device path is returned.\r
+ If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.\r
+ If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.\r
+ If both FirstDevicePath and SecondDevicePath are NULL, then a copy of an end-of-device-path is\r
+ returned.\r
+ If there is not enough memory for the newly allocated buffer, then NULL is returned.\r
+ The memory for the new device path is allocated from EFI boot services memory. It is the\r
+ responsibility of the caller to free the memory allocated.\r
\r
- Returns:\r
- Pointer - A pointer to the duplicate device path.\r
- NULL - Insufficient memory.\r
+ @param FirstDevicePath A pointer to a device path data structure.\r
+ @param SecondDevicePath A pointer to a device path data structure.\r
\r
---*/\r
-{\r
- return DuplicateDevicePath (DevicePath);\r
-}\r
+ @return A pointer to the new device path.\r
\r
+**/\r
EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
AppendDevicePathProtocolInterface (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2\r
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,\r
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath\r
)\r
-/*++\r
+{\r
+ return AppendDevicePath (FirstDevicePath, SecondDevicePath);\r
+}\r
\r
- Routine Description:\r
- Create a new path by appending the second device path to the first.\r
+/**\r
+ Creates a new path by appending the device node to the device path.\r
\r
- Arguments:\r
- Src1 - Points to the first device path. If NULL, then it is ignored.\r
- Src2 - Points to the second device path. If NULL, then it is ignored.\r
+ This function creates a new device path by appending a copy of the device node specified by\r
+ DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.\r
+ The end-of-device-path device node is moved after the end of the appended device node.\r
+ If DevicePathNode is NULL then a copy of DevicePath is returned.\r
+ If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device path device\r
+ node is returned.\r
+ If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path device node\r
+ is returned.\r
+ If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+ The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+ free the memory allocated.\r
\r
- Returns:\r
- Pointer - A pointer to the newly created device path.\r
- NULL - Memory could not be allocated\r
- or either DevicePath or DeviceNode is NULL.\r
+ @param DevicePath A pointer to a device path data structure.\r
+ @param DevicePathNode A pointer to a single device path node.\r
\r
---*/\r
-{\r
- return AppendDevicePath (Src1, Src2);\r
-}\r
+ @return A pointer to the new device path.\r
\r
+**/\r
EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
AppendDeviceNodeProtocolInterface (\r
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode\r
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode\r
)\r
-/*++\r
+{\r
+ return AppendDevicePathNode (DevicePath, DevicePathNode);\r
+}\r
\r
- Routine Description:\r
- Creates a new path by appending the device node to the device path.\r
+/**\r
+ Creates a new device path by appending the specified device path instance to the specified device\r
+ path.\r
\r
- Arguments:\r
- DevicePath - Points to the device path.\r
- DeviceNode - Points to the device node.\r
+ This function creates a new device path by appending a copy of the device path instance specified\r
+ by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.\r
+ The end-of-device-path device node is moved after the end of the appended device path instance\r
+ and a new end-of-device-path-instance node is inserted between.\r
+ If DevicePath is NULL, then a copy if DevicePathInstance is returned.\r
+ If DevicePathInstance is NULL, then NULL is returned.\r
+ If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+ The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+ free the memory allocated.\r
\r
- Returns:\r
- Pointer - A pointer to the allocated device node.\r
- NULL - Memory could not be allocated\r
- or either DevicePath or DeviceNode is NULL.\r
+ @param DevicePath A pointer to a device path data structure.\r
+ @param DevicePathInstance A pointer to a device path instance.\r
\r
---*/\r
-{\r
- return AppendDevicePathNode (DevicePath, DeviceNode);\r
-}\r
+ @return A pointer to the new device path.\r
\r
+**/\r
EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
AppendDevicePathInstanceProtocolInterface (\r
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance\r
)\r
-/*++\r
-\r
- Routine Description:\r
- Creates a new path by appending the specified device path instance to the specified device path.\r
-\r
- Arguments:\r
- DevicePath - Points to the device path. If NULL, then ignored.\r
- DevicePathInstance - Points to the device path instance.\r
-\r
- Returns:\r
- Pointer - A pointer to the newly created device path\r
- NULL - Memory could not be allocated or DevicePathInstance is NULL.\r
-\r
---*/\r
{\r
return AppendDevicePathInstance (DevicePath, DevicePathInstance);\r
}\r
\r
+/**\r
+ Creates a copy of the current device path instance and returns a pointer to the next device path\r
+ instance.\r
+\r
+ This function creates a copy of the current device path instance. It also updates DevicePath to\r
+ point to the next device path instance in the device path (or NULL if no more) and updates Size\r
+ to hold the size of the device path instance copy.\r
+ If DevicePath is NULL, then NULL is returned.\r
+ If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+ The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+ free the memory allocated.\r
+ If Size is NULL, then ASSERT().\r
+\r
+ @param DevicePath On input, this holds the pointer to the current device path\r
+ instance. On output, this holds the pointer to the next device\r
+ path instance or NULL if there are no more device path\r
+ instances in the device path pointer to a device path data\r
+ structure.\r
+ @param Size On output, this holds the size of the device path instance, in\r
+ bytes or zero, if DevicePath is NULL.\r
+\r
+ @return A pointer to the current device path instance.\r
+\r
+**/\r
EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
GetNextDevicePathInstanceProtocolInterface (\r
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,\r
- OUT UINTN *DevicePathInstanceSize\r
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
+ OUT UINTN *Size\r
)\r
-/*++\r
+{\r
+ return GetNextDevicePathInstance (DevicePath, Size);\r
+}\r
\r
- Routine Description:\r
- Creates a copy of the current device path instance and returns a pointer to the next device path instance.\r
+/**\r
+ Determines if a device path is single or multi-instance.\r
\r
- Arguments:\r
- DevicePathInstance - On input, this holds the pointer to the current device path\r
- instance. On output, this holds the pointer to the next\r
- device path instance or NULL if there are no more device\r
- path instances in the device path.\r
- DevicePathInstanceSize - On output, this holds the size of the device path instance,\r
- in bytes or zero, if DevicePathInstance is zero.\r
+ This function returns TRUE if the device path specified by DevicePath is multi-instance.\r
+ Otherwise, FALSE is returned. If DevicePath is NULL, then FALSE is returned.\r
\r
- Returns:\r
- Pointer - A pointer to the copy of the current device path instance.\r
- NULL - DevicePathInstace was NULL on entry or there was insufficient memory.\r
+ @param DevicePath A pointer to a device path data structure.\r
\r
---*/\r
-{\r
- return GetNextDevicePathInstance (DevicePathInstance, DevicePathInstanceSize);\r
-}\r
+ @retval TRUE DevicePath is multi-instance.\r
+ @retval FALSE DevicePath is not multi-instance or DevicePath is NULL.\r
\r
+**/\r
BOOLEAN\r
+EFIAPI\r
IsDevicePathMultiInstanceProtocolInterface (\r
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
)\r
-/*++\r
+{\r
+ return IsDevicePathMultiInstance (DevicePath);\r
+}\r
\r
- Routine Description:\r
- Returns whether a device path is multi-instance.\r
+/**\r
+ Creates a copy of the current device path instance and returns a pointer to the next device path\r
+ instance.\r
\r
- Arguments:\r
- DevicePath - Points to the device path. If NULL, then ignored.\r
+ This function creates a new device node in a newly allocated buffer of size NodeLength and\r
+ initializes the device path node header with NodeType and NodeSubType. The new device path node\r
+ is returned.\r
+ If NodeLength is smaller than a device path header, then NULL is returned.\r
+ If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+ The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+ free the memory allocated.\r
\r
- Returns:\r
- TRUE - The device path has more than one instance\r
- FALSE - The device path is empty or contains only a single instance.\r
+ @param NodeType The device node type for the new device node.\r
+ @param NodeSubType The device node sub-type for the new device node.\r
+ @param NodeLength The length of the new device node.\r
\r
---*/\r
-{\r
- return IsDevicePathMultiInstance (DevicePath);\r
-}\r
+ @return The new device path.\r
\r
+**/\r
EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
CreateDeviceNodeProtocolInterface (\r
IN UINT8 NodeType,\r
IN UINT8 NodeSubType,\r
IN UINT16 NodeLength\r
)\r
-/*++\r
-\r
- Routine Description:\r
- Creates a device node\r
-\r
- Arguments:\r
- NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for\r
- the new device node.\r
- NodeSubType - NodeSubType is the device node sub-type\r
- EFI_DEVICE_PATH.SubType) for the new device node.\r
- NodeLength - NodeLength is the length of the device node\r
- (EFI_DEVICE_PATH.Length) for the new device node.\r
-\r
- Returns:\r
- Pointer - A pointer to the newly created device node.\r
- NULL - NodeLength is less than\r
- the size of the header or there was insufficient memory.\r
-\r
---*/\r
{\r
return CreateDeviceNode (NodeType, NodeSubType, NodeLength);\r
}\r