TianoCore EDK2 master
Loading...
Searching...
No Matches
AndroidBootImgLib.c File Reference

Go to the source code of this file.

Data Structures

struct  MEMORY_DEVICE_PATH
 
struct  RAMDISK_DEVICE_PATH
 

Macros

#define FDT_ADDITIONAL_ENTRIES_SIZE   0x400
 

Functions

EFI_STATUS EFIAPI AndroidBootImgLoadFile2 (IN EFI_LOAD_FILE2_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)
 
EFI_STATUS AndroidBootImgGetImgSize (IN VOID *BootImg, OUT UINTN *ImgSize)
 
EFI_STATUS AndroidBootImgGetKernelInfo (IN VOID *BootImg, OUT VOID **Kernel, OUT UINTN *KernelSize)
 
EFI_STATUS AndroidBootImgGetRamdiskInfo (IN VOID *BootImg, OUT VOID **Ramdisk, OUT UINTN *RamdiskSize)
 
EFI_STATUS AndroidBootImgGetSecondBootLoaderInfo (IN VOID *BootImg, OUT VOID **Second, OUT UINTN *SecondSize)
 
EFI_STATUS AndroidBootImgGetKernelArgs (IN VOID *BootImg, OUT CHAR8 *KernelArgs)
 
EFI_STATUS AndroidBootImgGetFdt (IN VOID *BootImg, IN VOID **FdtBase)
 
EFI_STATUS AndroidBootImgUpdateArgs (IN VOID *BootImg, OUT VOID **KernelArgs)
 
EFI_STATUS AndroidBootImgInstallLoadFile2 (IN VOID *RamdiskData, IN UINTN RamdiskSize)
 
EFI_STATUS AndroidBootImgUninstallLoadFile2 (VOID)
 
BOOLEAN AndroidBootImgAcpiSupported (VOID)
 
EFI_STATUS AndroidBootImgLocateFdt (IN VOID *BootImg, IN VOID **FdtBase)
 
INTN AndroidBootImgGetChosenNode (IN INTN UpdatedFdtBase)
 
EFI_STATUS AndroidBootImgSetProperty64 (IN INTN UpdatedFdtBase, IN INTN ChosenNode, IN CHAR8 *PropertyName, IN UINT64 Val)
 
EFI_STATUS AndroidBootImgUpdateFdt (IN VOID *BootImg, IN VOID *FdtBase, IN VOID *RamdiskData, IN UINTN RamdiskSize)
 
EFI_STATUS AndroidBootImgBoot (IN VOID *Buffer, IN UINTN BufferSize)
 

Variables

STATIC ANDROID_BOOTIMG_PROTOCOLmAndroidBootImg
 
STATIC VOID * mRamdiskData = NULL
 
STATIC UINTN mRamdiskSize = 0
 
STATIC EFI_HANDLE mRamDiskLoadFileHandle = NULL
 
STATIC CONST MEMORY_DEVICE_PATH mMemoryDevicePathTemplate
 
STATIC CONST RAMDISK_DEVICE_PATH mRamdiskDevicePath
 
STATIC EFI_LOAD_FILE2_PROTOCOL mAndroidBootImgLoadFile2
 

Detailed Description

Copyright (c) 2013-2014, ARM Ltd. All rights reserved.
Copyright (c) 2017, Linaro. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AndroidBootImgLib.c.

Macro Definition Documentation

◆ FDT_ADDITIONAL_ENTRIES_SIZE

#define FDT_ADDITIONAL_ENTRIES_SIZE   0x400

Definition at line 24 of file AndroidBootImgLib.c.

Function Documentation

◆ AndroidBootImgAcpiSupported()

BOOLEAN AndroidBootImgAcpiSupported ( VOID  )

Definition at line 407 of file AndroidBootImgLib.c.

◆ AndroidBootImgBoot()

EFI_STATUS AndroidBootImgBoot ( IN VOID *  Buffer,
IN UINTN  BufferSize 
)

Definition at line 612 of file AndroidBootImgLib.c.

◆ AndroidBootImgGetChosenNode()

INTN AndroidBootImgGetChosenNode ( IN INTN  UpdatedFdtBase)

Definition at line 451 of file AndroidBootImgLib.c.

◆ AndroidBootImgGetFdt()

EFI_STATUS AndroidBootImgGetFdt ( IN VOID *  BootImg,
IN VOID **  FdtBase 
)

Definition at line 305 of file AndroidBootImgLib.c.

◆ AndroidBootImgGetImgSize()

EFI_STATUS AndroidBootImgGetImgSize ( IN VOID *  BootImg,
OUT UINTN ImgSize 
)

Definition at line 158 of file AndroidBootImgLib.c.

◆ AndroidBootImgGetKernelArgs()

EFI_STATUS AndroidBootImgGetKernelArgs ( IN VOID *  BootImg,
OUT CHAR8 *  KernelArgs 
)

Definition at line 286 of file AndroidBootImgLib.c.

◆ AndroidBootImgGetKernelInfo()

EFI_STATUS AndroidBootImgGetKernelInfo ( IN VOID *  BootImg,
OUT VOID **  Kernel,
OUT UINTN KernelSize 
)

Definition at line 188 of file AndroidBootImgLib.c.

◆ AndroidBootImgGetRamdiskInfo()

EFI_STATUS AndroidBootImgGetRamdiskInfo ( IN VOID *  BootImg,
OUT VOID **  Ramdisk,
OUT UINTN RamdiskSize 
)

Definition at line 219 of file AndroidBootImgLib.c.

◆ AndroidBootImgGetSecondBootLoaderInfo()

