gem5
v24.1.0.1
Toggle main menu visibility
Main Page
Related Pages
Topics
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
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
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
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
y
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
n
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 Symbols
:
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
s
t
v
w
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Typedefs
a
b
c
d
g
h
i
l
m
r
s
t
u
w
Enumerations
b
h
i
o
p
Enumerator
h
i
o
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
Loading...
Searching...
No Matches
kern
linux
events.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016, 2023 Arm Limited
3
* All rights reserved
4
*
5
* The license below extends only to copyright in the software and shall
6
* not be construed as granting a license to any other intellectual
7
* property including but not limited to intellectual property relating
8
* to a hardware implementation of the functionality of the software
9
* licensed hereunder. You may use the software subject to the license
10
* terms below provided that you ensure that this notice is replicated
11
* unmodified and in its entirety in all distributions of the software,
12
* modified or unmodified, in source code or in binary form.
13
*
14
* Copyright (c) 2004-2006 The Regents of The University of Michigan
15
* All rights reserved.
16
*
17
* Redistribution and use in source and binary forms, with or without
18
* modification, are permitted provided that the following conditions are
19
* met: redistributions of source code must retain the above copyright
20
* notice, this list of conditions and the following disclaimer;
21
* redistributions in binary form must reproduce the above copyright
22
* notice, this list of conditions and the following disclaimer in the
23
* documentation and/or other materials provided with the distribution;
24
* neither the name of the copyright holders nor the names of its
25
* contributors may be used to endorse or promote products derived from
26
* this software without specific prior written permission.
27
*
28
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
*/
40
41
#ifndef __KERN_LINUX_EVENTS_HH__
42
#define __KERN_LINUX_EVENTS_HH__
43
44
#include <functional>
45
#include <string>
46
47
#include "
base/compiler.hh
"
48
#include "
base/trace.hh
"
49
#include "debug/DebugPrintf.hh"
50
#include "enums/KernelPanicOopsBehaviour.hh"
51
#include "
kern/linux/printk.hh
"
52
#include "
kern/system_events.hh
"
53
#include "
mem/se_translating_port_proxy.hh
"
54
#include "
sim/guest_abi.hh
"
55
56
namespace
gem5
57
{
58
59
class
ThreadContext;
60
61
namespace
linux
62
{
63
64
template
<
typename
ABI,
typename
Base>
65
class
DebugPrintk
:
public
Base
66
{
67
public
:
68
using
Base::Base;
69
void
70
process
(
ThreadContext
*tc)
override
71
{
72
if
(debug::DebugPrintf) {
73
std::string str;
74
std::function<int(
ThreadContext
*,
Addr
,
PrintkVarArgs
)> func =
75
[&str](
ThreadContext
*tc,
Addr
format_ptr,
76
PrintkVarArgs
args) ->
int
{
77
return
printk
(str, tc, format_ptr, args);
78
};
79
invokeSimcall<ABI>(tc, func);
80
DPRINTFN
(
"%s"
, str);
81
}
82
Base::process(tc);
83
}
70
process
(
ThreadContext
*tc)
override
{
…
}
84
};
65
class
DebugPrintk
:
public
Base {
…
};
85
93
class
PanicOrOopsEvent
:
public
PCEvent
94
{
95
protected
:
96
std::string
fname
;
97
KernelPanicOopsBehaviour
behaviour
;
98
99
public
:
100
PanicOrOopsEvent
(
PCEventScope
*
s
,
const
std::string &desc,
Addr
addr
,
101
const
std::string &_fname,
102
const
KernelPanicOopsBehaviour _behaviour)
103
:
PCEvent
(
s
, desc,
addr
)
104
,
fname
(_fname)
105
,
behaviour
(_behaviour)
106
{}
100
PanicOrOopsEvent
(
PCEventScope
*
s
,
const
std::string &desc,
Addr
addr
, {
…
}
107
void
process
(
ThreadContext
*tc)
override
;
108
};
93
class
PanicOrOopsEvent
:
public
PCEvent
{
…
};
109
110
void
onUDelay
(
ThreadContext
*tc, uint64_t
div
, uint64_t mul, uint64_t time);
111
118
template
<
typename
ABI,
typename
Base>
119
class
SkipUDelay
:
public
Base
120
{
121
private
:
128
uint64_t
argDivToNs
;
129
135
uint64_t
argMultToNs
;
136
137
public
:
138
SkipUDelay
(
PCEventScope
*
s
,
const
std::string &desc,
Addr
addr
,
139
uint64_t mult, uint64_t
div
) :
140
Base(
s
, desc,
addr
),
argDivToNs
(
div
),
argMultToNs
(mult)
141
{}
138
SkipUDelay
(
PCEventScope
*
s
,
const
std::string &desc,
Addr
addr
, {
…
}
142
143
void
144
process
(
ThreadContext
*tc)
override
145
{
146
// Use Addr since it's handled specially and will act as a natively
147
// sized data type.
148
std::function<void(
ThreadContext
*,
Addr
)> call_udelay =
149
[
this
](
ThreadContext
*tc,
Addr
time) {
150
onUDelay
(tc,
argDivToNs
,
argMultToNs
, time);
151
};
152
invokeSimcall<ABI>(tc, call_udelay);
153
Base::process(tc);
154
}
144
process
(
ThreadContext
*tc)
override
{
…
}
155
};
119
class
SkipUDelay
:
public
Base {
…
};
156
157
}
// namespace linux
158
}
// namespace gem5
159
160
#endif
// __KERN_LINUX_EVENTS_HH__
trace.hh
DPRINTFN
#define DPRINTFN(...)
Definition
trace.hh:237
gem5::PCEventScope
Definition
pc_event.hh:68
gem5::PCEvent
Definition
pc_event.hh:46
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition
thread_context.hh:89
gem5::guest_abi::VarArgs
Definition
varargs.hh:150
gem5::linux::DebugPrintk
Definition
events.hh:66
gem5::linux::DebugPrintk::process
void process(ThreadContext *tc) override
Definition
events.hh:70
gem5::linux::PanicOrOopsEvent
Specify what to do on a Linux Kernel Panic or Oops.
Definition
events.hh:94
gem5::linux::PanicOrOopsEvent::PanicOrOopsEvent
PanicOrOopsEvent(PCEventScope *s, const std::string &desc, Addr addr, const std::string &_fname, const KernelPanicOopsBehaviour _behaviour)
Definition
events.hh:100
gem5::linux::PanicOrOopsEvent::behaviour
KernelPanicOopsBehaviour behaviour
Definition
events.hh:97
gem5::linux::PanicOrOopsEvent::process
void process(ThreadContext *tc) override
Definition
events.cc:62
gem5::linux::PanicOrOopsEvent::fname
std::string fname
Definition
events.hh:96
gem5::linux::SkipUDelay
A class to skip udelay() and related calls in the kernel.
Definition
events.hh:120
gem5::linux::SkipUDelay::process
void process(ThreadContext *tc) override
Definition
events.hh:144
gem5::linux::SkipUDelay::SkipUDelay
SkipUDelay(PCEventScope *s, const std::string &desc, Addr addr, uint64_t mult, uint64_t div)
Definition
events.hh:138
gem5::linux::SkipUDelay::argMultToNs
uint64_t argMultToNs
Value to multiple arg by to create ns.
Definition
events.hh:135
gem5::linux::SkipUDelay::argDivToNs
uint64_t argDivToNs
Value to divide arg by to create ns.
Definition
events.hh:128
compiler.hh
guest_abi.hh
gem5::ArmISA::s
Bitfield< 4 > s
Definition
misc_types.hh:647
gem5::RiscvISA::div
T div(T rs1, T rs2)
Definition
utility.hh:192
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition
types.hh:84
gem5::linux::onUDelay
void onUDelay(ThreadContext *tc, uint64_t div, uint64_t mul, uint64_t time)
Definition
events.cc:81
gem5::linux::printk
int printk(std::string &str, ThreadContext *tc, Addr format_ptr, PrintkVarArgs args)
Definition
printk.cc:49
gem5
Copyright (c) 2024 Arm Limited All rights reserved.
Definition
binary32.hh:36
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition
types.hh:147
printk.hh
se_translating_port_proxy.hh
system_events.hh
Generated on Mon Jan 13 2025 04:28:37 for gem5 by
doxygen
1.9.8