blob: 67d3f71b82a9f7f7d6792d8b1df5ad5ae99b33b2 [file] [log] [blame]
Ben Tynerbcf65a82020-12-01 08:46:36 -06001#pragma once
2
3namespace attn
4{
5
Ben Tynerb8335562021-07-16 12:43:52 -05006/** @brief Attention handler return codes */
7enum ReturnCodes
8{
9 RC_SUCCESS = 0,
10 RC_NOT_HANDLED = 1,
11 RC_ANALYZER_ERROR = 2,
12 RC_CFAM_ERROR = 3,
13 RC_DBUS_ERROR = 4
14};
15
16/** @brief Code seciton for error reporing */
17enum class AttnSection
18{
19 reserved = 0x0000,
20 attnHandler = 0x0100,
21 tiHandler = 0x0200,
22 handlePhypTi = 0x0300,
23 handleHbTi = 0x0400,
24 addHbStatusRegs = 0x0500
25};
26
27/** @brief Attention handler error reason codes */
28enum AttnCodes
29{
30 ATTN_NO_ERROR = 0,
31 ATTN_INFO_NULL = 1,
32 ATTN_PDBG_CFAM = 2,
33 ATTN_PDBG_SCOM = 3
34};
35
Ben Tynerbcf65a82020-12-01 08:46:36 -060036enum class HostState
37{
38 Quiesce,
Ben Tynerfe2757b2021-01-14 13:17:50 -060039 Diagnostic,
40 Crash
Ben Tynerbcf65a82020-12-01 08:46:36 -060041};
42
43/**
44 * @brief Transition the host state
45 *
46 * We will transition the host state by starting the appropriate dbus target.
47 *
48 * @param i_hostState the state to transition the host to
49 */
50void transitionHost(const HostState i_hostState);
51
Ben Tynerb8335562021-07-16 12:43:52 -050052/**
53 * @brief Traces some regs for hostboot
54 *
55 * When we receive a Checkstop or special Attention Term Immediate,
56 * hostboot wants some regs added to the error log. We will do this
57 * by tracing them and then the traces will get added to the error
58 * log later.
59 *
60 * @return nothing
61 */
62void addHbStatusRegs();
63
Ben Tynerbcf65a82020-12-01 08:46:36 -060064} // namespace attn