diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-03-03 03:34:52 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-03-03 03:34:52 +0000 |
commit | 94133657a1b9ff889da93e5c4ad6d858c8f21bf6 (patch) | |
tree | 74aa4343bb82f59325acaca462b31ee9df058600 /src/arch/sparc/faults.cc | |
parent | dc8cc8de3da85199a2dbbb6e3ccf75337fdf2de2 (diff) | |
parent | 4e8d2d1593475008b926829e6944a59963166079 (diff) | |
download | gem5-94133657a1b9ff889da93e5c4ad6d858c8f21bf6.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/newmem
into ahchoo.blinky.homelinux.org:/home/gblack/m5/newmem
--HG--
extra : convert_revision : dcb1fc0c6252fb96a956640c6d7995679da725e5
Diffstat (limited to 'src/arch/sparc/faults.cc')
-rw-r--r-- | src/arch/sparc/faults.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/sparc/faults.cc b/src/arch/sparc/faults.cc index a6f4343ae..391dd7134 100644 --- a/src/arch/sparc/faults.cc +++ b/src/arch/sparc/faults.cc @@ -656,6 +656,26 @@ void FillNNormal::invoke(ThreadContext *tc) tc->setNextNPC(fillStart + 2*sizeof(MachInst)); } +void TrapInstruction::invoke(ThreadContext *tc) +{ + //In SE, this mechanism is how the process requests a service from the + //operating system. We'll get the process object from the thread context + //and let it service the request. + + Process *p = tc->getProcessPtr(); + + SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p); + assert(lp); + + lp->handleTrap(_n, tc); + + //We need to explicitly advance the pc, since that's not done for us + //on a faulting instruction + tc->setPC(tc->readNextPC()); + tc->setNextPC(tc->readNextNPC()); + tc->setNextNPC(tc->readNextNPC() + sizeof(MachInst)); +} + void PageTableFault::invoke(ThreadContext *tc) { Process *p = tc->getProcessPtr(); |