From de01f72cc77d58162cb3ba7cd06f931fc9d13822 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 30 Nov 2016 11:35:00 +0100 Subject: [PATCH] ArmVirtPkg, OvmfPkg: QemuFwCfgLib: move DMA-related defs to lib class Move the type and macro definitions related to QEMU's DMA-like fw_cfg access method to the library class header. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Leif Lindholm Reviewed-by: Ard Biesheuvel Reviewed-by: Jordan Justen --- .../Library/QemuFwCfgLib/QemuFwCfgLib.c | 20 ------------------- OvmfPkg/Include/Library/QemuFwCfgLib.h | 19 ++++++++++++++++++ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index 2fd8d90505..6033a2a14c 100644 --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -53,26 +53,6 @@ STATIC READ_BYTES_FUNCTION DmaReadBytes; // STATIC READ_BYTES_FUNCTION *InternalQemuFwCfgReadBytes = MmioReadBytes; -// -// Communication structure for DmaReadBytes(). All fields are encoded in big -// endian. -// -#pragma pack (1) -typedef struct { - UINT32 Control; - UINT32 Length; - UINT64 Address; -} FW_CFG_DMA_ACCESS; -#pragma pack () - -// -// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding). -// -#define FW_CFG_DMA_CTL_ERROR BIT0 -#define FW_CFG_DMA_CTL_READ BIT1 -#define FW_CFG_DMA_CTL_SKIP BIT2 -#define FW_CFG_DMA_CTL_SELECT BIT3 - /** Returns a boolean indicating if the firmware configuration interface diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h index 7c29422fbd..40a07456c5 100644 --- a/OvmfPkg/Include/Library/QemuFwCfgLib.h +++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h @@ -23,6 +23,14 @@ // #define QEMU_FW_CFG_FNAME_SIZE 56 +// +// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding). +// +#define FW_CFG_DMA_CTL_ERROR BIT0 +#define FW_CFG_DMA_CTL_READ BIT1 +#define FW_CFG_DMA_CTL_SKIP BIT2 +#define FW_CFG_DMA_CTL_SELECT BIT3 + typedef enum { QemuFwCfgItemSignature = 0x0000, QemuFwCfgItemInterfaceVersion = 0x0001, @@ -59,6 +67,17 @@ typedef enum { } FIRMWARE_CONFIG_ITEM; +// +// Communication structure for the DMA access method. All fields are encoded in +// big endian. +// +#pragma pack (1) +typedef struct { + UINT32 Control; + UINT32 Length; + UINT64 Address; +} FW_CFG_DMA_ACCESS; +#pragma pack () /** Returns a boolean indicating if the firmware configuration interface -- 2.39.2