#pragma once #include #include #include #include #include #include #include #include namespace vpd { namespace types { using BiosProperty = std::tuple< std::string, bool, std::string, std::string, std::string, std::variant, std::variant, std::vector, std::string>>>; using BiosBaseTable = std::variant>; using BiosBaseTableType = std::map; using BiosAttributeCurrentValue = std::variant; using BiosAttributePendingValue = std::variant; using BiosGetAttrRetType = std::tuple; using PendingBIOSAttrItem = std::pair>; using PendingBIOSAttrs = std::vector; using BinaryVector = std::vector; // This covers mostly all the data type supported over Dbus for a property. // clang-format off using DbusVariantType = std::variant< std::vector>, std::vector, std::vector, std::string, int64_t, uint64_t, double, int32_t, uint32_t, int16_t, uint16_t, uint8_t, bool, BinaryVector, std::vector, std::vector, sdbusplus::message::object_path, std::tuple>>, std::vector>, std::vector>>, std::vector>, std::vector>, PendingBIOSAttrs >; using MapperGetObject = std::vector>>; using MapperGetSubTree = std::map>>; /* A type for holding the innermost map of property::value.*/ using IPZKwdValueMap = std::unordered_map; /*IPZ VPD Map of format >*/ using IPZVpdMap = std::unordered_map; /*Value types supported by Keyword VPD*/ using KWdVPDValueType = std::variant; /* This hold map of parsed data of keyword VPD type*/ using KeywordVpdMap = std::unordered_map; /** * Both Keyword VPD parser and DDIMM parser stores the * parsed VPD in the same format. * To have better readability, two types are defined for underneath data structure. */ using DdimmVpdMap = KeywordVpdMap; /** * Both Keyword VPD parser and ISDIMM parser stores the * parsed SPD in the same format. */ using JedecSpdMap = KeywordVpdMap; /** * Type to hold keyword::value map of a VPD. * Variant can be extended to support additional type. */ using VPDKWdValueMap = std::variant; /* Map*/ using PropertyMap = std::map; /* Map>*/ using InterfaceMap = std::map; using ObjectMap = std::map; using KwSize = uint8_t; using RecordId = uint8_t; using RecordSize = uint16_t; using RecordType = uint16_t; using RecordOffset = uint16_t; using RecordLength = uint16_t; using ECCOffset = uint16_t; using ECCLength = uint16_t; using PoundKwSize = uint16_t; using RecordOffsetList = std::vector; using VPDMapVariant = std::variant; using HWVerList = std::vector>; /** * Map of >> */ using SystemTypeMap = std::unordered_map>; using Path = std::string; using Record = std::string; using Keyword = std::string; using IpzData = std::tuple; using KwData = std::tuple; using VpdData = std::variant; using IpzType = std::tuple; using ReadVpdParams = std::variant; using WriteVpdParams = std::variant; using ListOfPaths = std::vector; using RecordData = std::tuple; using DbusInvalidArgument = sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument; using DbusNotAllowed = sdbusplus::xyz::openbmc_project::Common::Error::NotAllowed; using InvalidArgument = phosphor::logging::xyz::openbmc_project::Common::InvalidArgument; namespace DeviceError = sdbusplus::xyz::openbmc_project::Common::Device::Error; /* PEL Severity enum as defined in [xyz.openbmc_project.Logging.Entry.Level]log.hpp from 'phosphor-logging' repo. */ enum SeverityType { Notice, Informational, Debug, Warning, Critical, Emergency, Alert, Error }; /* PEL callout priority from 'phosphor-logging' pel_types.hpp. If any change in 'phosphor-logging', it needs update here as well. */ enum CalloutPriority { High, Medium, MediumGroupA, MediumGroupB, MediumGroupC, Low }; /* The Message property of the event entry for creating PEL, to introduce new message needs to be added in 'phosphor-logging' message_registry.json as well. */ enum ErrorType { DefaultValue, InvalidVpdMessage, VpdMismatch, InvalidEeprom, EccCheckFailed, JsonFailure, DbusFailure, InvalidSystem, EssentialFru, GpioError, InternalFailure, /* Should be used for any generic firmware failure */ FruMissing, /* Should be used in case of presence failure */ SystemTypeMismatch, UndefinedError, UnknownSystemSettings, FirmwareError, VpdParseError /* Should be used in case of any generic VPD parsing error. */ }; using InventoryCalloutData = std::tuple; using DeviceCalloutData = std::tuple; using I2cBusCalloutData = std::tuple; using ExceptionInfoVariant = std::variant; /* Error info map of format */ using ExceptionDataMap = std::map; /* Pair of invalid record name and error encountered while parsing the record*/ using InvalidRecordEntry = std::pair; /* List of invalid record entries*/ using InvalidRecordList = std::vector; /* Map of inventory path -> Present property match object */ using FruPresenceMatchObjectMap = std::map>; /* A map of interface to match object*/ using MatchObjectInterfaceMap = std::map>; /* A map of service name to match object interface map*/ using MatchObjectMap = std::map; /* * Tuple of Error type, severity, internal rc, userdata1, userdata2, symFru, Procedure */ using PelInfoTuple = std::tuple, uint8_t, std::optional, std::optional, std::optional, std::optional>; /* A tuple of Dbus object path, interface and property*/ using DbusPropertyEntry = std::tuple; /* A list of Dbus property entries */ using DbusPropertyList = std::vector; } // namespace types } // namespace vpd