thread_context.hh (8767:e575781f71b8) thread_context.hh (8777:dd43f1c9fa0a)
1/*
2 * Copyright (c) 2004-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;

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

87
88 /** Returns this thread's ID number. */
89 virtual int threadId() { return thread->threadId(); }
90 virtual void setThreadId(int id) { return thread->setThreadId(id); }
91
92 /** Returns a pointer to the system. */
93 virtual System *getSystemPtr() { return cpu->system; }
94
1/*
2 * Copyright (c) 2004-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;

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

87
88 /** Returns this thread's ID number. */
89 virtual int threadId() { return thread->threadId(); }
90 virtual void setThreadId(int id) { return thread->setThreadId(id); }
91
92 /** Returns a pointer to the system. */
93 virtual System *getSystemPtr() { return cpu->system; }
94
95#if FULL_SYSTEM
96 /** Returns a pointer to this thread's kernel statistics. */
97 virtual TheISA::Kernel::Statistics *getKernelStats()
98 { return thread->kernelStats; }
99
95 /** Returns a pointer to this thread's kernel statistics. */
96 virtual TheISA::Kernel::Statistics *getKernelStats()
97 { return thread->kernelStats; }
98
100 virtual void connectMemPorts(ThreadContext *tc) { thread->connectMemPorts(tc); }
101#endif
99 virtual void connectMemPorts(ThreadContext *tc)
100 { thread->connectMemPorts(tc); }
101
102 /** Returns a pointer to this thread's process. */
103 virtual Process *getProcessPtr() { return thread->getProcessPtr(); }
104
105 virtual TranslatingPort *getMemPort() { return thread->getMemPort(); }
106
107 virtual VirtualPort *getVirtPort();
108
109 virtual FunctionalPort *getPhysPort() { return thread->getPhysPort(); }

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

120 virtual void activate(int delay = 1);
121
122 /** Set the status to Suspended. */
123 virtual void suspend(int delay = 0);
124
125 /** Set the status to Halted. */
126 virtual void halt(int delay = 0);
127
102 /** Returns a pointer to this thread's process. */
103 virtual Process *getProcessPtr() { return thread->getProcessPtr(); }
104
105 virtual TranslatingPort *getMemPort() { return thread->getMemPort(); }
106
107 virtual VirtualPort *getVirtPort();
108
109 virtual FunctionalPort *getPhysPort() { return thread->getPhysPort(); }

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

120 virtual void activate(int delay = 1);
121
122 /** Set the status to Suspended. */
123 virtual void suspend(int delay = 0);
124
125 /** Set the status to Halted. */
126 virtual void halt(int delay = 0);
127
128#if FULL_SYSTEM
129 /** Dumps the function profiling information.
130 * @todo: Implement.
131 */
132 virtual void dumpFuncProfile();
128 /** Dumps the function profiling information.
129 * @todo: Implement.
130 */
131 virtual void dumpFuncProfile();
133#endif
132
134 /** Takes over execution of a thread from another CPU. */
135 virtual void takeOverFrom(ThreadContext *old_context);
136
137 /** Registers statistics associated with this TC. */
138 virtual void regStats(const std::string &name);
139
140 /** Serializes state. */
141 virtual void serialize(std::ostream &os);
142 /** Unserializes state. */
143 virtual void unserialize(Checkpoint *cp, const std::string &section);
144
133 /** Takes over execution of a thread from another CPU. */
134 virtual void takeOverFrom(ThreadContext *old_context);
135
136 /** Registers statistics associated with this TC. */
137 virtual void regStats(const std::string &name);
138
139 /** Serializes state. */
140 virtual void serialize(std::ostream &os);
141 /** Unserializes state. */
142 virtual void unserialize(Checkpoint *cp, const std::string &section);
143
145#if FULL_SYSTEM
146 /** Reads the last tick that this thread was activated on. */
147 virtual Tick readLastActivate();
148 /** Reads the last tick that this thread was suspended on. */
149 virtual Tick readLastSuspend();
150
151 /** Clears the function profiling information. */
152 virtual void profileClear();
153 /** Samples the function profiling information. */
154 virtual void profileSample();
144 /** Reads the last tick that this thread was activated on. */
145 virtual Tick readLastActivate();
146 /** Reads the last tick that this thread was suspended on. */
147 virtual Tick readLastSuspend();
148
149 /** Clears the function profiling information. */
150 virtual void profileClear();
151 /** Samples the function profiling information. */
152 virtual void profileSample();
155#endif
156
157 /** Copies the architectural registers from another TC into this TC. */
158 virtual void copyArchRegs(ThreadContext *tc);
159
160 /** Resets all architectural registers to 0. */
161 virtual void clearArchRegs();
162
163 /** Reads an integer register. */

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

224 // Only really makes sense for old CPU model. Lots of code
225 // outside the CPU still checks this function, so it will
226 // always return false to keep everything working.
227 /** Checks if the thread is misspeculating. Because it is
228 * very difficult to determine if the thread is
229 * misspeculating, this is set as false. */
230 virtual bool misspeculating() { return false; }
231
153
154 /** Copies the architectural registers from another TC into this TC. */
155 virtual void copyArchRegs(ThreadContext *tc);
156
157 /** Resets all architectural registers to 0. */
158 virtual void clearArchRegs();
159
160 /** Reads an integer register. */

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

221 // Only really makes sense for old CPU model. Lots of code
222 // outside the CPU still checks this function, so it will
223 // always return false to keep everything working.
224 /** Checks if the thread is misspeculating. Because it is
225 * very difficult to determine if the thread is
226 * misspeculating, this is set as false. */
227 virtual bool misspeculating() { return false; }
228
232#if !FULL_SYSTEM
233 /** Executes a syscall in SE mode. */
234 virtual void syscall(int64_t callnum)
235 { return cpu->syscall(callnum, thread->threadId()); }
236
237 /** Reads the funcExeInst counter. */
238 virtual Counter readFuncExeInst() { return thread->funcExeInst; }
229 /** Executes a syscall in SE mode. */
230 virtual void syscall(int64_t callnum)
231 { return cpu->syscall(callnum, thread->threadId()); }
232
233 /** Reads the funcExeInst counter. */
234 virtual Counter readFuncExeInst() { return thread->funcExeInst; }
239#else
235
240 /** Returns pointer to the quiesce event. */
241 virtual EndQuiesceEvent *getQuiesceEvent()
242 {
243 return this->thread->quiesceEvent;
244 }
236 /** Returns pointer to the quiesce event. */
237 virtual EndQuiesceEvent *getQuiesceEvent()
238 {
239 return this->thread->quiesceEvent;
240 }
245#endif
246
247};
248
249#endif
241
242};
243
244#endif