]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Include/Library/QemuFwCfgLib.h
ArmVirtPkg, OvmfPkg: QemuFwCfgLib: move DMA-related defs to lib class
[mirror_edk2.git] / OvmfPkg / Include / Library / QemuFwCfgLib.h
index 2519fc297f5ce36a543bee9ee0ca624564e8f4b3..40a07456c5308ebc699cf9eddad8485ea0919368 100644 (file)
 #ifndef __FW_CFG_LIB__\r
 #define __FW_CFG_LIB__\r
 \r
+//\r
+// The size, in bytes, of names of firmware configuration files, including at\r
+// least one terminating NUL byte.\r
+//\r
+#define QEMU_FW_CFG_FNAME_SIZE 56\r
+\r
+//\r
+// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding).\r
+//\r
+#define FW_CFG_DMA_CTL_ERROR  BIT0\r
+#define FW_CFG_DMA_CTL_READ   BIT1\r
+#define FW_CFG_DMA_CTL_SKIP   BIT2\r
+#define FW_CFG_DMA_CTL_SELECT BIT3\r
+\r
 typedef enum {\r
   QemuFwCfgItemSignature            = 0x0000,\r
   QemuFwCfgItemInterfaceVersion     = 0x0001,\r
@@ -53,6 +67,17 @@ typedef enum {
 \r
 } FIRMWARE_CONFIG_ITEM;\r
 \r
+//\r
+// Communication structure for the DMA access method. All fields are encoded in\r
+// big endian.\r
+//\r
+#pragma pack (1)\r
+typedef struct {\r
+  UINT32 Control;\r
+  UINT32 Length;\r
+  UINT64 Address;\r
+} FW_CFG_DMA_ACCESS;\r
+#pragma pack ()\r
 \r
 /**\r
   Returns a boolean indicating if the firmware configuration interface\r
@@ -200,17 +225,15 @@ QemuFwCfgFindFile (
 \r
 \r
 /**\r
-  Returns a boolean indicating if the firmware configuration interface is\r
-  available for library-internal purposes.\r
-\r
-  This function never changes fw_cfg state.\r
+  Determine if S3 support is explicitly enabled.\r
 \r
-  @retval    TRUE   The interface is available internally.\r
-  @retval    FALSE  The interface is not available internally.\r
+  @retval  TRUE   if S3 support is explicitly enabled.\r
+           FALSE  otherwise. This includes unavailability of the firmware\r
+                  configuration interface.\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
-InternalQemuFwCfgIsAvailable (\r
+QemuFwCfgS3Enabled (\r
   VOID\r
   );\r
 \r