diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-08-07 09:59:13 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-08-07 09:59:13 +0100 |
commit | 53e777d6838ac3ca80e6557626f9e99fd93dd0f7 (patch) | |
tree | 9029d3e7f1e158beac24761f2c9c690b3918d734 /src/sim/system.cc | |
parent | 3e26756f1dfe1ddd1d7f5e458771c9bf79acb09a (diff) | |
download | gem5-53e777d6838ac3ca80e6557626f9e99fd93dd0f7.tar.xz |
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.
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r-- | src/sim/system.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc index c5e2e0b96..d0418d99b 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -209,11 +209,11 @@ bool System::breakpoint() */ int rgdb_wait = -1; -int -System::registerThreadContext(ThreadContext *tc, int assigned) +ContextID +System::registerThreadContext(ThreadContext *tc, ContextID assigned) { int id; - if (assigned == -1) { + if (assigned == InvalidContextID) { for (id = 0; id < threadContexts.size(); id++) { if (!threadContexts[id]) break; @@ -305,7 +305,7 @@ System::initState() } void -System::replaceThreadContext(ThreadContext *tc, int context_id) +System::replaceThreadContext(ThreadContext *tc, ContextID context_id) { if (context_id >= threadContexts.size()) { panic("replaceThreadContext: bad id, %d >= %d\n", |