Deleted Added
sdiff udiff text old ( 11850:36119fa7874d ) new ( 11851:824055fe6b30 )
full compact
1/*
2 * Copyright (c) 2003-2005 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;

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

763 SparcFaultBase::invoke(tc, inst);
764 return;
765 }
766
767 doNormalFault(tc, trapType(), false);
768
769 Process *p = tc->getProcessPtr();
770
771 //XXX This will only work in faults from a SparcLiveProcess
772 SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
773 assert(lp);
774
775 // Then adjust the PC and NPC
776 tc->pcState(lp->readSpillStart());
777}
778
779void
780FillNNormal::invoke(ThreadContext *tc, const StaticInstPtr &inst)
781{
782 if (FullSystem) {
783 SparcFaultBase::invoke(tc, inst);
784 return;
785 }
786
787 doNormalFault(tc, trapType(), false);
788
789 Process *p = tc->getProcessPtr();
790
791 //XXX This will only work in faults from a SparcLiveProcess
792 SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
793 assert(lp);
794
795 // Then adjust the PC and NPC
796 tc->pcState(lp->readFillStart());
797}
798
799void
800TrapInstruction::invoke(ThreadContext *tc, const StaticInstPtr &inst)
801{
802 if (FullSystem) {
803 SparcFaultBase::invoke(tc, inst);
804 return;
805 }
806
807 // In SE, this mechanism is how the process requests a service from
808 // the operating system. We'll get the process object from the thread
809 // context and let it service the request.
810
811 Process *p = tc->getProcessPtr();
812
813 SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
814 assert(lp);
815
816 lp->handleTrap(_n, tc);
817
818 // We need to explicitly advance the pc, since that's not done for us
819 // on a faulting instruction
820 PCState pc = tc->pcState();
821 pc.advance();
822 tc->pcState(pc);
823}
824
825} // namespace SparcISA
826