OvmfPkg: Add the way of HOBs in QemuFwCfgLibMmio
Added the HOB methods to load and store the QEMU firmware configure address, data address and DMA address, which are not enabled during the DXE stage. Build-tested only (with "ArmVirtQemu.dsc and RiscVVirtQemu.dsc"). BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4755 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Cc: Andrei Warkentin <andrei.warkentin@intel.com> Signed-off-by: Chao Li <lichao@loongson.cn>
This commit is contained in:
@@ -12,9 +12,11 @@
|
||||
#ifndef QEMU_FW_CFG_LIB_MMIO_INTERNAL_H_
|
||||
#define QEMU_FW_CFG_LIB_MMIO_INTERNAL_H_
|
||||
|
||||
extern UINTN mFwCfgSelectorAddress;
|
||||
extern UINTN mFwCfgDataAddress;
|
||||
extern UINTN mFwCfgDmaAddress;
|
||||
typedef struct {
|
||||
UINTN FwCfgSelectorAddress;
|
||||
UINTN FwCfgDataAddress;
|
||||
UINTN FwCfgDmaAddress;
|
||||
} QEMU_FW_CFG_RESOURCE;
|
||||
|
||||
/**
|
||||
Reads firmware configuration bytes into a buffer
|
||||
@@ -90,6 +92,69 @@ VOID (EFIAPI *InternalQemuFwCfgSkipBytes)(
|
||||
IN UINTN Size
|
||||
);
|
||||
|
||||
/**
|
||||
Build firmware configure resource HOB.
|
||||
|
||||
@param[in] FwCfgResource A pointer to firmware configure resource.
|
||||
|
||||
@retval NULL
|
||||
**/
|
||||
VOID
|
||||
QemuBuildFwCfgResourceHob (
|
||||
IN QEMU_FW_CFG_RESOURCE *FwCfgResource
|
||||
);
|
||||
|
||||
/**
|
||||
Get firmware configure resource HOB.
|
||||
|
||||
@param VOID
|
||||
|
||||
@retval FwCfgResource The firmware configure resouce in HOB.
|
||||
**/
|
||||
QEMU_FW_CFG_RESOURCE *
|
||||
QemuGetFwCfgResourceHob (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
To get firmware configure selector address.
|
||||
|
||||
@param VOID
|
||||
|
||||
@retval firmware configure selector address
|
||||
**/
|
||||
UINTN
|
||||
EFIAPI
|
||||
QemuGetFwCfgSelectorAddress (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
To get firmware configure Data address.
|
||||
|
||||
@param VOID
|
||||
|
||||
@retval firmware configure data address
|
||||
**/
|
||||
UINTN
|
||||
EFIAPI
|
||||
QemuGetFwCfgDataAddress (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
To get firmware DMA address.
|
||||
|
||||
@param VOID
|
||||
|
||||
@retval firmware DMA address
|
||||
**/
|
||||
UINTN
|
||||
EFIAPI
|
||||
QemuGetFwCfgDmaAddress (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Slow READ_BYTES_FUNCTION.
|
||||
**/
|
||||
|
Reference in New Issue
Block a user