summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/MemDebugLogLib
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/Library/MemDebugLogLib')
-rw-r--r--OvmfPkg/Library/MemDebugLogLib/MemDebugLogPei.c29
-rw-r--r--OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiCore.c30
-rw-r--r--OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiLib.inf5
3 files changed, 24 insertions, 40 deletions
diff --git a/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPei.c b/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPei.c
index cbdab6c22f..05e32daf1c 100644
--- a/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPei.c
+++ b/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPei.c
@@ -12,9 +12,6 @@
#include <Library/QemuFwCfgSimpleParserLib.h>
#include <Library/MemDebugLogLib.h>
-EFI_PHYSICAL_ADDRESS mMemDebugLogBufAddr;
-BOOLEAN mMemDebugLogBufAddrInit;
-
EFI_STATUS
EFIAPI
MemDebugLogWrite (
@@ -22,23 +19,21 @@ MemDebugLogWrite (
IN UINTN Length
)
{
- EFI_STATUS Status;
+ EFI_PHYSICAL_ADDRESS MemDebugLogBufAddr;
+ EFI_STATUS Status;
- if (!mMemDebugLogBufAddrInit) {
- //
- // Obtain the Memory Debug Log buffer addr from HOB
- // NOTE: This is expected to fail until the HOB is created.
- //
- Status = MemDebugLogAddrFromHOB (&mMemDebugLogBufAddr);
- if (EFI_ERROR (Status)) {
- mMemDebugLogBufAddr = 0;
- } else {
- mMemDebugLogBufAddrInit = TRUE;
- }
+ //
+ // Obtain the Memory Debug Log buffer addr from HOB
+ // NOTE: This is expected to fail until the HOB is created.
+ //
+ Status = MemDebugLogAddrFromHOB (&MemDebugLogBufAddr);
+
+ if (EFI_ERROR (Status)) {
+ MemDebugLogBufAddr = 0;
}
- if (mMemDebugLogBufAddr) {
- Status = MemDebugLogWriteBuffer (mMemDebugLogBufAddr, Buffer, Length);
+ if (MemDebugLogBufAddr != 0) {
+ Status = MemDebugLogWriteBuffer (MemDebugLogBufAddr, Buffer, Length);
} else {
//
// HOB has not yet been created, so
diff --git a/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiCore.c b/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiCore.c
index 1e95d65aaa..c8de40d5c1 100644
--- a/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiCore.c
+++ b/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiCore.c
@@ -11,9 +11,6 @@
#include <Library/PeiServicesLib.h>
#include <Library/MemDebugLogLib.h>
-EFI_PHYSICAL_ADDRESS mMemDebugLogBufAddr;
-BOOLEAN mMemDebugLogBufAddrInit;
-
EFI_STATUS
EFIAPI
MemDebugLogWrite (
@@ -21,23 +18,20 @@ MemDebugLogWrite (
IN UINTN Length
)
{
- EFI_STATUS Status;
-
- if (!mMemDebugLogBufAddrInit) {
- //
- // Obtain the Memory Debug Log buffer addr from HOB
- // NOTE: This is expected to fail until the HOB is created.
- //
- Status = MemDebugLogAddrFromHOB (&mMemDebugLogBufAddr);
- if (EFI_ERROR (Status)) {
- mMemDebugLogBufAddr = 0;
- } else {
- mMemDebugLogBufAddrInit = TRUE;
- }
+ EFI_PHYSICAL_ADDRESS MemDebugLogBufAddr;
+ EFI_STATUS Status;
+
+ //
+ // Obtain the Memory Debug Log buffer addr from HOB
+ // NOTE: This is expected to fail until the HOB is created.
+ //
+ Status = MemDebugLogAddrFromHOB (&MemDebugLogBufAddr);
+ if (EFI_ERROR (Status)) {
+ MemDebugLogBufAddr = 0;
}
- if (mMemDebugLogBufAddr) {
- Status = MemDebugLogWriteBuffer (mMemDebugLogBufAddr, Buffer, Length);
+ if (MemDebugLogBufAddr != 0) {
+ Status = MemDebugLogWriteBuffer (MemDebugLogBufAddr, Buffer, Length);
} else {
//
// HOB has not yet been created, so
diff --git a/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiLib.inf b/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiLib.inf
index 18f06e45b3..b6b407c891 100644
--- a/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiLib.inf
+++ b/OvmfPkg/Library/MemDebugLogLib/MemDebugLogPeiLib.inf
@@ -29,11 +29,6 @@
[LibraryClasses]
SynchronizationLib
PcdLib
-
-[LibraryClasses.Ia32]
- QemuFwCfgSimpleParserLib
-
-[LibraryClasses.X64]
QemuFwCfgSimpleParserLib
[Guids]