]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: make PcdPropertiesTableEnable dynamic
authorLaszlo Ersek <lersek@redhat.com>
Tue, 15 Sep 2015 08:35:08 +0000 (08:35 +0000)
committerlersek <lersek@Edk2>
Tue, 15 Sep 2015 08:35:08 +0000 (08:35 +0000)
Since PcdPropertiesTableEnable is used by the DXE Core (in the
InstallPropertiesTable() function, which runs at End-of-Dxe), we must also
change the PcdLib class resolution for that module, from the default
BasePcdLibNull to DxePcdLib.

Traditionally we've considered the DXE Core to be incapable of accessing
dynamic PCDs -- the PCD PPI is not available any longer to the DXE Core,
and the PCD Protocol is not available to it *yet*. There are exceptions
however: if the DXE Core can ensure, by whatever means, that the PCD
Protocol *is* available, then DxePcdLib will just work (the latter even
lists DXE_CORE as an allowed client module type). Namely, DxePcdLib looks
up the PCD Protocol dynamically, on the first library call that actually
needs it (for accessing a dynamic PCD); the lookup doesn't occur in a
library constructor.

And because the DXE Core fetches PcdPropertiesTableEnable at End-of-Dxe,
the PCD Protocol is definitely available then.

In addition, we change the default value of PcdPropertiesTableEnable from
the inherited TRUE to FALSE. It makes no difference at this point (our
runtime DXE drivers are not built with the required 4KB section alignment
anyway), but it's better to be clear about this. The properties table
feature requires OS compatibility, and it breaks Windows 7 minimally.
Therefore the default should be FALSE.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
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@18470 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

index 0b873f62b6c162a55ab9dbf57c974fc302df3011..026b49c5ecc0e00232dd5d56ef7bc1c22c81d4ab 100644 (file)
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf\r
 !endif\r
   CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 \r
   # Noexec settings for DXE.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|TRUE\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPropertiesTableEnable|FALSE\r
 \r
 ################################################################################\r
 #\r
index 0017b46f20384443d1ef952670151636137aa3f9..a44dc82d9352bf415347883ffc69e73967afba68 100644 (file)
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf\r
 !endif\r
   CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 \r
   # Noexec settings for DXE.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|TRUE\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPropertiesTableEnable|FALSE\r
 \r
 ################################################################################\r
 #\r
index 5850b61b3823a91e2c5f5b4af1f260faf13a66fe..47ebf8b446f215e15580d710ea7f0af0afe65b41 100644 (file)
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf\r
 !endif\r
   CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 \r
   # Noexec settings for DXE.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|TRUE\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPropertiesTableEnable|FALSE\r
 \r
 ################################################################################\r
 #\r