summaryrefslogtreecommitdiff
path: root/src/cpu/inorder
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-03-07 15:56:23 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2014-03-07 15:56:23 -0500
commit62fe81e9c1ab09f1b401231f58d9c34008c7b558 (patch)
tree732e6ac33b6be91999dfeb3b95f1d98746146b9d /src/cpu/inorder
parentc4a8e5c36cbc30feee6ecd5c706e3275301b25ef (diff)
downloadgem5-62fe81e9c1ab09f1b401231f58d9c34008c7b558.tar.xz
cpu: Make CPU and ThreadContext getters const
This patch merely tidies up the CPU and ThreadContext getters by making them const where appropriate.
Diffstat (limited to 'src/cpu/inorder')
-rw-r--r--src/cpu/inorder/inorder_dyn_inst.cc2
-rw-r--r--src/cpu/inorder/inorder_dyn_inst.hh4
-rw-r--r--src/cpu/inorder/thread_context.hh6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/cpu/inorder/inorder_dyn_inst.cc b/src/cpu/inorder/inorder_dyn_inst.cc
index aedc630f5..86dbdf97c 100644
--- a/src/cpu/inorder/inorder_dyn_inst.cc
+++ b/src/cpu/inorder/inorder_dyn_inst.cc
@@ -91,7 +91,7 @@ InOrderDynInst::InOrderDynInst(InOrderCPU *cpu,
int InOrderDynInst::instcount = 0;
int
-InOrderDynInst::cpuId()
+InOrderDynInst::cpuId() const
{
return cpu->cpuId();
}
diff --git a/src/cpu/inorder/inorder_dyn_inst.hh b/src/cpu/inorder/inorder_dyn_inst.hh
index 48c15e292..578fd604a 100644
--- a/src/cpu/inorder/inorder_dyn_inst.hh
+++ b/src/cpu/inorder/inorder_dyn_inst.hh
@@ -357,10 +357,10 @@ class InOrderDynInst : public RefCounted
Fault getFault() { return fault; }
/** Read this CPU's ID. */
- int cpuId();
+ int cpuId() const;
/** Read this context's system-wide ID **/
- int contextId() { return thread->contextId(); }
+ int contextId() const { return thread->contextId(); }
////////////////////////////////////////////////////////////
//
diff --git a/src/cpu/inorder/thread_context.hh b/src/cpu/inorder/thread_context.hh
index b1a361027..96ec063c8 100644
--- a/src/cpu/inorder/thread_context.hh
+++ b/src/cpu/inorder/thread_context.hh
@@ -111,14 +111,14 @@ class InOrderThreadContext : public ThreadContext
std::string getCpuName() { return cpu->name(); }
/** Reads this CPU's ID. */
- int cpuId() { return cpu->cpuId(); }
+ int cpuId() const { return cpu->cpuId(); }
- int contextId() { return thread->contextId(); }
+ int contextId() const { return thread->contextId(); }
void setContextId(int id) { thread->setContextId(id); }
/** Returns this thread's ID number. */
- int threadId() { return thread->threadId(); }
+ int threadId() const { return thread->threadId(); }
void setThreadId(int id) { return thread->setThreadId(id); }
uint64_t readMicroPC()