blob: 49aa374ced9aab0e4cdfe06da366fc8c04ab4fa7 [file] [log] [blame]
Matt Spinler835a8692019-08-27 13:56:05 -05001#pragma once
2
Aatir186ce8c2019-10-20 15:13:39 -05003#include <map>
Matt Spinler835a8692019-08-27 13:56:05 -05004#include <string>
5#include <tuple>
6#include <vector>
7
8namespace openpower
9{
10namespace pels
11{
12namespace pel_values
13{
14
15// The actual value as it shows up in the PEL
16const int fieldValuePos = 0;
17
18// The name of the value as specified in the message registry
19const int registryNamePos = 1;
20
21// The description of the field, used by PEL parsers
22const int descriptionPos = 2;
23
24using PELFieldValue = std::tuple<uint32_t, const char*, const char*>;
25using 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 */
36PELValues::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 */
47PELValues::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 */
53extern const PELValues subsystemValues;
54
55/**
56 * @brief The values for the 'severity' field in the User Header
57 */
58extern const PELValues severityValues;
59
60/**
61 * @brief The values for the 'Event Type' field in the User Header
62 */
63extern const PELValues eventTypeValues;
64
65/**
66 * @brief The values for the 'Event Scope' field in the User Header
67 */
68extern const PELValues eventScopeValues;
69
70/**
71 * @brief The values for the 'Action Flags' field in the User Header
72 */
73extern const PELValues actionFlagsValues;
74
75/**
76 * @brief The values for callout priorities in the SRC section
77 */
78extern const PELValues calloutPriorityValues;
79
Aatir186ce8c2019-10-20 15:13:39 -050080/**
81 * @brief Map for section IDs
82 */
83extern const std::map<std::string, std::string> sectionTitles;
84
Matt Spinler835a8692019-08-27 13:56:05 -050085} // namespace pel_values
86} // namespace pels
87} // namespace openpower