From: Julien Grall <julien.grall@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@citrix.com>,
ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [RFC 01/10] xen/arm: move lr, push and pop in a separate header
Date: Tue, 15 Dec 2015 17:51:59 +0000 [thread overview]
Message-ID: <1450201928-4928-2-git-send-email-julien.grall@citrix.com> (raw)
In-Reply-To: <1450201928-4928-1-git-send-email-julien.grall@citrix.com>
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@citrix.com>
---
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
next prev parent reply other threads:[~2015-12-15 17:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 17:51 [RFC 00/10] xen/arm: Implement the hypercall handling in assembly Julien Grall
2015-12-15 17:51 ` Julien Grall [this message]
2015-12-15 17:52 ` [RFC 02/10] xen/arm: Drop unused defines in asm/bug.h Julien Grall
2015-12-15 17:52 ` [RFC 03/10] xen/arm: Implement assembly version of WARN/BUG/ASSERT_FAILED Julien Grall
2015-12-15 17:52 ` [RFC 04/10] xen/arm64: Add an assembly macro for perf counter Julien Grall
2015-12-15 17:52 ` [RFC 05/10] xen/arm: gic_inject: Introduce a local variable to store current Julien Grall
2015-12-15 17:52 ` [RFC 06/10] xen/arm: gic: Allow the LRs to be cleared lazily Julien Grall
2015-12-15 17:52 ` [RFC 07/10] xen/arm: Implement the code to dispatch the hypercall in assembly Julien Grall
2015-12-15 17:52 ` [RFC 08/10] xen/arm64: Implement the hypercall handing fully " Julien Grall
2015-12-15 17:52 ` [RFC 09/10] xen/arm: Remove the C version of do_trap_hypercall Julien Grall
2015-12-15 17:52 ` [RFC 10/10] xen/arm: Factorize the C code to dispatch HVC Julien Grall
2015-12-15 18:33 ` [RFC 00/10] xen/arm: Implement the hypercall handling in assembly Andrew Cooper
2015-12-16 11:19 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450201928-4928-2-git-send-email-julien.grall@citrix.com \
--to=julien.grall@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).