svn commit: r261728 - projects/uefi/sys/boot/amd64/efi
Ed Maste
emaste at FreeBSD.org
Mon Feb 10 21:20:43 UTC 2014
Author: emaste
Date: Mon Feb 10 21:20:42 2014
New Revision: 261728
URL: http://svnweb.freebsd.org/changeset/base/261728
Log:
Remove indirection in efi_find_framebuffer
Sponsored by: The FreeBSD Foundation
Modified:
projects/uefi/sys/boot/amd64/efi/bootinfo.c
projects/uefi/sys/boot/amd64/efi/framebuffer.c
projects/uefi/sys/boot/amd64/efi/framebuffer.h
Modified: projects/uefi/sys/boot/amd64/efi/bootinfo.c
==============================================================================
--- projects/uefi/sys/boot/amd64/efi/bootinfo.c Mon Feb 10 20:25:40 2014 (r261727)
+++ projects/uefi/sys/boot/amd64/efi/bootinfo.c Mon Feb 10 21:20:42 2014 (r261728)
@@ -289,7 +289,7 @@ bi_load_efi_data(struct preloaded_file *
efihdr->descriptor_size = mmsz;
efihdr->descriptor_version = mmver;
- efi_find_framebuffer(efihdr);
+ efi_find_framebuffer(&efihdr->fb);
file_addmetadata(kfp, MODINFOMD_EFI, efisz + sz, efihdr);
Modified: projects/uefi/sys/boot/amd64/efi/framebuffer.c
==============================================================================
--- projects/uefi/sys/boot/amd64/efi/framebuffer.c Mon Feb 10 20:25:40 2014 (r261727)
+++ projects/uefi/sys/boot/amd64/efi/framebuffer.c Mon Feb 10 21:20:42 2014 (r261728)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
void
-efi_find_framebuffer(struct efi_header *efihdr)
+efi_find_framebuffer(struct efi_fb *efifb)
{
EFI_GRAPHICS_OUTPUT *gop;
EFI_STATUS status;
@@ -48,41 +48,41 @@ efi_find_framebuffer(struct efi_header *
status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop);
if (EFI_ERROR(status)) {
- efihdr->fb.fb_present = 0;
+ efifb->fb_present = 0;
return;
}
mode = gop->Mode;
info = gop->Mode->Info;
- efihdr->fb.fb_present = 1;
- efihdr->fb.fb_addr = mode->FrameBufferBase;
- efihdr->fb.fb_size = mode->FrameBufferSize;
- efihdr->fb.fb_height = info->VerticalResolution;
- efihdr->fb.fb_width = info->HorizontalResolution;
- efihdr->fb.fb_stride = info->PixelsPerScanLine;
+ efifb->fb_present = 1;
+ efifb->fb_addr = mode->FrameBufferBase;
+ efifb->fb_size = mode->FrameBufferSize;
+ efifb->fb_height = info->VerticalResolution;
+ efifb->fb_width = info->HorizontalResolution;
+ efifb->fb_stride = info->PixelsPerScanLine;
switch (info->PixelFormat) {
case PixelRedGreenBlueReserved8BitPerColor:
- efihdr->fb.fb_mask_red = 0x000000ff;
- efihdr->fb.fb_mask_green = 0x0000ff00;
- efihdr->fb.fb_mask_blue = 0x00ff0000;
- efihdr->fb.fb_mask_reserved = 0xff000000;
+ efifb->fb_mask_red = 0x000000ff;
+ efifb->fb_mask_green = 0x0000ff00;
+ efifb->fb_mask_blue = 0x00ff0000;
+ efifb->fb_mask_reserved = 0xff000000;
break;
case PixelBlueGreenRedReserved8BitPerColor:
- efihdr->fb.fb_mask_red = 0x00ff0000;
- efihdr->fb.fb_mask_green = 0x0000ff00;
- efihdr->fb.fb_mask_blue = 0x000000ff;
- efihdr->fb.fb_mask_reserved = 0xff000000;
+ efifb->fb_mask_red = 0x00ff0000;
+ efifb->fb_mask_green = 0x0000ff00;
+ efifb->fb_mask_blue = 0x000000ff;
+ efifb->fb_mask_reserved = 0xff000000;
break;
case PixelBitMask:
- efihdr->fb.fb_mask_red = info->PixelInformation.RedMask;
- efihdr->fb.fb_mask_green = info->PixelInformation.GreenMask;
- efihdr->fb.fb_mask_blue = info->PixelInformation.BlueMask;
- efihdr->fb.fb_mask_reserved =
+ efifb->fb_mask_red = info->PixelInformation.RedMask;
+ efifb->fb_mask_green = info->PixelInformation.GreenMask;
+ efifb->fb_mask_blue = info->PixelInformation.BlueMask;
+ efifb->fb_mask_reserved =
info->PixelInformation.ReservedMask;
break;
default:
- efihdr->fb.fb_present = 0;
+ efifb->fb_present = 0;
}
}
Modified: projects/uefi/sys/boot/amd64/efi/framebuffer.h
==============================================================================
--- projects/uefi/sys/boot/amd64/efi/framebuffer.h Mon Feb 10 20:25:40 2014 (r261727)
+++ projects/uefi/sys/boot/amd64/efi/framebuffer.h Mon Feb 10 21:20:42 2014 (r261728)
@@ -1,6 +1,6 @@
#ifndef _EFIFB_H_
#define _EFIFB_H_
-void efi_find_framebuffer(struct efi_header *efihdr);
+void efi_find_framebuffer(struct efi_fb *efifb);
#endif /* _EFIFB_H_ */
More information about the svn-src-projects
mailing list