]>
Commit | Line | Data |
---|---|---|
3a2dc0f5 | 1 | /** @file\r |
f3b006c8 ED |
2 | The boot manager reference implementation\r |
3 | \r | |
4 | Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials are licensed and made available under\r | |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
7 | The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php.\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
3a2dc0f5 DB |
12 | \r |
13 | **/\r | |
14 | \r | |
15 | #ifndef _EFI_BOOT_MANAGER_H_\r | |
16 | #define _EFI_BOOT_MANAGER_H_\r | |
17 | \r | |
18 | #include <Guid/MdeModuleHii.h>\r | |
19 | #include <Guid/GlobalVariable.h>\r | |
20 | \r | |
21 | #include <Protocol/HiiConfigAccess.h>\r | |
22 | #include <Protocol/DevicePathToText.h>\r | |
23 | \r | |
24 | #include <Library/PrintLib.h>\r | |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/BaseMemoryLib.h>\r | |
27 | #include <Library/UefiBootServicesTableLib.h>\r | |
28 | #include <Library/UefiLib.h>\r | |
29 | #include <Library/MemoryAllocationLib.h>\r | |
30 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
31 | #include <Library/HiiLib.h>\r | |
32 | #include <Library/DevicePathLib.h>\r | |
33 | #include <Library/UefiBootManagerLib.h>\r | |
34 | \r | |
35 | #pragma pack(1)\r | |
36 | \r | |
37 | ///\r | |
38 | /// HII specific Vendor Device Path definition.\r | |
39 | ///\r | |
40 | typedef struct {\r | |
41 | VENDOR_DEVICE_PATH VendorDevicePath;\r | |
42 | EFI_DEVICE_PATH_PROTOCOL End;\r | |
43 | } HII_VENDOR_DEVICE_PATH;\r | |
44 | #pragma pack()\r | |
45 | \r | |
46 | //\r | |
47 | // These are defined as the same with vfr file\r | |
48 | //\r | |
49 | #define BOOT_MANAGER_FORMSET_GUID \\r | |
50 | { \\r | |
51 | 0x847bc3fe, 0xb974, 0x446d, {0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b} \\r | |
52 | }\r | |
53 | \r | |
54 | #define BOOT_MANAGER_FORM_ID 0x1000\r | |
55 | \r | |
56 | #define LABEL_BOOT_OPTION 0x00\r | |
57 | #define LABEL_BOOT_OPTION_END 0x01\r | |
58 | \r | |
59 | //\r | |
60 | // Variable created with this flag will be "Efi:...."\r | |
61 | //\r | |
62 | #define VAR_FLAG EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE\r | |
63 | \r | |
64 | //\r | |
65 | // These are the VFR compiler generated data representing our VFR data.\r | |
66 | //\r | |
67 | extern UINT8 BootManagerVfrBin[];\r | |
68 | \r | |
69 | #define BOOT_MANAGER_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('B', 'M', 'C', 'B')\r | |
70 | \r | |
71 | typedef struct {\r | |
72 | UINTN Signature;\r | |
73 | \r | |
74 | //\r | |
75 | // HII relative handles\r | |
76 | //\r | |
77 | EFI_HII_HANDLE HiiHandle;\r | |
78 | EFI_HANDLE DriverHandle;\r | |
79 | \r | |
80 | //\r | |
81 | // Produced protocols\r | |
82 | //\r | |
83 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
84 | } BOOT_MANAGER_CALLBACK_DATA;\r | |
85 | \r | |
86 | /**\r | |
87 | This call back function is registered with Boot Manager formset.\r | |
88 | When user selects a boot option, this call back function will\r | |
89 | be triggered. The boot option is saved for later processing.\r | |
90 | \r | |
91 | \r | |
92 | @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
93 | @param Action Specifies the type of action taken by the browser.\r | |
94 | @param QuestionId A unique value which is sent to the original exporting driver\r | |
95 | so that it can identify the type of data to expect.\r | |
96 | @param Type The type of value for the question.\r | |
97 | @param Value A pointer to the data being sent to the original exporting driver.\r | |
98 | @param ActionRequest On return, points to the action requested by the callback function.\r | |
99 | \r | |
100 | @retval EFI_SUCCESS The callback successfully handled the action.\r | |
101 | @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.\r | |
102 | \r | |
103 | **/\r | |
104 | EFI_STATUS\r | |
105 | EFIAPI\r | |
106 | BootManagerCallback (\r | |
107 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
108 | IN EFI_BROWSER_ACTION Action,\r | |
109 | IN EFI_QUESTION_ID QuestionId,\r | |
110 | IN UINT8 Type,\r | |
111 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
112 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r | |
113 | );\r | |
114 | \r | |
115 | /**\r | |
116 | This function allows a caller to extract the current configuration for one\r | |
117 | or more named elements from the target driver.\r | |
118 | \r | |
119 | \r | |
120 | @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
121 | @param Request - A null-terminated Unicode string in <ConfigRequest> format.\r | |
122 | @param Progress - On return, points to a character in the Request string.\r | |
123 | Points to the string's null terminator if request was successful.\r | |
124 | Points to the most recent '&' before the first failing name/value\r | |
125 | pair (or the beginning of the string if the failure is in the\r | |
126 | first name/value pair) if the request was not successful.\r | |
127 | @param Results - A null-terminated Unicode string in <ConfigAltResp> format which\r | |
128 | has all values filled in for the names in the Request string.\r | |
129 | String to be allocated by the called function.\r | |
130 | \r | |
131 | @retval EFI_SUCCESS The Results is filled with the requested values.\r | |
132 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r | |
133 | @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.\r | |
134 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r | |
135 | \r | |
136 | **/\r | |
137 | EFI_STATUS\r | |
138 | EFIAPI\r | |
139 | BootManagerExtractConfig (\r | |
140 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
141 | IN CONST EFI_STRING Request,\r | |
142 | OUT EFI_STRING *Progress,\r | |
143 | OUT EFI_STRING *Results\r | |
144 | );\r | |
145 | \r | |
146 | /**\r | |
147 | This function processes the results of changes in configuration.\r | |
148 | \r | |
149 | \r | |
150 | @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
151 | @param Configuration - A null-terminated Unicode string in <ConfigResp> format.\r | |
152 | @param Progress - A pointer to a string filled in with the offset of the most\r | |
153 | recent '&' before the first failing name/value pair (or the\r | |
154 | beginning of the string if the failure is in the first\r | |
155 | name/value pair) or the terminating NULL if all was successful.\r | |
156 | \r | |
157 | @retval EFI_SUCCESS The Results is processed successfully.\r | |
158 | @retval EFI_INVALID_PARAMETER Configuration is NULL.\r | |
159 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r | |
160 | \r | |
161 | **/\r | |
162 | EFI_STATUS\r | |
163 | EFIAPI\r | |
164 | BootManagerRouteConfig (\r | |
165 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
166 | IN CONST EFI_STRING Configuration,\r | |
167 | OUT EFI_STRING *Progress\r | |
168 | );\r | |
169 | \r | |
170 | #endif\r |