Deleted Added
sdiff udiff text old ( 13759:9941fca869a9 ) new ( 13865:cca49fc49c57 )
full compact
1/*
2 * Copyright (c) 2018 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

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

76SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
77 Process *_process, BaseTLB *_itb,
78 BaseTLB *_dtb, TheISA::ISA *_isa)
79 : ThreadState(_cpu, _thread_num, _process), isa(_isa),
80 predicate(false), system(_sys),
81 itb(_itb), dtb(_dtb), decoder(TheISA::Decoder(_isa))
82{
83 clearArchRegs();
84 tc = new ProxyThreadContext<SimpleThread>(this);
85 quiesceEvent = new EndQuiesceEvent(tc);
86}
87
88SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
89 BaseTLB *_itb, BaseTLB *_dtb,
90 TheISA::ISA *_isa, bool use_kernel_stats)
91 : ThreadState(_cpu, _thread_num, NULL), isa(_isa), system(_sys), itb(_itb),
92 dtb(_dtb), decoder(TheISA::Decoder(_isa))
93{
94 tc = new ProxyThreadContext<SimpleThread>(this);
95
96 quiesceEvent = new EndQuiesceEvent(tc);
97
98 clearArchRegs();
99
100 if (baseCpu->params()->profile) {
101 profile = new FunctionProfile(system->kernelSymtab);
102 Callback *cb =
103 new MakeCallback<SimpleThread,
104 &SimpleThread::dumpFuncProfile>(this);
105 registerExitCallback(cb);

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

110 static ProfileNode dummyNode;
111 profileNode = &dummyNode;
112 profilePC = 3;
113
114 if (use_kernel_stats)
115 kernelStats = new TheISA::Kernel::Statistics();
116}
117
118SimpleThread::~SimpleThread()
119{
120 delete tc;
121}
122
123void
124SimpleThread::takeOverFrom(ThreadContext *oldContext)
125{
126 ::takeOverFrom(*tc, *oldContext);
127 decoder.takeOverFrom(oldContext->getDecoderPtr());
128
129 kernelStats = oldContext->getKernelStats();
130 funcExeInst = oldContext->readFuncExeInst();
131 storeCondFailures = 0;
132}
133
134void

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

143 _threadId = oldContext->threadId();
144 _contextId = oldContext->contextId();
145}
146
147void
148SimpleThread::serialize(CheckpointOut &cp) const
149{
150 ThreadState::serialize(cp);
151 ::serialize(*tc, cp);
152}
153
154
155void
156SimpleThread::unserialize(CheckpointIn &cp)
157{
158 ThreadState::unserialize(cp);
159 ::unserialize(*tc, cp);
160}
161
162void
163SimpleThread::startup()
164{
165 isa->startup(tc);
166}
167
168void
169SimpleThread::dumpFuncProfile()
170{
171 OutputStream *os(simout.create(csprintf("profile.%s.dat", baseCpu->name())));
172 profile->dump(tc, *os->stream());
173 simout.close(os);
174}
175
176void
177SimpleThread::activate()
178{
179 if (status() == ThreadContext::Active)
180 return;

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

213{
214 if (FullSystem && kernelStats)
215 kernelStats->regStats(name + ".kern");
216}
217
218void
219SimpleThread::copyArchRegs(ThreadContext *src_tc)
220{
221 TheISA::copyRegs(src_tc, tc);
222}
223
224// The following methods are defined in src/arch/alpha/ev5.cc for
225// Alpha.
226#if THE_ISA != ALPHA_ISA
227Fault
228SimpleThread::hwrei()
229{
230 return NoFault;
231}
232
233bool
234SimpleThread::simPalCheck(int palFunc)
235{
236 return true;
237}
238#endif