mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
OvmfPkg/MemDebugLogLib: unoptimize PEIM and PEI_CORE
In AARCH64, the PEI phase runs from the flash memory, therefore global variables are not allowed. Remove this optimization so that this library can be used for this architecture. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
This commit is contained in:
parent
4b041f09d6
commit
839e79f62b
2 changed files with 23 additions and 34 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue