VOID CpuUpdateSmbios ( IN UINTN MaxCpus ) { mCpuSmbiosType4.CoreCount = MaxCpus; mCpuSmbiosType4.EnabledCoreCount = MaxCpus; mCpuSmbiosType4.ThreadCount = MaxCpus; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mCpuSmbiosType4, mCpuSmbiosType4Strings); }
VOID InstallProcessorSmbios ( IN VOID *Smbios ) { SMBIOS_STRUCTURE_POINTER SmbiosTable; CHAR8 *AString; CHAR16 *UString; STRING_REF Token; // // Processor info (TYPE 4) // SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 4, 0); if (SmbiosTable.Raw == NULL) { DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 4 (Processor Info) not found!\n")); return ; } // // Log Smbios Record Type4 // LogSmbiosData(gSmbios,(UINT8*)SmbiosTable.Type4); // // Set ProcessorVersion string // AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type4->ProcessorVersion); UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16)); ASSERT (UString != NULL); AsciiStrToUnicodeStr (AString, UString); Token = HiiSetString (gStringHandle, 0, UString, NULL); if (Token == 0) { gBS->FreePool (UString); return ; } gBS->FreePool (UString); return ; }
VOID InstallMemorySmbios ( IN VOID *Smbios ) { SMBIOS_STRUCTURE_POINTER SmbiosTable; // // Generate Memory Array Mapped Address info (TYPE 19) // SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 19, 0); if (SmbiosTable.Raw == NULL) { DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 19 (Memory Array Mapped Address Info) not found!\n")); return ; } // // Record Smbios Type 19 // LogSmbiosData(gSmbios, (UINT8*)SmbiosTable.Type19); return ; }
VOID InstallBaseBoardSmbios ( IN VOID *Smbios ) { SMBIOS_STRUCTURE_POINTER SmbiosTable; // // Generate Base Board info (TYPE 2) // SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 2, 0); if (SmbiosTable.Raw == NULL) { DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 2 (BaseBoard Information) not found!\n")); return ; } // // Record Smbios Type 19 // LogSmbiosData(gSmbios, (UINT8*)SmbiosTable.Type2); return ; }
VOID InstallMiscSmbios ( IN VOID *Smbios ) { SMBIOS_STRUCTURE_POINTER SmbiosTable; CHAR8 *AString; CHAR16 *UString; STRING_REF Token; // // BIOS information (TYPE 0) // SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 0, 0); if (SmbiosTable.Raw == NULL) { DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 0 (BIOS Information) not found!\n")); return ; } // // Record Type 2 // AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type0->BiosVersion); UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_BIOS_VERSIONE)); ASSERT (UString != NULL); CopyMem (UString, FIRMWARE_BIOS_VERSIONE, sizeof(FIRMWARE_BIOS_VERSIONE)); AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_BIOS_VERSIONE) / sizeof(CHAR16) - 1); Token = HiiSetString (gStringHandle, 0, UString, NULL); if (Token == 0) { gBS->FreePool (UString); return ; } gBS->FreePool (UString); // // Log Smios Type 0 // LogSmbiosData(gSmbios, (UINT8*)SmbiosTable.Type0); // // System information (TYPE 1) // SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 1, 0); if (SmbiosTable.Raw == NULL) { DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 1 (System Information) not found!\n")); return ; } // // Record Type 3 // AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type1->ProductName); UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_PRODUCT_NAME)); ASSERT (UString != NULL); CopyMem (UString, FIRMWARE_PRODUCT_NAME, sizeof(FIRMWARE_PRODUCT_NAME)); AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_PRODUCT_NAME) / sizeof(CHAR16) - 1); Token = HiiSetString (gStringHandle, 0, UString, NULL); if (Token == 0) { gBS->FreePool (UString); return ; } gBS->FreePool (UString); // // Log Smbios Type 1 // LogSmbiosData(gSmbios, (UINT8*)SmbiosTable.Type1); return ; }