TianoCore EDK2 master
Loading...
Searching...
No Matches
QemuFwCfgPei.c File Reference
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include <Library/IoLib.h>
#include <Library/PlatformInitLib.h>
#include <Library/QemuFwCfgLib.h>
#include <WorkArea.h>
#include "QemuFwCfgLibInternal.h"

Go to the source code of this file.

Functions

STATIC BOOLEAN QemuFwCfgIsCcGuest (VOID)
 
BOOLEAN EFIAPI QemuFwCfgIsAvailable (VOID)
 
STATIC VOID QemuFwCfgProbe (BOOLEAN *Supported, BOOLEAN *DmaSupported)
 
STATIC EFI_HOB_PLATFORM_INFOQemuFwCfgGetPlatformInfo (VOID)
 
RETURN_STATUS EFIAPI QemuFwCfgInitialize (VOID)
 
BOOLEAN InternalQemuFwCfgIsAvailable (VOID)
 
BOOLEAN InternalQemuFwCfgDmaIsAvailable (VOID)
 
VOID InternalQemuFwCfgDmaBytes (IN UINT32 Size, IN OUT VOID *Buffer OPTIONAL, IN UINT32 Control)
 

Detailed Description

Stateful and implicitly initialized fw_cfg library implementation.

Copyright (C) 2013, Red Hat, Inc. Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
Copyright (c) 2017, Advanced Micro Devices. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file QemuFwCfgPei.c.

Function Documentation

◆ InternalQemuFwCfgDmaBytes()

VOID InternalQemuFwCfgDmaBytes ( IN UINT32  Size,
IN OUT VOID *Buffer  OPTIONAL,
IN UINT32  Control 
)

Transfer an array of bytes, or skip a number of bytes, using the DMA interface.

Parameters
[in]SizeSize in bytes to transfer or skip.
[in,out]BufferBuffer to read data into or write data from. Ignored, and may be NULL, if Size is zero, or Control is FW_CFG_DMA_CTL_SKIP.
[in]ControlOne of the following: FW_CFG_DMA_CTL_WRITE - write to fw_cfg from Buffer. FW_CFG_DMA_CTL_READ - read from fw_cfg into Buffer. FW_CFG_DMA_CTL_SKIP - skip bytes in fw_cfg.

Definition at line 184 of file QemuFwCfgPei.c.

◆ InternalQemuFwCfgDmaIsAvailable()

BOOLEAN InternalQemuFwCfgDmaIsAvailable ( VOID  )

Returns a boolean indicating whether QEMU provides the DMA-like access method for fw_cfg.

Return values
TRUEThe DMA-like access method is available.
FALSEThe DMA-like access method is unavailable.

Definition at line 159 of file QemuFwCfgPei.c.

◆ InternalQemuFwCfgIsAvailable()

BOOLEAN InternalQemuFwCfgIsAvailable ( VOID  )

Returns a boolean indicating if the firmware configuration interface is available for library-internal purposes.

This function never changes fw_cfg state.

Return values
TRUEThe interface is available internally.
FALSEThe interface is not available internally.

Definition at line 142 of file QemuFwCfgPei.c.

◆ QemuFwCfgGetPlatformInfo()

STATIC EFI_HOB_PLATFORM_INFO * QemuFwCfgGetPlatformInfo ( VOID  )

Definition at line 98 of file QemuFwCfgPei.c.

◆ QemuFwCfgInitialize()

RETURN_STATUS EFIAPI QemuFwCfgInitialize ( VOID  )

Definition at line 125 of file QemuFwCfgPei.c.

◆ QemuFwCfgIsAvailable()

BOOLEAN EFIAPI QemuFwCfgIsAvailable ( VOID  )

Returns a boolean indicating if the firmware configuration interface is available or not.

This function may change fw_cfg state.

Return values
TRUEThe interface is available
FALSEThe interface is not available

Definition at line 53 of file QemuFwCfgPei.c.

◆ QemuFwCfgIsCcGuest()

STATIC BOOLEAN QemuFwCfgIsCcGuest ( VOID  )

Check if it is Tdx guest

Return values
TRUEIt is Tdx guest
FALSEIt is not Tdx guest

Definition at line 31 of file QemuFwCfgPei.c.

◆ QemuFwCfgProbe()

STATIC VOID QemuFwCfgProbe ( BOOLEAN *  Supported,
BOOLEAN *  DmaSupported 
)

Definition at line 62 of file QemuFwCfgPei.c.