diff mbox series

[v2,01/35] xen/arm64: macros: Introduce an assembly macro to alias x30

Message ID 20190722213958.5761-2-julien.grall@arm.com (mailing list archive)
State Superseded
Headers show
Series xen/arm: Rework head.S to make it more compliant with the Arm Arm | expand

Commit Message

Julien Grall July 22, 2019, 9:39 p.m. UTC
The return address of a function is always stored in x30. For convenience,
introduce a register alias so "lr" can be used in assembly.

This is defined in asm-arm/arm64/macros.h to allow all assembly files
to use it.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    Changes in v2:
        - Patch added
---
 xen/arch/arm/arm64/entry.S         | 5 -----
 xen/include/asm-arm/arm64/macros.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Volodymyr Babchuk July 26, 2019, 2:28 p.m. UTC | #1
Julien Grall writes:

> The return address of a function is always stored in x30. For convenience,
> introduce a register alias so "lr" can be used in assembly.
>
> This is defined in asm-arm/arm64/macros.h to allow all assembly files
> to use it.
>
> Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

>
> ---
>     Changes in v2:
>         - Patch added
> ---
>  xen/arch/arm/arm64/entry.S         | 5 -----
>  xen/include/asm-arm/arm64/macros.h | 5 +++++
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
> index 97b05f53ea..2d9a2713a1 100644
> --- a/xen/arch/arm/arm64/entry.S
> +++ b/xen/arch/arm/arm64/entry.S
> @@ -7,11 +7,6 @@
>  #include <public/xen.h>
>  
>  /*
> - * Register aliases.
> - */
> -lr      .req    x30             /* link register */
> -
> -/*
>   * Stack pushing/popping (register pairs only). Equivalent to store decrement
>   * before, load increment after.
>   */
> diff --git a/xen/include/asm-arm/arm64/macros.h b/xen/include/asm-arm/arm64/macros.h
> index 9c5e676b37..f981b4f43e 100644
> --- a/xen/include/asm-arm/arm64/macros.h
> +++ b/xen/include/asm-arm/arm64/macros.h
> @@ -21,5 +21,10 @@
>      ldr     \dst, [\dst, \tmp]
>      .endm
>  
> +/*
> + * Register aliases.
> + */
> +lr      .req    x30             /* link register */
> +
>  #endif /* __ASM_ARM_ARM64_MACROS_H */
Stefano Stabellini July 29, 2019, 11:11 p.m. UTC | #2
On Mon, 22 Jul 2019, Julien Grall wrote:
> The return address of a function is always stored in x30. For convenience,
> introduce a register alias so "lr" can be used in assembly.
> 
> This is defined in asm-arm/arm64/macros.h to allow all assembly files
> to use it.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

and committed


> ---
>     Changes in v2:
>         - Patch added
> ---
>  xen/arch/arm/arm64/entry.S         | 5 -----
>  xen/include/asm-arm/arm64/macros.h | 5 +++++
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
> index 97b05f53ea..2d9a2713a1 100644
> --- a/xen/arch/arm/arm64/entry.S
> +++ b/xen/arch/arm/arm64/entry.S
> @@ -7,11 +7,6 @@
>  #include <public/xen.h>
>  
>  /*
> - * Register aliases.
> - */
> -lr      .req    x30             /* link register */
> -
> -/*
>   * Stack pushing/popping (register pairs only). Equivalent to store decrement
>   * before, load increment after.
>   */
> diff --git a/xen/include/asm-arm/arm64/macros.h b/xen/include/asm-arm/arm64/macros.h
> index 9c5e676b37..f981b4f43e 100644
> --- a/xen/include/asm-arm/arm64/macros.h
> +++ b/xen/include/asm-arm/arm64/macros.h
> @@ -21,5 +21,10 @@
>      ldr     \dst, [\dst, \tmp]
>      .endm
>  
> +/*
> + * Register aliases.
> + */
> +lr      .req    x30             /* link register */
> +
>  #endif /* __ASM_ARM_ARM64_MACROS_H */
>  
> -- 
> 2.11.0
>
diff mbox series

Patch

diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index 97b05f53ea..2d9a2713a1 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -7,11 +7,6 @@ 
 #include <public/xen.h>
 
 /*
- * Register aliases.
- */
-lr      .req    x30             /* link register */
-
-/*
  * Stack pushing/popping (register pairs only). Equivalent to store decrement
  * before, load increment after.
  */
diff --git a/xen/include/asm-arm/arm64/macros.h b/xen/include/asm-arm/arm64/macros.h
index 9c5e676b37..f981b4f43e 100644
--- a/xen/include/asm-arm/arm64/macros.h
+++ b/xen/include/asm-arm/arm64/macros.h
@@ -21,5 +21,10 @@ 
     ldr     \dst, [\dst, \tmp]
     .endm
 
+/*
+ * Register aliases.
+ */
+lr      .req    x30             /* link register */
+
 #endif /* __ASM_ARM_ARM64_MACROS_H */