x86: fix dependency tracking for asm/indirect_thunk_asm.h
authorJan Beulich <jbeulich@suse.com>
Mon, 9 Jul 2018 08:49:37 +0000 (10:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 9 Jul 2018 08:49:37 +0000 (10:49 +0200)
Including the header solely at the assembler level means the compiler
can't record the header as a dependency in .*.o.d files. Arrange for the
header to be include-able at the C level instead.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/asm-x86/asm_defns.h
xen/include/asm-x86/indirect_thunk_asm.h

index f8128c096d51284baf991388aaed048e23583331..f0733f2b7c36526ad19e8402ff849a0b47b3d84f 100644 (file)
 #ifndef CONFIG_INDIRECT_THUNK
 .equ CONFIG_INDIRECT_THUNK, 0
 #endif
-# include <asm/indirect_thunk_asm.h>
 #else
 asm ( "\t.equ CONFIG_INDIRECT_THUNK, "
       __stringify(IS_ENABLED(CONFIG_INDIRECT_THUNK)) );
-asm ( "\t.include \"asm/indirect_thunk_asm.h\"" );
 #endif
+#include <asm/indirect_thunk_asm.h>
 
 #ifndef __ASSEMBLY__
 void ret_from_intr(void);
index 96bcc25497adda60a50d39d07ecc151b3b9b8490..71e6de5bf76d3799c625a7c7a26fbd3012d405c2 100644 (file)
@@ -1,7 +1,17 @@
 /*
- * Warning!  This file is included at an assembler level for .c files, causing
- * usual #ifdef'ary to turn into comments.
+ * Trickery to allow this header to be included at the C level, to permit
+ * proper dependency tracking in .*.o.d files, while still having it contain
+ * assembler only macros.
  */
+#ifndef __ASSEMBLY__
+# if 0
+  .if 0
+# endif
+asm ( "\t.include \"asm/indirect_thunk_asm.h\"" );
+# if 0
+  .endif
+# endif
+#else
 
 .macro INDIRECT_BRANCH insn:req arg:req
 /*
@@ -39,3 +49,5 @@
 .macro INDIRECT_JMP arg:req
     INDIRECT_BRANCH jmp \arg
 .endm
+
+#endif