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 /** Returns a pointer to this thread's kernel statistics. */ 96 virtual TheISA::Kernel::Statistics *getKernelStats() 97 { return thread->kernelStats; } 98 |
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 |
128 /** Dumps the function profiling information. 129 * @todo: Implement. 130 */ 131 virtual void dumpFuncProfile(); |
132 |
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 §ion); 143 |
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(); |
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 |
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; } |
235 |
236 /** Returns pointer to the quiesce event. */ 237 virtual EndQuiesceEvent *getQuiesceEvent() 238 { 239 return this->thread->quiesceEvent; 240 } |
241 242}; 243 244#endif |