diff options
Diffstat (limited to 'ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c')
-rw-r--r-- | ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c | 98 |
1 files changed, 55 insertions, 43 deletions
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);
|