]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Include/Library/BdsLib.h
ArmPkg: Introduce GetGlobalEnvironmentVariable() function.
[mirror_edk2.git] / ArmPkg / Include / Library / BdsLib.h
1 /** @file
2 *
3 * Copyright (c) 2013, ARM Limited. All rights reserved.
4 *
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
9 *
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.
12 *
13 **/
14
15 #ifndef __BDS_ENTRY_H__
16 #define __BDS_ENTRY_H__
17
18 typedef UINT8* EFI_LOAD_OPTION;
19
20 /**
21 This is defined by the UEFI specs, don't change it
22 **/
23 typedef struct {
24 UINT16 LoadOptionIndex;
25 EFI_LOAD_OPTION LoadOption;
26 UINTN LoadOptionSize;
27
28 UINT32 Attributes;
29 UINT16 FilePathListLength;
30 CHAR16 *Description;
31 EFI_DEVICE_PATH_PROTOCOL *FilePathList;
32
33 VOID* OptionalData;
34 UINTN OptionalDataSize;
35 } BDS_LOAD_OPTION;
36
37 /**
38 Connect a Device Path and return the handle of the driver that support this DevicePath
39
40 @param DevicePath Device Path of the File to connect
41 @param Handle Handle of the driver that support this DevicePath
42 @param RemainingDevicePath Remaining DevicePath nodes that do not match the driver DevicePath
43
44 @retval EFI_SUCCESS A driver that matches the Device Path has been found
45 @retval EFI_NOT_FOUND No handles match the search.
46 @retval EFI_INVALID_PARAMETER DevicePath or Handle is NULL
47
48 **/
49 EFI_STATUS
50 BdsConnectDevicePath (
51 IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
52 OUT EFI_HANDLE *Handle,
53 OUT EFI_DEVICE_PATH_PROTOCOL **RemainingDevicePath
54 );
55
56 /**
57 Connect all DXE drivers
58
59 @retval EFI_SUCCESS All drivers have been connected
60 @retval EFI_NOT_FOUND No handles match the search.
61 @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results.
62
63 **/
64 EFI_STATUS
65 BdsConnectAllDrivers (
66 VOID
67 );
68
69 EFI_STATUS
70 GetGlobalEnvironmentVariable (
71 IN CONST CHAR16* VariableName,
72 IN VOID* DefaultValue,
73 IN OUT UINTN* Size,
74 OUT VOID** Value
75 );
76
77 EFI_STATUS
78 GetEnvironmentVariable (
79 IN CONST CHAR16* VariableName,
80 IN EFI_GUID* VendorGuid,
81 IN VOID* DefaultValue,
82 IN OUT UINTN* Size,
83 OUT VOID** Value
84 );
85
86 EFI_STATUS
87 BootOptionFromLoadOptionIndex (
88 IN UINT16 LoadOptionIndex,
89 OUT BDS_LOAD_OPTION** BdsLoadOption
90 );
91
92 EFI_STATUS
93 BootOptionFromLoadOptionVariable (
94 IN CHAR16* BootVariableName,
95 OUT BDS_LOAD_OPTION** BdsLoadOption
96 );
97
98 EFI_STATUS
99 BootOptionToLoadOptionVariable (
100 IN BDS_LOAD_OPTION* BdsLoadOption
101 );
102
103 UINT16
104 BootOptionAllocateBootIndex (
105 VOID
106 );
107
108 /**
109 Start a Linux kernel from a Device Path
110
111 @param LinuxKernel Device Path to the Linux Kernel
112 @param Parameters Linux kernel arguments
113
114 @retval EFI_SUCCESS All drivers have been connected
115 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
116 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
117
118 **/
119 EFI_STATUS
120 BdsBootLinuxAtag (
121 IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,
122 IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,
123 IN CONST CHAR8* Arguments
124 );
125
126 /**
127 Start a Linux kernel from a Device Path
128
129 @param LinuxKernel Device Path to the Linux Kernel
130 @param Parameters Linux kernel arguments
131 @param Fdt Device Path to the Flat Device Tree
132
133 @retval EFI_SUCCESS All drivers have been connected
134 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
135 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
136
137 **/
138 EFI_STATUS
139 BdsBootLinuxFdt (
140 IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,
141 IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,
142 IN CONST CHAR8* Arguments,
143 IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath
144 );
145
146 /**
147 Start an EFI Application from a Device Path
148
149 @param ParentImageHandle Handle of the calling image
150 @param DevicePath Location of the EFI Application
151
152 @retval EFI_SUCCESS All drivers have been connected
153 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
154 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
155
156 **/
157 EFI_STATUS
158 BdsStartEfiApplication (
159 IN EFI_HANDLE ParentImageHandle,
160 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
161 IN UINTN LoadOptionsSize,
162 IN VOID* LoadOptions
163 );
164
165 /**
166 Start an EFI Application from any Firmware Volume
167
168 @param EfiApp EFI Application Name
169
170 @retval EFI_SUCCESS All drivers have been connected
171 @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
172 @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
173
174 **/
175 EFI_STATUS
176 BdsLoadApplication (
177 IN EFI_HANDLE ParentImageHandle,
178 IN CHAR16* EfiApp,
179 IN UINTN LoadOptionsSize,
180 IN VOID* LoadOptions
181 );
182
183 EFI_STATUS
184 BdsLoadImage (
185 IN EFI_DEVICE_PATH *DevicePath,
186 IN EFI_ALLOCATE_TYPE Type,
187 IN OUT EFI_PHYSICAL_ADDRESS* Image,
188 OUT UINTN *FileSize
189 );
190
191 #endif