gem5
v20.0.0.2
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
+
Enumerations
a
b
c
d
e
f
i
l
m
o
p
r
s
t
v
x
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
w
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
+
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
+
Enumerations
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
v
w
+
Enumerator
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
arch
mips
interrupts.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 MIPS Technologies, Inc.
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;
9
* redistributions in binary form must reproduce the above copyright
10
* notice, this list of conditions and the following disclaimer in the
11
* documentation and/or other materials provided with the distribution;
12
* neither the name of the copyright holders nor the names of its
13
* contributors may be used to endorse or promote products derived from
14
* this software without specific prior written permission.
15
*
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
#ifndef __ARCH_MIPS_INTERRUPT_HH__
30
#define __ARCH_MIPS_INTERRUPT_HH__
31
32
#include <string>
33
34
#include "
arch/generic/interrupts.hh
"
35
#include "
arch/mips/faults.hh
"
36
#include "
base/compiler.hh
"
37
#include "
base/logging.hh
"
38
#include "params/MipsInterrupts.hh"
39
#include "
sim/serialize.hh
"
40
41
class
BaseCPU
;
42
class
Checkpoint;
43
44
namespace
MipsISA
45
{
46
47
class
Interrupts
:
public
BaseInterrupts
48
{
49
public
:
50
typedef
MipsInterruptsParams
Params
;
51
52
const
Params *
53
params
()
const
54
{
55
return
dynamic_cast<
const
Params *
>
(
_params
);
56
}
57
58
Interrupts
(Params *
p
) :
BaseInterrupts
(p)
59
{
60
}
61
62
void
setCPU
(
BaseCPU
*_cpu)
override
{}
63
64
// post(int int_num, int index) is responsible
65
// for posting an interrupt. It sets a bit
66
// in intstatus corresponding to Cause IP*. The
67
// MIPS register Cause is updated by updateIntrInfo
68
// which is called by checkInterrupts
69
//
70
void
post
(
int
int_num,
ThreadContext
*tc);
71
void
post
(
int
int_num,
int
index
)
override
;
72
73
// clear(int int_num, int index) is responsible
74
// for clearing an interrupt. It clear a bit
75
// in intstatus corresponding to Cause IP*. The
76
// MIPS register Cause is updated by updateIntrInfo
77
// which is called by checkInterrupts
78
//
79
void
clear
(
int
int_num,
ThreadContext
* tc);
80
void
clear
(
int
int_num,
int
index)
override
;
81
82
// clearAll() is responsible
83
// for clearing all interrupts. It clears all bits
84
// in intstatus corresponding to Cause IP*. The
85
// MIPS register Cause is updated by updateIntrInfo
86
// which is called by checkInterrupts
87
//
88
void
clearAll
(
ThreadContext
*tc);
89
void
clearAll
()
override
;
90
91
// getInterrupt(ThreadContext * tc) checks if an interrupt
92
// should be returned. It ands the interrupt mask and
93
// and interrupt pending bits to see if one exists. It
94
// also makes sure interrupts are enabled (IE) and
95
// that ERL and ERX are not set
96
//
97
Fault
getInterrupt
(
ThreadContext
*tc)
override
;
98
99
// updateIntrInfo(ThreadContext *tc) const syncs the
100
// MIPS cause register with the instatus variable. instatus
101
// is essentially a copy of the MIPS cause[IP7:IP0]
102
//
103
void
updateIntrInfo
(
ThreadContext
*tc)
override
;
104
bool
interruptsPending
(
ThreadContext
*tc)
const
;
105
bool
onCpuTimerInterrupt
(
ThreadContext
*tc)
const
;
106
bool
checkInterrupts
(
ThreadContext
*tc)
const override
;
107
108
void
109
serialize
(
CheckpointOut
&
cp
)
const override
110
{
111
fatal
(
"Serialization of Interrupts Unimplemented for MIPS"
);
112
}
113
114
void
115
unserialize
(
CheckpointIn
&
cp
)
override
116
{
117
fatal
(
"Unserialization of Interrupts Unimplemented for MIPS"
);
118
}
119
};
120
121
}
122
123
#endif
124
logging.hh
MipsISA::Interrupts::post
void post(int int_num, ThreadContext *tc)
Definition:
interrupts.cc:55
interrupts.hh
MipsISA::index
Bitfield< 30, 0 > index
Definition:
pra_constants.hh:44
MipsISA::Interrupts::clear
void clear(int int_num, ThreadContext *tc)
Definition:
interrupts.cc:73
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition:
logging.hh:171
MipsISA::Interrupts::interruptsPending
bool interruptsPending(ThreadContext *tc) const
Definition:
interrupts.cc:158
MipsISA::Interrupts::checkInterrupts
bool checkInterrupts(ThreadContext *tc) const override
Definition:
interrupts.cc:106
MipsISA::Interrupts::updateIntrInfo
void updateIntrInfo(ThreadContext *tc) override
Definition:
interrupts.cc:152
MipsISA::Interrupts::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition:
interrupts.hh:115
cp
Definition:
cprintf.cc:40
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Definition:
thread_context.hh:91
MipsISA::Interrupts
Definition:
interrupts.hh:47
MipsISA::Interrupts::getInterrupt
Fault getInterrupt(ThreadContext *tc) override
Definition:
interrupts.cc:129
MipsISA::Interrupts::Params
MipsInterruptsParams Params
Definition:
interrupts.hh:50
BaseInterrupts
Definition:
interrupts.hh:37
faults.hh
MipsISA::Interrupts::clearAll
void clearAll() override
Definition:
interrupts.cc:99
CheckpointIn
Definition:
serialize.hh:67
serialize.hh
CheckpointOut
std::ostream CheckpointOut
Definition:
serialize.hh:63
SimObject::_params
const SimObjectParams * _params
Cached copy of the object parameters.
Definition:
sim_object.hh:110
BaseCPU
Definition:
cpu_dummy.hh:43
compiler.hh
MipsISA
Definition:
decoder.cc:31
MipsISA::Interrupts::params
const Params * params() const
Definition:
interrupts.hh:53
MipsISA::Interrupts::onCpuTimerInterrupt
bool onCpuTimerInterrupt(ThreadContext *tc) const
Definition:
interrupts.cc:142
MipsISA::p
Bitfield< 0 > p
Definition:
pra_constants.hh:323
Fault
std::shared_ptr< FaultBase > Fault
Definition:
types.hh:238
MipsISA::Interrupts::Interrupts
Interrupts(Params *p)
Definition:
interrupts.hh:58
MipsISA::Interrupts::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition:
interrupts.hh:109
MipsISA::Interrupts::setCPU
void setCPU(BaseCPU *_cpu) override
Definition:
interrupts.hh:62
Generated on Mon Jun 8 2020 15:34:39 for gem5 by
doxygen
1.8.13