TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeDtPlatformDtbLoaderLibDefault.c
Go to the documentation of this file.
1
9#include <PiDxe.h>
10
11#include <Library/BaseLib.h>
14
28EFIAPI
30 OUT VOID **Dtb,
31 OUT UINTN *DtbSize
32 )
33{
34 EFI_STATUS Status;
35 VOID *OrigDtb;
36 VOID *CopyDtb;
37 UINTN OrigDtbSize;
38
39 Status = GetSectionFromAnyFv (
40 &gDtPlatformDefaultDtbFileGuid,
41 EFI_SECTION_RAW,
42 0,
43 &OrigDtb,
44 &OrigDtbSize
45 );
46 if (EFI_ERROR (Status)) {
47 return EFI_NOT_FOUND;
48 }
49
50 CopyDtb = AllocateCopyPool (OrigDtbSize, OrigDtb);
51 if (CopyDtb == NULL) {
52 return EFI_OUT_OF_RESOURCES;
53 }
54
55 *Dtb = CopyDtb;
56 *DtbSize = OrigDtbSize;
57
58 return EFI_SUCCESS;
59}
UINT64 UINTN
EFI_STATUS EFIAPI DtPlatformLoadDtb(OUT VOID **Dtb, OUT UINTN *DtbSize)
EFI_STATUS EFIAPI GetSectionFromAnyFv(IN CONST EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, OUT VOID **Buffer, OUT UINTN *Size)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define NULL
Definition: Base.h:319
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112