3 * Copyright (c) 2011, ARM Limited. All rights reserved.
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
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.
15 #ifndef __BDS_INTERNAL_H__
16 #define __BDS_INTERNAL_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>
26 #include <Library/BdsLib.h>
27 #include <Library/PerformanceLib.h>
29 #include <Guid/FileInfo.h>
31 #include <Protocol/DevicePath.h>
32 #include <Protocol/DevicePathFromText.h>
33 #include <Protocol/SimpleFileSystem.h>
34 #include <Protocol/FirmwareVolume2.h>
35 #include <Protocol/LoadFile.h>
36 #include <Protocol/PxeBaseCode.h>
39 typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT
) (
40 IN EFI_DEVICE_PATH
*DevicePath
,
42 IN EFI_DEVICE_PATH
*RemainingDevicePath
45 typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE
) (
46 IN EFI_DEVICE_PATH
*DevicePath
,
48 IN EFI_DEVICE_PATH
*RemainingDevicePath
,
49 IN EFI_ALLOCATE_TYPE Type
,
50 IN OUT EFI_PHYSICAL_ADDRESS
* Image
,
55 BDS_FILE_LOADER_SUPPORT Support
;
56 BDS_FILE_LOADER_LOAD_IMAGE LoadImage
;
59 typedef struct _BDS_SYSTEM_MEMORY_RESOURCE
{
60 LIST_ENTRY Link
; // This attribute must be the first entry of this structure (to avoid pointer computation)
61 EFI_PHYSICAL_ADDRESS PhysicalStart
;
62 UINT64 ResourceLength
;
63 } BDS_SYSTEM_MEMORY_RESOURCE
;
68 ShutdownUefiBootServices (
73 GetSystemMemoryResources (
74 LIST_ENTRY
*ResourceList
83 IN EFI_DEVICE_PATH
*DevicePath
,
84 IN EFI_ALLOCATE_TYPE Type
,
85 IN OUT EFI_PHYSICAL_ADDRESS
* Image
,