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

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

index 10d86f8e9c12d78b0b666b3b276e665b7216477f..07d64208076db09b30f89684f2a96924bd1b4e1b 100644 (file)
@@ -217,7 +217,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 ce217fa26365d112014cc67aaa2ea755aee8820a..562f716fd40b27a47e194c4106cb61c6c3061032 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 7fdd47f599c2110427dc85bc52bd50a8c5f7d8c2..39cb889f62bdd00ad07222dd29b29115434b0aae 100644 (file)
@@ -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 98d6181501d17ccecb551bd5bd55bc01c32c8f04..8e58e61031d34b98c0e76784d8869b7e36603b93 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 8e57fd50225f58b7e587b737ebe3be663d8352c2..0df651e6938421def646a9c319c4747f3e15634d 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 3c3a5f3ed78ffe43074d4c646b3a800ab66b0006..988e0c6029a3ff6f9722c2049a2779ddb598262e 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 f3291828c3b9ed1bc83bc5bf567a001a5f00ce7b..a879283a9ce637b4e5fd27d7f19f89d95c71c922 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 e137887803c9e671db2b2b7140810d1ef6411826..3242fe342eef2646b4fcd18f4377e6dbadadc6f3 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 33a43a3e647aade0ac265789862c78f072d4a7ac..d7678d375894eb49d51346d063b42cb3a31c41c5 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 7e5be7ea809d3f040f6eccb1f83d345f7f4a5dd5..c7749f3f178a18231111d2ddfae5e140a9388ed7 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
@@ -106,17 +106,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 88a99a210865dd275dd5d6586869b5523e30ecf2..fc2275cc7a09e24afeb15357f7fee7492317ede8 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 db15a252da9e112549148a6664dc41700b6da297..96a357782881f69076ac4a5aa051ebd7ac14bee7 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 670f379f566272836f9a0c569dec77ebd99bc9d7..317922ffe1d1c2b001ee1812a96ce898848f5ba5 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 348a33ec82577254f81afccdb8cc49f5dfeb7246..734e90dff61326ff89b9af4e720afb782a4d5e4c 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 3ed0fa74ca894f7f02d82c8f9ff4df2b305b34a9..3c64a11e692a57236e3567550d044da6242140ca 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