From: Jan Kiszka <[email protected]>

Rather than placing the arch-specific traps.h under at unusual place,
make use of includ_next to pull the common header from the prioritized
arch-specific one.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/arch/arm-common/include/asm/traps.h       |  8 --------
 hypervisor/arch/arm/include/{arch => }/asm/traps.h   | 10 ++++++++++
 hypervisor/arch/arm64/include/{arch => }/asm/traps.h | 10 ++++++++++
 3 files changed, 20 insertions(+), 8 deletions(-)
 rename hypervisor/arch/arm/include/{arch => }/asm/traps.h (69%)
 rename hypervisor/arch/arm64/include/{arch => }/asm/traps.h (69%)

diff --git a/hypervisor/arch/arm-common/include/asm/traps.h 
b/hypervisor/arch/arm-common/include/asm/traps.h
index ce3907d0..65d4cbd2 100644
--- a/hypervisor/arch/arm-common/include/asm/traps.h
+++ b/hypervisor/arch/arm-common/include/asm/traps.h
@@ -10,12 +10,6 @@
  * the COPYING file in the top-level directory.
  */

-#ifndef _JAILHOUSE_ASM_TRAPS_H
-#define _JAILHOUSE_ASM_TRAPS_H
-
-#include <jailhouse/types.h>
-#include <arch/asm/traps.h>
-
 enum trap_return {
        TRAP_HANDLED            = 1,
        TRAP_UNHANDLED          = 0,
@@ -27,5 +21,3 @@ typedef enum trap_return (*trap_handler)(struct trap_context 
*ctx);
 void arch_skip_instruction(struct trap_context *ctx);

 enum trap_return arch_handle_dabt(struct trap_context *ctx);
-
-#endif /* !_JAILHOUSE_ASM_TRAPS_H */
diff --git a/hypervisor/arch/arm/include/arch/asm/traps.h 
b/hypervisor/arch/arm/include/asm/traps.h
similarity index 69%
rename from hypervisor/arch/arm/include/arch/asm/traps.h
rename to hypervisor/arch/arm/include/asm/traps.h
index 3e02b828..99cb3ada 100644
--- a/hypervisor/arch/arm/include/arch/asm/traps.h
+++ b/hypervisor/arch/arm/include/asm/traps.h
@@ -10,6 +10,11 @@
  * the COPYING file in the top-level directory.
  */

+#ifndef _JAILHOUSE_ASM_TRAPS_H
+#define _JAILHOUSE_ASM_TRAPS_H
+
+#include <jailhouse/types.h>
+
 struct trap_context {
        unsigned long *regs;
        u32 hsr;
@@ -17,3 +22,8 @@ struct trap_context {

 void access_cell_reg(struct trap_context *ctx, u8 reg, unsigned long *val,
                     bool is_read);
+
+/* now include from arm-common */
+#include_next <asm/traps.h>
+
+#endif /* !_JAILHOUSE_ASM_TRAPS_H */
diff --git a/hypervisor/arch/arm64/include/arch/asm/traps.h 
b/hypervisor/arch/arm64/include/asm/traps.h
similarity index 69%
rename from hypervisor/arch/arm64/include/arch/asm/traps.h
rename to hypervisor/arch/arm64/include/asm/traps.h
index e2164ad9..59cb137c 100644
--- a/hypervisor/arch/arm64/include/arch/asm/traps.h
+++ b/hypervisor/arch/arm64/include/asm/traps.h
@@ -10,6 +10,11 @@
  * the COPYING file in the top-level directory.
  */

+#ifndef _JAILHOUSE_ASM_TRAPS_H
+#define _JAILHOUSE_ASM_TRAPS_H
+
+#include <jailhouse/processor.h>
+
 struct trap_context {
        unsigned long *regs;
        u64 esr;
@@ -19,3 +24,8 @@ struct trap_context {

 void arch_handle_trap(union registers *guest_regs);
 void arch_el2_abt(union registers *regs);
+
+/* now include from arm-common */
+#include_next <asm/traps.h>
+
+#endif /* !_JAILHOUSE_ASM_TRAPS_H */
--
2.16.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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/f07ebffc91fdc37ba7760eac353338c759f563e4.1577125789.git.jan.kiszka%40web.de.

Reply via email to