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