thread_context.hh (8767:e575781f71b8) | thread_context.hh (8777:dd43f1c9fa0a) |
---|---|
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; --- 23 unchanged lines hidden (view full) --- 32#define __CPU_THREAD_CONTEXT_HH__ 33 34#include <iostream> 35#include <string> 36 37#include "arch/registers.hh" 38#include "arch/types.hh" 39#include "base/types.hh" | 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; --- 23 unchanged lines hidden (view full) --- 32#define __CPU_THREAD_CONTEXT_HH__ 33 34#include <iostream> 35#include <string> 36 37#include "arch/registers.hh" 38#include "arch/types.hh" 39#include "base/types.hh" |
40#include "config/full_system.hh" | |
41#include "config/the_isa.hh" 42 43// @todo: Figure out a more architecture independent way to obtain the ITB and 44// DTB pointers. 45namespace TheISA 46{ 47 class TLB; 48} --- 71 unchanged lines hidden (view full) --- 120 virtual TheISA::TLB *getITBPtr() = 0; 121 122 virtual TheISA::TLB *getDTBPtr() = 0; 123 124 virtual Decoder *getDecoderPtr() = 0; 125 126 virtual System *getSystemPtr() = 0; 127 | 40#include "config/the_isa.hh" 41 42// @todo: Figure out a more architecture independent way to obtain the ITB and 43// DTB pointers. 44namespace TheISA 45{ 46 class TLB; 47} --- 71 unchanged lines hidden (view full) --- 119 virtual TheISA::TLB *getITBPtr() = 0; 120 121 virtual TheISA::TLB *getDTBPtr() = 0; 122 123 virtual Decoder *getDecoderPtr() = 0; 124 125 virtual System *getSystemPtr() = 0; 126 |
128#if FULL_SYSTEM | |
129 virtual TheISA::Kernel::Statistics *getKernelStats() = 0; 130 131 virtual void connectMemPorts(ThreadContext *tc) = 0; | 127 virtual TheISA::Kernel::Statistics *getKernelStats() = 0; 128 129 virtual void connectMemPorts(ThreadContext *tc) = 0; |
132#endif | 130 |
133 virtual Process *getProcessPtr() = 0; 134 135 virtual TranslatingPort *getMemPort() = 0; 136 137 virtual VirtualPort *getVirtPort() = 0; 138 139 virtual FunctionalPort *getPhysPort() = 0; 140 --- 6 unchanged lines hidden (view full) --- 147 virtual void activate(int delay = 1) = 0; 148 149 /// Set the status to Suspended. 150 virtual void suspend(int delay = 0) = 0; 151 152 /// Set the status to Halted. 153 virtual void halt(int delay = 0) = 0; 154 | 131 virtual Process *getProcessPtr() = 0; 132 133 virtual TranslatingPort *getMemPort() = 0; 134 135 virtual VirtualPort *getVirtPort() = 0; 136 137 virtual FunctionalPort *getPhysPort() = 0; 138 --- 6 unchanged lines hidden (view full) --- 145 virtual void activate(int delay = 1) = 0; 146 147 /// Set the status to Suspended. 148 virtual void suspend(int delay = 0) = 0; 149 150 /// Set the status to Halted. 151 virtual void halt(int delay = 0) = 0; 152 |
155#if FULL_SYSTEM | |
156 virtual void dumpFuncProfile() = 0; | 153 virtual void dumpFuncProfile() = 0; |
157#endif | |
158 159 virtual void takeOverFrom(ThreadContext *old_context) = 0; 160 161 virtual void regStats(const std::string &name) = 0; 162 163 virtual void serialize(std::ostream &os) = 0; 164 virtual void unserialize(Checkpoint *cp, const std::string §ion) = 0; 165 | 154 155 virtual void takeOverFrom(ThreadContext *old_context) = 0; 156 157 virtual void regStats(const std::string &name) = 0; 158 159 virtual void serialize(std::ostream &os) = 0; 160 virtual void unserialize(Checkpoint *cp, const std::string §ion) = 0; 161 |
166#if FULL_SYSTEM | |
167 virtual EndQuiesceEvent *getQuiesceEvent() = 0; 168 169 // Not necessarily the best location for these... 170 // Having an extra function just to read these is obnoxious 171 virtual Tick readLastActivate() = 0; 172 virtual Tick readLastSuspend() = 0; 173 174 virtual void profileClear() = 0; 175 virtual void profileSample() = 0; | 162 virtual EndQuiesceEvent *getQuiesceEvent() = 0; 163 164 // Not necessarily the best location for these... 165 // Having an extra function just to read these is obnoxious 166 virtual Tick readLastActivate() = 0; 167 virtual Tick readLastSuspend() = 0; 168 169 virtual void profileClear() = 0; 170 virtual void profileSample() = 0; |
176#endif | |
177 178 virtual void copyArchRegs(ThreadContext *tc) = 0; 179 180 virtual void clearArchRegs() = 0; 181 182 // 183 // New accessors for new decoder. 184 // --- 45 unchanged lines hidden (view full) --- 230 // away once we decide upon where st cond failures goes. 231 virtual unsigned readStCondFailures() = 0; 232 233 virtual void setStCondFailures(unsigned sc_failures) = 0; 234 235 // Only really makes sense for old CPU model. Still could be useful though. 236 virtual bool misspeculating() = 0; 237 | 171 172 virtual void copyArchRegs(ThreadContext *tc) = 0; 173 174 virtual void clearArchRegs() = 0; 175 176 // 177 // New accessors for new decoder. 178 // --- 45 unchanged lines hidden (view full) --- 224 // away once we decide upon where st cond failures goes. 225 virtual unsigned readStCondFailures() = 0; 226 227 virtual void setStCondFailures(unsigned sc_failures) = 0; 228 229 // Only really makes sense for old CPU model. Still could be useful though. 230 virtual bool misspeculating() = 0; 231 |
238#if !FULL_SYSTEM | |
239 // Same with st cond failures. 240 virtual Counter readFuncExeInst() = 0; 241 242 virtual void syscall(int64_t callnum) = 0; 243 244 // This function exits the thread context in the CPU and returns 245 // 1 if the CPU has no more active threads (meaning it's OK to exit); 246 // Used in syscall-emulation mode when a thread calls the exit syscall. 247 virtual int exit() { return 1; }; | 232 // Same with st cond failures. 233 virtual Counter readFuncExeInst() = 0; 234 235 virtual void syscall(int64_t callnum) = 0; 236 237 // This function exits the thread context in the CPU and returns 238 // 1 if the CPU has no more active threads (meaning it's OK to exit); 239 // Used in syscall-emulation mode when a thread calls the exit syscall. 240 virtual int exit() { return 1; }; |
248#endif | |
249 250 /** function to compare two thread contexts (for debugging) */ 251 static void compare(ThreadContext *one, ThreadContext *two); 252}; 253 254/** 255 * ProxyThreadContext class that provides a way to implement a 256 * ThreadContext without having to derive from it. ThreadContext is an --- 31 unchanged lines hidden (view full) --- 288 TheISA::TLB *getITBPtr() { return actualTC->getITBPtr(); } 289 290 TheISA::TLB *getDTBPtr() { return actualTC->getDTBPtr(); } 291 292 Decoder *getDecoderPtr() { return actualTC->getDecoderPtr(); } 293 294 System *getSystemPtr() { return actualTC->getSystemPtr(); } 295 | 241 242 /** function to compare two thread contexts (for debugging) */ 243 static void compare(ThreadContext *one, ThreadContext *two); 244}; 245 246/** 247 * ProxyThreadContext class that provides a way to implement a 248 * ThreadContext without having to derive from it. ThreadContext is an --- 31 unchanged lines hidden (view full) --- 280 TheISA::TLB *getITBPtr() { return actualTC->getITBPtr(); } 281 282 TheISA::TLB *getDTBPtr() { return actualTC->getDTBPtr(); } 283 284 Decoder *getDecoderPtr() { return actualTC->getDecoderPtr(); } 285 286 System *getSystemPtr() { return actualTC->getSystemPtr(); } 287 |
296#if FULL_SYSTEM | |
297 TheISA::Kernel::Statistics *getKernelStats() 298 { return actualTC->getKernelStats(); } 299 300 void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); } | 288 TheISA::Kernel::Statistics *getKernelStats() 289 { return actualTC->getKernelStats(); } 290 291 void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); } |
301#endif | 292 |
302 Process *getProcessPtr() { return actualTC->getProcessPtr(); } 303 304 TranslatingPort *getMemPort() { return actualTC->getMemPort(); } 305 306 VirtualPort *getVirtPort() { return actualTC->getVirtPort(); } 307 308 FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); } 309 --- 6 unchanged lines hidden (view full) --- 316 void activate(int delay = 1) { actualTC->activate(delay); } 317 318 /// Set the status to Suspended. 319 void suspend(int delay = 0) { actualTC->suspend(); } 320 321 /// Set the status to Halted. 322 void halt(int delay = 0) { actualTC->halt(); } 323 | 293 Process *getProcessPtr() { return actualTC->getProcessPtr(); } 294 295 TranslatingPort *getMemPort() { return actualTC->getMemPort(); } 296 297 VirtualPort *getVirtPort() { return actualTC->getVirtPort(); } 298 299 FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); } 300 --- 6 unchanged lines hidden (view full) --- 307 void activate(int delay = 1) { actualTC->activate(delay); } 308 309 /// Set the status to Suspended. 310 void suspend(int delay = 0) { actualTC->suspend(); } 311 312 /// Set the status to Halted. 313 void halt(int delay = 0) { actualTC->halt(); } 314 |
324#if FULL_SYSTEM | |
325 void dumpFuncProfile() { actualTC->dumpFuncProfile(); } | 315 void dumpFuncProfile() { actualTC->dumpFuncProfile(); } |
326#endif | |
327 328 void takeOverFrom(ThreadContext *oldContext) 329 { actualTC->takeOverFrom(oldContext); } 330 331 void regStats(const std::string &name) { actualTC->regStats(name); } 332 333 void serialize(std::ostream &os) { actualTC->serialize(os); } 334 void unserialize(Checkpoint *cp, const std::string §ion) 335 { actualTC->unserialize(cp, section); } 336 | 316 317 void takeOverFrom(ThreadContext *oldContext) 318 { actualTC->takeOverFrom(oldContext); } 319 320 void regStats(const std::string &name) { actualTC->regStats(name); } 321 322 void serialize(std::ostream &os) { actualTC->serialize(os); } 323 void unserialize(Checkpoint *cp, const std::string §ion) 324 { actualTC->unserialize(cp, section); } 325 |
337#if FULL_SYSTEM | |
338 EndQuiesceEvent *getQuiesceEvent() { return actualTC->getQuiesceEvent(); } 339 340 Tick readLastActivate() { return actualTC->readLastActivate(); } 341 Tick readLastSuspend() { return actualTC->readLastSuspend(); } 342 343 void profileClear() { return actualTC->profileClear(); } 344 void profileSample() { return actualTC->profileSample(); } | 326 EndQuiesceEvent *getQuiesceEvent() { return actualTC->getQuiesceEvent(); } 327 328 Tick readLastActivate() { return actualTC->readLastActivate(); } 329 Tick readLastSuspend() { return actualTC->readLastSuspend(); } 330 331 void profileClear() { return actualTC->profileClear(); } 332 void profileSample() { return actualTC->profileSample(); } |
345#endif | |
346 347 // @todo: Do I need this? 348 void copyArchRegs(ThreadContext *tc) { actualTC->copyArchRegs(tc); } 349 350 void clearArchRegs() { actualTC->clearArchRegs(); } 351 352 // 353 // New accessors for new decoder. --- 51 unchanged lines hidden (view full) --- 405 { return actualTC->readStCondFailures(); } 406 407 void setStCondFailures(unsigned sc_failures) 408 { actualTC->setStCondFailures(sc_failures); } 409 410 // @todo: Fix this! 411 bool misspeculating() { return actualTC->misspeculating(); } 412 | 333 334 // @todo: Do I need this? 335 void copyArchRegs(ThreadContext *tc) { actualTC->copyArchRegs(tc); } 336 337 void clearArchRegs() { actualTC->clearArchRegs(); } 338 339 // 340 // New accessors for new decoder. --- 51 unchanged lines hidden (view full) --- 392 { return actualTC->readStCondFailures(); } 393 394 void setStCondFailures(unsigned sc_failures) 395 { actualTC->setStCondFailures(sc_failures); } 396 397 // @todo: Fix this! 398 bool misspeculating() { return actualTC->misspeculating(); } 399 |
413#if !FULL_SYSTEM | |
414 void syscall(int64_t callnum) 415 { actualTC->syscall(callnum); } 416 417 Counter readFuncExeInst() { return actualTC->readFuncExeInst(); } | 400 void syscall(int64_t callnum) 401 { actualTC->syscall(callnum); } 402 403 Counter readFuncExeInst() { return actualTC->readFuncExeInst(); } |
418#endif | |
419}; 420 421#endif | 404}; 405 406#endif |