]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/BdsLib/BdsInternal.h
ArmPkg/BdsLib: Rework TFTP boot
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsInternal.h
CommitLineData
1e57a462 1/** @file\r
2*\r
3* Copyright (c) 2011-2012, 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
48typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) (\r
49 IN EFI_DEVICE_PATH *DevicePath,\r
50 IN EFI_HANDLE Handle,\r
51 IN EFI_DEVICE_PATH *RemainingDevicePath\r
52 );\r
53\r
54typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) (\r
55 IN EFI_DEVICE_PATH *DevicePath,\r
56 IN EFI_HANDLE Handle,\r
57 IN EFI_DEVICE_PATH *RemainingDevicePath,\r
58 IN EFI_ALLOCATE_TYPE Type,\r
59 IN OUT EFI_PHYSICAL_ADDRESS* Image,\r
60 OUT UINTN *ImageSize\r
61 );\r
62\r
63typedef struct {\r
64 BDS_FILE_LOADER_SUPPORT Support;\r
65 BDS_FILE_LOADER_LOAD_IMAGE LoadImage;\r
66} BDS_FILE_LOADER;\r
67\r
68typedef struct _BDS_SYSTEM_MEMORY_RESOURCE {\r
69 LIST_ENTRY Link; // This attribute must be the first entry of this structure (to avoid pointer computation)\r
70 EFI_PHYSICAL_ADDRESS PhysicalStart;\r
71 UINT64 ResourceLength;\r
72} BDS_SYSTEM_MEMORY_RESOURCE;\r
73\r
061568e2
RC
74typedef struct {\r
75 UINT64 FileSize;\r
76 UINT64 DownloadedNbOfBytes;\r
77 UINT64 LastReportedNbOfBytes;\r
78} BDS_TFTP_CONTEXT;\r
1e57a462 79\r
80// BdsHelper.c\r
81EFI_STATUS\r
82ShutdownUefiBootServices (\r
83 VOID\r
84 );\r
85\r
86EFI_STATUS\r
87GetSystemMemoryResources (\r
88 LIST_ENTRY *ResourceList\r
89 );\r
90\r
91VOID\r
92PrintPerformance (\r
93 VOID\r
94 );\r
95\r
96EFI_STATUS\r
97BdsLoadImage (\r
98 IN EFI_DEVICE_PATH *DevicePath,\r
99 IN EFI_ALLOCATE_TYPE Type,\r
100 IN OUT EFI_PHYSICAL_ADDRESS* Image,\r
101 OUT UINTN *FileSize\r
102 );\r
103\r
104#endif\r