]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: Include asm/asm-offsets.h and asm/macros.h on every assembly files
authorJulien Grall <jgrall@amazon.com>
Sat, 23 Jan 2021 17:48:45 +0000 (17:48 +0000)
committerJulien Grall <jgrall@amazon.com>
Sun, 18 Apr 2021 17:59:54 +0000 (18:59 +0100)
In a follow-up patch we may want to automatically replace some
mnemonics (such as ret) with a different sequence.

To ensure all the assembly files will include asm/macros.h it is best to
automatically include it on single assembly. This can be done via
config.h.

It was necessary to include a few more headers as dependency:
  - <asm/asm_defns.h> to define sizeof_*
  - <xen/page-size.h> which is already a latent issue given STACK_ORDER
  rely on PAGE_SIZE.

Unfortunately the build system will use -D__ASSEMBLY__ when generating
the linker script. A new option -D__LINKER__ is introduceed and used for
the linker script to avoid including headers (such as asm/macros.h) that
may not be compatible with the syntax.

Lastly, take the opportunity to remove both asm/asm-offsets.h and
asm/macros.h from the various assembly files as they are now
automagically included.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/Makefile
xen/arch/arm/arm32/entry.S
xen/arch/arm/arm32/head.S
xen/arch/arm/arm32/proc-v7.S
xen/arch/arm/arm64/debug-cadence.inc
xen/arch/arm/arm64/debug-pl011.inc
xen/arch/arm/arm64/entry.S
xen/arch/arm/arm64/head.S
xen/arch/arm/arm64/smc.S
xen/include/asm-arm/config.h

index 46e6a95fec981b45c3120b5b6346340720062400..ca75f1040dcc140d617a9f4012c84884fbcd150e 100644 (file)
@@ -134,7 +134,7 @@ asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
        $(CC) $(filter-out -flto,$(c_flags)) -S -o $@ $<
 
 xen.lds: xen.lds.S
-       $(CPP) -P $(a_flags) -MQ $@ -o $@ $<
+       $(CPP) -P $(a_flags) -D__LINKER__ -MQ $@ -o $@ $<
 
 dtb.o: $(patsubst "%",%,$(CONFIG_DTB_FILE))
 
index b228d44b190c5233feccce445bc5aecb6ea4f0c0..f2f1bc7a31584bd353c884a15e074a42b9ecc80d 100644 (file)
@@ -1,4 +1,3 @@
-#include <asm/asm_defns.h>
 #include <asm/sysregs.h>
 #include <asm/regs.h>
 #include <asm/alternative.h>
index 50f019ed98eaeebadb7fab73c4eb89d08080c12c..7178865f48c363e0c8674f9affd53788bdef723a 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #include <asm/page.h>
-#include <asm/asm_defns.h>
 #include <asm/early_printk.h>
 
 #define ZIMAGE_MAGIC_NUMBER 0x016f2818
index 46bfc7a9074c4d24b46a457110faf78b4ee9390f..1efde2d72da0a8d3d603e3477f50fc18fcd34ad6 100644 (file)
@@ -17,7 +17,6 @@
  * GNU General Public License for more details.
  */
 
-#include <asm/asm_defns.h>
 #include <asm/arm32/processor.h>
 #include <asm/sysregs.h>
 
index 7df0abe4756f9ce74cccfba3ae2f08c31227666c..0b6f2e094e1824029848d2936929d1508a9dd927 100644 (file)
@@ -17,7 +17,6 @@
  * GNU General Public License for more details.
  */
 
-#include <asm/asm_defns.h>
 #include <asm/cadence-uart.h>
 
 /*
index 385deff49b1bfc8e53cfa9e544df46b5a682334d..1928a2e3ffbb47f7208f5ad91d7c449833bc6be0 100644 (file)
@@ -16,8 +16,6 @@
  * GNU General Public License for more details.
  */
 
-#include <asm/asm_defns.h>
-
 /*
  * PL011 UART initialization
  * xb: register which containts the UART base address
index 175ea2981e72ff487a81275ededa67c4e978c64e..ab9a65fc14757b671cb1c1112f132b57f19f4956 100644 (file)
@@ -1,6 +1,4 @@
-#include <asm/asm_defns.h>
 #include <asm/current.h>
-#include <asm/macros.h>
 #include <asm/regs.h>
 #include <asm/alternative.h>
 #include <asm/smccc.h>
index f38a8dfca7dc62d6afbd3ffb99bf56179d7c9d14..aa1f88c76498882227596a17433547c1c0407767 100644 (file)
  */
 
 #include <asm/page.h>
-#include <asm/asm_defns.h>
 #include <asm/early_printk.h>
 #include <efi/efierr.h>
 #include <asm/arm64/efibind.h>
-#include <asm/arm64/macros.h>
 
 #define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
 #define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
index b0752be57e8f842e73c0c498604a016303eb328b..91bae62dd4d2372b42fbe5399fb515dea8355f97 100644 (file)
@@ -13,9 +13,6 @@
  * GNU General Public License for more details.
  */
 
-#include <asm/asm_defns.h>
-#include <asm/macros.h>
-
 /*
  * void __arm_smccc_1_0_smc(register_t a0, register_t a1, register_t a2,
  *                          register_t a3, register_t a4, register_t a5,
index 5c10c755db46ef7cf4bd3c5e4892fa297640c651..c7b77912013ea8eb275d5d53bcdec0c0e46cc473 100644 (file)
@@ -69,6 +69,7 @@
 #endif
 
 #include <xen/const.h>
+#include <xen/page-size.h>
 
 /*
  * Common ARM32 and ARM64 layout:
@@ -190,6 +191,11 @@ extern unsigned long frametable_virt_end;
 #define watchdog_disable() ((void)0)
 #define watchdog_enable()  ((void)0)
 
+#if defined(__ASSEMBLY__) && !defined(__LINKER__)
+#include <asm/asm_defns.h>
+#include <asm/macros.h>
+#endif
+
 #endif /* __ARM_CONFIG_H__ */
 /*
  * Local variables: