From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by mx.groups.io with SMTP id smtpd.web11.4168.1610642225297175001 for ; Thu, 14 Jan 2021 08:37:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=y7V/G1z1; spf=pass (domain: nuviainc.com, ip: 209.85.166.43, mailfrom: rebecca@nuviainc.com) Received: by mail-io1-f43.google.com with SMTP id e22so12360329iom.5 for ; Thu, 14 Jan 2021 08:37:05 -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=ghc8SEASAYrN1dMdWyeN4bz9ctxDnxCSyqdhUoPTPOc=; b=y7V/G1z1xxIBk99GLxVmBBniQhP2XayhaJT11+aiQQEtVpzaO8WfZbAUM+VDpLURSk OgGYIYvjn7agRAAkgaJAbylGSnL48atPUrCx+jeW90UsZD3fsqS9kPwq+Jyxdil0yNs/ KMMXzmbwTUir1GynpUw4tAvXa2BUO1Hp5x/ooP7kJQPzhcSkbbBQNdwWvygWqgMUHa2H AvkRfwzew238baWVh6Ca/prgjmAAIr4KicXU3Umn1hMVvdbcvS0Cv5bC3hpHU3j9ttw3 tGB8Efd5JXCLNHt4MwYpy1tPRhB418DvqsGWY9zCu9h92uhS2o64nZzVSIak1B5e9A4f uyHw== 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=ghc8SEASAYrN1dMdWyeN4bz9ctxDnxCSyqdhUoPTPOc=; b=WvAzMifytjYk+KWJwUzptILmmvZfNFBwkTOKcBuE6urh1HQrm1bxUwcMNf6s2gb6kf /WZXQF0Nle2BVFZoOjgs+B5zzVgqswtlMyIWPBg49aSdwsNi5sVtlBmEXE/Xl7m3e36J jBIgmZTp31ABPxyqFhC9PsMZtG24S2gshuON3mSrmrS3+FosRo8kf6a8e5f9Yij+/abg ERLdGzxtMDDzuK15jUbEAEaYOSeKJX9FO2kc+UI2EqtqXn01krM5+E1DQ6mi2JQ5DNN6 qWsMgeiflHb+y/pTigEr/zBICI0B/ySA2FF9hoT1H26g41nSKvgrsI6H91VHbuDQSiQA 71Ew== X-Gm-Message-State: AOAM532PaQzAlCCxHI/d+rhk4Dru9gVQPDrEE1016/HOb6/yrpoDTlmB zsmdpWBy7PDrElGKLaXcr+i+q6F6avzLUHP1c+Wqrj7232iW4eIglb2byhZs8c+7/GvI+ifcMfP hr0bmNVOSWfIIF3dcS2lELH2C3vy90DHlP4OCCRnUTHjVzItAOA0X0RsE6Nkhk7o0XrRGFwEz X-Google-Smtp-Source: ABdhPJzvNfFkC6WMfNoiHyBNRobaJR9nOzJtWWxFDaH0uZ6ZghVptwOGCgaIhY66k17+uxA7EtbboQ== X-Received: by 2002:a92:bbcb:: with SMTP id x72mr7324644ilk.104.1610642224343; Thu, 14 Jan 2021 08:37:04 -0800 (PST) Return-Path: Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id y5sm3711920ilj.35.2021.01.14.08.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 08:37:03 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Leif Lindholm , Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu Subject: [PATCH v6 20/22] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type32 Date: Thu, 14 Jan 2021 09:36:26 -0700 Message-Id: <20210114163628.31952-21-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210114163628.31952-1-rebecca@nuviainc.com> References: <20210114163628.31952-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 --- 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