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