mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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>
52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
/** @file
|
|
*
|
|
Memory Debug Log Library - PEI Core
|
|
|
|
Copyright (C) 2025, Oracle and/or its affiliates.
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
**/
|
|
|
|
#include <PiPei.h>
|
|
#include <Library/PeiServicesLib.h>
|
|
#include <Library/MemDebugLogLib.h>
|
|
|
|
EFI_STATUS
|
|
EFIAPI
|
|
MemDebugLogWrite (
|
|
IN CHAR8 *Buffer,
|
|
IN UINTN Length
|
|
)
|
|
{
|
|
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 (MemDebugLogBufAddr != 0) {
|
|
Status = MemDebugLogWriteBuffer (MemDebugLogBufAddr, Buffer, Length);
|
|
} else {
|
|
//
|
|
// HOB has not yet been created, so
|
|
// write to the early debug log buffer.
|
|
//
|
|
if (FixedPcdGet32 (PcdOvmfEarlyMemDebugLogBase) != 0x0) {
|
|
Status = MemDebugLogWriteBuffer (
|
|
(EFI_PHYSICAL_ADDRESS)(UINTN)FixedPcdGet32 (PcdOvmfEarlyMemDebugLogBase),
|
|
Buffer,
|
|
Length
|
|
);
|
|
} else {
|
|
Status = EFI_NOT_FOUND;
|
|
}
|
|
}
|
|
|
|
return Status;
|
|
}
|