From 429309e0c6b74792d679681a8edd0d5ae0ff850c Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Sun, 5 Dec 2021 14:53:50 -0800 Subject: ArmPkg: Apply uncrustify changes REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ArmPkg package Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney Signed-off-by: Michael Kubacki Reviewed-by: Andrew Fish --- ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMisc.h | 38 +++--- .../Smbios/SmbiosMiscDxe/SmbiosMiscDataTable.c | 88 +++++++----- .../Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c | 100 +++++++------- .../SmbiosMiscDxe/Type00/MiscBiosVendorData.c | 80 ++++++----- .../SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 151 +++++++++++---------- .../Type01/MiscSystemManufacturerData.c | 11 +- .../Type01/MiscSystemManufacturerFunction.c | 98 +++++++------ .../Type02/MiscBaseBoardManufacturerData.c | 2 +- .../Type02/MiscBaseBoardManufacturerFunction.c | 120 ++++++++-------- .../Type03/MiscChassisManufacturerData.c | 3 +- .../Type03/MiscChassisManufacturerFunction.c | 96 ++++++------- .../Type13/MiscNumberOfInstallableLanguagesData.c | 8 +- .../MiscNumberOfInstallableLanguagesFunction.c | 40 +++--- .../SmbiosMiscDxe/Type32/MiscBootInformationData.c | 8 +- .../Type32/MiscBootInformationFunction.c | 20 +-- 15 files changed, 464 insertions(+), 399 deletions(-) (limited to 'ArmPkg/Universal/Smbios/SmbiosMiscDxe') diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMisc.h b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMisc.h index 4fd37c4..88f6043 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMisc.h +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMisc.h @@ -20,12 +20,11 @@ // // Data table entry update function. // -typedef EFI_STATUS (EFIAPI SMBIOS_MISC_DATA_FUNCTION) ( +typedef EFI_STATUS (EFIAPI SMBIOS_MISC_DATA_FUNCTION)( IN VOID *RecordData, IN EFI_SMBIOS_PROTOCOL *Smbios ); - // // Data table entry definition. // @@ -33,11 +32,10 @@ typedef struct { // // intermediate input data for SMBIOS record // - VOID *RecordData; - SMBIOS_MISC_DATA_FUNCTION *Function; + VOID *RecordData; + SMBIOS_MISC_DATA_FUNCTION *Function; } SMBIOS_MISC_DATA_TABLE; - // // SMBIOS table extern definitions // @@ -45,7 +43,6 @@ typedef struct { extern NAME1 NAME2 ## Data; \ extern SMBIOS_MISC_DATA_FUNCTION NAME3 ## Function; - // // SMBIOS data table entries // @@ -73,15 +70,14 @@ extern SMBIOS_MISC_DATA_FUNCTION NAME3 ## Function; // // Data Table Array Entries // -extern EFI_HII_HANDLE mSmbiosMiscHiiHandle; +extern EFI_HII_HANDLE mSmbiosMiscHiiHandle; -typedef struct _SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING{ - UINT8 *LanguageSignature; - EFI_STRING_ID InstallableLanguageLongString; - EFI_STRING_ID InstallableLanguageAbbreviateString; +typedef struct _SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING { + UINT8 *LanguageSignature; + EFI_STRING_ID InstallableLanguageLongString; + EFI_STRING_ID InstallableLanguageAbbreviateString; } SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING; - /** Adds an SMBIOS record. @@ -101,8 +97,8 @@ typedef struct _SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING{ **/ EFI_STATUS SmbiosMiscAddRecord ( - IN UINT8 *Buffer, - IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle OPTIONAL + IN UINT8 *Buffer, + IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle OPTIONAL ); /** @@ -114,21 +110,21 @@ SmbiosMiscAddRecord ( **/ VOID -SmbiosMiscGetLinkTypeHandle( - IN UINT8 SmbiosType, - OUT UINT16 **HandleArray, - OUT UINTN *HandleCount +SmbiosMiscGetLinkTypeHandle ( + IN UINT8 SmbiosType, + OUT UINT16 **HandleArray, + OUT UINTN *HandleCount ); // // Data Table Array // -extern SMBIOS_MISC_DATA_TABLE mSmbiosMiscDataTable[]; +extern SMBIOS_MISC_DATA_TABLE mSmbiosMiscDataTable[]; // // Data Table Array Entries // -extern UINTN mSmbiosMiscDataTableEntries; -extern UINT8 mSmbiosMiscDxeStrings[]; +extern UINTN mSmbiosMiscDataTableEntries; +extern UINT8 mSmbiosMiscDxeStrings[]; #endif // SMBIOS_MISC_H_ diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDataTable.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDataTable.c index ac16c3a..c1b866f 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDataTable.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDataTable.c @@ -13,50 +13,72 @@ #include "SmbiosMisc.h" -SMBIOS_MISC_TABLE_EXTERNS (SMBIOS_TABLE_TYPE0, - MiscBiosVendor, - MiscBiosVendor) -SMBIOS_MISC_TABLE_EXTERNS (SMBIOS_TABLE_TYPE1, - MiscSystemManufacturer, - MiscSystemManufacturer) -SMBIOS_MISC_TABLE_EXTERNS (SMBIOS_TABLE_TYPE3, - MiscChassisManufacturer, - MiscChassisManufacturer) -SMBIOS_MISC_TABLE_EXTERNS (SMBIOS_TABLE_TYPE2, - MiscBaseBoardManufacturer, - MiscBaseBoardManufacturer) -SMBIOS_MISC_TABLE_EXTERNS (SMBIOS_TABLE_TYPE13, - MiscNumberOfInstallableLanguages, - MiscNumberOfInstallableLanguages) -SMBIOS_MISC_TABLE_EXTERNS (SMBIOS_TABLE_TYPE32, - MiscBootInformation, - MiscBootInformation) - +SMBIOS_MISC_TABLE_EXTERNS ( + SMBIOS_TABLE_TYPE0, + MiscBiosVendor, + MiscBiosVendor + ) +SMBIOS_MISC_TABLE_EXTERNS ( + SMBIOS_TABLE_TYPE1, + MiscSystemManufacturer, + MiscSystemManufacturer + ) +SMBIOS_MISC_TABLE_EXTERNS ( + SMBIOS_TABLE_TYPE3, + MiscChassisManufacturer, + MiscChassisManufacturer + ) +SMBIOS_MISC_TABLE_EXTERNS ( + SMBIOS_TABLE_TYPE2, + MiscBaseBoardManufacturer, + MiscBaseBoardManufacturer + ) +SMBIOS_MISC_TABLE_EXTERNS ( + SMBIOS_TABLE_TYPE13, + MiscNumberOfInstallableLanguages, + MiscNumberOfInstallableLanguages + ) +SMBIOS_MISC_TABLE_EXTERNS ( + SMBIOS_TABLE_TYPE32, + MiscBootInformation, + MiscBootInformation + ) SMBIOS_MISC_DATA_TABLE mSmbiosMiscDataTable[] = { // Type0 - SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION (MiscBiosVendor, - MiscBiosVendor), + SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION ( + MiscBiosVendor, + MiscBiosVendor + ), // Type1 - SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION (MiscSystemManufacturer, - MiscSystemManufacturer), + SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION ( + MiscSystemManufacturer, + MiscSystemManufacturer + ), // Type3 - SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION (MiscChassisManufacturer, - MiscChassisManufacturer), + SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION ( + MiscChassisManufacturer, + MiscChassisManufacturer + ), // Type2 - SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION (MiscBaseBoardManufacturer, - MiscBaseBoardManufacturer), + SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION ( + MiscBaseBoardManufacturer, + MiscBaseBoardManufacturer + ), // Type13 - SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION (MiscNumberOfInstallableLanguages, - MiscNumberOfInstallableLanguages), + SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION ( + MiscNumberOfInstallableLanguages, + MiscNumberOfInstallableLanguages + ), // Type32 - SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION (MiscBootInformation, - MiscBootInformation), + SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION ( + MiscBootInformation, + MiscBootInformation + ), }; - // // Number of Data Table entries. // -UINTN mSmbiosMiscDataTableEntries = +UINTN mSmbiosMiscDataTableEntries = (sizeof (mSmbiosMiscDataTable)) / sizeof (SMBIOS_MISC_DATA_TABLE); diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c index eb7f4cb..3a5626b 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c @@ -21,11 +21,10 @@ #include "SmbiosMisc.h" - STATIC EFI_HANDLE mSmbiosMiscImageHandle; STATIC EFI_SMBIOS_PROTOCOL *mSmbiosMiscSmbios = NULL; -EFI_HII_HANDLE mSmbiosMiscHiiHandle; +EFI_HII_HANDLE mSmbiosMiscHiiHandle; /** Standard EFI driver point. This driver parses the mSmbiosMiscDataTable @@ -39,28 +38,32 @@ EFI_HII_HANDLE mSmbiosMiscHiiHandle; **/ EFI_STATUS EFIAPI -SmbiosMiscEntryPoint( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable +SmbiosMiscEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) { - UINTN Index; - EFI_STATUS EfiStatus; + UINTN Index; + EFI_STATUS EfiStatus; mSmbiosMiscImageHandle = ImageHandle; - EfiStatus = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, - (VOID**)&mSmbiosMiscSmbios); + EfiStatus = gBS->LocateProtocol ( + &gEfiSmbiosProtocolGuid, + NULL, + (VOID **)&mSmbiosMiscSmbios + ); if (EFI_ERROR (EfiStatus)) { DEBUG ((DEBUG_ERROR, "Could not locate SMBIOS protocol. %r\n", EfiStatus)); return EfiStatus; } - mSmbiosMiscHiiHandle = HiiAddPackages (&gEfiCallerIdGuid, - mSmbiosMiscImageHandle, - SmbiosMiscDxeStrings, - NULL - ); + mSmbiosMiscHiiHandle = HiiAddPackages ( + &gEfiCallerIdGuid, + mSmbiosMiscImageHandle, + SmbiosMiscDxeStrings, + NULL + ); if (mSmbiosMiscHiiHandle == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -70,13 +73,19 @@ SmbiosMiscEntryPoint( // If the entry have a function pointer, just log the data. // if (mSmbiosMiscDataTable[Index].Function != NULL) { - EfiStatus = (*mSmbiosMiscDataTable[Index].Function)(mSmbiosMiscDataTable[Index].RecordData, - mSmbiosMiscSmbios - ); - - if (EFI_ERROR(EfiStatus)) { - DEBUG ((DEBUG_ERROR, "Misc smbios store error. Index=%d," - "ReturnStatus=%r\n", Index, EfiStatus)); + EfiStatus = (*mSmbiosMiscDataTable[Index].Function)( + mSmbiosMiscDataTable[Index].RecordData, + mSmbiosMiscSmbios + ); + + if (EFI_ERROR (EfiStatus)) { + DEBUG (( + DEBUG_ERROR, + "Misc smbios store error. Index=%d," + "ReturnStatus=%r\n", + Index, + EfiStatus + )); return EfiStatus; } } @@ -85,7 +94,6 @@ SmbiosMiscEntryPoint( return EfiStatus; } - /** Adds an SMBIOS record. @@ -119,11 +127,11 @@ SmbiosMiscAddRecord ( } Status = mSmbiosMiscSmbios->Add ( - mSmbiosMiscSmbios, - NULL, - &Handle, - (EFI_SMBIOS_TABLE_HEADER *)Buffer - ); + mSmbiosMiscSmbios, + NULL, + &Handle, + (EFI_SMBIOS_TABLE_HEADER *)Buffer + ); if (SmbiosHandle != NULL) { *SmbiosHandle = Handle; @@ -132,7 +140,6 @@ SmbiosMiscAddRecord ( return Status; } - /** Fetches the number of handles of the specified SMBIOS type. * * @param SmbiosType The type of SMBIOS record to look for. @@ -143,7 +150,7 @@ SmbiosMiscAddRecord ( STATIC UINTN GetHandleCount ( - IN UINT8 SmbiosType + IN UINT8 SmbiosType ) { UINTN HandleCount; @@ -155,12 +162,13 @@ GetHandleCount ( // Iterate through entries to get the number do { - Status = mSmbiosMiscSmbios->GetNext (mSmbiosMiscSmbios, - &SmbiosHandle, - &SmbiosType, - &Record, - NULL - ); + Status = mSmbiosMiscSmbios->GetNext ( + mSmbiosMiscSmbios, + &SmbiosHandle, + &SmbiosType, + &Record, + NULL + ); if (Status == EFI_SUCCESS) { HandleCount++; @@ -178,10 +186,10 @@ GetHandleCount ( @param[out] *HandleCount Number of handles in the array **/ VOID -SmbiosMiscGetLinkTypeHandle( - IN UINT8 SmbiosType, - OUT SMBIOS_HANDLE **HandleArray, - OUT UINTN *HandleCount +SmbiosMiscGetLinkTypeHandle ( + IN UINT8 SmbiosType, + OUT SMBIOS_HANDLE **HandleArray, + OUT UINTN *HandleCount ) { UINTN Index; @@ -206,12 +214,13 @@ SmbiosMiscGetLinkTypeHandle( SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED; for (Index = 0; Index < (*HandleCount); Index++) { - Status = mSmbiosMiscSmbios->GetNext (mSmbiosMiscSmbios, - &SmbiosHandle, - &SmbiosType, - &Record, - NULL - ); + Status = mSmbiosMiscSmbios->GetNext ( + mSmbiosMiscSmbios, + &SmbiosHandle, + &SmbiosType, + &Record, + NULL + ); if (!EFI_ERROR (Status)) { (*HandleArray)[Index] = Record->Handle; @@ -220,4 +229,3 @@ SmbiosMiscGetLinkTypeHandle( } } } - diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c index edf0186..14ded60 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c @@ -11,18 +11,16 @@ **/ - #include "SmbiosMisc.h" - // // Static (possibly build generated) Bios Vendor data. // -SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE0, MiscBiosVendor) = { +SMBIOS_MISC_TABLE_DATA (SMBIOS_TABLE_TYPE0, MiscBiosVendor) = { { // Hdr - EFI_SMBIOS_TYPE_BIOS_INFORMATION, // Type, - 0, // Length, - 0 // Handle + EFI_SMBIOS_TYPE_BIOS_INFORMATION, // Type, + 0, // Length, + 0 // Handle }, 1, // Vendor 2, // BiosVersion @@ -30,38 +28,38 @@ SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE0, MiscBiosVendor) = { 3, // BiosReleaseDate 0, // BiosSize { // BiosCharacteristics - 0, // Reserved :2 - 0, // Unknown :1 - 0, // BiosCharacteristicsNotSupported :1 - 0, // IsaIsSupported :1 - 0, // McaIsSupported :1 - 0, // EisaIsSupported :1 - 1, // PciIsSupported :1 - 0, // PcmciaIsSupported :1 - 1, // PlugAndPlayIsSupported :1 - 0, // ApmIsSupported :1 - 1, // BiosIsUpgradable :1 - 1, // BiosShadowingAllowed :1 - 0, // VlVesaIsSupported :1 - 0, // EscdSupportIsAvailable :1 - 1, // BootFromCdIsSupported :1 - 1, // SelectableBootIsSupported :1 - 0, // RomBiosIsSocketed :1 - 0, // BootFromPcmciaIsSupported :1 - 0, // EDDSpecificationIsSupported :1 - 0, // JapaneseNecFloppyIsSupported :1 - 0, // JapaneseToshibaFloppyIsSupported :1 - 0, // Floppy525_360IsSupported :1 - 0, // Floppy525_12IsSupported :1 - 0, // Floppy35_720IsSupported :1 - 0, // Floppy35_288IsSupported :1 - 0, // PrintScreenIsSupported :1 - 0, // Keyboard8042IsSupported :1 - 0, // SerialIsSupported :1 - 0, // PrinterIsSupported :1 - 0, // CgaMonoIsSupported :1 - 0, // NecPc98 :1 - 0 // ReservedForVendor :32 + 0, // Reserved :2 + 0, // Unknown :1 + 0, // BiosCharacteristicsNotSupported :1 + 0, // IsaIsSupported :1 + 0, // McaIsSupported :1 + 0, // EisaIsSupported :1 + 1, // PciIsSupported :1 + 0, // PcmciaIsSupported :1 + 1, // PlugAndPlayIsSupported :1 + 0, // ApmIsSupported :1 + 1, // BiosIsUpgradable :1 + 1, // BiosShadowingAllowed :1 + 0, // VlVesaIsSupported :1 + 0, // EscdSupportIsAvailable :1 + 1, // BootFromCdIsSupported :1 + 1, // SelectableBootIsSupported :1 + 0, // RomBiosIsSocketed :1 + 0, // BootFromPcmciaIsSupported :1 + 0, // EDDSpecificationIsSupported :1 + 0, // JapaneseNecFloppyIsSupported :1 + 0, // JapaneseToshibaFloppyIsSupported :1 + 0, // Floppy525_360IsSupported :1 + 0, // Floppy525_12IsSupported :1 + 0, // Floppy35_720IsSupported :1 + 0, // Floppy35_288IsSupported :1 + 0, // PrintScreenIsSupported :1 + 0, // Keyboard8042IsSupported :1 + 0, // SerialIsSupported :1 + 0, // PrinterIsSupported :1 + 0, // CgaMonoIsSupported :1 + 0, // NecPc98 :1 + 0 // ReservedForVendor :32 }, { @@ -76,7 +74,7 @@ SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE0, MiscBiosVendor) = { // 0, // Boot1394IsSupported :1 // 0 // SmartBatteryIsSupported :1 // }, - 0x0C //BIOSCharacteristicsExtensionBytes[1] + 0x0C // BIOSCharacteristicsExtensionBytes[1] // { //SystemReserved // 0, //BiosBootSpecIsSupported :1 // 0, //FunctionKeyNetworkBootIsSupported :1 @@ -86,8 +84,8 @@ SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE0, MiscBiosVendor) = { // 0 //ExtensionByte2Reserved :3 // }, }, - 0xFF, // SystemBiosMajorRelease; - 0xFF, // SystemBiosMinorRelease; + 0xFF, // SystemBiosMajorRelease; + 0xFF, // SystemBiosMinorRelease; 0xFF, // EmbeddedControllerFirmwareMajorRelease; 0xFF // EmbeddedControllerFirmwareMinorRelease; }; diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c index 2506c03..b49c4b7 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c @@ -18,27 +18,26 @@ #include "SmbiosMisc.h" - typedef struct { - CONST CHAR8* MonthStr; - UINT32 MonthInt; + CONST CHAR8 *MonthStr; + UINT32 MonthInt; } MONTH_DESCRIPTION; STATIC CONST -MONTH_DESCRIPTION mMonthDescription[] = { - { "Jan", 1 }, - { "Feb", 2 }, - { "Mar", 3 }, - { "Apr", 4 }, - { "May", 5 }, - { "Jun", 6 }, - { "Jul", 7 }, - { "Aug", 8 }, - { "Sep", 9 }, +MONTH_DESCRIPTION mMonthDescription[] = { + { "Jan", 1 }, + { "Feb", 2 }, + { "Mar", 3 }, + { "Apr", 4 }, + { "May", 5 }, + { "Jun", 6 }, + { "Jul", 7 }, + { "Aug", 8 }, + { "Sep", 9 }, { "Oct", 10 }, { "Nov", 11 }, { "Dec", 12 }, - { "???", 1 }, // Use 1 as default month + { "???", 1 }, // Use 1 as default month }; /** @@ -55,7 +54,7 @@ Base2ToByteWith64KUnit ( IN UINTN Value ) { - UINT8 Size; + UINT8 Size; Size = ((Value + (SIZE_64KB - 1)) >> 16); @@ -69,12 +68,12 @@ Base2ToByteWith64KUnit ( **/ VOID GetReleaseTime ( - OUT EFI_TIME *Time + OUT EFI_TIME *Time ) { - CONST CHAR8 *ReleaseDate = __DATE__; - CONST CHAR8 *ReleaseTime = __TIME__; - UINTN i; + CONST CHAR8 *ReleaseDate = __DATE__; + CONST CHAR8 *ReleaseTime = __TIME__; + UINTN i; for (i = 0; i < 12; i++) { if (AsciiStrnCmp (ReleaseDate, mMonthDescription[i].MonthStr, 3) == 0) { @@ -82,10 +81,10 @@ GetReleaseTime ( } } - Time->Month = mMonthDescription[i].MonthInt; - Time->Day = AsciiStrDecimalToUintn (ReleaseDate + 4); - Time->Year = AsciiStrDecimalToUintn (ReleaseDate + 7); - Time->Hour = AsciiStrDecimalToUintn (ReleaseTime); + Time->Month = mMonthDescription[i].MonthInt; + Time->Day = AsciiStrDecimalToUintn (ReleaseDate + 4); + Time->Year = AsciiStrDecimalToUintn (ReleaseDate + 7); + Time->Hour = AsciiStrDecimalToUintn (ReleaseTime); Time->Minute = AsciiStrDecimalToUintn (ReleaseTime + 3); Time->Second = AsciiStrDecimalToUintn (ReleaseTime + 6); } @@ -101,23 +100,24 @@ GetBiosReleaseDate ( VOID ) { - CHAR16 *ReleaseDate; - EFI_TIME BuildTime; + CHAR16 *ReleaseDate; + EFI_TIME BuildTime; ReleaseDate = AllocateZeroPool ((sizeof (CHAR16)) * SMBIOS_STRING_MAX_LENGTH); if (ReleaseDate == NULL) { - return NULL; + return NULL; } GetReleaseTime (&BuildTime); - (VOID)UnicodeSPrintAsciiFormat (ReleaseDate, - (sizeof (CHAR16)) * SMBIOS_STRING_MAX_LENGTH, - "%02d/%02d/%4d", - BuildTime.Month, - BuildTime.Day, - BuildTime.Year - ); + (VOID)UnicodeSPrintAsciiFormat ( + ReleaseDate, + (sizeof (CHAR16)) * SMBIOS_STRING_MAX_LENGTH, + "%02d/%02d/%4d", + BuildTime.Month, + BuildTime.Day, + BuildTime.Year + ); return ReleaseDate; } @@ -133,14 +133,13 @@ GetBiosVersion ( VOID ) { - CHAR16 *ReleaseString; + CHAR16 *ReleaseString; ReleaseString = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString); return ReleaseString; } - /** This function makes boot time changes to the contents of the MiscBiosVendor (Type 0) record. @@ -153,23 +152,22 @@ GetBiosVersion ( @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory. **/ -SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) -{ - CHAR8 *OptionalStrStart; - CHAR8 *StrStart; - UINTN VendorStrLen; - UINTN VerStrLen; - UINTN DateStrLen; - UINTN BiosPhysicalSize; - CHAR16 *Vendor; - CHAR16 *Version; - CHAR16 *ReleaseDate; - CHAR16 *Char16String; - EFI_STATUS Status; - EFI_STRING_ID TokenToUpdate; - EFI_STRING_ID TokenToGet; - SMBIOS_TABLE_TYPE0 *SmbiosRecord; - SMBIOS_TABLE_TYPE0 *InputData; +SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { + CHAR8 *OptionalStrStart; + CHAR8 *StrStart; + UINTN VendorStrLen; + UINTN VerStrLen; + UINTN DateStrLen; + UINTN BiosPhysicalSize; + CHAR16 *Vendor; + CHAR16 *Version; + CHAR16 *ReleaseDate; + CHAR16 *Char16String; + EFI_STATUS Status; + EFI_STRING_ID TokenToUpdate; + EFI_STRING_ID TokenToGet; + SMBIOS_TABLE_TYPE0 *SmbiosRecord; + SMBIOS_TABLE_TYPE0 *InputData; // // First check for invalid parameters. @@ -180,20 +178,20 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) InputData = (SMBIOS_TABLE_TYPE0 *)RecordData; - Vendor = (CHAR16 *) PcdGetPtr (PcdFirmwareVendor); + Vendor = (CHAR16 *)PcdGetPtr (PcdFirmwareVendor); if (StrLen (Vendor) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VENDOR); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL); } - Version = GetBiosVersion(); + Version = GetBiosVersion (); if (StrLen (Version) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); } else { - Version = (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString); + Version = (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString); if (StrLen (Version) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); @@ -201,22 +199,22 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) } Char16String = GetBiosReleaseDate (); - if (StrLen(Char16String) > 0) { + if (StrLen (Char16String) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Char16String, NULL); } - TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR); - Vendor = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR); + Vendor = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); VendorStrLen = StrLen (Vendor); TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION); - Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - VerStrLen = StrLen (Version); + Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + VerStrLen = StrLen (Version); - TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE); + TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE); ReleaseDate = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - DateStrLen = StrLen (ReleaseDate); + DateStrLen = StrLen (ReleaseDate); // // Now update the BiosPhysicalSize @@ -226,9 +224,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) // // Two zeros following the last string. // - SmbiosRecord = AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + - VerStrLen + 1 + - DateStrLen + 1 + 1); + SmbiosRecord = AllocateZeroPool ( + sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + + VerStrLen + 1 + + DateStrLen + 1 + 1 + ); if (SmbiosRecord == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -236,7 +236,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) (VOID)CopyMem (SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE0)); - SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0); + SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0); SmbiosRecord->BiosSegment = (UINT16)(FixedPcdGet32 (PcdFdBaseAddress) / SIZE_64KB); if (BiosPhysicalSize < SIZE_16MB) { SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1; @@ -251,13 +251,13 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) } } - SmbiosRecord->SystemBiosMajorRelease = (UINT8) (PcdGet16 (PcdSystemBiosRelease) >> 8); - SmbiosRecord->SystemBiosMinorRelease = (UINT8) (PcdGet16 (PcdSystemBiosRelease) & 0xFF); + SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8); + SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF); SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16) - (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8); + (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8); SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16) - (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF); + (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF); OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1); UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1); @@ -268,10 +268,15 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) // // Now we have got the full smbios record, call smbios protocol to add this record. // - Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); + Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n", - __FUNCTION__, DEBUG_LINE_NUMBER, Status)); + DEBUG (( + DEBUG_ERROR, + "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n", + __FUNCTION__, + DEBUG_LINE_NUMBER, + Status + )); } FreePool (SmbiosRecord); diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerData.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerData.c index c03b133..00f448a 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerData.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerData.c @@ -13,22 +13,21 @@ #include "SmbiosMisc.h" - // // Static (possibly build generated) System Manufacturer data. // -SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE1, MiscSystemManufacturer) = { +SMBIOS_MISC_TABLE_DATA (SMBIOS_TABLE_TYPE1, MiscSystemManufacturer) = { { // Hdr - EFI_SMBIOS_TYPE_SYSTEM_INFORMATION, // Type, - 0, // Length, - 0 // Handle + EFI_SMBIOS_TYPE_SYSTEM_INFORMATION, // Type, + 0, // Length, + 0 // Handle }, 1, // Manufacturer 2, // ProductName 3, // Version 4, // SerialNumber { // Uuid - 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, SystemWakeupTypePowerSwitch, // SystemWakeupType 5, // SKUNumber, diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c index 555557a..6d08a75 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c @@ -35,30 +35,29 @@ @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory. **/ -SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer) -{ - CHAR8 *OptionalStrStart; - CHAR8 *StrStart; - UINTN ManuStrLen; - UINTN VerStrLen; - UINTN PdNameStrLen; - UINTN SerialNumStrLen; - UINTN SKUNumStrLen; - UINTN FamilyStrLen; - UINTN RecordLength; - EFI_STRING Manufacturer; - EFI_STRING ProductName; - EFI_STRING Version; - EFI_STRING SerialNumber; - EFI_STRING SKUNumber; - EFI_STRING Family; - EFI_STRING_ID TokenToGet; - SMBIOS_TABLE_TYPE1 *SmbiosRecord; - SMBIOS_TABLE_TYPE1 *InputData; - EFI_STATUS Status; - EFI_STRING_ID TokenToUpdate; - CHAR16 *Product; - CHAR16 *pVersion; +SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) { + CHAR8 *OptionalStrStart; + CHAR8 *StrStart; + UINTN ManuStrLen; + UINTN VerStrLen; + UINTN PdNameStrLen; + UINTN SerialNumStrLen; + UINTN SKUNumStrLen; + UINTN FamilyStrLen; + UINTN RecordLength; + EFI_STRING Manufacturer; + EFI_STRING ProductName; + EFI_STRING Version; + EFI_STRING SerialNumber; + EFI_STRING SKUNumber; + EFI_STRING Family; + EFI_STRING_ID TokenToGet; + SMBIOS_TABLE_TYPE1 *SmbiosRecord; + SMBIOS_TABLE_TYPE1 *InputData; + EFI_STATUS Status; + EFI_STRING_ID TokenToUpdate; + CHAR16 *Product; + CHAR16 *pVersion; Status = EFI_SUCCESS; @@ -71,30 +70,38 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer) InputData = (SMBIOS_TABLE_TYPE1 *)RecordData; - Product = (CHAR16 *) PcdGetPtr (PcdSystemProductName); + Product = (CHAR16 *)PcdGetPtr (PcdSystemProductName); if (StrLen (Product) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Product, NULL); } - pVersion = (CHAR16 *) PcdGetPtr (PcdSystemVersion); + pVersion = (CHAR16 *)PcdGetPtr (PcdSystemVersion); if (StrLen (pVersion) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_VERSION); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, pVersion, NULL); } - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, - STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER), - SerialNumType01); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, - STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER), - SystemManufacturerType01); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, - STRING_TOKEN (STR_MISC_SYSTEM_SKU_NUMBER), - SkuNumberType01); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, - STRING_TOKEN (STR_MISC_SYSTEM_FAMILY), - FamilyType01); + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER), + SerialNumType01 + ); + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER), + SystemManufacturerType01 + ); + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_SYSTEM_SKU_NUMBER), + SkuNumberType01 + ); + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_SYSTEM_FAMILY), + FamilyType01 + ); TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER); Manufacturer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); @@ -141,12 +148,12 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer) SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1); - CopyGuid(&SmbiosRecord->Uuid, &InputData->Uuid); + CopyGuid (&SmbiosRecord->Uuid, &InputData->Uuid); OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1); UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1); StrStart = OptionalStrStart + ManuStrLen + 1; - UnicodeStrToAsciiStrS (ProductName, StrStart, PdNameStrLen + 1); + UnicodeStrToAsciiStrS (ProductName, StrStart, PdNameStrLen + 1); StrStart += PdNameStrLen + 1; UnicodeStrToAsciiStrS (Version, StrStart, VerStrLen + 1); StrStart += VerStrLen + 1; @@ -159,10 +166,15 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer) // // Now we have got the full smbios record, call smbios protocol to add this record. // - Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); + Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n", - __FUNCTION__, DEBUG_LINE_NUMBER, Status)); + DEBUG (( + DEBUG_ERROR, + "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n", + __FUNCTION__, + DEBUG_LINE_NUMBER, + Status + )); } FreePool (SmbiosRecord); diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerData.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerData.c index dfe1f2d..2c3f181 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerData.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerData.c @@ -17,7 +17,7 @@ // // Static (possibly build generated) Chassis Manufacturer data. // -SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE2, MiscBaseBoardManufacturer) = { +SMBIOS_MISC_TABLE_DATA (SMBIOS_TABLE_TYPE2, MiscBaseBoardManufacturer) = { { // Hdr EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION, // Type, 0, // Length, diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c index f11295b..99ba99e 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c @@ -23,7 +23,6 @@ #include "SmbiosMisc.h" - /** This function makes boot time changes to the contents of the MiscBaseBoardManufacturer (Type 2) record. @@ -36,35 +35,34 @@ @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory. **/ -SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer) -{ - CHAR8 *OptionalStrStart; - CHAR8 *StrStart; - UINTN RecordLength; - UINTN ManuStrLen; - UINTN ProductNameStrLen; - UINTN VerStrLen; - UINTN SerialNumStrLen; - UINTN AssetTagStrLen; - UINTN ChassisLocaStrLen; - UINTN HandleCount; - UINT16 *HandleArray; - CHAR16 *BaseBoardManufacturer; - CHAR16 *BaseBoardProductName; - CHAR16 *Version; - EFI_STRING SerialNumber; - EFI_STRING AssetTag; - EFI_STRING ChassisLocation; - EFI_STRING_ID TokenToGet; - SMBIOS_TABLE_TYPE2 *SmbiosRecord; - SMBIOS_TABLE_TYPE2 *InputData; - EFI_STATUS Status; - - EFI_STRING_ID TokenToUpdate; +SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) { + CHAR8 *OptionalStrStart; + CHAR8 *StrStart; + UINTN RecordLength; + UINTN ManuStrLen; + UINTN ProductNameStrLen; + UINTN VerStrLen; + UINTN SerialNumStrLen; + UINTN AssetTagStrLen; + UINTN ChassisLocaStrLen; + UINTN HandleCount; + UINT16 *HandleArray; + CHAR16 *BaseBoardManufacturer; + CHAR16 *BaseBoardProductName; + CHAR16 *Version; + EFI_STRING SerialNumber; + EFI_STRING AssetTag; + EFI_STRING ChassisLocation; + EFI_STRING_ID TokenToGet; + SMBIOS_TABLE_TYPE2 *SmbiosRecord; + SMBIOS_TABLE_TYPE2 *InputData; + EFI_STATUS Status; + + EFI_STRING_ID TokenToUpdate; HandleCount = 0; HandleArray = NULL; - InputData = NULL; + InputData = NULL; // // First check for invalid parameters. @@ -73,73 +71,79 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer) return EFI_INVALID_PARAMETER; } - InputData = (SMBIOS_TABLE_TYPE2*)RecordData; + InputData = (SMBIOS_TABLE_TYPE2 *)RecordData; - BaseBoardManufacturer = (CHAR16 *) PcdGetPtr (PcdBaseBoardManufacturer); + BaseBoardManufacturer = (CHAR16 *)PcdGetPtr (PcdBaseBoardManufacturer); if (StrLen (BaseBoardManufacturer) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardManufacturer, NULL); } - BaseBoardProductName = (CHAR16 *) PcdGetPtr (PcdBaseBoardProductName); + BaseBoardProductName = (CHAR16 *)PcdGetPtr (PcdBaseBoardProductName); if (StrLen (BaseBoardProductName) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardProductName, NULL); } - Version = (CHAR16 *) PcdGetPtr (PcdBaseBoardVersion); + Version = (CHAR16 *)PcdGetPtr (PcdBaseBoardVersion); if (StrLen (Version) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); } - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG), AssertTagType02 ); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER), SerialNumberType02 ); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER), BoardManufacturerType02 ); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER), SerialNumberType02 ); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, STRING_TOKEN (STR_MISC_BASE_BOARD_SKU_NUMBER), SerialNumberType02 ); - OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION), ChassisLocationType02 ); - TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER); + TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER); BaseBoardManufacturer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - ManuStrLen = StrLen (BaseBoardManufacturer); + ManuStrLen = StrLen (BaseBoardManufacturer); - TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME); + TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME); BaseBoardProductName = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - ProductNameStrLen = StrLen (BaseBoardProductName); + ProductNameStrLen = StrLen (BaseBoardProductName); TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION); - Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - VerStrLen = StrLen (Version); + Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + VerStrLen = StrLen (Version); - TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER); - SerialNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER); + SerialNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); SerialNumStrLen = StrLen (SerialNumber); - TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG); - AssetTag = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG); + AssetTag = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); AssetTagStrLen = StrLen (AssetTag); - TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION); - ChassisLocation = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION); + ChassisLocation = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); ChassisLocaStrLen = StrLen (ChassisLocation); // @@ -159,14 +163,17 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer) } (VOID)CopyMem (SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE2)); - SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE2); + SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE2); // // Update Contained objects Handle // SmbiosRecord->NumberOfContainedObjectHandles = 0; - SmbiosMiscGetLinkTypeHandle (EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, &HandleArray, - &HandleCount); + SmbiosMiscGetLinkTypeHandle ( + EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, + &HandleArray, + &HandleCount + ); // It's assumed there's at most a single chassis ASSERT (HandleCount < 2); if (HandleCount > 0) { @@ -195,8 +202,13 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer) Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n", - __FUNCTION__, DEBUG_LINE_NUMBER, Status)); + DEBUG (( + DEBUG_ERROR, + "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n", + __FUNCTION__, + DEBUG_LINE_NUMBER, + Status + )); } FreePool (SmbiosRecord); diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerData.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerData.c index 29449b8..67cb5fe 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerData.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerData.c @@ -13,11 +13,10 @@ #include "SmbiosMisc.h" - // // Static (possibly build generated) Chassis Manufacturer data. // -SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE3, MiscChassisManufacturer) = { +SMBIOS_MISC_TABLE_DATA (SMBIOS_TABLE_TYPE3, MiscChassisManufacturer) = { { // Hdr EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, // Type, 0, // Length, diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c index d640461..d161970 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c @@ -35,30 +35,29 @@ @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory. **/ -SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer) -{ - CHAR8 *OptionalStrStart; - CHAR8 *StrStart; - UINT8 *SkuNumberField; - UINTN RecordLength; - UINTN ManuStrLen; - UINTN VerStrLen; - UINTN AssertTagStrLen; - UINTN SerialNumStrLen; - UINTN ChaNumStrLen; - EFI_STRING Manufacturer; - EFI_STRING Version; - EFI_STRING SerialNumber; - EFI_STRING AssertTag; - EFI_STRING ChassisSkuNumber; - EFI_STRING_ID TokenToGet; - SMBIOS_TABLE_TYPE3 *SmbiosRecord; - SMBIOS_TABLE_TYPE3 *InputData; - EFI_STATUS Status; - - UINT8 ContainedElementCount; - CONTAINED_ELEMENT ContainedElements; - UINT8 ExtendLength; +SMBIOS_MISC_TABLE_FUNCTION (MiscChassisManufacturer) { + CHAR8 *OptionalStrStart; + CHAR8 *StrStart; + UINT8 *SkuNumberField; + UINTN RecordLength; + UINTN ManuStrLen; + UINTN VerStrLen; + UINTN AssertTagStrLen; + UINTN SerialNumStrLen; + UINTN ChaNumStrLen; + EFI_STRING Manufacturer; + EFI_STRING Version; + EFI_STRING SerialNumber; + EFI_STRING AssertTag; + EFI_STRING ChassisSkuNumber; + EFI_STRING_ID TokenToGet; + SMBIOS_TABLE_TYPE3 *SmbiosRecord; + SMBIOS_TABLE_TYPE3 *InputData; + EFI_STATUS Status; + + UINT8 ContainedElementCount; + CONTAINED_ELEMENT ContainedElements; + UINT8 ExtendLength; ExtendLength = 0; @@ -97,28 +96,28 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer) SkuNumberType03 ); - TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER); + TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER); Manufacturer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - ManuStrLen = StrLen (Manufacturer); + ManuStrLen = StrLen (Manufacturer); TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_VERSION); - Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - VerStrLen = StrLen (Version); + Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + VerStrLen = StrLen (Version); - TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER); - SerialNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER); + SerialNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); SerialNumStrLen = StrLen (SerialNumber); - TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG); - AssertTag = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); + TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG); + AssertTag = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); AssertTagStrLen = StrLen (AssertTag); - TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SKU_NUMBER); + TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SKU_NUMBER); ChassisSkuNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); - ChaNumStrLen = StrLen (ChassisSkuNumber); + ChaNumStrLen = StrLen (ChassisSkuNumber); ContainedElementCount = InputData->ContainedElementCount; - ExtendLength = ContainedElementCount * sizeof (CONTAINED_ELEMENT); + ExtendLength = ContainedElementCount * sizeof (CONTAINED_ELEMENT); // // Two zeros following the last string. @@ -142,11 +141,11 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer) SmbiosRecord->Type = OemGetChassisType (); - //ContainedElements + // ContainedElements ASSERT (ContainedElementCount < 2); (VOID)CopyMem (SmbiosRecord + 1, &ContainedElements, ExtendLength); - //ChassisSkuNumber + // ChassisSkuNumber SkuNumberField = (UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT) + ExtendLength; @@ -154,7 +153,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer) *SkuNumberField = 5; OptionalStrStart = (CHAR8 *)((UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) + - ExtendLength + 1); + ExtendLength + 1); UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1); StrStart = OptionalStrStart + ManuStrLen + 1; UnicodeStrToAsciiStrS (Version, StrStart, VerStrLen + 1); @@ -165,20 +164,25 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer) StrStart += AssertTagStrLen + 1; UnicodeStrToAsciiStrS (ChassisSkuNumber, StrStart, ChaNumStrLen + 1); - SmbiosRecord->BootupState = OemGetChassisBootupState (); - SmbiosRecord->PowerSupplyState = OemGetChassisPowerSupplyState (); - SmbiosRecord->ThermalState = OemGetChassisThermalState (); - SmbiosRecord->SecurityStatus = OemGetChassisSecurityStatus (); - SmbiosRecord->Height = OemGetChassisHeight (); + SmbiosRecord->BootupState = OemGetChassisBootupState (); + SmbiosRecord->PowerSupplyState = OemGetChassisPowerSupplyState (); + SmbiosRecord->ThermalState = OemGetChassisThermalState (); + SmbiosRecord->SecurityStatus = OemGetChassisSecurityStatus (); + SmbiosRecord->Height = OemGetChassisHeight (); SmbiosRecord->NumberofPowerCords = OemGetChassisNumPowerCords (); // // Now we have got the full smbios record, call smbios protocol to add this record. // - Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); + Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n", - __FUNCTION__, DEBUG_LINE_NUMBER, Status)); + DEBUG (( + DEBUG_ERROR, + "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n", + __FUNCTION__, + DEBUG_LINE_NUMBER, + Status + )); } FreePool (SmbiosRecord); diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesData.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesData.c index 97d7303..014dec5 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesData.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesData.c @@ -17,12 +17,12 @@ // Static (possibly build generated) Bios Vendor data. // -SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE13, MiscNumberOfInstallableLanguages) = +SMBIOS_MISC_TABLE_DATA (SMBIOS_TABLE_TYPE13, MiscNumberOfInstallableLanguages) = { { // Hdr - EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION, // Type, - 0, // Length, - 0 // Handle + EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION, // Type, + 0, // Length, + 0 // Handle }, 0, // InstallableLanguages 0, // Flags diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c index 017b410..386b880 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c @@ -32,14 +32,14 @@ VOID EFIAPI GetNextLanguage ( - IN OUT CHAR8 **LangCode, - OUT CHAR8 *Lang + IN OUT CHAR8 **LangCode, + OUT CHAR8 *Lang ) { UINTN Index; CHAR8 *StringPtr; - if (LangCode == NULL || *LangCode == NULL || Lang == NULL) { + if ((LangCode == NULL) || (*LangCode == NULL) || (Lang == NULL)) { return; } @@ -55,6 +55,7 @@ GetNextLanguage ( if (StringPtr[Index] == ';') { Index++; } + *LangCode = StringPtr + Index; } @@ -69,7 +70,7 @@ GetNextLanguage ( UINT16 EFIAPI GetSupportedLanguageNumber ( - IN EFI_HII_HANDLE HiiHandle + IN EFI_HII_HANDLE HiiHandle ) { CHAR8 *Lang; @@ -83,20 +84,21 @@ GetSupportedLanguageNumber ( } LangNumber = 0; - Lang = AllocatePool (AsciiStrSize (Languages)); + Lang = AllocatePool (AsciiStrSize (Languages)); if (Lang != NULL) { LanguageString = Languages; while (*LanguageString != 0) { GetNextLanguage (&LanguageString, Lang); LangNumber++; } + FreePool (Lang); } + FreePool (Languages); return LangNumber; } - /** This function makes boot time changes to the contents of the MiscNumberOfInstallableLanguages (Type 13) record. @@ -109,14 +111,13 @@ GetSupportedLanguageNumber ( @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory. **/ -SMBIOS_MISC_TABLE_FUNCTION(MiscNumberOfInstallableLanguages) -{ - UINTN LangStrLen; - CHAR8 CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1]; - CHAR8 *OptionalStrStart; - EFI_STATUS Status; - SMBIOS_TABLE_TYPE13 *SmbiosRecord; - SMBIOS_TABLE_TYPE13 *InputData; +SMBIOS_MISC_TABLE_FUNCTION (MiscNumberOfInstallableLanguages) { + UINTN LangStrLen; + CHAR8 CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1]; + CHAR8 *OptionalStrStart; + EFI_STATUS Status; + SMBIOS_TABLE_TYPE13 *SmbiosRecord; + SMBIOS_TABLE_TYPE13 *InputData; InputData = NULL; @@ -155,10 +156,15 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscNumberOfInstallableLanguages) // // Now we have got the full smbios record, call smbios protocol to add this record. // - Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); + Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n", - __FUNCTION__, DEBUG_LINE_NUMBER, Status)); + DEBUG (( + DEBUG_ERROR, + "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n", + __FUNCTION__, + DEBUG_LINE_NUMBER, + Status + )); } FreePool (SmbiosRecord); diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c index ebe4ad9..5e1a6e4 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationData.c @@ -14,11 +14,11 @@ // // Static (possibly build generated) Bios Vendor data. // -SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE32, MiscBootInformation) = { +SMBIOS_MISC_TABLE_DATA (SMBIOS_TABLE_TYPE32, MiscBootInformation) = { { // Hdr - EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, // Type, - 0, // Length, - 0 // Handle + EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, // Type, + 0, // Length, + 0 // Handle }, { // Reserved[6] 0, diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c index c4ce6a5..fdf6262 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c @@ -33,11 +33,10 @@ @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; +SMBIOS_MISC_TABLE_FUNCTION (MiscBootInformation) { + EFI_STATUS Status; + SMBIOS_TABLE_TYPE32 *SmbiosRecord; + SMBIOS_TABLE_TYPE32 *InputData; // // First check for invalid parameters. @@ -65,10 +64,15 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation) // // Now we have got the full smbios record, call smbios protocol to add this record. // - Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); + Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n", - __FUNCTION__, DEBUG_LINE_NUMBER, Status)); + DEBUG (( + DEBUG_ERROR, + "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n", + __FUNCTION__, + DEBUG_LINE_NUMBER, + Status + )); } FreePool (SmbiosRecord); -- cgit v1.1