]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/UefiBootManagerLib.h
MdeModulePkg/UefiBootManagerLib: Expose *GetLoadOptionBuffer() API
[mirror_edk2.git] / MdeModulePkg / Include / Library / UefiBootManagerLib.h
CommitLineData
067ed98a
RN
1/** @file\r
2 Provide Boot Manager related library APIs.\r
3\r
4ed2440d 4Copyright (c) 2011 - 2016, 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
63 CHAR16 *ExitData; // Exit data returned from gBS->StartImage () \r
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
70 #### is the hex value of the UINT16 in each BootOrder/DriverOrder entry. \r
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
166 \r
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
179 This function will update the Boot####/Driver####/SysPrep#### and the \r
180 BootOrder/DriverOrder/SysPrepOrder to add a new load option.\r
181\r
182 @param Option Pointer to load option to add.\r
183 @param Position Position of the new load option to put in the BootOrder/DriverOrder/SysPrepOrder.\r
184\r
185 @retval EFI_SUCCESS The load option has been successfully added.\r
186 @retval Others Error status returned by RT->SetVariable.\r
187**/\r
188EFI_STATUS\r
189EFIAPI\r
190EfiBootManagerAddLoadOptionVariable (\r
191 IN EFI_BOOT_MANAGER_LOAD_OPTION *Option,\r
192 IN UINTN Position\r
193 );\r
194\r
195/**\r
196 Delete the load option according to the OptionNumber and OptionType.\r
197 \r
198 Only the BootOrder/DriverOrder is updated to remove the reference of the OptionNumber.\r
199 \r
200 @param OptionNumber Option number of the load option.\r
201 @param OptionType Type of the load option.\r
202\r
203 @retval EFI_NOT_FOUND The load option cannot be found.\r
204 @retval EFI_SUCCESS The load option was deleted.\r
205**/\r
206EFI_STATUS\r
207EFIAPI\r
208EfiBootManagerDeleteLoadOptionVariable (\r
209 IN UINTN OptionNumber,\r
210 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType\r
211 );\r
212\r
213/**\r
214 Sort the load options. The DriverOrder/BootOrder variables will be re-created to \r
215 reflect the new order.\r
216\r
217 @param OptionType The type of the load option.\r
54ae9c08 218 @param CompareFunction The comparator function pointer.\r
067ed98a
RN
219**/\r
220VOID\r
221EFIAPI\r
222EfiBootManagerSortLoadOptionVariable (\r
223 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType,\r
224 IN SORT_COMPARE CompareFunction\r
225 );\r
226\r
5d3a9896
SW
227/**\r
228 Return the index of the load option in the load option array.\r
229\r
230 The function consider two load options are equal when the \r
231 OptionType, Attributes, Description, FilePath and OptionalData are equal.\r
232\r
233 @param Key Pointer to the load option to be found.\r
234 @param Array Pointer to the array of load options to be found.\r
235 @param Count Number of entries in the Array.\r
236\r
237 @retval -1 Key wasn't found in the Array.\r
238 @retval 0 ~ Count-1 The index of the Key in the Array.\r
239**/\r
240INTN\r
241EFIAPI\r
242EfiBootManagerFindLoadOption (\r
243 IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,\r
244 IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,\r
245 IN UINTN Count\r
246 );\r
247\r
067ed98a
RN
248//\r
249// Boot Manager hot key library functions.\r
250//\r
251\r
252#pragma pack(1)\r
253///\r
254/// EFI Key Option.\r
255///\r
256typedef struct {\r
257 ///\r
258 /// Specifies options about how the key will be processed.\r
259 ///\r
260 EFI_BOOT_KEY_DATA KeyData;\r
261 ///\r
262 /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to\r
263 /// which BootOption refers. If the CRC-32s do not match this value, then this key\r
264 /// option is ignored.\r
265 ///\r
266 UINT32 BootOptionCrc;\r
267 ///\r
268 /// The Boot#### option which will be invoked if this key is pressed and the boot option\r
269 /// is active (LOAD_OPTION_ACTIVE is set).\r
270 ///\r
271 UINT16 BootOption;\r
272 ///\r
273 /// The key codes to compare against those returned by the\r
274 /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.\r
275 /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.\r
276 ///\r
277 EFI_INPUT_KEY Keys[3];\r
278 UINT16 OptionNumber;\r
279} EFI_BOOT_MANAGER_KEY_OPTION;\r
280#pragma pack()\r
281\r
282/**\r
283 Start the hot key service so that the key press can trigger the boot option.\r
284\r
285 @param HotkeyTriggered Return the waitable event and it will be signaled \r
286 when a valid hot key is pressed.\r
287\r
288 @retval EFI_SUCCESS The hot key service is started.\r
289**/\r
290EFI_STATUS\r
291EFIAPI\r
292EfiBootManagerStartHotkeyService (\r
293 IN EFI_EVENT *HotkeyTriggered\r
294 );\r
295\r
296//\r
297// Modifier for EfiBootManagerAddKeyOptionVariable and EfiBootManagerDeleteKeyOptionVariable\r
298//\r
299#define EFI_BOOT_MANAGER_SHIFT_PRESSED 0x00000001\r
300#define EFI_BOOT_MANAGER_CONTROL_PRESSED 0x00000002\r
301#define EFI_BOOT_MANAGER_ALT_PRESSED 0x00000004\r
302#define EFI_BOOT_MANAGER_LOGO_PRESSED 0x00000008\r
303#define EFI_BOOT_MANAGER_MENU_KEY_PRESSED 0x00000010\r
304#define EFI_BOOT_MANAGER_SYS_REQ_PRESSED 0x00000020\r
305\r
306/**\r
307 Add the key option.\r
308 It adds the key option variable and the key option takes affect immediately.\r
309\r
310 @param AddedOption Return the added key option.\r
311 @param BootOptionNumber The boot option number for the key option.\r
312 @param Modifier Key shift state.\r
313 @param ... Parameter list of pointer of EFI_INPUT_KEY.\r
314\r
315 @retval EFI_SUCCESS The key option is added.\r
316 @retval EFI_ALREADY_STARTED The hot key is already used by certain key option.\r
317**/\r
318EFI_STATUS\r
319EFIAPI\r
320EfiBootManagerAddKeyOptionVariable (\r
321 OUT EFI_BOOT_MANAGER_KEY_OPTION *AddedOption, OPTIONAL\r
322 IN UINT16 BootOptionNumber,\r
323 IN UINT32 Modifier,\r
324 ...\r
325 );\r
326\r
327/**\r
328 Delete the Key Option variable and unregister the hot key\r
329\r
330 @param DeletedOption Return the deleted key options.\r
331 @param Modifier Key shift state.\r
332 @param ... Parameter list of pointer of EFI_INPUT_KEY.\r
333\r
334 @retval EFI_SUCCESS The key option is deleted.\r
335 @retval EFI_NOT_FOUND The key option cannot be found.\r
336**/\r
337EFI_STATUS\r
338EFIAPI\r
339EfiBootManagerDeleteKeyOptionVariable (\r
340 IN EFI_BOOT_MANAGER_KEY_OPTION *DeletedOption, OPTIONAL\r
341 IN UINT32 Modifier,\r
342 ...\r
343 );\r
344\r
345/**\r
346 Register the key option to exit the waiting of the Boot Manager timeout.\r
347 Platform should ensure that the continue key option isn't conflict with\r
348 other boot key options.\r
349\r
350 @param Modifier Key shift state.\r
351 @param ... Parameter list of pointer of EFI_INPUT_KEY.\r
352\r
353 @retval EFI_SUCCESS Successfully register the continue key option.\r
354 @retval EFI_ALREADY_STARTED The continue key option is already registered.\r
355**/\r
356EFI_STATUS\r
357EFIAPI\r
358EfiBootManagerRegisterContinueKeyOption (\r
359 IN UINT32 Modifier,\r
360 ...\r
361 );\r
362\r
363/**\r
364 Try to boot the boot option triggered by hot key.\r
365**/\r
366VOID\r
367EFIAPI\r
368EfiBootManagerHotkeyBoot (\r
369 VOID\r
370 );\r
371//\r
372// Boot Manager boot library functions.\r
373//\r
374\r
375/**\r
376 The function creates boot options for all possible bootable medias in the following order:\r
377 1. Removable BlockIo - The boot option only points to the removable media\r
378 device, like USB key, DVD, Floppy etc.\r
379 2. Fixed BlockIo - The boot option only points to a Fixed blockIo device,\r
380 like HardDisk.\r
381 3. Non-BlockIo SimpleFileSystem - The boot option points to a device supporting\r
382 SimpleFileSystem Protocol, but not supporting BlockIo\r
383 protocol.\r
384 4. LoadFile - The boot option points to the media supporting \r
385 LoadFile protocol.\r
386 Reference: UEFI Spec chapter 3.3 Boot Option Variables Default Boot Behavior\r
387\r
388 The function won't delete the boot option not added by itself.\r
389**/\r
390VOID\r
391EFIAPI\r
392EfiBootManagerRefreshAllBootOption (\r
393 VOID\r
394 );\r
395\r
396/**\r
397 Attempt to boot the EFI boot option. This routine sets L"BootCurent" and\r
398 signals the EFI ready to boot event. If the device path for the option starts\r
399 with a BBS device path a legacy boot is attempted. Short form device paths are\r
400 also supported via this rountine. A device path starting with \r
401 MEDIA_HARDDRIVE_DP, MSG_USB_WWID_DP, MSG_USB_CLASS_DP gets expaned out\r
402 to find the first device that matches. If the BootOption Device Path \r
403 fails the removable media boot algorithm is attempted (\EFI\BOOTIA32.EFI,\r
404 \EFI\BOOTX64.EFI,... only one file type is tried per processor type)\r
405\r
406 @param BootOption Boot Option to try and boot.\r
407 On return, BootOption->Status contains the boot status:\r
408 EFI_SUCCESS BootOption was booted\r
409 EFI_UNSUPPORTED BootOption isn't supported.\r
410 EFI_NOT_FOUND The BootOption was not found on the system\r
411 Others BootOption failed with this error status\r
412\r
413**/\r
414VOID\r
415EFIAPI\r
416EfiBootManagerBoot (\r
417 IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption\r
418 );\r
419\r
420/**\r
421 Return the Boot Manager Menu.\r
422 \r
423 @param BootOption Return the Boot Manager Menu.\r
424\r
425 @retval EFI_SUCCESS The Boot Manager Menu is successfully returned.\r
426 @retval EFI_NOT_FOUND The Boot Manager Menu is not found.\r
427**/\r
428EFI_STATUS\r
429EFIAPI\r
430EfiBootManagerGetBootManagerMenu (\r
431 EFI_BOOT_MANAGER_LOAD_OPTION *BootOption\r
432 );\r
4ed2440d
RN
433\r
434\r
435/**\r
436 Get the load option by its device path.\r
437\r
438 @param FilePath The device path pointing to a load option.\r
439 It could be a short-form device path.\r
440 @param FullPath Return the full device path of the load option after\r
441 short-form device path expanding.\r
442 Caller is responsible to free it.\r
443 @param FileSize Return the load option size.\r
444\r
445 @return The load option buffer. Caller is responsible to free the memory.\r
446**/\r
447VOID *\r
448EFIAPI\r
449EfiBootManagerGetLoadOptionBuffer (\r
450 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
451 OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,\r
452 OUT UINTN *FileSize\r
453 );\r
067ed98a
RN
454\r
455/**\r
456 The function enumerates all the legacy boot options, creates them and \r
457 registers them in the BootOrder variable.\r
458**/\r
459typedef\r
460VOID\r
461(EFIAPI *EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION) (\r
462 VOID\r
463 );\r
464\r
465/**\r
466 The function boots a legacy boot option.\r
467**/\r
468typedef\r
469VOID\r
470(EFIAPI *EFI_BOOT_MANAGER_LEGACY_BOOT) (\r
471 IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption\r
472 );\r
473\r
474/**\r
475 The function registers the legacy boot support capabilities.\r
476\r
477 @param RefreshLegacyBootOption The function pointer to create all the legacy boot options.\r
478 @param LegacyBoot The function pointer to boot the legacy boot option.\r
479**/\r
480VOID\r
481EFIAPI\r
482EfiBootManagerRegisterLegacyBootSupport (\r
483 EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION RefreshLegacyBootOption,\r
484 EFI_BOOT_MANAGER_LEGACY_BOOT LegacyBoot\r
485 );\r
486\r
f41c71d2
RN
487/**\r
488 Return the platform provided boot option description for the controller.\r
489\r
490 @param Handle Controller handle.\r
491 @param DefaultDescription Default boot description provided by core.\r
492\r
493 @return The callee allocated description string\r
494 or NULL if the handler wants to use DefaultDescription.\r
495**/\r
496typedef\r
497CHAR16 *\r
498(EFIAPI *EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER) (\r
499 IN EFI_HANDLE Handle,\r
500 IN CONST CHAR16 *DefaultDescription\r
501 );\r
502\r
503/**\r
504 Register the platform provided boot description handler.\r
505\r
506 @param Handler The platform provided boot description handler\r
507\r
508 @retval EFI_SUCCESS The handler was registered successfully.\r
509 @retval EFI_ALREADY_STARTED The handler was already registered.\r
510 @retval EFI_OUT_OF_RESOURCES There is not enough resource to perform the registration.\r
511**/\r
512EFI_STATUS\r
513EFIAPI\r
514EfiBootManagerRegisterBootDescriptionHandler (\r
515 IN EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER Handler\r
516 );\r
067ed98a
RN
517\r
518//\r
519// Boot Manager connect and disconnect library functions\r
520//\r
521\r
522/**\r
523 This function will connect all the system driver to controller\r
524 first, and then special connect the default console, this make\r
525 sure all the system controller available and the platform default\r
526 console connected.\r
527**/\r
528VOID\r
529EFIAPI\r
530EfiBootManagerConnectAll (\r
531 VOID\r
532 );\r
533\r
534/**\r
535 This function will create all handles associate with every device\r
536 path node. If the handle associate with one device path node can not\r
537 be created successfully, then still give chance to do the dispatch,\r
538 which load the missing drivers if possible.\r
539\r
540 @param DevicePathToConnect The device path which will be connected, it can be\r
541 a multi-instance device path\r
542 @param MatchingHandle Return the controller handle closest to the DevicePathToConnect\r
543\r
544 @retval EFI_SUCCESS All handles associate with every device path node\r
545 have been created.\r
546 @retval EFI_OUT_OF_RESOURCES There is no resource to create new handles.\r
547 @retval EFI_NOT_FOUND Create the handle associate with one device path\r
548 node failed.\r
549 @retval EFI_SECURITY_VIOLATION The user has no permission to start UEFI device \r
550 drivers on the DevicePath.\r
551**/\r
552EFI_STATUS\r
553EFIAPI\r
554EfiBootManagerConnectDevicePath (\r
555 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect,\r
556 OUT EFI_HANDLE *MatchingHandle OPTIONAL\r
557 );\r
558\r
559/**\r
560 This function will disconnect all current system handles. \r
561 \r
562 gBS->DisconnectController() is invoked for each handle exists in system handle buffer.\r
563 If handle is a bus type handle, all childrens also are disconnected recursively by\r
564 gBS->DisconnectController().\r
565**/\r
566VOID\r
567EFIAPI\r
568EfiBootManagerDisconnectAll (\r
569 VOID\r
570 );\r
571\r
572\r
573//\r
574// Boot Manager console library functions\r
575//\r
576\r
577typedef enum {\r
578 ConIn,\r
579 ConOut,\r
580 ErrOut,\r
581 ConInDev,\r
582 ConOutDev,\r
583 ErrOutDev,\r
584 ConsoleTypeMax\r
585} CONSOLE_TYPE;\r
586\r
587/**\r
588 This function will connect all the console devices base on the console\r
589 device variable ConIn, ConOut and ErrOut.\r
590\r
591 @retval EFI_DEVICE_ERROR All the consoles were not connected due to an error.\r
592 @retval EFI_SUCCESS Success connect any one instance of the console\r
593 device path base on the variable ConVarName.\r
594**/\r
595EFI_STATUS\r
596EFIAPI\r
597EfiBootManagerConnectAllDefaultConsoles (\r
598 VOID\r
599 );\r
600\r
601/**\r
602 This function updates the console variable based on ConVarName. It can\r
603 add or remove one specific console device path from the variable\r
604\r
605 @param ConsoleType ConIn, ConOut, ErrOut, ConInDev, ConOutDev or ErrOutDev.\r
606 @param CustomizedConDevicePath The console device path to be added to\r
607 the console variable. Cannot be multi-instance.\r
608 @param ExclusiveDevicePath The console device path to be removed\r
609 from the console variable. Cannot be multi-instance.\r
610\r
611 @retval EFI_UNSUPPORTED The added device path is the same as a removed one.\r
612 @retval EFI_SUCCESS Successfully added or removed the device path from the\r
613 console variable.\r
614\r
615**/\r
616EFI_STATUS\r
617EFIAPI\r
618EfiBootManagerUpdateConsoleVariable (\r
619 IN CONSOLE_TYPE ConsoleType,\r
620 IN EFI_DEVICE_PATH_PROTOCOL *CustomizedConDevicePath,\r
621 IN EFI_DEVICE_PATH_PROTOCOL *ExclusiveDevicePath\r
622 );\r
623\r
624/**\r
625 Connect the console device base on the variable ConVarName, if\r
626 device path of the ConVarName is multi-instance device path, if\r
627 anyone of the instances is connected success, then this function\r
628 will return success.\r
629\r
630 @param ConsoleType ConIn, ConOut or ErrOut.\r
631\r
632 @retval EFI_NOT_FOUND There is not any console devices connected\r
633 success\r
634 @retval EFI_SUCCESS Success connect any one instance of the console\r
635 device path base on the variable ConVarName.\r
636\r
637**/\r
638EFI_STATUS\r
639EFIAPI\r
640EfiBootManagerConnectConsoleVariable (\r
641 IN CONSOLE_TYPE ConsoleType\r
642 );\r
643\r
644/**\r
645 Query all the children of VideoController and return the device paths of all the \r
646 children that support GraphicsOutput protocol.\r
647\r
648 @param VideoController PCI handle of video controller.\r
649\r
650 @return Device paths of all the children that support GraphicsOutput protocol.\r
651**/\r
652EFI_DEVICE_PATH_PROTOCOL *\r
653EFIAPI\r
654EfiBootManagerGetGopDevicePath (\r
655 IN EFI_HANDLE VideoController\r
656 );\r
657\r
658/**\r
659 Connect the platform active active video controller.\r
660\r
661 @param VideoController PCI handle of video controller.\r
662\r
663 @retval EFI_NOT_FOUND There is no active video controller.\r
664 @retval EFI_SUCCESS The video controller is connected.\r
665**/\r
666EFI_STATUS\r
667EFIAPI\r
668EfiBootManagerConnectVideoController (\r
669 EFI_HANDLE VideoController OPTIONAL\r
670 );\r
671\r
672//\r
673// Boot Manager driver health library functions.\r
674//\r
675\r
676typedef struct {\r
677 EFI_DRIVER_HEALTH_PROTOCOL *DriverHealth;\r
678\r
679 ///\r
680 /// Driver relative handles\r
681 ///\r
682 EFI_HANDLE DriverHealthHandle;\r
683 EFI_HANDLE ControllerHandle;\r
684 EFI_HANDLE ChildHandle;\r
685\r
686 ///\r
687 /// Driver health messages of the specify Driver \r
688 ///\r
689 EFI_DRIVER_HEALTH_HII_MESSAGE *MessageList;\r
690\r
691 ///\r
692 /// HII relative handles\r
693 ///\r
694 EFI_HII_HANDLE HiiHandle;\r
695\r
696 ///\r
697 /// Driver Health status\r
698 ///\r
699 EFI_DRIVER_HEALTH_STATUS HealthStatus;\r
700} EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO;\r
701\r
702/**\r
703 Return all the Driver Health information.\r
704\r
705 When the cumulative health status of all the controllers managed by the\r
706 driver who produces the EFI_DRIVER_HEALTH_PROTOCOL is healthy, only one\r
707 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO entry is created for such\r
708 EFI_DRIVER_HEALTH_PROTOCOL instance.\r
709 Otherwise, every controller creates one EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO\r
710 entry. Additionally every child controller creates one\r
711 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO entry if the driver is a bus driver.\r
712\r
713 @param Count Return the count of the Driver Health information.\r
714\r
715 @retval NULL No Driver Health information is returned.\r
716 @retval !NULL Pointer to the Driver Health information array.\r
717**/\r
718EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *\r
719EFIAPI\r
720EfiBootManagerGetDriverHealthInfo (\r
721 UINTN *Count\r
722 );\r
723\r
724/**\r
725 Free the Driver Health information array.\r
726\r
727 @param DriverHealthInfo Pointer to array of the Driver Health information.\r
728 @param Count Count of the array.\r
729\r
730 @retval EFI_SUCCESS The array is freed.\r
731 @retval EFI_INVALID_PARAMETER The array is NULL.\r
732**/\r
733EFI_STATUS\r
734EFIAPI\r
735EfiBootManagerFreeDriverHealthInfo (\r
736 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *DriverHealthInfo,\r
737 UINTN Count\r
738 );\r
739\r
740/**\r
741 Process (load and execute) the load option.\r
742\r
743 @param LoadOption Pointer to the load option.\r
744\r
745 @retval EFI_INVALID_PARAMETER The load option type is invalid, \r
746 or the load option file path doesn't point to a valid file.\r
747 @retval EFI_UNSUPPORTED The load option type is of LoadOptionTypeBoot.\r
748 @retval EFI_SUCCESS The load option is inactive, or successfully loaded and executed.\r
749**/\r
750EFI_STATUS\r
751EFIAPI\r
752EfiBootManagerProcessLoadOption (\r
753 EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption\r
754 );\r
3dc5c1ae
TP
755\r
756/**\r
757 Check whether the VariableName is a valid load option variable name\r
758 and return the load option type and option number.\r
759\r
760 @param VariableName The name of the load option variable.\r
761 @param OptionType Return the load option type.\r
762 @param OptionNumber Return the load option number.\r
763\r
764 @retval TRUE The variable name is valid; The load option type and\r
765 load option number are returned.\r
766 @retval FALSE The variable name is NOT valid.\r
767**/\r
768BOOLEAN\r
769EFIAPI\r
770EfiBootManagerIsValidLoadOptionVariableName (\r
771 IN CHAR16 *VariableName,\r
772 OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType OPTIONAL,\r
773 OUT UINT16 *OptionNumber OPTIONAL\r
774 );\r
775\r
067ed98a 776#endif\r