Deleted Added
sdiff udiff text old ( 3577:605c370622b1 ) new ( 3633:524f2aadbc89 )
full compact
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 626 unchanged lines hidden (view full) ---

635 //////////////////////////////////////
636
637#if FULL_SYSTEM
638 // Process interrupts if interrupts are enabled, not in PAL mode,
639 // and no other traps or external squashes are currently pending.
640 // @todo: Allow other threads to handle interrupts.
641 if (cpu->checkInterrupts &&
642 cpu->check_interrupts(cpu->tcBase(0)) &&
643 !trapSquash[0] &&
644 !tcSquash[0]) {
645 // Tell fetch that there is an interrupt pending. This will
646 // make fetch wait until it sees a non PAL-mode PC, at which
647 // point it stops fetching instructions.
648 toIEW->commitInfo[0].interruptPending = true;
649
650 // Wait until the ROB is empty and all stores have drained in
651 // order to enter the interrupt.
652 if (rob->isEmpty() && !iewStage->hasStoresToWB()) {
653 // Not sure which thread should be the one to interrupt. For now
654 // always do thread 0.
655 assert(!thread[0]->inSyscall);
656 thread[0]->inSyscall = true;
657
658 // CPU will handle implementation of the interrupt.
659 cpu->processInterrupts();
660
661 // Now squash or record that I need to squash this cycle.
662 commitStatus[0] = TrapPending;
663
664 // Exit state update mode to avoid accidental updating.
665 thread[0]->inSyscall = false;
666
667 // Generate trap squash event.
668 generateTrapEvent(0);
669
670 toIEW->commitInfo[0].clearInterrupt = true;
671
672 DPRINTF(Commit, "Interrupt detected.\n");
673 } else {
674 DPRINTF(Commit, "Interrupt pending, waiting for ROB to empty.\n");
675 }
676 }
677#endif // FULL_SYSTEM
678
679 ////////////////////////////////////
680 // Check for any possible squashes, handle them first
681 ////////////////////////////////////
682
683 std::list<unsigned>::iterator threads = (*activeThreads).begin();
684
685 while (threads != (*activeThreads).end()) {
686 unsigned tid = *threads++;
687
688 // Not sure which one takes priority. I think if we have
689 // both, that's a bad sign.
690 if (trapSquash[tid] == true) {

--- 722 unchanged lines hidden ---