]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_SELECTOR, adapt the package
authorLaszlo Ersek <lersek@redhat.com>
Tue, 21 Feb 2017 13:43:00 +0000 (14:43 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 22 Feb 2017 02:35:43 +0000 (03:35 +0100)
Introduce the FW_CFG_IO_SELECTOR macro for IO Port 0x510 (the Selector
Register), and update all references in OvmfPkg.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
OvmfPkg/SmmControl2Dxe/SmiFeatures.c

index c7e9b5c382a58e011240978b48ea5ccad436f715..776bfe88ae2b14187ea45906f047d65b1d3d182c 100644 (file)
 #define FW_CFG_DMA_CTL_SELECT BIT3\r
 #define FW_CFG_DMA_CTL_WRITE  BIT4\r
 \r
+//\r
+// The fw_cfg registers can be found at these IO Ports, on the IO-mapped\r
+// platforms (Ia32 and X64).\r
+//\r
+#define FW_CFG_IO_SELECTOR    0x510\r
+\r
 //\r
 // Numerically defined keys.\r
 //\r
index 7744873217fe8bbbb8826afa6d696bcb7b87be35..1387ea85f3f08cf14d329111947c13842b694c24 100644 (file)
@@ -42,7 +42,7 @@ QemuFwCfgSelectItem (
   )\r
 {\r
   DEBUG ((EFI_D_INFO, "Select Item: 0x%x\n", (UINT16)(UINTN) QemuFwCfgItem));\r
-  IoWrite16 (0x510, (UINT16)(UINTN) QemuFwCfgItem);\r
+  IoWrite16 (FW_CFG_IO_SELECTOR, (UINT16)(UINTN) QemuFwCfgItem);\r
 }\r
 \r
 \r
index e070969065c0f11fd4bb59cb1206c6afef1c780e..352ffa01737348bd1e426334a5370ef604556885 100644 (file)
@@ -281,7 +281,7 @@ SaveSmiFeatures (
                           S3SaveState,                     // This\r
                           EFI_BOOT_SCRIPT_IO_WRITE_OPCODE, // OpCode\r
                           EfiBootScriptWidthUint16,        // Width\r
-                          (UINT64)0x510,                   // Address\r
+                          (UINT64)FW_CFG_IO_SELECTOR,      // Address\r
                           (UINTN)1,                        // Count\r
                           &FeaturesOkItemAsUint16          // Buffer\r
                           );\r