TianoCore EDK2 master
Loading...
Searching...
No Matches
QemuFwCfgDxe.c File Reference

Go to the source code of this file.

Functions

BOOLEAN EFIAPI QemuFwCfgIsAvailable (VOID)
 
RETURN_STATUS EFIAPI QemuFwCfgInitialize (VOID)
 
BOOLEAN InternalQemuFwCfgIsAvailable (VOID)
 
BOOLEAN InternalQemuFwCfgDmaIsAvailable (VOID)
 
STATIC VOID AllocFwCfgDmaAccessBuffer (OUT VOID **Access, OUT VOID **MapInfo)
 
STATIC VOID FreeFwCfgDmaAccessBuffer (IN VOID *Access, IN VOID *Mapping)
 
STATIC VOID MapFwCfgDmaDataBuffer (IN BOOLEAN IsWrite, IN VOID *HostAddress, IN UINT32 Size, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **MapInfo)
 
STATIC VOID UnmapFwCfgDmaDataBuffer (IN VOID *Mapping)
 
VOID InternalQemuFwCfgDmaBytes (IN UINT32 Size, IN OUT VOID *Buffer OPTIONAL, IN UINT32 Control)
 

Variables

STATIC BOOLEAN mQemuFwCfgSupported = FALSE
 
STATIC BOOLEAN mQemuFwCfgDmaSupported
 
STATIC EDKII_IOMMU_PROTOCOLmIoMmuProtocol
 

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 QemuFwCfgDxe.c.

Function Documentation

◆ AllocFwCfgDmaAccessBuffer()

STATIC VOID AllocFwCfgDmaAccessBuffer ( OUT VOID **  Access,
OUT VOID **  MapInfo 
)

Function is used for allocating a bi-directional FW_CFG_DMA_ACCESS used between Host and device to exchange the information. The buffer must be free'd using FreeFwCfgDmaAccessBuffer ().

Definition at line 156 of file QemuFwCfgDxe.c.

◆ FreeFwCfgDmaAccessBuffer()

STATIC VOID FreeFwCfgDmaAccessBuffer ( IN VOID *  Access,
IN VOID *  Mapping 
)

Function is to used for freeing the Access buffer allocated using AllocFwCfgDmaAccessBuffer()

Definition at line 250 of file QemuFwCfgDxe.c.

◆ 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 387 of file QemuFwCfgDxe.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 141 of file QemuFwCfgDxe.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 126 of file QemuFwCfgDxe.c.

◆ MapFwCfgDmaDataBuffer()

STATIC VOID MapFwCfgDmaDataBuffer ( IN BOOLEAN  IsWrite,
IN VOID *  HostAddress,
IN UINT32  Size,
OUT EFI_PHYSICAL_ADDRESS DeviceAddress,
OUT VOID **  MapInfo 
)

Function is used for mapping host address to device address. The buffer must be unmapped with UnmapDmaDataBuffer ().

Definition at line 294 of file QemuFwCfgDxe.c.

◆ QemuFwCfgInitialize()

RETURN_STATUS EFIAPI QemuFwCfgInitialize ( VOID  )

Definition at line 53 of file QemuFwCfgDxe.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 44 of file QemuFwCfgDxe.c.

◆ UnmapFwCfgDmaDataBuffer()

STATIC VOID UnmapFwCfgDmaDataBuffer ( IN VOID *  Mapping)

Definition at line 351 of file QemuFwCfgDxe.c.

Variable Documentation

◆ mIoMmuProtocol

STATIC EDKII_IOMMU_PROTOCOL* mIoMmuProtocol

Definition at line 30 of file QemuFwCfgDxe.c.

◆ mQemuFwCfgDmaSupported

STATIC BOOLEAN mQemuFwCfgDmaSupported

Definition at line 28 of file QemuFwCfgDxe.c.

◆ mQemuFwCfgSupported

STATIC BOOLEAN mQemuFwCfgSupported = FALSE

Definition at line 27 of file QemuFwCfgDxe.c.