From 53e777d6838ac3ca80e6557626f9e99fd93dd0f7 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 7 Aug 2015 09:59:13 +0100 Subject: base: Declare a type for context IDs Context IDs used to be declared as ad hoc (usually as int). This changeset introduces a typedef for ContextIDs and a constant for invalid context IDs. --- src/sim/system.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/sim/system.hh') diff --git a/src/sim/system.hh b/src/sim/system.hh index 97d271d3a..634c78a6a 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -197,7 +197,7 @@ class System : public MemObject std::vector threadContexts; int _numContexts; - ThreadContext *getThreadContext(ThreadID tid) + ThreadContext *getThreadContext(ContextID tid) { return threadContexts[tid]; } @@ -514,8 +514,9 @@ class System : public MemObject /// @return Starting address of first page Addr allocPhysPages(int npages); - int registerThreadContext(ThreadContext *tc, int assigned=-1); - void replaceThreadContext(ThreadContext *tc, int context_id); + ContextID registerThreadContext(ThreadContext *tc, + ContextID assigned = InvalidContextID); + void replaceThreadContext(ThreadContext *tc, ContextID context_id); void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; -- cgit v1.2.3