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 commitStatus[0] != TrapPending && |
644 !trapSquash[0] && 645 !tcSquash[0]) { |
646 647 // Get any interrupt that happened 648 Fault intr = cpu->getInterrupts(); 649 650 // Exit this if block if there's no fault. 651 if (intr == NoFault) { 652 goto commit_insts; 653 } 654 |
655 // Tell fetch that there is an interrupt pending. This will 656 // make fetch wait until it sees a non PAL-mode PC, at which 657 // point it stops fetching instructions. 658 toIEW->commitInfo[0].interruptPending = true; 659 660 // Wait until the ROB is empty and all stores have drained in 661 // order to enter the interrupt. 662 if (rob->isEmpty() && !iewStage->hasStoresToWB()) { |
663 // Squash or record that I need to squash this cycle if 664 // an interrupt needed to be handled. 665 DPRINTF(Commit, "Interrupt detected.\n"); 666 |
667 assert(!thread[0]->inSyscall); 668 thread[0]->inSyscall = true; 669 |
670 // CPU will handle interrupt. 671 cpu->processInterrupts(intr); |
672 |
673 thread[0]->inSyscall = false; 674 |
675 commitStatus[0] = TrapPending; 676 |
677 // Generate trap squash event. 678 generateTrapEvent(0); 679 680 toIEW->commitInfo[0].clearInterrupt = true; |
681 } else { 682 DPRINTF(Commit, "Interrupt pending, waiting for ROB to empty.\n"); 683 } 684 } 685#endif // FULL_SYSTEM 686 687 //////////////////////////////////// 688 // Check for any possible squashes, handle them first 689 //////////////////////////////////// |
690 commit_insts: |
691 std::list<unsigned>::iterator threads = (*activeThreads).begin(); 692 693 while (threads != (*activeThreads).end()) { 694 unsigned tid = *threads++; 695 696 // Not sure which one takes priority. I think if we have 697 // both, that's a bad sign. 698 if (trapSquash[tid] == true) { --- 722 unchanged lines hidden --- |