From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@ml01.01.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Jordan Justen <jordan.l.justen@intel.com>,
Leif Lindholm <leif.lindholm@linaro.org>
Subject: [PATCH v2 3/6] ArmVirtPkg, OvmfPkg: QemuFwCfgLib: move DMA-related defs to lib class
Date: Fri, 2 Dec 2016 21:20:56 +0100 [thread overview]
Message-ID: <20161202202059.5061-4-lersek@redhat.com> (raw)
In-Reply-To: <20161202202059.5061-1-lersek@redhat.com>
Move the type and macro definitions related to QEMU's DMA-like fw_cfg
access method to the library class header.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
Notes:
v2:
- move definitions to lib class header rather than to a new
IndustryStandard include [Jordan]
- because ArmVirtPkg's library instance already includes the lib class
header, the code movement must be atomic and straddle both packages
- restrict patch to code movement solely; FW_CFG_F_DMA and
FW_CFG_DMA_CTL_WRITE will be added separately
OvmfPkg/Include/Library/QemuFwCfgLib.h | 19 +++++++++++++++++++
ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 20 --------------------
2 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h
index 7c29422fbd72..40a07456c530 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
diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
index 2fd8d9050566..6033a2a14c42 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
--
2.9.2
next prev parent reply other threads:[~2016-12-02 20:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-02 20:20 [PATCH v2 0/6] OvmfPkg/QemuFwCfgLib: support the DMA-like interface Laszlo Ersek
2016-12-02 20:20 ` [PATCH v2 1/6] ArmVirtPkg/QemuFwCfgLib: remove superfluous InternalQemuFwCfgIsAvailable() Laszlo Ersek
2016-12-02 20:20 ` [PATCH v2 2/6] OvmfPkg/QemuFwCfgLib: move InternalQemuFwCfgIsAvailable() to lib instances Laszlo Ersek
2016-12-02 20:20 ` Laszlo Ersek [this message]
2016-12-05 10:29 ` [PATCH v2 3/6] ArmVirtPkg, OvmfPkg: QemuFwCfgLib: move DMA-related defs to lib class Leif Lindholm
2016-12-02 20:20 ` [PATCH v2 4/6] OvmfPkg/QemuFwCfgLib: extend lib class header with more definitions Laszlo Ersek
2016-12-05 10:30 ` Leif Lindholm
2016-12-02 20:20 ` [PATCH v2 5/6] ArmVirtPkg/QemuFwCfgLib: rebase lib instance to updated lib class header Laszlo Ersek
2016-12-05 10:30 ` Leif Lindholm
2016-12-05 10:51 ` Laszlo Ersek
2016-12-02 20:20 ` [PATCH v2 6/6] OvmfPkg/QemuFwCfgLib: support QEMU's DMA-like fw_cfg access method Laszlo Ersek
2016-12-05 15:37 ` [PATCH v2 0/6] OvmfPkg/QemuFwCfgLib: support the DMA-like interface Ard Biesheuvel
2016-12-05 15:55 ` Laszlo Ersek
2016-12-05 18:28 ` Jordan Justen
2016-12-05 18:55 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161202202059.5061-4-lersek@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox