]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Dxe/Include/RtDevicePath.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / Include / RtDevicePath.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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
8
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.
11
12 Module Name:
13
14 RtDevicePath.h
15
16 Abstract:
17
18 Device Path services. The thing to remember is device paths are built out of
19 nodes. The device path is terminated by an end node that is length
20 sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EFI_DEVICE_PATH_PROTOCOL)
21 all over this file.
22
23 The only place where multi-instance device paths are supported is in
24 environment varibles. Multi-instance device paths should never be placed
25 on a Handle.
26
27 --*/
28 #ifndef _RT_DEVICE_PATH_H_
29 #define _RT_DEVICE_PATH_H_
30
31 BOOLEAN
32 RtEfiIsDevicePathMultiInstance (
33 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
34 )
35 /*++
36
37 Routine Description:
38 Return TRUE is this is a multi instance device path.
39
40 Arguments:
41 DevicePath - A pointer to a device path data structure.
42
43
44 Returns:
45 TRUE - If DevicePath is multi instance.
46 FALSE - If DevicePath is not multi instance.
47
48 --*/
49 ;
50
51 EFI_DEVICE_PATH_PROTOCOL *
52 RtEfiDevicePathInstance (
53 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
54 OUT UINTN *Size
55 )
56 /*++
57
58 Routine Description:
59 Function retrieves the next device path instance from a device path data structure.
60
61 Arguments:
62 DevicePath - A pointer to a device path data structure.
63
64 Size - A pointer to the size of a device path instance in bytes.
65
66 Returns:
67
68 This function returns a pointer to the current device path instance.
69 In addition, it returns the size in bytes of the current device path instance in Size,
70 and a pointer to the next device path instance in DevicePath.
71 If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
72
73 --*/
74 ;
75
76 UINTN
77 RtEfiDevicePathSize (
78 IN EFI_DEVICE_PATH_PROTOCOL *DevPath
79 )
80 /*++
81
82 Routine Description:
83
84 Calculate the size of a whole device path.
85
86 Arguments:
87
88 DevPath - The pointer to the device path data.
89
90 Returns:
91
92 Size of device path data structure..
93
94 --*/
95 ;
96
97 EFI_DEVICE_PATH_PROTOCOL *
98 RtEfiAppendDevicePath (
99 IN EFI_DEVICE_PATH_PROTOCOL *Src1,
100 IN EFI_DEVICE_PATH_PROTOCOL *Src2
101 )
102 /*++
103
104 Routine Description:
105 Function is used to append a Src1 and Src2 together.
106
107 Arguments:
108 Src1 - A pointer to a device path data structure.
109
110 Src2 - A pointer to a device path data structure.
111
112 Returns:
113
114 A pointer to the new device path is returned.
115 NULL is returned if space for the new device path could not be allocated from pool.
116 It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
117
118 --*/
119 ;
120
121 EFI_DEVICE_PATH_PROTOCOL *
122 RtEfiDevicePathFromHandle (
123 IN EFI_HANDLE Handle
124 )
125 /*++
126
127 Routine Description:
128
129 Locate device path protocol interface on a device handle.
130
131 Arguments:
132
133 Handle - The device handle
134
135 Returns:
136
137 Device path protocol interface located.
138
139 --*/
140 ;
141
142 EFI_DEVICE_PATH_PROTOCOL *
143 RtEfiDuplicateDevicePath (
144 IN EFI_DEVICE_PATH_PROTOCOL *DevPath
145 )
146 /*++
147
148 Routine Description:
149 Duplicate a new device path data structure from the old one.
150
151 Arguments:
152 DevPath - A pointer to a device path data structure.
153
154 Returns:
155 A pointer to the new allocated device path data.
156 Caller must free the memory used by DevicePath if it is no longer needed.
157
158 --*/
159 ;
160
161 EFI_DEVICE_PATH_PROTOCOL *
162 RtEfiAppendDevicePathNode (
163 IN EFI_DEVICE_PATH_PROTOCOL *Src1,
164 IN EFI_DEVICE_PATH_PROTOCOL *Src2
165 )
166 /*++
167
168 Routine Description:
169 Function is used to append a device path node to the end of another device path.
170
171 Arguments:
172 Src1 - A pointer to a device path data structure.
173
174 Src2 - A pointer to a device path data structure.
175
176 Returns:
177 This function returns a pointer to the new device path.
178 If there is not enough temporary pool memory available to complete this function,
179 then NULL is returned.
180
181
182 --*/
183 ;
184
185 EFI_DEVICE_PATH_PROTOCOL *
186 RtEfiFileDevicePath (
187 IN EFI_HANDLE Device OPTIONAL,
188 IN CHAR16 *FileName
189 )
190 /*++
191
192 Routine Description:
193 Create a device path that appends a MEDIA_DEVICE_PATH with
194 FileNameGuid to the device path of DeviceHandle.
195
196 Arguments:
197 Device - Optional Device Handle to use as Root of the Device Path
198
199 FileName - FileName
200
201 Returns:
202 EFI_DEVICE_PATH_PROTOCOL that was allocated from dynamic memory
203 or NULL pointer.
204
205 --*/
206 ;
207
208 EFI_DEVICE_PATH_PROTOCOL *
209 RtEfiAppendDevicePathInstance (
210 IN EFI_DEVICE_PATH_PROTOCOL *Src,
211 IN EFI_DEVICE_PATH_PROTOCOL *Instance
212 )
213 /*++
214
215 Routine Description:
216
217 Append a device path instance to another.
218
219 Arguments:
220
221 Src - The device path instance to be appended with.
222 Instance - The device path instance appending the other.
223
224 Returns:
225
226 The contaction of these two.
227
228 --*/
229 ;
230
231 #endif