arch-arm: generic method for getting an ArmSystem
This patch provides a generic method for casting a System object into an ArmSystem object. This is specially useful in dev-arm, since devices by default obtain a generic System reference which needs to be casted to use ArmSystem-specific functionality. Change-Id: Ib100002413cb48cd93772dcf38f13be65badd1d3 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22426 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Giacomo Travaglini
parent
092ab7f5ca
commit
3783d65369
@@ -174,6 +174,14 @@ ArmSystem::initState()
|
||||
}
|
||||
}
|
||||
|
||||
ArmSystem *
|
||||
ArmSystem::getArmSystem(System *sys)
|
||||
{
|
||||
ArmSystem *a_sys = dynamic_cast<ArmSystem *>(sys);
|
||||
assert(a_sys);
|
||||
return a_sys;
|
||||
}
|
||||
|
||||
ArmSystem*
|
||||
ArmSystem::getArmSystem(ThreadContext *tc)
|
||||
{
|
||||
|
||||
@@ -284,6 +284,13 @@ class ArmSystem : public System
|
||||
/** Is Arm Semihosting support enabled? */
|
||||
bool haveSemihosting() const { return semihosting != nullptr; }
|
||||
|
||||
/**
|
||||
* Casts the provided System object into a valid ArmSystem, it fails
|
||||
* otherwise.
|
||||
* @param sys System object to cast
|
||||
*/
|
||||
static ArmSystem *getArmSystem(System *sys);
|
||||
|
||||
/**
|
||||
* Returns a valid ArmSystem pointer if using ARM ISA, it fails
|
||||
* otherwise.
|
||||
|
||||
Reference in New Issue
Block a user