]> git.proxmox.com Git - mirror_edk2.git/commitdiff
According to PI errata 0000654 and 000811, we need use 0xFFFE to instead of 0 for...
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Nov 2011 08:59:54 +0000 (08:59 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Nov 2011 08:59:54 +0000 (08:59 +0000)
Signed-off-by: lzeng14
Reviewed-by: li-elvin
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12753 6f19259b-4bc3-4df7-8a09-765794883524

15 files changed:
UnixPkg/CpuRuntimeDxe/Cpu.c
UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h
UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c
UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c

index d4926c3707b5b884d9f1812e6791fcf5cf339fa2..54c784ea6677c2c60bd6d19a8720f14a5c1bce19 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -417,7 +417,7 @@ LogSmbiosData (
   EFI_STATUS         Status;\r
   EFI_SMBIOS_HANDLE  SmbiosHandle;\r
   \r
-  SmbiosHandle = 0;\r
+  SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
   Status = Smbios->Add (\r
                      Smbios,\r
                      NULL,\r
index 04f5a1edc51da92b288b787404791607f265a404..0158ae9d525123a40b515d0c0a743565056e4fe8 100644 (file)
@@ -2,7 +2,7 @@
   BaseBoard manufacturer information boot time changes.\r
   SMBIOS type 2.\r
 \r
-  Copyright (c) 2009, 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
@@ -154,13 +154,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
 \r
   FreePool(SmbiosRecord);\r
   return Status;\r
index 6d64ef463254eac8a3e3ec770e56769f977e91ee..fbfb52fce5b2f2ac82abe46f8ae00a0fee9b7580 100644 (file)
@@ -3,7 +3,7 @@
   Misc. subclass type 2.\r
   SMBIOS type 0.\r
 \r
-  Copyright (c) 2009, 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
@@ -189,13 +189,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
 \r
   FreePool(SmbiosRecord);\r
   return Status;\r
index 65c9792a9344011df5a478661676dbd829885a2b..fec5ecc0bd2a24d1a196b2cbd50a45dbdb618df4 100644 (file)
@@ -2,7 +2,7 @@
   boot information boot time changes.\r
   SMBIOS type 32.\r
 \r
-  Copyright (c) 2009, 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
@@ -61,13 +61,8 @@ MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r
index fd1262b1907f5c3ebbdddaae36581fa8bcbbd88d..ce89603479d657bcf1f06341294fe73b868fee4f 100644 (file)
@@ -2,7 +2,7 @@
   Chassis manufacturer information boot time changes.\r
   SMBIOS type 3.\r
 \r
-  Copyright (c) 2009, 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
@@ -124,13 +124,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
 \r
   FreePool(SmbiosRecord);\r
   return Status;\r
index 288848d0daf9251547b6f8cd9c62213f8667a3a4..64addad4a9d47fcc394943211dda19ef714bfe81 100644 (file)
@@ -2,7 +2,7 @@
   This driver parses the mSmbiosMiscDataTable structure and reports\r
   any generated data.\r
 \r
-  Copyright (c) 2009, 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
@@ -226,13 +226,8 @@ MISC_SMBIOS_TABLE_FUNCTION(NumberOfInstallableLanguages)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r
index 94fc71c23119400cbb97859a8a0195bab6cf3cce..f0401cebbd36b57af96823e17089f71b0c94d1fa 100644 (file)
@@ -2,7 +2,7 @@
   boot information boot time changes.\r
   SMBIOS type 11.\r
 \r
-  Copyright (c) 2009, 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
@@ -68,13 +68,8 @@ MISC_SMBIOS_TABLE_FUNCTION(OemString)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r
index 8f240a40804df4971733280bc2ad6a05cb4b924f..9f7708be7369b96f2a93e57495f19b38bd791af7 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
  \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -161,13 +161,8 @@ Returns:
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r
index 8303c5a29b61ea88eed6245ffba281b4cf892de1..588f9d65de185860339f37eeb60ff37cde4947f4 100644 (file)
@@ -2,7 +2,7 @@
   ResetCapabilities.\r
   SMBIOS type 23.\r
 \r
-  Copyright (c) 2009, 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
@@ -63,13 +63,8 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r
index debd08bc637ea3e56bae5941623ea05c8d6c2851..b682aebb079c438f0d8512623c92b45e69f43fdd 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -105,17 +105,27 @@ extern UINTN                        mMiscSubclassDataTableEntries;
 extern UINT8                        MiscSubclassStrings[];\r
 extern EFI_HII_HANDLE               mHiiHandle;\r
 \r
-//\r
-// Prototypes\r
-//\r
+/**\r
+  Add an SMBIOS record.\r
+\r
+  @param  Smbios                The EFI_SMBIOS_PROTOCOL instance.\r
+  @param  SmbiosHandle          A unique handle will be assigned to the SMBIOS record.\r
+  @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
+                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
+                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
+                                a set of null terminated strings and a null.\r
+\r
+  @retval EFI_SUCCESS           Record was added.\r
+  @retval EFI_OUT_OF_RESOURCES  Record was not added due to lack of system resources.\r
+\r
+**/\r
 EFI_STATUS\r
-EFIAPI\r
-MiscSubclassDriverEntryPoint (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
+AddSmbiosRecord (\r
+  IN EFI_SMBIOS_PROTOCOL        *Smbios,\r
+  OUT EFI_SMBIOS_HANDLE         *SmbiosHandle,\r
+  IN EFI_SMBIOS_TABLE_HEADER    *Record\r
   );\r
 \r
-\r
 #endif /* _MISC_SUBCLASS_DRIVER_H */\r
 \r
 /* eof - MiscSubclassDriver.h */\r
index a2c14e7a7aa72bc3f215bf9817756ab242a52a45..41b32fe673485f405f4144a4758ba4319e04918f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -90,8 +90,8 @@ LogMemorySmbiosRecord (
   //\r
   // Generate Memory Array Mapped Address info (TYPE 19)\r
   //\r
-  MemArrayMappedAddrSmbiosHandle = 0;\r
-  Status = Smbios->Add (Smbios, NULL, &MemArrayMappedAddrSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type19Record);\r
+  Status = AddSmbiosRecord (Smbios, &MemArrayMappedAddrSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type19Record);\r
+\r
   FreePool(Type19Record);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -168,3 +168,34 @@ Returns:
   EfiStatus = LogMemorySmbiosRecord();\r
   return EfiStatus;\r
 }\r
+\r
+/**\r
+  Add an SMBIOS record.\r
+\r
+  @param  Smbios                The EFI_SMBIOS_PROTOCOL instance.\r
+  @param  SmbiosHandle          A unique handle will be assigned to the SMBIOS record.\r
+  @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
+                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
+                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
+                                a set of null terminated strings and a null.\r
+\r
+  @retval EFI_SUCCESS           Record was added.\r
+  @retval EFI_OUT_OF_RESOURCES  Record was not added due to lack of system resources.\r
+\r
+**/\r
+EFI_STATUS\r
+AddSmbiosRecord (\r
+  IN EFI_SMBIOS_PROTOCOL        *Smbios,\r
+  OUT EFI_SMBIOS_HANDLE         *SmbiosHandle,\r
+  IN EFI_SMBIOS_TABLE_HEADER    *Record\r
+  )\r
+{\r
+  *SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
+  return Smbios->Add (\r
+                   Smbios,\r
+                   NULL,\r
+                   SmbiosHandle,\r
+                   Record\r
+                   );\r
+}\r
+\r
index 3e10c63caae598b8d9a710ea1feeb7d05d66b167..86d63b4191528046e920fd56036e2a01bfd87215 100644 (file)
@@ -2,7 +2,7 @@
   ResetCapabilities.\r
   SMBIOS type 23.\r
 \r
-  Copyright (c) 2009, 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
@@ -72,13 +72,8 @@ MISC_SMBIOS_TABLE_FUNCTION(SystemLanguageString)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r
index 1483ace35b219d9186e6ac64220120efa7e8c156..3582447a40a8173c9b8172ec667da77a09ce85e3 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -126,13 +126,8 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r
index a910634f0092da315c2c44717965ba5f8de89e5a..145603a9a9f014e385d05c23253cc91abd4e5266 100644 (file)
@@ -2,7 +2,7 @@
   BIOS system option string boot time changes.\r
   SMBIOS type 12.\r
 \r
-  Copyright (c) 2009, 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
@@ -70,13 +70,7 @@ MISC_SMBIOS_TABLE_FUNCTION(SystemOptionString)
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
 \r
   FreePool(SmbiosRecord);\r
   return Status;\r
index 72c4137c6b6dff91e7e31eae296fc72907c3395d..2bf88442362746e418b70cc0801706a5a04a870d 100644 (file)
@@ -2,7 +2,7 @@
   BIOS system slot designator information boot time changes.\r
   SMBIOS type 9.\r
 \r
-  Copyright (c) 2009, 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
@@ -85,13 +85,8 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignation)
   //  \r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r
-  SmbiosHandle = 0;\r
-  Status = Smbios-> Add(\r
-                      Smbios, \r
-                      NULL,\r
-                      &SmbiosHandle, \r
-                      (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
-                      );\r
+  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
+\r
   FreePool(SmbiosRecord);\r
   return Status;\r
 }\r