]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/UefiBootManagerLib.h
MdeModulePkg: Rename confusion function name
[mirror_edk2.git] / MdeModulePkg / Include / Library / UefiBootManagerLib.h
1 /** @file
2 Provide Boot Manager related library APIs.
3
4 Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16
17 #ifndef _UEFI_BOOT_MANAGER_LIB_H_
18 #define _UEFI_BOOT_MANAGER_LIB_H_
19
20 #include <Protocol/DriverHealth.h>
21 #include <Library/SortLib.h>
22
23 //
24 // Boot Manager load option library functions.
25 //
26
27 //
28 // Load Option Type
29 //
30 typedef enum {
31 LoadOptionTypeDriver,
32 LoadOptionTypeSysPrep,
33 LoadOptionTypeBoot,
34 LoadOptionTypePlatformRecovery,
35 LoadOptionTypeMax
36 } EFI_BOOT_MANAGER_LOAD_OPTION_TYPE;
37
38 typedef enum {
39 LoadOptionNumberMax = 0x10000,
40 LoadOptionNumberUnassigned = LoadOptionNumberMax
41 } EFI_BOOT_MANAGER_LOAD_OPTION_NUMBER;
42
43 //
44 // Common structure definition for DriverOption and BootOption
45 //
46 typedef struct {
47 //
48 // Data read from UEFI NV variables
49 //
50 UINTN OptionNumber; // #### numerical value, could be LoadOptionNumberUnassigned
51 EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType; // LoadOptionTypeBoot or LoadOptionTypeDriver
52 UINT32 Attributes; // Load Option Attributes
53 CHAR16 *Description; // Load Option Description
54 EFI_DEVICE_PATH_PROTOCOL *FilePath; // Load Option Device Path
55 UINT8 *OptionalData; // Load Option optional data to pass into image
56 UINT32 OptionalDataSize; // Load Option size of OptionalData
57 EFI_GUID VendorGuid;
58
59 //
60 // Used at runtime
61 //
62 EFI_STATUS Status; // Status returned from boot attempt gBS->StartImage ()
63 CHAR16 *ExitData; // Exit data returned from gBS->StartImage ()
64 UINTN ExitDataSize; // Size of ExitData
65 } EFI_BOOT_MANAGER_LOAD_OPTION;
66
67 /**
68 Returns an array of load options based on the EFI variable
69 L"BootOrder"/L"DriverOrder" and the L"Boot####"/L"Driver####" variables impled by it.
70 #### is the hex value of the UINT16 in each BootOrder/DriverOrder entry.
71
72 @param LoadOptionCount Returns number of entries in the array.
73 @param LoadOptionType The type of the load option.
74
75 @retval NULL No load options exist.
76 @retval !NULL Array of load option entries.
77
78 **/
79 EFI_BOOT_MANAGER_LOAD_OPTION *
80 EFIAPI
81 EfiBootManagerGetLoadOptions (
82 OUT UINTN *LoadOptionCount,
83 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType
84 );
85
86 /**
87 Free an array of load options returned from EfiBootManagerGetLoadOptions().
88
89 @param LoadOptions Pointer to the array of load options to free.
90 @param LoadOptionCount Number of array entries in LoadOptions.
91
92 @return EFI_SUCCESS LoadOptions was freed.
93 @return EFI_INVALID_PARAMETER LoadOptions is NULL.
94 **/
95 EFI_STATUS
96 EFIAPI
97 EfiBootManagerFreeLoadOptions (
98 IN EFI_BOOT_MANAGER_LOAD_OPTION *LoadOptions,
99 IN UINTN LoadOptionCount
100 );
101
102 /**
103 Initialize a load option.
104
105 @param Option Pointer to the load option to be initialized.
106 @param OptionNumber Option number of the load option.
107 @param OptionType Type of the load option.
108 @param Attributes Attributes of the load option.
109 @param Description Description of the load option.
110 @param FilePath Device path of the load option.
111 @param OptionalData Optional data of the load option.
112 @param OptionalDataSize Size of the optional data of the load option.
113
114 @retval EFI_SUCCESS The load option was initialized successfully.
115 @retval EFI_INVALID_PARAMETER Option, Description or FilePath is NULL.
116 **/
117 EFI_STATUS
118 EFIAPI
119 EfiBootManagerInitializeLoadOption (
120 IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *Option,
121 IN UINTN OptionNumber,
122 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType,
123 IN UINT32 Attributes,
124 IN CHAR16 *Description,
125 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
126 IN UINT8 *OptionalData,
127 IN UINT32 OptionalDataSize
128 );
129
130 /**
131 Free a load option created by EfiBootManagerInitializeLoadOption()
132 or EfiBootManagerVariableToLoadOption().
133
134 @param LoadOption Pointer to the load option to free.
135 CONCERN: Check Boot#### instead of BootOrder, optimize, spec clarify
136 @return EFI_SUCCESS LoadOption was freed.
137 @return EFI_INVALID_PARAMETER LoadOption is NULL.
138
139 **/
140 EFI_STATUS
141 EFIAPI
142 EfiBootManagerFreeLoadOption (
143 IN EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption
144 );
145
146 /**
147 Initialize the load option from the VariableName.
148
149 @param VariableName EFI Variable name which could be Boot#### or
150 Driver####
151 @param LoadOption Pointer to the load option to be initialized
152
153 @retval EFI_SUCCESS The option was created
154 @retval EFI_INVALID_PARAMETER VariableName or LoadOption is NULL.
155 @retval EFI_NOT_FOUND The variable specified by VariableName cannot be found.
156 **/
157 EFI_STATUS
158 EFIAPI
159 EfiBootManagerVariableToLoadOption (
160 IN CHAR16 *VariableName,
161 IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption
162 );
163
164 /**
165 Create the Boot#### or Driver#### variable from the load option.
166
167 @param LoadOption Pointer to the load option.
168
169 @retval EFI_SUCCESS The variable was created.
170 @retval Others Error status returned by RT->SetVariable.
171 **/
172 EFI_STATUS
173 EFIAPI
174 EfiBootManagerLoadOptionToVariable (
175 IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption
176 );
177
178 /**
179 This function will register the new Boot####, Driver#### or SysPrep#### option.
180 After the *#### is updated, the *Order will also be updated.
181
182 @param Option Pointer to load option to add. If on input
183 Option->OptionNumber is LoadOptionNumberUnassigned,
184 then on output Option->OptionNumber is updated to
185 the number of the new Boot####,
186 Driver#### or SysPrep#### option.
187 @param Position Position of the new load option to put in the ****Order variable.
188
189 @retval EFI_SUCCESS The *#### have been successfully registered.
190 @retval EFI_INVALID_PARAMETER The option number exceeds 0xFFFF.
191 @retval EFI_ALREADY_STARTED The option number of Option is being used already.
192 Note: this API only adds new load option, no replacement support.
193 @retval EFI_OUT_OF_RESOURCES There is no free option number that can be used when the
194 option number specified in the Option is LoadOptionNumberUnassigned.
195 @return Status codes of gRT->SetVariable ().
196
197 **/
198 EFI_STATUS
199 EFIAPI
200 EfiBootManagerAddLoadOptionVariable (
201 IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *Option,
202 IN UINTN Position
203 );
204
205 /**
206 Delete the load option according to the OptionNumber and OptionType.
207
208 Only the BootOrder/DriverOrder is updated to remove the reference of the OptionNumber.
209
210 @param OptionNumber Option number of the load option.
211 @param OptionType Type of the load option.
212
213 @retval EFI_NOT_FOUND The load option cannot be found.
214 @retval EFI_SUCCESS The load option was deleted.
215 **/
216 EFI_STATUS
217 EFIAPI
218 EfiBootManagerDeleteLoadOptionVariable (
219 IN UINTN OptionNumber,
220 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType
221 );
222
223 /**
224 Sort the load options. The DriverOrder/BootOrder variables will be re-created to
225 reflect the new order.
226
227 @param OptionType The type of the load option.
228 @param CompareFunction The comparator function pointer.
229 **/
230 VOID
231 EFIAPI
232 EfiBootManagerSortLoadOptionVariable (
233 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType,
234 IN SORT_COMPARE CompareFunction
235 );
236
237 /**
238 Return the index of the load option in the load option array.
239
240 The function consider two load options are equal when the
241 OptionType, Attributes, Description, FilePath and OptionalData are equal.
242
243 @param Key Pointer to the load option to be found.
244 @param Array Pointer to the array of load options to be found.
245 @param Count Number of entries in the Array.
246
247 @retval -1 Key wasn't found in the Array.
248 @retval 0 ~ Count-1 The index of the Key in the Array.
249 **/
250 INTN
251 EFIAPI
252 EfiBootManagerFindLoadOption (
253 IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
254 IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
255 IN UINTN Count
256 );
257
258 //
259 // Boot Manager hot key library functions.
260 //
261
262 #pragma pack(1)
263 ///
264 /// EFI Key Option.
265 ///
266 typedef struct {
267 ///
268 /// Specifies options about how the key will be processed.
269 ///
270 EFI_BOOT_KEY_DATA KeyData;
271 ///
272 /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
273 /// which BootOption refers. If the CRC-32s do not match this value, then this key
274 /// option is ignored.
275 ///
276 UINT32 BootOptionCrc;
277 ///
278 /// The Boot#### option which will be invoked if this key is pressed and the boot option
279 /// is active (LOAD_OPTION_ACTIVE is set).
280 ///
281 UINT16 BootOption;
282 ///
283 /// The key codes to compare against those returned by the
284 /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
285 /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
286 ///
287 EFI_INPUT_KEY Keys[3];
288 UINT16 OptionNumber;
289 } EFI_BOOT_MANAGER_KEY_OPTION;
290 #pragma pack()
291
292 /**
293 Start the hot key service so that the key press can trigger the boot option.
294
295 @param HotkeyTriggered Return the waitable event and it will be signaled
296 when a valid hot key is pressed.
297
298 @retval EFI_SUCCESS The hot key service is started.
299 **/
300 EFI_STATUS
301 EFIAPI
302 EfiBootManagerStartHotkeyService (
303 IN EFI_EVENT *HotkeyTriggered
304 );
305
306 //
307 // Modifier for EfiBootManagerAddKeyOptionVariable and EfiBootManagerDeleteKeyOptionVariable
308 //
309 #define EFI_BOOT_MANAGER_SHIFT_PRESSED 0x00000001
310 #define EFI_BOOT_MANAGER_CONTROL_PRESSED 0x00000002
311 #define EFI_BOOT_MANAGER_ALT_PRESSED 0x00000004
312 #define EFI_BOOT_MANAGER_LOGO_PRESSED 0x00000008
313 #define EFI_BOOT_MANAGER_MENU_KEY_PRESSED 0x00000010
314 #define EFI_BOOT_MANAGER_SYS_REQ_PRESSED 0x00000020
315
316 /**
317 Add the key option.
318 It adds the key option variable and the key option takes affect immediately.
319
320 @param AddedOption Return the added key option.
321 @param BootOptionNumber The boot option number for the key option.
322 @param Modifier Key shift state.
323 @param ... Parameter list of pointer of EFI_INPUT_KEY.
324
325 @retval EFI_SUCCESS The key option is added.
326 @retval EFI_ALREADY_STARTED The hot key is already used by certain key option.
327 **/
328 EFI_STATUS
329 EFIAPI
330 EfiBootManagerAddKeyOptionVariable (
331 OUT EFI_BOOT_MANAGER_KEY_OPTION *AddedOption, OPTIONAL
332 IN UINT16 BootOptionNumber,
333 IN UINT32 Modifier,
334 ...
335 );
336
337 /**
338 Delete the Key Option variable and unregister the hot key
339
340 @param DeletedOption Return the deleted key options.
341 @param Modifier Key shift state.
342 @param ... Parameter list of pointer of EFI_INPUT_KEY.
343
344 @retval EFI_SUCCESS The key option is deleted.
345 @retval EFI_NOT_FOUND The key option cannot be found.
346 **/
347 EFI_STATUS
348 EFIAPI
349 EfiBootManagerDeleteKeyOptionVariable (
350 IN EFI_BOOT_MANAGER_KEY_OPTION *DeletedOption, OPTIONAL
351 IN UINT32 Modifier,
352 ...
353 );
354
355 /**
356 Register the key option to exit the waiting of the Boot Manager timeout.
357 Platform should ensure that the continue key option isn't conflict with
358 other boot key options.
359
360 @param Modifier Key shift state.
361 @param ... Parameter list of pointer of EFI_INPUT_KEY.
362
363 @retval EFI_SUCCESS Successfully register the continue key option.
364 @retval EFI_ALREADY_STARTED The continue key option is already registered.
365 **/
366 EFI_STATUS
367 EFIAPI
368 EfiBootManagerRegisterContinueKeyOption (
369 IN UINT32 Modifier,
370 ...
371 );
372
373 /**
374 Try to boot the boot option triggered by hot key.
375 **/
376 VOID
377 EFIAPI
378 EfiBootManagerHotkeyBoot (
379 VOID
380 );
381 //
382 // Boot Manager boot library functions.
383 //
384
385 /**
386 The function creates boot options for all possible bootable medias in the following order:
387 1. Removable BlockIo - The boot option only points to the removable media
388 device, like USB key, DVD, Floppy etc.
389 2. Fixed BlockIo - The boot option only points to a Fixed blockIo device,
390 like HardDisk.
391 3. Non-BlockIo SimpleFileSystem - The boot option points to a device supporting
392 SimpleFileSystem Protocol, but not supporting BlockIo
393 protocol.
394 4. LoadFile - The boot option points to the media supporting
395 LoadFile protocol.
396 Reference: UEFI Spec chapter 3.3 Boot Option Variables Default Boot Behavior
397
398 The function won't delete the boot option not added by itself.
399 **/
400 VOID
401 EFIAPI
402 EfiBootManagerRefreshAllBootOption (
403 VOID
404 );
405
406 /**
407 Attempt to boot the EFI boot option. This routine sets L"BootCurent" and
408 signals the EFI ready to boot event. If the device path for the option starts
409 with a BBS device path a legacy boot is attempted. Short form device paths are
410 also supported via this rountine. A device path starting with
411 MEDIA_HARDDRIVE_DP, MSG_USB_WWID_DP, MSG_USB_CLASS_DP gets expaned out
412 to find the first device that matches. If the BootOption Device Path
413 fails the removable media boot algorithm is attempted (\EFI\BOOTIA32.EFI,
414 \EFI\BOOTX64.EFI,... only one file type is tried per processor type)
415
416 @param BootOption Boot Option to try and boot.
417 On return, BootOption->Status contains the boot status:
418 EFI_SUCCESS BootOption was booted
419 EFI_UNSUPPORTED BootOption isn't supported.
420 EFI_NOT_FOUND The BootOption was not found on the system
421 Others BootOption failed with this error status
422
423 **/
424 VOID
425 EFIAPI
426 EfiBootManagerBoot (
427 IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
428 );
429
430 /**
431 Return the boot option corresponding to the Boot Manager Menu.
432 It may automatically create one if the boot option hasn't been created yet.
433
434 @param BootOption Return the Boot Manager Menu.
435
436 @retval EFI_SUCCESS The Boot Manager Menu is successfully returned.
437 @retval EFI_NOT_FOUND The Boot Manager Menu cannot be found.
438 @retval others Return status of gRT->SetVariable (). BootOption still points
439 to the Boot Manager Menu even the Status is not EFI_SUCCESS
440 and EFI_NOT_FOUND.
441 **/
442 EFI_STATUS
443 EFIAPI
444 EfiBootManagerGetBootManagerMenu (
445 EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
446 );
447
448 /**
449 Get the next possible full path pointing to the load option.
450 The routine doesn't guarantee the returned full path points to an existing
451 file, and it also doesn't guarantee the existing file is a valid load option.
452 BmGetNextLoadOptionBuffer() guarantees.
453
454 @param FilePath The device path pointing to a load option.
455 It could be a short-form device path.
456 @param FullPath The full path returned by the routine in last call.
457 Set to NULL in first call.
458
459 @return The next possible full path pointing to the load option.
460 Caller is responsible to free the memory.
461 **/
462 EFI_DEVICE_PATH_PROTOCOL *
463 EFIAPI
464 EfiBootManagerGetNextLoadOptionDevicePath (
465 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
466 IN EFI_DEVICE_PATH_PROTOCOL *FullPath
467 );
468
469 /**
470 Get the load option by its device path.
471
472 @param FilePath The device path pointing to a load option.
473 It could be a short-form device path.
474 @param FullPath Return the full device path of the load option after
475 short-form device path expanding.
476 Caller is responsible to free it.
477 @param FileSize Return the load option size.
478
479 @return The load option buffer. Caller is responsible to free the memory.
480 **/
481 VOID *
482 EFIAPI
483 EfiBootManagerGetLoadOptionBuffer (
484 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
485 OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,
486 OUT UINTN *FileSize
487 );
488
489 /**
490 The function enumerates all the legacy boot options, creates them and
491 registers them in the BootOrder variable.
492 **/
493 typedef
494 VOID
495 (EFIAPI *EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION) (
496 VOID
497 );
498
499 /**
500 The function boots a legacy boot option.
501 **/
502 typedef
503 VOID
504 (EFIAPI *EFI_BOOT_MANAGER_LEGACY_BOOT) (
505 IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
506 );
507
508 /**
509 The function registers the legacy boot support capabilities.
510
511 @param RefreshLegacyBootOption The function pointer to create all the legacy boot options.
512 @param LegacyBoot The function pointer to boot the legacy boot option.
513 **/
514 VOID
515 EFIAPI
516 EfiBootManagerRegisterLegacyBootSupport (
517 EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION RefreshLegacyBootOption,
518 EFI_BOOT_MANAGER_LEGACY_BOOT LegacyBoot
519 );
520
521 /**
522 Return the platform provided boot option description for the controller.
523
524 @param Handle Controller handle.
525 @param DefaultDescription Default boot description provided by core.
526
527 @return The callee allocated description string
528 or NULL if the handler wants to use DefaultDescription.
529 **/
530 typedef
531 CHAR16 *
532 (EFIAPI *EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER) (
533 IN EFI_HANDLE Handle,
534 IN CONST CHAR16 *DefaultDescription
535 );
536
537 /**
538 Register the platform provided boot description handler.
539
540 @param Handler The platform provided boot description handler
541
542 @retval EFI_SUCCESS The handler was registered successfully.
543 @retval EFI_ALREADY_STARTED The handler was already registered.
544 @retval EFI_OUT_OF_RESOURCES There is not enough resource to perform the registration.
545 **/
546 EFI_STATUS
547 EFIAPI
548 EfiBootManagerRegisterBootDescriptionHandler (
549 IN EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER Handler
550 );
551
552 //
553 // Boot Manager connect and disconnect library functions
554 //
555
556 /**
557 This function will connect all the system driver to controller
558 first, and then special connect the default console, this make
559 sure all the system controller available and the platform default
560 console connected.
561 **/
562 VOID
563 EFIAPI
564 EfiBootManagerConnectAll (
565 VOID
566 );
567
568 /**
569 This function will create all handles associate with every device
570 path node. If the handle associate with one device path node can not
571 be created successfully, then still give chance to do the dispatch,
572 which load the missing drivers if possible.
573
574 @param DevicePathToConnect The device path which will be connected, it can be
575 a multi-instance device path
576 @param MatchingHandle Return the controller handle closest to the DevicePathToConnect
577
578 @retval EFI_SUCCESS All handles associate with every device path node
579 have been created.
580 @retval EFI_OUT_OF_RESOURCES There is no resource to create new handles.
581 @retval EFI_NOT_FOUND Create the handle associate with one device path
582 node failed.
583 @retval EFI_SECURITY_VIOLATION The user has no permission to start UEFI device
584 drivers on the DevicePath.
585 **/
586 EFI_STATUS
587 EFIAPI
588 EfiBootManagerConnectDevicePath (
589 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect,
590 OUT EFI_HANDLE *MatchingHandle OPTIONAL
591 );
592
593 /**
594 This function will disconnect all current system handles.
595
596 gBS->DisconnectController() is invoked for each handle exists in system handle buffer.
597 If handle is a bus type handle, all childrens also are disconnected recursively by
598 gBS->DisconnectController().
599 **/
600 VOID
601 EFIAPI
602 EfiBootManagerDisconnectAll (
603 VOID
604 );
605
606
607 //
608 // Boot Manager console library functions
609 //
610
611 typedef enum {
612 ConIn,
613 ConOut,
614 ErrOut,
615 ConInDev,
616 ConOutDev,
617 ErrOutDev,
618 ConsoleTypeMax
619 } CONSOLE_TYPE;
620
621 /**
622 This function will connect all the console devices base on the console
623 device variable ConIn, ConOut and ErrOut.
624
625 @retval EFI_DEVICE_ERROR All the consoles were not connected due to an error.
626 @retval EFI_SUCCESS Success connect any one instance of the console
627 device path base on the variable ConVarName.
628 **/
629 EFI_STATUS
630 EFIAPI
631 EfiBootManagerConnectAllDefaultConsoles (
632 VOID
633 );
634
635 /**
636 This function updates the console variable based on ConVarName. It can
637 add or remove one specific console device path from the variable
638
639 @param ConsoleType ConIn, ConOut, ErrOut, ConInDev, ConOutDev or ErrOutDev.
640 @param CustomizedConDevicePath The console device path to be added to
641 the console variable. Cannot be multi-instance.
642 @param ExclusiveDevicePath The console device path to be removed
643 from the console variable. Cannot be multi-instance.
644
645 @retval EFI_UNSUPPORTED The added device path is the same as a removed one.
646 @retval EFI_SUCCESS Successfully added or removed the device path from the
647 console variable.
648
649 **/
650 EFI_STATUS
651 EFIAPI
652 EfiBootManagerUpdateConsoleVariable (
653 IN CONSOLE_TYPE ConsoleType,
654 IN EFI_DEVICE_PATH_PROTOCOL *CustomizedConDevicePath,
655 IN EFI_DEVICE_PATH_PROTOCOL *ExclusiveDevicePath
656 );
657
658 /**
659 Connect the console device base on the variable ConVarName, if
660 device path of the ConVarName is multi-instance device path, if
661 anyone of the instances is connected success, then this function
662 will return success.
663
664 @param ConsoleType ConIn, ConOut or ErrOut.
665
666 @retval EFI_NOT_FOUND There is not any console devices connected
667 success
668 @retval EFI_SUCCESS Success connect any one instance of the console
669 device path base on the variable ConVarName.
670
671 **/
672 EFI_STATUS
673 EFIAPI
674 EfiBootManagerConnectConsoleVariable (
675 IN CONSOLE_TYPE ConsoleType
676 );
677
678 /**
679 Query all the children of VideoController and return the device paths of all the
680 children that support GraphicsOutput protocol.
681
682 @param VideoController PCI handle of video controller.
683
684 @return Device paths of all the children that support GraphicsOutput protocol.
685 **/
686 EFI_DEVICE_PATH_PROTOCOL *
687 EFIAPI
688 EfiBootManagerGetGopDevicePath (
689 IN EFI_HANDLE VideoController
690 );
691
692 /**
693 Connect the platform active active video controller.
694
695 @param VideoController PCI handle of video controller.
696
697 @retval EFI_NOT_FOUND There is no active video controller.
698 @retval EFI_SUCCESS The video controller is connected.
699 **/
700 EFI_STATUS
701 EFIAPI
702 EfiBootManagerConnectVideoController (
703 EFI_HANDLE VideoController OPTIONAL
704 );
705
706 //
707 // Boot Manager driver health library functions.
708 //
709
710 typedef struct {
711 EFI_DRIVER_HEALTH_PROTOCOL *DriverHealth;
712
713 ///
714 /// Driver relative handles
715 ///
716 EFI_HANDLE DriverHealthHandle;
717 EFI_HANDLE ControllerHandle;
718 EFI_HANDLE ChildHandle;
719
720 ///
721 /// Driver health messages of the specify Driver
722 ///
723 EFI_DRIVER_HEALTH_HII_MESSAGE *MessageList;
724
725 ///
726 /// HII relative handles
727 ///
728 EFI_HII_HANDLE HiiHandle;
729
730 ///
731 /// Driver Health status
732 ///
733 EFI_DRIVER_HEALTH_STATUS HealthStatus;
734 } EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO;
735
736 /**
737 Return all the Driver Health information.
738
739 When the cumulative health status of all the controllers managed by the
740 driver who produces the EFI_DRIVER_HEALTH_PROTOCOL is healthy, only one
741 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO entry is created for such
742 EFI_DRIVER_HEALTH_PROTOCOL instance.
743 Otherwise, every controller creates one EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO
744 entry. Additionally every child controller creates one
745 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO entry if the driver is a bus driver.
746
747 @param Count Return the count of the Driver Health information.
748
749 @retval NULL No Driver Health information is returned.
750 @retval !NULL Pointer to the Driver Health information array.
751 **/
752 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *
753 EFIAPI
754 EfiBootManagerGetDriverHealthInfo (
755 UINTN *Count
756 );
757
758 /**
759 Free the Driver Health information array.
760
761 @param DriverHealthInfo Pointer to array of the Driver Health information.
762 @param Count Count of the array.
763
764 @retval EFI_SUCCESS The array is freed.
765 @retval EFI_INVALID_PARAMETER The array is NULL.
766 **/
767 EFI_STATUS
768 EFIAPI
769 EfiBootManagerFreeDriverHealthInfo (
770 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *DriverHealthInfo,
771 UINTN Count
772 );
773
774 /**
775 Process (load and execute) the load option.
776
777 @param LoadOption Pointer to the load option.
778
779 @retval EFI_INVALID_PARAMETER The load option type is invalid,
780 or the load option file path doesn't point to a valid file.
781 @retval EFI_UNSUPPORTED The load option type is of LoadOptionTypeBoot.
782 @retval EFI_SUCCESS The load option is inactive, or successfully loaded and executed.
783 **/
784 EFI_STATUS
785 EFIAPI
786 EfiBootManagerProcessLoadOption (
787 EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption
788 );
789
790 /**
791 Check whether the VariableName is a valid load option variable name
792 and return the load option type and option number.
793
794 @param VariableName The name of the load option variable.
795 @param OptionType Return the load option type.
796 @param OptionNumber Return the load option number.
797
798 @retval TRUE The variable name is valid; The load option type and
799 load option number are returned.
800 @retval FALSE The variable name is NOT valid.
801 **/
802 BOOLEAN
803 EFIAPI
804 EfiBootManagerIsValidLoadOptionVariableName (
805 IN CHAR16 *VariableName,
806 OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType OPTIONAL,
807 OUT UINT16 *OptionNumber OPTIONAL
808 );
809
810
811 /**
812 Dispatch the deferred images that are returned from all DeferredImageLoad instances.
813
814 @retval EFI_SUCCESS At least one deferred image is loaded successfully and started.
815 @retval EFI_NOT_FOUND There is no deferred image.
816 @retval EFI_ACCESS_DENIED There are deferred images but all of them are failed to load.
817 **/
818 EFI_STATUS
819 EFIAPI
820 EfiBootManagerDispatchDeferredImages (
821 VOID
822 );
823 #endif