]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg/QemuFwCfgS3Lib: implement opcode APIs for PEI fw_cfg instance
authorLaszlo Ersek <lersek@redhat.com>
Wed, 22 Feb 2017 09:34:48 +0000 (10:34 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 14 Mar 2017 20:49:32 +0000 (21:49 +0100)
commitda58d987cc894b12fbe208bf66d3f129817f771b
tree687e8c8217e51fbedb8dddbde3a3739596951071
parent33ead2dd14073ce747d1a623975fc55d9fe84640
OvmfPkg/QemuFwCfgS3Lib: implement opcode APIs for PEI fw_cfg instance

In the PEI fw_cfg instance:

- QemuFwCfgS3Enabled() queries S3 enablement via fw_cfg. This behavior is
  shared with the DXE fw_cfg instance, and the PEI fw_cfg instance already
  pulls in the function from "QemuFwCfgS3PeiDxe.c".

- If QemuFwCfgS3Enabled() returns TRUE, the client module is permitted to
  call QemuFwCfgS3CallWhenBootScriptReady(). However, in the PEI phase we
  have no support for capturing ACPI S3 Boot Script opcodes, hence we
  return RETURN_UNSUPPORTED unconditionally. This behavior is unique to
  the PEI fw_cfg instance, so add the function to "QemuFwCfgS3Pei.c".

- Consequently, the QemuFwCfgS3ScriptWriteBytes(),
  QemuFwCfgS3ScriptReadBytes(), QemuFwCfgS3ScriptSkipBytes(), and
  QemuFwCfgS3ScriptCheckValue() functions must never be called. (They
  could only be called from the client module's callback, but
  QemuFwCfgS3CallWhenBootScriptReady() will never install such callback in
  the PEI fw_cfg instance -- see above.)

  This behavior is not unique to the PEI fw_cfg instance (it is shared
  with the Base Null instance), so pull in these functions from
  "QemuFwCfgS3BasePei.c".

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=394
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/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf
OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Pei.c [new file with mode: 0644]