blob: 2e04d481cdafb8df216820fcbcf29f70b31371e8 [file] [log] [blame]
Zane Shelleyc85716c2021-08-17 10:54:06 -05001#pragma once
2
Zane Shelley9980d482022-01-28 15:21:47 -06003#include <map>
Zane Shelleyc85716c2021-08-17 10:54:06 -05004#include <string>
5
6namespace analyzer
7{
8
9namespace callout
10{
11
12/** @brief All callouts will have a priority indicating when to issue the
13 * required service action. */
Zane Shelley9980d482022-01-28 15:21:47 -060014enum class Priority
Zane Shelleyc85716c2021-08-17 10:54:06 -050015{
Zane Shelleyc85716c2021-08-17 10:54:06 -050016 /** Serivce is mandatory. */
Zane Shelley9980d482022-01-28 15:21:47 -060017 HIGH,
Zane Shelleyc85716c2021-08-17 10:54:06 -050018
19 /** Serivce medium priority callouts one at a time, in order, until the
20 * issue is resolved. */
Zane Shelley9980d482022-01-28 15:21:47 -060021 MED,
Zane Shelleyc85716c2021-08-17 10:54:06 -050022
23 /** Same as MED, except replace all A's as a group. */
Zane Shelley9980d482022-01-28 15:21:47 -060024 MED_A,
Zane Shelleyc85716c2021-08-17 10:54:06 -050025
Zane Shelley9980d482022-01-28 15:21:47 -060026 /** Same as MED, except replace all B's as a group. */
27 MED_B,
Zane Shelleyc85716c2021-08-17 10:54:06 -050028
Zane Shelley9980d482022-01-28 15:21:47 -060029 /** Same as MED, except replace all C's as a group. */
30 MED_C,
Zane Shelleyc85716c2021-08-17 10:54:06 -050031
32 /** If servicing all high and medium priority callouts did not resolve
33 * the issue, service low priority callouts one at a time, in order,
34 * until the issue is resolved. */
Zane Shelley9980d482022-01-28 15:21:47 -060035 LOW,
Zane Shelleyc85716c2021-08-17 10:54:06 -050036};
37
Zane Shelley9980d482022-01-28 15:21:47 -060038/** @return The string representation of the priority used in callouts. */
39inline std::string getString(Priority i_priority)
40{
41 // clang-format off
42 static const std::map<Priority, std::string> m =
43 {
44 {Priority::HIGH, "H"},
45 {Priority::MED, "M"},
46 {Priority::MED_A, "A"},
47 {Priority::MED_B, "B"},
48 {Priority::MED_C, "C"},
49 {Priority::LOW, "L"},
50 };
51 // clang-format on
52
53 return m.at(i_priority);
54}
55
56/** @return The string representation of the priority used in The callout FFDC.
57 */
58inline std::string getStringFFDC(Priority i_priority)
59{
60 // clang-format off
61 static const std::map<Priority, std::string> m =
62 {
63 {Priority::HIGH, "high"},
64 {Priority::MED, "medium"},
65 {Priority::MED_A, "medium_group_A"},
66 {Priority::MED_B, "medium_group_B"},
67 {Priority::MED_C, "medium_group_C"},
68 {Priority::LOW, "low"},
69 };
70 // clang-format on
71
72 return m.at(i_priority);
73}
Zane Shelleyc85716c2021-08-17 10:54:06 -050074
75/** @brief Container class for procedure callout service actions. */
76class Procedure
77{
78 public:
79 /** Contact next level support. */
80 static const Procedure NEXTLVL;
81
82 private:
83 /**
84 * @brief Constructor from components.
85 * @param i_string The string representation of the procedure used for
86 * callouts.
87 */
88 explicit Procedure(const std::string& i_string) : iv_string(i_string) {}
89
90 private:
91 /** The string representation of the procedure used for callouts. */
92 const std::string iv_string;
93
94 public:
95 /** iv_string accessor */
96 std::string getString() const
97 {
98 return iv_string;
99 }
100};
101
Zane Shelley86ccc452021-11-16 13:10:52 -0600102inline const Procedure Procedure::NEXTLVL{"next_level_support"};
Zane Shelleyc85716c2021-08-17 10:54:06 -0500103
Zane Shelley5d63cef2021-09-17 18:10:17 -0500104/** @brief Container class for bus callout service actions. */
105class BusType
106{
107 public:
108 /** SMP bus (fabric A or X bus). */
109 static const BusType SMP_BUS;
110
111 /** OMI bus (memory bus). */
112 static const BusType OMI_BUS;
113
114 private:
115 /**
116 * @brief Constructor from components.
117 * @param i_string The string representation of the procedure used for
118 * callouts.
119 */
120 explicit BusType(const std::string& i_string) : iv_string(i_string) {}
121
122 private:
123 /** The string representation of the procedure used for callouts. */
124 const std::string iv_string;
125
126 public:
127 bool operator==(const BusType& r) const
128 {
129 return this->iv_string == r.iv_string;
130 }
131
132 /** iv_string accessor */
133 std::string getString() const
134 {
135 return iv_string;
136 }
137};
138
139inline const BusType BusType::SMP_BUS{"SMP_BUS"};
140inline const BusType BusType::OMI_BUS{"OMI_BUS"};
141
Zane Shelley84721d92021-09-08 13:30:27 -0500142/** @brief Container class for clock callout service actions. */
143class ClockType
144{
145 public:
146 /** Oscillator reference clock 0. */
147 static const ClockType OSC_REF_CLOCK_0;
148
149 /** Oscillator reference clock 1. */
150 static const ClockType OSC_REF_CLOCK_1;
151
Zane Shelleyd195b712022-01-26 13:26:34 -0600152 /** Time of Day (TOD) clock. */
153 static const ClockType TOD_CLOCK;
154
Zane Shelley84721d92021-09-08 13:30:27 -0500155 private:
156 /**
157 * @brief Constructor from components.
158 * @param i_string The string representation of the procedure used for
159 * callouts.
160 */
161 explicit ClockType(const std::string& i_string) : iv_string(i_string) {}
162
163 private:
164 /** The string representation of the procedure used for callouts. */
165 const std::string iv_string;
166
167 public:
168 /** iv_string accessor */
169 std::string getString() const
170 {
171 return iv_string;
172 }
173};
174
175inline const ClockType ClockType::OSC_REF_CLOCK_0{"OSC_REF_CLOCK_0"};
176inline const ClockType ClockType::OSC_REF_CLOCK_1{"OSC_REF_CLOCK_1"};
Zane Shelleyd195b712022-01-26 13:26:34 -0600177inline const ClockType ClockType::TOD_CLOCK{"TOD_CLOCK"};
Zane Shelley84721d92021-09-08 13:30:27 -0500178
Zane Shelleya4134772022-01-10 17:22:44 -0600179/** @brief Container class for part callout service actions. */
180class PartType
181{
182 public:
183 /** The part containing the PNOR. */
184 static const PartType PNOR;
185
186 private:
187 /**
188 * @brief Constructor from components.
189 * @param i_string The string representation of the part callout.
190 */
191 explicit PartType(const std::string& i_string) : iv_string(i_string) {}
192
193 private:
194 /** The string representation of the part callout. */
195 const std::string iv_string;
196
197 public:
198 bool operator==(const PartType& r) const
199 {
200 return this->iv_string == r.iv_string;
201 }
202
203 /** iv_string accessor */
204 std::string getString() const
205 {
206 return iv_string;
207 }
208};
209
210inline const PartType PartType::PNOR{"PNOR"};
211
Zane Shelleybf3326f2021-11-12 13:41:39 -0600212/** @brief Container class for guard service actions. */
213class GuardType
214{
215 public:
216 /** Do not guard. */
217 static const GuardType NONE;
218
219 /** Guard on fatal error (cannot recover resource). */
220 static const GuardType UNRECOVERABLE;
221
222 /** Guard on non-fatal error (can recover resource). */
223 static const GuardType PREDICTIVE;
224
225 private:
226 /**
227 * @brief Constructor from components.
228 * @param i_string The string representation of the procedure used for
229 * callouts.
230 */
231 explicit GuardType(const std::string& i_string) : iv_string(i_string) {}
232
233 private:
234 /** The string representation of the procedure used for callouts. */
235 const std::string iv_string;
236
237 public:
238 bool operator==(const GuardType& r) const
239 {
240 return this->iv_string == r.iv_string;
241 }
242
243 /** iv_string accessor */
244 std::string getString() const
245 {
246 return iv_string;
247 }
248};
249
250inline const GuardType GuardType::NONE{"GARD_NULL"};
251inline const GuardType GuardType::UNRECOVERABLE{"GARD_Unrecoverable"};
252inline const GuardType GuardType::PREDICTIVE{"GARD_Predictive"};
253
Zane Shelleyc85716c2021-08-17 10:54:06 -0500254} // namespace callout
255
256} // namespace analyzer