]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/BdsLib/BdsInternal.h
ArmPkg/BdsLib: Use two distinct functions to boot Linux either by Atag or Fdt
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsInternal.h
CommitLineData
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>
76d17c31 19#include <Library/ArmLib.h>
1bfda055 20#include <Library/BaseLib.h>
21#include <Library/BaseMemoryLib.h>
76d17c31 22#include <Library/HobLib.h>
1bfda055 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>
6bab33c7 28#include <Library/BdsLib.h>
76d17c31 29#include <Library/PcdLib.h>
a355a365 30#include <Library/PerformanceLib.h>
4aa24170 31#include <Library/PrintLib.h>
32#include <Library/UefiRuntimeServicesTableLib.h>
1bfda055 33
4aa24170 34#include <Guid/GlobalVariable.h>
1bfda055 35#include <Guid/FileInfo.h>
36
37#include <Protocol/DevicePath.h>
38#include <Protocol/DevicePathFromText.h>
39#include <Protocol/SimpleFileSystem.h>
40#include <Protocol/FirmwareVolume2.h>
a355a365 41#include <Protocol/LoadFile.h>
42#include <Protocol/PxeBaseCode.h>
1bfda055 43
76d17c31 44#include "BdsLinuxLoader.h"
1bfda055 45
a355a365 46typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) (
4aa24170 47 IN EFI_DEVICE_PATH *DevicePath,
48 IN EFI_HANDLE Handle,
49 IN EFI_DEVICE_PATH *RemainingDevicePath
50 );
1bfda055 51
a355a365 52typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) (
4aa24170 53 IN EFI_DEVICE_PATH *DevicePath,
54 IN EFI_HANDLE Handle,
55 IN EFI_DEVICE_PATH *RemainingDevicePath,
56 IN EFI_ALLOCATE_TYPE Type,
57 IN OUT EFI_PHYSICAL_ADDRESS* Image,
58 OUT UINTN *ImageSize
59 );
1bfda055 60
61typedef struct {
a355a365 62 BDS_FILE_LOADER_SUPPORT Support;
63 BDS_FILE_LOADER_LOAD_IMAGE LoadImage;
64} BDS_FILE_LOADER;
1bfda055 65
66typedef struct _BDS_SYSTEM_MEMORY_RESOURCE {
a355a365 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;
1bfda055 70} BDS_SYSTEM_MEMORY_RESOURCE;
71
72
73// BdsHelper.c
74EFI_STATUS
a355a365 75ShutdownUefiBootServices (
76 VOID
77 );
1bfda055 78
79EFI_STATUS
a355a365 80GetSystemMemoryResources (
81 LIST_ENTRY *ResourceList
82 );
83
84VOID
85PrintPerformance (
86 VOID
87 );
4aa24170 88
a355a365 89EFI_STATUS
90BdsLoadImage (
91 IN EFI_DEVICE_PATH *DevicePath,
92 IN EFI_ALLOCATE_TYPE Type,
93 IN OUT EFI_PHYSICAL_ADDRESS* Image,
94 OUT UINTN *FileSize
95 );
1bfda055 96
97#endif