]> 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:56:48 +0000 (08:56 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Nov 2011 08:56:48 +0000 (08:56 +0000)
Signed-off-by: lzeng14
Reviewed-by: li-elvin
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12751 6f19259b-4bc3-4df7-8a09-765794883524

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

index 4ac12a4e1eab07fcd6ce7ed995e8d634b4f4377a..d15ac989eac545e5ba59c177b164ee4ec943605e 100644 (file)
@@ -402,7 +402,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 6076e93b8e3fc3b2168dbb613c83843a9d7f2555..303726c3fd5927cd55e52ef596e77165231aead0 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 eb11765316f74c56b0ffd41182162d9b32dbddac..415a8cab3aa12ee24f65d9d0d52f3b0c0dc60990 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 25105c3e413f5de40c2b426571b2f330776fca2f..0b916f2db2fbdbd7a1df6336c6fa860088c98a68 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 586e2535c02317dd2a66f312825755f23438a19f..c7f65ea83055976ade44f26222c917fd4fd217db 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 0b4d78875d3ecb263ce9bc1a9596f813b87e5f0b..5be7444b31735cb890e5de8c25f94ac15c3243bd 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\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
@@ -224,13 +224,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 67d5979351eed890eb373bc54ae1798cc9436ace..077660257ac1073bcd14ee9c40ccc8e2f0f17d68 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
@@ -69,13 +69,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 6d2274f8a3f0147e9dbc1c01d55c1cf49c0f3f04..1636abc4fa86402a4052341648ce80b2a0ab23a4 100644 (file)
@@ -1,6 +1,6 @@
 /**@file\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 52d5e4e67e77914b4a6671cda3d458ed999e5605..7c1ffabe5cf185ee411cafdb6cca89c149d20803 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
@@ -64,13 +64,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 2e87031e23ee2147c38de6ac653693310a4b0514..179a015deaa948319c6e144600e83123f5287a77 100644 (file)
@@ -1,6 +1,6 @@
 /**@file\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
@@ -102,16 +102,28 @@ extern UINTN                        mMiscSubclassDataTableEntries;
 extern UINT8                        MiscSubclassStrings[];\r
 extern EFI_HII_HANDLE               mHiiHandle;\r
 \r
-//\r
-// Prototypes\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
-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 9c901d82b9e79c36404289a1632259a6d53a9724..95e050f32374f6f62e918ea920c328e9c7e2d07c 100644 (file)
@@ -1,6 +1,6 @@
 /**@file\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 2cdbfda1089c89c439687238a0b78ed82dde8301..f033d1145e50b0b1b372e1c3b092e37e826fe934 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\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,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 55c85e9e657891fd602168b74c135b20bec9dd40..9f3d5fe2674cdab34b9317f3d5596ddf525a244d 100644 (file)
@@ -1,6 +1,6 @@
 /**@file\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 1f702668236aadb6a0318b853b259bd663ab4465..b9ce708f828dc5e49f5c6e218bf97e8b7a47e3f6 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 026ef2493ed1b23940217eeafa6cd45be2fc68b7..daf597039e75cb571648c065ee82e7c97d8a4e3c 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