summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OvmfPkg/Include/IndustryStandard/QemuFwCfg.h6
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c2
-rw-r--r--OvmfPkg/SmmControl2Dxe/SmiFeatures.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
index c7e9b5c382..776bfe88ae 100644
--- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
+++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
@@ -43,6 +43,12 @@
#define FW_CFG_DMA_CTL_WRITE BIT4
//
+// The fw_cfg registers can be found at these IO Ports, on the IO-mapped
+// platforms (Ia32 and X64).
+//
+#define FW_CFG_IO_SELECTOR 0x510
+
+//
// Numerically defined keys.
//
typedef enum {
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
index 7744873217..1387ea85f3 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
@@ -42,7 +42,7 @@ QemuFwCfgSelectItem (
)
{
DEBUG ((EFI_D_INFO, "Select Item: 0x%x\n", (UINT16)(UINTN) QemuFwCfgItem));
- IoWrite16 (0x510, (UINT16)(UINTN) QemuFwCfgItem);
+ IoWrite16 (FW_CFG_IO_SELECTOR, (UINT16)(UINTN) QemuFwCfgItem);
}
diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c
index e070969065..352ffa0173 100644
--- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c
+++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c
@@ -281,7 +281,7 @@ SaveSmiFeatures (
S3SaveState, // This
EFI_BOOT_SCRIPT_IO_WRITE_OPCODE, // OpCode
EfiBootScriptWidthUint16, // Width
- (UINT64)0x510, // Address
+ (UINT64)FW_CFG_IO_SELECTOR, // Address
(UINTN)1, // Count
&FeaturesOkItemAsUint16 // Buffer
);