]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h
Add BootlogoOnly feature in BDS for BGRT
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / FrontPage.h
CommitLineData
5c08e117 1/** @file\r
2 FrontPage routines to handle the callbacks and browser calls\r
3\r
2df686c6 4Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
180a5a35 5This program and the accompanying materials\r
5c08e117 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _FRONT_PAGE_H_\r
16#define _FRONT_PAGE_H_\r
17\r
18#include "DeviceMngr/DeviceManager.h"\r
19#include "BootMaint/BootMaint.h"\r
20#include "BootMngr/BootManager.h"\r
21#include "String.h"\r
22\r
9f6531d1 23\r
24//\r
25// These are the VFR compiler generated data representing our VFR data.\r
26//\r
27extern UINT8 FrontPageVfrBin[];\r
28\r
9f6531d1 29extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;\r
9f6531d1 30\r
31extern UINTN gCallbackKey;\r
32extern BOOLEAN gConnectAllHappened;\r
33\r
2df686c6 34//\r
35// Boot video resolution and text mode.\r
36//\r
37extern UINT32 mBootHorizontalResolution;\r
38extern UINT32 mBootVerticalResolution;\r
39extern UINT32 mBootTextModeColumn;\r
40extern UINT32 mBootTextModeRow;\r
41//\r
42// BIOS setup video resolution and text mode.\r
43//\r
44extern UINT32 mSetupTextModeColumn;\r
45extern UINT32 mSetupTextModeRow;\r
46extern UINT32 mSetupHorizontalResolution;\r
47extern UINT32 mSetupVerticalResolution;\r
48\r
9f6531d1 49\r
5c08e117 50#define ONE_SECOND 10000000\r
51\r
da96258f 52///\r
53/// The size of a 3 character ISO639 language code.\r
54///\r
55#define ISO_639_2_ENTRY_SIZE 3\r
56\r
5c08e117 57//\r
58// This is the VFR compiler generated header file which defines the\r
59// string identifiers.\r
60//\r
61#define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001\r
62\r
63//\r
64// These are defined as the same with vfr file\r
65//\r
66#define FRONT_PAGE_FORM_ID 0x1000\r
67\r
68#define FRONT_PAGE_KEY_CONTINUE 0x1000\r
69#define FRONT_PAGE_KEY_LANGUAGE 0x1234\r
70#define FRONT_PAGE_KEY_BOOT_MANAGER 0x1064\r
71#define FRONT_PAGE_KEY_DEVICE_MANAGER 0x8567\r
72#define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876\r
73\r
74#define LABEL_SELECT_LANGUAGE 0x1000\r
75bf9d0e 75#define LABEL_END 0xffff\r
5c08e117 76\r
5c08e117 77#define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')\r
78\r
79typedef struct {\r
80 UINTN Signature;\r
81\r
82 //\r
83 // HII relative handles\r
84 //\r
85 EFI_HII_HANDLE HiiHandle;\r
86 EFI_HANDLE DriverHandle;\r
87 EFI_STRING_ID *LanguageToken;\r
88\r
89 //\r
90 // Produced protocols\r
91 //\r
92 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
93} FRONT_PAGE_CALLBACK_DATA;\r
94\r
95#define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \\r
96 CR (a, \\r
97 FRONT_PAGE_CALLBACK_DATA, \\r
98 ConfigAccess, \\r
99 FRONT_PAGE_CALLBACK_DATA_SIGNATURE \\r
100 )\r
101\r
5c08e117 102/**\r
103 This function allows a caller to extract the current configuration for one\r
104 or more named elements from the target driver.\r
105\r
106\r
107 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
108 @param Request - A null-terminated Unicode string in <ConfigRequest> format.\r
109 @param Progress - On return, points to a character in the Request string.\r
110 Points to the string's null terminator if request was successful.\r
111 Points to the most recent '&' before the first failing name/value\r
112 pair (or the beginning of the string if the failure is in the\r
113 first name/value pair) if the request was not successful.\r
114 @param Results - A null-terminated Unicode string in <ConfigAltResp> format which\r
115 has all values filled in for the names in the Request string.\r
116 String to be allocated by the called function.\r
117\r
118 @retval EFI_SUCCESS The Results is filled with the requested values.\r
119 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
120 @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.\r
121 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
122\r
123**/\r
124EFI_STATUS\r
125EFIAPI\r
126FakeExtractConfig (\r
127 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
128 IN CONST EFI_STRING Request,\r
129 OUT EFI_STRING *Progress,\r
130 OUT EFI_STRING *Results\r
131 );\r
132\r
133/**\r
134 This function processes the results of changes in configuration.\r
135\r
136\r
137 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
138 @param Configuration - A null-terminated Unicode string in <ConfigResp> format.\r
139 @param Progress - A pointer to a string filled in with the offset of the most\r
140 recent '&' before the first failing name/value pair (or the\r
141 beginning of the string if the failure is in the first\r
142 name/value pair) or the terminating NULL if all was successful.\r
143\r
144 @retval EFI_SUCCESS The Results is processed successfully.\r
145 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
146 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
147\r
148**/\r
149EFI_STATUS\r
150EFIAPI\r
151FakeRouteConfig (\r
152 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
153 IN CONST EFI_STRING Configuration,\r
154 OUT EFI_STRING *Progress\r
155 );\r
156\r
157/**\r
158 This function processes the results of changes in configuration.\r
159\r
160\r
161 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
162 @param Action - Specifies the type of action taken by the browser.\r
163 @param QuestionId - A unique value which is sent to the original exporting driver\r
164 so that it can identify the type of data to expect.\r
165 @param Type - The type of value for the question.\r
166 @param Value - A pointer to the data being sent to the original exporting driver.\r
167 @param ActionRequest - On return, points to the action requested by the callback function.\r
168\r
169 @retval EFI_SUCCESS The callback successfully handled the action.\r
170 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
171 @retval EFI_DEVICE_ERROR The variable could not be saved.\r
172 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.\r
173\r
174**/\r
175EFI_STATUS\r
176EFIAPI\r
177FrontPageCallback (\r
178 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
179 IN EFI_BROWSER_ACTION Action,\r
180 IN EFI_QUESTION_ID QuestionId,\r
181 IN UINT8 Type,\r
182 IN EFI_IFR_TYPE_VALUE *Value,\r
183 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
184 );\r
185\r
186/**\r
187 Initialize HII information for the FrontPage\r
188\r
189\r
190 @param InitializeHiiData TRUE if HII elements need to be initialized.\r
191\r
192 @retval EFI_SUCCESS The operation is successful.\r
193 @retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.\r
194\r
195**/\r
196EFI_STATUS\r
197InitializeFrontPage (\r
198 IN BOOLEAN InitializeHiiData\r
199 );\r
200\r
201/**\r
202 Acquire the string associated with the ProducerGuid and return it.\r
203\r
204\r
205 @param ProducerGuid - The Guid to search the HII database for\r
206 @param Token - The token value of the string to extract\r
207 @param String - The string that is extracted\r
208\r
209 @retval EFI_SUCCESS The function returns EFI_SUCCESS always.\r
210\r
211**/\r
212EFI_STATUS\r
213GetProducerString (\r
214 IN EFI_GUID *ProducerGuid,\r
215 IN EFI_STRING_ID Token,\r
216 OUT CHAR16 **String\r
217 );\r
218\r
219/**\r
220 Compare two EFI_TIME data.\r
221\r
222\r
223 @param FirstTime - A pointer to the first EFI_TIME data.\r
224 @param SecondTime - A pointer to the second EFI_TIME data.\r
225\r
226 @retval TRUE The FirstTime is not later than the SecondTime.\r
227 @retval FALSE The FirstTime is later than the SecondTime.\r
228\r
229**/\r
230BOOLEAN\r
231TimeCompare (\r
232 IN EFI_TIME *FirstTime,\r
233 IN EFI_TIME *SecondTime\r
234 );\r
235\r
236/**\r
237 This function is the main entry of the platform setup entry.\r
238 The function will present the main menu of the system setup,\r
239 this is the platform reference part and can be customize.\r
240\r
241\r
242 @param TimeoutDefault - The fault time out value before the system\r
243 continue to boot.\r
244 @param ConnectAllHappened - The indicater to check if the connect all have\r
baf46e70 245 already happened.\r
5c08e117 246\r
247**/\r
248VOID\r
249PlatformBdsEnterFrontPage (\r
250 IN UINT16 TimeoutDefault,\r
251 IN BOOLEAN ConnectAllHappened\r
252 );\r
253\r
72861c22 254/**\r
2df686c6 255 This function will change video resolution and text mode\r
256 according to defined setup mode or defined boot mode \r
72861c22 257\r
2df686c6 258 @param IsSetupMode Indicate mode is changed to setup mode or boot mode. \r
72861c22 259\r
260 @retval EFI_SUCCESS Mode is changed successfully.\r
2df686c6 261 @retval Others Mode failed to be changed.\r
72861c22 262\r
263**/\r
2df686c6 264\r
72861c22 265EFI_STATUS\r
266EFIAPI\r
2df686c6 267BdsSetConsoleMode (\r
268 BOOLEAN IsSetupMode\r
72861c22 269 );\r
270\r
5c08e117 271#endif // _FRONT_PAGE_H_\r
272\r