2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) ARM Limited, 2014
7 * Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #include <jailhouse/control.h>
14 #include <jailhouse/processor.h>
15 #include <jailhouse/string.h>
16 #include <jailhouse/types.h>
17 #include <asm/control.h>
18 #include <asm/percpu.h>
19 #include <asm/sysregs.h>
21 unsigned long phys_processor_id(void)
25 arm_read_sysreg(MPIDR_EL1, mpidr);
26 return mpidr & MPIDR_CPUID_MASK;
29 unsigned int arm_cpu_by_mpidr(struct cell *cell, unsigned long mpidr)
33 for_each_cpu(cpu, cell->cpu_set)
34 if (mpidr == (per_cpu(cpu)->mpidr & MPIDR_CPUID_MASK))