2 * An "early" DXE driver that parses well-known fw-cfg files into dynamic PCDs
3 * that control other (universal) DXE drivers.
5 * Copyright (C) 2015, Red Hat, Inc.
6 * Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>
8 * This program and the accompanying materials are licensed and made available
9 * under the terms and conditions of the BSD License which accompanies this
10 * distribution. The full text of the license may be found at
11 * http://opensource.org/licenses/bsd-license.php
13 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
19 #include <Uefi/UefiBaseType.h>
20 #include <Uefi/UefiSpec.h>
22 #include <IndustryStandard/SmBios.h>
24 #include <Library/BaseMemoryLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/QemuFwCfgLib.h>
31 Set the SMBIOS entry point version for the generic SmbiosDxe driver.
35 SmbiosVersionInitialization (
39 FIRMWARE_CONFIG_ITEM Anchor
;
41 SMBIOS_TABLE_ENTRY_POINT QemuAnchor
;
44 if (RETURN_ERROR (QemuFwCfgFindFile ("etc/smbios/smbios-anchor", &Anchor
,
46 AnchorSize
!= sizeof QemuAnchor
) {
50 QemuFwCfgSelectItem (Anchor
);
51 QemuFwCfgReadBytes (AnchorSize
, &QemuAnchor
);
52 if (CompareMem (QemuAnchor
.AnchorString
, "_SM_", 4) != 0 ||
53 CompareMem (QemuAnchor
.IntermediateAnchorString
, "_DMI_", 5) != 0) {
57 SmbiosVersion
= (UINT16
)(QemuAnchor
.MajorVersion
<< 8 |
58 QemuAnchor
.MinorVersion
);
59 DEBUG ((EFI_D_INFO
, "%a: SMBIOS version from QEMU: 0x%04x\n", __FUNCTION__
,
61 PcdSet16 (PcdSmbiosVersion
, SmbiosVersion
);
67 IN EFI_HANDLE ImageHandle
,
68 IN EFI_SYSTEM_TABLE
*SystemTable
71 SmbiosVersionInitialization ();