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/cpu/thread_state.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cpu/thread_state.hh') diff --git a/src/cpu/thread_state.hh b/src/cpu/thread_state.hh index 485c9306f..bd471e13a 100644 --- a/src/cpu/thread_state.hh +++ b/src/cpu/thread_state.hh @@ -71,9 +71,9 @@ struct ThreadState : public Serializable { uint32_t socketId() const { return baseCpu->socketId(); } - int contextId() const { return _contextId; } + ContextID contextId() const { return _contextId; } - void setContextId(int id) { _contextId = id; } + void setContextId(ContextID id) { _contextId = id; } void setThreadId(ThreadID id) { _threadId = id; } @@ -153,7 +153,7 @@ struct ThreadState : public Serializable { BaseCPU *baseCpu; // system wide HW context id - int _contextId; + ContextID _contextId; // Index of hardware thread context on the CPU that this represents. ThreadID _threadId; -- cgit v1.2.3