示例#1
0
EFI_STATUS
GetImage (
  IN  EFI_GUID           *NameGuid,
  IN  EFI_SECTION_TYPE   SectionType,
  OUT VOID               **Buffer,
  OUT UINTN              *Size
  )
{
  return GetImageEx (NULL, NameGuid, SectionType, Buffer, Size, FALSE);
}
示例#2
0
EFI_STATUS
GetGraphicsBitMapFromFVEx (
  IN  EFI_HANDLE    ImageHandle,
  IN  EFI_GUID      *FileNameGuid,
  OUT VOID          **Image,
  OUT UINTN         *ImageSize
  )
/*++

Routine Description:

  Return the graphics image file named FileNameGuid into Image and return it's
  size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
  file name.

Arguments:

  ImageHandle   - The driver image handle of the caller. The parameter is used to
                  optimize the loading of the image file so that the FV from which
                  the driver image is loaded will be tried first. 

  FileNameGuid  - File Name of graphics file in the FV(s).

  Image         - Pointer to pointer to return graphics image.  If NULL, a 
                  buffer will be allocated.

  ImageSize     - Size of the graphics Image in bytes. Zero if no image found.


Returns: 

  EFI_SUCCESS          - Image and ImageSize are valid. 
  EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
  EFI_NOT_FOUND        - FileNameGuid not found

--*/
{
  return GetImageEx (
           ImageHandle,
           FileNameGuid,
           EFI_SECTION_RAW,
           Image,
           ImageSize,
           FALSE
           );
}
示例#3
0
EFI_STATUS
GetBiosId (
  OUT BIOS_ID_IMAGE     *BiosIdImage
  )

{
  EFI_STATUS    Status;
  VOID          *Address = NULL;
  UINTN         Size = 0;

    DEBUG ((EFI_D_INFO, "Get BIOS ID from FV\n"));

    Status = GetImageEx (
               NULL,
               &gEfiBiosIdGuid,
               EFI_SECTION_RAW,
               &Address,
               &Size,
               FALSE
               );

    if (Status == EFI_SUCCESS) {
      //
      // BiosId image is present in FV
      //
      if (Address != NULL) {
        Size = sizeof (BIOS_ID_IMAGE);
        gBS->CopyMem (
              (void *) BiosIdImage,
              Address,
              Size
              );
        //
        // GetImage () allocated buffer for Address, now clear it.
        //
        gBS->FreePool (Address);

        DEBUG ((EFI_D_INFO, "Get BIOS ID from FV successfully\n"));
        DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage->BiosIdString))));

        return EFI_SUCCESS;
      }
    }
  return EFI_NOT_FOUND;
}