diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2017-11-27 18:17:25 +0000 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2017-11-28 12:00:30 +0000 |
commit | e7bff655aa48da0fd1e7656bc10b66473f34aa2a (patch) | |
tree | d8b228f49c3f44bd727b5d5575d361c5cda159a2 /src/arch/arm/system.hh | |
parent | d92e96732966ee48db3f8283367c0a1ffd84c1a7 (diff) | |
download | gem5-e7bff655aa48da0fd1e7656bc10b66473f34aa2a.tar.xz |
arch-arm: Add assertions when extracting an ArmSystem from a TC
We sometimes need to cast the System pointer stored in a
ThreadContext to an ArmSystem pointer to query global
system setting.
Add an assertion to make sure that the cast resulted in a
valid pointer.
Change-Id: Id382d0c1dceefee8f74d070c205c7b43b83ab215
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/6161
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/system.hh')
-rw-r--r-- | src/arch/arm/system.hh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/arch/arm/system.hh b/src/arch/arm/system.hh index 97769337a..b81ec05f9 100644 --- a/src/arch/arm/system.hh +++ b/src/arch/arm/system.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012-2013, 2015-2016 ARM Limited + * Copyright (c) 2010, 2012-2013, 2015-2017 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -228,6 +228,12 @@ class ArmSystem : public System */ const AddrRange &m5opRange() const { return _m5opRange; } + /** + * Returns a valid ArmSystem pointer if using ARM ISA, it fails + * otherwise. + */ + static ArmSystem* getArmSystem(ThreadContext *tc); + /** Returns true if the system of a specific thread context implements the * Security Extensions */ |