]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
xen/arm: Move VABORT_GEN_BY_GUEST to traps.h and turned into inline
authorJulien Grall <julien.grall@arm.com>
Wed, 31 Oct 2018 18:12:58 +0000 (18:12 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 9 Nov 2018 18:14:24 +0000 (10:14 -0800)
The macro VABORT_GEN_BY_GUEST is only used by the trap code. So move it
to trap.h.

While moving the code, convert is to a static inline to allow typecheck.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/processor.h
xen/include/asm-arm/traps.h

index bdce0df122f1de5026e92bd5704dada6092cc499..3f40468bfd6914ccf8861176551c13cdab36f6e0 100644 (file)
@@ -684,16 +684,6 @@ void do_trap_guest_serror(struct cpu_user_regs *regs);
 
 register_t get_default_hcr_flags(void);
 
-/* Functions for pending virtual abort checking window. */
-void abort_guest_exit_start(void);
-void abort_guest_exit_end(void);
-
-#define VABORT_GEN_BY_GUEST(r)  \
-( \
-    ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \
-    ( (unsigned long)abort_guest_exit_end == (r)->pc ) \
-)
-
 /*
  * Synchronize SError unless the feature is selected.
  * This is relying on the SErrors are currently unmasked.
index d30ee1e01e4106dc0bbc863a8493fc68f6ac0b57..a0406b5a3c56f61684fb634c2559f21c536ab0dd 100644 (file)
@@ -45,6 +45,16 @@ void do_trap_hvc_smccc(struct cpu_user_regs *regs);
 
 int do_bug_frame(const struct cpu_user_regs *regs, vaddr_t pc);
 
+/* Functions for pending virtual abort checking window. */
+void abort_guest_exit_start(void);
+void abort_guest_exit_end(void);
+
+static inline bool VABORT_GEN_BY_GUEST(const struct cpu_user_regs *regs)
+{
+    return ((unsigned long)abort_guest_exit_start == regs->pc) ||
+        (unsigned long)abort_guest_exit_end == regs->pc;
+}
+
 #endif /* __ASM_ARM_TRAPS__ */
 /*
  * Local variables: