From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by mx.groups.io with SMTP id smtpd.web09.26082.1612135557040401856 for ; Sun, 31 Jan 2021 15:25:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=TJWILhNl; spf=pass (domain: nuviainc.com, ip: 209.85.219.54, mailfrom: rebecca@nuviainc.com) Received: by mail-qv1-f54.google.com with SMTP id u20so3320711qvx.7 for ; Sun, 31 Jan 2021 15:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bvdpfTviRIRdWtsoaeK7vF11eZ/pYIoujdMIa4wH3+Y=; b=TJWILhNlIWC9dpl4U3Gcoa8Sgm2Ybb3gbPSMquYp9SJfOak0oiicUwQMoWY7rM7Pei 5YQPIMXYTFa+zgMW0BeEkk05TYe7HxJZCnrfUwS00TjoybkB6ZR1RXVXW90iDm1tcEw7 +3DcsWIagysyTbD+274+Brl2V0Nwel8s8wT69GdB2CzhH10mT110/7lS3Jt5IRKAdm8u EpnAXC+QR0v61DF1O42EQZtqeZXq6PXWLlivCFN5zRh0UK8MNAAoVNzmKbDOvw8AzIKY fwkDIDxsii++74IavfjD7a206kgbEetjxjKwtW9lyf7YBuCGU3vDE9D+HLTuKye+DODj lWHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bvdpfTviRIRdWtsoaeK7vF11eZ/pYIoujdMIa4wH3+Y=; b=rlzuX+0vhB0JxO14d2vVb7IgEv+LraQE4YwqjG1UjfV9moHnJNkTDmNNiz9f0+amP2 uD/tdQXgDPE2Mq78n8Bo4XaHF3J+nI7JX4biZNmV2NnBAFxHXkSHDLjMlMjd6vFv87yf DEP5dA8lKG3IDECHlmpjtGTrhPQYZAMiMz69AnDxX7K5qHY0zeOXijAblRNkQwOSXtP/ yuVVzaXVb+mIYljWCENn9jQbni6EK3UnJ6YHTx0qkBFEIaku5kybBA68js6j99ao22qd SuY7LE8lcPPSUOcJSWI06fqseVKlhfcGeMu4YTPE5He2FSqFfXOQGSE4zSDxzekaggrY iHEA== X-Gm-Message-State: AOAM531pGVvFRCpp8QAarRH54N37Os0IvEv7PiixoG2FgeSdlIaQ3lVN XSvUA/BulIEOjYs8TG+QAIrzenoh+PY0dViuuKVsW176pop2qGbk90FlaNnA1ayY76oIjUcxbvF MBCqmQfGuxTykkKZbbNKrxURGA4OSGYmur8p+jb61B8AQmTKMQs5S/xGre8bnmC6m4Mvbug== X-Google-Smtp-Source: ABdhPJxXiTiD9JmbamEegVJM+tu1wXl/QmIVksSHnRlFZWxZdgUdOsaopdzDSXx+i135kKQwCmeieg== X-Received: by 2002:a05:6214:410:: with SMTP id z16mr13411120qvx.39.1612135555720; Sun, 31 Jan 2021 15:25:55 -0800 (PST) Return-Path: Received: from cube.int.bluestop.org (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id 12sm11809361qkg.39.2021.01.31.15.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 15:25:54 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , leif@nuviainc.com, Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Samer El-Haj-Mahmoud , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v7 19/21] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type32 Date: Sun, 31 Jan 2021 16:25:09 -0700 Message-Id: <20210131232511.18340-20-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210131232511.18340-1-rebecca@nuviainc.com> References: <20210131232511.18340-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This code provides information for the SMBIOS Type 32 table. Signed-off-by: Rebecca Cran Reviewed-by: Leif Lindholm Reviewed-by: Samer El-Haj-Mahmoud --- ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c | 32 +++++++++ ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c | 73 ++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c new file mode 100644 index 000000000000..ebe4ad941c5f --- /dev/null +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c @@ -0,0 +1,32 @@ +/** @file + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ + + Copyright (c) 2021, NUVIA Inc. All rights reserved.
+ Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2015, Hisilicon Limited. All rights reserved.
+ Copyright (c) 2015, Linaro Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosMisc.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE32, MiscBootInformation) = { + { // Hdr + EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, // Type, + 0, // Length, + 0 // Handle + }, + { // Reserved[6] + 0, + 0, + 0, + 0, + 0, + 0 + }, + BootInformationStatusNoError // BootInformationStatus +}; diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c new file mode 100644 index 000000000000..733615bbcf1a --- /dev/null +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c @@ -0,0 +1,73 @@ +/** @file + boot information boot time changes. + SMBIOS type 32. + + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ + + Copyright (c) 2021, NUVIA Inc. All rights reserved.
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2015, Hisilicon Limited. All rights reserved.
+ Copyright (c) 2015, Linaro Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include + +#include "SmbiosMisc.h" + +/** + This function makes boot time changes to the contents of the + MiscBootInformation (Type 32) record. + + @param RecordData Pointer to SMBIOS table with default values. + @param Smbios SMBIOS protocol. + + @retval EFI_SUCCESS The SMBIOS table was successfully added. + @retval EFI_INVALID_PARAMETER Invalid parameter was found. + @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory. + +**/ +SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation) +{ + EFI_STATUS Status; + SMBIOS_TABLE_TYPE32 *SmbiosRecord; + SMBIOS_TABLE_TYPE32 *InputData; + + // + // First check for invalid parameters. + // + if (RecordData == NULL) { + return EFI_INVALID_PARAMETER; + } + + InputData = (SMBIOS_TABLE_TYPE32 *)RecordData; + + // + // Two zeros following the last string. + // + SmbiosRecord = AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1); + if (SmbiosRecord == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + (VOID)CopyMem (SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE32)); + + SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32); + + // + // Now we have got the full smbios record, call smbios protocol to add this record. + // + Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n", + __FUNCTION__, __LINE__, Status)); + } + + FreePool (SmbiosRecord); + return Status; +} -- 2.26.2