public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Guo, Mang" <mang.guo@intel.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Wei, David" <david.wei@intel.com>
Subject: [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] Produce SMBIOS type 1
Date: Mon, 17 Sep 2018 11:12:59 +0000	[thread overview]
Message-ID: <22D2C85ED001C54AA20BFE3B0E4751D1526DA201@SHSMSX103.ccr.corp.intel.com> (raw)

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



                 reply	other threads:[~2018-09-17 11:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22D2C85ED001C54AA20BFE3B0E4751D1526DA201@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox