blob: a09f2861efb763e2254fd302f439ec17888f8ad1 [file] [log] [blame]
Matt Spinlerf9bae182019-10-09 13:37:38 -05001#pragma once
2
3#include "additional_data.hpp"
4#include "ascii_string.hpp"
5#include "callouts.hpp"
Matt Spinler075e5ba2020-02-21 15:46:00 -06006#include "data_interface.hpp"
Matt Spinlerf9bae182019-10-09 13:37:38 -05007#include "pel_types.hpp"
Matt Spinlerbd716f02019-10-15 10:54:11 -05008#include "registry.hpp"
Matt Spinlerf9bae182019-10-09 13:37:38 -05009#include "section.hpp"
10#include "stream.hpp"
11
12namespace openpower
13{
14namespace pels
15{
16
Matt Spinlerbd716f02019-10-15 10:54:11 -050017constexpr uint8_t srcSectionVersion = 0x01;
18constexpr uint8_t srcSectionSubtype = 0x01;
Matt Spinlerf9bae182019-10-09 13:37:38 -050019constexpr size_t numSRCHexDataWords = 8;
Matt Spinlerbd716f02019-10-15 10:54:11 -050020constexpr uint8_t srcVersion = 0x02;
21constexpr uint8_t bmcSRCFormat = 0x55;
22constexpr uint8_t primaryBMCPosition = 0x10;
23constexpr size_t baseSRCSize = 72;
Matt Spinlerf9bae182019-10-09 13:37:38 -050024
Harisuddin Mohamed Isa0f717e12020-01-15 20:05:33 +080025enum class DetailLevel
26{
27 message = 0x01,
28 json = 0x02
29};
Matt Spinlerf9bae182019-10-09 13:37:38 -050030/**
31 * @class SRC
32 *
33 * SRC stands for System Reference Code.
34 *
35 * This class represents the SRC sections in the PEL, of which there are 2:
36 * primary SRC and secondary SRC. These are the same structurally, the
37 * difference is that the primary SRC must be the 3rd section in the PEL if
38 * present and there is only one of them, and the secondary SRC sections are
39 * optional and there can be more than one (by definition, for there to be a
40 * secondary SRC, a primary SRC must also exist).
41 *
42 * This section consists of:
43 * - An 8B header (Has the version, flags, hexdata word count, and size fields)
44 * - 8 4B words of hex data
45 * - An ASCII character string
46 * - An optional subsection for Callouts
47 */
48class SRC : public Section
49{
50 public:
51 enum HeaderFlags
52 {
Matt Spinlerbd716f02019-10-15 10:54:11 -050053 additionalSections = 0x01,
Harisuddin Mohamed Isa0f717e12020-01-15 20:05:33 +080054 powerFaultEvent = 0x02,
55 hypDumpInit = 0x04,
Sumit Kumar3e274432021-09-14 06:37:56 -050056 postOPPanel = 0x08,
Harisuddin Mohamed Isa0f717e12020-01-15 20:05:33 +080057 i5OSServiceEventBit = 0x10,
58 virtualProgressSRC = 0x80
Matt Spinlerf9bae182019-10-09 13:37:38 -050059 };
60
Matt Spinlerafa2c792020-08-27 11:01:39 -050061 /**
62 * @brief Enums for the error status bits in hex word 5
63 * of BMC SRCs.
64 */
Matt Spinlerda5b76b2023-06-01 15:56:57 -050065 enum class ErrorStatusFlags : uint32_t
Matt Spinlerafa2c792020-08-27 11:01:39 -050066 {
Matt Spinlerda5b76b2023-06-01 15:56:57 -050067 hwCheckstop = 0x80000000,
Sumit Kumar3e274432021-09-14 06:37:56 -050068 terminateFwErr = 0x20000000,
Matt Spinlerafa2c792020-08-27 11:01:39 -050069 deconfigured = 0x02000000,
70 guarded = 0x01000000
71 };
72
Matt Spinlerf9bae182019-10-09 13:37:38 -050073 SRC() = delete;
74 ~SRC() = default;
75 SRC(const SRC&) = delete;
76 SRC& operator=(const SRC&) = delete;
77 SRC(SRC&&) = delete;
78 SRC& operator=(SRC&&) = delete;
79
80 /**
81 * @brief Constructor
82 *
83 * Fills in this class's data fields from the stream.
84 *
85 * @param[in] pel - the PEL data stream
86 */
87 explicit SRC(Stream& pel);
88
89 /**
Matt Spinlerbd716f02019-10-15 10:54:11 -050090 * @brief Constructor
91 *
92 * Creates the section with data from the PEL message registry entry for
93 * this error, along with the AdditionalData property contents from the
94 * corresponding event log.
95 *
96 * @param[in] regEntry - The message registry entry for this event log
97 * @param[in] additionalData - The AdditionalData properties in this event
98 * log
Matt Spinler075e5ba2020-02-21 15:46:00 -060099 * @param[in] dataIface - The DataInterface object
Matt Spinlerbd716f02019-10-15 10:54:11 -0500100 */
Matt Spinler075e5ba2020-02-21 15:46:00 -0600101 SRC(const message::Entry& regEntry, const AdditionalData& additionalData,
Matt Spinler5a90a952020-08-27 09:39:03 -0500102 const DataInterfaceBase& dataIface) :
103 SRC(regEntry, additionalData, nlohmann::json{}, dataIface)
Patrick Williams2544b412022-10-04 08:41:06 -0500104 {}
Matt Spinler5a90a952020-08-27 09:39:03 -0500105
106 /**
107 * @brief Constructor
108 *
109 * Creates the section with data from the PEL message registry entry for
110 * this error, along with the AdditionalData property contents from the
111 * corresponding event log, and a JSON array of callouts to add.
112 *
113 * @param[in] regEntry - The message registry entry for this event log
114 * @param[in] additionalData - The AdditionalData properties in this event
115 * log
116 * @param[in] jsonCallouts - The array of JSON callouts, or an empty object.
117 * @param[in] dataIface - The DataInterface object
118 */
119 SRC(const message::Entry& regEntry, const AdditionalData& additionalData,
120 const nlohmann::json& jsonCallouts, const DataInterfaceBase& dataIface);
Matt Spinlerbd716f02019-10-15 10:54:11 -0500121
122 /**
Matt Spinlerf9bae182019-10-09 13:37:38 -0500123 * @brief Flatten the section into the stream
124 *
125 * @param[in] stream - The stream to write to
126 */
Matt Spinler06885452019-11-06 10:35:42 -0600127 void flatten(Stream& stream) const override;
Matt Spinlerf9bae182019-10-09 13:37:38 -0500128
129 /**
130 * @brief Returns the SRC version, which is a different field
131 * than the version byte in the section header.
132 *
133 * @return uint8_t
134 */
135 uint8_t version() const
136 {
137 return _version;
138 }
139
140 /**
141 * @brief Returns the flags byte
142 *
143 * @return uint8_t
144 */
145 uint8_t flags() const
146 {
147 return _flags;
148 }
149
150 /**
151 * @brief Returns the hex data word count.
152 *
153 * Even though there always 8 words, this returns 9 due to previous
154 * SRC version formats.
155 *
156 * @return uint8_t
157 */
158 uint8_t hexWordCount() const
159 {
160 return _wordCount;
161 }
162
163 /**
164 * @brief Returns the size of the SRC section, not including the header.
165 *
166 * @return uint16_t
167 */
168 uint16_t size() const
169 {
170 return _size;
171 }
172
173 /**
174 * @brief Returns the 8 hex data words.
175 *
176 * @return const std::array<uint32_t, numSRCHexDataWords>&
177 */
178 const std::array<uint32_t, numSRCHexDataWords>& hexwordData() const
179 {
180 return _hexData;
181 }
182
183 /**
184 * @brief Returns the ASCII string
185 *
186 * @return std::string
187 */
188 std::string asciiString() const
189 {
190 return _asciiString->get();
191 }
192
193 /**
194 * @brief Returns the callouts subsection
195 *
196 * If no callouts, this unique_ptr will be empty
197 *
198 * @return const std::unique_ptr<src::Callouts>&
199 */
200 const std::unique_ptr<src::Callouts>& callouts() const
201 {
202 return _callouts;
203 }
204
Matt Spinlerf9bae182019-10-09 13:37:38 -0500205 /**
Matt Spinlerbd716f02019-10-15 10:54:11 -0500206 * @brief Returns the size of this section when flattened into a PEL
Matt Spinlerf9bae182019-10-09 13:37:38 -0500207 *
Matt Spinlerbd716f02019-10-15 10:54:11 -0500208 * @return size_t - the size of the section
Matt Spinlerf9bae182019-10-09 13:37:38 -0500209 */
Matt Spinlerbd716f02019-10-15 10:54:11 -0500210 size_t flattenedSize() const
211 {
212 return _header.size;
213 }
Matt Spinlerf9bae182019-10-09 13:37:38 -0500214
215 /**
216 * @brief Says if this SRC has additional subsections in it
217 *
218 * Note: The callouts section is the only possible subsection.
219 *
220 * @return bool
221 */
222 inline bool hasAdditionalSections() const
223 {
Matt Spinlerbd716f02019-10-15 10:54:11 -0500224 return _flags & additionalSections;
225 }
226
227 /**
228 * @brief Indicates if this event log is for a power fault.
229 *
230 * This comes from a field in the message registry for BMC
231 * generated PELs.
232 *
233 * @return bool
234 */
235 inline bool isPowerFaultEvent() const
236 {
237 return _flags & powerFaultEvent;
238 }
239
Matt Spinlerc63e2e82019-12-02 15:50:12 -0600240 /**
241 * @brief Get the _hexData[] index to use based on the corresponding
242 * SRC word number.
243 *
244 * Converts the specification nomenclature to this data structure.
245 * See the _hexData documentation below for more information.
246 *
247 * @param[in] wordNum - The SRC word number, as defined by the spec.
248 *
249 * @return size_t The corresponding index into _hexData.
250 */
251 inline size_t getWordIndexFromWordNum(size_t wordNum) const
252 {
253 assert(wordNum >= 2 && wordNum <= 9);
254 return wordNum - 2;
255 }
256
Harisuddin Mohamed Isa0f717e12020-01-15 20:05:33 +0800257 /**
258 * @brief Get section in JSON.
Harisuddin Mohamed Isaa214ed32020-02-28 15:58:23 +0800259 * @param[in] registry - Registry object reference
Harisuddin Mohamed Isac8d6cc62020-08-19 22:47:19 +0800260 * @param[in] plugins - Vector of strings of plugins found in filesystem
261 * @param[in] creatorID - Creator Subsystem ID from Private Header
Harisuddin Mohamed Isa0f717e12020-01-15 20:05:33 +0800262 * @return std::optional<std::string> - SRC section's JSON
263 */
Harisuddin Mohamed Isac8d6cc62020-08-19 22:47:19 +0800264 std::optional<std::string> getJSON(message::Registry& registry,
265 const std::vector<std::string>& plugins,
266 uint8_t creatorID) const override;
Harisuddin Mohamed Isa0f717e12020-01-15 20:05:33 +0800267
268 /**
269 * @brief Get error details based on refcode and hexwords
270 * @param[in] registry - Registry object
271 * @param[in] type - detail level enum value : single message or full json
272 * @param[in] toCache - boolean to cache registry in memory, default=false
273 * @return std::optional<std::string> - Error details
274 */
275 std::optional<std::string> getErrorDetails(message::Registry& registry,
276 DetailLevel type,
277 bool toCache = false) const;
278
Matt Spinler075e5ba2020-02-21 15:46:00 -0600279 /**
280 * @brief Says if this SRC was created by the BMC (i.e. this code).
281 *
282 * @return bool - If created by the BMC or not
283 */
284 bool isBMCSRC() const;
285
Sumit Kumar3e274432021-09-14 06:37:56 -0500286 /**
Matt Spinler4deed972023-04-28 14:09:22 -0500287 * @brief Says if this SRC was created by Hostboot
288 *
289 * @return bool - If created by Hostboot or not
290 */
291 bool isHostbootSRC() const;
292
293 /**
Sumit Kumar3e274432021-09-14 06:37:56 -0500294 * @brief Set the terminate bit in hex data word 3.
295 */
296 void setTerminateBit()
297 {
298 setErrorStatusFlag(ErrorStatusFlags::terminateFwErr);
299 }
300
301 /**
302 * @brief Get the SRC structure to pass on to the boot progress dbus
303 * interface.
304 *
305 * @return std::vector<uint8_t> - SRC struct data
306 */
307 std::vector<uint8_t> getSrcStruct();
308
Vijay Lobo875b6c72021-10-20 17:38:56 -0500309 /**
310 * @brief Extracts the first 8 characters of the ASCII String field
311 * from the raw progress SRC and converts it to a uint32_t.
312 *
313 * @param[in] rawProgressSRC - The progress SRC bytes
314 *
315 * @return uint32_t - The code, like 0xCC0099EE from "CC0099EE"
316 */
317 static uint32_t getProgressCode(std::vector<uint8_t>& rawProgressSRC);
318
Matt Spinler8e65f4e2023-05-02 13:40:08 -0500319 /**
320 * @brief Return the value of the passed in error status flag.
321 *
322 * @param[in] flag - The flag
323 *
324 * @return bool - If the flag is set.
325 */
326 bool getErrorStatusFlag(ErrorStatusFlags flag) const
327 {
328 return _hexData[3] & static_cast<uint32_t>(flag);
329 }
330
Matt Spinler0dd22c82023-05-04 15:28:12 -0500331 /**
332 * @brief Clears an error status flag in the SRC.
333 *
334 * @param[in] flag - The flag to set
335 */
336 void clearErrorStatusFlag(ErrorStatusFlags flag)
337 {
338 _hexData[3] &= ~static_cast<uint32_t>(flag);
339 }
340
Matt Spinlerbd716f02019-10-15 10:54:11 -0500341 private:
342 /**
343 * @brief Fills in the user defined hex words from the
344 * AdditionalData fields.
345 *
346 * When creating this section from a message registry entry,
347 * that entry has a field that says which AdditionalData property
348 * fields to use to fill in the user defined hex data words 6-9
349 * (which correspond to hexData words 4-7).
350 *
351 * For example, given that AdditionalData is a map of string keys
352 * to string values, find the AdditionalData value for AdditionalData
353 * key X, convert it to a uint32_t, and save it in user data word Y.
354 *
355 * @param[in] regEntry - The message registry entry for the error
356 * @param[in] additionalData - The AdditionalData map
357 */
358 void setUserDefinedHexWords(const message::Entry& regEntry,
359 const AdditionalData& additionalData);
360 /**
361 * @brief Fills in the object from the stream data
362 *
363 * @param[in] stream - The stream to read from
364 */
365 void unflatten(Stream& stream);
366
367 /**
Matt Spinlerbd716f02019-10-15 10:54:11 -0500368 * @brief Says if the word number is in the range of user defined words.
369 *
370 * This is only used for BMC generated SRCs, where words 6 - 9 are the
371 * user defined ones, meaning that setUserDefinedHexWords() will be
372 * used to fill them in based on the contents of the OpenBMC event log.
373 *
374 * @param[in] wordNum - The SRC word number, as defined by the spec.
375 *
376 * @return bool - If this word number can be filled in by the creator.
377 */
378 inline bool isUserDefinedWord(size_t wordNum) const
379 {
380 return (wordNum >= 6) && (wordNum <= 9);
381 }
382
383 /**
384 * @brief Sets the SRC format byte in the hex word data.
385 */
386 inline void setBMCFormat()
387 {
388 _hexData[0] |= bmcSRCFormat;
389 }
390
391 /**
392 * @brief Sets the hex word field that specifies which BMC
393 * (primary vs backup) created the error.
394 *
395 * Can be hardcoded until there are systems with redundant BMCs.
396 */
397 inline void setBMCPosition()
398 {
399 _hexData[1] |= primaryBMCPosition;
Matt Spinlerf9bae182019-10-09 13:37:38 -0500400 }
401
402 /**
Matt Spinler075e5ba2020-02-21 15:46:00 -0600403 * @brief Sets the motherboard CCIN hex word field
404 *
405 * @param[in] dataIface - The DataInterface object
406 */
407 void setMotherboardCCIN(const DataInterfaceBase& dataIface);
408
409 /**
Vijay Lobo875b6c72021-10-20 17:38:56 -0500410 * @brief Sets the progress code hex word field
411 *
412 * @param[in] dataIface - The DataInterface object
413 */
414 void setProgressCode(const DataInterfaceBase& dataIface);
415
416 /**
Matt Spinlerafa2c792020-08-27 11:01:39 -0500417 * @brief Sets an error status bit in the SRC.
418 *
419 * @param[in] flag - The flag to set
420 */
421 void setErrorStatusFlag(ErrorStatusFlags flag)
422 {
423 _hexData[3] |= static_cast<uint32_t>(flag);
424 }
425
426 /**
Matt Spinlerf9bae182019-10-09 13:37:38 -0500427 * @brief Validates the section contents
428 *
429 * Updates _valid (in Section) with the results.
430 */
431 void validate() override;
432
433 /**
Harisuddin Mohamed Isa0f717e12020-01-15 20:05:33 +0800434 * @brief Get error description from message registry
435 * @param[in] regEntry - The message registry entry for the error
436 * @return std::optional<std::string> - Error message
437 */
438 std::optional<std::string>
439 getErrorMessage(const message::Entry& regEntry) const;
440
441 /**
442 * @brief Get Callout info in JSON
443 * @return std::optional<std::string> - Callout details
444 */
445 std::optional<std::string> getCallouts() const;
446
447 /**
Matt Spinlered046852020-03-13 13:58:15 -0500448 * @brief Checks the AdditionalData property and the message registry
449 * JSON and adds any necessary callouts.
450 *
451 * The callout sources are the AdditionalData event log property
452 * and the message registry JSON.
453 *
Matt Spinler03984582020-04-09 13:17:58 -0500454 * @param[in] regEntry - The message registry entry for the error
455 * @param[in] additionalData - The AdditionalData values
Matt Spinler5a90a952020-08-27 09:39:03 -0500456 * @param[in] jsonCallouts - The array of JSON callouts, or an empty object
Matt Spinlered046852020-03-13 13:58:15 -0500457 * @param[in] dataIface - The DataInterface object
458 */
Matt Spinler03984582020-04-09 13:17:58 -0500459 void addCallouts(const message::Entry& regEntry,
460 const AdditionalData& additionalData,
Matt Spinler5a90a952020-08-27 09:39:03 -0500461 const nlohmann::json& jsonCallouts,
Matt Spinlered046852020-03-13 13:58:15 -0500462 const DataInterfaceBase& dataIface);
463
464 /**
465 * @brief Adds a FRU callout based on an inventory path
466 *
467 * @param[in] inventoryPath - The inventory item to call out
Matt Spinleraf191c72020-06-04 11:35:13 -0500468 * @param[in] priority - An optional priority (uses high if nullopt)
469 * @param[in] locationCode - The expanded location code (or look it up)
Matt Spinlered046852020-03-13 13:58:15 -0500470 * @param[in] dataIface - The DataInterface object
Matt Spinlerb8cb60f2020-08-27 10:55:55 -0500471 * @param[in] mrus - The MRUs to add to the callout
Matt Spinlered046852020-03-13 13:58:15 -0500472 */
Matt Spinlerb8cb60f2020-08-27 10:55:55 -0500473 void
474 addInventoryCallout(const std::string& inventoryPath,
475 const std::optional<CalloutPriority>& priority,
476 const std::optional<std::string>& locationCode,
477 const DataInterfaceBase& dataIface,
478 const std::vector<src::MRU::MRUCallout>& mrus = {});
Matt Spinlered046852020-03-13 13:58:15 -0500479
480 /**
Matt Spinlerf00f9d02020-10-23 09:14:22 -0500481 * @brief Returns the callouts to use from the registry entry.
482 *
Matt Spinler03984582020-04-09 13:17:58 -0500483 * @param[in] regEntry - The message registry entry for the error
Matt Spinlerf00f9d02020-10-23 09:14:22 -0500484 * @param[in] additionalData - The AdditionalData property
Matt Spinler03984582020-04-09 13:17:58 -0500485 * @param[in] dataIface - The DataInterface object
486 */
Matt Spinlerf00f9d02020-10-23 09:14:22 -0500487 std::vector<message::RegistryCallout>
488 getRegistryCallouts(const message::Entry& regEntry,
489 const AdditionalData& additionalData,
490 const DataInterfaceBase& dataIface);
491
492 /**
493 * @brief Adds the FRU callouts from the list of registry callouts
494 * passed in to the SRC.
495 *
496 * The last parameter is used only in a special case when the first
497 * callout is a symbolic FRU with a trusted location code. See the
498 * addRegistryCallout documentation.
499 *
500 * @param[in] callouts - The message registry callouts to add
501 * @param[in] dataIface - The DataInterface object
502 * @param[in] trustedSymbolicFRUInvPath - The optional inventory path used
503 * in the symbolic FRU case.
504 */
505 void addRegistryCallouts(
506 const std::vector<message::RegistryCallout>& callouts,
507 const DataInterfaceBase& dataIface,
508 std::optional<std::string> trustedSymbolicFRUInvPath);
Matt Spinler03984582020-04-09 13:17:58 -0500509
510 /**
511 * @brief Adds a single FRU callout from the message registry.
512 *
Matt Spinlerf00f9d02020-10-23 09:14:22 -0500513 * If the last parameter is filled in, and the registry callout is a
514 * symbolic FRU callout with a trusted location code, and it has the
515 * 'useInventoryLocCode' member set to true, then the location code of
516 * that inventory item will be what is used for that trusted location code.
517 *
Matt Spinler03984582020-04-09 13:17:58 -0500518 * @param[in] callout - The registry callout structure
519 * @param[in] dataIface - The DataInterface object
Matt Spinlerf00f9d02020-10-23 09:14:22 -0500520 * @param[in] trustedSymbolicFRUInvPath - The optional inventory path used
521 * in the symbolic FRU case.
Matt Spinler03984582020-04-09 13:17:58 -0500522 */
Matt Spinlerf00f9d02020-10-23 09:14:22 -0500523 void addRegistryCallout(
524 const message::RegistryCallout& callout,
525 const DataInterfaceBase& dataIface,
526 const std::optional<std::string>& trustedSymbolicFRUInvPath);
Matt Spinler03984582020-04-09 13:17:58 -0500527
528 /**
Matt Spinlered046852020-03-13 13:58:15 -0500529 * @brief Creates the Callouts object _callouts
530 * so that callouts can be added to it.
531 */
532 void createCalloutsObject()
533 {
534 if (!_callouts)
535 {
536 _callouts = std::make_unique<src::Callouts>();
537 _flags |= additionalSections;
538 }
539 }
540
541 /**
Matt Spinler717de422020-06-04 13:10:14 -0500542 * @brief Adds any FRU callouts based on a device path in the
543 * AdditionalData parameter.
544 *
545 * @param[in] additionalData - The AdditionalData values
546 * @param[in] dataIface - The DataInterface object
547 */
548 void addDevicePathCallouts(const AdditionalData& additionalData,
549 const DataInterfaceBase& dataIface);
550
551 /**
Matt Spinler5a90a952020-08-27 09:39:03 -0500552 * @brief Adds any FRU callouts specified in the incoming JSON.
553 *
554 * @param[in] jsonCallouts - The JSON array of callouts
555 * @param[in] dataIface - The DataInterface object
556 */
557 void addJSONCallouts(const nlohmann::json& jsonCallouts,
558 const DataInterfaceBase& dataIface);
559
560 /**
561 * @brief Adds a single callout based on the JSON
562 *
563 * @param[in] jsonCallouts - A single callout entry
564 * @param[in] dataIface - The DataInterface object
565 */
566 void addJSONCallout(const nlohmann::json& jsonCallout,
567 const DataInterfaceBase& dataIface);
Matt Spinler3bdd0112020-08-27 10:24:34 -0500568
569 /**
570 * @brief Extracts a CalloutPriority value from the json
571 * using the 'Priority' key.
572 *
573 * @param[in] json - A JSON object that contains the priority key
574 *
575 * @return CalloutPriority - The priority value
576 */
577 CalloutPriority getPriorityFromJSON(const nlohmann::json& json);
578
Matt Spinler5a90a952020-08-27 09:39:03 -0500579 /**
Matt Spinlerb8cb60f2020-08-27 10:55:55 -0500580 * @brief Exracts MRU values and their priorities from the
581 * input JSON array.
582 *
583 * @param[in] mruJSON - The JSON array
584 */
585 std::vector<src::MRU::MRUCallout>
586 getMRUsFromJSON(const nlohmann::json& mruJSON);
587
588 /**
Sumit Kumar9d43a722021-08-24 09:46:19 -0500589 * @brief Sets the dump status
590 *
591 * @param[in] dataIface - The DataInterface object
592 */
593 void setDumpStatus(const DataInterfaceBase& dataIface);
594
595 /**
Matt Spinlerf9bae182019-10-09 13:37:38 -0500596 * @brief The SRC version field
597 */
598 uint8_t _version;
599
600 /**
601 * @brief The SRC flags field
602 */
603 uint8_t _flags;
604
605 /**
606 * @brief A byte of reserved data after the flags field
607 */
608 uint8_t _reserved1B;
609
610 /**
611 * @brief The hex data word count.
612 *
613 * To be compatible with previous versions of SRCs, this is
614 * number of hex words (8) + 1 = 9.
615 */
616 uint8_t _wordCount;
617
618 /**
619 * @brief Two bytes of reserved data after the hex word count
620 */
621 uint16_t _reserved2B;
622
623 /**
624 * @brief The total size of the SRC section, not including the section
625 * header.
626 */
627 uint16_t _size;
628
629 /**
630 * @brief The SRC 'hex words'.
631 *
632 * In the spec these are referred to as SRC words 2 - 9 as words 0 and 1
633 * are filled by the 8 bytes of fields from above.
634 */
635 std::array<uint32_t, numSRCHexDataWords> _hexData;
636
637 /**
638 * @brief The 32 byte ASCII character string of the SRC
639 *
640 * It is padded with spaces to fill the 32 bytes.
641 * An example is:
642 * "BD8D1234 "
643 *
644 * That first word is what is commonly referred to as the refcode, and
645 * sometimes also called an SRC.
646 */
647 std::unique_ptr<src::AsciiString> _asciiString;
648
649 /**
650 * @brief The callouts subsection.
651 *
652 * Optional and only created if there are callouts.
653 */
654 std::unique_ptr<src::Callouts> _callouts;
655};
656
657} // namespace pels
658} // namespace openpower