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