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