faults.cc (11850:36119fa7874d) | faults.cc (11851:824055fe6b30) |
---|---|
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 | 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); | 771 SparcProcess *sp = dynamic_cast<SparcProcess *>(p); 772 assert(sp); |
774 775 // Then adjust the PC and NPC | 773 774 // Then adjust the PC and NPC |
776 tc->pcState(lp->readSpillStart()); | 775 tc->pcState(sp->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 | 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 |
791 //XXX This will only work in faults from a SparcLiveProcess 792 SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p); 793 assert(lp); | 790 SparcProcess *sp = dynamic_cast<SparcProcess *>(p); 791 assert(sp); |
794 795 // Then adjust the PC and NPC | 792 793 // Then adjust the PC and NPC |
796 tc->pcState(lp->readFillStart()); | 794 tc->pcState(sp->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 | 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 |
813 SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p); 814 assert(lp); | 811 SparcProcess *sp = dynamic_cast<SparcProcess *>(p); 812 assert(sp); |
815 | 813 |
816 lp->handleTrap(_n, tc); | 814 sp->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 | 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 |