[xen staging] x86: fix dependency tracking for asm/indirect_thunk_asm.h

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen staging] x86: fix dependency tracking for asm/indirect_thunk_asm.h

patchbot
commit 8a36fdafe6415210ec2c64f83407af79ac7a88c7
Author:     Jan Beulich <[hidden email]>
AuthorDate: Mon Jul 9 10:49:37 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Mon Jul 9 10:49:37 2018 +0200

    x86: fix dependency tracking for asm/indirect_thunk_asm.h
   
    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 <[hidden email]>
    Reviewed-by: Wei Liu <[hidden email]>
    Acked-by: Andrew Cooper <[hidden email]>
---
 xen/include/asm-x86/asm_defns.h          |  3 +--
 xen/include/asm-x86/indirect_thunk_asm.h | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index f8128c096d..f0733f2b7c 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -18,12 +18,11 @@
 #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);
diff --git a/xen/include/asm-x86/indirect_thunk_asm.h b/xen/include/asm-x86/indirect_thunk_asm.h
index 96bcc25497..71e6de5bf7 100644
--- a/xen/include/asm-x86/indirect_thunk_asm.h
+++ b/xen/include/asm-x86/indirect_thunk_asm.h
@@ -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
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog