Later we will use this function to do architecture-dependent initialisation. Like setting up the MMU on ARM(64).
Signed-off-by: Ralf Ramsauer <[email protected]> --- inmates/lib/arm-common/Makefile.lib | 2 +- inmates/lib/arm-common/setup.c | 43 +++++++++++++++++++++++++++++ inmates/lib/inmate_common.h | 2 ++ inmates/lib/setup.c | 2 ++ inmates/lib/x86/Makefile | 2 +- inmates/lib/x86/setup.c | 43 +++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 inmates/lib/arm-common/setup.c create mode 100644 inmates/lib/x86/setup.c diff --git a/inmates/lib/arm-common/Makefile.lib b/inmates/lib/arm-common/Makefile.lib index fc25f724..89889359 100644 --- a/inmates/lib/arm-common/Makefile.lib +++ b/inmates/lib/arm-common/Makefile.lib @@ -37,7 +37,7 @@ # objs-y := ../string.o ../cmdline.o ../setup.o ../alloc.o -objs-y += printk.o gic.o timer.o +objs-y += printk.o gic.o timer.o setup.o objs-y += uart-jailhouse.o uart-pl011.o uart-8250.o uart-8250-8.o objs-y += uart-xuartps.o uart-mvebu.o uart-hscif.o uart-scifa.o uart-imx.o objs-y += gic-v2.o gic-v3.o diff --git a/inmates/lib/arm-common/setup.c b/inmates/lib/arm-common/setup.c new file mode 100644 index 00000000..f79fd736 --- /dev/null +++ b/inmates/lib/arm-common/setup.c @@ -0,0 +1,43 @@ +/* + * Jailhouse, a Linux-based partitioning hypervisor + * + * Copyright (c) OTH Regensburg, 2018 + * + * Authors: + * Ralf Ramsauer <[email protected]> + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + * Alternatively, you can use or redistribute this file under the following + * BSD license: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <inmate.h> + +void arch_init_early(void) +{ +} diff --git a/inmates/lib/inmate_common.h b/inmates/lib/inmate_common.h index cdce825f..9e5bf94d 100644 --- a/inmates/lib/inmate_common.h +++ b/inmates/lib/inmate_common.h @@ -67,6 +67,8 @@ static inline void __attribute__((noreturn)) stop(void) halt(); } +void arch_init_early(void); + void printk(const char *fmt, ...); void *alloc(unsigned long size, unsigned long align); diff --git a/inmates/lib/setup.c b/inmates/lib/setup.c index feca82d1..4d007322 100644 --- a/inmates/lib/setup.c +++ b/inmates/lib/setup.c @@ -41,6 +41,8 @@ void __attribute__((noreturn)) c_entry(void); void __attribute__((noreturn)) c_entry(void) { + arch_init_early(); + /* check if the ABI version of the communication region matches */ if (comm_region->revision != COMM_REGION_ABI_REVISION || memcmp(comm_region->signature, COMM_REGION_MAGIC, diff --git a/inmates/lib/x86/Makefile b/inmates/lib/x86/Makefile index 0ae88e39..d64539e9 100644 --- a/inmates/lib/x86/Makefile +++ b/inmates/lib/x86/Makefile @@ -40,7 +40,7 @@ include $(INMATES_LIB)/Makefile.lib always := lib.a lib32.a -TARGETS := header.o hypercall.o ioapic.o printk.o smp.o +TARGETS := header.o hypercall.o ioapic.o printk.o setup.o smp.o TARGETS += ../alloc.o ../pci.o ../string.o ../cmdline.o ../setup.o TARGETS_64_ONLY := int.o mem.o pci.o timing.o diff --git a/inmates/lib/x86/setup.c b/inmates/lib/x86/setup.c new file mode 100644 index 00000000..f79fd736 --- /dev/null +++ b/inmates/lib/x86/setup.c @@ -0,0 +1,43 @@ +/* + * Jailhouse, a Linux-based partitioning hypervisor + * + * Copyright (c) OTH Regensburg, 2018 + * + * Authors: + * Ralf Ramsauer <[email protected]> + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + * Alternatively, you can use or redistribute this file under the following + * BSD license: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <inmate.h> + +void arch_init_early(void) +{ +} -- 2.17.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]. For more options, visit https://groups.google.com/d/optout.
