]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/BdsLib/BdsInternal.h
ArmPlatformPkg/Bds: Fix various bugs in the new BDS
[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>
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>
1bfda055 27#include <Library/BdsUnixLib.h>
a355a365 28#include <Library/PerformanceLib.h>
1bfda055 29
30#include <Guid/FileInfo.h>
31
32#include <Protocol/DevicePath.h>
33#include <Protocol/DevicePathFromText.h>
34#include <Protocol/SimpleFileSystem.h>
35#include <Protocol/FirmwareVolume2.h>
a355a365 36#include <Protocol/LoadFile.h>
37#include <Protocol/PxeBaseCode.h>
1bfda055 38
39
a355a365 40typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) (
41 IN EFI_DEVICE_PATH *DevicePath,
42 IN EFI_HANDLE Handle,
43 IN EFI_DEVICE_PATH *RemainingDevicePath
44 );
1bfda055 45
a355a365 46typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) (
47 IN EFI_DEVICE_PATH *DevicePath,
48 IN EFI_HANDLE Handle,
49 IN EFI_DEVICE_PATH *RemainingDevicePath,
50 IN EFI_ALLOCATE_TYPE Type,
51 IN OUT EFI_PHYSICAL_ADDRESS* Image,
52 OUT UINTN *ImageSize
53 );
1bfda055 54
55typedef struct {
a355a365 56 BDS_FILE_LOADER_SUPPORT Support;
57 BDS_FILE_LOADER_LOAD_IMAGE LoadImage;
58} BDS_FILE_LOADER;
1bfda055 59
60typedef struct _BDS_SYSTEM_MEMORY_RESOURCE {
a355a365 61 LIST_ENTRY Link; // This attribute must be the first entry of this structure (to avoid pointer computation)
62 EFI_PHYSICAL_ADDRESS PhysicalStart;
63 UINT64 ResourceLength;
1bfda055 64} BDS_SYSTEM_MEMORY_RESOURCE;
65
66
67// BdsHelper.c
68EFI_STATUS
a355a365 69ShutdownUefiBootServices (
70 VOID
71 );
1bfda055 72
73EFI_STATUS
a355a365 74GetSystemMemoryResources (
75 LIST_ENTRY *ResourceList
76 );
77
78VOID
79PrintPerformance (
80 VOID
81 );
82EFI_STATUS
83BdsLoadImage (
84 IN EFI_DEVICE_PATH *DevicePath,
85 IN EFI_ALLOCATE_TYPE Type,
86 IN OUT EFI_PHYSICAL_ADDRESS* Image,
87 OUT UINTN *FileSize
88 );
1bfda055 89
90#endif