blob: c41e2311bd25acfc8f4e9cad7e3358a0ff53f1c9 [file] [log] [blame]
Ben Tyner792f32f2020-06-02 08:50:47 -05001#include <libpdbg.h>
2
Ben Tyner0205f3b2020-02-24 10:24:47 -06003#include <analyzer/analyzer_main.hpp>
Ben Tynerb797b3e2020-06-29 10:12:05 -05004#include <attn/attention.hpp>
Ben Tynerbcf65a82020-12-01 08:46:36 -06005#include <attn/attn_common.hpp>
Ben Tynerb797b3e2020-06-29 10:12:05 -05006#include <attn/attn_config.hpp>
7#include <attn/attn_handler.hpp>
8#include <attn/attn_logging.hpp>
9#include <attn/bp_handler.hpp>
10#include <attn/ti_handler.hpp>
Ben Tynerbcf65a82020-12-01 08:46:36 -060011#include <attn/vital_handler.hpp>
Ben Tyneref320152020-01-09 10:31:23 -060012
Ben Tynerb481d902020-03-05 10:24:23 -060013#include <algorithm>
Ben Tyneref320152020-01-09 10:31:23 -060014#include <iomanip>
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050015#include <map>
Ben Tyner9ae5ca42020-02-28 13:13:50 -060016#include <sstream>
Ben Tynerb481d902020-03-05 10:24:23 -060017#include <vector>
Ben Tyneref320152020-01-09 10:31:23 -060018
19namespace attn
20{
21
22/**
Ben Tyneref320152020-01-09 10:31:23 -060023 * @brief Handle checkstop attention
24 *
Ben Tynerb481d902020-03-05 10:24:23 -060025 * @param i_attention Attention object
Ben Tyner3fb52e52020-03-31 10:10:07 -050026 * @return 0 indicates that the checkstop attention was successfully handled
27 * 1 indicates that the checkstop attention was NOT successfully
28 * handled.
Ben Tyneref320152020-01-09 10:31:23 -060029 */
Ben Tynerb481d902020-03-05 10:24:23 -060030int handleCheckstop(Attention* i_attention);
Ben Tyneref320152020-01-09 10:31:23 -060031
32/**
33 * @brief Handle special attention
34 *
Ben Tynerb481d902020-03-05 10:24:23 -060035 * @param i_attention Attention object
Ben Tyner3fb52e52020-03-31 10:10:07 -050036 * @return 0 indicates that the special attention was successfully handled
37 * 1 indicates that the special attention was NOT successfully handled
Ben Tyneref320152020-01-09 10:31:23 -060038 */
Ben Tynerb481d902020-03-05 10:24:23 -060039int handleSpecial(Attention* i_attention);
Ben Tyneref320152020-01-09 10:31:23 -060040
Ben Tynerfb190542020-11-06 09:27:56 -060041/** @brief Determine if attention is active and not masked */
Ben Tyner1965e502020-11-20 10:32:24 -060042bool activeAttn(uint32_t i_val, uint32_t i_mask, uint32_t i_attn);
Ben Tynerfb190542020-11-06 09:27:56 -060043
Ben Tyneref320152020-01-09 10:31:23 -060044/**
Ben Tyneref320152020-01-09 10:31:23 -060045 * @brief The main attention handler logic
Ben Tyner970fd4f2020-02-19 13:46:42 -060046 *
47 * @param i_breakpoints true = breakpoint special attn handling enabled
Ben Tyneref320152020-01-09 10:31:23 -060048 */
Ben Tyner3fb52e52020-03-31 10:10:07 -050049void attnHandler(Config* i_config)
Ben Tyneref320152020-01-09 10:31:23 -060050{
Ben Tynerb481d902020-03-05 10:24:23 -060051 // Vector of active attentions to be handled
52 std::vector<Attention> active_attentions;
53
Ben Tyneref320152020-01-09 10:31:23 -060054 uint32_t isr_val, isr_mask;
Ben Tyneref320152020-01-09 10:31:23 -060055
56 // loop through processors looking for active attentions
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050057 trace<level::INFO>("Attention handler started");
Ben Tyner117af992020-05-22 13:32:11 -050058
Ben Tyneref320152020-01-09 10:31:23 -060059 pdbg_target* target;
Ben Tyner5e622d82020-09-11 10:10:24 -050060 pdbg_for_each_class_target("proc", target)
Ben Tyneref320152020-01-09 10:31:23 -060061 {
62 if (PDBG_TARGET_ENABLED == pdbg_target_probe(target))
63 {
Zane Shelleya79f6c82021-01-12 16:38:49 -060064 auto proc = pdbg_target_index(target); // get processor number
Ben Tyneref320152020-01-09 10:31:23 -060065
Ben Tynerb83c8522020-11-20 10:45:26 -060066 // Use PIB target to determine if a processor is enabled
Ben Tyner5e622d82020-09-11 10:10:24 -050067 char path[16];
Ben Tynerb83c8522020-11-20 10:45:26 -060068 sprintf(path, "/proc%d/pib", proc);
Ben Tyner8882c322021-02-05 12:13:21 -060069 pdbg_target* pibTarget = pdbg_target_from_path(nullptr, path);
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050070
Ben Tynerb83c8522020-11-20 10:45:26 -060071 // sanity check
Ben Tyner8882c322021-02-05 12:13:21 -060072 if (nullptr == pibTarget)
Ben Tynerb83c8522020-11-20 10:45:26 -060073 {
74 trace<level::INFO>("pib path or target not found");
75 continue;
76 }
77
Ben Tyner8882c322021-02-05 12:13:21 -060078 // check if pib target is enabled
79 if (PDBG_TARGET_ENABLED == pdbg_target_probe(pibTarget))
Ben Tyneref320152020-01-09 10:31:23 -060080 {
Ben Tynerb83c8522020-11-20 10:45:26 -060081 // The processor FSI target is required for CFAM read
82 sprintf(path, "/proc%d/fsi", proc);
Ben Tyner8882c322021-02-05 12:13:21 -060083 pdbg_target* fsiTarget = pdbg_target_from_path(nullptr, path);
Ben Tynerb83c8522020-11-20 10:45:26 -060084
85 // sanity check
Ben Tyner8882c322021-02-05 12:13:21 -060086 if (nullptr == fsiTarget)
Ben Tynerb83c8522020-11-20 10:45:26 -060087 {
88 trace<level::INFO>("fsi path or target not found");
89 continue;
90 }
91
Ben Tyner8882c322021-02-05 12:13:21 -060092 // trace the proc number
93 std::string traceMsg = "proc: " + std::to_string(proc);
94 trace<level::INFO>(traceMsg.c_str());
Ben Tyner1965e502020-11-20 10:32:24 -060095
Ben Tyner5adc96e2020-11-20 10:54:12 -060096 isr_val = 0xffffffff; // invalid isr value
97
Ben Tyner5e622d82020-09-11 10:10:24 -050098 // get active attentions on processor
Ben Tyner8882c322021-02-05 12:13:21 -060099 if (RC_SUCCESS != fsi_read(fsiTarget, 0x1007, &isr_val))
Ben Tyneref320152020-01-09 10:31:23 -0600100 {
Ben Tynerfb190542020-11-06 09:27:56 -0600101 // log cfam read error
Ben Tyner5e622d82020-09-11 10:10:24 -0500102 trace<level::INFO>("Error! cfam read 0x1007 FAILED");
Ben Tynerfb190542020-11-06 09:27:56 -0600103 eventAttentionFail(RC_CFAM_ERROR);
Ben Tyneref320152020-01-09 10:31:23 -0600104 }
Ben Tyner5adc96e2020-11-20 10:54:12 -0600105 else if (0xffffffff == isr_val)
106 {
107 trace<level::INFO>("Error! cfam read 0x1007 INVALID");
108 continue;
109 }
Ben Tyneref320152020-01-09 10:31:23 -0600110 else
111 {
Ben Tyner8882c322021-02-05 12:13:21 -0600112 // trace isr value
113 std::stringstream ssIsr;
114 ssIsr << "cfam 0x1007 = 0x" << std::setw(8)
115 << std::setfill('0') << std::hex << isr_val;
116 std::string strobjIsr = ssIsr.str();
117 trace<level::INFO>(strobjIsr.c_str());
Ben Tyner1965e502020-11-20 10:32:24 -0600118
Ben Tyner5adc96e2020-11-20 10:54:12 -0600119 isr_mask = 0xffffffff; // invalid isr mask
120
Ben Tyner5e622d82020-09-11 10:10:24 -0500121 // get interrupt enabled special attentions mask
Ben Tyner8882c322021-02-05 12:13:21 -0600122 if (RC_SUCCESS != fsi_read(fsiTarget, 0x100d, &isr_mask))
Ben Tyneref320152020-01-09 10:31:23 -0600123 {
Ben Tynerfb190542020-11-06 09:27:56 -0600124 // log cfam read error
Ben Tyner5e622d82020-09-11 10:10:24 -0500125 trace<level::INFO>("Error! cfam read 0x100d FAILED");
Ben Tynerfb190542020-11-06 09:27:56 -0600126 eventAttentionFail(RC_CFAM_ERROR);
Ben Tyneref320152020-01-09 10:31:23 -0600127 }
Ben Tyner5adc96e2020-11-20 10:54:12 -0600128 else if (0xffffffff == isr_mask)
129 {
130 trace<level::INFO>("Error! cfam read 0x100d INVALID");
131 continue;
132 }
Ben Tyner5e622d82020-09-11 10:10:24 -0500133 else
134 {
Ben Tyner8882c322021-02-05 12:13:21 -0600135 // trace true mask
136 std::stringstream ssMask;
137 ssMask << "cfam 0x100d = 0x" << std::setw(8)
138 << std::setfill('0') << std::hex << isr_mask;
139 std::string strobjMask = ssMask.str();
140 trace<level::INFO>(strobjMask.c_str());
Ben Tyner1965e502020-11-20 10:32:24 -0600141
Ben Tynerfb190542020-11-06 09:27:56 -0600142 // SBE vital attention active and not masked?
Ben Tyner1965e502020-11-20 10:32:24 -0600143 if (true == activeAttn(isr_val, isr_mask, SBE_ATTN))
Ben Tyner5e622d82020-09-11 10:10:24 -0500144 {
145 active_attentions.emplace_back(Attention::Vital,
146 handleVital, target,
147 i_config);
148 }
149
Ben Tynerfb190542020-11-06 09:27:56 -0600150 // Checkstop attention active and not masked?
151 if (true ==
Ben Tyner1965e502020-11-20 10:32:24 -0600152 activeAttn(isr_val, isr_mask, CHECKSTOP_ATTN))
Ben Tyner5e622d82020-09-11 10:10:24 -0500153 {
154 active_attentions.emplace_back(Attention::Checkstop,
155 handleCheckstop,
156 target, i_config);
157 }
158
Ben Tynerfb190542020-11-06 09:27:56 -0600159 // Special attention active and not masked?
Ben Tyner1965e502020-11-20 10:32:24 -0600160 if (true == activeAttn(isr_val, isr_mask, SPECIAL_ATTN))
Ben Tyner5e622d82020-09-11 10:10:24 -0500161 {
162 active_attentions.emplace_back(Attention::Special,
163 handleSpecial,
164 target, i_config);
165 }
166 } // cfam 0x100d valid
167 } // cfam 0x1007 valid
Ben Tyner8882c322021-02-05 12:13:21 -0600168 } // fsi target enabled
169 } // pib target enabled
Ben Tyner5e622d82020-09-11 10:10:24 -0500170 } // next processor
Ben Tyneref320152020-01-09 10:31:23 -0600171
Ben Tynerb481d902020-03-05 10:24:23 -0600172 // convert to heap, highest priority is at front
173 if (!std::is_heap(active_attentions.begin(), active_attentions.end()))
174 {
175 std::make_heap(active_attentions.begin(), active_attentions.end());
176 }
177
178 // call the attention handler until one is handled or all were attempted
179 while (false == active_attentions.empty())
180 {
181 // handle highest priority attention, done if successful
182 if (RC_SUCCESS == active_attentions.front().handle())
183 {
Ben Tynerb1ebfcb2020-05-08 18:52:48 -0500184 // an attention was handled so we are done
Ben Tynerb481d902020-03-05 10:24:23 -0600185 break;
186 }
187
188 // move attention to back of vector
189 std::pop_heap(active_attentions.begin(), active_attentions.end());
190
191 // remove attention from vector
192 active_attentions.pop_back();
193 }
Ben Tyneref320152020-01-09 10:31:23 -0600194}
195
196/**
Ben Tyneref320152020-01-09 10:31:23 -0600197 * @brief Handle checkstop attention
Ben Tyner3fb52e52020-03-31 10:10:07 -0500198 *
199 * @param i_attention Attention object
200 * @return 0 indicates that the checkstop attention was successfully handled
201 * 1 indicates that the checkstop attention was NOT successfully
202 * handled.
Ben Tyneref320152020-01-09 10:31:23 -0600203 */
Ben Tynerb481d902020-03-05 10:24:23 -0600204int handleCheckstop(Attention* i_attention)
Ben Tyneref320152020-01-09 10:31:23 -0600205{
Ben Tyner3fb52e52020-03-31 10:10:07 -0500206 int rc = RC_SUCCESS; // assume checkstop handled
Ben Tyneref320152020-01-09 10:31:23 -0600207
Ben Tynerb1ebfcb2020-05-08 18:52:48 -0500208 trace<level::INFO>("checkstop handler started");
209
Ben Tyner3fb52e52020-03-31 10:10:07 -0500210 // if checkstop handling enabled, handle checkstop attention
211 if (false == (i_attention->getConfig()->getFlag(enCheckstop)))
212 {
Ben Tynerb1ebfcb2020-05-08 18:52:48 -0500213 trace<level::INFO>("Checkstop handling disabled");
Ben Tyner3fb52e52020-03-31 10:10:07 -0500214 }
215 else
216 {
Zane Shelley9fb73932020-09-15 13:34:57 -0500217 // Look for any attentions found in hardware. This will generate and
Zane Shelley7ae9c8c2020-12-02 20:10:31 -0600218 // commit a PEL if any errors are found.
Zane Shelley9fb73932020-09-15 13:34:57 -0500219 if (true != analyzer::analyzeHardware())
Ben Tynerb1ebfcb2020-05-08 18:52:48 -0500220 {
221 rc = RC_ANALYZER_ERROR;
222 }
Ben Tyner3fb52e52020-03-31 10:10:07 -0500223 }
Ben Tyneref320152020-01-09 10:31:23 -0600224
Ben Tyneref320152020-01-09 10:31:23 -0600225 return rc;
226}
227
228/**
229 * @brief Handle special attention
Ben Tyner3fb52e52020-03-31 10:10:07 -0500230 *
231 * @param i_attention Attention object
232 * @return 0 indicates that the special attention was successfully handled
233 * 1 indicates that the special attention was NOT successfully handled
Ben Tyneref320152020-01-09 10:31:23 -0600234 */
Ben Tynerb481d902020-03-05 10:24:23 -0600235int handleSpecial(Attention* i_attention)
Ben Tyneref320152020-01-09 10:31:23 -0600236{
Ben Tynerb1ebfcb2020-05-08 18:52:48 -0500237 int rc = RC_SUCCESS; // assume special attention handled
Ben Tyneref320152020-01-09 10:31:23 -0600238
Ben Tynerfb190542020-11-06 09:27:56 -0600239 // The TI info chipop will give us a pointer to the TI info data
Ben Tyner98430b32020-08-19 19:14:02 -0500240 uint8_t* tiInfo = nullptr; // ptr to TI info data
241 uint32_t tiInfoLen = 0; // length of TI info data
242 pdbg_target* attnProc = i_attention->getTarget(); // proc with attention
Ben Tynerb1ebfcb2020-05-08 18:52:48 -0500243
Ben Tyner29651ef2021-02-08 10:51:03 -0600244 bool tiInfoStatic = false; // assume TI info was provided (not created)
245
Ben Tyner98430b32020-08-19 19:14:02 -0500246 if (attnProc != nullptr)
Ben Tyner89c0a7a2020-08-07 12:07:35 -0500247 {
Ben Tyner98430b32020-08-19 19:14:02 -0500248 // The processor PIB target is required for get TI info chipop
249 char path[16];
250 sprintf(path, "/proc%d/pib", pdbg_target_index(attnProc));
251 pdbg_target* tiInfoTarget = pdbg_target_from_path(nullptr, path);
252
253 if (nullptr != tiInfoTarget)
Ben Tyner89c0a7a2020-08-07 12:07:35 -0500254 {
Ben Tyner98430b32020-08-19 19:14:02 -0500255 if (PDBG_TARGET_ENABLED == pdbg_target_probe(tiInfoTarget))
256 {
Ben Tyner98430b32020-08-19 19:14:02 -0500257 sbe_mpipl_get_ti_info(tiInfoTarget, &tiInfo, &tiInfoLen);
258 if (tiInfo == nullptr)
259 {
260 trace<level::INFO>("TI info data ptr is null after call");
Ben Tyner29651ef2021-02-08 10:51:03 -0600261 tiInfo = (uint8_t*)defaultPhypTiInfo;
262 tiInfoStatic = true; // using our TI info
Ben Tyner98430b32020-08-19 19:14:02 -0500263 }
264 }
Ben Tyner89c0a7a2020-08-07 12:07:35 -0500265 }
266 }
Ben Tyneref320152020-01-09 10:31:23 -0600267
Ben Tyner0fe5df42020-12-03 08:57:17 -0600268 bool tiInfoValid = false; // TI area data not valid or not available
269
Ben Tyner792f32f2020-06-02 08:50:47 -0500270 // If TI area exists and is marked valid we can assume TI occurred
271 if ((nullptr != tiInfo) && (0 != tiInfo[0]))
Ben Tyner970fd4f2020-02-19 13:46:42 -0600272 {
Ben Tyner792f32f2020-06-02 08:50:47 -0500273 TiDataArea* tiDataArea = (TiDataArea*)tiInfo;
Ben Tyner7e6611f2020-02-13 16:42:56 -0600274
Ben Tyner8882c322021-02-05 12:13:21 -0600275 std::stringstream ss; // string stream object for tracing
276 std::string strobj; // string object for tracing
Ben Tyner40717722020-09-23 09:43:20 -0500277
Ben Tyner8882c322021-02-05 12:13:21 -0600278 // trace a few known TI data area values
279 ss.str(std::string()); // empty the stream
280 ss.clear(); // clear the stream
281 ss << "TI data command = 0x" << std::setw(2) << std::setfill('0')
282 << std::hex << (int)tiDataArea->command;
283 strobj = ss.str();
284 trace<level::INFO>(strobj.c_str());
Ben Tyner40717722020-09-23 09:43:20 -0500285
Ben Tyner0fe5df42020-12-03 08:57:17 -0600286 // Another check for valid TI Info since it has been seen that
287 // tiInfo[0] != 0 but TI info is not valid
288 if (0xa1 == tiDataArea->command)
Ben Tyner792f32f2020-06-02 08:50:47 -0500289 {
Ben Tyner0fe5df42020-12-03 08:57:17 -0600290 tiInfoValid = true;
291
292 // trace some more data since TI info appears valid
Ben Tyner8882c322021-02-05 12:13:21 -0600293 ss.str(std::string()); // empty the stream
294 ss.clear(); // clear the stream
295 ss << "TI data hb_terminate_type = 0x" << std::setw(2)
296 << std::setfill('0') << std::hex
Ben Tyner0fe5df42020-12-03 08:57:17 -0600297 << (int)tiDataArea->hbTerminateType;
Ben Tyner8882c322021-02-05 12:13:21 -0600298 strobj = ss.str();
299 trace<level::INFO>(strobj.c_str());
Ben Tyner0fe5df42020-12-03 08:57:17 -0600300
Ben Tyner8882c322021-02-05 12:13:21 -0600301 ss.str(std::string()); // empty the stream
302 ss.clear(); // clear the stream
303 ss << "TI data SRC format = 0x" << std::setw(2) << std::setfill('0')
304 << std::hex << (int)tiDataArea->srcFormat;
305 strobj = ss.str();
306 trace<level::INFO>(strobj.c_str());
Ben Tyner0fe5df42020-12-03 08:57:17 -0600307
Ben Tyner8882c322021-02-05 12:13:21 -0600308 ss.str(std::string()); // empty the stream
309 ss.clear(); // clear the stream
310 ss << "TI data source = 0x" << std::setw(2) << std::setfill('0')
311 << std::hex << (int)tiDataArea->source;
312 strobj = ss.str();
313 trace<level::INFO>(strobj.c_str());
Ben Tyner0fe5df42020-12-03 08:57:17 -0600314
315 if (true == (i_attention->getConfig()->getFlag(enTerminate)))
316 {
317 // Call TI special attention handler
318 rc = tiHandler(tiDataArea);
319 }
Ben Tyner792f32f2020-06-02 08:50:47 -0500320 }
Ben Tyner3fb52e52020-03-31 10:10:07 -0500321 }
Ben Tyner0fe5df42020-12-03 08:57:17 -0600322
323 // If TI area not valid or not available
324 if (false == tiInfoValid)
Ben Tyner3fb52e52020-03-31 10:10:07 -0500325 {
Ben Tynere4f5dbe2020-10-19 07:19:33 -0500326 trace<level::INFO>("TI info NOT available");
Ben Tyner98430b32020-08-19 19:14:02 -0500327
Ben Tynere4f5dbe2020-10-19 07:19:33 -0500328 // if configured to handle breakpoint as default special attention
329 if (i_attention->getConfig()->getFlag(dfltBreakpoint))
Ben Tyner3fb52e52020-03-31 10:10:07 -0500330 {
Ben Tynere4f5dbe2020-10-19 07:19:33 -0500331 if (true == (i_attention->getConfig()->getFlag(enBreakpoints)))
332 {
Ben Tynere4f5dbe2020-10-19 07:19:33 -0500333 // Call the breakpoint special attention handler
334 bpHandler();
335 }
336 }
337 // if configured to handle TI as default special attention
338 else
339 {
340 trace<level::INFO>("assuming TI");
341
342 if (true == (i_attention->getConfig()->getFlag(enTerminate)))
343 {
Ben Tynere4f5dbe2020-10-19 07:19:33 -0500344 // Call TI special attention handler
345 rc = tiHandler(nullptr);
346 }
Ben Tyner3fb52e52020-03-31 10:10:07 -0500347 }
Ben Tyner970fd4f2020-02-19 13:46:42 -0600348 }
Ben Tyneref320152020-01-09 10:31:23 -0600349
Ben Tyner792f32f2020-06-02 08:50:47 -0500350 // release TI data buffer
Ben Tyner29651ef2021-02-08 10:51:03 -0600351 if ((nullptr != tiInfo) && (false == tiInfoStatic))
Ben Tyner792f32f2020-06-02 08:50:47 -0500352 {
353 free(tiInfo);
354 }
355
Ben Tyner3fb52e52020-03-31 10:10:07 -0500356 if (RC_SUCCESS != rc)
357 {
Ben Tyner792f32f2020-06-02 08:50:47 -0500358 trace<level::INFO>("Special attn not handled");
Ben Tyner3fb52e52020-03-31 10:10:07 -0500359 }
Ben Tyneref320152020-01-09 10:31:23 -0600360
361 return rc;
362}
363
Ben Tynerfb190542020-11-06 09:27:56 -0600364/**
365 * @brief Determine if attention is active and not masked
366 *
367 * Determine whether an attention needs to be handled and trace details of
368 * attention type and whether it is masked or not.
369 *
370 * @param i_val attention status register
371 * @param i_mask attention true mask register
372 * @param i_attn attention type
373 * @param i_proc processor associated with registers
374 *
375 * @return true if attention is active and not masked, otherwise false
376 */
Ben Tyner1965e502020-11-20 10:32:24 -0600377bool activeAttn(uint32_t i_val, uint32_t i_mask, uint32_t i_attn)
Ben Tynerfb190542020-11-06 09:27:56 -0600378{
Zane Shelley9fb657f2021-01-12 15:30:58 -0600379 bool rc = false; // assume attn masked and/or inactive
Ben Tynerfb190542020-11-06 09:27:56 -0600380
381 // if attention active
382 if (0 != (i_val & i_attn))
383 {
Ben Tynerfb190542020-11-06 09:27:56 -0600384 std::stringstream ss;
Ben Tynerfb190542020-11-06 09:27:56 -0600385
Zane Shelley9fb657f2021-01-12 15:30:58 -0600386 bool validAttn = true; // known attention type
387
Ben Tynerfb190542020-11-06 09:27:56 -0600388 switch (i_attn)
389 {
390 case SBE_ATTN:
391 ss << "SBE attn";
392 break;
393 case CHECKSTOP_ATTN:
394 ss << "Checkstop attn";
395 break;
396 case SPECIAL_ATTN:
397 ss << "Special attn";
398 break;
399 default:
400 ss << "Unknown attn";
401 validAttn = false;
402 }
403
404 // see if attention is masked
405 if (true == validAttn)
406 {
407 if (0 != (i_mask & i_attn))
408 {
409 rc = true; // attention active and not masked
410 }
411 else
412 {
413 ss << " masked";
414 }
415 }
416
Ben Tyner8882c322021-02-05 12:13:21 -0600417 std::string strobj = ss.str(); // ss.str() is temporary
418 trace<level::INFO>(strobj.c_str()); // commit trace stream
Ben Tynerfb190542020-11-06 09:27:56 -0600419 }
420
421 return rc;
422}
423
Ben Tyneref320152020-01-09 10:31:23 -0600424} // namespace attn