ArmPkg: Rename some functions and parameters in OemMiscLib

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 <rebecca@nuviainc.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
This commit is contained in:
Rebecca Cran
2021-02-22 21:53:52 -07:00
committed by mergify[bot]
parent 533fff506e
commit 869ccd4a3e
3 changed files with 35 additions and 36 deletions

View File

@ -116,13 +116,13 @@ OemGetCacheInformation (
IN OUT SMBIOS_TABLE_TYPE7 *SmbiosCacheTable 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 UINT8
EFIAPI EFIAPI
OemGetProcessorMaxSockets ( OemGetMaxProcessors (
VOID VOID
); );
@ -146,22 +146,22 @@ OemGetChassisType (
**/ **/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
OemIsSocketPresent ( OemIsProcessorPresent (
IN UINTN ProcessorIndex IN UINTN ProcessorIndex
); );
/** Updates the HII string for the specified field. /** 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 TokenToUpdate The string to update.
@param Offset The field to get information about. @param Field The field to get information about.
**/ **/
VOID VOID
EFIAPI EFIAPI
OemUpdateSmbiosInfo ( OemUpdateSmbiosInfo (
IN EFI_HII_HANDLE HiiHandle, IN EFI_HII_HANDLE HiiHandle,
IN EFI_STRING_ID TokenToUpdate, 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_ #endif // OEM_MISC_LIB_H_

View File

@ -13,7 +13,6 @@
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/HiiLib.h> #include <Library/HiiLib.h>
#include <Library/OemMiscLib.h> #include <Library/OemMiscLib.h>
@ -80,13 +79,13 @@ OemGetCacheInformation (
return TRUE; 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 UINT8
EFIAPI EFIAPI
OemGetProcessorMaxSockets ( OemGetMaxProcessors (
VOID VOID
) )
{ {
@ -119,7 +118,7 @@ OemGetChassisType (
**/ **/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
OemIsSocketPresent ( OemIsProcessorPresent (
IN UINTN ProcessorIndex IN UINTN ProcessorIndex
) )
{ {
@ -129,16 +128,16 @@ OemIsSocketPresent (
/** Updates the HII string for the specified field. /** 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 TokenToUpdate The string to update.
@param Offset The field to get information about. @param Field The field to get information about.
**/ **/
VOID VOID
EFIAPI EFIAPI
OemUpdateSmbiosInfo ( OemUpdateSmbiosInfo (
IN EFI_HII_HANDLE mHiiHandle, IN EFI_HII_HANDLE HiiHandle,
IN EFI_STRING_ID TokenToUpdate, IN EFI_STRING_ID TokenToUpdate,
IN OEM_MISC_SMBIOS_HII_STRING_FIELD Offset IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
) )
{ {
ASSERT (FALSE); ASSERT (FALSE);

View File

@ -439,8 +439,8 @@ AddSmbiosCacheTypeTable (
strings following the data fields. strings following the data fields.
@param[out] Type4Record The Type 4 structure to allocate and initialize @param[out] Type4Record The Type 4 structure to allocate and initialize
@param[in] ProcessorIndex The index of the processor socket @param[in] ProcessorIndex The index of the processor
@param[in] Populated Whether the specified processor socket is @param[in] Populated Whether the specified processor is
populated. populated.
@retval EFI_SUCCESS The Type 4 structure was successfully @retval EFI_SUCCESS The Type 4 structure was successfully
@ -460,7 +460,7 @@ AllocateType4AndSetProcessorInformationStrings (
EFI_STRING_ID SerialNumber; EFI_STRING_ID SerialNumber;
EFI_STRING_ID AssetTag; EFI_STRING_ID AssetTag;
EFI_STRING_ID PartNumber; EFI_STRING_ID PartNumber;
EFI_STRING ProcessorSocketStr; EFI_STRING ProcessorStr;
EFI_STRING ProcessorManuStr; EFI_STRING ProcessorManuStr;
EFI_STRING ProcessorVersionStr; EFI_STRING ProcessorVersionStr;
EFI_STRING SerialNumberStr; EFI_STRING SerialNumberStr;
@ -468,7 +468,7 @@ AllocateType4AndSetProcessorInformationStrings (
EFI_STRING PartNumberStr; EFI_STRING PartNumberStr;
CHAR8 *OptionalStrStart; CHAR8 *OptionalStrStart;
CHAR8 *StrStart; CHAR8 *StrStart;
UINTN ProcessorSocketStrLen; UINTN ProcessorStrLen;
UINTN ProcessorManuStrLen; UINTN ProcessorManuStrLen;
UINTN ProcessorVersionStrLen; UINTN ProcessorVersionStrLen;
UINTN SerialNumberStrLen; UINTN SerialNumberStrLen;
@ -497,14 +497,14 @@ AllocateType4AndSetProcessorInformationStrings (
SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag); SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag);
SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorPartNumber, PartNumber); SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorPartNumber, PartNumber);
// Processor Socket Designation // Processor Designation
StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH; StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
ProcessorSocketStr = AllocateZeroPool (StringBufferSize); ProcessorStr = AllocateZeroPool (StringBufferSize);
if (ProcessorSocketStr == NULL) { if (ProcessorStr == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
ProcessorSocketStrLen = UnicodeSPrint (ProcessorSocketStr, StringBufferSize, ProcessorStrLen = UnicodeSPrint (ProcessorStr, StringBufferSize,
L"CPU%02d", ProcessorIndex + 1); L"CPU%02d", ProcessorIndex + 1);
// Processor Manufacture // Processor Manufacture
@ -528,7 +528,7 @@ AllocateType4AndSetProcessorInformationStrings (
PartNumberStrLen = StrLen (PartNumberStr); PartNumberStrLen = StrLen (PartNumberStr);
TotalSize = sizeof (SMBIOS_TABLE_TYPE4) + TotalSize = sizeof (SMBIOS_TABLE_TYPE4) +
ProcessorSocketStrLen + 1 + ProcessorStrLen + 1 +
ProcessorManuStrLen + 1 + ProcessorManuStrLen + 1 +
ProcessorVersionStrLen + 1 + ProcessorVersionStrLen + 1 +
SerialNumberStrLen + 1 + SerialNumberStrLen + 1 +
@ -545,12 +545,12 @@ AllocateType4AndSetProcessorInformationStrings (
OptionalStrStart = (CHAR8 *)(*Type4Record + 1); OptionalStrStart = (CHAR8 *)(*Type4Record + 1);
UnicodeStrToAsciiStrS ( UnicodeStrToAsciiStrS (
ProcessorSocketStr, ProcessorStr,
OptionalStrStart, OptionalStrStart,
ProcessorSocketStrLen + 1 ProcessorStrLen + 1
); );
StrStart = OptionalStrStart + ProcessorSocketStrLen + 1; StrStart = OptionalStrStart + ProcessorStrLen + 1;
UnicodeStrToAsciiStrS ( UnicodeStrToAsciiStrS (
ProcessorManuStr, ProcessorManuStr,
StrStart, StrStart,
@ -586,7 +586,7 @@ AllocateType4AndSetProcessorInformationStrings (
); );
Exit: Exit:
FreePool (ProcessorSocketStr); FreePool (ProcessorStr);
FreePool (ProcessorManuStr); FreePool (ProcessorManuStr);
FreePool (ProcessorVersionStr); FreePool (ProcessorVersionStr);
FreePool (SerialNumberStr); FreePool (SerialNumberStr);
@ -618,7 +618,7 @@ AddSmbiosProcessorTypeTable (
UINT64 *ProcessorId; UINT64 *ProcessorId;
PROCESSOR_CHARACTERISTIC_FLAGS ProcessorCharacteristics; PROCESSOR_CHARACTERISTIC_FLAGS ProcessorCharacteristics;
OEM_MISC_PROCESSOR_DATA MiscProcessorData; OEM_MISC_PROCESSOR_DATA MiscProcessorData;
BOOLEAN SocketPopulated; BOOLEAN ProcessorPopulated;
Type4Record = NULL; Type4Record = NULL;
@ -632,12 +632,12 @@ AddSmbiosProcessorTypeTable (
L2CacheHandle = 0xFFFF; L2CacheHandle = 0xFFFF;
L3CacheHandle = 0xFFFF; L3CacheHandle = 0xFFFF;
SocketPopulated = OemIsSocketPresent(ProcessorIndex); ProcessorPopulated = OemIsProcessorPresent (ProcessorIndex);
Status = AllocateType4AndSetProcessorInformationStrings ( Status = AllocateType4AndSetProcessorInformationStrings (
&Type4Record, &Type4Record,
ProcessorIndex, ProcessorIndex,
SocketPopulated ProcessorPopulated
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
@ -649,7 +649,7 @@ AddSmbiosProcessorTypeTable (
&Type4Record->ProcessorCharacteristics, &Type4Record->ProcessorCharacteristics,
&MiscProcessorData); &MiscProcessorData);
if (SocketPopulated) { if (ProcessorPopulated) {
AddSmbiosCacheTypeTable (ProcessorIndex, &L1CacheHandle, AddSmbiosCacheTypeTable (ProcessorIndex, &L1CacheHandle,
&L2CacheHandle, &L3CacheHandle); &L2CacheHandle, &L3CacheHandle);
} }
@ -713,7 +713,7 @@ ProcessorSubClassEntryPoint(
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
UINT32 SocketIndex; UINT32 ProcessorIndex;
// //
// Locate dependent protocols // Locate dependent protocols
@ -740,8 +740,8 @@ ProcessorSubClassEntryPoint(
// //
// Add SMBIOS tables for populated sockets. // Add SMBIOS tables for populated sockets.
// //
for (SocketIndex = 0; SocketIndex < OemGetProcessorMaxSockets(); SocketIndex++) { for (ProcessorIndex = 0; ProcessorIndex < OemGetMaxProcessors (); ProcessorIndex++) {
Status = AddSmbiosProcessorTypeTable (SocketIndex); Status = AddSmbiosProcessorTypeTable (ProcessorIndex);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Add Processor Type Table Failed! %r.\n", Status)); DEBUG ((DEBUG_ERROR, "Add Processor Type Table Failed! %r.\n", Status));
return Status; return Status;