diff mbox series

[Xen-devel,for-4.13,v4,15/19] xen/arm: Allow insn.h to be called from assembly

Message ID 20191031150922.22938-16-julien.grall@arm.com
State New
Headers show
Series xen/arm: XSA-201 and XSA-263 fixes | expand

Commit Message

Julien Grall Oct. 31, 2019, 3:09 p.m. UTC
A follow-up patch will require to include insn.h from assembly code. So
we need to protect any C-specific definition to avoid compilation
errors when used in assembly code.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

---

    Changes in v3:
        - Add Stefano's reviewed-by

    Changes in v2:
        - Fix typo
        - Remove in-code comment
---
 xen/include/asm-arm/insn.h | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/xen/include/asm-arm/insn.h b/xen/include/asm-arm/insn.h
index 19277212e1..27271e95f9 100644
--- a/xen/include/asm-arm/insn.h
+++ b/xen/include/asm-arm/insn.h
@@ -1,6 +1,8 @@ 
 #ifndef __ARCH_ARM_INSN
 #define __ARCH_ARM_INSN
 
+#ifndef __ASSEMBLY__
+
 #include <xen/types.h>
 
 #if defined(CONFIG_ARM_64)
@@ -11,6 +13,8 @@ 
 # error "unknown ARM variant"
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /* On ARM32,64 instructions are always 4 bytes long. */
 #define ARCH_PATCH_INSN_SIZE 4