diff options
Diffstat (limited to 'configs/common/CpuConfig.py')
-rw-r--r-- | configs/common/CpuConfig.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py index 3f193ae60..d70e6cfa7 100644 --- a/configs/common/CpuConfig.py +++ b/configs/common/CpuConfig.py @@ -1,4 +1,4 @@ -# Copyright (c) 2012, 2017 ARM Limited +# Copyright (c) 2012, 2017-2018 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -59,6 +59,17 @@ def is_cpu_class(cls): except (TypeError, AttributeError): return False +def _cpu_subclass_tester(name): + cpu_class = getattr(m5.objects, name, None) + + def tester(cls): + return cpu_class is not None and cls is not None and \ + issubclass(cls, cpu_class) + + return tester + +is_kvm_cpu = _cpu_subclass_tester("BaseKvmCPU") + def get(name): """Get a CPU class from a user provided class name or alias.""" |