summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Include/Library/QemuFwCfgLib.h
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2017-01-27 06:35:41 +0100
committerLaszlo Ersek <lersek@redhat.com>2017-01-31 00:14:35 +0100
commitfcca9f67fb81e77b2c76315bd26160772090fd75 (patch)
tree5f3fe0709e3207425713d79bba03bc3b6d5a05ef /OvmfPkg/Include/Library/QemuFwCfgLib.h
parentd055601ea7dc7cc09338445188ba18482365c2a1 (diff)
downloadedk2-fcca9f67fb81e77b2c76315bd26160772090fd75.tar.gz
edk2-fcca9f67fb81e77b2c76315bd26160772090fd75.tar.bz2
edk2-fcca9f67fb81e77b2c76315bd26160772090fd75.zip
OvmfPkg/QemuFwCfgLib: add QemuFwCfgSkipBytes()
Introduce the new public API QemuFwCfgSkipBytes(), for advancing over bytes in the selected firmware configuration item without transferring data between the item and the caller. When the DMA interface is available (the common case), the operation is instantaneous. As a fallback, provide a loop of chunked reads into a small stack-allocated scratch buffer. This patch enables OvmfPkg/QemuFwCfgLib to overwrite part of a writeable fw_cfg file, which will be particularly useful for the upcoming QEMU_LOADER_WRITE_POINTER command in OvmfPkg/AcpiPlatformDxe. Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'OvmfPkg/Include/Library/QemuFwCfgLib.h')
-rw-r--r--OvmfPkg/Include/Library/QemuFwCfgLib.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h
index 3e017d53a9..41c3817470 100644
--- a/OvmfPkg/Include/Library/QemuFwCfgLib.h
+++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h
@@ -159,6 +159,22 @@ QemuFwCfgWriteBytes (
/**
+ Skip bytes in the firmware configuration item.
+
+ Increase the offset of the firmware configuration item without transferring
+ bytes between the item and a caller-provided buffer. Subsequent read, write
+ or skip operations will commence at the increased offset.
+
+ @param[in] Size Number of bytes to skip.
+**/
+VOID
+EFIAPI
+QemuFwCfgSkipBytes (
+ IN UINTN Size
+ );
+
+
+/**
Reads a UINT8 firmware configuration value
@return Value of Firmware Configuration item read