Matt Spinler | 835a869 | 2019-08-27 13:56:05 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Aatir | 186ce8c | 2019-10-20 15:13:39 -0500 | [diff] [blame] | 3 | #include <map> |
Matt Spinler | 835a869 | 2019-08-27 13:56:05 -0500 | [diff] [blame] | 4 | #include <string> |
| 5 | #include <tuple> |
| 6 | #include <vector> |
| 7 | |
| 8 | namespace openpower |
| 9 | { |
| 10 | namespace pels |
| 11 | { |
| 12 | namespace pel_values |
| 13 | { |
| 14 | |
| 15 | // The actual value as it shows up in the PEL |
| 16 | const int fieldValuePos = 0; |
| 17 | |
| 18 | // The name of the value as specified in the message registry |
| 19 | const int registryNamePos = 1; |
| 20 | |
| 21 | // The description of the field, used by PEL parsers |
| 22 | const int descriptionPos = 2; |
| 23 | |
| 24 | using PELFieldValue = std::tuple<uint32_t, const char*, const char*>; |
| 25 | using PELValues = std::vector<PELFieldValue>; |
| 26 | |
| 27 | /** |
| 28 | * @brief Find the desired entry in a PELValues table based on the |
| 29 | * field value. |
| 30 | * |
| 31 | * @param[in] value - the PEL value to find |
| 32 | * @param[in] fields - the PEL values table to use |
| 33 | * |
| 34 | * @return PELValues::const_iterator - an iterator to the table entry |
| 35 | */ |
| 36 | PELValues::const_iterator findByValue(uint32_t value, const PELValues& fields); |
| 37 | |
| 38 | /** |
| 39 | * @brief Find the desired entry in a PELValues table based on the |
| 40 | * field message registry name. |
| 41 | * |
| 42 | * @param[in] name - the PEL message registry enum name |
| 43 | * @param[in] fields - the PEL values table to use |
| 44 | * |
| 45 | * @return PELValues::const_iterator - an iterator to the table entry |
| 46 | */ |
| 47 | PELValues::const_iterator findByName(const std::string& name, |
| 48 | const PELValues& fields); |
| 49 | |
| 50 | /** |
| 51 | * @brief The values for the 'subsystem' field in the User Header |
| 52 | */ |
| 53 | extern const PELValues subsystemValues; |
| 54 | |
| 55 | /** |
| 56 | * @brief The values for the 'severity' field in the User Header |
| 57 | */ |
| 58 | extern const PELValues severityValues; |
| 59 | |
| 60 | /** |
| 61 | * @brief The values for the 'Event Type' field in the User Header |
| 62 | */ |
| 63 | extern const PELValues eventTypeValues; |
| 64 | |
| 65 | /** |
| 66 | * @brief The values for the 'Event Scope' field in the User Header |
| 67 | */ |
| 68 | extern const PELValues eventScopeValues; |
| 69 | |
| 70 | /** |
| 71 | * @brief The values for the 'Action Flags' field in the User Header |
| 72 | */ |
| 73 | extern const PELValues actionFlagsValues; |
| 74 | |
| 75 | /** |
| 76 | * @brief The values for callout priorities in the SRC section |
| 77 | */ |
| 78 | extern const PELValues calloutPriorityValues; |
| 79 | |
Aatir | 186ce8c | 2019-10-20 15:13:39 -0500 | [diff] [blame] | 80 | /** |
| 81 | * @brief Map for section IDs |
| 82 | */ |
| 83 | extern const std::map<std::string, std::string> sectionTitles; |
| 84 | |
Matt Spinler | 835a869 | 2019-08-27 13:56:05 -0500 | [diff] [blame] | 85 | } // namespace pel_values |
| 86 | } // namespace pels |
| 87 | } // namespace openpower |