]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - ArmPkg/Include/Library/BdsLib.h
ArmPkg: Fixed GetEnvironmentVariable() when the UEFI Variable did not exist
[mirror_edk2.git] / ArmPkg / Include / Library / BdsLib.h
... / ...
CommitLineData
1/** @file\r
2*\r
3* Copyright (c) 2013, ARM Limited. All rights reserved.\r
4*\r
5* This program and the accompanying materials\r
6* are licensed and made available under the terms and conditions of the BSD License\r
7* which accompanies this distribution. 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
12*\r
13**/\r
14\r
15#ifndef __BDS_ENTRY_H__\r
16#define __BDS_ENTRY_H__\r
17\r
18typedef UINT8* EFI_LOAD_OPTION;\r
19\r
20/**\r
21 This is defined by the UEFI specs, don't change it\r
22**/\r
23typedef struct {\r
24 UINT16 LoadOptionIndex;\r
25 EFI_LOAD_OPTION LoadOption;\r
26 UINTN LoadOptionSize;\r
27\r
28 UINT32 Attributes;\r
29 UINT16 FilePathListLength;\r
30 CHAR16 *Description;\r
31 EFI_DEVICE_PATH_PROTOCOL *FilePathList;\r
32\r
33 VOID* OptionalData;\r
34 UINTN OptionalDataSize;\r
35} BDS_LOAD_OPTION;\r
36\r
37/**\r
38 Connect a Device Path and return the handle of the driver that support this DevicePath\r
39\r
40 @param DevicePath Device Path of the File to connect\r
41 @param Handle Handle of the driver that support this DevicePath\r
42 @param RemainingDevicePath Remaining DevicePath nodes that do not match the driver DevicePath\r
43\r
44 @retval EFI_SUCCESS A driver that matches the Device Path has been found\r
45 @retval EFI_NOT_FOUND No handles match the search.\r
46 @retval EFI_INVALID_PARAMETER DevicePath or Handle is NULL\r
47\r
48**/\r
49EFI_STATUS\r
50BdsConnectDevicePath (\r
51 IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,\r
52 OUT EFI_HANDLE *Handle,\r
53 OUT EFI_DEVICE_PATH_PROTOCOL **RemainingDevicePath\r
54 );\r
55\r
56/**\r
57 Connect all DXE drivers\r
58\r
59 @retval EFI_SUCCESS All drivers have been connected\r
60 @retval EFI_NOT_FOUND No handles match the search.\r
61 @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results.\r
62\r
63**/\r
64EFI_STATUS\r
65BdsConnectAllDrivers (\r
66 VOID\r
67 );\r
68\r
69/**\r
70 Return the value of a global variable defined by its VariableName.\r
71 The variable must be defined with the VendorGuid gEfiGlobalVariableGuid.\r
72\r
73 @param VariableName A Null-terminated string that is the name of the vendor's\r
74 variable.\r
75 @param DefaultValue Value returned by the function if the variable does not exist\r
76 @param DataSize On input, the size in bytes of the return Data buffer.\r
77 On output the size of data returned in Data.\r
78 @param Value Value read from the UEFI Variable or copy of the default value\r
79 if the UEFI Variable does not exist\r
80\r
81 @retval EFI_SUCCESS All drivers have been connected\r
82 @retval EFI_NOT_FOUND No handles match the search.\r
83 @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results.\r
84\r
85**/\r
86EFI_STATUS\r
87GetGlobalEnvironmentVariable (\r
88 IN CONST CHAR16* VariableName,\r
89 IN VOID* DefaultValue,\r
90 IN OUT UINTN* Size,\r
91 OUT VOID** Value\r
92 );\r
93\r
94/**\r
95 Return the value of the variable defined by its VariableName and VendorGuid\r
96\r
97 @param VariableName A Null-terminated string that is the name of the vendor's\r
98 variable.\r
99 @param VendorGuid A unique identifier for the vendor.\r
100 @param DefaultValue Value returned by the function if the variable does not exist\r
101 @param DataSize On input, the size in bytes of the return Data buffer.\r
102 On output the size of data returned in Data.\r
103 @param Value Value read from the UEFI Variable or copy of the default value\r
104 if the UEFI Variable does not exist\r
105\r
106 @retval EFI_SUCCESS All drivers have been connected\r
107 @retval EFI_NOT_FOUND No handles match the search.\r
108 @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results.\r
109\r
110**/\r
111EFI_STATUS\r
112GetEnvironmentVariable (\r
113 IN CONST CHAR16* VariableName,\r
114 IN EFI_GUID* VendorGuid,\r
115 IN VOID* DefaultValue,\r
116 IN OUT UINTN* Size,\r
117 OUT VOID** Value\r
118 );\r
119\r
120EFI_STATUS\r
121BootOptionFromLoadOptionIndex (\r
122 IN UINT16 LoadOptionIndex,\r
123 OUT BDS_LOAD_OPTION** BdsLoadOption\r
124 );\r
125\r
126EFI_STATUS\r
127BootOptionFromLoadOptionVariable (\r
128 IN CHAR16* BootVariableName,\r
129 OUT BDS_LOAD_OPTION** BdsLoadOption\r
130 );\r
131\r
132EFI_STATUS\r
133BootOptionToLoadOptionVariable (\r
134 IN BDS_LOAD_OPTION* BdsLoadOption\r
135 );\r
136\r
137UINT16\r
138BootOptionAllocateBootIndex (\r
139 VOID\r
140 );\r
141\r
142/**\r
143 Start a Linux kernel from a Device Path\r
144\r
145 @param LinuxKernel Device Path to the Linux Kernel\r
146 @param Parameters Linux kernel arguments\r
147\r
148 @retval EFI_SUCCESS All drivers have been connected\r
149 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found\r
150 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.\r
151\r
152**/\r
153EFI_STATUS\r
154BdsBootLinuxAtag (\r
155 IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,\r
156 IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,\r
157 IN CONST CHAR8* Arguments\r
158 );\r
159\r
160/**\r
161 Start a Linux kernel from a Device Path\r
162\r
163 @param LinuxKernel Device Path to the Linux Kernel\r
164 @param Parameters Linux kernel arguments\r
165 @param Fdt Device Path to the Flat Device Tree\r
166\r
167 @retval EFI_SUCCESS All drivers have been connected\r
168 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found\r
169 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.\r
170\r
171**/\r
172EFI_STATUS\r
173BdsBootLinuxFdt (\r
174 IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,\r
175 IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,\r
176 IN CONST CHAR8* Arguments,\r
177 IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath\r
178 );\r
179\r
180/**\r
181 Start an EFI Application from a Device Path\r
182\r
183 @param ParentImageHandle Handle of the calling image\r
184 @param DevicePath Location of the EFI Application\r
185\r
186 @retval EFI_SUCCESS All drivers have been connected\r
187 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found\r
188 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.\r
189\r
190**/\r
191EFI_STATUS\r
192BdsStartEfiApplication (\r
193 IN EFI_HANDLE ParentImageHandle,\r
194 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
195 IN UINTN LoadOptionsSize,\r
196 IN VOID* LoadOptions\r
197 );\r
198\r
199/**\r
200 Start an EFI Application from any Firmware Volume\r
201\r
202 @param EfiApp EFI Application Name\r
203\r
204 @retval EFI_SUCCESS All drivers have been connected\r
205 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found\r
206 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.\r
207\r
208**/\r
209EFI_STATUS\r
210BdsLoadApplication (\r
211 IN EFI_HANDLE ParentImageHandle,\r
212 IN CHAR16* EfiApp,\r
213 IN UINTN LoadOptionsSize,\r
214 IN VOID* LoadOptions\r
215 );\r
216\r
217EFI_STATUS\r
218BdsLoadImage (\r
219 IN EFI_DEVICE_PATH *DevicePath,\r
220 IN EFI_ALLOCATE_TYPE Type,\r
221 IN OUT EFI_PHYSICAL_ADDRESS* Image,\r
222 OUT UINTN *FileSize\r
223 );\r
224\r
225#endif\r