summaryrefslogtreecommitdiffstats
path: root/src/usr/intr/intrrp.C
diff options
context:
space:
mode:
authorBill Hoffa <wghoffa@us.ibm.com>2016-10-07 14:52:05 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-11-05 23:48:40 -0400
commit3b80efa6dc9eacc981c1b403c64a059c7c5fd1e2 (patch)
tree9b53178163e83bd4eeca44d37607156543aa9437 /src/usr/intr/intrrp.C
parent68f271dece6930f9488c98565596e2750059a421 (diff)
downloadtalos-hostboot-3b80efa6dc9eacc981c1b403c64a059c7c5fd1e2.tar.gz
talos-hostboot-3b80efa6dc9eacc981c1b403c64a059c7c5fd1e2.zip
Create function to handle External Interrupts
Change-Id: I8aa3b0f218e51c28d7e8ca106c75c3c5bfe14f87 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30912 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/intr/intrrp.C')
-rw-r--r--src/usr/intr/intrrp.C151
1 files changed, 75 insertions, 76 deletions
diff --git a/src/usr/intr/intrrp.C b/src/usr/intr/intrrp.C
index b6092cde5..0d963bc86 100644
--- a/src/usr/intr/intrrp.C
+++ b/src/usr/intr/intrrp.C
@@ -523,82 +523,9 @@ void IntrRp::msgHandler()
msg_respond(iv_msgQ, msg);
}
- //Read LSI Interrupt Status register from each enabled
- // proc chip to see which caused the interrupt
- for(ChipList_t::iterator targ_itr = iv_chipList.begin();
- targ_itr != iv_chipList.end(); ++targ_itr)
- {
- uint64_t lsiIntStatus =
- (*targ_itr)->psiHbBaseAddr->lsiintstatus;
- TRACFCOMP(g_trac_intr, "IntrRp::msgHandler() "
- "lsiIntStatus 0x%016lx", lsiIntStatus);
-
- //Loop through each bit, and add any pending
- // interrupts to list for later handling
- for (uint8_t i=0; i < LSI_LAST_SOURCE; i++)
- {
- uint64_t lsiIntMask = 0x8000000000000000 >> i;
- if (lsiIntMask & lsiIntStatus)
- {
- TRACDCOMP(g_trac_intr,"IntrRp::msgHandler()"
- " Interrupt Type: %d found", i);
-
- //Get PIR value for the proc with the
- // interrupt condition
- uint64_t l_groupId =
- (*targ_itr)->proc->getAttr
- <TARGETING::ATTR_FABRIC_GROUP_ID>();
- uint64_t l_chipId =
- (*targ_itr)->proc->getAttr
- <TARGETING::ATTR_FABRIC_CHIP_ID>();
- //Core + Thread IDs not important so use 0's
- PIR_t l_pir = PIR_t(l_groupId, l_chipId,
- 0, 0);
-
- //Make object to search pending interrupt
- // list for
- std::pair<PIR_t, ext_intr_t> l_intr =
- std::make_pair( l_pir,
- static_cast<ext_intr_t>(i));
-
- //See if an interrupt with from Proc with
- // the same PIR + interrupt source are
- // still being processed
- auto l_found = std::find_if(
- iv_pendingIntr.begin(),
- iv_pendingIntr.end(),
- [&l_intr](auto k)->bool
- {
- return ((k.first == l_intr.first) &&
- (k.second == l_intr.second));
- });
- if (l_found != iv_pendingIntr.end())
- {
- TRACFCOMP(g_trac_intr,
- "IntrRp::msgHandler() Pending Interrupt already found for pir: 0x%lx,"
- " interrupt type: %d, Ignoring",
- l_pir, static_cast<ext_intr_t>(i));
- }
- else
- {
- //New pending interrupt for source type
- TRACFCOMP(g_trac_intr,
- "IntrRp::msgHandler() External Interrupt found for pir: 0x%lx,"
- " interrupt type: %d",
- l_pir, static_cast<ext_intr_t>(i));
-
- //Add to list of interrupts in flight
- iv_pendingIntr.push_back(l_intr);
-
- //Call function to route the interrupt
- //to the appropriate handler
- routeInterrupt((*targ_itr),
- static_cast<ext_intr_t>(i),
- l_pir);
- }
- }
- }
- }
+ //Read Interrupt Condition(s) and route to appropriate
+ //interrupt handlers
+ handleExternalInterrupt();
}
}
break;
@@ -1097,6 +1024,78 @@ void IntrRp::routeInterrupt(intr_hdlr_t* i_proc,
return;
}
+void IntrRp::handleExternalInterrupt()
+{
+ //Read LSI Interrupt Status register from each enabled
+ // proc chip to see which caused the interrupt
+ for(ChipList_t::iterator targ_itr = iv_chipList.begin();
+ targ_itr != iv_chipList.end(); ++targ_itr)
+ {
+ uint64_t lsiIntStatus = (*targ_itr)->psiHbBaseAddr->lsiintstatus;
+ TRACFCOMP(g_trac_intr, "IntrRp::msgHandler() lsiIntStatus 0x%016lx",
+ lsiIntStatus);
+
+ //Loop through each bit, and add any pending
+ // interrupts to list for later handling
+ for (uint8_t i=0; i < LSI_LAST_SOURCE; i++)
+ {
+ uint64_t lsiIntMask = 0x8000000000000000 >> i;
+ if (lsiIntMask & lsiIntStatus)
+ {
+ TRACDCOMP(g_trac_intr,"IntrRp::msgHandler()"
+ " Interrupt Type: %d found", i);
+
+ //Get PIR value for the proc with the
+ // interrupt condition
+ uint64_t l_groupId =
+ (*targ_itr)->proc->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>();
+ uint64_t l_chipId =
+ (*targ_itr)->proc->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
+ //Core + Thread IDs not important so use 0's
+ PIR_t l_pir = PIR_t(l_groupId, l_chipId, 0, 0);
+
+ //Make object to search pending interrupt
+ // list for
+ std::pair<PIR_t, ext_intr_t> l_intr =
+ std::make_pair( l_pir, static_cast<ext_intr_t>(i));
+
+ //See if an interrupt with from Proc with
+ // the same PIR + interrupt source are
+ // still being processed
+ auto l_found = std::find_if( iv_pendingIntr.begin(),
+ iv_pendingIntr.end(),
+ [&l_intr](auto k)->bool
+ {
+ return ((k.first == l_intr.first) &&
+ (k.second == l_intr.second));
+ });
+ if (l_found != iv_pendingIntr.end())
+ {
+ TRACFCOMP(g_trac_intr, "IntrRp::msgHandler() Pending"
+ " Interrupt already found for pir: 0x%lx,"
+ " interrupt type: %d, Ignoring",
+ l_pir, static_cast<ext_intr_t>(i));
+ }
+ else
+ {
+ //New pending interrupt for source type
+ TRACFCOMP(g_trac_intr, "IntrRp::msgHandler() External "
+ "Interrupt found for pir: 0x%lx,interrupt type: %d",
+ l_pir, static_cast<ext_intr_t>(i));
+
+ //Add to list of interrupts in flight
+ iv_pendingIntr.push_back(l_intr);
+
+ //Call function to route the interrupt
+ //to the appropriate handler
+ routeInterrupt((*targ_itr), static_cast<ext_intr_t>(i),
+ l_pir);
+ }
+ }
+ }
+ }
+}
+
errlHndl_t IntrRp::maskAllInterruptSources()
{
errlHndl_t l_err = NULL;
OpenPOWER on IntegriCloud