From: Antonios Motakis <antonios.mota...@huawei.com> Add the percpu.h header file for the AArch64 implementation. This is the bare bones version of the header needed to compile a stub hypervisor binary on AArch64. A lot of these fields could probably be moved to an arch independent header.
Signed-off-by: Antonios Motakis <antonios.mota...@huawei.com> [Jan: adjust includes, remove obsolete CHECK_ASSUMPTION] Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- hypervisor/arch/arm64/include/asm/percpu.h | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 hypervisor/arch/arm64/include/asm/percpu.h diff --git a/hypervisor/arch/arm64/include/asm/percpu.h b/hypervisor/arch/arm64/include/asm/percpu.h new file mode 100644 index 0000000..62e3e16 --- /dev/null +++ b/hypervisor/arch/arm64/include/asm/percpu.h @@ -0,0 +1,55 @@ +/* + * Jailhouse AArch64 support + * + * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH + * + * Authors: + * Antonios Motakis <antonios.mota...@huawei.com> + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + */ + +#ifndef _JAILHOUSE_ASM_PERCPU_H +#define _JAILHOUSE_ASM_PERCPU_H + +#include <jailhouse/types.h> + +#ifndef __ASSEMBLY__ + +#include <jailhouse/cell.h> + +struct per_cpu { + /* common fields */ + unsigned int cpu_id; + struct cell *cell; + u32 stats[JAILHOUSE_NUM_CPU_STATS]; + int shutdown_state; + bool failed; + + bool flush_vcpu_caches; +} __attribute__((aligned(PAGE_SIZE))); + +static inline struct per_cpu *this_cpu_data(void) +{ + while (1); + return NULL; +} + +#define DEFINE_PER_CPU_ACCESSOR(field) \ +static inline typeof(((struct per_cpu *)0)->field) this_##field(void) \ +{ \ + return this_cpu_data()->field; \ +} + +DEFINE_PER_CPU_ACCESSOR(cpu_id) +DEFINE_PER_CPU_ACCESSOR(cell) + +static inline struct per_cpu *per_cpu(unsigned int cpu) +{ + while (1); + return NULL; +} +#endif /* !__ASSEMBLY__ */ + +#endif /* !_JAILHOUSE_ASM_PERCPU_H */ -- 2.1.4 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to jailhouse-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.