diff options
author | Laszlo Ersek <lersek@redhat.com> | 2017-02-21 14:43:00 +0100 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2017-02-22 03:35:45 +0100 |
commit | 509e6b5a034f0e121c6de9bedd08532bf54cc4f7 (patch) | |
tree | c7b90da1c2da4183792eb0183ab0f74e9fffea92 | |
parent | 21ca2f28e6c5e006820956d7d56150184faeef85 (diff) | |
download | edk2-509e6b5a034f0e121c6de9bedd08532bf54cc4f7.zip edk2-509e6b5a034f0e121c6de9bedd08532bf54cc4f7.tar.gz edk2-509e6b5a034f0e121c6de9bedd08532bf54cc4f7.tar.bz2 |
OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_DATA, adapt the package
Introduce the FW_CFG_IO_DATA macro for IO Port 0x511 (the Data 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>
-rw-r--r-- | OvmfPkg/Include/IndustryStandard/QemuFwCfg.h | 1 | ||||
-rw-r--r-- | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 6 | ||||
-rw-r--r-- | OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h index 776bfe8..5da6b45 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h @@ -47,6 +47,7 @@ // platforms (Ia32 and X64).
//
#define FW_CFG_IO_SELECTOR 0x510
+#define FW_CFG_IO_DATA 0x511
//
// Numerically defined keys.
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index 1387ea8..d79d0a4 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -135,7 +135,7 @@ InternalQemuFwCfgReadBytes ( InternalQemuFwCfgDmaBytes ((UINT32)Size, Buffer, FW_CFG_DMA_CTL_READ);
return;
}
- IoReadFifo8 (0x511, Size, Buffer);
+ IoReadFifo8 (FW_CFG_IO_DATA, Size, Buffer);
}
@@ -187,7 +187,7 @@ QemuFwCfgWriteBytes ( InternalQemuFwCfgDmaBytes ((UINT32)Size, Buffer, FW_CFG_DMA_CTL_WRITE);
return;
}
- IoWriteFifo8 (0x511, Size, Buffer);
+ IoWriteFifo8 (FW_CFG_IO_DATA, Size, Buffer);
}
}
@@ -230,7 +230,7 @@ QemuFwCfgSkipBytes ( //
while (Size > 0) {
ChunkSize = MIN (Size, sizeof SkipBuffer);
- IoReadFifo8 (0x511, ChunkSize, SkipBuffer);
+ IoReadFifo8 (FW_CFG_IO_DATA, ChunkSize, SkipBuffer);
Size -= ChunkSize;
}
}
diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c index 352ffa0..73c2984 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -303,7 +303,7 @@ SaveSmiFeatures ( S3SaveState, // This
EFI_BOOT_SCRIPT_IO_POLL_OPCODE, // OpCode
EfiBootScriptWidthUint8, // Width
- (UINT64)(UINTN)0x511, // Address
+ (UINT64)(UINTN)FW_CFG_IO_DATA, // Address
&FeaturesOkData, // Data
&FeaturesOkMask, // DataMask
MAX_UINT64 // Delay
|