SMBIOS version check

As per SMBIOS specification(DSP0134) conformance guidelines, before
parsing the SMBIOS data the system needs to check for anchor string
and SMBIOS version information.

Define Entry Point structure and implement SMBIOS version check
support.

Tested:
Verified BMC is able to validate the version information from the
SMBIOS table data which BIOS sends.

Jan 01 00:00:20 intel-obmc smbiosmdrv2app[429]: SMBIOS VERSION - 3.2

Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
Change-Id: I6dfa9eb23f02343a47937747e8e9070b8f0cb227
diff --git a/include/smbios_mdrv2.hpp b/include/smbios_mdrv2.hpp
index 0d8ec30..4f3b654 100644
--- a/include/smbios_mdrv2.hpp
+++ b/include/smbios_mdrv2.hpp
@@ -119,6 +119,29 @@
     uint32_t dataSize;
 } __attribute__((packed));
 
+typedef struct
+{
+    uint8_t majorVersion;
+    uint8_t minorVersion;
+} SMBIOSVersion;
+
+struct EntryPointStructure
+{
+    uint32_t anchorString;
+    uint8_t epChecksum;
+    uint8_t epLength;
+    SMBIOSVersion smbiosVersion;
+    uint16_t maxStructSize;
+    uint8_t epRevision;
+    uint8_t formattedArea[5];
+    uint8_t intermediateAnchorString[5];
+    uint8_t intermediateChecksum;
+    uint16_t structTableLength;
+    uint32_t structTableAddress;
+    uint16_t noOfSmbiosStruct;
+    uint8_t smbiosBDCRevision;
+} __attribute__((packed));
+
 static constexpr const char* cpuPath =
     "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu";
 
@@ -131,6 +154,9 @@
 static constexpr const char* systemPath =
     "/xyz/openbmc_project/inventory/system/chassis/motherboard/bios";
 
+constexpr std::array<SMBIOSVersion, 2> supportedSMBIOSVersions{
+    SMBIOSVersion{3, 2}, SMBIOSVersion{3, 3}};
+
 typedef enum
 {
     biosType = 0,