1 | /** @file
|
---|
2 | Generic BDS library defines general interfaces for BDS driver including:
|
---|
3 | 1) BDS boot policy interface
|
---|
4 | 2) BDS boot device connect interface
|
---|
5 | 3) BDS Misc interfaces for maintaining boot variable, output string.
|
---|
6 |
|
---|
7 | Copyright (c) 2004 - 2009, Intel Corporation. <BR>
|
---|
8 | All rights reserved. This program and the accompanying materials
|
---|
9 | are licensed and made available under the terms and conditions of the BSD License
|
---|
10 | which accompanies this distribution. The full text of the license may be found at
|
---|
11 | http://opensource.org/licenses/bsd-license.php
|
---|
12 |
|
---|
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
---|
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
---|
15 |
|
---|
16 | **/
|
---|
17 |
|
---|
18 | #ifndef _GENERIC_BDS_LIB_H_
|
---|
19 | #define _GENERIC_BDS_LIB_H_
|
---|
20 |
|
---|
21 | extern EFI_HANDLE mBdsImageHandle;
|
---|
22 |
|
---|
23 | ///
|
---|
24 | /// Constants which are variable names used to access variables
|
---|
25 | ///
|
---|
26 | #define VAR_LEGACY_DEV_ORDER L"LegacyDevOrder"
|
---|
27 |
|
---|
28 | ///
|
---|
29 | /// Data structures and defines
|
---|
30 | ///
|
---|
31 | #define FRONT_PAGE_QUESTION_ID 0x0000
|
---|
32 | #define FRONT_PAGE_DATA_WIDTH 0x01
|
---|
33 |
|
---|
34 | ///
|
---|
35 | /// ConnectType
|
---|
36 | ///
|
---|
37 | #define CONSOLE_OUT 0x00000001
|
---|
38 | #define STD_ERROR 0x00000002
|
---|
39 | #define CONSOLE_IN 0x00000004
|
---|
40 | #define CONSOLE_ALL (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
|
---|
41 |
|
---|
42 | ///
|
---|
43 | /// Load Option Attributes
|
---|
44 | ///
|
---|
45 | #define LOAD_OPTION_ACTIVE 0x00000001
|
---|
46 | #define LOAD_OPTION_FORCE_RECONNECT 0x00000002
|
---|
47 |
|
---|
48 | #define LOAD_OPTION_HIDDEN 0x00000008
|
---|
49 | #define LOAD_OPTION_CATEGORY 0x00001F00
|
---|
50 |
|
---|
51 | #define LOAD_OPTION_CATEGORY_BOOT 0x00000000
|
---|
52 | #define LOAD_OPTION_CATEGORY_APP 0x00000100
|
---|
53 |
|
---|
54 | #define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001
|
---|
55 | #define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002
|
---|
56 |
|
---|
57 | #define IS_LOAD_OPTION_TYPE(_c, _Mask) (BOOLEAN) (((_c) & (_Mask)) != 0)
|
---|
58 |
|
---|
59 | ///
|
---|
60 | /// Define Maximum characters that will be accepted
|
---|
61 | ///
|
---|
62 | #define MAX_CHAR 480
|
---|
63 | #define MAX_CHAR_SIZE (MAX_CHAR * 2)
|
---|
64 |
|
---|
65 | ///
|
---|
66 | /// Define maximum characters for boot option variable "BootXXXX"
|
---|
67 | ///
|
---|
68 | #define BOOT_OPTION_MAX_CHAR 10
|
---|
69 |
|
---|
70 | //
|
---|
71 | // This data structure is the part of BDS_CONNECT_ENTRY
|
---|
72 | //
|
---|
73 | #define BDS_LOAD_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'C', 'O')
|
---|
74 |
|
---|
75 | typedef struct {
|
---|
76 |
|
---|
77 | UINTN Signature;
|
---|
78 | LIST_ENTRY Link;
|
---|
79 |
|
---|
80 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
---|
81 |
|
---|
82 | CHAR16 *OptionName;
|
---|
83 | UINTN OptionNumber;
|
---|
84 | UINT16 BootCurrent;
|
---|
85 | UINT32 Attribute;
|
---|
86 | CHAR16 *Description;
|
---|
87 | VOID *LoadOptions;
|
---|
88 | UINT32 LoadOptionsSize;
|
---|
89 | CHAR16 *StatusString;
|
---|
90 |
|
---|
91 | } BDS_COMMON_OPTION;
|
---|
92 |
|
---|
93 | typedef struct {
|
---|
94 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
---|
95 | UINTN ConnectType;
|
---|
96 | } BDS_CONSOLE_CONNECT_ENTRY;
|
---|
97 |
|
---|
98 | //
|
---|
99 | // Bds boot related lib functions
|
---|
100 | //
|
---|
101 | /**
|
---|
102 | Boot from the UEFI spec defined "BootNext" variable.
|
---|
103 |
|
---|
104 | **/
|
---|
105 | VOID
|
---|
106 | EFIAPI
|
---|
107 | BdsLibBootNext (
|
---|
108 | VOID
|
---|
109 | );
|
---|
110 |
|
---|
111 | /**
|
---|
112 | Process the boot option according to the UEFI specification. The legacy boot option device path includes BBS_DEVICE_PATH.
|
---|
113 |
|
---|
114 | @param Option The boot option to be processed
|
---|
115 | @param DevicePath The device path describing where to load the
|
---|
116 | boot image or the legacy BBS device path to boot
|
---|
117 | the legacy OS
|
---|
118 | @param ExitDataSize The size of exit data.
|
---|
119 | @param ExitData Data returned when Boot image failed.
|
---|
120 |
|
---|
121 | @retval EFI_SUCCESS Boot from the input boot option succeeded.
|
---|
122 | @retval EFI_NOT_FOUND The Device Path is not found in the system
|
---|
123 |
|
---|
124 | **/
|
---|
125 | EFI_STATUS
|
---|
126 | EFIAPI
|
---|
127 | BdsLibBootViaBootOption (
|
---|
128 | IN BDS_COMMON_OPTION * Option,
|
---|
129 | IN EFI_DEVICE_PATH_PROTOCOL * DevicePath,
|
---|
130 | OUT UINTN *ExitDataSize,
|
---|
131 | OUT CHAR16 **ExitData OPTIONAL
|
---|
132 | );
|
---|
133 |
|
---|
134 |
|
---|
135 | /**
|
---|
136 | This function will enumerate all possible boot devices in the system, and
|
---|
137 | automatically create boot options for Network, Shell, Removable BlockIo,
|
---|
138 | and Non-BlockIo Simplefile devices.
|
---|
139 |
|
---|
140 | BDS separates EFI boot options into six types:
|
---|
141 | 1. Network - The boot option points to the SimpleNetworkProtocol device.
|
---|
142 | Bds will try to automatically create this type of boot option during enumeration.
|
---|
143 | 2. Shell - The boot option points to internal flash shell.
|
---|
144 | Bds will try to automatically create this type of boot option during enumeration.
|
---|
145 | 3. Removable BlockIo - The boot option points to a removable media
|
---|
146 | device, such as a USB flash drive or DVD drive.
|
---|
147 | These devices should contain a *removable* blockIo
|
---|
148 | protocol in their device handle.
|
---|
149 | Bds will try to automatically create this type boot option
|
---|
150 | when enumerate.
|
---|
151 | 4. Fixed BlockIo - The boot option points to a Fixed blockIo device,
|
---|
152 | such as a hard disk.
|
---|
153 | These devices should contain a *fixed* blockIo
|
---|
154 | protocol in their device handle.
|
---|
155 | BDS will skip fixed blockIo devices, and not
|
---|
156 | automatically create boot option for them. But BDS
|
---|
157 | will help to delete those fixed blockIo boot options,
|
---|
158 | whose description rules conflict with other auto-created
|
---|
159 | boot options.
|
---|
160 | 5. Non-BlockIo Simplefile - The boot option points to a device whose handle
|
---|
161 | has SimpleFileSystem Protocol, but has no blockio
|
---|
162 | protocol. These devices do not offer blockIo
|
---|
163 | protocol, but BDS still can get the
|
---|
164 | \EFI\BOOT\boot{machinename}.EFI by SimpleFileSystem
|
---|
165 | Protocol.
|
---|
166 | 6. File - The boot option points to a file. These boot options are usually
|
---|
167 | created by the user, either manually or with an OS loader. BDS will not delete or modify
|
---|
168 | these boot options.
|
---|
169 |
|
---|
170 | This function will enumerate all possible boot devices in the system, and
|
---|
171 | automatically create boot options for Network, Shell, Removable BlockIo,
|
---|
172 | and Non-BlockIo Simplefile devices.
|
---|
173 | It will excute once every boot.
|
---|
174 |
|
---|
175 | @param BdsBootOptionList The header of the linked list that indexed all
|
---|
176 | current boot options
|
---|
177 |
|
---|
178 | @retval EFI_SUCCESS Finished all the boot device enumerations and created
|
---|
179 | the boot option based on the boot device
|
---|
180 |
|
---|
181 | @retval EFI_OUT_OF_RESOURCES Failed to enumerate the boot device and create the boot option list
|
---|
182 | **/
|
---|
183 | EFI_STATUS
|
---|
184 | EFIAPI
|
---|
185 | BdsLibEnumerateAllBootOption (
|
---|
186 | IN OUT LIST_ENTRY *BdsBootOptionList
|
---|
187 | );
|
---|
188 |
|
---|
189 | /**
|
---|
190 | Build the boot option with the handle parsed in
|
---|
191 |
|
---|
192 | @param Handle The handle representing the device path for which to create
|
---|
193 | boot option
|
---|
194 | @param BdsBootOptionList The header of the link list which indexed all
|
---|
195 | current boot options
|
---|
196 | @param String The description of the boot option.
|
---|
197 |
|
---|
198 | **/
|
---|
199 | VOID
|
---|
200 | EFIAPI
|
---|
201 | BdsLibBuildOptionFromHandle (
|
---|
202 | IN EFI_HANDLE Handle,
|
---|
203 | IN LIST_ENTRY *BdsBootOptionList,
|
---|
204 | IN CHAR16 *String
|
---|
205 | );
|
---|
206 |
|
---|
207 |
|
---|
208 | /**
|
---|
209 | Build the on flash shell boot option with the handle parsed in.
|
---|
210 |
|
---|
211 | @param Handle The handle which present the device path to create
|
---|
212 | on flash shell boot option
|
---|
213 | @param BdsBootOptionList The header of the link list which indexed all
|
---|
214 | current boot options
|
---|
215 |
|
---|
216 | **/
|
---|
217 | VOID
|
---|
218 | EFIAPI
|
---|
219 | BdsLibBuildOptionFromShell (
|
---|
220 | IN EFI_HANDLE Handle,
|
---|
221 | IN OUT LIST_ENTRY *BdsBootOptionList
|
---|
222 | );
|
---|
223 |
|
---|
224 | //
|
---|
225 | // Bds misc lib functions
|
---|
226 | //
|
---|
227 | /**
|
---|
228 | Get boot mode by looking up configuration table and parsing HOB list
|
---|
229 |
|
---|
230 | @param BootMode Boot mode from PEI handoff HOB.
|
---|
231 |
|
---|
232 | @retval EFI_SUCCESS Successfully get boot mode
|
---|
233 |
|
---|
234 | **/
|
---|
235 | EFI_STATUS
|
---|
236 | EFIAPI
|
---|
237 | BdsLibGetBootMode (
|
---|
238 | OUT EFI_BOOT_MODE *BootMode
|
---|
239 | );
|
---|
240 |
|
---|
241 |
|
---|
242 | /**
|
---|
243 | The function will go through the driver option link list, and then load and start
|
---|
244 | every driver to which the driver option device path points.
|
---|
245 |
|
---|
246 | @param BdsDriverLists The header of the current driver option link list
|
---|
247 |
|
---|
248 | **/
|
---|
249 | VOID
|
---|
250 | EFIAPI
|
---|
251 | BdsLibLoadDrivers (
|
---|
252 | IN LIST_ENTRY *BdsDriverLists
|
---|
253 | );
|
---|
254 |
|
---|
255 |
|
---|
256 | /**
|
---|
257 | This function processes BootOrder or DriverOrder variables, by calling
|
---|
258 |
|
---|
259 | BdsLibVariableToOption () for each UINT16 in the variables.
|
---|
260 |
|
---|
261 | @param BdsCommonOptionList The header of the option list base on variable
|
---|
262 | VariableName
|
---|
263 | @param VariableName EFI Variable name indicate the BootOrder or
|
---|
264 | DriverOrder
|
---|
265 |
|
---|
266 | @retval EFI_SUCCESS Success create the boot option or driver option
|
---|
267 | list
|
---|
268 | @retval EFI_OUT_OF_RESOURCES Failed to get the boot option or driver option list
|
---|
269 | **/
|
---|
270 | EFI_STATUS
|
---|
271 | EFIAPI
|
---|
272 | BdsLibBuildOptionFromVar (
|
---|
273 | IN LIST_ENTRY *BdsCommonOptionList,
|
---|
274 | IN CHAR16 *VariableName
|
---|
275 | );
|
---|
276 |
|
---|
277 | /**
|
---|
278 | This function reads the EFI variable (VendorGuid/Name) and returns a dynamically allocated
|
---|
279 | buffer and the size of the buffer. If failure, return NULL.
|
---|
280 |
|
---|
281 | @param Name String part of EFI variable name
|
---|
282 | @param VendorGuid GUID part of EFI variable name
|
---|
283 | @param VariableSize Returns the size of the EFI variable that was read
|
---|
284 |
|
---|
285 | @return Dynamically allocated memory that contains a copy of the EFI variable
|
---|
286 | Caller is responsible freeing the buffer.
|
---|
287 | @retval NULL Variable was not read
|
---|
288 |
|
---|
289 | **/
|
---|
290 | VOID *
|
---|
291 | EFIAPI
|
---|
292 | BdsLibGetVariableAndSize (
|
---|
293 | IN CHAR16 *Name,
|
---|
294 | IN EFI_GUID *VendorGuid,
|
---|
295 | OUT UINTN *VariableSize
|
---|
296 | );
|
---|
297 |
|
---|
298 |
|
---|
299 | /**
|
---|
300 | This function prints a series of strings.
|
---|
301 |
|
---|
302 | @param ConOut Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
---|
303 | @param ... A variable argument list containing series of
|
---|
304 | strings, the last string must be NULL.
|
---|
305 |
|
---|
306 | @retval EFI_SUCCESS Success print out the string using ConOut.
|
---|
307 | @retval EFI_STATUS Return the status of the ConOut->OutputString ().
|
---|
308 |
|
---|
309 | **/
|
---|
310 | EFI_STATUS
|
---|
311 | EFIAPI
|
---|
312 | BdsLibOutputStrings (
|
---|
313 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut,
|
---|
314 | ...
|
---|
315 | );
|
---|
316 |
|
---|
317 | /**
|
---|
318 | Build the boot#### or driver#### option from the VariableName. The
|
---|
319 | build boot#### or driver#### will also be linked to BdsCommonOptionList.
|
---|
320 |
|
---|
321 | @param BdsCommonOptionList The header of the boot#### or driver#### option
|
---|
322 | link list
|
---|
323 | @param VariableName EFI Variable name, indicates if it is boot#### or
|
---|
324 | driver####
|
---|
325 |
|
---|
326 | @retval BDS_COMMON_OPTION The option that was created
|
---|
327 | @retval NULL Failed to get the new option
|
---|
328 |
|
---|
329 | **/
|
---|
330 | BDS_COMMON_OPTION *
|
---|
331 | EFIAPI
|
---|
332 | BdsLibVariableToOption (
|
---|
333 | IN OUT LIST_ENTRY *BdsCommonOptionList,
|
---|
334 | IN CHAR16 *VariableName
|
---|
335 | );
|
---|
336 |
|
---|
337 | /**
|
---|
338 | This function registers the new boot#### or driver#### option based on
|
---|
339 | the VariableName. The new registered boot#### or driver#### will be linked
|
---|
340 | to BdsOptionList and also update to the VariableName. After the boot#### or
|
---|
341 | driver#### updated, the BootOrder or DriverOrder will also be updated.
|
---|
342 |
|
---|
343 | @param BdsOptionList The header of the boot#### or driver#### link list
|
---|
344 | @param DevicePath The device path which the boot#### or driver####
|
---|
345 | option present
|
---|
346 | @param String The description of the boot#### or driver####
|
---|
347 | @param VariableName Indicate if the boot#### or driver#### option
|
---|
348 |
|
---|
349 | @retval EFI_SUCCESS The boot#### or driver#### have been success
|
---|
350 | registered
|
---|
351 | @retval EFI_STATUS Return the status of gRT->SetVariable ().
|
---|
352 |
|
---|
353 | **/
|
---|
354 | EFI_STATUS
|
---|
355 | EFIAPI
|
---|
356 | BdsLibRegisterNewOption (
|
---|
357 | IN LIST_ENTRY *BdsOptionList,
|
---|
358 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
---|
359 | IN CHAR16 *String,
|
---|
360 | IN CHAR16 *VariableName
|
---|
361 | );
|
---|
362 |
|
---|
363 | //
|
---|
364 | // Bds connect and disconnect driver lib functions
|
---|
365 | //
|
---|
366 | /**
|
---|
367 | This function connects all system drivers with the corresponding controllers.
|
---|
368 |
|
---|
369 | **/
|
---|
370 | VOID
|
---|
371 | EFIAPI
|
---|
372 | BdsLibConnectAllDriversToAllControllers (
|
---|
373 | VOID
|
---|
374 | );
|
---|
375 |
|
---|
376 | /**
|
---|
377 | This function connects all system drivers to controllers.
|
---|
378 |
|
---|
379 | **/
|
---|
380 | VOID
|
---|
381 | EFIAPI
|
---|
382 | BdsLibConnectAll (
|
---|
383 | VOID
|
---|
384 | );
|
---|
385 |
|
---|
386 | /**
|
---|
387 | This function creates all handles associated with the given device
|
---|
388 | path node. If the handle associated with one device path node can not
|
---|
389 | be created, then it tries to execute the dispatch to load the missing drivers.
|
---|
390 |
|
---|
391 | @param DevicePathToConnect The device path to be connected. Can be
|
---|
392 | a multi-instance device path
|
---|
393 |
|
---|
394 | @retval EFI_SUCCESS All handles associates with every device path node
|
---|
395 | were created
|
---|
396 | @retval EFI_OUT_OF_RESOURCES Not enough resources to create new handles
|
---|
397 | @retval EFI_NOT_FOUND At least one handle could not be created
|
---|
398 |
|
---|
399 | **/
|
---|
400 | EFI_STATUS
|
---|
401 | EFIAPI
|
---|
402 | BdsLibConnectDevicePath (
|
---|
403 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect
|
---|
404 | );
|
---|
405 |
|
---|
406 | /**
|
---|
407 | This function will connect all current system handles recursively. gBS->ConnectController() service is invoked for each handle exist in system handler buffer. If the handle is bus type handler, all childrens also will be connected recursively by gBS->ConnectController().
|
---|
408 | @retval EFI_SUCCESS All handles and child handles have been connected @retval EFI_STATUS Return the status of gBS->LocateHandleBuffer().
|
---|
409 | **/
|
---|
410 | EFI_STATUS
|
---|
411 | EFIAPI
|
---|
412 | BdsLibConnectAllEfi (
|
---|
413 | VOID
|
---|
414 | );
|
---|
415 |
|
---|
416 | /**
|
---|
417 | This function will disconnect all current system handles. gBS->DisconnectController() is invoked for each handle exists in system handle buffer. If handle is a bus type handle, all childrens also are disconnected recursively by gBS->DisconnectController().
|
---|
418 | @retval EFI_SUCCESS All handles have been disconnected
|
---|
419 | @retval EFI_STATUS Error status returned by of gBS->LocateHandleBuffer().
|
---|
420 |
|
---|
421 | **/
|
---|
422 | EFI_STATUS
|
---|
423 | EFIAPI
|
---|
424 | BdsLibDisconnectAllEfi (
|
---|
425 | VOID
|
---|
426 | );
|
---|
427 |
|
---|
428 | //
|
---|
429 | // Bds console related lib functions
|
---|
430 | //
|
---|
431 | /**
|
---|
432 | This function will search every simpletxt device in the current system,
|
---|
433 | and make every simpletxt device a potential console device.
|
---|
434 |
|
---|
435 | **/
|
---|
436 | VOID
|
---|
437 | EFIAPI
|
---|
438 | BdsLibConnectAllConsoles (
|
---|
439 | VOID
|
---|
440 | );
|
---|
441 |
|
---|
442 |
|
---|
443 | /**
|
---|
444 | This function will connect console device based on the console
|
---|
445 | device variable ConIn, ConOut and ErrOut.
|
---|
446 |
|
---|
447 | @retval EFI_SUCCESS At least one of the ConIn and ConOut devices have
|
---|
448 | been connected.
|
---|
449 | @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
|
---|
450 |
|
---|
451 | **/
|
---|
452 | EFI_STATUS
|
---|
453 | EFIAPI
|
---|
454 | BdsLibConnectAllDefaultConsoles (
|
---|
455 | VOID
|
---|
456 | );
|
---|
457 |
|
---|
458 | /**
|
---|
459 | This function updates the console variable based on ConVarName. It can
|
---|
460 | add or remove one specific console device path from the variable
|
---|
461 |
|
---|
462 | @param ConVarName Console-related variable name: ConIn, ConOut,
|
---|
463 | ErrOut.
|
---|
464 | @param CustomizedConDevicePath The console device path to be added to
|
---|
465 | the console variable ConVarName. Can not be multi-instance.
|
---|
466 | @param ExclusiveDevicePath The console device path to be removed
|
---|
467 | from the console variable ConVarName. Can not be multi-instance.
|
---|
468 |
|
---|
469 | @retval EFI_UNSUPPORTED The added device path is the same as a removed one.
|
---|
470 | @retval EFI_SUCCESS Successfully added or removed the device path from the
|
---|
471 | console variable.
|
---|
472 |
|
---|
473 | **/
|
---|
474 | EFI_STATUS
|
---|
475 | EFIAPI
|
---|
476 | BdsLibUpdateConsoleVariable (
|
---|
477 | IN CHAR16 *ConVarName,
|
---|
478 | IN EFI_DEVICE_PATH_PROTOCOL *CustomizedConDevicePath,
|
---|
479 | IN EFI_DEVICE_PATH_PROTOCOL *ExclusiveDevicePath
|
---|
480 | );
|
---|
481 |
|
---|
482 | /**
|
---|
483 | Connect the console device base on the variable ConVarName. If
|
---|
484 | ConVarName is a multi-instance device path, and at least one
|
---|
485 | instance connects successfully, then this function
|
---|
486 | will return success.
|
---|
487 |
|
---|
488 | @param ConVarName Console related variable name, ConIn, ConOut,
|
---|
489 | ErrOut.
|
---|
490 |
|
---|
491 | @retval EFI_NOT_FOUND No console devices were connected successfully
|
---|
492 | @retval EFI_SUCCESS Connected at least one instance of the console
|
---|
493 | device path based on the variable ConVarName.
|
---|
494 |
|
---|
495 | **/
|
---|
496 | EFI_STATUS
|
---|
497 | EFIAPI
|
---|
498 | BdsLibConnectConsoleVariable (
|
---|
499 | IN CHAR16 *ConVarName
|
---|
500 | );
|
---|
501 |
|
---|
502 | //
|
---|
503 | // Bds device path related lib functions
|
---|
504 | //
|
---|
505 | /**
|
---|
506 | Delete the instance in Multi that overlaps with Single
|
---|
507 |
|
---|
508 | @param Multi A pointer to a multi-instance device path data
|
---|
509 | structure.
|
---|
510 | @param Single A pointer to a single-instance device path data
|
---|
511 | structure.
|
---|
512 |
|
---|
513 | @return This function removes the device path instances in Multi that overlap
|
---|
514 | Single, and returns the resulting device path. If there is no
|
---|
515 | remaining device path as a result, this function will return NULL.
|
---|
516 |
|
---|
517 | **/
|
---|
518 | EFI_DEVICE_PATH_PROTOCOL *
|
---|
519 | EFIAPI
|
---|
520 | BdsLibDelPartMatchInstance (
|
---|
521 | IN EFI_DEVICE_PATH_PROTOCOL *Multi,
|
---|
522 | IN EFI_DEVICE_PATH_PROTOCOL *Single
|
---|
523 | );
|
---|
524 |
|
---|
525 | /**
|
---|
526 | Function compares a device path data structure to that of all the nodes of a
|
---|
527 | second device path instance.
|
---|
528 |
|
---|
529 | @param Multi A pointer to a multi-instance device path data
|
---|
530 | structure.
|
---|
531 | @param Single A pointer to a single-instance device path data
|
---|
532 | structure.
|
---|
533 |
|
---|
534 | @retval TRUE If the Single device path is contained within Multi device path.
|
---|
535 | @retval FALSE The Single device path is not contained within Multi device path.
|
---|
536 |
|
---|
537 | **/
|
---|
538 | BOOLEAN
|
---|
539 | EFIAPI
|
---|
540 | BdsLibMatchDevicePaths (
|
---|
541 | IN EFI_DEVICE_PATH_PROTOCOL *Multi,
|
---|
542 | IN EFI_DEVICE_PATH_PROTOCOL *Single
|
---|
543 | );
|
---|
544 |
|
---|
545 | /**
|
---|
546 | This function converts an input device structure to a Unicode string.
|
---|
547 |
|
---|
548 | @param DevPath A pointer to the device path structure.
|
---|
549 |
|
---|
550 | @return A new allocated Unicode string that represents the device path.
|
---|
551 |
|
---|
552 | **/
|
---|
553 | CHAR16 *
|
---|
554 | EFIAPI
|
---|
555 | DevicePathToStr (
|
---|
556 | IN EFI_DEVICE_PATH_PROTOCOL *DevPath
|
---|
557 | );
|
---|
558 |
|
---|
559 |
|
---|
560 | //
|
---|
561 | // Internal definitions
|
---|
562 | //
|
---|
563 | typedef struct {
|
---|
564 | CHAR16 *Str;
|
---|
565 | UINTN Len;
|
---|
566 | UINTN Maxlen;
|
---|
567 | } POOL_PRINT;
|
---|
568 |
|
---|
569 | typedef struct {
|
---|
570 | UINT8 Type;
|
---|
571 | UINT8 SubType;
|
---|
572 | VOID (*Function) (POOL_PRINT *, VOID *);
|
---|
573 | } DEVICE_PATH_STRING_TABLE;
|
---|
574 |
|
---|
575 | extern EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid;
|
---|
576 |
|
---|
577 | typedef struct {
|
---|
578 | EFI_DEVICE_PATH_PROTOCOL Header;
|
---|
579 | EFI_GUID Guid;
|
---|
580 | UINT8 VendorDefinedData[1];
|
---|
581 | } VENDOR_DEVICE_PATH_WITH_DATA;
|
---|
582 |
|
---|
583 |
|
---|
584 | extern EFI_GUID mEfiDevicePathMessagingSASGuid;
|
---|
585 |
|
---|
586 | typedef struct {
|
---|
587 | EFI_DEVICE_PATH_PROTOCOL Header;
|
---|
588 | UINT16 NetworkProtocol;
|
---|
589 | UINT16 LoginOption;
|
---|
590 | UINT64 Lun;
|
---|
591 | UINT16 TargetPortalGroupTag;
|
---|
592 | CHAR16 TargetName[1];
|
---|
593 | } ISCSI_DEVICE_PATH_WITH_NAME;
|
---|
594 |
|
---|
595 |
|
---|
596 | //
|
---|
597 | // Notes: EFI 64 shadow all option rom
|
---|
598 | //
|
---|
599 | #if defined (MDE_CPU_IPF)
|
---|
600 | #define EFI64_SHADOW_ALL_LEGACY_ROM() ShadowAllOptionRom ();
|
---|
601 | #else
|
---|
602 | #define EFI64_SHADOW_ALL_LEGACY_ROM()
|
---|
603 | #endif
|
---|
604 |
|
---|
605 | /**
|
---|
606 | Shadow all Legacy OptionRom.
|
---|
607 |
|
---|
608 | **/
|
---|
609 | VOID
|
---|
610 | EFIAPI
|
---|
611 | ShadowAllOptionRom (
|
---|
612 | VOID
|
---|
613 | );
|
---|
614 |
|
---|
615 | //
|
---|
616 | // BBS support macros and functions
|
---|
617 | //
|
---|
618 |
|
---|
619 | #if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
|
---|
620 | #define REFRESH_LEGACY_BOOT_OPTIONS \
|
---|
621 | BdsDeleteAllInvalidLegacyBootOptions ();\
|
---|
622 | BdsAddNonExistingLegacyBootOptions (); \
|
---|
623 | BdsUpdateLegacyDevOrder ()
|
---|
624 | #else
|
---|
625 | #define REFRESH_LEGACY_BOOT_OPTIONS
|
---|
626 | #endif
|
---|
627 |
|
---|
628 | /**
|
---|
629 | Delete all the invalid legacy boot options.
|
---|
630 |
|
---|
631 | @retval EFI_SUCCESS All invalid legacy boot options are deleted.
|
---|
632 | @retval EFI_OUT_OF_RESOURCES Fail to allocate necessary memory.
|
---|
633 | @retval EFI_NOT_FOUND Fail to retrieve variable of boot order.
|
---|
634 |
|
---|
635 | **/
|
---|
636 | EFI_STATUS
|
---|
637 | EFIAPI
|
---|
638 | BdsDeleteAllInvalidLegacyBootOptions (
|
---|
639 | VOID
|
---|
640 | );
|
---|
641 |
|
---|
642 | /**
|
---|
643 | Add the legacy boot options from BBS table if they do not exist.
|
---|
644 |
|
---|
645 | @retval EFI_SUCCESS The boot options are added successfully
|
---|
646 | or they are already in boot options.
|
---|
647 | @retval EFI_NOT_FOUND No legacy boot options is found.
|
---|
648 | @retval EFI_OUT_OF_RESOURCE No enough memory.
|
---|
649 | @return Other value LegacyBoot options are not added.
|
---|
650 | **/
|
---|
651 | EFI_STATUS
|
---|
652 | EFIAPI
|
---|
653 | BdsAddNonExistingLegacyBootOptions (
|
---|
654 | VOID
|
---|
655 | );
|
---|
656 |
|
---|
657 | /**
|
---|
658 | Add the legacy boot devices from BBS table into
|
---|
659 | the legacy device boot order.
|
---|
660 |
|
---|
661 | @retval EFI_SUCCESS The boot devices are added successfully.
|
---|
662 | @retval EFI_NOT_FOUND The legacy boot devices are not found.
|
---|
663 | @retval EFI_OUT_OF_RESOURCES Memory or storage is not enough.
|
---|
664 | @retval EFI_DEVICE_ERROR Fail to add the legacy device boot order into EFI variable
|
---|
665 | because of hardware error.
|
---|
666 | **/
|
---|
667 | EFI_STATUS
|
---|
668 | EFIAPI
|
---|
669 | BdsUpdateLegacyDevOrder (
|
---|
670 | VOID
|
---|
671 | );
|
---|
672 |
|
---|
673 | /**
|
---|
674 | Refresh the boot priority for BBS entries based on boot option entry and boot order.
|
---|
675 |
|
---|
676 | @param Entry The boot option is to be checked for refresh BBS table.
|
---|
677 |
|
---|
678 | @retval EFI_SUCCESS The boot priority for BBS entries is refreshed successfully.
|
---|
679 | @retval EFI_NOT_FOUND BBS entries can't be found.
|
---|
680 | @retval EFI_OUT_OF_RESOURCES Failed to get the legacy device boot order.
|
---|
681 | **/
|
---|
682 | EFI_STATUS
|
---|
683 | EFIAPI
|
---|
684 | BdsRefreshBbsTableForBoot (
|
---|
685 | IN BDS_COMMON_OPTION *Entry
|
---|
686 | );
|
---|
687 |
|
---|
688 | /**
|
---|
689 | Delete the Boot Option from EFI Variable. The Boot Order Array
|
---|
690 | is also updated.
|
---|
691 |
|
---|
692 | @param OptionNumber The number of Boot option want to be deleted.
|
---|
693 | @param BootOrder The Boot Order array.
|
---|
694 | @param BootOrderSize The size of the Boot Order Array.
|
---|
695 |
|
---|
696 | @retval EFI_SUCCESS The Boot Option Variable was found and removed
|
---|
697 | @retval EFI_UNSUPPORTED The Boot Option Variable store was inaccessible
|
---|
698 | @retval EFI_NOT_FOUND The Boot Option Variable was not found
|
---|
699 | **/
|
---|
700 | EFI_STATUS
|
---|
701 | EFIAPI
|
---|
702 | BdsDeleteBootOption (
|
---|
703 | IN UINTN OptionNumber,
|
---|
704 | IN OUT UINT16 *BootOrder,
|
---|
705 | IN OUT UINTN *BootOrderSize
|
---|
706 | );
|
---|
707 |
|
---|
708 | //
|
---|
709 | //The interface functions related to the Setup Browser Reset Reminder feature
|
---|
710 | //
|
---|
711 | /**
|
---|
712 | Enable the setup browser reset reminder feature.
|
---|
713 | This routine is used in platform tip. If the platform policy needs the feature, use the routine to enable it.
|
---|
714 |
|
---|
715 | **/
|
---|
716 | VOID
|
---|
717 | EFIAPI
|
---|
718 | EnableResetReminderFeature (
|
---|
719 | VOID
|
---|
720 | );
|
---|
721 |
|
---|
722 | /**
|
---|
723 | Disable the setup browser reset reminder feature.
|
---|
724 | This routine is used in platform tip. If the platform policy does not want the feature, use the routine to disable it.
|
---|
725 |
|
---|
726 | **/
|
---|
727 | VOID
|
---|
728 | EFIAPI
|
---|
729 | DisableResetReminderFeature (
|
---|
730 | VOID
|
---|
731 | );
|
---|
732 |
|
---|
733 | /**
|
---|
734 | Record the info that a reset is required.
|
---|
735 | A module boolean variable is used to record whether a reset is required.
|
---|
736 |
|
---|
737 | **/
|
---|
738 | VOID
|
---|
739 | EFIAPI
|
---|
740 | EnableResetRequired (
|
---|
741 | VOID
|
---|
742 | );
|
---|
743 |
|
---|
744 |
|
---|
745 | /**
|
---|
746 | Record the info that no reset is required.
|
---|
747 | A module boolean variable is used to record whether a reset is required.
|
---|
748 |
|
---|
749 | **/
|
---|
750 | VOID
|
---|
751 | EFIAPI
|
---|
752 | DisableResetRequired (
|
---|
753 | VOID
|
---|
754 | );
|
---|
755 |
|
---|
756 | /**
|
---|
757 | Check whether platform policy enables the reset reminder feature. The default is enabled.
|
---|
758 |
|
---|
759 | **/
|
---|
760 | BOOLEAN
|
---|
761 | EFIAPI
|
---|
762 | IsResetReminderFeatureEnable (
|
---|
763 | VOID
|
---|
764 | );
|
---|
765 |
|
---|
766 | /**
|
---|
767 | Check if the user changed any option setting that needs a system reset to be effective.
|
---|
768 |
|
---|
769 | **/
|
---|
770 | BOOLEAN
|
---|
771 | EFIAPI
|
---|
772 | IsResetRequired (
|
---|
773 | VOID
|
---|
774 | );
|
---|
775 |
|
---|
776 | /**
|
---|
777 | Check whether a reset is needed, and finish the reset reminder feature.
|
---|
778 | If a reset is needed, pop up a menu to notice user, and finish the feature
|
---|
779 | according to the user selection.
|
---|
780 |
|
---|
781 | **/
|
---|
782 | VOID
|
---|
783 | EFIAPI
|
---|
784 | SetupResetReminder (
|
---|
785 | VOID
|
---|
786 | );
|
---|
787 |
|
---|
788 |
|
---|
789 | ///
|
---|
790 | /// Define the boot type which to classify the boot option type
|
---|
791 | /// Different boot option type could have different boot behavior
|
---|
792 | /// Use their device path node (Type + SubType) as type value
|
---|
793 | /// The boot type here can be added according to requirement
|
---|
794 | ///
|
---|
795 |
|
---|
796 | ///
|
---|
797 | /// ACPI boot type. For ACPI device, cannot use sub-type to distinguish device, so hardcode their value
|
---|
798 | ///
|
---|
799 | #define BDS_EFI_ACPI_FLOPPY_BOOT 0x0201
|
---|
800 | ///
|
---|
801 | /// Message boot type
|
---|
802 | /// If a device path of boot option only point to a message node, the boot option is message boot type
|
---|
803 | ///
|
---|
804 | #define BDS_EFI_MESSAGE_ATAPI_BOOT 0x0301 // Type 03; Sub-Type 01
|
---|
805 | #define BDS_EFI_MESSAGE_SCSI_BOOT 0x0302 // Type 03; Sub-Type 02
|
---|
806 | #define BDS_EFI_MESSAGE_USB_DEVICE_BOOT 0x0305 // Type 03; Sub-Type 05
|
---|
807 | #define BDS_EFI_MESSAGE_SATA_BOOT 0x0312 // Type 03; Sub-Type 18
|
---|
808 | #define BDS_EFI_MESSAGE_MAC_BOOT 0x030b // Type 03; Sub-Type 11
|
---|
809 | #define BDS_EFI_MESSAGE_MISC_BOOT 0x03FF
|
---|
810 |
|
---|
811 | ///
|
---|
812 | /// Media boot type
|
---|
813 | /// If a device path of boot option contain a media node, the boot option is media boot type
|
---|
814 | ///
|
---|
815 | #define BDS_EFI_MEDIA_HD_BOOT 0x0401 // Type 04; Sub-Type 01
|
---|
816 | #define BDS_EFI_MEDIA_CDROM_BOOT 0x0402 // Type 04; Sub-Type 02
|
---|
817 | ///
|
---|
818 | /// BBS boot type
|
---|
819 | /// If a device path of boot option contain a BBS node, the boot option is BBS boot type
|
---|
820 | ///
|
---|
821 | #define BDS_LEGACY_BBS_BOOT 0x0501 // Type 05; Sub-Type 01
|
---|
822 |
|
---|
823 | #define BDS_EFI_UNSUPPORT 0xFFFF
|
---|
824 |
|
---|
825 | /**
|
---|
826 | Check whether an instance in BlockIoDevicePath has the same partition node as the HardDriveDevicePath device path
|
---|
827 |
|
---|
828 | @param BlockIoDevicePath Multi device path instances to check
|
---|
829 | @param HardDriveDevicePath A device path starting with a hard drive media
|
---|
830 | device path.
|
---|
831 |
|
---|
832 | @retval TRUE There is a matched device path instance.
|
---|
833 | @retval FALSE There is no matched device path instance.
|
---|
834 |
|
---|
835 | **/
|
---|
836 | BOOLEAN
|
---|
837 | EFIAPI
|
---|
838 | MatchPartitionDevicePathNode (
|
---|
839 | IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath,
|
---|
840 | IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath
|
---|
841 | );
|
---|
842 |
|
---|
843 |
|
---|
844 | /**
|
---|
845 | Expand a device path that starts with a hard drive media device path node to be a
|
---|
846 | full device path that includes the full hardware path to the device. This function enables the device to boot.
|
---|
847 | To avoid requiring a connect on every boot, the front match is saved in a variable (the part point
|
---|
848 | to the partition node. E.g. ACPI() /PCI()/ATA()/Partition() ).
|
---|
849 | All successful history device paths
|
---|
850 | that point to the front part of the partition node will be saved.
|
---|
851 |
|
---|
852 | @param HardDriveDevicePath EFI Device Path to boot, if it starts with a hard
|
---|
853 | drive media device path.
|
---|
854 | @return A Pointer to the full device path or NULL if a valid Hard Drive device path
|
---|
855 | cannot be found.
|
---|
856 |
|
---|
857 | **/
|
---|
858 | EFI_DEVICE_PATH_PROTOCOL *
|
---|
859 | EFIAPI
|
---|
860 | BdsExpandPartitionPartialDevicePathToFull (
|
---|
861 | IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath
|
---|
862 | );
|
---|
863 |
|
---|
864 | /**
|
---|
865 | Return the bootable media handle.
|
---|
866 | First, check whether the device is connected.
|
---|
867 | Second, check whether the device path points to a device that supports SimpleFileSystemProtocol.
|
---|
868 | Third, detect the default boot file in the Media, and return the removable Media handle.
|
---|
869 |
|
---|
870 | @param DevicePath Device Path to a bootable device
|
---|
871 |
|
---|
872 | @return The bootable media handle. If the media on the DevicePath is not bootable, NULL will return.
|
---|
873 |
|
---|
874 | **/
|
---|
875 | EFI_HANDLE
|
---|
876 | EFIAPI
|
---|
877 | BdsLibGetBootableHandle (
|
---|
878 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
---|
879 | IN OUT CHAR16 **NewFileName
|
---|
880 | );
|
---|
881 |
|
---|
882 |
|
---|
883 | /**
|
---|
884 | Checks whether the Device path in a boot option points to a valid bootable device, and if the device
|
---|
885 | is ready to boot now.
|
---|
886 |
|
---|
887 | @param DevPath the Device path in a boot option
|
---|
888 | @param CheckMedia if true, check whether the device is ready to boot now.
|
---|
889 |
|
---|
890 | @retval TRUE the Device path is valid
|
---|
891 | @retval FALSE the Device path is invalid
|
---|
892 |
|
---|
893 | **/
|
---|
894 | BOOLEAN
|
---|
895 | EFIAPI
|
---|
896 | BdsLibIsValidEFIBootOptDevicePath (
|
---|
897 | IN EFI_DEVICE_PATH_PROTOCOL *DevPath,
|
---|
898 | IN BOOLEAN CheckMedia
|
---|
899 | );
|
---|
900 |
|
---|
901 | /**
|
---|
902 | Checks whether the Device path in a boot option points to a valid bootable device, and if the device
|
---|
903 | is ready to boot now.
|
---|
904 | If Description is not NULL and the device path points to a fixed BlockIo
|
---|
905 | device, this function checks whether the description conflicts with other auto-created
|
---|
906 | boot options.
|
---|
907 |
|
---|
908 | @param DevPath the Device path in a boot option
|
---|
909 | @param CheckMedia if true, checks if the device is ready to boot now.
|
---|
910 | @param Description the description of a boot option
|
---|
911 |
|
---|
912 | @retval TRUE the Device path is valid
|
---|
913 | @retval FALSE the Device path is invalid
|
---|
914 |
|
---|
915 | **/
|
---|
916 | BOOLEAN
|
---|
917 | EFIAPI
|
---|
918 | BdsLibIsValidEFIBootOptDevicePathExt (
|
---|
919 | IN EFI_DEVICE_PATH_PROTOCOL *DevPath,
|
---|
920 | IN BOOLEAN CheckMedia,
|
---|
921 | IN CHAR16 *Description
|
---|
922 | );
|
---|
923 |
|
---|
924 | /**
|
---|
925 | For a bootable Device path, return its boot type.
|
---|
926 |
|
---|
927 | @param DevicePath The bootable device Path to check
|
---|
928 |
|
---|
929 | @retval BDS_EFI_MEDIA_HD_BOOT If given device path contains MEDIA_DEVICE_PATH type device path node which subtype is MEDIA_HARDDRIVE_DP @retval BDS_EFI_MEDIA_CDROM_BOOT If given device path contains MEDIA_DEVICE_PATH type device path node which subtype is MEDIA_CDROM_DP @retval BDS_EFI_ACPI_FLOPPY_BOOT If given device path contains ACPI_DEVICE_PATH type device path node which HID is floppy device. @retval BDS_EFI_MESSAGE_ATAPI_BOOT If given device path contains MESSAGING_DEVICE_PATH type device path node and its last device path node's subtype is MSG_ATAPI_DP. @retval BDS_EFI_MESSAGE_SCSI_BOOT If given device path contains MESSAGING_DEVICE_PATH type device path node and its last device path node's subtype is MSG_SCSI_DP. @retval BDS_EFI_MESSAGE_USB_DEVICE_BOOT If given device path contains MESSAGING_DEVICE_PATH type device path node and its last device path node's subtype is MSG_USB_DP. @retval BDS_EFI_MESSAGE_MISC_BOOT If the device path not contains any media device path node, and its last device path node point to a message device path node. @retval BDS_LEGACY_BBS_BOOT If given device path contains BBS_DEVICE_PATH type device path node. @retval BDS_EFI_UNSUPPORT An EFI Removable BlockIO device path not point to a media and message device,
|
---|
930 | **/
|
---|
931 | UINT32
|
---|
932 | EFIAPI
|
---|
933 | BdsGetBootTypeFromDevicePath (
|
---|
934 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
---|
935 | );
|
---|
936 |
|
---|
937 |
|
---|
938 | /**
|
---|
939 | This routine registers a function to adjust the different types of memory page numbers
|
---|
940 | just before booting, and saves the updated info into the variable for the next boot to use.
|
---|
941 |
|
---|
942 | **/
|
---|
943 | VOID
|
---|
944 | EFIAPI
|
---|
945 | BdsLibSaveMemoryTypeInformation (
|
---|
946 | VOID
|
---|
947 | );
|
---|
948 |
|
---|
949 |
|
---|
950 | /**
|
---|
951 | This function checks if a Fv file device path is valid, according to a file GUID. If it is invalid,
|
---|
952 | it tries to return the valid device path.
|
---|
953 | FV address maybe changes for memory layout adjust from time to time, use this function
|
---|
954 | could promise the Fv file device path is right.
|
---|
955 |
|
---|
956 | @param DevicePath on input, the Fv file device path to check. On
|
---|
957 | output, the updated valid Fv file device path
|
---|
958 | @param FileGuid the Fv file GUID
|
---|
959 |
|
---|
960 | @retval EFI_INVALID_PARAMETER the input DevicePath or FileGuid is invalid
|
---|
961 | @retval EFI_UNSUPPORTED the input DevicePath does not contain an Fv file
|
---|
962 | GUID at all
|
---|
963 | @retval EFI_ALREADY_STARTED the input DevicePath has pointed to the Fv file and is
|
---|
964 | valid
|
---|
965 | @retval EFI_SUCCESS successfully updated the invalid DevicePath
|
---|
966 | and returned the updated device path in DevicePath
|
---|
967 |
|
---|
968 | **/
|
---|
969 | EFI_STATUS
|
---|
970 | EFIAPI
|
---|
971 | BdsLibUpdateFvFileDevicePath (
|
---|
972 | IN OUT EFI_DEVICE_PATH_PROTOCOL ** DevicePath,
|
---|
973 | IN EFI_GUID *FileGuid
|
---|
974 | );
|
---|
975 |
|
---|
976 |
|
---|
977 | /**
|
---|
978 | Connect the specific USB device that matches the RemainingDevicePath,
|
---|
979 | and whose bus is determined by Host Controller (Uhci or Ehci)
|
---|
980 |
|
---|
981 | @param HostControllerPI Uhci (0x00) or Ehci (0x20) or Both uhci and ehci
|
---|
982 | (0xFF)
|
---|
983 | @param RemainingDevicePath a short-form device path that starts with the first
|
---|
984 | element being a USB WWID or a USB Class device
|
---|
985 | path
|
---|
986 |
|
---|
987 | @retval EFI_SUCCESS The specific Usb device is connected successfully.
|
---|
988 | @retval EFI_INVALID_PARAMETER Invalid HostControllerPi (not 0x00, 0x20 or 0xFF)
|
---|
989 | or RemainingDevicePath is not the USB class device path.
|
---|
990 | @retval EFI_NOT_FOUND The device specified by device path is not found.
|
---|
991 |
|
---|
992 | **/
|
---|
993 | EFI_STATUS
|
---|
994 | EFIAPI
|
---|
995 | BdsLibConnectUsbDevByShortFormDP(
|
---|
996 | IN UINT8 HostControllerPI,
|
---|
997 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
---|
998 | );
|
---|
999 |
|
---|
1000 |
|
---|
1001 | //
|
---|
1002 | // The implementation of this function is provided by Platform code.
|
---|
1003 | //
|
---|
1004 | /**
|
---|
1005 | Convert Vendor device path to a device name.
|
---|
1006 |
|
---|
1007 | @param Str The buffer storing device name
|
---|
1008 | @param DevPath Pointer to vendor device path
|
---|
1009 |
|
---|
1010 | **/
|
---|
1011 | VOID
|
---|
1012 | DevPathVendor (
|
---|
1013 | IN OUT POOL_PRINT *Str,
|
---|
1014 | IN VOID *DevPath
|
---|
1015 | );
|
---|
1016 |
|
---|
1017 | /**
|
---|
1018 | Concatenates a formatted unicode string to allocated pool.
|
---|
1019 | The caller must free the resulting buffer.
|
---|
1020 |
|
---|
1021 | @param Str Tracks the allocated pool, size in use, and amount of pool allocated.
|
---|
1022 | @param Fmt The format string
|
---|
1023 | @param ... The data will be printed.
|
---|
1024 |
|
---|
1025 | @return Allocated buffer with the formatted string printed in it.
|
---|
1026 | The caller must free the allocated buffer.
|
---|
1027 | The buffer allocation is not packed.
|
---|
1028 |
|
---|
1029 | **/
|
---|
1030 | CHAR16 *
|
---|
1031 | EFIAPI
|
---|
1032 | CatPrint (
|
---|
1033 | IN OUT POOL_PRINT *Str,
|
---|
1034 | IN CHAR16 *Fmt,
|
---|
1035 | ...
|
---|
1036 | );
|
---|
1037 |
|
---|
1038 | /**
|
---|
1039 | Use SystemTable ConOut to stop video based Simple Text Out consoles from going
|
---|
1040 | to the video device. Put up LogoFile on every video device that is a console.
|
---|
1041 |
|
---|
1042 | @param[in] LogoFile File name of logo to display on the center of the screen.
|
---|
1043 |
|
---|
1044 | @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.
|
---|
1045 | @retval EFI_UNSUPPORTED Logo not found
|
---|
1046 |
|
---|
1047 | **/
|
---|
1048 | EFI_STATUS
|
---|
1049 | EFIAPI
|
---|
1050 | EnableQuietBoot (
|
---|
1051 | IN EFI_GUID *LogoFile
|
---|
1052 | );
|
---|
1053 |
|
---|
1054 |
|
---|
1055 | /**
|
---|
1056 | Use SystemTable ConOut to turn on video based Simple Text Out consoles. The
|
---|
1057 | Simple Text Out screens will now be synced up with all non video output devices
|
---|
1058 |
|
---|
1059 | @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
|
---|
1060 |
|
---|
1061 | **/
|
---|
1062 | EFI_STATUS
|
---|
1063 | EFIAPI
|
---|
1064 | DisableQuietBoot (
|
---|
1065 | VOID
|
---|
1066 | );
|
---|
1067 |
|
---|
1068 | #endif
|
---|
1069 |
|
---|