]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
According to PI errata 0000654 and 000811, we need use 0xFFFE to instead of 0 for...
[mirror_edk2.git] / UnixPkg / MiscSubClassPlatformDxe / MiscSubclassDriverEntryPoint.c
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