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
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\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
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