]>
Commit | Line | Data |
---|---|---|
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 | |
1e57a462 | 31 | #include <Library/PrintLib.h>\r |
32 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
33 | \r | |
1e57a462 | 34 | #include <Guid/GlobalVariable.h>\r |
35 | #include <Guid/FileInfo.h>\r | |
36 | \r | |
37 | #include <Protocol/DevicePath.h>\r | |
38 | #include <Protocol/DevicePathFromText.h>\r | |
39 | #include <Protocol/SimpleFileSystem.h>\r | |
40 | #include <Protocol/FirmwareVolume2.h>\r | |
41 | #include <Protocol/LoadFile.h>\r | |
42 | #include <Protocol/PxeBaseCode.h>\r | |
43 | \r | |
44 | #include <Uefi.h>\r | |
45 | \r | |
df320b10 OM |
46 | /**\r |
47 | * Check if the file loader can support this device path.\r | |
48 | *\r | |
49 | * @param DevicePath EFI Device Path of the image to load.\r | |
50 | * This device path generally comes from the boot entry (ie: Boot####).\r | |
51 | * @param Handle Handle of the driver supporting the device path\r | |
52 | * @param RemainingDevicePath Part of the EFI Device Path that has not been resolved during\r | |
53 | * the Device Path discovery\r | |
54 | */\r | |
1e57a462 | 55 | typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) (\r |
56 | IN EFI_DEVICE_PATH *DevicePath,\r | |
57 | IN EFI_HANDLE Handle,\r | |
58 | IN EFI_DEVICE_PATH *RemainingDevicePath\r | |
59 | );\r | |
60 | \r | |
df320b10 OM |
61 | /**\r |
62 | * Function to load an image from a given Device Path for a\r | |
63 | * specific support (FileSystem, TFTP, PXE, ...)\r | |
64 | *\r | |
65 | * @param DevicePath EFI Device Path of the image to load.\r | |
66 | * This device path generally comes from the boot entry (ie: Boot####).\r | |
67 | * This path is also defined as 'OUT' as there are some device paths that\r | |
68 | * might not be completed such as EFI path for removable device. In these\r | |
69 | * cases, it is expected the loader to add \EFI\BOOT\BOOT(ARM|AA64).EFI\r | |
70 | * @param Handle Handle of the driver supporting the device path\r | |
71 | * @param RemainingDevicePath Part of the EFI Device Path that has not been resolved during\r | |
72 | * the Device Path discovery\r | |
73 | * @param Type Define where the image should be loaded (see EFI_ALLOCATE_TYPE definition)\r | |
74 | * @param Image Base Address of the image has been loaded\r | |
75 | * @param ImageSize Size of the image that has been loaded\r | |
76 | */\r | |
1e57a462 | 77 | typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) (\r |
df320b10 | 78 | IN OUT EFI_DEVICE_PATH **DevicePath,\r |
1e57a462 | 79 | IN EFI_HANDLE Handle,\r |
80 | IN EFI_DEVICE_PATH *RemainingDevicePath,\r | |
81 | IN EFI_ALLOCATE_TYPE Type,\r | |
82 | IN OUT EFI_PHYSICAL_ADDRESS* Image,\r | |
83 | OUT UINTN *ImageSize\r | |
84 | );\r | |
85 | \r | |
86 | typedef struct {\r | |
87 | BDS_FILE_LOADER_SUPPORT Support;\r | |
88 | BDS_FILE_LOADER_LOAD_IMAGE LoadImage;\r | |
89 | } BDS_FILE_LOADER;\r | |
90 | \r | |
91 | typedef struct _BDS_SYSTEM_MEMORY_RESOURCE {\r | |
92 | LIST_ENTRY Link; // This attribute must be the first entry of this structure (to avoid pointer computation)\r | |
93 | EFI_PHYSICAL_ADDRESS PhysicalStart;\r | |
94 | UINT64 ResourceLength;\r | |
95 | } BDS_SYSTEM_MEMORY_RESOURCE;\r | |
96 | \r | |
061568e2 RC |
97 | typedef struct {\r |
98 | UINT64 FileSize;\r | |
99 | UINT64 DownloadedNbOfBytes;\r | |
100 | UINT64 LastReportedNbOfBytes;\r | |
101 | } BDS_TFTP_CONTEXT;\r | |
1e57a462 | 102 | \r |
1e57a462 | 103 | EFI_STATUS\r |
104 | BdsLoadImage (\r | |
105 | IN EFI_DEVICE_PATH *DevicePath,\r | |
106 | IN EFI_ALLOCATE_TYPE Type,\r | |
107 | IN OUT EFI_PHYSICAL_ADDRESS* Image,\r | |
108 | OUT UINTN *FileSize\r | |
109 | );\r | |
110 | \r | |
111 | #endif\r |