traps.h are almost the same for both arm architectures. The only differences are struct traps_context and an additional routine (access_cell_regs) on armv7.
Common routines and definitions have their home inside arm-common, so de-duplicate redundant definitions and give them a new home. No functional change. Signed-off-by: Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de> --- .../{arm64 => arm-common}/include/asm/traps.h | 14 ++++--------- .../arch/arm/include/{ => arch}/asm/traps.h | 21 ------------------- .../arch/arm64/include/arch/asm/traps.h | 18 ++++++++++++++++ 3 files changed, 22 insertions(+), 31 deletions(-) rename hypervisor/arch/{arm64 => arm-common}/include/asm/traps.h (70%) rename hypervisor/arch/arm/include/{ => arch}/asm/traps.h (51%) create mode 100644 hypervisor/arch/arm64/include/arch/asm/traps.h diff --git a/hypervisor/arch/arm64/include/asm/traps.h b/hypervisor/arch/arm-common/include/asm/traps.h similarity index 70% rename from hypervisor/arch/arm64/include/asm/traps.h rename to hypervisor/arch/arm-common/include/asm/traps.h index 4b7e40d5..e72d9fb9 100644 --- a/hypervisor/arch/arm64/include/asm/traps.h +++ b/hypervisor/arch/arm-common/include/asm/traps.h @@ -1,10 +1,10 @@ /* - * Jailhouse AArch64 support + * Jailhouse, a Linux-based partitioning hypervisor * - * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH + * Copyright (c) OTH Regensburg, 2018 * * Authors: - * Antonios Motakis <antonios.mota...@huawei.com> + * Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de> * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. @@ -14,6 +14,7 @@ #define _JAILHOUSE_ASM_TRAPS_H #include <jailhouse/types.h> +#include <arch/asm/traps.h> enum trap_return { TRAP_HANDLED = 1, @@ -21,13 +22,6 @@ enum trap_return { TRAP_FORBIDDEN = -1, }; -struct trap_context { - unsigned long *regs; - u64 esr; - u64 spsr; - u64 sp; -}; - typedef int (*trap_handler)(struct trap_context *ctx); void arch_skip_instruction(struct trap_context *ctx); diff --git a/hypervisor/arch/arm/include/asm/traps.h b/hypervisor/arch/arm/include/arch/asm/traps.h similarity index 51% rename from hypervisor/arch/arm/include/asm/traps.h rename to hypervisor/arch/arm/include/arch/asm/traps.h index 437e08fe..3e02b828 100644 --- a/hypervisor/arch/arm/include/asm/traps.h +++ b/hypervisor/arch/arm/include/arch/asm/traps.h @@ -10,31 +10,10 @@ * the COPYING file in the top-level directory. */ -#ifndef _JAILHOUSE_ASM_TRAPS_H -#define _JAILHOUSE_ASM_TRAPS_H - -#include <jailhouse/types.h> - -#ifndef __ASSEMBLY__ - -enum trap_return { - TRAP_HANDLED = 1, - TRAP_UNHANDLED = 0, - TRAP_FORBIDDEN = -1, -}; - struct trap_context { unsigned long *regs; u32 hsr; }; -typedef int (*trap_handler)(struct trap_context *ctx); - void access_cell_reg(struct trap_context *ctx, u8 reg, unsigned long *val, bool is_read); -void arch_skip_instruction(struct trap_context *ctx); - -int arch_handle_dabt(struct trap_context *ctx); - -#endif /* !__ASSEMBLY__ */ -#endif /* !_JAILHOUSE_ASM_TRAPS_H */ diff --git a/hypervisor/arch/arm64/include/arch/asm/traps.h b/hypervisor/arch/arm64/include/arch/asm/traps.h new file mode 100644 index 00000000..aec6de5a --- /dev/null +++ b/hypervisor/arch/arm64/include/arch/asm/traps.h @@ -0,0 +1,18 @@ +/* + * 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. + */ + +struct trap_context { + unsigned long *regs; + u64 esr; + u64 spsr; + u64 sp; +}; -- 2.19.1 -- 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.