3 Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #ifndef _DEVICE_PATH_UTILITIES_PROTOCOL_H_
21 #define _DEVICE_PATH_UTILITIES_PROTOCOL_H_
24 // Device Path Utilities protocol
26 #define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
28 0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4} \
34 (EFIAPI
*EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE
) (
35 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
40 Returns the size of the device path, in bytes.
43 DevicePath - Points to the start of the EFI device path.
46 Size - Size of the specified device path, in bytes, including the end-of-path tag.
52 EFI_DEVICE_PATH_PROTOCOL
*
54 (EFIAPI
*EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH
) (
55 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
60 Create a duplicate of the specified path.
63 DevicePath - Points to the source EFI device path.
66 Pointer - A pointer to the duplicate device path.
67 NULL - Insufficient memory.
73 EFI_DEVICE_PATH_PROTOCOL
*
75 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_PATH
) (
76 IN CONST EFI_DEVICE_PATH_PROTOCOL
*Src1
,
77 IN CONST EFI_DEVICE_PATH_PROTOCOL
*Src2
82 Create a new path by appending the second device path to the first.
85 Src1 - Points to the first device path. If NULL, then it is ignored.
86 Src2 - Points to the second device path. If NULL, then it is ignored.
89 Pointer - A pointer to the newly created device path.
90 NULL - Memory could not be allocated
91 or either DevicePath or DeviceNode is NULL.
97 EFI_DEVICE_PATH_PROTOCOL
*
99 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_NODE
) (
100 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
101 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DeviceNode
106 Creates a new path by appending the device node to the device path.
109 DevicePath - Points to the device path.
110 DeviceNode - Points to the device node.
113 Pointer - A pointer to the allocated device node.
114 NULL - Memory could not be allocated
115 or either DevicePath or DeviceNode is NULL.
121 EFI_DEVICE_PATH_PROTOCOL
*
123 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE
) (
124 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
125 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePathInstance
130 Creates a new path by appending the specified device path instance to the specified device path.
133 DevicePath - Points to the device path. If NULL, then ignored.
134 DevicePathInstance - Points to the device path instance.
137 Pointer - A pointer to the newly created device path
138 NULL - Memory could not be allocated or DevicePathInstance is NULL.
144 EFI_DEVICE_PATH_PROTOCOL
*
146 (EFIAPI
*EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE
) (
147 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePathInstance
,
148 OUT UINTN
*DevicePathInstanceSize
153 Creates a copy of the current device path instance and returns a pointer to the next device path instance.
156 DevicePathInstance - On input, this holds the pointer to the current device path
157 instance. On output, this holds the pointer to the next
158 device path instance or NULL if there are no more device
159 path instances in the device path.
160 DevicePathInstanceSize - On output, this holds the size of the device path instance,
161 in bytes or zero, if DevicePathInstance is zero.
164 Pointer - A pointer to the copy of the current device path instance.
165 NULL - DevicePathInstace was NULL on entry or there was insufficient memory.
173 (EFIAPI
*EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE
) (
174 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
179 Returns whether a device path is multi-instance.
182 DevicePath - Points to the device path. If NULL, then ignored.
185 TRUE - The device path has more than one instance
186 FALSE - The device path is empty or contains only a single instance.
192 EFI_DEVICE_PATH_PROTOCOL
*
194 (EFIAPI
*EFI_DEVICE_PATH_UTILS_CREATE_NODE
) (
196 IN UINT8 NodeSubType
,
202 Creates a device node
205 NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for
207 NodeSubType - NodeSubType is the device node sub-type
208 EFI_DEVICE_PATH.SubType) for the new device node.
209 NodeLength - NodeLength is the length of the device node
210 (EFI_DEVICE_PATH.Length) for the new device node.
213 Pointer - A pointer to the newly created device node.
214 NULL - NodeLength is less than
215 the size of the header or there was insufficient memory.
221 EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize
;
222 EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath
;
223 EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath
;
224 EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode
;
225 EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance
;
226 EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance
;
227 EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance
;
228 EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode
;
229 } EFI_DEVICE_PATH_UTILITIES_PROTOCOL
;
231 extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid
;