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>
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2\r
!endif\r
\r
+ #\r
+ # The NumberOfPages values below are ad-hoc. They are updated sporadically at\r
+ # best (please refer to git-blame for past updates). The values capture a set\r
+ # of BIN hints that made sense at a particular time, for some (now likely\r
+ # unknown) workloads / boot paths.\r
+ #\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x4\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x8\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x4\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x30\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x24\r
+\r
#\r
# Network Pcds\r
#\r
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2\r
!endif\r
\r
+[PcdsFixedAtBuild.IA32]\r
+ #\r
+ # The NumberOfPages values below are ad-hoc. They are updated sporadically at\r
+ # best (please refer to git-blame for past updates). The values capture a set\r
+ # of BIN hints that made sense at a particular time, for some (now likely\r
+ # unknown) workloads / boot paths.\r
+ #\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x4\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x8\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x4\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x30\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x24\r
+\r
[PcdsFixedAtBuild.X64]\r
#\r
# Network Pcds\r
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2\r
!endif\r
\r
+ #\r
+ # The NumberOfPages values below are ad-hoc. They are updated sporadically at\r
+ # best (please refer to git-blame for past updates). The values capture a set\r
+ # of BIN hints that made sense at a particular time, for some (now likely\r
+ # unknown) workloads / boot paths.\r
+ #\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x4\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x8\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x4\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x30\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x24\r
+\r
#\r
# Network Pcds\r
#\r
\r
#include "Platform.h"\r
\r
-//\r
-// The NumberOfPages values below are ad-hoc. They are updated sporadically at\r
-// best (please refer to git-blame for past updates). The values capture a set\r
-// of BIN hints that made sense at a particular time, for some (now likely\r
-// unknown) workloads / boot paths.\r
-//\r
+#define MEMORY_TYPE_INFO_DEFAULT(Type) \\r
+ { Type, FixedPcdGet32 (PcdMemoryType ## Type) }\r
+\r
STATIC EFI_MEMORY_TYPE_INFORMATION mMemoryTypeInformation[] = {\r
- { EfiACPIMemoryNVS, 0x004 },\r
- { EfiACPIReclaimMemory, 0x008 },\r
- { EfiReservedMemoryType, 0x004 },\r
- { EfiRuntimeServicesData, 0x024 },\r
- { EfiRuntimeServicesCode, 0x030 },\r
- { EfiMaxMemoryType, 0x000 }\r
+ MEMORY_TYPE_INFO_DEFAULT (EfiACPIMemoryNVS),\r
+ MEMORY_TYPE_INFO_DEFAULT (EfiACPIReclaimMemory),\r
+ MEMORY_TYPE_INFO_DEFAULT (EfiReservedMemoryType),\r
+ MEMORY_TYPE_INFO_DEFAULT (EfiRuntimeServicesCode),\r
+ MEMORY_TYPE_INFO_DEFAULT (EfiRuntimeServicesData),\r
+ { EfiMaxMemoryType, 0 }\r
};\r
\r
STATIC\r
Xen.h\r
\r
[Packages]\r
+ EmbeddedPkg/EmbeddedPkg.dec\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
SecurityPkg/SecurityPkg.dec\r
\r
[FixedPcd]\r
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode\r
+ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData\r
\r
[FeaturePcd]\r
gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable\r