1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-25 05:57:51 +00:00

module/hotplug: Add list_hotpluggable_cpus helper

This is similar to the list_{online/offline}_cpus helpers from Target
This commit is contained in:
Valentin Schneider 2018-08-23 14:11:10 +01:00 committed by Marc Bonnici
parent 63d2fb53fc
commit 66be73be3e

@ -35,6 +35,10 @@ class HotplugModule(Module):
cpu = 'cpu{}'.format(cpu)
return target.path.join(cls.base_path, cpu, 'online')
def list_hotpluggable_cpus(self):
return [cpu for cpu in range(self.target.number_of_cpus)
if self.target.file_exists(self._cpu_path(self.target, cpu))]
def online_all(self):
self.target._execute_util('hotplug_online_all', # pylint: disable=protected-access
as_root=self.target.is_rooted)