1 #pragma once
2 
3 namespace attn
4 {
5 
6 // number of seconds to wait for power fault handling
7 constexpr int POWER_FAULT_WAIT = 10;
8 
9 /** @brief Attention handler return codes */
10 enum ReturnCodes
11 {
12     RC_SUCCESS        = 0,
13     RC_NOT_HANDLED    = 1,
14     RC_ANALYZER_ERROR = 2,
15     RC_CFAM_ERROR     = 3,
16     RC_DBUS_ERROR     = 4
17 };
18 
19 /** @brief Code seciton for error reporing */
20 enum class AttnSection
21 {
22     reserved        = 0x0000,
23     attnHandler     = 0x0100,
24     tiHandler       = 0x0200,
25     handlePhypTi    = 0x0300,
26     handleHbTi      = 0x0400,
27     addHbStatusRegs = 0x0500
28 };
29 
30 /** @brief Attention handler error reason codes */
31 enum AttnCodes
32 {
33     ATTN_NO_ERROR  = 0,
34     ATTN_INFO_NULL = 1,
35     ATTN_PDBG_CFAM = 2,
36     ATTN_PDBG_SCOM = 3
37 };
38 
39 /**
40  * @brief Traces some regs for hostboot
41  *
42  * When we receive a Checkstop or special Attention Term Immediate,
43  * hostboot wants some regs added to the error log. We will do this
44  * by tracing them and then the traces will get added to the error
45  * log later.
46  *
47  * @return nothing
48  */
49 void addHbStatusRegs();
50 
51 /**
52  * @brief Check for recoverable errors present
53  *
54  * @return true if any recoverable errors are present, else false
55  */
56 bool recoverableErrors();
57 
58 /**
59  * @brief sleep for n-seconds
60  *
61  * @param[in] seconds number of seconds to sleep
62  */
63 void sleepSeconds(const unsigned int seconds);
64 
65 } // namespace attn
66