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