audk/OvmfPkg/SmmAccess
Laszlo Ersek 1372f8d347 OvmfPkg/SmmAccess: prepare for PcdQ35TsegMbytes becoming dynamic
In one of the next patches we'll turn PcdQ35TsegMbytes into a dynamic PCD,
to be set by PlatformPei.

Jordan suggested to use gEfiPeiMemoryDiscoveredPpiGuid as SmmAccessPei's
DEPEX for making sure that PlatformPei sets the PCD before SmmAccessPei
consumes it. (PlatformPei installs the permanent PEI RAM.) Such a DEPEX is
supposed to mirror physical firmware, where anything related to SMRAM
cannot run before said platform's physical RAM is discovered (signaled by
the presence of gEfiPeiMemoryDiscoveredPpiGuid).

Introduce the InitQ35TsegMbytes() function and the "mQ35TsegMbytes" extern
variable to "SmramInternal.h" and "SmramInternal.c":

- Both SmmAccess modules (PEIM and DXE driver) are supposed to call
  InitQ35TsegMbytes() in their respective entry point functions, saving
  PcdQ35TsegMbytes into "mQ35TsegMbytes". This way dynamic PCD fetches can
  be kept out of PEI_SMM_ACCESS_PPI and EFI_SMM_ACCESS2_PROTOCOL member
  functions later (when we add support for extended TSEG size).

- We can thus replace the current PcdQ35TsegMbytes fetches in
  SmmAccessPei's entry point function as well, with reads from
  "mQ35TsegMbytes".

Cc: Jordan Justen <jordan.l.justen@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>
2017-07-05 22:25:03 +02:00
..
SmmAccess2Dxe.c OvmfPkg/SmmAccess: prepare for PcdQ35TsegMbytes becoming dynamic 2017-07-05 22:25:03 +02:00
SmmAccess2Dxe.inf OvmfPkg/SmmAccess: prepare for PcdQ35TsegMbytes becoming dynamic 2017-07-05 22:25:03 +02:00
SmmAccessPei.c OvmfPkg/SmmAccess: prepare for PcdQ35TsegMbytes becoming dynamic 2017-07-05 22:25:03 +02:00
SmmAccessPei.inf OvmfPkg/SmmAccess: prepare for PcdQ35TsegMbytes becoming dynamic 2017-07-05 22:25:03 +02:00
SmramInternal.c OvmfPkg/SmmAccess: prepare for PcdQ35TsegMbytes becoming dynamic 2017-07-05 22:25:03 +02:00
SmramInternal.h OvmfPkg/SmmAccess: prepare for PcdQ35TsegMbytes becoming dynamic 2017-07-05 22:25:03 +02:00