From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.web08.615.1611601937902364402 for ; Mon, 25 Jan 2021 11:12:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=NS0rB7EM; spf=pass (domain: nuviainc.com, ip: 209.85.221.53, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f53.google.com with SMTP id a9so14112245wrt.5 for ; Mon, 25 Jan 2021 11:12:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=87JtCvvNXKTvagFK3d7mxWKz0wLCS6mvZdN7uBc6ypI=; b=NS0rB7EMvH10QRse29F0bbgipGOOPmvmqIQsrs4yFy7jACMvBWCL47sjxWhxNhb4ir Jyl8JgjUQLaNpJYKBbqlnLhup7qk7ZROigVrm/t5Ud9+3E3UzEVba+yWyUCofKchRwZY 7RtYkYXADEWbVXQvn8CAsOvt3oX4fDM7LTuU2+zYAWvZ9JKD7p3EESbk2MOELoV+OLaC 3AZ+KsNGpiCNyy7JBcrBiOL3XGmalepv/mrBiUXzJZ9btOm4Uho4usf4eFEES0fu383P 8VnSWz3GlGaPgO7Z0zzY5jxkk+A6G9XRzxC2XnitOl/EJ2zkZaOh4WDubPx9LEMIxUGi se2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=87JtCvvNXKTvagFK3d7mxWKz0wLCS6mvZdN7uBc6ypI=; b=QRhBuBFPetXaM4XVE7XF3AhxGxbRiyJv43zdAN/ZeFaXrI/yy+Xv5J5d3r1xL3OIcv B3gFHP7/EQy7ao6Y0fCbOC1V5y5z29njMu4AWvYngU588UL67SAnRQLj3LqcxQI8p/Kq QB6cQv++oqwI0AO0j24Mn50IgpH187+BPwweMidxGqC5Wou9/Qcpo+98aEq/bHEwfDOY KBA3jLTAMJm10n0r6af2KCH5igc3vXdRKYbyz1gv+z+TgE6FqzrLx9Kws0zWYNsNJfhJ tMVbDZxEXUXF887kxC0iLU0+Xcgv30vRXxt/TvLH3YJREpwy3rnHc2zhmYNbeCb2tl37 BQmQ== X-Gm-Message-State: AOAM532QDyivsOcURhNu3Q6L25COmllEA42w/Qiu9HcKzDdI11cd4u70 MaKMqpmlWzHQFbXzRWeMWPbXuw== X-Google-Smtp-Source: ABdhPJwMjgLdgfVvlWq9FuBs2jZ385edtEWSVTJPSf0HAyYdAZdQdhyaiWZ4vX9u350wXLzj7WXoww== X-Received: by 2002:a5d:524a:: with SMTP id k10mr2594516wrc.394.1611601936478; Mon, 25 Jan 2021 11:12:16 -0800 (PST) Return-Path: Received: from vanye (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id g14sm26018444wru.45.2021.01.25.11.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 11:12:16 -0800 (PST) Date: Mon, 25 Jan 2021 19:12:14 +0000 From: "Leif Lindholm" To: Rebecca Cran Cc: devel@edk2.groups.io, Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu Subject: Re: [PATCH v6 20/22] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type32 Message-ID: <20210125191214.GK1664@vanye> References: <20210114163628.31952-1-rebecca@nuviainc.com> <20210114163628.31952-21-rebecca@nuviainc.com> MIME-Version: 1.0 In-Reply-To: <20210114163628.31952-21-rebecca@nuviainc.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 14, 2021 at 09:36:26 -0700, Rebecca Cran wrote: > This code provides information for the SMBIOS Type 32 table. > > Signed-off-by: Rebecca Cran Reviewed-by: Leif Lindholm > --- > 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 >