]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.h
MdePkg/Base: introduce MAX_ALLOC_ADDRESS
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / LegacyBootMaintUiLib / LegacyBootMaintUi.h
CommitLineData
5a673ab2
ED
1/** @file\r
2 Legacy boot maintainence Ui definition.\r
3\r
67b55c92 4Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
5a673ab2
ED
5This program and the accompanying materials\r
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\r
16#ifndef _EFI_LEGACY_BOOT_OPTION_H_\r
17#define _EFI_LEGACY_BOOT_OPTION_H_\r
18\r
19#include <PiDxe.h>\r
20\r
21\r
22#include <Guid/GlobalVariable.h>\r
23#include <Guid/LegacyDevOrder.h>\r
24#include <Guid/MdeModuleHii.h>\r
25\r
26#include <Protocol/HiiConfigAccess.h>\r
27#include <Protocol/HiiConfigRouting.h>\r
28\r
29#include <Protocol/HiiDatabase.h>\r
30#include <Protocol/LegacyBios.h>\r
31\r
32#include <Library/UefiDriverEntryPoint.h>\r
33#include <Library/UefiBootServicesTableLib.h>\r
34#include <Library/UefiRuntimeServicesTableLib.h>\r
35#include <Library/BaseLib.h>\r
36#include <Library/DevicePathLib.h>\r
37#include <Library/DebugLib.h>\r
38#include <Library/HiiLib.h>\r
39#include <Library/UefiBootManagerLib.h>\r
40#include <Library/MemoryAllocationLib.h>\r
41#include <Library/UefiLib.h>\r
42#include <Library/PrintLib.h>\r
43#include <Library/BaseMemoryLib.h>\r
44\r
45#include "LegacyBootMaintUiVfr.h"\r
46\r
47#define CONFIG_OPTION_OFFSET 0x1200\r
48\r
49//\r
50// VarOffset that will be used to create question\r
51// all these values are computed from the structure\r
52// defined below\r
53//\r
54#define VAR_OFFSET(Field) ((UINT16) ((UINTN) &(((LEGACY_BOOT_NV_DATA *) 0)->Field)))\r
55\r
56//\r
57// Question Id of Zero is invalid, so add an offset to it\r
58//\r
59#define QUESTION_ID(Field) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET)\r
60\r
61\r
62#define LEGACY_FD_QUESTION_ID QUESTION_ID (LegacyFD)\r
63#define LEGACY_HD_QUESTION_ID QUESTION_ID (LegacyHD)\r
64#define LEGACY_CD_QUESTION_ID QUESTION_ID (LegacyCD)\r
65#define LEGACY_NET_QUESTION_ID QUESTION_ID (LegacyNET)\r
66#define LEGACY_BEV_QUESTION_ID QUESTION_ID (LegacyBEV)\r
67\r
68\r
69//\r
70// String Contant\r
71//\r
72#define STR_FLOPPY L"Floppy Drive #%02x"\r
73#define STR_HARDDISK L"HardDisk Drive #%02x"\r
74#define STR_CDROM L"ATAPI CDROM Drive #%02x"\r
75#define STR_NET L"NET Drive #%02x"\r
76#define STR_BEV L"BEV Drive #%02x"\r
77\r
78#define STR_FLOPPY_HELP L"Select Floppy Drive #%02x"\r
79#define STR_HARDDISK_HELP L"Select HardDisk Drive #%02x"\r
80#define STR_CDROM_HELP L"Select ATAPI CDROM Drive #%02x"\r
81#define STR_NET_HELP L"NET Drive #%02x"\r
82#define STR_BEV_HELP L"BEV Drive #%02x"\r
83\r
84#define STR_FLOPPY_TITLE L"Set Legacy Floppy Drive Order"\r
85#define STR_HARDDISK_TITLE L"Set Legacy HardDisk Drive Order"\r
86#define STR_CDROM_TITLE L"Set Legacy CDROM Drive Order"\r
87#define STR_NET_TITLE L"Set Legacy NET Drive Order"\r
88#define STR_BEV_TITLE L"Set Legacy BEV Drive Order"\r
89\r
90//\r
91// These are the VFR compiler generated data representing our VFR data.\r
92//\r
93extern UINT8 LegacyBootMaintUiVfrBin[];\r
94\r
95#pragma pack(1)\r
96\r
97///\r
98/// HII specific Vendor Device Path definition.\r
99///\r
100typedef struct {\r
101 VENDOR_DEVICE_PATH VendorDevicePath;\r
102 EFI_DEVICE_PATH_PROTOCOL End;\r
103} HII_VENDOR_DEVICE_PATH;\r
104\r
105\r
106\r
107//\r
108// Variable created with this flag will be "Efi:...."\r
109//\r
110#define VAR_FLAG EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE\r
111\r
112\r
113#define LEGACY_BOOT_OPTION_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('L', 'G', 'C', 'B')\r
114\r
115typedef struct {\r
116 UINTN Signature;\r
117\r
118 //\r
119 // HII relative handles\r
120 //\r
121 EFI_HII_HANDLE HiiHandle;\r
122 EFI_HANDLE DriverHandle;\r
123\r
124 //\r
125 // Produced protocols\r
126 //\r
127 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
128\r
129 //\r
130 // Maintain the data.\r
131 //\r
132 LEGACY_BOOT_MAINTAIN_DATA *MaintainMapData;\r
133} LEGACY_BOOT_OPTION_CALLBACK_DATA;\r
134\r
135//\r
136// All of the signatures that will be used in list structure\r
137//\r
138#define LEGACY_MENU_OPTION_SIGNATURE SIGNATURE_32 ('m', 'e', 'n', 'u')\r
139#define LEGACY_MENU_ENTRY_SIGNATURE SIGNATURE_32 ('e', 'n', 't', 'r')\r
140\r
141#define LEGACY_LEGACY_DEV_CONTEXT_SELECT 0x9\r
142\r
143typedef struct {\r
144 UINTN Signature;\r
145 LIST_ENTRY Head;\r
146 UINTN MenuNumber;\r
147} LEGACY_MENU_OPTION;\r
148\r
149typedef struct {\r
150 UINT16 BbsIndex;\r
151 CHAR16 *Description;\r
152} LEGACY_DEVICE_CONTEXT;\r
153\r
154typedef struct {\r
155 UINTN Signature;\r
156 LIST_ENTRY Link;\r
157 UINTN OptionNumber;\r
158 UINT16 *DisplayString;\r
159 UINT16 *HelpString;\r
160 EFI_STRING_ID DisplayStringToken;\r
161 EFI_STRING_ID HelpStringToken;\r
162 VOID *VariableContext;\r
163} LEGACY_MENU_ENTRY;\r
164\r
165typedef struct {\r
166 UINT16 BbsIndex;\r
167} LEGACY_BOOT_OPTION_BBS_DATA;\r
168\r
169#pragma pack()\r
170\r
171/**\r
172 This call back function is registered with Boot Manager formset.\r
173 When user selects a boot option, this call back function will\r
174 be triggered. The boot option is saved for later processing.\r
175\r
176\r
177 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
178 @param Action Specifies the type of action taken by the browser.\r
179 @param QuestionId A unique value which is sent to the original exporting driver\r
180 so that it can identify the type of data to expect.\r
181 @param Type The type of value for the question.\r
182 @param Value A pointer to the data being sent to the original exporting driver.\r
183 @param ActionRequest On return, points to the action requested by the callback function.\r
184\r
185 @retval EFI_SUCCESS The callback successfully handled the action.\r
186 @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.\r
187\r
188**/\r
189EFI_STATUS\r
190EFIAPI\r
191LegacyBootOptionCallback (\r
192 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
193 IN EFI_BROWSER_ACTION Action,\r
194 IN EFI_QUESTION_ID QuestionId,\r
195 IN UINT8 Type,\r
196 IN EFI_IFR_TYPE_VALUE *Value,\r
197 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
198 );\r
199\r
200/**\r
201 This function allows a caller to extract the current configuration for one\r
202 or more named elements from the target driver.\r
203\r
204\r
205 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
206 @param Request - A null-terminated Unicode string in <ConfigRequest> format.\r
207 @param Progress - On return, points to a character in the Request string.\r
208 Points to the string's null terminator if request was successful.\r
209 Points to the most recent '&' before the first failing name/value\r
210 pair (or the beginning of the string if the failure is in the\r
211 first name/value pair) if the request was not successful.\r
212 @param Results - A null-terminated Unicode string in <ConfigAltResp> format which\r
213 has all values filled in for the names in the Request string.\r
214 String to be allocated by the called function.\r
215\r
216 @retval EFI_SUCCESS The Results is filled with the requested values.\r
217 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
218 @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.\r
219 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
220\r
221**/\r
222EFI_STATUS\r
223EFIAPI\r
224LegacyBootOptionExtractConfig (\r
225 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
226 IN CONST EFI_STRING Request,\r
227 OUT EFI_STRING *Progress,\r
228 OUT EFI_STRING *Results\r
229 );\r
230\r
231/**\r
232 This function processes the results of changes in configuration.\r
233\r
234\r
235 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
236 @param Configuration - A null-terminated Unicode string in <ConfigResp> format.\r
237 @param Progress - A pointer to a string filled in with the offset of the most\r
238 recent '&' before the first failing name/value pair (or the\r
239 beginning of the string if the failure is in the first\r
240 name/value pair) or the terminating NULL if all was successful.\r
241\r
242 @retval EFI_SUCCESS The Results is processed successfully.\r
243 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
244 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
245\r
246**/\r
247EFI_STATUS\r
248EFIAPI\r
249LegacyBootOptionRouteConfig (\r
250 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
251 IN CONST EFI_STRING Configuration,\r
252 OUT EFI_STRING *Progress\r
253 );\r
254\r
255#endif\r