]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
OvmfPkg: VirtioRngDxe: adapt feature negotiation to virtio-1.0
[mirror_edk2.git] / OvmfPkg / SmbiosPlatformDxe / SmbiosPlatformDxe.c
index bf7f717a59e8e2a030c7d25a5c5e457ea62eb35e..29948a4b42659517549cb13a86c860fa87b06648 100644 (file)
@@ -2,7 +2,7 @@
   This driver installs SMBIOS information for OVMF\r
 \r
   Copyright (c) 2011, Bei Guan <gbtju85@gmail.com>\r
-  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 \r
 #include "SmbiosPlatformDxe.h"\r
 \r
+#define TYPE0_STRINGS \\r
+  "EFI Development Kit II / OVMF\0"     /* Vendor */ \\r
+  "0.0.0\0"                             /* BiosVersion */ \\r
+  "02/06/2015\0"                        /* BiosReleaseDate */\r
 //\r
 // Type definition and contents of the default Type 0 SMBIOS table.\r
 //\r
 #pragma pack(1)\r
 typedef struct {\r
   SMBIOS_TABLE_TYPE0 Base;\r
-  UINT8              Strings[];\r
+  UINT8              Strings[sizeof(TYPE0_STRINGS)];\r
 } OVMF_TYPE0;\r
 #pragma pack()\r
 \r
@@ -56,47 +60,10 @@ STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = {
     0xFF   // UINT8                     EmbeddedControllerFirmwareMinorRelease\r
   },\r
   // Text strings (unformatted area)\r
-  "EFI Development Kit II / OVMF\0"     // Vendor\r
-  "0.0.0\0"                             // BiosVersion\r
-  "02/06/2015\0"                        // BiosReleaseDate\r
+  TYPE0_STRINGS\r
 };\r
 \r
 \r
-/**\r
-  Validates the SMBIOS entry point structure\r
-\r
-  @param  EntryPointStructure  SMBIOS entry point structure\r
-\r
-  @retval TRUE   The entry point structure is valid\r
-  @retval FALSE  The entry point structure is not valid\r
-\r
-**/\r
-BOOLEAN\r
-IsEntryPointStructureValid (\r
-  IN SMBIOS_TABLE_ENTRY_POINT  *EntryPointStructure\r
-  )\r
-{\r
-  UINTN                     Index;\r
-  UINT8                     Length;\r
-  UINT8                     Checksum;\r
-  UINT8                     *BytePtr;\r
-\r
-  BytePtr = (UINT8*) EntryPointStructure;\r
-  Length = EntryPointStructure->EntryPointLength;\r
-  Checksum = 0;\r
-\r
-  for (Index = 0; Index < Length; Index++) {\r
-    Checksum = Checksum + (UINT8) BytePtr[Index];\r
-  }\r
-\r
-  if (Checksum != 0) {\r
-    return FALSE;\r
-  } else {\r
-    return TRUE;\r
-  }\r
-}\r
-\r
-\r
 /**\r
   Get SMBIOS record length.\r
 \r