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