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