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