diff options
author | Laszlo Ersek <lersek@redhat.com> | 2015-10-26 14:58:33 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-10-26 14:58:33 +0000 |
commit | 109301e5a14ec4bfd0ce93e15439e30d7ccd8b0a (patch) | |
tree | f0e7213febb77cdd4628ea460292aca6593d5112 /OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h | |
parent | f97a5b5e4cab1f01f92a0899cc95b92c5a9f3ed3 (diff) | |
download | edk2-109301e5a14ec4bfd0ce93e15439e30d7ccd8b0a.tar.gz edk2-109301e5a14ec4bfd0ce93e15439e30d7ccd8b0a.tar.bz2 edk2-109301e5a14ec4bfd0ce93e15439e30d7ccd8b0a.zip |
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: no dual addressing needed
Currently the EFI_FW_VOL_INSTANCE and ESAL_FWB_GLOBAL structures declare
the following entries as arrays, with two entries each:
- EFI_FW_VOL_INSTANCE.FvBase[2]
- ESAL_FWB_GLOBAL.FvInstance[2]
In every case, the entry at subscript zero is meant as "physical address",
while the entry at subscript one is meant as "virtual address" -- a
pointer to the same object. The virtual address entry is originally
initialized to the physical address, and then it is converted to the
virtual mapping in FvbVirtualddressChangeEvent().
Functions that (a) read the listed fields and (b) run both before and
after the virtual address change event -- since this is a runtime DXE
driver -- derive the correct array subscript by calling the
EfiGoneVirtual() function from UefiRuntimeLib.
The problem with the above infrastructure is that it's entirely
superfluous.
EfiGoneVirtual() "knows" whether EFI has gone virtual only because the
UefiRuntimeLib constructor registers the exact same kind of virtual
address change callback, and the callback flips a static variabe to TRUE,
and EfiGoneVirtual() queries that static variable.
In effect this means for QemuFlashFvbServicesRuntimeDxe: "when there is a
virtual address change, convert the entries with subscript one from
physical to virtual, and from then on use the entries with subscript one".
This would only make sense if QemuFlashFvbServicesRuntimeDxe ever needed
the original (physical) addresses (ie. the entries with subscript zero)
after the virtual address change, but that is not the case.
Replace the arrays with single elements. The subscript zero elements
simply disappear, and the single elements take the role of the prior
subscript one elements.
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@18670 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h')
0 files changed, 0 insertions, 0 deletions