1 /** @file
2   The platform boot manager reference implement
3 
4 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6 
7 **/
8 
9 #ifndef _EFI_BOOT_MANAGER_H_
10 #define _EFI_BOOT_MANAGER_H_
11 
12 #include "Bds.h"
13 #include "FrontPage.h"
14 
15 #define BOOT_MANAGER_FORM_ID     0x1000
16 
17 #define LABEL_BOOT_OPTION        0x00
18 #define LABEL_BOOT_OPTION_END    0x01
19 
20 //
21 // These are the VFR compiler generated data representing our VFR data.
22 //
23 extern UINT8 BootManagerVfrBin[];
24 
25 #define BOOT_MANAGER_CALLBACK_DATA_SIGNATURE  SIGNATURE_32 ('B', 'M', 'C', 'B')
26 
27 typedef struct {
28   UINTN                           Signature;
29 
30   //
31   // HII relative handles
32   //
33   EFI_HII_HANDLE                  HiiHandle;
34   EFI_HANDLE                      DriverHandle;
35 
36   //
37   // Produced protocols
38   //
39   EFI_HII_CONFIG_ACCESS_PROTOCOL   ConfigAccess;
40 } BOOT_MANAGER_CALLBACK_DATA;
41 
42 /**
43   This call back function is registered with Boot Manager formset.
44   When user selects a boot option, this call back function will
45   be triggered. The boot option is saved for later processing.
46 
47 
48   @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
49   @param Action          Specifies the type of action taken by the browser.
50   @param QuestionId      A unique value which is sent to the original exporting driver
51                          so that it can identify the type of data to expect.
52   @param Type            The type of value for the question.
53   @param Value           A pointer to the data being sent to the original exporting driver.
54   @param ActionRequest   On return, points to the action requested by the callback function.
55 
56   @retval  EFI_SUCCESS           The callback successfully handled the action.
57   @retval  EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
58 
59 **/
60 EFI_STATUS
61 EFIAPI
62 BootManagerCallback (
63   IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
64   IN  EFI_BROWSER_ACTION                     Action,
65   IN  EFI_QUESTION_ID                        QuestionId,
66   IN  UINT8                                  Type,
67   IN  EFI_IFR_TYPE_VALUE                     *Value,
68   OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest
69   );
70 
71 /**
72 
73   Registers HII packages for the Boot Manger to HII Database.
74   It also registers the browser call back function.
75 
76   @retval  EFI_SUCCESS           HII packages for the Boot Manager were registered successfully.
77   @retval  EFI_OUT_OF_RESOURCES  HII packages for the Boot Manager failed to be registered.
78 
79 **/
80 EFI_STATUS
81 InitializeBootManager (
82   VOID
83   );
84 
85 /**
86   This function invokes Boot Manager. If all devices have not a chance to be connected,
87   the connect all will be triggered. It then enumerate all boot options. If
88   a boot option from the Boot Manager page is selected, Boot Manager will boot
89   from this boot option.
90 
91 **/
92 VOID
93 CallBootManager (
94   VOID
95   );
96 
97 #endif
98