summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2015-08-06 10:14:12 +0000
committerlersek <lersek@Edk2>2015-08-06 10:14:12 +0000
commitc3db5a8c3d3acf4791844c10b89a60552ac3c350 (patch)
treed1ad0d5c5461a892fd3065d955cd384d3e904c52 /OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
parent9b1c5be0265bf201f493da688c6afed20e8a4be0 (diff)
downloadedk2-c3db5a8c3d3acf4791844c10b89a60552ac3c350.tar.gz
edk2-c3db5a8c3d3acf4791844c10b89a60552ac3c350.tar.bz2
edk2-c3db5a8c3d3acf4791844c10b89a60552ac3c350.zip
OvmfPkg: SmbiosVersionLib: recognize SMBIOS 3.x entry point
Also set the DocRev field the way QEMU exposes it, because MdeModulePkg/Universal/SmbiosDxe lets us control that field too. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Wei Huang <wei@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gabriel L. Somlo <somlo@cmu.edu> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18182 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c')
-rw-r--r--OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
index 9d5e337e1a..950c3f7e0a 100644
--- a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
+++ b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
@@ -27,6 +27,7 @@
typedef union {
SMBIOS_TABLE_ENTRY_POINT V2;
+ SMBIOS_TABLE_3_0_ENTRY_POINT V3;
} QEMU_SMBIOS_ANCHOR;
RETURN_STATUS
@@ -73,6 +74,22 @@ DetectSmbiosVersion (
QemuAnchor.V2.MinorVersion);
break;
+ case sizeof QemuAnchor.V3:
+ QemuFwCfgReadBytes (AnchorSize, &QemuAnchor);
+
+ if (QemuAnchor.V3.MajorVersion != 3 ||
+ QemuAnchor.V3.TableMaximumSize != TablesSize ||
+ CompareMem (QemuAnchor.V3.AnchorString, "_SM3_", 5) != 0) {
+ return RETURN_SUCCESS;
+ }
+ SmbiosVersion = (UINT16)(QemuAnchor.V3.MajorVersion << 8 |
+ QemuAnchor.V3.MinorVersion);
+
+ DEBUG ((EFI_D_INFO, "%a: SMBIOS 3.x DocRev from QEMU: 0x%02x\n",
+ __FUNCTION__, QemuAnchor.V3.DocRev));
+ PcdSet8 (PcdSmbiosDocRev, QemuAnchor.V3.DocRev);
+ break;
+
default:
return RETURN_SUCCESS;
}