errlHndl_t ServiceCommon::handleAttentions(const TargetHandle_t i_proc) { errlHndl_t err = NULL; AttentionList attentions; MemOps & memOps = getMemOps(); ProcOps & procOps = getProcOps(); do { attentions.clear(); // query the proc resolver for active attentions err = procOps.resolve(i_proc, 0, attentions); if(err) { break; } // query the mem resolver for active attentions err = memOps.resolve(i_proc, attentions); if(err) { break; } if(!attentions.empty()) { err = getPrdWrapper().callPrd(attentions); } if(err) { break; } #ifdef __HOSTBOOT_RUNTIME // During runtime, we will only handle one attention at a time //and give control back to OPAL. break; #endif //__HOSTBOOT_RUNTIME } while(!attentions.empty()); return err; }
void Service::processAttentions(const TargetHandleList & i_procs) { errlHndl_t err = NULL; AttentionList attentions; MemOps & memOps = getMemOps(); ProcOps & procOps = getProcOps(); do { attentions.clear(); // enumerate the highest priority pending attention // on every chip and then give the entire set to PRD TargetHandleList::const_iterator pit = i_procs.end(); while(pit-- != i_procs.begin()) { // enumerate proc local attentions (xstp,spcl,rec). err = procOps.resolveIpoll(*pit, attentions); if(err) { errlCommit(err, ATTN_COMP_ID); } // enumerate host attentions and convert // to centaur targets err = memOps.resolve(*pit, attentions); if(err) { errlCommit(err, ATTN_COMP_ID); } } err = getPrdWrapper().callPrd(attentions); if(err) { errlCommit(err, ATTN_COMP_ID); } // unmask proc local attentions // (xstp,rec,special) in ipoll mask // any pending attentions will be found // on the next pass pit = i_procs.end(); while(pit-- != i_procs.begin()) { mutex_lock(&iv_mutex); // the other thread might be trying to mask // on the same target. The mutex ensures // neither thread corrupts the register. err = modifyScom( *pit, IPOLL::address, ~HostMask::nonHost(), SCOM_AND); mutex_unlock(&iv_mutex); if(err) { errlCommit(err, ATTN_COMP_ID); } } // if on a given Centaur with a pending attention // on an MBA, an attention comes on in the other MBA // we don't get an interrupt for that. So make another // pass and check for that. } while(!attentions.empty()); }