From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web12.29057.1612745621094030437 for ; Sun, 07 Feb 2021 16:53:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=T9dLBd+8; spf=pass (domain: nuviainc.com, ip: 209.85.216.52, mailfrom: rebecca@nuviainc.com) Received: by mail-pj1-f52.google.com with SMTP id fa16so6858012pjb.1 for ; Sun, 07 Feb 2021 16:53:41 -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=T9dLBd+8otafn8RWrGjKODZoyIFYKCeQptdLJ2yCtXLlDeXH5AxdpLbV9qMuqxfa9w F4uq0CuZN0YIWXdYplGy4HUnSL5i+wpQzygtH5KYqxzB/44WzoYvHoIfZZbkPUh/d/xe JhIA7xMz5XSPXpKDv/wvG6q19s7RG0ki0cQZuYJZmZVptCeAYh58ASjGsTwVtqFS9Q5p l9oEfTJ0fe54LgH7ZtMFLtrwN4P8Zea3RAuptClAnKN9oYnoQYeDY/QL4RWrvVgtJv8z KRlnibK65Rwg0QQzgkFUaOopTdmtue0iRqEybMJ0DlbonOPVLUwVFtyKdQYOo/CG/8DR vFdQ== 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=Y9Vg2Tkg0VLvRN8B4hyXk9F9kKQ10gQIbxNfUB38NNiAaWnEpFn00eWIM/jq6cJUg9 WB/0jiNzZKFvkqlA99oXUrtHITCxRkVkDhtnR+0QyH2kbgkqCsStx96m1ldFcT3aYzep jo0Kme6BljEjcOouW68sM5vmQvZc5vx46KvyCW0VSkvCSS5zljCIULVos9cSBkIZVCa4 htW1O0jzPC6rvMW6/UGxVfK40u9AwqxfSwCuDesfRMyrnDyv4ZNCH1AH3hr/DxAgKo3s E8fWVFSVdk8WLOHryvCvPg36NFECKIfqYq58y/BWH5BPkNda+HPmbcq4JwNG8zZwj/yL hJ7Q== X-Gm-Message-State: AOAM531Fq4hi2E89NQJq+LhfwRbf3Onn4HwfxbqQracCgq1DIWokONtC 1iZFE+yVF8Jv+j0/lLUnYGOFi8o+yl0e1Kk2F3ned21pWcA+aEsdyqumrIZ6JQPBQB+0DpMPDi7 2rLYIK4za56xNV9FxyUci8GCdh+eUw8DZ8bLZiC2UJo4gh4CHigwPXN1jBJDxkpqPHMjr3g== X-Google-Smtp-Source: ABdhPJxp1PZ6MstAcStOpLlPS1TZ+8Fk//VX99eIAvR/N+NL+ASSEjgbBMhQOgPi5Xguq6wfxVXXTA== X-Received: by 2002:a17:902:f688:b029:da:a817:1753 with SMTP id l8-20020a170902f688b02900daa8171753mr13952920plg.76.1612745620291; Sun, 07 Feb 2021 16:53:40 -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 c6sm11095883pjd.21.2021.02.07.16.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 16:53:39 -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 v8 19/21] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type32 Date: Sun, 7 Feb 2021 17:52:52 -0700 Message-Id: <20210208005254.12176-20-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208005254.12176-1-rebecca@nuviainc.com> References: <20210208005254.12176-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