EFI_STATUS AndroidBootImgGetSecondBootLoaderInfo ( IN VOID *  BootImg,
OUT VOID **  Second,
OUT UINTN SecondSize 
)

Definition at line 252 of file AndroidBootImgLib.c.

◆ AndroidBootImgInstallLoadFile2()

EFI_STATUS AndroidBootImgInstallLoadFile2 ( IN VOID *  RamdiskData,
IN UINTN  RamdiskSize 
)

Definition at line 363 of file AndroidBootImgLib.c.

◆ AndroidBootImgLoadFile2()

EFI_STATUS EFIAPI AndroidBootImgLoadFile2 ( IN EFI_LOAD_FILE2_PROTOCOL This,
IN EFI_DEVICE_PATH_PROTOCOL FilePath,
IN BOOLEAN  BootPolicy,
IN OUT UINTN BufferSize,
IN VOID *Buffer  OPTIONAL 
)

Causes the driver to load a specified file.

Parameters
ThisProtocol instance pointer.
FilePathThe device specific path of the file to load.
BootPolicyShould always be FALSE.
BufferSizeOn input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file.
BufferThe memory buffer to transfer the file to. IF Buffer is NULL, then no the size of the requested file is returned in BufferSize.
Return values
EFI_SUCCESSThe file was loaded.
EFI_UNSUPPORTEDBootPolicy is TRUE.
EFI_INVALID_PARAMETERFilePath is not a valid device path, or BufferSize is NULL.
EFI_NO_MEDIANo medium was present to load the file.
EFI_DEVICE_ERRORThe file was not loaded due to a device error.
EFI_NO_RESPONSEThe remote system did not respond.
EFI_NOT_FOUNDThe file was not found
EFI_ABORTEDThe file load process was manually canceled.
EFI_BUFFER_TOO_SMALLThe BufferSize is too small to read the current directory entry. BufferSize has been updated with the size needed to complete the request.

Definition at line 110 of file AndroidBootImgLib.c.

◆ AndroidBootImgLocateFdt()

EFI_STATUS AndroidBootImgLocateFdt ( IN VOID *  BootImg,
IN VOID **  FdtBase 
)

Definition at line 419 of file AndroidBootImgLib.c.

◆ AndroidBootImgSetProperty64()

EFI_STATUS AndroidBootImgSetProperty64 ( IN INTN  UpdatedFdtBase,
IN INTN  ChosenNode,
IN CHAR8 *  PropertyName,
IN UINT64  Val 
)

Definition at line 470 of file AndroidBootImgLib.c.

◆ AndroidBootImgUninstallLoadFile2()

EFI_STATUS AndroidBootImgUninstallLoadFile2 ( VOID  )

Definition at line 382 of file AndroidBootImgLib.c.

◆ AndroidBootImgUpdateArgs()

EFI_STATUS AndroidBootImgUpdateArgs ( IN VOID *  BootImg,
OUT VOID **  KernelArgs 
)

Definition at line 324 of file AndroidBootImgLib.c.

◆ AndroidBootImgUpdateFdt()

EFI_STATUS AndroidBootImgUpdateFdt ( IN VOID *  BootImg,
IN VOID *  FdtBase,
IN VOID *  RamdiskData,
IN UINTN  RamdiskSize 
)

Definition at line 520 of file AndroidBootImgLib.c.

Variable Documentation

◆ mAndroidBootImg

STATIC ANDROID_BOOTIMG_PROTOCOL* mAndroidBootImg

Definition at line 36 of file AndroidBootImgLib.c.

◆ mAndroidBootImgLoadFile2

STATIC EFI_LOAD_FILE2_PROTOCOL mAndroidBootImgLoadFile2
Initial value:
= {
}
EFI_STATUS EFIAPI AndroidBootImgLoadFile2(IN EFI_LOAD_FILE2_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)

Load File Protocol instance

Definition at line 153 of file AndroidBootImgLib.c.

◆ mMemoryDevicePathTemplate

STATIC CONST MEMORY_DEVICE_PATH mMemoryDevicePathTemplate
Initial value:
=
{
{
{
{
(UINT8)(sizeof (MEMMAP_DEVICE_PATH)),
(UINT8)((sizeof (MEMMAP_DEVICE_PATH)) >> 8),
},
},
0,
0
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{ sizeof (EFI_DEVICE_PATH_PROTOCOL), 0 }
}
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_MEMMAP_DP
Definition: DevicePath.h:109

Definition at line 41 of file AndroidBootImgLib.c.

◆ mRamdiskData

STATIC VOID* mRamdiskData = NULL

Definition at line 37 of file AndroidBootImgLib.c.

◆ mRamdiskDevicePath

STATIC CONST RAMDISK_DEVICE_PATH mRamdiskDevicePath
Initial value:
=
{
{
{
MEDIA_DEVICE_PATH,
{ sizeof (VENDOR_DEVICE_PATH), 0 }
},
LINUX_EFI_INITRD_MEDIA_GUID
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{ sizeof (EFI_DEVICE_PATH_PROTOCOL), 0 }
}
}
#define MEDIA_VENDOR_DP
Media vendor device path subtype.
Definition: DevicePath.h:1093

Definition at line 62 of file AndroidBootImgLib.c.

◆ mRamDiskLoadFileHandle

STATIC EFI_HANDLE mRamDiskLoadFileHandle = NULL

Definition at line 39 of file AndroidBootImgLib.c.

◆ mRamdiskSize

STATIC UINTN mRamdiskSize = 0

Definition at line 38 of file AndroidBootImgLib.c.