]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/BdsLib/BdsInternal.h
ArmPkg/BdsLib: Exposed ShutdownUefiBootServices() in the BdsLib interface
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsInternal.h
CommitLineData
1e57a462 1/** @file\r
2*\r
df320b10 3* Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
1e57a462 4*\r
3402aac7
RC
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
1e57a462 12*\r
13**/\r
14\r
15#ifndef __BDS_INTERNAL_H__\r
16#define __BDS_INTERNAL_H__\r
17\r
18#include <PiDxe.h>\r
19#include <Library/ArmLib.h>\r
20#include <Library/BaseLib.h>\r
21#include <Library/BaseMemoryLib.h>\r
04ad241e 22#include <Library/DxeServicesTableLib.h>\r
1e57a462 23#include <Library/HobLib.h>\r
24#include <Library/UefiBootServicesTableLib.h>\r
25#include <Library/UefiLib.h>\r
26#include <Library/DevicePathLib.h>\r
27#include <Library/MemoryAllocationLib.h>\r
28#include <Library/DebugLib.h>\r
29#include <Library/BdsLib.h>\r
30#include <Library/PcdLib.h>\r
31#include <Library/PerformanceLib.h>\r
32#include <Library/PrintLib.h>\r
33#include <Library/UefiRuntimeServicesTableLib.h>\r
34\r
35#include <Guid/ArmMpCoreInfo.h>\r
36#include <Guid/GlobalVariable.h>\r
37#include <Guid/FileInfo.h>\r
38\r
39#include <Protocol/DevicePath.h>\r
40#include <Protocol/DevicePathFromText.h>\r
41#include <Protocol/SimpleFileSystem.h>\r
42#include <Protocol/FirmwareVolume2.h>\r
43#include <Protocol/LoadFile.h>\r
44#include <Protocol/PxeBaseCode.h>\r
45\r
46#include <Uefi.h>\r
47\r
df320b10
OM
48/**\r
49 * Check if the file loader can support this device path.\r
50 *\r
51 * @param DevicePath EFI Device Path of the image to load.\r
52 * This device path generally comes from the boot entry (ie: Boot####).\r
53 * @param Handle Handle of the driver supporting the device path\r
54 * @param RemainingDevicePath Part of the EFI Device Path that has not been resolved during\r
55 * the Device Path discovery\r
56 */\r
1e57a462 57typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) (\r
58 IN EFI_DEVICE_PATH *DevicePath,\r
59 IN EFI_HANDLE Handle,\r
60 IN EFI_DEVICE_PATH *RemainingDevicePath\r
61 );\r
62\r
df320b10
OM
63/**\r
64 * Function to load an image from a given Device Path for a\r
65 * specific support (FileSystem, TFTP, PXE, ...)\r
66 *\r
67 * @param DevicePath EFI Device Path of the image to load.\r
68 * This device path generally comes from the boot entry (ie: Boot####).\r
69 * This path is also defined as 'OUT' as there are some device paths that\r
70 * might not be completed such as EFI path for removable device. In these\r
71 * cases, it is expected the loader to add \EFI\BOOT\BOOT(ARM|AA64).EFI\r
72 * @param Handle Handle of the driver supporting the device path\r
73 * @param RemainingDevicePath Part of the EFI Device Path that has not been resolved during\r
74 * the Device Path discovery\r
75 * @param Type Define where the image should be loaded (see EFI_ALLOCATE_TYPE definition)\r
76 * @param Image Base Address of the image has been loaded\r
77 * @param ImageSize Size of the image that has been loaded\r
78 */\r
1e57a462 79typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) (\r
df320b10 80 IN OUT EFI_DEVICE_PATH **DevicePath,\r
1e57a462 81 IN EFI_HANDLE Handle,\r
82 IN EFI_DEVICE_PATH *RemainingDevicePath,\r
83 IN EFI_ALLOCATE_TYPE Type,\r
84 IN OUT EFI_PHYSICAL_ADDRESS* Image,\r
85 OUT UINTN *ImageSize\r
86 );\r
87\r
88typedef struct {\r
89 BDS_FILE_LOADER_SUPPORT Support;\r
90 BDS_FILE_LOADER_LOAD_IMAGE LoadImage;\r
91} BDS_FILE_LOADER;\r
92\r
93typedef struct _BDS_SYSTEM_MEMORY_RESOURCE {\r
94 LIST_ENTRY Link; // This attribute must be the first entry of this structure (to avoid pointer computation)\r
95 EFI_PHYSICAL_ADDRESS PhysicalStart;\r
96 UINT64 ResourceLength;\r
97} BDS_SYSTEM_MEMORY_RESOURCE;\r
98\r
061568e2
RC
99typedef struct {\r
100 UINT64 FileSize;\r
101 UINT64 DownloadedNbOfBytes;\r
102 UINT64 LastReportedNbOfBytes;\r
103} BDS_TFTP_CONTEXT;\r
1e57a462 104\r
105// BdsHelper.c\r
1e57a462 106EFI_STATUS\r
107GetSystemMemoryResources (\r
108 LIST_ENTRY *ResourceList\r
109 );\r
110\r
111VOID\r
112PrintPerformance (\r
113 VOID\r
114 );\r
115\r
116EFI_STATUS\r
117BdsLoadImage (\r
118 IN EFI_DEVICE_PATH *DevicePath,\r
119 IN EFI_ALLOCATE_TYPE Type,\r
120 IN OUT EFI_PHYSICAL_ADDRESS* Image,\r
121 OUT UINTN *FileSize\r
122 );\r
123\r
124#endif\r