OvmfPkg: PlatformPei: allow caching in AddReservedMemoryBaseSizeHob()

AddReservedMemoryBaseSizeHob() should be able to set the same resource
attributes for reserved memory as AddMemoryBaseSizeHob() sets for system
memory. Add a new parameter called "Cacheable" to
AddReservedMemoryBaseSizeHob(), and set it to FALSE in the only caller we
have at the moment.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19038 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Laszlo Ersek 2015-11-30 18:41:29 +00:00 committed by lersek
parent efb0f16e98
commit cdef34ec12
3 changed files with 11 additions and 3 deletions

View File

@ -88,7 +88,8 @@ AddIoMemoryBaseSizeHob (
VOID VOID
AddReservedMemoryBaseSizeHob ( AddReservedMemoryBaseSizeHob (
EFI_PHYSICAL_ADDRESS MemoryBase, EFI_PHYSICAL_ADDRESS MemoryBase,
UINT64 MemorySize UINT64 MemorySize,
BOOLEAN Cacheable
) )
{ {
BuildResourceDescriptorHob ( BuildResourceDescriptorHob (
@ -96,6 +97,12 @@ AddReservedMemoryBaseSizeHob (
EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_PRESENT |
EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
(Cacheable ?
EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE :
0
) |
EFI_RESOURCE_ATTRIBUTE_TESTED, EFI_RESOURCE_ATTRIBUTE_TESTED,
MemoryBase, MemoryBase,
MemorySize MemorySize

View File

@ -50,7 +50,8 @@ AddUntestedMemoryBaseSizeHob (
VOID VOID
AddReservedMemoryBaseSizeHob ( AddReservedMemoryBaseSizeHob (
EFI_PHYSICAL_ADDRESS MemoryBase, EFI_PHYSICAL_ADDRESS MemoryBase,
UINT64 MemorySize UINT64 MemorySize,
BOOLEAN Cacheable
); );
VOID VOID

View File

@ -223,7 +223,7 @@ InitializeXen (
// Reserve away HVMLOADER reserved memory [0xFC000000,0xFD000000). // Reserve away HVMLOADER reserved memory [0xFC000000,0xFD000000).
// This needs to match HVMLOADER RESERVED_MEMBASE/RESERVED_MEMSIZE. // This needs to match HVMLOADER RESERVED_MEMBASE/RESERVED_MEMSIZE.
// //
AddReservedMemoryBaseSizeHob (0xFC000000, 0x1000000); AddReservedMemoryBaseSizeHob (0xFC000000, 0x1000000, FALSE);
PcdSetBool (PcdPciDisableBusEnumeration, TRUE); PcdSetBool (PcdPciDisableBusEnumeration, TRUE);