]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Create smbios table before ReadyToBoot event. For SMBIOS thunk driver, create/update...
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Aug 2011 07:23:14 +0000 (07:23 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Aug 2011 07:23:14 +0000 (07:23 +0000)
Signed-off-by: li-elvin
Reviewed-by: lzeng14
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12066 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/Translate.c

index 851fb06c032720ac5f8d13ed5960a7356e4bbcfa..38b16971563c5c87cac0858d26f8ba8af31d00d2 100644 (file)
@@ -2,7 +2,7 @@
   Translate the DataHub records via EFI_DATA_HUB_PROTOCOL to Smbios recorders \r
   via EFI_SMBIOS_PROTOCOL.\r
   \r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -127,7 +127,7 @@ SmbiosProcessDataRecord (
             StructureNode->SubInstance == DataHeader->SubInstance &&\r
             CompareGuid (&(StructureNode->ProducerName), &(RecordHeader->ProducerName))\r
               ) {\r
-          if (Conversion->SmbiosType >= 0X80) {\r
+          if (Conversion->SmbiosType >= 0x80) {\r
             if (StructureNode->SmbiosType == ((SMBIOS_STRUCTURE_HDR *) SrcData)->Type) {\r
               break;\r
             }\r
@@ -144,7 +144,7 @@ SmbiosProcessDataRecord (
             StructureNode->Instance == DataHeader->Instance &&\r
             CompareGuid (&(StructureNode->ProducerName), &(RecordHeader->ProducerName))\r
               ) {\r
-          if (Conversion->SmbiosType >= 0X80) {\r
+          if (Conversion->SmbiosType >= 0x80) {\r
             if (StructureNode->SmbiosType == ((SMBIOS_STRUCTURE_HDR *) SrcData)->Type) {\r
               break;\r
             }\r
@@ -196,7 +196,6 @@ SmbiosProcessDataRecord (
       // Allocate the structure instance\r
       //\r
       StructureNode->StructureSize = SmbiosGetTypeMinimalLength (Conversion->SmbiosType);\r
-      StructureNode->SmbiosType    = Conversion->SmbiosType;\r
       \r
       //\r
       // StructureSize include the TWO trailing zero byte.\r
@@ -209,7 +208,15 @@ SmbiosProcessDataRecord (
         goto Done;\r
       }\r
 \r
-      StructureNode->SmbiosType          = Conversion->SmbiosType;\r
+      //\r
+      // Assign correct SmbiosType when OEM type and Non-OEM type\r
+      //\r
+      if (Conversion->SmbiosType >= 0x80) {\r
+        StructureNode->SmbiosType = ((SMBIOS_STRUCTURE_HDR *) SrcData)->Type;\r
+      } else {\r
+        StructureNode->SmbiosType = Conversion->SmbiosType;\r
+      }\r
+      \r
       StructureNode->SmbiosHandle        = 0;\r
       Status = SmbiosProtocolCreateRecord (\r
                  NULL, \r
@@ -361,6 +368,17 @@ SmbiosProcessDataRecord (
 \r
       goto Done;\r
     }\r
+    \r
+    //\r
+    // SmbiosEnlargeStructureBuffer is called to remove and add again\r
+    // this SMBIOS entry to reflash SMBIOS table in configuration table.\r
+    //\r
+    SmbiosEnlargeStructureBuffer (\r
+      StructureNode,\r
+      StructureNode->Structure->Length,\r
+      StructureNode->StructureSize,\r
+      StructureNode->StructureSize\r
+      );\r
   }\r
 Done:\r
   return ;\r