--- /dev/null
+/** @file\r
+ Based on files under Nt32Pkg/MiscSubClassPlatformDxe/\r
+\r
+ Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>\r
+ Copyright (c) 2015, Linaro Limited. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include "SmbiosMisc.h"\r
+\r
+//\r
+// Static (possibly build generated) Bios Vendor data.\r
+//\r
+SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE32, MiscBootInformation) = {\r
+ { // Hdr\r
+ EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, // Type,\r
+ 0, // Length,\r
+ 0 // Handle\r
+ },\r
+ { // Reserved[6]\r
+ 0,\r
+ 0,\r
+ 0,\r
+ 0,\r
+ 0,\r
+ 0\r
+ },\r
+ BootInformationStatusNoError // BootInformationStatus\r
+};\r
--- /dev/null
+/** @file\r
+ boot information boot time changes.\r
+ SMBIOS type 32.\r
+\r
+ Based on files under Nt32Pkg/MiscSubClassPlatformDxe/\r
+\r
+ Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>\r
+ Copyright (c) 2015, Linaro Limited. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+\r
+#include "SmbiosMisc.h"\r
+\r
+/**\r
+ This function makes boot time changes to the contents of the\r
+ MiscBootInformation (Type 32) record.\r
+\r
+ @param RecordData Pointer to SMBIOS table with default values.\r
+ @param Smbios SMBIOS protocol.\r
+\r
+ @retval EFI_SUCCESS The SMBIOS table was successfully added.\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory.\r
+\r
+**/\r
+SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation)\r
+{\r
+ EFI_STATUS Status;\r
+ SMBIOS_TABLE_TYPE32 *SmbiosRecord;\r
+ SMBIOS_TABLE_TYPE32 *InputData;\r
+\r
+ //\r
+ // First check for invalid parameters.\r
+ //\r
+ if (RecordData == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ InputData = (SMBIOS_TABLE_TYPE32 *)RecordData;\r
+\r
+ //\r
+ // Two zeros following the last string.\r
+ //\r
+ SmbiosRecord = AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r
+ if (SmbiosRecord == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ (VOID)CopyMem (SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE32));\r
+\r
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);\r
+\r
+ //\r
+ // Now we have got the full smbios record, call smbios protocol to add this record.\r
+ //\r
+ Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",\r
+ __FUNCTION__, __LINE__, Status));\r
+ }\r
+\r
+ FreePool (SmbiosRecord);\r
+ return Status;\r
+}\r