From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by mx.groups.io with SMTP id smtpd.web09.5901.1614056041001559184 for ; Mon, 22 Feb 2021 20:54:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=TswhgK/V; spf=pass (domain: nuviainc.com, ip: 209.85.222.173, mailfrom: rebecca@nuviainc.com) Received: by mail-qk1-f173.google.com with SMTP id 204so10147762qke.11 for ; Mon, 22 Feb 2021 20:54:00 -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=yIxr2wFEokYkTcyAu8UgWYmHAKpe8zI7UXjBHxZBGUw=; b=TswhgK/VSuVaXAD0KKHGqhL+Ek7ccfO0WPlEokScrQoTClHaN607xSuoSZIfRljC0n NyOYUh4IFNyMjJJc/21JN9VfDNS2LP94UGItMC3imEHwqXTshrH0e7LpRZHo0fYzgtqt qbCDb0qZNCTSX9dKU6MS8ECv/b3mWfreiPey5Lp/XBIXSXoYUYb3Z9UUmlauCe8st6KF +jbZf9EI6b775r2lIvDHMxp7I9XD+/A+ZeRRcUTDmqR/XF5PlGlcABgEqwrvmn+AldsA ZWgMSdrifzUaLSFZL6wExn14fquiT55WL9YAYUeiiUAnOWIAwnMDDjWX8oUic8+/W44p lfRQ== 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=yIxr2wFEokYkTcyAu8UgWYmHAKpe8zI7UXjBHxZBGUw=; b=GgYaAnjEBnu2Gnm0DxhQoE5hfHuWAWqudlIZbGTRcTOC0iPcztkqiej7WlTFDa2buP oPk1qrtLFcsiMVSYaoTQX2WcOSVoRoqiQzwuiMLK1y3/9ZXuAWPBRdOx/NSozKZyAZ8q 4s/WZjkkW5++yWx61eWVrxrq/+dDOuwZbDTOeVWHhiTiVSpFJaB1hs7bPVpvq7XwCRcM LOq1Gt5UFtT/251Rcre4X94EqTpZQ0KZvsEST1Y0G5Chc2IV5j/6kKsY9Uk92uRoiYjL yL0DRB4tWJe3/66zuH/KVM/15YrYNLR/NXEMUjmc8VLJZvLtbpTwp/XEgl1pThK4QYXm z7BQ== X-Gm-Message-State: AOAM531B2fGDntiTkuUSk961KpTdVQde2GGxRjaatcuy4ZiVX3FBlUmf Ecb43wrtq8b3iBrDA/QDbDwTNvydkZ/sVKIi2chEjBBFC32rJtfmffPsl3iYKxU+b/vZQeufcdX Tg6QYF6JuAFZNZTefLwYZNk3LaSYlEoVI8L4FM4mP/oewKKCpB0IqEDw8v/QbvDuu/n82CQ== X-Google-Smtp-Source: ABdhPJwGj246y6etfdvRrknXMH4BsCzA2iI73X2PRzBqHA/+y5w9tLpnE83NhnPgQwEH94gK1j5ebA== X-Received: by 2002:a37:b6c4:: with SMTP id g187mr14685505qkf.162.1614056039825; Mon, 22 Feb 2021 20:53:59 -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 x9sm12303258qtr.74.2021.02.22.20.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 20:53:59 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Leif Lindholm , Ard Biesheuvel Subject: [PATCH v3 2/3] ArmPkg: Rename some functions and parameters in OemMiscLib Date: Mon, 22 Feb 2021 21:53:52 -0700 Message-Id: <20210223045353.31315-3-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210223045353.31315-1-rebecca@nuviainc.com> References: <20210223045353.31315-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit o Rename 'mHiiHandle' parameter in OemUpdateSmbiosInfo to 'HiiHandle'. o Rename 'Offset' parameter in OemUpdateSmbiosInfo to 'Field'. o Rename OemGetProcessorMaxSockets to OemGetMaxProcessors. o Rename OemIsSocketPresent to OemIsProcessorPresent. o Update Universal/Smbios to follow the changes to OemMiscLib. Signed-off-by: Rebecca Cran --- ArmPkg/Include/Library/OemMiscLib.h | 14 +++---- ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 17 ++++----- ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 40 ++++++++++---------- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h index ad0e77685dbe..d1ac81f73d9f 100644 --- a/ArmPkg/Include/Library/OemMiscLib.h +++ b/ArmPkg/Include/Library/OemMiscLib.h @@ -116,13 +116,13 @@ OemGetCacheInformation ( IN OUT SMBIOS_TABLE_TYPE7 *SmbiosCacheTable ); -/** Gets the maximum number of sockets supported by the platform. +/** Gets the maximum number of processors supported by the platform. - @return The maximum number of sockets. + @return The maximum number of processors. **/ UINT8 EFIAPI -OemGetProcessorMaxSockets ( +OemGetMaxProcessors ( VOID ); @@ -146,22 +146,22 @@ OemGetChassisType ( **/ BOOLEAN EFIAPI -OemIsSocketPresent ( +OemIsProcessorPresent ( IN UINTN ProcessorIndex ); /** Updates the HII string for the specified field. - @param mHiiHandle The HII handle. + @param HiiHandle The HII handle. @param TokenToUpdate The string to update. - @param Offset The field to get information about. + @param Field The field to get information about. **/ VOID EFIAPI OemUpdateSmbiosInfo ( IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID TokenToUpdate, - IN OEM_MISC_SMBIOS_HII_STRING_FIELD Offset + IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field ); #endif // OEM_MISC_LIB_H_ diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c index 6b179941e414..5153c9d7809c 100644 --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c @@ -13,7 +13,6 @@ #include #include #include - #include @@ -80,13 +79,13 @@ OemGetCacheInformation ( return TRUE; } -/** Gets the maximum number of sockets supported by the platform. +/** Gets the maximum number of processors supported by the platform. - @return The maximum number of sockets. + @return The maximum number of processors. **/ UINT8 EFIAPI -OemGetProcessorMaxSockets ( +OemGetMaxProcessors ( VOID ) { @@ -119,7 +118,7 @@ OemGetChassisType ( **/ BOOLEAN EFIAPI -OemIsSocketPresent ( +OemIsProcessorPresent ( IN UINTN ProcessorIndex ) { @@ -129,16 +128,16 @@ OemIsSocketPresent ( /** Updates the HII string for the specified field. - @param mHiiHandle The HII handle. + @param HiiHandle The HII handle. @param TokenToUpdate The string to update. - @param Offset The field to get information about. + @param Field The field to get information about. **/ VOID EFIAPI OemUpdateSmbiosInfo ( - IN EFI_HII_HANDLE mHiiHandle, + IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID TokenToUpdate, - IN OEM_MISC_SMBIOS_HII_STRING_FIELD Offset + IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field ) { ASSERT (FALSE); diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c index d03de12a820e..0cb56c53975e 100644 --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c @@ -439,8 +439,8 @@ AddSmbiosCacheTypeTable ( strings following the data fields. @param[out] Type4Record The Type 4 structure to allocate and initialize - @param[in] ProcessorIndex The index of the processor socket - @param[in] Populated Whether the specified processor socket is + @param[in] ProcessorIndex The index of the processor + @param[in] Populated Whether the specified processor is populated. @retval EFI_SUCCESS The Type 4 structure was successfully @@ -460,7 +460,7 @@ AllocateType4AndSetProcessorInformationStrings ( EFI_STRING_ID SerialNumber; EFI_STRING_ID AssetTag; EFI_STRING_ID PartNumber; - EFI_STRING ProcessorSocketStr; + EFI_STRING ProcessorStr; EFI_STRING ProcessorManuStr; EFI_STRING ProcessorVersionStr; EFI_STRING SerialNumberStr; @@ -468,7 +468,7 @@ AllocateType4AndSetProcessorInformationStrings ( EFI_STRING PartNumberStr; CHAR8 *OptionalStrStart; CHAR8 *StrStart; - UINTN ProcessorSocketStrLen; + UINTN ProcessorStrLen; UINTN ProcessorManuStrLen; UINTN ProcessorVersionStrLen; UINTN SerialNumberStrLen; @@ -497,14 +497,14 @@ AllocateType4AndSetProcessorInformationStrings ( SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag); SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorPartNumber, PartNumber); - // Processor Socket Designation + // Processor Designation StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH; - ProcessorSocketStr = AllocateZeroPool (StringBufferSize); - if (ProcessorSocketStr == NULL) { + ProcessorStr = AllocateZeroPool (StringBufferSize); + if (ProcessorStr == NULL) { return EFI_OUT_OF_RESOURCES; } - ProcessorSocketStrLen = UnicodeSPrint (ProcessorSocketStr, StringBufferSize, + ProcessorStrLen = UnicodeSPrint (ProcessorStr, StringBufferSize, L"CPU%02d", ProcessorIndex + 1); // Processor Manufacture @@ -528,7 +528,7 @@ AllocateType4AndSetProcessorInformationStrings ( PartNumberStrLen = StrLen (PartNumberStr); TotalSize = sizeof (SMBIOS_TABLE_TYPE4) + - ProcessorSocketStrLen + 1 + + ProcessorStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1 + SerialNumberStrLen + 1 + @@ -545,12 +545,12 @@ AllocateType4AndSetProcessorInformationStrings ( OptionalStrStart = (CHAR8 *)(*Type4Record + 1); UnicodeStrToAsciiStrS ( - ProcessorSocketStr, + ProcessorStr, OptionalStrStart, - ProcessorSocketStrLen + 1 + ProcessorStrLen + 1 ); - StrStart = OptionalStrStart + ProcessorSocketStrLen + 1; + StrStart = OptionalStrStart + ProcessorStrLen + 1; UnicodeStrToAsciiStrS ( ProcessorManuStr, StrStart, @@ -586,7 +586,7 @@ AllocateType4AndSetProcessorInformationStrings ( ); Exit: - FreePool (ProcessorSocketStr); + FreePool (ProcessorStr); FreePool (ProcessorManuStr); FreePool (ProcessorVersionStr); FreePool (SerialNumberStr); @@ -618,7 +618,7 @@ AddSmbiosProcessorTypeTable ( UINT64 *ProcessorId; PROCESSOR_CHARACTERISTIC_FLAGS ProcessorCharacteristics; OEM_MISC_PROCESSOR_DATA MiscProcessorData; - BOOLEAN SocketPopulated; + BOOLEAN ProcessorPopulated; Type4Record = NULL; @@ -632,12 +632,12 @@ AddSmbiosProcessorTypeTable ( L2CacheHandle = 0xFFFF; L3CacheHandle = 0xFFFF; - SocketPopulated = OemIsSocketPresent(ProcessorIndex); + ProcessorPopulated = OemIsProcessorPresent (ProcessorIndex); Status = AllocateType4AndSetProcessorInformationStrings ( &Type4Record, ProcessorIndex, - SocketPopulated + ProcessorPopulated ); if (EFI_ERROR (Status)) { return Status; @@ -649,7 +649,7 @@ AddSmbiosProcessorTypeTable ( &Type4Record->ProcessorCharacteristics, &MiscProcessorData); - if (SocketPopulated) { + if (ProcessorPopulated) { AddSmbiosCacheTypeTable (ProcessorIndex, &L1CacheHandle, &L2CacheHandle, &L3CacheHandle); } @@ -713,7 +713,7 @@ ProcessorSubClassEntryPoint( ) { EFI_STATUS Status; - UINT32 SocketIndex; + UINT32 ProcessorIndex; // // Locate dependent protocols @@ -740,8 +740,8 @@ ProcessorSubClassEntryPoint( // // Add SMBIOS tables for populated sockets. // - for (SocketIndex = 0; SocketIndex < OemGetProcessorMaxSockets(); SocketIndex++) { - Status = AddSmbiosProcessorTypeTable (SocketIndex); + for (ProcessorIndex = 0; ProcessorIndex < OemGetMaxProcessors (); ProcessorIndex++) { + Status = AddSmbiosProcessorTypeTable (ProcessorIndex); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "Add Processor Type Table Failed! %r.\n", Status)); return Status; -- 2.26.2