xen/arm64: head: Move earlyprintk messages in .rodata.str
authorJulien Grall <julien.grall@arm.com>
Sat, 13 Apr 2019 16:25:16 +0000 (17:25 +0100)
committerJulien Grall <julien.grall@arm.com>
Wed, 29 May 2019 17:35:08 +0000 (18:35 +0100)
At the moment, the earlyprintk messages are interleaved with the
instructions. This makes more difficult to read the objdump output.

Introduce a new macro to add a string in .rodata.str and use it for all
the earlyprintk messages.

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/arch/arm/arm64/head.S
xen/include/asm-arm/asm_defns.h

index 87a8f27fcf946a8895402f272311e5cc259b64c0..a7ef0d7759070702c6cd59beb3aabf0127f8babb 100644 (file)
 /* Macro to print a string to the UART, if there is one.
  * Clobbers x0-x3. */
 #ifdef CONFIG_EARLY_PRINTK
-#define PRINT(_s)       \
-        adr   x0, 98f ; \
-        bl    puts    ; \
-        b     99f     ; \
-98:     .asciz _s     ; \
-        .align 2      ; \
-99:
+#define PRINT(_s)           \
+        adr   x0, 98f ;     \
+        bl    puts    ;     \
+        RODATA_STR(98, _s)
 #else /* CONFIG_EARLY_PRINTK */
 #define PRINT(s)
 #endif /* !CONFIG_EARLY_PRINTK */
@@ -641,8 +638,7 @@ init_uart:
 #endif
         adr   x0, 1f
         b     puts
-1:      .asciz "- UART enabled -\r\n"
-        .align 4
+RODATA_STR(1, "- UART enabled -\r\n")
 
 /* Print early debug messages.
  * x0: Nul-terminated string to print.
index 02be83e2b395dd6363ecab0a60823251b3c1cade..3f21def0ab2e625cda6a9163ad34ea8951c4f397 100644 (file)
 # error "unknown ARM variant"
 #endif
 
+#define RODATA_STR(label, msg)                  \
+.pushsection .rodata.str, "aMS", %progbits, 1 ; \
+label:  .asciz msg;                             \
+.popsection
+
 #endif /* __ARM_ASM_DEFNS_H__ */
 /*
  * Local variables: