BdsInternal.h revision 0a6653bc2aecaa621eb42c7137b6f13815a34a92
1/** @file 2* 3* Copyright (c) 2011-2012, 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/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> 33 34#include <Guid/ArmMpCoreInfo.h> 35#include <Guid/GlobalVariable.h> 36#include <Guid/FileInfo.h> 37 38#include <Protocol/DevicePath.h> 39#include <Protocol/DevicePathFromText.h> 40#include <Protocol/SimpleFileSystem.h> 41#include <Protocol/FirmwareVolume2.h> 42#include <Protocol/LoadFile.h> 43#include <Protocol/PxeBaseCode.h> 44 45#include <Uefi.h> 46 47typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) ( 48 IN EFI_DEVICE_PATH *DevicePath, 49 IN EFI_HANDLE Handle, 50 IN EFI_DEVICE_PATH *RemainingDevicePath 51 ); 52 53typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) ( 54 IN EFI_DEVICE_PATH *DevicePath, 55 IN EFI_HANDLE Handle, 56 IN EFI_DEVICE_PATH *RemainingDevicePath, 57 IN EFI_ALLOCATE_TYPE Type, 58 IN OUT EFI_PHYSICAL_ADDRESS* Image, 59 OUT UINTN *ImageSize 60 ); 61 62typedef struct { 63 BDS_FILE_LOADER_SUPPORT Support; 64 BDS_FILE_LOADER_LOAD_IMAGE LoadImage; 65} BDS_FILE_LOADER; 66 67typedef struct _BDS_SYSTEM_MEMORY_RESOURCE { 68 LIST_ENTRY Link; // This attribute must be the first entry of this structure (to avoid pointer computation) 69 EFI_PHYSICAL_ADDRESS PhysicalStart; 70 UINT64 ResourceLength; 71} BDS_SYSTEM_MEMORY_RESOURCE; 72 73 74// BdsHelper.c 75EFI_STATUS 76ShutdownUefiBootServices ( 77 VOID 78 ); 79 80EFI_STATUS 81GetSystemMemoryResources ( 82 LIST_ENTRY *ResourceList 83 ); 84 85VOID 86PrintPerformance ( 87 VOID 88 ); 89 90EFI_STATUS 91BdsLoadImage ( 92 IN EFI_DEVICE_PATH *DevicePath, 93 IN EFI_ALLOCATE_TYPE Type, 94 IN OUT EFI_PHYSICAL_ADDRESS* Image, 95 OUT UINTN *FileSize 96 ); 97 98#endif 99