2011-02-02 23:35:30 +01:00
|
|
|
/** @file
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011, ARM Limited. All rights reserved.
|
|
|
|
*
|
|
|
|
* This program and the accompanying materials
|
|
|
|
* are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
* which accompanies this distribution. The full text of the license may be found at
|
|
|
|
* http://opensource.org/licenses/bsd-license.php
|
|
|
|
*
|
|
|
|
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __BDS_INTERNAL_H__
|
|
|
|
#define __BDS_INTERNAL_H__
|
|
|
|
|
|
|
|
#include <PiDxe.h>
|
2011-09-23 00:54:38 +02:00
|
|
|
#include <Library/ArmLib.h>
|
2011-02-02 23:35:30 +01:00
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/BaseMemoryLib.h>
|
2011-09-23 00:54:38 +02:00
|
|
|
#include <Library/HobLib.h>
|
2011-02-02 23:35:30 +01:00
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
#include <Library/UefiLib.h>
|
|
|
|
#include <Library/DevicePathLib.h>
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
|
|
|
#include <Library/DebugLib.h>
|
2011-06-15 21:56:50 +02:00
|
|
|
#include <Library/BdsLib.h>
|
2011-09-23 00:54:38 +02:00
|
|
|
#include <Library/PcdLib.h>
|
2011-06-11 13:56:30 +02:00
|
|
|
#include <Library/PerformanceLib.h>
|
2011-09-09 12:54:33 +02:00
|
|
|
#include <Library/PrintLib.h>
|
|
|
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
2011-02-02 23:35:30 +01:00
|
|
|
|
2011-09-09 12:54:33 +02:00
|
|
|
#include <Guid/GlobalVariable.h>
|
2011-02-02 23:35:30 +01:00
|
|
|
#include <Guid/FileInfo.h>
|
|
|
|
|
|
|
|
#include <Protocol/DevicePath.h>
|
|
|
|
#include <Protocol/DevicePathFromText.h>
|
|
|
|
#include <Protocol/SimpleFileSystem.h>
|
|
|
|
#include <Protocol/FirmwareVolume2.h>
|
2011-06-11 13:56:30 +02:00
|
|
|
#include <Protocol/LoadFile.h>
|
|
|
|
#include <Protocol/PxeBaseCode.h>
|
2011-02-02 23:35:30 +01:00
|
|
|
|
2011-09-23 00:54:38 +02:00
|
|
|
#include "BdsLinuxLoader.h"
|
2011-02-02 23:35:30 +01:00
|
|
|
|
2011-06-11 13:56:30 +02:00
|
|
|
typedef BOOLEAN (*BDS_FILE_LOADER_SUPPORT) (
|
2011-09-09 12:54:33 +02:00
|
|
|
IN EFI_DEVICE_PATH *DevicePath,
|
|
|
|
IN EFI_HANDLE Handle,
|
|
|
|
IN EFI_DEVICE_PATH *RemainingDevicePath
|
|
|
|
);
|
2011-02-02 23:35:30 +01:00
|
|
|
|
2011-06-11 13:56:30 +02:00
|
|
|
typedef EFI_STATUS (*BDS_FILE_LOADER_LOAD_IMAGE) (
|
2011-09-09 12:54:33 +02:00
|
|
|
IN EFI_DEVICE_PATH *DevicePath,
|
|
|
|
IN EFI_HANDLE Handle,
|
|
|
|
IN EFI_DEVICE_PATH *RemainingDevicePath,
|
|
|
|
IN EFI_ALLOCATE_TYPE Type,
|
|
|
|
IN OUT EFI_PHYSICAL_ADDRESS* Image,
|
|
|
|
OUT UINTN *ImageSize
|
|
|
|
);
|
2011-02-02 23:35:30 +01:00
|
|
|
|
|
|
|
typedef struct {
|
2011-06-11 13:56:30 +02:00
|
|
|
BDS_FILE_LOADER_SUPPORT Support;
|
|
|
|
BDS_FILE_LOADER_LOAD_IMAGE LoadImage;
|
|
|
|
} BDS_FILE_LOADER;
|
2011-02-02 23:35:30 +01:00
|
|
|
|
|
|
|
typedef struct _BDS_SYSTEM_MEMORY_RESOURCE {
|
2011-06-11 13:56:30 +02:00
|
|
|
LIST_ENTRY Link; // This attribute must be the first entry of this structure (to avoid pointer computation)
|
|
|
|
EFI_PHYSICAL_ADDRESS PhysicalStart;
|
|
|
|
UINT64 ResourceLength;
|
2011-02-02 23:35:30 +01:00
|
|
|
} BDS_SYSTEM_MEMORY_RESOURCE;
|
|
|
|
|
|
|
|
|
|
|
|
// BdsHelper.c
|
|
|
|
EFI_STATUS
|
2011-06-11 13:56:30 +02:00
|
|
|
ShutdownUefiBootServices (
|
|
|
|
VOID
|
|
|
|
);
|
2011-02-02 23:35:30 +01:00
|
|
|
|
|
|
|
EFI_STATUS
|
2011-06-11 13:56:30 +02:00
|
|
|
GetSystemMemoryResources (
|
|
|
|
LIST_ENTRY *ResourceList
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
PrintPerformance (
|
|
|
|
VOID
|
|
|
|
);
|
2011-09-09 12:54:33 +02:00
|
|
|
|
2011-06-11 13:56:30 +02:00
|
|
|
EFI_STATUS
|
|
|
|
BdsLoadImage (
|
|
|
|
IN EFI_DEVICE_PATH *DevicePath,
|
|
|
|
IN EFI_ALLOCATE_TYPE Type,
|
|
|
|
IN OUT EFI_PHYSICAL_ADDRESS* Image,
|
|
|
|
OUT UINTN *FileSize
|
|
|
|
);
|
2011-02-02 23:35:30 +01:00
|
|
|
|
2011-09-23 00:55:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
PrepareAtagList (
|
2011-09-27 20:27:20 +02:00
|
|
|
IN CONST CHAR8* CommandLineString,
|
|
|
|
IN EFI_PHYSICAL_ADDRESS InitrdImage,
|
|
|
|
IN UINTN InitrdImageSize,
|
|
|
|
OUT EFI_PHYSICAL_ADDRESS *AtagBase,
|
|
|
|
OUT UINT32 *AtagSize
|
2011-09-23 00:55:54 +02:00
|
|
|
);
|
|
|
|
|
2011-02-02 23:35:30 +01:00
|
|
|
#endif
|