diff options
author | Laszlo Ersek <lersek@redhat.com> | 2015-08-06 10:14:12 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-08-06 10:14:12 +0000 |
commit | c3db5a8c3d3acf4791844c10b89a60552ac3c350 (patch) | |
tree | d1ad0d5c5461a892fd3065d955cd384d3e904c52 /OvmfPkg | |
parent | 9b1c5be0265bf201f493da688c6afed20e8a4be0 (diff) | |
download | edk2-platforms-c3db5a8c3d3acf4791844c10b89a60552ac3c350.tar.xz |
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')
-rw-r--r-- | OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c | 17 | ||||
-rw-r--r-- | OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf | 1 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgIa32.dsc | 1 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgIa32X64.dsc | 1 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgX64.dsc | 1 |
5 files changed, 21 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;
}
diff --git a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf index 8487e73e46..45d953a015 100644 --- a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf +++ b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf @@ -49,4 +49,5 @@ [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 6353f1da9b..4ab618d395 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -362,6 +362,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE
################################################################################
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 47baeb80ce..90ca42a4d9 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -368,6 +368,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE
################################################################################
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index dd8148d0a9..b72eaa92f8 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -367,6 +367,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE
################################################################################
|