* [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] Produce SMBIOS type 1
@ 2018-09-17 11:12 Guo, Mang
0 siblings, 0 replies; only message in thread
From: Guo, Mang @ 2018-09-17 11:12 UTC (permalink / raw)
To: edk2-devel@lists.01.org; +Cc: Wei, David
Produce SMBIOS type 1 table before ready to boot event so BDS driver can get product name, CUP info from SMBIOS table and show the info in front page before boot.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Guo Mang <mang.guo@intel.com>
CC: David Wei <david.wei@intel.com>
---
.../SmBiosMiscDxe/MiscSystemManufacturerFunction.c | 26 +++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
index 1199374..40a84a8 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
@@ -206,11 +206,14 @@ AddSmbiosManuCallback (
CHAR16 *Uuid;
UINT64 TempData;
UINTN Index;
+ static BOOLEAN RemoveTable = TRUE;
+ EFI_SMBIOS_TABLE_HEADER *Record;
-
+if (Event != NULL) {
gBS->CloseEvent (Event); // Unload this event.
+}
DEBUG ((EFI_D_INFO, "Executing AddSmbiosManuCallback.\n"));
@@ -453,6 +456,21 @@ AddSmbiosManuCallback (
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ if (RemoveTable == TRUE) {
+ Status = EFI_SUCCESS;
+ while (!EFI_ERROR(Status)) {
+ Status = Smbios->GetNext (Smbios, &SmbiosHandle, NULL, &Record, NULL);
+ if (Record->Type == SMBIOS_TYPE_SYSTEM_INFORMATION) {
+ Status = Smbios-> Remove(
+ Smbios,
+ SmbiosHandle
+ );
+ RemoveTable = FALSE;
+ break;
+ }
+ }
+ }
+
Status = Smbios-> Add(
Smbios,
NULL,
@@ -481,6 +499,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)
static BOOLEAN CallbackIsInstalledManu = FALSE;
EFI_EVENT AddSmbiosManuCallbackEvent;
+
+ Status = AddSmbiosManuCallback (NULL, RecordData);
+
if (CallbackIsInstalledManu == FALSE) {
CallbackIsInstalledManu = TRUE; // Prevent more than 1 callback.
DEBUG ((EFI_D_INFO, "Create Smbios Manu callback.\n"));
@@ -492,10 +513,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)
RecordData,
&AddSmbiosManuCallbackEvent
);
- return Status;
}
- return EFI_SUCCESS;
+ return Status;
}
--
2.10.1.windows.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-17 11:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-17 11:12 [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] Produce SMBIOS type 1 Guo, Mang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox