[Avida-SVN] r3126 - branches/interrupt/source/cpu

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Mon Jan 19 06:42:26 PST 2009


Author: beckma24
Date: 2009-01-19 09:42:26 -0500 (Mon, 19 Jan 2009)
New Revision: 3126

Modified:
   branches/interrupt/source/cpu/cHardwareCPU.cc
Log:
BUG FIX:  A MSG_received_handler_START followed by a interrupt_handler_END was not being respected as a complete interrupt handler

Modified: branches/interrupt/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/interrupt/source/cpu/cHardwareCPU.cc	2009-01-19 05:35:17 UTC (rev 3125)
+++ branches/interrupt/source/cpu/cHardwareCPU.cc	2009-01-19 14:42:26 UTC (rev 3126)
@@ -152,7 +152,7 @@
 
 void cLocalThread::interruptContextSwitch(int interruptType) {
 	// note: movement interrupts cannot be blocked, just message interrupts
-	// note: movements within an interrupt handler do not cause another interrupt
+	// note: movements within an interrupt handler do not cause another interrupt (REALLY?)
 	// note: interrupt handlers can be jumped into and out of
   // TODO: config arg to disallow jumping into and out of interrupt handler
 	
@@ -164,7 +164,9 @@
 		switch (interruptType) {
 			case cLocalThread::MSG_INTERRUPT:
 				if(initializeInterruptState("MSG_received_handler_START")) {
+					hardware->IP().Retreat();
 					hardware->Inst_RetrieveMessage(m_world->GetDefaultContext());
+					hardware->IP().Advance();
 				}
 				break;
 			case cLocalThread::MOVE_INTERRUPT:
@@ -181,7 +183,9 @@
 	else if(interrupted && interruptType == cLocalThread::INTERRUPT_COMPLETE) { // currently interrupted	
 		if(hardware->GetOrganism()->NumQueuedMessages() > 0) { // more messages to process
 			if(initializeInterruptState("MSG_received_handler_START")) {
+				hardware->IP().Retreat();
 				hardware->Inst_RetrieveMessage(m_world->GetDefaultContext());
+				hardware->IP().Advance();
 			}
 		} else { // interrupt -> normal
 			interrupted = false;




More information about the Avida-cvs mailing list