mirror of https://github.com/acidanthera/audk.git
OvmfPkg/PlatformPei: extract memory type info defaults to PCDs
Some OvmfPkg modules already depend on "EmbeddedPkg.dec"; thus, replace the open-coded memory type info defaults in the source code with the EmbeddedPkg PCDs that stand for the same purpose. Consequently, platform builders can override these values with the "--pcd" option of "build", without source code updates. While at it, sort the memory type names alphabetically. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2706 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200508121651.16045-4-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
This commit is contained in:
parent
356b96b3a2
commit
8db87f9835
|
@ -536,6 +536,18 @@
|
||||||
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
|
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# The NumberOfPages values below are ad-hoc. They are updated sporadically at
|
||||||
|
# best (please refer to git-blame for past updates). The values capture a set
|
||||||
|
# of BIN hints that made sense at a particular time, for some (now likely
|
||||||
|
# unknown) workloads / boot paths.
|
||||||
|
#
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x4
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x8
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x4
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x30
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x24
|
||||||
|
|
||||||
#
|
#
|
||||||
# Network Pcds
|
# Network Pcds
|
||||||
#
|
#
|
||||||
|
|
|
@ -540,6 +540,19 @@
|
||||||
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
|
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
[PcdsFixedAtBuild.IA32]
|
||||||
|
#
|
||||||
|
# The NumberOfPages values below are ad-hoc. They are updated sporadically at
|
||||||
|
# best (please refer to git-blame for past updates). The values capture a set
|
||||||
|
# of BIN hints that made sense at a particular time, for some (now likely
|
||||||
|
# unknown) workloads / boot paths.
|
||||||
|
#
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x4
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x8
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x4
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x30
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x24
|
||||||
|
|
||||||
[PcdsFixedAtBuild.X64]
|
[PcdsFixedAtBuild.X64]
|
||||||
#
|
#
|
||||||
# Network Pcds
|
# Network Pcds
|
||||||
|
|
|
@ -540,6 +540,18 @@
|
||||||
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
|
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# The NumberOfPages values below are ad-hoc. They are updated sporadically at
|
||||||
|
# best (please refer to git-blame for past updates). The values capture a set
|
||||||
|
# of BIN hints that made sense at a particular time, for some (now likely
|
||||||
|
# unknown) workloads / boot paths.
|
||||||
|
#
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x4
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x8
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x4
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x30
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x24
|
||||||
|
|
||||||
#
|
#
|
||||||
# Network Pcds
|
# Network Pcds
|
||||||
#
|
#
|
||||||
|
|
|
@ -17,19 +17,16 @@
|
||||||
|
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
|
||||||
//
|
#define MEMORY_TYPE_INFO_DEFAULT(Type) \
|
||||||
// The NumberOfPages values below are ad-hoc. They are updated sporadically at
|
{ Type, FixedPcdGet32 (PcdMemoryType ## Type) }
|
||||||
// best (please refer to git-blame for past updates). The values capture a set
|
|
||||||
// of BIN hints that made sense at a particular time, for some (now likely
|
|
||||||
// unknown) workloads / boot paths.
|
|
||||||
//
|
|
||||||
STATIC EFI_MEMORY_TYPE_INFORMATION mMemoryTypeInformation[] = {
|
STATIC EFI_MEMORY_TYPE_INFORMATION mMemoryTypeInformation[] = {
|
||||||
{ EfiACPIMemoryNVS, 0x004 },
|
MEMORY_TYPE_INFO_DEFAULT (EfiACPIMemoryNVS),
|
||||||
{ EfiACPIReclaimMemory, 0x008 },
|
MEMORY_TYPE_INFO_DEFAULT (EfiACPIReclaimMemory),
|
||||||
{ EfiReservedMemoryType, 0x004 },
|
MEMORY_TYPE_INFO_DEFAULT (EfiReservedMemoryType),
|
||||||
{ EfiRuntimeServicesData, 0x024 },
|
MEMORY_TYPE_INFO_DEFAULT (EfiRuntimeServicesCode),
|
||||||
{ EfiRuntimeServicesCode, 0x030 },
|
MEMORY_TYPE_INFO_DEFAULT (EfiRuntimeServicesData),
|
||||||
{ EfiMaxMemoryType, 0x000 }
|
{ EfiMaxMemoryType, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
Xen.h
|
Xen.h
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
EmbeddedPkg/EmbeddedPkg.dec
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
SecurityPkg/SecurityPkg.dec
|
SecurityPkg/SecurityPkg.dec
|
||||||
|
@ -105,6 +106,11 @@
|
||||||
|
|
||||||
[FixedPcd]
|
[FixedPcd]
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable
|
gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable
|
||||||
|
|
Loading…
Reference in New Issue