From de7ddfc21c2af6768221ed90044556d9c60d1dad Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 17 Jan 2020 10:47:27 +0000 Subject: [PATCH] cpu: Mark ExecContext::tcBase() as const Change-Id: Ia3965c05a1b00e0a9738ddbccb4dc0b651f78e5e Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24523 Tested-by: kokoro --- src/cpu/base_dyn_inst.hh | 4 ++-- src/cpu/checker/cpu.hh | 4 ++-- src/cpu/exec_context.hh | 4 ++-- src/cpu/minor/exec_context.hh | 4 ++-- src/cpu/simple/exec_context.hh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cpu/base_dyn_inst.hh b/src/cpu/base_dyn_inst.hh index 85ad54404..81b39999e 100644 --- a/src/cpu/base_dyn_inst.hh +++ b/src/cpu/base_dyn_inst.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, 2016-2019 ARM Limited + * Copyright (c) 2011, 2013, 2016-2020 ARM Limited * Copyright (c) 2013 Advanced Micro Devices, Inc. * All rights reserved. * @@ -919,7 +919,7 @@ class BaseDynInst : public ExecContext, public RefCounted void setThreadState(ImplState *state) { thread = state; } /** Returns the thread context. */ - ThreadContext *tcBase() { return thread->getTC(); } + ThreadContext *tcBase() const { return thread->getTC(); } public: /** Returns whether or not the eff. addr. source registers are ready. */ diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh index 775381c28..7d3d3390a 100644 --- a/src/cpu/checker/cpu.hh +++ b/src/cpu/checker/cpu.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016-2018 ARM Limited + * Copyright (c) 2011, 2016-2018, 2020 ARM Limited * Copyright (c) 2013 Advanced Micro Devices, Inc. * All rights reserved * @@ -595,7 +595,7 @@ class CheckerCPU : public BaseCPU, public ExecContext void dumpAndExit(); - ThreadContext *tcBase() override { return tc; } + ThreadContext *tcBase() const override { return tc; } SimpleThread *threadBase() { return thread; } InstResult unverifiedResult; diff --git a/src/cpu/exec_context.hh b/src/cpu/exec_context.hh index a96ccfca3..c1af767fa 100644 --- a/src/cpu/exec_context.hh +++ b/src/cpu/exec_context.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016-2018 ARM Limited + * Copyright (c) 2014, 2016-2018, 2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -311,7 +311,7 @@ class ExecContext { /** @} */ /** Returns a pointer to the ThreadContext. */ - virtual ThreadContext *tcBase() = 0; + virtual ThreadContext *tcBase() const = 0; /** * @{ diff --git a/src/cpu/minor/exec_context.hh b/src/cpu/minor/exec_context.hh index 2b1b53054..327c0b2d0 100644 --- a/src/cpu/minor/exec_context.hh +++ b/src/cpu/minor/exec_context.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, 2016-2018 ARM Limited + * Copyright (c) 2011-2014, 2016-2018, 2020 ARM Limited * Copyright (c) 2013 Advanced Micro Devices, Inc. * All rights reserved * @@ -390,7 +390,7 @@ class ExecContext : public ::ExecContext thread.syscall(fault); } - ThreadContext *tcBase() override { return thread.getTC(); } + ThreadContext *tcBase() const override { return thread.getTC(); } /* @todo, should make stCondFailures persistent somewhere */ unsigned int readStCondFailures() const override { return 0; } diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh index 04be1a016..5924ada99 100644 --- a/src/cpu/simple/exec_context.hh +++ b/src/cpu/simple/exec_context.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 ARM Limited + * Copyright (c) 2014-2018, 2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -505,7 +505,7 @@ class SimpleExecContext : public ExecContext { } /** Returns a pointer to the ThreadContext. */ - ThreadContext *tcBase() override { return thread->getTC(); } + ThreadContext *tcBase() const override { return thread->getTC(); } bool readPredicate() const override -- 2.30.2