From: Antonios Motakis <[email protected]> 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 <[email protected]> --- hypervisor/arch/arm64/include/asm/percpu.h | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 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..c73d756 --- /dev/null +++ b/hypervisor/arch/arm64/include/asm/percpu.h @@ -0,0 +1,65 @@ +/* + * Jailhouse AArch64 support + * + * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH + * + * Authors: + * Antonios Motakis <[email protected]> + * + * 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> +#include <asm/paging.h> + +#ifndef __ASSEMBLY__ + +#include <asm/cell.h> +#include <asm/spinlock.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; +} + +/* Validate defines */ +#define CHECK_ASSUMPTION(assume) ((void)sizeof(char[1 - 2*!(assume)])) + +static inline void __check_assumptions(void) +{ + CHECK_ASSUMPTION(sizeof(unsigned long) == (8)); +} +#endif /* !__ASSEMBLY__ */ + +#endif /* !_JAILHOUSE_ASM_PERCPU_H */ -- 2.8.0.rc3 -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
