From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mx.groups.io with SMTP id smtpd.web11.85.1609801148026470221 for ; Mon, 04 Jan 2021 14:59:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=lLnuiqYX; spf=pass (domain: nuviainc.com, ip: 209.85.215.175, mailfrom: rebecca@nuviainc.com) Received: by mail-pg1-f175.google.com with SMTP id n7so20049527pgg.2 for ; Mon, 04 Jan 2021 14:59:07 -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=pNU+AngCCWWbIiIaXXoxddw7fWM+bmA/5xScvflCP98=; b=lLnuiqYXfvX+IilMvMjGnHtTMyfYUapC6bwKs2+rJ+AhhyYivFecdXYoX10//9XnCS fYJ77kdfxBWfYMDGd1sQxjgEibpB7Byp7pL4iWRpLDGuNstvAhlwhdKo+/PFafHWgPuU e0b84L91Q4YGbnmefLEYWrAO04Llztgzz7qWuvpG720aaF5QMERII1vNW254Mi7CWobp EOzuFFDNxg8mTzo1G3bvboqYvdvd4aj/mamCG/IKNODXNQ9SJaOgOaJ82EqZvl9TAEiV O1ku+QafTUkpGaL9FDiv04bcmL2kSJD5DWaXV+B7fcEfNHM6dpnwFancW5nAdILVxb6g LjlA== 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=pNU+AngCCWWbIiIaXXoxddw7fWM+bmA/5xScvflCP98=; b=B5vlcZgZh3FufTMC1XYLyq5AmL3jGzeRwCQH3pfNHTd3mj4wprq2zx4i5eg5PKzvA6 HoDLnNoIp8h61kch4CIVMtE1uh7Y7Z8xQxsFedMubxdNhKnOHhKzthwDLEpYbPIXGfzz hIb2WPFMbibu15i9a5L2wM9tYK76RLPSnyNpfkCbU1lKs+B/Cvh8zj5GbUSvbAvCslkQ wVSmUinEIT782E1YHzWXWw7sAVRdzS3kK/ubbb7J264vRc57KVLCs3VzVI/VMfF82aRp vkSFd+jK6DQFy5tg7ee75mggfK50nJKChZ+aKLALB2o/uAJDiOZs3Fn3kN+PuFWdPNhX TxfQ== X-Gm-Message-State: AOAM531c+3cchgjeqNfKXbLUuwOtlMGJjFnSkoqxeN1gq5lWISCkEKMF FoQvrXQy7NZBKLRy5Q1vrUH5QfKsap43Y248Kr0fSIhGYviynro9QBTzACH+W1u8mpYy3gDpQ1i PKWerP2fYd5Y36fV+tXXGHgpFr2z6FZauJIcUxsMNJpmeq6Kwyh24q6Z7hUsGR6XZTSyb5nlH X-Google-Smtp-Source: ABdhPJxXXmMEcKqKeRgdSOrWqjeDA9tDBouFWLou7KbgpzDeMhcCSDK4pthoJBoT5L9GzGo/mRdiiQ== X-Received: by 2002:a05:6a00:8c7:b029:19d:afa5:34e5 with SMTP id s7-20020a056a0008c7b029019dafa534e5mr67888333pfu.30.1609801147096; Mon, 04 Jan 2021 14:59:07 -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 x143sm64185289pgx.66.2021.01.04.14.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 14:59:06 -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 v5 17/23] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type32 Date: Mon, 4 Jan 2021 15:58:24 -0700 Message-Id: <20210104225830.12606-18-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210104225830.12606-1-rebecca@nuviainc.com> References: <20210104225830.12606-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 | 34 ++++++++++ ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c | 66 ++++++++++++++++++++ 2 files changed, 100 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..e72656d3b002 --- /dev/null +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c @@ -0,0 +1,34 @@ +/** @file + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ + + 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. +// +MISC_SMBIOS_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..dabecbbd3a64 --- /dev/null +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c @@ -0,0 +1,66 @@ +/** @file + boot information boot time changes. + SMBIOS type 32. + + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ + + 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 "SmbiosMisc.h" + +/** + This function makes boot time changes to the contents of the + MiscBootInformation (Type 32). + + @param RecordData Pointer to copy of RecordData from the Data Table. + + @retval EFI_SUCCESS All parameters were valid. + @retval EFI_UNSUPPORTED Unexpected RecordType value. + @retval EFI_INVALID_PARAMETER Invalid parameter was found. + +**/ +MISC_SMBIOS_TABLE_FUNCTION(MiscBootInformation) +{ + EFI_STATUS Status; + EFI_SMBIOS_HANDLE SmbiosHandle; + 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 = LogSmbiosData ((UINT8*)SmbiosRecord, &SmbiosHandle); + 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