39SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
40 CHAR8 *OptionalStrStart;
45 UINTN SerialNumStrLen;
49 EFI_STRING Manufacturer;
50 EFI_STRING ProductName;
52 EFI_STRING SerialNumber;
55 EFI_STRING_ID TokenToGet;
59 EFI_STRING_ID TokenToUpdate;
68 if (RecordData ==
NULL) {
69 return EFI_INVALID_PARAMETER;
74 Product = (CHAR16 *)
PcdGetPtr (PcdSystemProductName);
75 if (
StrLen (Product) > 0) {
76 TokenToUpdate =
STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
86 pVersion = (CHAR16 *)
PcdGetPtr (PcdSystemVersion);
87 if (
StrLen (pVersion) > 0) {
104 mSmbiosMiscHiiHandle,
106 SystemManufacturerType01
109 mSmbiosMiscHiiHandle,
114 mSmbiosMiscHiiHandle,
119 TokenToGet =
STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);
121 ManuStrLen =
StrLen (Manufacturer);
123 TokenToGet =
STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
125 PdNameStrLen =
StrLen (ProductName);
129 VerStrLen =
StrLen (Version);
131 TokenToGet =
STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);
133 SerialNumStrLen =
StrLen (SerialNumber);
137 SKUNumStrLen =
StrLen (SKUNumber);
141 FamilyStrLen =
StrLen (Family);
150 SerialNumStrLen + 1 +
152 FamilyStrLen + 1 + 1;
155 if (SmbiosRecord ==
NULL) {
156 Status = EFI_OUT_OF_RESOURCES;
166 OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
168 StrStart = OptionalStrStart + ManuStrLen + 1;
170 StrStart += PdNameStrLen + 1;
172 StrStart += VerStrLen + 1;
174 StrStart += SerialNumStrLen + 1;
176 StrStart += SKUNumStrLen + 1;
183 if (EFI_ERROR (Status)) {
186 "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
196 if (Manufacturer !=
NULL) {
200 if (ProductName !=
NULL) {
204 if (Version !=
NULL) {
208 if (SerialNumber !=
NULL) {
212 if (SKUNumber !=
NULL) {
216 if (Family !=
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)
VOID EFIAPI OemGetSystemUuid(OUT GUID *SystemUuid)
#define PcdGetPtr(TokenName)
EFI_STATUS SmbiosMiscAddRecord(IN UINT8 *Buffer, IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle OPTIONAL)
VOID EFIAPI Exit(IN EFI_STATUS Status)