]>
Commit | Line | Data |
---|---|---|
1bfda055 | 1 | /** @file |
2 | * | |
3 | * Copyright (c) 2011, 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_INTERNAL_H__ | |
16 | #define __BDS_INTERNAL_H__ | |
17 | ||
18 | #include <PiDxe.h> | |
19 | #include <Library/BaseLib.h> | |
20 | #include <Library/BaseMemoryLib.h> | |
21 | #include <Library/UefiBootServicesTableLib.h> | |
22 | #include <Library/UefiLib.h> | |
23 | #include <Library/DevicePathLib.h> | |
24 | #include <Library/MemoryAllocationLib.h> | |
25 | #include <Library/DebugLib.h> | |
6bab33c7 | 26 | #include <Library/BdsLib.h> |
a355a365 | 27 | #include <Library/PerformanceLib.h> |
4aa24170 | 28 | #include <Library/PrintLib.h> |
29 | #include <Library/UefiRuntimeServicesTableLib.h> | |
1bfda055 | 30 | |
4aa24170 | 31 | #include <Guid/GlobalVariable.h> |
1bfda055 | 32 | #include <Guid/FileInfo.h> |
33 | ||
34 | #include <Protocol/DevicePath.h> | |
35 | #include <Protocol/DevicePathFromText.h> | |
36 | #include <Protocol/SimpleFileSystem.h> | |
37 | #include <Protocol/FirmwareVolume2.h> | |
a355a365 | 38 | #include <Protocol/LoadFile.h> |
39 | #include <Protocol/PxeBaseCode.h> | |
1bfda055 | 40 | |
41 | ||
a355a365 | 42 | typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) ( |
4aa24170 | 43 | IN EFI_DEVICE_PATH *DevicePath, |
44 | IN EFI_HANDLE Handle, | |
45 | IN EFI_DEVICE_PATH *RemainingDevicePath | |
46 | ); | |
1bfda055 | 47 | |
a355a365 | 48 | typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) ( |
4aa24170 | 49 | IN EFI_DEVICE_PATH *DevicePath, |
50 | IN EFI_HANDLE Handle, | |
51 | IN EFI_DEVICE_PATH *RemainingDevicePath, | |
52 | IN EFI_ALLOCATE_TYPE Type, | |
53 | IN OUT EFI_PHYSICAL_ADDRESS* Image, | |
54 | OUT UINTN *ImageSize | |
55 | ); | |
1bfda055 | 56 | |
57 | typedef struct { | |
a355a365 | 58 | BDS_FILE_LOADER_SUPPORT Support; |
59 | BDS_FILE_LOADER_LOAD_IMAGE LoadImage; | |
60 | } BDS_FILE_LOADER; | |
1bfda055 | 61 | |
62 | typedef struct _BDS_SYSTEM_MEMORY_RESOURCE { | |
a355a365 | 63 | LIST_ENTRY Link; // This attribute must be the first entry of this structure (to avoid pointer computation) |
64 | EFI_PHYSICAL_ADDRESS PhysicalStart; | |
65 | UINT64 ResourceLength; | |
1bfda055 | 66 | } BDS_SYSTEM_MEMORY_RESOURCE; |
67 | ||
68 | ||
69 | // BdsHelper.c | |
70 | EFI_STATUS | |
a355a365 | 71 | ShutdownUefiBootServices ( |
72 | VOID | |
73 | ); | |
1bfda055 | 74 | |
75 | EFI_STATUS | |
a355a365 | 76 | GetSystemMemoryResources ( |
77 | LIST_ENTRY *ResourceList | |
78 | ); | |
79 | ||
80 | VOID | |
81 | PrintPerformance ( | |
82 | VOID | |
83 | ); | |
4aa24170 | 84 | |
a355a365 | 85 | EFI_STATUS |
86 | BdsLoadImage ( | |
87 | IN EFI_DEVICE_PATH *DevicePath, | |
88 | IN EFI_ALLOCATE_TYPE Type, | |
89 | IN OUT EFI_PHYSICAL_ADDRESS* Image, | |
90 | OUT UINTN *FileSize | |
91 | ); | |
1bfda055 | 92 | |
93 | #endif |