diff options
Diffstat (limited to 'OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c')
-rw-r--r-- | OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c index 0efe020eea..9d5e337e1a 100644 --- a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c +++ b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c @@ -40,6 +40,15 @@ DetectSmbiosVersion ( QEMU_SMBIOS_ANCHOR QemuAnchor;
UINT16 SmbiosVersion;
+ if (PcdGetBool (PcdQemuSmbiosValidated)) {
+ //
+ // Some other module, linked against this library, has already performed
+ // the task at hand. This should never happen, but it's easy to handle;
+ // just exit early.
+ //
+ return RETURN_SUCCESS;
+ }
+
if (RETURN_ERROR (QemuFwCfgFindFile (
"etc/smbios/smbios-anchor", &Anchor, &AnchorSize)) ||
RETURN_ERROR (QemuFwCfgFindFile (
@@ -72,5 +81,10 @@ DetectSmbiosVersion ( SmbiosVersion));
PcdSet16 (PcdSmbiosVersion, SmbiosVersion);
+ //
+ // SMBIOS platform drivers can now fetch and install
+ // "etc/smbios/smbios-tables" from QEMU.
+ //
+ PcdSetBool (PcdQemuSmbiosValidated, TRUE);
return RETURN_SUCCESS;
}
|