__page_pool and __text_start are global vars, but there is no centralized declaratoin for them. Wredundant-decls complains in multiple places.
Signed-off-by: Andrea Bastoni <[email protected]> --- hypervisor/include/jailhouse/globals.h | 21 +++++++++++++++++++++ hypervisor/include/jailhouse/percpu.h | 3 +-- hypervisor/paging.c | 3 +-- hypervisor/setup.c | 3 +-- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 hypervisor/include/jailhouse/globals.h diff --git a/hypervisor/include/jailhouse/globals.h b/hypervisor/include/jailhouse/globals.h new file mode 100644 index 00000000..b4be2315 --- /dev/null +++ b/hypervisor/include/jailhouse/globals.h @@ -0,0 +1,21 @@ +/* + * Jailhouse, a Linux-based partitioning hypervisor + * + * Copyright (c) Siemens AG, 2013-2020 + * + * Authors: + * Jan Kiszka <[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_GLOBALS_H +#define _JAILHOUSE_GLOBALS_H + +#include <jailhouse/types.h> + +/** Global page pool and code */ +extern u8 __page_pool[]; +extern u8 __text_start[]; + +#endif diff --git a/hypervisor/include/jailhouse/percpu.h b/hypervisor/include/jailhouse/percpu.h index 344ed65f..7ff5d6bb 100644 --- a/hypervisor/include/jailhouse/percpu.h +++ b/hypervisor/include/jailhouse/percpu.h @@ -19,6 +19,7 @@ * The per-CPU subsystem provides a CPU-local state structure and accessors. */ +#include <jailhouse/globals.h> #include <jailhouse/cell.h> #include <asm/percpu.h> @@ -132,8 +133,6 @@ static inline struct cell *this_cell(void) */ static inline struct per_cpu *per_cpu(unsigned int cpu) { - extern u8 __page_pool[]; - return (struct per_cpu *)(__page_pool + cpu * sizeof(struct per_cpu)); } diff --git a/hypervisor/paging.c b/hypervisor/paging.c index 876f1521..93622d9e 100644 --- a/hypervisor/paging.c +++ b/hypervisor/paging.c @@ -10,6 +10,7 @@ * the COPYING file in the top-level directory. */ +#include <jailhouse/globals.h> #include <jailhouse/paging.h> #include <jailhouse/printk.h> #include <jailhouse/string.h> @@ -21,8 +22,6 @@ #define PAGE_SCRUB_ON_FREE 0x1 -extern u8 __page_pool[]; - /** * Offset between virtual and physical hypervisor addresses. * diff --git a/hypervisor/setup.c b/hypervisor/setup.c index 9f651aec..5db00051 100644 --- a/hypervisor/setup.c +++ b/hypervisor/setup.c @@ -10,6 +10,7 @@ * the COPYING file in the top-level directory. */ +#include <jailhouse/globals.h> #include <jailhouse/processor.h> #include <jailhouse/printk.h> #include <jailhouse/entry.h> @@ -22,8 +23,6 @@ #include <generated/version.h> #include <asm/spinlock.h> -extern u8 __text_start[], __page_pool[]; - static const __attribute__((aligned(PAGE_SIZE))) u8 empty_page[PAGE_SIZE]; static spinlock_t init_lock; -- 2.28.0 -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/20201021145404.100463-7-andrea.bastoni%40tum.de.
