thread_state.cc (8764:e4660687c49f) thread_state.cc (8766:b0773af78423)
1/*
2 * Copyright (c) 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;

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

37#include "mem/vport.hh"
38#include "sim/serialize.hh"
39
40#if FULL_SYSTEM
41#include "arch/kernel_stats.hh"
42#include "cpu/quiesce_event.hh"
43#endif
44
1/*
2 * Copyright (c) 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;

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

37#include "mem/vport.hh"
38#include "sim/serialize.hh"
39
40#if FULL_SYSTEM
41#include "arch/kernel_stats.hh"
42#include "cpu/quiesce_event.hh"
43#endif
44
45#if FULL_SYSTEM
46ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid)
47#else
48ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
45ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
49#endif
50 : numInst(0), numLoad(0), _status(ThreadContext::Halted),
51 baseCpu(cpu), _threadId(_tid), lastActivate(0), lastSuspend(0),
52#if FULL_SYSTEM
53 profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL),
54 kernelStats(NULL),
46 : numInst(0), numLoad(0), _status(ThreadContext::Halted),
47 baseCpu(cpu), _threadId(_tid), lastActivate(0), lastSuspend(0),
48#if FULL_SYSTEM
49 profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL),
50 kernelStats(NULL),
55#else
56 process(_process),
57#endif
51#endif
58 port(NULL), virtPort(NULL), physPort(NULL), funcExeInst(0),
59 storeCondFailures(0)
52 process(_process), port(NULL), virtPort(NULL), physPort(NULL),
53 funcExeInst(0), storeCondFailures(0)
60{
61}
62
63ThreadState::~ThreadState()
64{
54{
55}
56
57ThreadState::~ThreadState()
58{
65#if !FULL_SYSTEM
66 if (port) {
67 delete port->getPeer();
68 delete port;
69 }
59 if (port) {
60 delete port->getPeer();
61 delete port;
62 }
70#endif
71}
72
73void
74ThreadState::serialize(std::ostream &os)
75{
76 SERIALIZE_ENUM(_status);
77 // thread_num and cpu_id are deterministic from the config
78 SERIALIZE_SCALAR(funcExeInst);

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

159TranslatingPort *
160ThreadState::getMemPort()
161{
162 if (port != NULL)
163 return port;
164
165 /* Use this port to for syscall emulation writes to memory. */
166 port = new TranslatingPort(csprintf("%s-%d-funcport", baseCpu->name(),
63}
64
65void
66ThreadState::serialize(std::ostream &os)
67{
68 SERIALIZE_ENUM(_status);
69 // thread_num and cpu_id are deterministic from the config
70 SERIALIZE_SCALAR(funcExeInst);

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

151TranslatingPort *
152ThreadState::getMemPort()
153{
154 if (port != NULL)
155 return port;
156
157 /* Use this port to for syscall emulation writes to memory. */
158 port = new TranslatingPort(csprintf("%s-%d-funcport", baseCpu->name(),
167 _threadId),
168#if !FULL_SYSTEM
169 process,
170#endif
171 TranslatingPort::NextPage);
159 _threadId), process, TranslatingPort::NextPage);
172
173 connectToMemFunc(port);
174
175 return port;
176}
177
178void
179ThreadState::connectToMemFunc(Port *port)

--- 15 unchanged lines hidden ---
160
161 connectToMemFunc(port);
162
163 return port;
164}
165
166void
167ThreadState::connectToMemFunc(Port *port)

--- 15 unchanged lines hidden ---