blob: d2b6764ad38f85dc558ee36a92ca6f267035d5bb [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 Tynerfb190542020-11-06 09:27:56 -060017/** @brief Attention global status bits */
18constexpr uint32_t SBE_ATTN = 0x00000002;
19constexpr uint32_t CHECKSTOP_ATTN = 0x40000000;
20constexpr uint32_t SPECIAL_ATTN = 0x20000000;
21
Ben Tyneref320152020-01-09 10:31:23 -060022/**
23 * @brief The main attention handler logic
24 *
25 * Check each processor for active attentions of type SBE Vital (vital),
26 * System Checkstop (checkstop) and Special Attention (special) and handle
27 * each as follows:
28 *
Ben Tyner3fb52e52020-03-31 10:10:07 -050029 * checkstop: Call hardware error analyzer
Ben Tyneref320152020-01-09 10:31:23 -060030 * vital: TBD
31 * special: Determine if the special attention is a Breakpoint (BP),
32 * Terminate Immediately (TI) or CoreCodeToSp (corecode). For each
33 * special attention type, do the following:
34 *
35 * BP: Notify Cronus
Ben Tyner3fb52e52020-03-31 10:10:07 -050036 * TI: Start host diagnostics mode systemd unit
Ben Tyneref320152020-01-09 10:31:23 -060037 * Corecode: TBD
Ben Tyner970fd4f2020-02-19 13:46:42 -060038 *
Ben Tyner3fb52e52020-03-31 10:10:07 -050039 * @param i_config pointer to attention handler configuration object
Ben Tyneref320152020-01-09 10:31:23 -060040 */
Ben Tyner3fb52e52020-03-31 10:10:07 -050041void attnHandler(Config* i_config);
Ben Tyner73ac3682020-01-09 10:46:47 -060042
43} // namespace attn