Files
system76-edk2/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
Rebecca Cran 8ba392687b OvmfPkg: Update code to be more C11 compliant by using __func__
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

Since it's more standard, replace __FUNCTION__ with __func__ throughout
OvmfPkg.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2023-04-10 14:19:57 +00:00

66 lines
1.3 KiB
C

/** @file
*
* Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
#include <PiPei.h>
#include <Library/PrePiHobListPointerLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include <Library/BaseRiscVSbiLib.h>
/**
Returns the pointer to the HOB list.
This function returns the pointer to first HOB in the list.
@return The pointer to the HOB list.
**/
VOID *
EFIAPI
PrePeiGetHobList (
VOID
)
{
EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContext;
FirmwareContext = NULL;
GetFirmwareContextPointer (&FirmwareContext);
if (FirmwareContext == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
return NULL;
}
return (VOID *)FirmwareContext->PrePiHobList;
}
/**
Updates the pointer to the HOB list.
@param HobList Hob list pointer to store
**/
EFI_STATUS
EFIAPI
PrePeiSetHobList (
IN VOID *HobList
)
{
EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContext;
FirmwareContext = NULL;
GetFirmwareContextPointer (&FirmwareContext);
if (FirmwareContext == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
return EFI_NOT_READY;
}
FirmwareContext->PrePiHobList = HobList;
return EFI_SUCCESS;
}