3 * Copyright (c) 2013-2015, ARM Limited. All rights reserved.
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __BDS_ENTRY_H__
16 #define __BDS_ENTRY_H__
19 This is defined by the UEFI specs, don't change it
22 UINT16 LoadOptionIndex
;
23 EFI_LOAD_OPTION
*LoadOption
;
27 UINT16 FilePathListLength
;
29 EFI_DEVICE_PATH_PROTOCOL
*FilePathList
;
32 UINTN OptionalDataSize
;
36 Connect a Device Path and return the handle of the driver that support this DevicePath
38 @param DevicePath Device Path of the File to connect
39 @param Handle Handle of the driver that support this DevicePath
40 @param RemainingDevicePath Remaining DevicePath nodes that do not match the driver DevicePath
42 @retval EFI_SUCCESS A driver that matches the Device Path has been found
43 @retval EFI_NOT_FOUND No handles match the search.
44 @retval EFI_INVALID_PARAMETER DevicePath or Handle is NULL
48 BdsConnectDevicePath (
49 IN EFI_DEVICE_PATH_PROTOCOL
* DevicePath
,
50 OUT EFI_HANDLE
*Handle
,
51 OUT EFI_DEVICE_PATH_PROTOCOL
**RemainingDevicePath
55 Connect all DXE drivers
57 @retval EFI_SUCCESS All drivers have been connected
58 @retval EFI_NOT_FOUND No handles match the search.
59 @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results.
63 BdsConnectAllDrivers (
68 Return the value of a global variable defined by its VariableName.
69 The variable must be defined with the VendorGuid gEfiGlobalVariableGuid.
71 @param VariableName A Null-terminated string that is the name of the vendor's
73 @param DefaultValue Value returned by the function if the variable does not exist
74 @param DataSize On input, the size in bytes of the return Data buffer.
75 On output the size of data returned in Data.
76 @param Value Value read from the UEFI Variable or copy of the default value
77 if the UEFI Variable does not exist
79 @retval EFI_SUCCESS All drivers have been connected
80 @retval EFI_NOT_FOUND No handles match the search.
81 @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results.
85 GetGlobalEnvironmentVariable (
86 IN CONST CHAR16
* VariableName
,
87 IN VOID
* DefaultValue
,
93 Return the value of the variable defined by its VariableName and VendorGuid
95 @param VariableName A Null-terminated string that is the name of the vendor's
97 @param VendorGuid A unique identifier for the vendor.
98 @param DefaultValue Value returned by the function if the variable does not exist
99 @param DataSize On input, the size in bytes of the return Data buffer.
100 On output the size of data returned in Data.
101 @param Value Value read from the UEFI Variable or copy of the default value
102 if the UEFI Variable does not exist
104 @retval EFI_SUCCESS All drivers have been connected
105 @retval EFI_NOT_FOUND No handles match the search.
106 @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results.
110 GetEnvironmentVariable (
111 IN CONST CHAR16
* VariableName
,
112 IN EFI_GUID
* VendorGuid
,
113 IN VOID
* DefaultValue
,
119 BootOptionFromLoadOptionIndex (
120 IN UINT16 LoadOptionIndex
,
121 OUT BDS_LOAD_OPTION
** BdsLoadOption
125 BootOptionFromLoadOptionVariable (
126 IN CHAR16
* BootVariableName
,
127 OUT BDS_LOAD_OPTION
** BdsLoadOption
131 BootOptionToLoadOptionVariable (
132 IN BDS_LOAD_OPTION
* BdsLoadOption
136 BootOptionAllocateBootIndex (
141 Start a Linux kernel from a Device Path
143 @param LinuxKernel Device Path to the Linux Kernel
144 @param Parameters Linux kernel arguments
146 @retval EFI_SUCCESS All drivers have been connected
147 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
148 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
153 IN EFI_DEVICE_PATH_PROTOCOL
* LinuxKernelDevicePath
,
154 IN EFI_DEVICE_PATH_PROTOCOL
* InitrdDevicePath
,
155 IN CONST CHAR8
* Arguments
159 Start a Linux kernel from a Device Path
161 @param[in] LinuxKernelDevicePath Device Path to the Linux Kernel
162 @param[in] InitrdDevicePath Device Path to the Initrd
163 @param[in] Arguments Linux kernel arguments
165 @retval EFI_SUCCESS All drivers have been connected
166 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
167 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
172 IN EFI_DEVICE_PATH_PROTOCOL
* LinuxKernelDevicePath
,
173 IN EFI_DEVICE_PATH_PROTOCOL
* InitrdDevicePath
,
174 IN CONST CHAR8
* Arguments
178 Start an EFI Application from a Device Path
180 @param ParentImageHandle Handle of the calling image
181 @param DevicePath Location of the EFI Application
183 @retval EFI_SUCCESS All drivers have been connected
184 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
185 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
189 BdsStartEfiApplication (
190 IN EFI_HANDLE ParentImageHandle
,
191 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
192 IN UINTN LoadOptionsSize
,
198 IN EFI_DEVICE_PATH
*DevicePath
,
199 IN EFI_ALLOCATE_TYPE Type
,
200 IN OUT EFI_PHYSICAL_ADDRESS
* Image
,
205 * Call BS.ExitBootServices with the appropriate Memory Map information
208 ShutdownUefiBootServices (
213 Locate an EFI application in a the Firmware Volumes by its name
215 @param EfiAppGuid Guid of the EFI Application into the Firmware Volume
216 @param DevicePath EFI Device Path of the EFI application
218 @return EFI_SUCCESS The function completed successfully.
219 @return EFI_NOT_FOUND The protocol could not be located.
220 @return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.
224 LocateEfiApplicationInFvByName (
225 IN CONST CHAR16
* EfiAppName
,
226 OUT EFI_DEVICE_PATH
**DevicePath
230 Locate an EFI application in a the Firmware Volumes by its GUID
232 @param EfiAppGuid Guid of the EFI Application into the Firmware Volume
233 @param DevicePath EFI Device Path of the EFI application
235 @return EFI_SUCCESS The function completed successfully.
236 @return EFI_NOT_FOUND The protocol could not be located.
237 @return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.
241 LocateEfiApplicationInFvByGuid (
242 IN CONST EFI_GUID
*EfiAppGuid
,
243 OUT EFI_DEVICE_PATH
**DevicePath