Deleted Added
sdiff udiff text old ( 8591:8f23aeaf6a91 ) new ( 8696:642f83fafffb )
full compact
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007 MIPS Technologies, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * Authors: Gabe Black
30 * Korey Sewell
31 * Jaidev Patwardhan
32 */
33
34#ifndef __MIPS_FAULTS_HH__
35#define __MIPS_FAULTS_HH__
36
37#include "arch/mips/pra_constants.hh"
38#include "cpu/thread_context.hh"
39#include "debug/MipsPRA.hh"

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

82
83 void setExceptionState(ThreadContext *, uint8_t);
84
85 virtual FaultVect offset(ThreadContext *tc) const = 0;
86 virtual ExcCode code() const = 0;
87 virtual FaultVect base(ThreadContext *tc) const
88 {
89 StatusReg status = tc->readMiscReg(MISCREG_STATUS);
90 if (status.bev)
91 return tc->readMiscReg(MISCREG_EBASE);
92 else
93 return 0xbfc00200;
94 }
95
96 FaultVect
97 vect(ThreadContext *tc) const
98 {

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

161 void
162 invoke(ThreadContext * tc,
163 StaticInstPtr inst = StaticInst::nullStaticInstPtr)
164 {
165 MipsFault<CoprocessorUnusableFault>::invoke(tc, inst);
166 if (FULL_SYSTEM) {
167 CauseReg cause = tc->readMiscReg(MISCREG_CAUSE);
168 cause.ce = coProcID;
169 tc->setMiscReg(MISCREG_CAUSE, cause);
170 }
171 }
172};
173
174class InterruptFault : public MipsFault<InterruptFault>
175{
176 public:
177 FaultVect
178 offset(ThreadContext *tc) const
179 {
180 CauseReg cause = tc->readMiscRegNoEffect(MISCREG_CAUSE);
181 return cause.iv ? 0x200 : 0x000;
182 }
183};
184
185template <typename T>
186class AddressFault : public MipsFault<T>
187{
188 protected:
189 Addr vaddr;

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

245 tc->setMiscRegNoEffect(MISCREG_CONTEXT, context);
246 }
247
248 void
249 invoke(ThreadContext * tc,
250 StaticInstPtr inst = StaticInst::nullStaticInstPtr)
251 {
252 if (FULL_SYSTEM) {
253 DPRINTF(MipsPRA, "Fault %s encountered.\n", name());
254 tc->pcState(this->vect(tc));
255 setTlbExceptionState(tc, this->code());
256 } else {
257 AddressFault<T>::invoke(tc, inst);
258 }
259 }
260
261 ExcCode
262 code() const
263 {

--- 40 unchanged lines hidden ---