diff options
author | Laszlo Ersek <lersek@redhat.com> | 2018-08-03 01:29:13 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2018-08-06 20:56:12 +0200 |
commit | 91a5b13650752a54cf766791aa369495c3426485 (patch) | |
tree | 22ab2f0f69fce0fde0f84359ad1cbe29786e4f7e /ShellPkg | |
parent | d3bc33731f5b039bf3df76e50cbb1f60ce697e9b (diff) | |
download | edk2-91a5b13650752a54cf766791aa369495c3426485.tar.gz edk2-91a5b13650752a54cf766791aa369495c3426485.tar.bz2 edk2-91a5b13650752a54cf766791aa369495c3426485.zip |
OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE Core
The DXE Core is one of those modules that call
ProcessLibraryConstructorList() manually.
Before DxeMain() [MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c] calls
ProcessLibraryConstructorList(), and through it, our
PlatformDebugLibIoPortConstructor() function, DxeMain() invokes the
DEBUG() macro multiple times. That macro lands in our
PlatformDebugLibIoPortFound() function -- which currently relies on the
"mDebugIoPortFound" global variable that has (not yet) been set by the
constructor. As a result, early debug messages from the DXE Core are lost.
Move the device detection into PlatformDebugLibIoPortFound(), also caching
the fact (not just the result) of the device detection.
(We could introduce a separate DebugLib instance just for the DXE Core,
but the above approach works for all modules that currently consume the
PlatformDebugLibIoPort instance (which means "everything but SEC").)
This restores messages such as:
> CoreInitializeMemoryServices:
> BaseAddress - 0x7AF21000 Length - 0x3CDE000 MinimalMemorySizeNeeded - 0x10F4000
Keep the empty constructor function -- OVMF's DebugLib instances have
always had constructors; we had better not upset constructor dependency
ordering by making our instance(s) constructor-less.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Fixes: c09d9571300a089c35f5df2773b70edc25050d0d
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
[lersek@redhat.com: sanitize blank lines around "mDebugIoPortChecked"]
Diffstat (limited to 'ShellPkg')
0 files changed, 0 insertions, 0 deletions