[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC 01/10] xen/arm: move lr, push and pop in a separate header



The shorthand lr and the macros push/pop are useful for any assembly
code.

Move them in asm/arm64/asm_defns.h

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
 xen/arch/arm/arm64/entry.S            | 17 -----------------
 xen/include/asm-arm/arm64/asm_defns.h | 26 ++++++++++++++++++++++++++
 xen/include/asm-arm/asm_defns.h       |  3 +++
 3 files changed, 29 insertions(+), 17 deletions(-)
 create mode 100644 xen/include/asm-arm/arm64/asm_defns.h

diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index 9cda8f1..2b9d4cd 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -4,23 +4,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.
- */
-        .macro  push, xreg1, xreg2
-        stp     \xreg1, \xreg2, [sp, #-16]!
-        .endm
-
-        .macro  pop, xreg1, xreg2
-        ldp     \xreg1, \xreg2, [sp], #16
-        .endm
-
-/*
  * Save/restore guest mode specific state, outer stack frame
  */
         .macro  entry_guest, compat
diff --git a/xen/include/asm-arm/arm64/asm_defns.h 
b/xen/include/asm-arm/arm64/asm_defns.h
new file mode 100644
index 0000000..7085c26
--- /dev/null
+++ b/xen/include/asm-arm/arm64/asm_defns.h
@@ -0,0 +1,26 @@
+#ifndef __ASM_ARM_ARM64_DEFNS_H__
+#define __ASM_ARM_ARM64_DEFNS_H__
+
+#ifdef __ASSEMBLY__
+
+/*
+ * Register aliases.
+ */
+lr      .req    x30             // link register
+
+/*
+ * Stack pushing/popping (register pairs only). Equivalent to store decrement
+ * before, load increment after.
+ */
+.macro  push, xreg1, xreg2
+stp     \xreg1, \xreg2, [sp, #-16]!
+.endm
+
+.macro  pop, xreg1, xreg2
+ldp     \xreg1, \xreg2, [sp], #16
+.endm
+
+#endif /* !__ASSEMBLY__ */
+
+
+#endif /* __ASM_ARM_ARM64_DEFNS_H__ */
diff --git a/xen/include/asm-arm/asm_defns.h b/xen/include/asm-arm/asm_defns.h
index 02be83e..365263b 100644
--- a/xen/include/asm-arm/asm_defns.h
+++ b/xen/include/asm-arm/asm_defns.h
@@ -12,6 +12,9 @@
 # define __OP32
 #elif defined(CONFIG_ARM_64)
 # define __OP32 "w"
+
+# include <asm/arm64/asm_defns.h>
+
 #else
 # error "unknown ARM variant"
 #endif
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.