diff options
Diffstat (limited to 'src/sim/system.hh')
-rw-r--r-- | src/sim/system.hh | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/sim/system.hh b/src/sim/system.hh index cdd5bebb0..bfa5ea8bb 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -87,14 +87,19 @@ class System : public SimObject PCEventQueue pcEventQueue; std::vector<ThreadContext *> threadContexts; - int numcpus; + int _numContexts; - int getNumCPUs() + ThreadContext * getThreadContext(int tid) { - if (numcpus != threadContexts.size()) + return threadContexts[tid]; + } + + int numContexts() + { + if (_numContexts != threadContexts.size()) panic("cpu array not fully populated!"); - return numcpus; + return _numContexts; } #if FULL_SYSTEM @@ -134,6 +139,12 @@ class System : public SimObject return next_PID++; } + /** Amount of physical memory that is still free */ + Addr freeMemSize(); + + /** Amount of physical memory that exists */ + Addr memSize(); + #endif // FULL_SYSTEM @@ -219,8 +230,8 @@ class System : public SimObject #endif // FULL_SYSTEM - int registerThreadContext(ThreadContext *tc, int tcIndex); - void replaceThreadContext(ThreadContext *tc, int tcIndex); + int registerThreadContext(ThreadContext *tc, int assigned=-1); + void replaceThreadContext(ThreadContext *tc, int context_id); void serialize(std::ostream &os); void unserialize(Checkpoint *cp, const std::string §ion); |