edk2/OvmfPkg/Library/MemDebugLogLib/MemDebugLogNull.c
Luigi Leonardi e59458b658 OvmfPkg/MemDebugLogLib: Add MemDebugLogInit/Copy stubs to Null instance
The Null instance of MemDebugLogLib only provides MemDebugLogWrite(),
MemDebugLogPages(), and MemDebugLogEnabled(). Any module that
references MemDebugLogInit() or MemDebugLogCopy() cannot link against
the Null instance, forcing the feature to be gated at the build-system
level rather than at runtime.

Add no-op stubs for MemDebugLogInit() and MemDebugLogCopy().

This will be used by the following commit to add memory debug log
support in TDX.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2026-07-22 09:00:42 +00:00

60 lines
842 B
C

/** @file
*
Memory Debug Log Library - Null.
Copyright (C) 2025, Oracle and/or its affiliates.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Library/MemDebugLogLib.h>
EFI_STATUS
EFIAPI
MemDebugLogWrite (
IN CHAR8 *Buffer,
IN UINTN Length
)
{
// Null Instance - NOP
return EFI_SUCCESS;
}
UINT32
EFIAPI
MemDebugLogPages (
VOID
)
{
return 0;
}
BOOLEAN
EFIAPI
MemDebugLogEnabled (
VOID
)
{
return FALSE;
}
EFI_STATUS
EFIAPI
MemDebugLogInit (
IN EFI_PHYSICAL_ADDRESS MemDebugLogBufAddr,
IN UINT32 MemDebugLogBufSize
)
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
MemDebugLogCopy (
IN EFI_PHYSICAL_ADDRESS MemDebugLogBufDestAddr,
IN EFI_PHYSICAL_ADDRESS MemDebugLogBufSrcAddr
)
{
return EFI_SUCCESS;
}