summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c')
-rw-r--r--MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
index 207abf780..804ffa5a6 100644
--- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
+++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
@@ -1,7 +1,7 @@
/** @file
This module install ACPI Boot Graphics Resource Table (BGRT).
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -27,15 +27,7 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugLib.h>
-
-//
-// ACPI table information used to initialize tables.
-//
-#define EFI_ACPI_OEM_ID "INTEL"
-#define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO "
-#define EFI_ACPI_OEM_REVISION 0x00000001
-#define EFI_ACPI_CREATOR_ID 0x5446534D // TBD "MSFT"
-#define EFI_ACPI_CREATOR_REVISION 0x01000013 // TBD
+#include <Library/PcdLib.h>
//
// Module globals.
@@ -81,13 +73,13 @@ EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE mBootGraphicsResourceTableTemplate = {
EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION, // Revision
0x00, // Checksum will be updated at runtime
//
- // It is expected that these values will be updated at runtime.
+ // It is expected that these values will be updated at EntryPoint.
//
- EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field
- EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
- EFI_ACPI_OEM_REVISION, // OEM revision number
- EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
- EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number
+ {0x00}, // OEM ID is a 6 bytes long field
+ 0x00, // OEM Table ID(8 bytes long)
+ 0x00, // OEM Revision
+ 0x00, // Creator ID
+ 0x00, // Creator Revision
},
EFI_ACPI_5_0_BGRT_VERSION, // Version
EFI_ACPI_5_0_BGRT_STATUS_VALID, // Status
@@ -235,9 +227,9 @@ BgrtAcpiTableChecksum (
}
/**
- Allocate EfiReservedMemoryType below 4G memory address.
+ Allocate EfiBootServicesData below 4G memory address.
- This function allocates EfiReservedMemoryType below 4G memory address.
+ This function allocates EfiBootServicesData below 4G memory address.
@param[in] Size Size of memory to allocate.
@@ -245,7 +237,7 @@ BgrtAcpiTableChecksum (
**/
VOID *
-BgrtAllocateReservedMemoryBelow4G (
+BgrtAllocateBsDataMemoryBelow4G (
IN UINTN Size
)
{
@@ -259,7 +251,7 @@ BgrtAllocateReservedMemoryBelow4G (
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiReservedMemoryType,
+ EfiBootServicesData,
Pages,
&Address
);
@@ -361,9 +353,12 @@ InstallBootGraphicsResourceTable (
if (mLogoHeight > (((UINT32) ~0) - sizeof (BMP_IMAGE_HEADER)) / (mLogoWidth * 3 + PaddingSize)) {
return EFI_UNSUPPORTED;
}
-
+
+ //
+ // The image should be stored in EfiBootServicesData, allowing the system to reclaim the memory
+ //
BmpSize = (mLogoWidth * 3 + PaddingSize) * mLogoHeight + sizeof (BMP_IMAGE_HEADER);
- ImageBuffer = BgrtAllocateReservedMemoryBelow4G (BmpSize);
+ ImageBuffer = BgrtAllocateBsDataMemoryBelow4G (BmpSize);
if (ImageBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -464,6 +459,18 @@ BootGraphicsDxeEntryPoint (
)
{
EFI_STATUS Status;
+ UINT64 OemTableId;
+
+ CopyMem (
+ mBootGraphicsResourceTableTemplate.Header.OemId,
+ PcdGetPtr (PcdAcpiDefaultOemId),
+ sizeof (mBootGraphicsResourceTableTemplate.Header.OemId)
+ );
+ OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId);
+ CopyMem (&mBootGraphicsResourceTableTemplate.Header.OemTableId, &OemTableId, sizeof (UINT64));
+ mBootGraphicsResourceTableTemplate.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ mBootGraphicsResourceTableTemplate.Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ mBootGraphicsResourceTableTemplate.Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// Install Boot Logo protocol.