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
This commit is contained in:
Laszlo Ersek 2015-08-06 10:14:12 +00:00 committed by lersek
parent 9b1c5be026
commit c3db5a8c3d
5 changed files with 21 additions and 0 deletions

View File

@ -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;
}

View File

@ -49,4 +49,5 @@
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated

View File

@ -362,6 +362,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE
################################################################################

View File

@ -368,6 +368,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE
################################################################################

View File

@ -367,6 +367,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE
################################################################################