blob: ad3181d466145b4d6cf5f034efa57b2fab28b9dc [file] [log] [blame]
Ben Tyneref320152020-01-09 10:31:23 -06001#pragma once
2
Ben Tyner3fb52e52020-03-31 10:10:07 -05003#include <attn/attn_config.hpp>
4
Ben Tyner73ac3682020-01-09 10:46:47 -06005namespace attn
6{
7
Ben Tynerdbeaf792020-05-14 08:27:18 -05008/** @brief Attention handler return codes */
9enum ReturnCodes
10{
11 RC_SUCCESS = 0,
12 RC_NOT_HANDLED,
13 RC_ANALYZER_ERROR,
14 RC_CFAM_ERROR
15};
16
Ben Tyner29651ef2021-02-08 10:51:03 -060017/** @brief Attention handler return codes */
18enum AttnCodes
19{
20 ATTN_NO_ERROR = 0,
21 ATTN_INFO_NULL = 1
22};
23
Ben Tynerfb190542020-11-06 09:27:56 -060024/** @brief Attention global status bits */
25constexpr uint32_t SBE_ATTN = 0x00000002;
26constexpr uint32_t CHECKSTOP_ATTN = 0x40000000;
27constexpr uint32_t SPECIAL_ATTN = 0x20000000;
28
Ben Tynerb24b2202021-02-08 09:06:10 -060029// Need to add defaultHbTiInfo with SRC BC801B99 (hex)
30
31// Need to add defaultOpalTiInfo with SRC BB821410 (ascii)
32
33constexpr uint8_t defaultPhypTiInfo[0x58] = {
34 0x01, 0xa1, 0x02, 0xa8, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00,
35 0x09, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
37 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38 0x00, 0x00, 0x00, 0x00, 0x42, 0x37, 0x30, 0x30, 0x46, 0x46, 0x46,
39 0x46, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
40 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
41 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
42
Ben Tyneref320152020-01-09 10:31:23 -060043/**
44 * @brief The main attention handler logic
45 *
46 * Check each processor for active attentions of type SBE Vital (vital),
Ben Tynerb24b2202021-02-08 09:06:10 -060047 * System Checkstop (checkstop) and Special Attention (special) and
48 * handle each as follows:
Ben Tyneref320152020-01-09 10:31:23 -060049 *
Ben Tyner3fb52e52020-03-31 10:10:07 -050050 * checkstop: Call hardware error analyzer
Ben Tyneref320152020-01-09 10:31:23 -060051 * vital: TBD
52 * special: Determine if the special attention is a Breakpoint (BP),
Ben Tynerb24b2202021-02-08 09:06:10 -060053 * Terminate Immediately (TI) or CoreCodeToSp (corecode). For
54 * each special attention type, do the following:
Ben Tyneref320152020-01-09 10:31:23 -060055 *
56 * BP: Notify Cronus
Ben Tyner3fb52e52020-03-31 10:10:07 -050057 * TI: Start host diagnostics mode systemd unit
Ben Tyneref320152020-01-09 10:31:23 -060058 * Corecode: TBD
Ben Tyner970fd4f2020-02-19 13:46:42 -060059 *
Ben Tyner3fb52e52020-03-31 10:10:07 -050060 * @param i_config pointer to attention handler configuration object
Ben Tyneref320152020-01-09 10:31:23 -060061 */
Ben Tyner3fb52e52020-03-31 10:10:07 -050062void attnHandler(Config* i_config);
Ben Tyner73ac3682020-01-09 10:46:47 -060063
64} // namespace attn