/* Return a pool allocated copy of the DTB image that is appropriate for booting the current platform via DT. */
EFI_STATUS EFIAPI DtPlatformLoadDtb(OUT VOID **Dtb, OUT UINTN *DtbSize)
/* Return a pool allocated copy of the DTB image that is appropriate for booting the current platform via DT. */
EFI_STATUS EFIAPI DtPlatformLoadDtb(OUT VOID **Dtb, OUT UINTN *DtbSize)
{
  EFI_STATUS  Status;
  VOID        *OrigDtb;
  VOID        *CopyDtb;
  UINTN       OrigDtbSize;
  Status = GetSectionFromAnyFv (
             &gDtPlatformDefaultDtbFileGuid,
             EFI_SECTION_RAW,
             0,
             &OrigDtb,
             &OrigDtbSize
             );
  if (EFI_ERROR (Status)) {
    return EFI_NOT_FOUND;
  }
  CopyDtb = AllocateCopyPool (OrigDtbSize, OrigDtb);
  if (CopyDtb == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  *Dtb     = CopyDtb;
  *DtbSize = OrigDtbSize;
  return EFI_SUCCESS;
}