39SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
40 CHAR8 *OptionalStrStart;
44 UINTN ProductNameStrLen;
46 UINTN SerialNumStrLen;
48 UINTN ChassisLocaStrLen;
51 CHAR16 *BaseBoardManufacturer;
52 CHAR16 *BaseBoardProductName;
54 EFI_STRING SerialNumber;
56 EFI_STRING ChassisLocation;
57 EFI_STRING_ID TokenToGet;
62 EFI_STRING_ID TokenToUpdate;
71 if (RecordData ==
NULL) {
72 return EFI_INVALID_PARAMETER;
77 BaseBoardManufacturer = (CHAR16 *)
PcdGetPtr (PcdBaseBoardManufacturer);
78 if (
StrLen (BaseBoardManufacturer) > 0) {
79 TokenToUpdate =
STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
80 HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardManufacturer,
NULL);
85 BoardManufacturerType02
89 BaseBoardProductName = (CHAR16 *)
PcdGetPtr (PcdBaseBoardProductName);
90 if (
StrLen (BaseBoardProductName) > 0) {
91 TokenToUpdate =
STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
92 HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardProductName,
NULL);
101 Version = (CHAR16 *)
PcdGetPtr (PcdBaseBoardVersion);
102 if (
StrLen (Version) > 0) {
103 TokenToUpdate =
STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
107 mSmbiosMiscHiiHandle,
114 mSmbiosMiscHiiHandle,
119 mSmbiosMiscHiiHandle,
124 mSmbiosMiscHiiHandle,
129 mSmbiosMiscHiiHandle,
131 ChassisLocationType02
134 TokenToGet =
STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
136 ManuStrLen =
StrLen (BaseBoardManufacturer);
138 TokenToGet =
STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
140 ProductNameStrLen =
StrLen (BaseBoardProductName);
142 TokenToGet =
STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
144 VerStrLen =
StrLen (Version);
146 TokenToGet =
STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER);
148 SerialNumStrLen =
StrLen (SerialNumber);
150 TokenToGet =
STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG);
152 AssetTagStrLen =
StrLen (AssetTag);
154 TokenToGet =
STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION);
156 ChassisLocaStrLen =
StrLen (ChassisLocation);
163 ProductNameStrLen + 1 +
165 SerialNumStrLen + 1 +
167 ChassisLocaStrLen + 1 + 1;
169 if (SmbiosRecord ==
NULL) {
170 Status = EFI_OUT_OF_RESOURCES;
180 SmbiosRecord->NumberOfContainedObjectHandles = 0;
182 EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE,
187 ASSERT (HandleCount < 2);
188 if (HandleCount > 0) {
189 SmbiosRecord->ChassisHandle = HandleArray[0];
194 OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
197 StrStart = OptionalStrStart + ManuStrLen + 1;
200 StrStart += ProductNameStrLen + 1;
203 StrStart += VerStrLen + 1;
206 StrStart += SerialNumStrLen + 1;
209 StrStart += AssetTagStrLen + 1;
213 if (EFI_ERROR (Status)) {
216 "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
226 if (BaseBoardManufacturer !=
NULL) {
230 if (BaseBoardProductName !=
NULL) {
234 if (Version !=
NULL) {
238 if (SerialNumber !=
NULL) {
242 if (AssetTag !=
NULL) {
246 if (ChassisLocation !=
NULL) {
RETURN_STATUS EFIAPI UnicodeStrToAsciiStrS(IN CONST CHAR16 *Source, OUT CHAR8 *Destination, IN UINTN DestMax)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STRING EFIAPI HiiGetPackageString(IN CONST EFI_GUID *PackageListGuid, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
EFI_STRING_ID EFIAPI HiiSetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId OPTIONAL, IN CONST EFI_STRING String, IN CONST CHAR8 *SupportedLanguages OPTIONAL)
#define DEBUG(Expression)
VOID EFIAPI OemUpdateSmbiosInfo(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID TokenToUpdate, IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field)
#define PcdGetPtr(TokenName)
VOID SmbiosMiscGetLinkTypeHandle(IN UINT8 SmbiosType, OUT UINT16 **HandleArray, OUT UINTN *HandleCount)
EFI_STATUS SmbiosMiscAddRecord(IN UINT8 *Buffer, IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle OPTIONAL)
VOID EFIAPI Exit(IN EFI_STATUS Status)