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/ArmLib.h>
20 #include <Library/BaseLib.h>
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/HobLib.h>
23 #include <Library/UefiBootServicesTableLib.h>
24 #include <Library/UefiLib.h>
25 #include <Library/DevicePathLib.h>
26 #include <Library/MemoryAllocationLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/BdsLib.h>
29 #include <Library/PcdLib.h>
30 #include <Library/PerformanceLib.h>
31 #include <Library/PrintLib.h>
32 #include <Library/UefiRuntimeServicesTableLib.h>
34 #include <Guid/GlobalVariable.h>
35 #include <Guid/FileInfo.h>
37 #include <Protocol/DevicePath.h>
38 #include <Protocol/DevicePathFromText.h>
39 #include <Protocol/SimpleFileSystem.h>
40 #include <Protocol/FirmwareVolume2.h>
41 #include <Protocol/LoadFile.h>
42 #include <Protocol/PxeBaseCode.h>
44 #include "BdsLinuxLoader.h"
46 typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT
) (
47 IN EFI_DEVICE_PATH
*DevicePath
,
49 IN EFI_DEVICE_PATH
*RemainingDevicePath
52 typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE
) (
53 IN EFI_DEVICE_PATH
*DevicePath
,
55 IN EFI_DEVICE_PATH
*RemainingDevicePath
,
56 IN EFI_ALLOCATE_TYPE Type
,
57 IN OUT EFI_PHYSICAL_ADDRESS
* Image
,
62 BDS_FILE_LOADER_SUPPORT Support
;
63 BDS_FILE_LOADER_LOAD_IMAGE LoadImage
;
66 typedef struct _BDS_SYSTEM_MEMORY_RESOURCE
{
67 LIST_ENTRY Link
; // This attribute must be the first entry of this structure (to avoid pointer computation)
68 EFI_PHYSICAL_ADDRESS PhysicalStart
;
69 UINT64 ResourceLength
;
70 } BDS_SYSTEM_MEMORY_RESOURCE
;
75 ShutdownUefiBootServices (
80 GetSystemMemoryResources (
81 LIST_ENTRY
*ResourceList
91 IN EFI_DEVICE_PATH
*DevicePath
,
92 IN EFI_ALLOCATE_TYPE Type
,
93 IN OUT EFI_PHYSICAL_ADDRESS
* Image
,
99 IN CONST CHAR8
* CommandLineString
,
100 IN EFI_PHYSICAL_ADDRESS InitrdImage
,
101 IN UINTN InitrdImageSize
,
102 OUT EFI_PHYSICAL_ADDRESS
*AtagBase
,