simple_thread.cc (6315:c7295a4826d5) simple_thread.cc (6316:51f3026d4cbb)
1/*
2 * Copyright (c) 2001-2006 The Regents of The University of Michigan
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;

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

66 : ThreadState(_cpu, _thread_num), cpu(_cpu), system(_sys), itb(_itb),
67 dtb(_dtb)
68
69{
70 tc = new ProxyThreadContext<SimpleThread>(this);
71
72 quiesceEvent = new EndQuiesceEvent(tc);
73
1/*
2 * Copyright (c) 2001-2006 The Regents of The University of Michigan
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;

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

66 : ThreadState(_cpu, _thread_num), cpu(_cpu), system(_sys), itb(_itb),
67 dtb(_dtb)
68
69{
70 tc = new ProxyThreadContext<SimpleThread>(this);
71
72 quiesceEvent = new EndQuiesceEvent(tc);
73
74 regs.clear();
74 clearArchRegs();
75
76 if (cpu->params()->profile) {
77 profile = new FunctionProfile(system->kernelSymtab);
78 Callback *cb =
79 new MakeCallback<SimpleThread,
80 &SimpleThread::dumpFuncProfile>(this);
81 registerExitCallback(cb);
82 }

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

91 kernelStats = new TheISA::Kernel::Statistics(system);
92}
93#else
94SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process,
95 TheISA::TLB *_itb, TheISA::TLB *_dtb, int _asid)
96 : ThreadState(_cpu, _thread_num, _process, _asid),
97 cpu(_cpu), itb(_itb), dtb(_dtb)
98{
75
76 if (cpu->params()->profile) {
77 profile = new FunctionProfile(system->kernelSymtab);
78 Callback *cb =
79 new MakeCallback<SimpleThread,
80 &SimpleThread::dumpFuncProfile>(this);
81 registerExitCallback(cb);
82 }

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

91 kernelStats = new TheISA::Kernel::Statistics(system);
92}
93#else
94SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process,
95 TheISA::TLB *_itb, TheISA::TLB *_dtb, int _asid)
96 : ThreadState(_cpu, _thread_num, _process, _asid),
97 cpu(_cpu), itb(_itb), dtb(_dtb)
98{
99 regs.clear();
99 clearArchRegs();
100 tc = new ProxyThreadContext<SimpleThread>(this);
101}
102
103#endif
104
105SimpleThread::SimpleThread()
106#if FULL_SYSTEM
107 : ThreadState(NULL, -1)

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

188}
189
190void
191SimpleThread::serialize(ostream &os)
192{
193 ThreadState::serialize(os);
194 regs.serialize(cpu, os);
195 SERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
100 tc = new ProxyThreadContext<SimpleThread>(this);
101}
102
103#endif
104
105SimpleThread::SimpleThread()
106#if FULL_SYSTEM
107 : ThreadState(NULL, -1)

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

188}
189
190void
191SimpleThread::serialize(ostream &os)
192{
193 ThreadState::serialize(os);
194 regs.serialize(cpu, os);
195 SERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
196 SERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
196 // thread_num and cpu_id are deterministic from the config
197}
198
199
200void
201SimpleThread::unserialize(Checkpoint *cp, const std::string &section)
202{
203 ThreadState::unserialize(cp, section);
204 regs.unserialize(cpu, cp, section);
205 UNSERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
197 // thread_num and cpu_id are deterministic from the config
198}
199
200
201void
202SimpleThread::unserialize(Checkpoint *cp, const std::string &section)
203{
204 ThreadState::unserialize(cp, section);
205 regs.unserialize(cpu, cp, section);
206 UNSERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
207 UNSERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
206 // thread_num and cpu_id are deterministic from the config
207}
208
209#if FULL_SYSTEM
210void
211SimpleThread::dumpFuncProfile()
212{
213 std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));

--- 71 unchanged lines hidden ---
208 // thread_num and cpu_id are deterministic from the config
209}
210
211#if FULL_SYSTEM
212void
213SimpleThread::dumpFuncProfile()
214{
215 std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));

--- 71 unchanged lines hidden ---